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: 4,462 bytes, lines 287-371
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"); 301 302 303function _typeof(obj) { 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); } 304 305function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 306 307function _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); } } 308 309function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 310 311function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 312 313function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 314 315function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 316 317function _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); } 318 319function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 320 321 322 323 324/** 325 * Abide module. 326 * @module foundation.abide 327 */ 328 329var Abide = 330/*#__PURE__*/ 331function (_Plugin) { 332 _inherits(Abide, _Plugin); 333 334 function Abide() { 335 _classCallCheck(this, Abide); 336 337 return _possibleConstructorReturn(this, _getPrototypeOf(Abide).apply(this, arguments)); 338 } 339 340 _createClass(Abide, [{ 341 key: "_setup", 342 343 /** 344 * Creates a new instance of Abide. 345 * @class 346 * @name Abide 347 * @fires Abide#init 348 * @param {Object} element - jQuery object to add the trigger to. 349 * @param {Object} options - Overrides to the default plugin settings. 350 */ 351 value: function _setup(element) { 352 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 353 this.$element = element; 354 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(true, {}, Abide.defaults, this.$element.data(), options); 355 this.isEnabled = true; 356 this.formnovalidate = null; 357 this.className = 'Abide'; // ie9 back compat 358 359 this._init(); 360 } 361 /** 362 * Initializes the Abide plugin and calls functions to get Abide functioning on load. 363 * @private 364 */ 365 366 }, { 367 key: "_init", 368 value: function _init() { 369 var _this2 = this; 370 371 this.$inputs = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.merge
vendor: 29,410 bytes, lines 371-1217
371( // Consider as input to validate: 372 this.$element.find('input').not('[type="submit"]'), // * all input fields expect submit 373 this.$element.find('textarea, select') // * all textareas and select fields 374 ); 375 this.$submits = this.$element.find('[type="submit"]'); 376 var $globalErrors = this.$element.find('[data-abide-error]'); // Add a11y attributes to all fields 377 378 if (this.options.a11yAttributes) { 379 this.$inputs.each(function (i, input) { 380 return _this2.addA11yAttributes(jquery__WEBPACK_IMPORTED_MODULE_0___default()(input)); 381 }); 382 $globalErrors.each(function (i, error) { 383 return _this2.addGlobalErrorA11yAttributes(jquery__WEBPACK_IMPORTED_MODULE_0___default()(error)); 384 }); 385 } 386 387 this._events(); 388 } 389 /** 390 * Initializes events for Abide. 391 * @private 392 */ 393 394 }, { 395 key: "_events", 396 value: function _events() { 397 var _this3 = this; 398 399 this.$element.off('.abide').on('reset.zf.abide', function () { 400 _this3.resetForm(); 401 }).on('submit.zf.abide', function () { 402 return _this3.validateForm(); 403 }); 404 this.$submits.off('click.zf.abide keydown.zf.abide').on('click.zf.abide keydown.zf.abide', function (e) { 405 if (!e.key || e.key === ' ' || e.key === 'Enter') { 406 e.preventDefault(); 407 _this3.formnovalidate = e.target.getAttribute('formnovalidate') !== null; 408 409 _this3.$element.submit(); 410 } 411 }); 412 413 if (this.options.validateOn === 'fieldChange') { 414 this.$inputs.off('change.zf.abide').on('change.zf.abide', function (e) { 415 _this3.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target)); 416 }); 417 } 418 419 if (this.options.liveValidate) { 420 this.$inputs.off('input.zf.abide').on('input.zf.abide', function (e) { 421 _this3.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target)); 422 }); 423 } 424 425 if (this.options.validateOnBlur) { 426 this.$inputs.off('blur.zf.abide').on('blur.zf.abide', function (e) { 427 _this3.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target)); 428 }); 429 } 430 } 431 /** 432 * Calls necessary functions to update Abide upon DOM change 433 * @private 434 */ 435 436 }, { 437 key: "_reflow", 438 value: function _reflow() { 439 this._init(); 440 } 441 /** 442 * Checks whether the submitted form should be validated or not, consodering formnovalidate and isEnabled 443 * @returns {Boolean} 444 * @private 445 */ 446 447 }, { 448 key: "_validationIsDisabled", 449 value: function _validationIsDisabled() { 450 if (this.isEnabled === false) { 451 // whole validation disabled 452 return true; 453 } else if (typeof this.formnovalidate === 'boolean') { 454 // triggered by $submit 455 return this.formnovalidate; 456 } // triggered by Enter in non-submit input 457 458 459 return this.$submits.length ? this.$submits[0].getAttribute('formnovalidate') !== null : false; 460 } 461 /** 462 * Enables the whole validation 463 */ 464 465 }, { 466 key: "enableValidation", 467 value: function enableValidation() { 468 this.isEnabled = true; 469 } 470 /** 471 * Disables the whole validation 472 */ 473 474 }, { 475 key: "disableValidation", 476 value: function disableValidation() { 477 this.isEnabled = false; 478 } 479 /** 480 * Checks whether or not a form element has the required attribute and if it's checked or not 481 * @param {Object} element - jQuery object to check for required attribute 482 * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty 483 */ 484 485 }, { 486 key: "requiredCheck", 487 value: function requiredCheck($el) { 488 if (!$el.attr('required')) return true; 489 var isGood = true; 490 491 switch ($el[0].type) { 492 case 'checkbox': 493 isGood = $el[0].checked; 494 break; 495 496 case 'select': 497 case 'select-one': 498 case 'select-multiple': 499 var opt = $el.find('option:selected'); 500 if (!opt.length || !opt.val()) isGood = false; 501 break; 502 503 default: 504 if (!$el.val() || !$el.val().length) isGood = false; 505 } 506 507 return isGood; 508 } 509 /** 510 * Get: 511 * - Based on $el, the first element(s) corresponding to `formErrorSelector` in this order: 512 * 1. The element's direct sibling('s). 513 * 2. The element's parent's children. 514 * - Element(s) with the attribute `[data-form-error-for]` set with the element's id. 515 * 516 * This allows for multiple form errors per input, though if none are found, no form errors will be shown. 517 * 518 * @param {Object} $el - jQuery object to use as reference to find the form error selector. 519 * @param {String[]} [failedValidators] - List of failed validators. 520 * @returns {Object} jQuery object with the selector. 521 */ 522 523 }, { 524 key: "findFormError", 525 value: function findFormError($el, failedValidators) { 526 var _this4 = this; 527 528 var id = $el.length ? $el[0].id : ''; 529 var $error = $el.siblings(this.options.formErrorSelector); 530 531 if (!$error.length) { 532 $error = $el.parent().find(this.options.formErrorSelector); 533 } 534 535 if (id) { 536 $error = $error.add(this.$element.find("[data-form-error-for=\"".concat(id, "\"]"))); 537 } 538 539 if (!!failedValidators) { 540 $error = $error.not('[data-form-error-on]'); 541 failedValidators.forEach(function (v) { 542 $error = $error.add($el.siblings("[data-form-error-on=\"".concat(v, "\"]"))); 543 $error = $error.add(_this4.$element.find("[data-form-error-for=\"".concat(id, "\"][data-form-error-on=\"").concat(v, "\"]"))); 544 }); 545 } 546 547 return $error; 548 } 549 /** 550 * Get the first element in this order: 551 * 2. The <label> with the attribute `[for="someInputId"]` 552 * 3. The `.closest()` <label> 553 * 554 * @param {Object} $el - jQuery object to check for required attribute 555 * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty 556 */ 557 558 }, { 559 key: "findLabel", 560 value: function findLabel($el) { 561 var id = $el[0].id; 562 var $label = this.$element.find("label[for=\"".concat(id, "\"]")); 563 564 if (!$label.length) { 565 return $el.closest('label'); 566 } 567 568 return $label; 569 } 570 /** 571 * Get the set of labels associated with a set of radio els in this order 572 * 2. The <label> with the attribute `[for="someInputId"]` 573 * 3. The `.closest()` <label> 574 * 575 * @param {Object} $el - jQuery object to check for required attribute 576 * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty 577 */ 578 579 }, { 580 key: "findRadioLabels", 581 value: function findRadioLabels($els) { 582 var _this5 = this; 583 584 var labels = $els.map(function (i, el) { 585 var id = el.id; 586 587 var $label = _this5.$element.find("label[for=\"".concat(id, "\"]")); 588 589 if (!$label.length) { 590 $label = jquery__WEBPACK_IMPORTED_MODULE_0___default()(el).closest('label'); 591 } 592 593 return $label[0]; 594 }); 595 return jquery__WEBPACK_IMPORTED_MODULE_0___default()(labels); 596 } 597 /** 598 * Get the set of labels associated with a set of checkbox els in this order 599 * 2. The <label> with the attribute `[for="someInputId"]` 600 * 3. The `.closest()` <label> 601 * 602 * @param {Object} $el - jQuery object to check for required attribute 603 * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty 604 */ 605 606 }, { 607 key: "findCheckboxLabels", 608 value: function findCheckboxLabels($els) { 609 var _this6 = this; 610 611 var labels = $els.map(function (i, el) { 612 var id = el.id; 613 614 var $label = _this6.$element.find("label[for=\"".concat(id, "\"]")); 615 616 if (!$label.length) { 617 $label = jquery__WEBPACK_IMPORTED_MODULE_0___default()(el).closest('label'); 618 } 619 620 return $label[0]; 621 }); 622 return jquery__WEBPACK_IMPORTED_MODULE_0___default()(labels); 623 } 624 /** 625 * Adds the CSS error class as specified by the Abide settings to the label, input, and the form 626 * @param {Object} $el - jQuery object to add the class to 627 * @param {String[]} [failedValidators] - List of failed validators. 628 */ 629 630 }, { 631 key: "addErrorClasses", 632 value: function addErrorClasses($el, failedValidators) { 633 var $label = this.findLabel($el); 634 var $formError = this.findFormError($el, failedValidators); 635 636 if ($label.length) { 637 $label.addClass(this.options.labelErrorClass); 638 } 639 640 if ($formError.length) { 641 $formError.addClass(this.options.formErrorClass); 642 } 643 644 $el.addClass(this.options.inputErrorClass).attr({ 645 'data-invalid': '', 646 'aria-invalid': true 647 }); 648 } 649 /** 650 * Adds [for] and [role=alert] attributes to all form error targetting $el, 651 * and [aria-describedby] attribute to $el toward the first form error. 652 * @param {Object} $el - jQuery object 653 */ 654 655 }, { 656 key: "addA11yAttributes", 657 value: function addA11yAttributes($el) { 658 var $errors = this.findFormError($el); 659 var $labels = $errors.filter('label'); 660 var $error = $errors.first(); 661 if (!$errors.length) return; // Set [aria-describedby] on the input toward the first form error if it is not set 662 663 if (typeof $el.attr('aria-describedby') === 'undefined') { 664 // Get the first error ID or create one 665 var errorId = $error.attr('id'); 666 667 if (typeof errorId === 'undefined') { 668 errorId = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'abide-error'); 669 $error.attr('id', errorId); 670 } 671 672 $el.attr('aria-describedby', errorId); 673 } 674 675 if ($labels.filter('[for]').length < $labels.length) { 676 // Get the input ID or create one 677 var elemId = $el.attr('id'); 678 679 if (typeof elemId === 'undefined') { 680 elemId = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'abide-input'); 681 $el.attr('id', elemId); 682 } // For each label targeting $el, set [for] if it is not set. 683 684 685 $labels.each(function (i, label) { 686 var $label = jquery__WEBPACK_IMPORTED_MODULE_0___default()(label); 687 if (typeof $label.attr('for') === 'undefined') $label.attr('for', elemId); 688 }); 689 } // For each error targeting $el, set [role=alert] if it is not set. 690 691 692 $errors.each(function (i, label) { 693 var $label = jquery__WEBPACK_IMPORTED_MODULE_0___default()(label); 694 if (typeof $label.attr('role') === 'undefined') $label.attr('role', 'alert'); 695 }).end(); 696 } 697 /** 698 * Adds [aria-live] attribute to the given global form error $el. 699 * @param {Object} $el - jQuery object to add the attribute to 700 */ 701 702 }, { 703 key: "addGlobalErrorA11yAttributes", 704 value: function addGlobalErrorA11yAttributes($el) { 705 if (typeof $el.attr('aria-live') === 'undefined') $el.attr('aria-live', this.options.a11yErrorLevel); 706 } 707 /** 708 * Remove CSS error classes etc from an entire radio button group 709 * @param {String} groupName - A string that specifies the name of a radio button group 710 * 711 */ 712 713 }, { 714 key: "removeRadioErrorClasses", 715 value: function removeRadioErrorClasses(groupName) { 716 var $els = this.$element.find(":radio[name=\"".concat(groupName, "\"]")); 717 var $labels = this.findRadioLabels($els); 718 var $formErrors = this.findFormError($els); 719 720 if ($labels.length) { 721 $labels.removeClass(this.options.labelErrorClass); 722 } 723 724 if ($formErrors.length) { 725 $formErrors.removeClass(this.options.formErrorClass); 726 } 727 728 $els.removeClass(this.options.inputErrorClass).attr({ 729 'data-invalid': null, 730 'aria-invalid': null 731 }); 732 } 733 /** 734 * Remove CSS error classes etc from an entire checkbox group 735 * @param {String} groupName - A string that specifies the name of a checkbox group 736 * 737 */ 738 739 }, { 740 key: "removeCheckboxErrorClasses", 741 value: function removeCheckboxErrorClasses(groupName) { 742 var $els = this.$element.find(":checkbox[name=\"".concat(groupName, "\"]")); 743 var $labels = this.findCheckboxLabels($els); 744 var $formErrors = this.findFormError($els); 745 746 if ($labels.length) { 747 $labels.removeClass(this.options.labelErrorClass); 748 } 749 750 if ($formErrors.length) { 751 $formErrors.removeClass(this.options.formErrorClass); 752 } 753 754 $els.removeClass(this.options.inputErrorClass).attr({ 755 'data-invalid': null, 756 'aria-invalid': null 757 }); 758 } 759 /** 760 * Removes CSS error class as specified by the Abide settings from the label, input, and the form 761 * @param {Object} $el - jQuery object to remove the class from 762 */ 763 764 }, { 765 key: "removeErrorClasses", 766 value: function removeErrorClasses($el) { 767 // radios need to clear all of the els 768 if ($el[0].type == 'radio') { 769 return this.removeRadioErrorClasses($el.attr('name')); 770 } // checkboxes need to clear all of the els 771 else if ($el[0].type == 'checkbox') { 772 return this.removeCheckboxErrorClasses($el.attr('name')); 773 } 774 775 var $label = this.findLabel($el); 776 var $formError = this.findFormError($el); 777 778 if ($label.length) { 779 $label.removeClass(this.options.labelErrorClass); 780 } 781 782 if ($formError.length) { 783 $formError.removeClass(this.options.formErrorClass); 784 } 785 786 $el.removeClass(this.options.inputErrorClass).attr({ 787 'data-invalid': null, 788 'aria-invalid': null 789 }); 790 } 791 /** 792 * Goes through a form to find inputs and proceeds to validate them in ways specific to their type. 793 * Ignores inputs with data-abide-ignore, type="hidden" or disabled attributes set 794 * @fires Abide#invalid 795 * @fires Abide#valid 796 * @param {Object} element - jQuery object to validate, should be an HTML input 797 * @returns {Boolean} goodToGo - If the input is valid or not. 798 */ 799 800 }, { 801 key: "validateInput", 802 value: function validateInput($el) { 803 var _this7 = this; 804 805 var clearRequire = this.requiredCheck($el), 806 validator = $el.attr('data-validator'), 807 failedValidators = [], 808 manageErrorClasses = true; // skip validation if disabled 809 810 if (this._validationIsDisabled()) { 811 return true; 812 } // don't validate ignored inputs or hidden inputs or disabled inputs 813 814 815 if ($el.is('[data-abide-ignore]') || $el.is('[type="hidden"]') || $el.is('[disabled]')) { 816 return true; 817 } 818 819 switch ($el[0].type) { 820 case 'radio': 821 this.validateRadio($el.attr('name')) || failedValidators.push('required'); 822 break; 823 824 case 'checkbox': 825 this.validateCheckbox($el.attr('name')) || failedValidators.push('required'); // validateCheckbox() adds/removes error classes 826 827 manageErrorClasses = false; 828 break; 829 830 case 'select': 831 case 'select-one': 832 case 'select-multiple': 833 clearRequire || failedValidators.push('required'); 834 break; 835 836 default: 837 clearRequire || failedValidators.push('required'); 838 this.validateText($el) || failedValidators.push('pattern'); 839 } 840 841 if (validator) { 842 var required = $el.attr('required') ? true : false; 843 validator.split(' ').forEach(function (v) { 844 _this7.options.validators[v]($el, required, $el.parent()) || failedValidators.push(v); 845 }); 846 } 847 848 if ($el.attr('data-equalto')) { 849 this.options.validators.equalTo($el) || failedValidators.push('equalTo'); 850 } 851 852 var goodToGo = failedValidators.length === 0; 853 var message = (goodToGo ? 'valid' : 'invalid') + '.zf.abide'; 854 855 if (goodToGo) { 856 // Re-validate inputs that depend on this one with equalto 857 var dependentElements = this.$element.find("[data-equalto=\"".concat($el.attr('id'), "\"]")); 858 859 if (dependentElements.length) { 860 var _this = this; 861 862 dependentElements.each(function () { 863 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).val()) { 864 _this.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)); 865 } 866 }); 867 } 868 } 869 870 if (manageErrorClasses) { 871 this.removeErrorClasses($el); 872 873 if (!goodToGo) { 874 this.addErrorClasses($el, failedValidators); 875 } 876 } 877 /** 878 * Fires when the input is done checking for validation. Event trigger is either `valid.zf.abide` or `invalid.zf.abide` 879 * Trigger includes the DOM element of the input. 880 * @event Abide#valid 881 * @event Abide#invalid 882 */ 883 884 885 $el.trigger(message, [$el]); 886 return goodToGo; 887 } 888 /** 889 * Goes through a form and if there are any invalid inputs, it will display the form error element 890 * @returns {Boolean} noError - true if no errors were detected... 891 * @fires Abide#formvalid 892 * @fires Abide#forminvalid 893 */ 894 895 }, { 896 key: "validateForm", 897 value: function validateForm() { 898 var _this8 = this; 899 900 var acc = []; 901 902 var _this = this; 903 904 var checkboxGroupName; // Remember first form submission to prevent specific checkbox validation (more than one required) until form got initially submitted 905 906 if (!this.initialized) { 907 this.initialized = true; 908 } // skip validation if disabled 909 910 911 if (this._validationIsDisabled()) { 912 this.formnovalidate = null; 913 return true; 914 } 915 916 this.$inputs.each(function () { 917 // Only use one checkbox per group since validateCheckbox() iterates over all associated checkboxes 918 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)[0].type === 'checkbox') { 919 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('name') === checkboxGroupName) return true; 920 checkboxGroupName = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('name'); 921 } 922 923 acc.push(_this.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this))); 924 }); 925 var noError = acc.indexOf(false) === -1; 926 this.$element.find('[data-abide-error]').each(function (i, elem) { 927 var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(elem); // Ensure a11y attributes are set 928 929 if (_this8.options.a11yAttributes) _this8.addGlobalErrorA11yAttributes($elem); // Show or hide the error 930 931 $elem.css('display', noError ? 'none' : 'block'); 932 }); 933 /** 934 * Fires when the form is finished validating. Event trigger is either `formvalid.zf.abide` or `forminvalid.zf.abide`. 935 * Trigger includes the element of the form. 936 * @event Abide#formvalid 937 * @event Abide#forminvalid 938 */ 939 940 this.$element.trigger((noError ? 'formvalid' : 'forminvalid') + '.zf.abide', [this.$element]); 941 return noError; 942 } 943 /** 944 * 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. 945 * @param {Object} $el - jQuery object to validate, should be a text input HTML element 946 * @param {String} pattern - string value of one of the RegEx patterns in Abide.options.patterns 947 * @returns {Boolean} Boolean value depends on whether or not the input value matches the pattern specified 948 */ 949 950 }, { 951 key: "validateText", 952 value: function validateText($el, pattern) { 953 // A pattern can be passed to this function, or it will be infered from the input's "pattern" attribute, or it's "type" attribute 954 pattern = pattern || $el.attr('data-pattern') || $el.attr('pattern') || $el.attr('type'); 955 var inputText = $el.val(); 956 var valid = true; 957 958 if (inputText.length) { 959 // If the pattern attribute on the element is in Abide's list of patterns, then test that regexp 960 if (this.options.patterns.hasOwnProperty(pattern)) { 961 valid = this.options.patterns[pattern].test(inputText); 962 } // If the pattern name isn't also the type attribute of the field, then test it as a regexp 963 else if (pattern !== $el.attr('type')) { 964 valid = new RegExp(pattern).test(inputText); 965 } 966 } 967 968 return valid; 969 } 970 /** 971 * 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. 972 * @param {String} groupName - A string that specifies the name of a radio button group 973 * @returns {Boolean} Boolean value depends on whether or not at least one radio input has been selected (if it's required) 974 */ 975 976 }, { 977 key: "validateRadio", 978 value: function validateRadio(groupName) { 979 // If at least one radio in the group has the `required` attribute, the group is considered required 980 // Per W3C spec, all radio buttons in a group should have `required`, but we're being nice 981 var $group = this.$element.find(":radio[name=\"".concat(groupName, "\"]")); 982 var valid = false, 983 required = false; // For the group to be required, at least one radio needs to be required 984 985 $group.each(function (i, e) { 986 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e).attr('required')) { 987 required = true; 988 } 989 }); 990 if (!required) valid = true; 991 992 if (!valid) { 993 // For the group to be valid, at least one radio needs to be checked 994 $group.each(function (i, e) { 995 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e).prop('checked')) { 996 valid = true; 997 } 998 }); 999 } 1000 1001 return valid; 1002 } 1003 /** 1004 * 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. 1005 * @param {String} groupName - A string that specifies the name of a checkbox group 1006 * @returns {Boolean} Boolean value depends on whether or not at least one checkbox input has been checked (if it's required) 1007 */ 1008 1009 }, { 1010 key: "validateCheckbox", 1011 value: function validateCheckbox(groupName) { 1012 var _this9 = this; 1013 1014 // If at least one checkbox in the group has the `required` attribute, the group is considered required 1015 // Per W3C spec, all checkboxes in a group should have `required`, but we're being nice 1016 var $group = this.$element.find(":checkbox[name=\"".concat(groupName, "\"]")); 1017 var valid = false, 1018 required = false, 1019 minRequired = 1, 1020 checked = 0; // For the group to be required, at least one checkbox needs to be required 1021 1022 $group.each(function (i, e) { 1023 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e).attr('required')) { 1024 required = true; 1025 } 1026 }); 1027 if (!required) valid = true; 1028 1029 if (!valid) { 1030 // Count checked checkboxes within the group 1031 // Use data-min-required if available (default: 1) 1032 $group.each(function (i, e) { 1033 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e).prop('checked')) { 1034 checked++; 1035 } 1036 1037 if (typeof jquery__WEBPACK_IMPORTED_MODULE_0___default()(e).attr('data-min-required') !== 'undefined') { 1038 minRequired = parseInt(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e).attr('data-min-required')); 1039 } 1040 }); // For the group to be valid, the minRequired amount of checkboxes have to be checked 1041 1042 if (checked >= minRequired) { 1043 valid = true; 1044 } 1045 } // 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) 1046 1047 1048 if (this.initialized !== true && minRequired > 1) { 1049 return true; 1050 } // Refresh error class for all input 1051 1052 1053 $group.each(function (i, e) { 1054 if (!valid) { 1055 _this9.addErrorClasses(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e), ['required']); 1056 } else { 1057 _this9.removeErrorClasses(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e)); 1058 } 1059 }); 1060 return valid; 1061 } 1062 /** 1063 * 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. 1064 * @param {Object} $el - jQuery input element. 1065 * @param {String} validators - a string of function names matching functions in the Abide.options.validators object. 1066 * @param {Boolean} required - self explanatory? 1067 * @returns {Boolean} - true if validations passed. 1068 */ 1069 1070 }, { 1071 key: "matchValidation", 1072 value: function matchValidation($el, validators, required) { 1073 var _this10 = this; 1074 1075 required = required ? true : false; 1076 var clear = validators.split(' ').map(function (v) { 1077 return _this10.options.validators[v]($el, required, $el.parent()); 1078 }); 1079 return clear.indexOf(false) === -1; 1080 } 1081 /** 1082 * Resets form inputs and styles 1083 * @fires Abide#formreset 1084 */ 1085 1086 }, { 1087 key: "resetForm", 1088 value: function resetForm() { 1089 var $form = this.$element, 1090 opts = this.options; 1091 jquery__WEBPACK_IMPORTED_MODULE_0___default()(".".concat(opts.labelErrorClass), $form).not('small').removeClass(opts.labelErrorClass); 1092 jquery__WEBPACK_IMPORTED_MODULE_0___default()(".".concat(opts.inputErrorClass), $form).not('small').removeClass(opts.inputErrorClass); 1093 jquery__WEBPACK_IMPORTED_MODULE_0___default()("".concat(opts.formErrorSelector, ".").concat(opts.formErrorClass)).removeClass(opts.formErrorClass); 1094 $form.find('[data-abide-error]').css('display', 'none'); 1095 jquery__WEBPACK_IMPORTED_MODULE_0___default()(':input', $form).not(':button, :submit, :reset, :hidden, :radio, :checkbox, [data-abide-ignore]').val('').attr({ 1096 'data-invalid': null, 1097 'aria-invalid': null 1098 }); 1099 jquery__WEBPACK_IMPORTED_MODULE_0___default()(':input:radio', $form).not('[data-abide-ignore]').prop('checked', false).attr({ 1100 'data-invalid': null, 1101 'aria-invalid': null 1102 }); 1103 jquery__WEBPACK_IMPORTED_MODULE_0___default()(':input:checkbox', $form).not('[data-abide-ignore]').prop('checked', false).attr({ 1104 'data-invalid': null, 1105 'aria-invalid': null 1106 }); 1107 /** 1108 * Fires when the form has been reset. 1109 * @event Abide#formreset 1110 */ 1111 1112 $form.trigger('formreset.zf.abide', [$form]); 1113 } 1114 /** 1115 * Destroys an instance of Abide. 1116 * Removes error styles and classes from elements, without resetting their values. 1117 */ 1118 1119 }, { 1120 key: "_destroy", 1121 value: function _destroy() { 1122 var _this = this; 1123 1124 this.$element.off('.abide').find('[data-abide-error]').css('display', 'none'); 1125 this.$inputs.off('.abide').each(function () { 1126 _this.removeErrorClasses(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)); 1127 }); 1128 this.$submits.off('.abide'); 1129 } 1130 }]); 1131 1132 return Abide; 1133}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]); 1134/** 1135 * Default settings for plugin 1136 */ 1137 1138 1139Abide.defaults = { 1140 /** 1141 * The default event to validate inputs. Checkboxes and radios validate immediately. 1142 * Remove or change this value for manual validation. 1143 * @option 1144 * @type {?string} 1145 * @default 'fieldChange' 1146 */ 1147 validateOn: 'fieldChange', 1148 1149 /** 1150 * Class to be applied to input labels on failed validation. 1151 * @option 1152 * @type {string} 1153 * @default 'is-invalid-label' 1154 */ 1155 labelErrorClass: 'is-invalid-label', 1156 1157 /** 1158 * Class to be applied to inputs on failed validation. 1159 * @option 1160 * @type {string} 1161 * @default 'is-invalid-input' 1162 */ 1163 inputErrorClass: 'is-invalid-input', 1164 1165 /** 1166 * Class selector to use to target Form Errors for show/hide. 1167 * @option 1168 * @type {string} 1169 * @default '.form-error' 1170 */ 1171 formErrorSelector: '.form-error', 1172 1173 /** 1174 * Class added to Form Errors on failed validation. 1175 * @option 1176 * @type {string} 1177 * @default 'is-visible' 1178 */ 1179 formErrorClass: 'is-visible', 1180 1181 /** 1182 * If true, automatically insert when possible: 1183 * - `[aria-describedby]` on fields 1184 * - `[role=alert]` on form errors and `[for]` on form error labels 1185 * - `[aria-live]` on global errors `[data-abide-error]` (see option `a11yErrorLevel`). 1186 * @option 1187 * @type {boolean} 1188 * @default true 1189 */ 1190 a11yAttributes: true, 1191 1192 /** 1193 * [aria-live] attribute value to be applied on global errors `[data-abide-error]`. 1194 * Options are: 'assertive', 'polite' and 'off'/null 1195 * @option 1196 * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions 1197 * @type {string} 1198 * @default 'assertive' 1199 */ 1200 a11yErrorLevel: 'assertive', 1201 1202 /** 1203 * Set to true to validate text inputs on any value change. 1204 * @option 1205 * @type {boolean} 1206 * @default false 1207 */ 1208 liveValidate: false, 1209 1210 /** 1211 * Set to true to validate inputs on blur. 1212 * @option 1213 * @type {boolean} 1214 * @default false 1215 */ 1216 validateOnBlur: false, 1217 patterns: {
1218 alpha: /^[a-zA-Z]+$/, 1219 alpha_numeric: /^[a-zA-Z0-9]+$/, 1220 integer: /^[-+]?\d+$/, 1221 number: /^[-+]?\d*(?:[\.\,]\d+)?$/, 1222 // amex, visa, diners 1223 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})$/, 1224 cvv: /^([0-9]){3,4}$/, 1225 // http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#valid-e-mail-address 1226 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])?)+$/, 1227 // From CommonRegexJS (@talyssonoc) 1228 // https://github.com/talyssonoc/CommonRegexJS/blob/e2901b9f57222bc14069dc8f0598d5f412555411/lib/commonregex.js#L76 1229 // For more restrictive URL Regexs, see https://mathiasbynens.be/demo/url-regex. 1230 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]))$/, 1231 // abc.de 1232 domain: /^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,8}$/, 1233 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))$/, 1234 // YYYY-MM-DD 1235 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))$/, 1236 // HH:MM:SS 1237 time: /^(0[0-9]|1[0-9]|2[0-3])(:[0-5][0-9]){2}$/, 1238 dateISO: /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/, 1239 // MM/DD/YYYY 1240 month_day_year: /^(0[1-9]|1[012])[- \/.](0[1-9]|[12][0-9]|3[01])[- \/.]\d{4}$/, 1241 // DD/MM/YYYY 1242 day_month_year: /^(0[1-9]|[12][0-9]|3[01])[- \/.](0[1-9]|1[012])[- \/.]\d{4}$/, 1243 // #FFF or #FFFFFF 1244 color: /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/, 1245 // Domain || URL 1246 website: { 1247 test: function test(text) { 1248 return Abide.defaults.patterns['domain'].test(text) || Abide.defaults.patterns['url'].test(text); 1249 } 1250 } 1251 }, 1252 1253 /** 1254 * Optional validation functions to be used. `equalTo` being the only default included function. 1255 * Functions should return only a boolean if the input is valid or not. Functions are given the following arguments: 1256 * el : The jQuery element to validate. 1257 * required : Boolean value of the required attribute be present or not. 1258 * parent : The direct parent of the input. 1259 * @option 1260 */ 1261 validators: { 1262 equalTo: function equalTo(el, required, parent) { 1263 return jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(el.attr('data-equalto'))).val() === el.val(); 1264 } 1265 } 1266}; 1267 1268 1269/***/ }), 1270
1271/***/ "./js/foundation.accordion.js": 1272/*!************************************!*\ 1273 !*** ./js/foundation.accordion.js ***! 1274 \************************************/ 1275/*! exports provided: Accordion */ 1276/***/ (function(module, __webpack_exports__, __webpack_require__) { 1277 1278"use strict"; 1279__webpack_require__.r(__webpack_exports__); 1280/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Accordion", function() { return Accordion; }); 1281/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 1282/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 1283/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 1284/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 1285/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js"); 1286 1287 1288function _typeof(obj) { 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); } 1289 1290function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 1291 1292function _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); } } 1293 1294function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 1295 1296function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 1297 1298function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 1299 1300function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 1301 1302function _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); } 1303 1304function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 1305 1306 1307 1308 1309 1310/** 1311 * Accordion module. 1312 * @module foundation.accordion 1313 * @requires foundation.util.keyboard 1314 */ 1315 1316var Accordion = 1317/*#__PURE__*/ 1318function (_Plugin) { 1319 _inherits(Accordion, _Plugin); 1320 1321 function Accordion() { 1322 _classCallCheck(this, Accordion); 1323 1324 return _possibleConstructorReturn(this, _getPrototypeOf(Accordion).apply(this, arguments)); 1325 } 1326 1327 _createClass(Accordion, [{ 1328 key: "_setup", 1329 1330 /** 1331 * Creates a new instance of an accordion. 1332 * @class 1333 * @name Accordion 1334 * @fires Accordion#init 1335 * @param {jQuery} element - jQuery object to make into an accordion. 1336 * @param {Object} options - a plain object with settings to override the default options. 1337 */ 1338 value: function _setup(element, options) { 1339 this.$element = element; 1340 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Accordion.defaults, this.$element.data(), options); 1341 this.className = 'Accordion'; // ie9 back compat 1342 1343 this._init(); 1344 1345 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].register('Accordion', { 1346 'ENTER': 'toggle', 1347 'SPACE': 'toggle', 1348 'ARROW_DOWN': 'next', 1349 'ARROW_UP': 'previous' 1350 }); 1351 } 1352 /** 1353 * Initializes the accordion by animating the preset active pane(s). 1354 * @private 1355 */ 1356 1357 }, { 1358 key: "_init", 1359 value: function _init() { 1360 var _this2 = this; 1361 1362 this._isInitializing = true; 1363 this.$element.attr('role', 'tablist'); 1364 this.$tabs = this.$element.children('[data-accordion-item]'); 1365 this.$tabs.attr({ 1366 'role': 'presentation' 1367 }); 1368 this.$tabs.each(function (idx, el) { 1369 var $el = jquery__WEBPACK_IMPORTED_MODULE_0___default()(el), 1370 $content = $el.children('[data-tab-content]'), 1371 id = $content[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'accordion'), 1372 linkId = el.id ? "".concat(el.id, "-label") : "".concat(id, "-label"); 1373 $el.find('a:first').attr({ 1374 'aria-controls': id, 1375 'role': 'tab', 1376 'id': linkId, 1377 'aria-expanded': false, 1378 'aria-selected': false 1379 }); 1380 $content.attr({ 1381 'role': 'tabpanel', 1382 'aria-labelledby': linkId, 1383 'aria-hidden': true, 1384 'id': id 1385 }); 1386 }); 1387 var $initActive = this.$element.find('.is-active').children('[data-tab-content]'); 1388 1389 if ($initActive.length) { 1390 // Save up the initial hash to return to it later when going back in history 1391 this._initialAnchor = $initActive.prev('a').attr('href'); 1392 1393 this._openSingleTab($initActive); 1394 } 1395 1396 this._checkDeepLink = function () { 1397 var anchor = window.location.hash; 1398 1399 if (!anchor.length) { 1400 // If we are still initializing and there is no anchor, then there is nothing to do 1401 if (_this2._isInitializing) return; // Otherwise, move to the initial anchor 1402 1403 if (_this2._initialAnchor) anchor = _this2._initialAnchor; 1404 } 1405 1406 var $anchor = anchor && jquery__WEBPACK_IMPORTED_MODULE_0___default()(anchor); 1407 1408 var $link = anchor && _this2.$element.find("[href$=\"".concat(anchor, "\"]"));
vendor: 4,547 bytes, lines 1408-1552
1408 // Whether the anchor element that has been found is part of this element 1409 1410 1411 var isOwnAnchor = !!($anchor.length && $link.length); 1412 1413 if (isOwnAnchor) { 1414 // If there is an anchor for the hash, open it (if not already active) 1415 if ($anchor && $link && $link.length) { 1416 if (!$link.parent('[data-accordion-item]').hasClass('is-active')) { 1417 _this2._openSingleTab($anchor); 1418 } 1419 } // Otherwise, close everything 1420 else { 1421 _this2._closeAllTabs(); 1422 } // Roll up a little to show the titles 1423 1424 1425 if (_this2.options.deepLinkSmudge) { 1426 Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () { 1427 var offset = _this2.$element.offset(); 1428 1429 jquery__WEBPACK_IMPORTED_MODULE_0___default()('html, body').animate({ 1430 scrollTop: offset.top - _this2.options.deepLinkSmudgeOffset 1431 }, _this2.options.deepLinkSmudgeDelay); 1432 }); 1433 } 1434 /** 1435 * Fires when the plugin has deeplinked at pageload 1436 * @event Accordion#deeplink 1437 */ 1438 1439 1440 _this2.$element.trigger('deeplink.zf.accordion', [$link, $anchor]); 1441 } 1442 }; //use browser to open a tab, if it exists in this tabset 1443 1444 1445 if (this.options.deepLink) { 1446 this._checkDeepLink(); 1447 } 1448 1449 this._events(); 1450 1451 this._isInitializing = false; 1452 } 1453 /** 1454 * Adds event handlers for items within the accordion. 1455 * @private 1456 */ 1457 1458 }, { 1459 key: "_events", 1460 value: function _events() { 1461 var _this = this; 1462 1463 this.$tabs.each(function () { 1464 var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this); 1465 var $tabContent = $elem.children('[data-tab-content]'); 1466 1467 if ($tabContent.length) { 1468 $elem.children('a').off('click.zf.accordion keydown.zf.accordion').on('click.zf.accordion', function (e) { 1469 e.preventDefault(); 1470 1471 _this.toggle($tabContent); 1472 }).on('keydown.zf.accordion', function (e) { 1473 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].handleKey(e, 'Accordion', { 1474 toggle: function toggle() { 1475 _this.toggle($tabContent); 1476 }, 1477 next: function next() { 1478 var $a = $elem.next().find('a').focus(); 1479 1480 if (!_this.options.multiExpand) { 1481 $a.trigger('click.zf.accordion'); 1482 } 1483 }, 1484 previous: function previous() { 1485 var $a = $elem.prev().find('a').focus(); 1486 1487 if (!_this.options.multiExpand) { 1488 $a.trigger('click.zf.accordion'); 1489 } 1490 }, 1491 handled: function handled() { 1492 e.preventDefault(); 1493 } 1494 }); 1495 }); 1496 } 1497 }); 1498 1499 if (this.options.deepLink) { 1500 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('hashchange', this._checkDeepLink); 1501 } 1502 } 1503 /** 1504 * Toggles the selected content pane's open/close state. 1505 * @param {jQuery} $target - jQuery object of the pane to toggle (`.accordion-content`). 1506 * @function 1507 */ 1508 1509 }, { 1510 key: "toggle", 1511 value: function toggle($target) { 1512 if ($target.closest('[data-accordion]').is('[disabled]')) { 1513 console.info('Cannot toggle an accordion that is disabled.'); 1514 return; 1515 } 1516 1517 if ($target.parent().hasClass('is-active')) { 1518 this.up($target); 1519 } else { 1520 this.down($target); 1521 } //either replace or update browser history 1522 1523 1524 if (this.options.deepLink) { 1525 var anchor = $target.prev('a').attr('href'); 1526 1527 if (this.options.updateHistory) { 1528 history.pushState({}, '', anchor); 1529 } else { 1530 history.replaceState({}, '', anchor); 1531 } 1532 } 1533 } 1534 /** 1535 * Opens the accordion tab defined by `$target`. 1536 * @param {jQuery} $target - Accordion pane to open (`.accordion-content`). 1537 * @fires Accordion#down 1538 * @function 1539 */ 1540 1541 }, { 1542 key: "down", 1543 value: function down($target) { 1544 if ($target.closest('[data-accordion]').is('[disabled]')) { 1545 console.info('Cannot call down on an accordion that is disabled.'); 1546 return; 1547 } 1548 1549 if (this.options.multiExpand) this._openTab($target);else this._openSingleTab($target); 1550 } 1551 /** 1552 * Closes the tab defined by `$target`.
1553 * It may be ignored if the Accordion options don't allow it. 1554 * 1555 * @param {jQuery} $target - Accordion tab to close (`.accordion-content`). 1556 * @fires Accordion#up 1557 * @function 1558 */ 1559 1560 }, { 1561 key: "up", 1562 value: function up($target) { 1563 if (this.$element.is('[disabled]')) { 1564 console.info('Cannot call up on an accordion that is disabled.'); 1565 return; 1566 } // Don't close the item if it is already closed 1567 1568 1569 var $targetItem = $target.parent(); 1570 if (!$targetItem.hasClass('is-active')) return; // Don't close the item if there is no other active item (unless with `allowAllClosed`) 1571 1572 var $othersItems = $targetItem.siblings(); 1573 if (!this.options.allowAllClosed && !$othersItems.hasClass('is-active')) return; 1574 1575 this._closeTab($target); 1576 } 1577 /** 1578 * Make the tab defined by `$target` the only opened tab, closing all others tabs. 1579 * @param {jQuery} $target - Accordion tab to open (`.accordion-content`). 1580 * @function 1581 * @private 1582 */ 1583 1584 }, { 1585 key: "_openSingleTab", 1586 value: function _openSingleTab($target) { 1587 // Close all the others active tabs. 1588 var $activeContents = this.$element.children('.is-active').children('[data-tab-content]'); 1589 1590 if ($activeContents.length) { 1591 this._closeTab($activeContents.not($target)); 1592 } // Then open the target. 1593 1594 1595 this._openTab($target); 1596 } 1597 /** 1598 * Opens the tab defined by `$target`. 1599 * @param {jQuery} $target - Accordion tab to open (`.accordion-content`). 1600 * @fires Accordion#down 1601 * @function 1602 * @private 1603 */ 1604 1605 }, { 1606 key: "_openTab", 1607 value: function _openTab($target) { 1608 var _this3 = this; 1609 1610 var $targetItem = $target.parent(); 1611 var targetContentId = $target.attr('aria-labelledby'); 1612 $target.attr('aria-hidden', false); 1613 $targetItem.addClass('is-active'); 1614 jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(targetContentId)).attr({ 1615 'aria-expanded': true, 1616 'aria-selected': true 1617 }); 1618 $target.finish().slideDown(this.options.slideSpeed, function () { 1619 /** 1620 * Fires when the tab is done opening. 1621 * @event Accordion#down 1622 */ 1623 _this3.$element.trigger('down.zf.accordion', [$target]); 1624 }); 1625 } 1626 /** 1627 * Closes the tab defined by `$target`. 1628 * @param {jQuery} $target - Accordion tab to close (`.accordion-content`). 1629 * @fires Accordion#up 1630 * @function 1631 * @private 1632 */ 1633 1634 }, { 1635 key: "_closeTab", 1636 value: function _closeTab($target) { 1637 var _this4 = this; 1638 1639 var $targetItem = $target.parent(); 1640 var targetContentId = $target.attr('aria-labelledby'); 1641 $target.attr('aria-hidden', true); 1642 $targetItem.removeClass('is-active'); 1643 jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(targetContentId)).attr({ 1644 'aria-expanded': false, 1645 'aria-selected': false 1646 }); 1647 $target.finish().slideUp(this.options.slideSpeed, function () { 1648 /** 1649 * Fires when the tab is done collapsing up. 1650 * @event Accordion#up 1651 */ 1652 _this4.$element.trigger('up.zf.accordion', [$target]); 1653 }); 1654 } 1655 /** 1656 * Closes all active tabs 1657 * @fires Accordion#up 1658 * @function 1659 * @private 1660 */ 1661 1662 }, { 1663 key: "_closeAllTabs", 1664 value: function _closeAllTabs() { 1665 var $activeTabs = this.$element.children('.is-active').children('[data-tab-content]'); 1666 1667 if ($activeTabs.length) { 1668 this._closeTab($activeTabs); 1669 } 1670 } 1671 /** 1672 * Destroys an instance of an accordion. 1673 * @fires Accordion#destroyed 1674 * @function 1675 */ 1676 1677 }, { 1678 key: "_destroy", 1679 value: function _destroy() { 1680 this.$element.find('[data-tab-content]').stop(true).slideUp(0).css('display', ''); 1681 this.$element.find('a').off('.zf.accordion'); 1682 1683 if (this.options.deepLink) { 1684 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('hashchange', this._checkDeepLink); 1685 } 1686 } 1687 }]); 1688 1689 return Accordion; 1690}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]); 1691 1692Accordion.defaults = { 1693 /** 1694 * Amount of time to animate the opening of an accordion pane. 1695 * @option 1696 * @type {number} 1697 * @default 250 1698 */ 1699 slideSpeed: 250, 1700 1701 /** 1702 * Allow the accordion to have multiple open panes. 1703 * @option 1704 * @type {boolean} 1705 * @default false 1706 */ 1707 multiExpand: false, 1708 1709 /** 1710 * Allow the accordion to close all panes. 1711 * @option 1712 * @type {boolean} 1713 * @default false 1714 */
1715 allowAllClosed: false, 1716 1717 /** 1718 * Link the location hash to the open pane. 1719 * Set the location hash when the opened pane changes, and open and scroll to the corresponding pane when the location changes. 1720 * @option 1721 * @type {boolean} 1722 * @default false 1723 */ 1724 deepLink: false, 1725 1726 /** 1727 * If `deepLink` is enabled, adjust the deep link scroll to make sure the top of the accordion panel is visible 1728 * @option 1729 * @type {boolean} 1730 * @default false 1731 */ 1732 deepLinkSmudge: false, 1733 1734 /** 1735 * If `deepLinkSmudge` is enabled, animation time (ms) for the deep link adjustment 1736 * @option 1737 * @type {number} 1738 * @default 300 1739 */ 1740 deepLinkSmudgeDelay: 300, 1741 1742 /** 1743 * If `deepLinkSmudge` is enabled, the offset for scrollToTtop to prevent overlap by a sticky element at the top of the page 1744 * @option 1745 * @type {number} 1746 * @default 0 1747 */ 1748 deepLinkSmudgeOffset: 0, 1749 1750 /** 1751 * If `deepLink` is enabled, update the browser history with the open accordion 1752 * @option 1753 * @type {boolean} 1754 * @default false 1755 */ 1756 updateHistory: false 1757}; 1758 1759 1760/***/ }), 1761
1762/***/ "./js/foundation.accordionMenu.js": 1763/*!****************************************!*\ 1764 !*** ./js/foundation.accordionMenu.js ***! 1765 \****************************************/ 1766/*! exports provided: AccordionMenu */ 1767/***/ (function(module, __webpack_exports__, __webpack_require__) { 1768 1769"use strict"; 1770__webpack_require__.r(__webpack_exports__); 1771/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AccordionMenu", function() { return AccordionMenu; }); 1772/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 1773/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 1774/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js"); 1775/* harmony import */ var _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.nest */ "./js/foundation.util.nest.js"); 1776/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 1777/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 1778 1779 1780function _typeof(obj) { 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); } 1781 1782function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 1783 1784function _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); } } 1785 1786function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 1787 1788function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 1789 1790function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 1791 1792function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 1793 1794function _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); } 1795 1796function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 1797 1798 1799 1800 1801 1802 1803/** 1804 * AccordionMenu module. 1805 * @module foundation.accordionMenu 1806 * @requires foundation.util.keyboard 1807 * @requires foundation.util.nest 1808 */ 1809 1810var AccordionMenu = 1811/*#__PURE__*/ 1812function (_Plugin) { 1813 _inherits(AccordionMenu, _Plugin); 1814 1815 function AccordionMenu() { 1816 _classCallCheck(this, AccordionMenu); 1817 1818 return _possibleConstructorReturn(this, _getPrototypeOf(AccordionMenu).apply(this, arguments)); 1819 } 1820 1821 _createClass(AccordionMenu, [{ 1822 key: "_setup", 1823 1824 /** 1825 * Creates a new instance of an accordion menu. 1826 * @class 1827 * @name AccordionMenu 1828 * @fires AccordionMenu#init 1829 * @param {jQuery} element - jQuery object to make into an accordion menu. 1830 * @param {Object} options - Overrides to the default plugin settings. 1831 */ 1832 value: function _setup(element, options) { 1833 this.$element = element; 1834 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, AccordionMenu.defaults, this.$element.data(), options); 1835 this.className = 'AccordionMenu'; // ie9 back compat 1836 1837 this._init(); 1838 1839 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].register('AccordionMenu', { 1840 'ENTER': 'toggle', 1841 'SPACE': 'toggle', 1842 'ARROW_RIGHT': 'open', 1843 'ARROW_UP': 'up', 1844 'ARROW_DOWN': 'down', 1845 'ARROW_LEFT': 'close', 1846 'ESCAPE': 'closeAll' 1847 }); 1848 } 1849 /** 1850 * Initializes the accordion menu by hiding all nested menus. 1851 * @private 1852 */ 1853 1854 }, { 1855 key: "_init", 1856 value: function _init() { 1857 _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__["Nest"].Feather(this.$element, 'accordion'); 1858 1859 var _this = this; 1860 1861 this.$element.find('[data-submenu]').not('.is-active').slideUp(0); //.find('a').css('padding-left', '1rem'); 1862 1863 this.$element.attr({ 1864 'role': 'tree',
vendor: 5,379 bytes, lines 1865-1995
1865 'aria-multiselectable': this.options.multiOpen 1866 }); 1867 this.$menuLinks = this.$element.find('.is-accordion-submenu-parent'); 1868 this.$menuLinks.each(function () { 1869 var linkId = this.id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'acc-menu-link'), 1870 $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 1871 $sub = $elem.children('[data-submenu]'), 1872 subId = $sub[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'acc-menu'), 1873 isActive = $sub.hasClass('is-active'); 1874 1875 if (_this.options.parentLink) { 1876 var $anchor = $elem.children('a'); 1877 $anchor.clone().prependTo($sub).wrap('<li data-is-parent-link class="is-submenu-parent-item is-submenu-item is-accordion-submenu-item"></li>'); 1878 } 1879 1880 if (_this.options.submenuToggle) { 1881 $elem.addClass('has-submenu-toggle'); 1882 $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>'); 1883 } else { 1884 $elem.attr({ 1885 'aria-controls': subId, 1886 'aria-expanded': isActive, 1887 'id': linkId 1888 }); 1889 } 1890 1891 $sub.attr({ 1892 'aria-labelledby': linkId, 1893 'aria-hidden': !isActive, 1894 'role': 'group', 1895 'id': subId 1896 }); 1897 }); 1898 this.$element.find('li').attr({ 1899 'role': 'treeitem' 1900 }); 1901 var initPanes = this.$element.find('.is-active'); 1902 1903 if (initPanes.length) { 1904 initPanes.each(function () { 1905 _this.down(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)); 1906 }); 1907 } 1908 1909 this._events(); 1910 } 1911 /** 1912 * Adds event handlers for items within the menu. 1913 * @private 1914 */ 1915 1916 }, { 1917 key: "_events", 1918 value: function _events() { 1919 var _this = this; 1920 1921 this.$element.find('li').each(function () { 1922 var $submenu = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).children('[data-submenu]'); 1923 1924 if ($submenu.length) { 1925 if (_this.options.submenuToggle) { 1926 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).children('.submenu-toggle').off('click.zf.accordionMenu').on('click.zf.accordionMenu', function (e) { 1927 _this.toggle($submenu); 1928 }); 1929 } else { 1930 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).children('a').off('click.zf.accordionMenu').on('click.zf.accordionMenu', function (e) { 1931 e.preventDefault(); 1932 1933 _this.toggle($submenu); 1934 }); 1935 } 1936 } 1937 }).on('keydown.zf.accordionMenu', function (e) { 1938 var $element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 1939 $elements = $element.parent('ul').children('li'), 1940 $prevElement, 1941 $nextElement, 1942 $target = $element.children('[data-submenu]'); 1943 $elements.each(function (i) { 1944 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is($element)) { 1945 $prevElement = $elements.eq(Math.max(0, i - 1)).find('a').first(); 1946 $nextElement = $elements.eq(Math.min(i + 1, $elements.length - 1)).find('a').first(); 1947 1948 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).children('[data-submenu]:visible').length) { 1949 // has open sub menu 1950 $nextElement = $element.find('li:first-child').find('a').first(); 1951 } 1952 1953 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is(':first-child')) { 1954 // is first element of sub menu 1955 $prevElement = $element.parents('li').first().find('a').first(); 1956 } else if ($prevElement.parents('li').first().children('[data-submenu]:visible').length) { 1957 // if previous element has open sub menu 1958 $prevElement = $prevElement.parents('li').find('li:last-child').find('a').first(); 1959 } 1960 1961 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is(':last-child')) { 1962 // is last element of sub menu 1963 $nextElement = $element.parents('li').first().next('li').find('a').first(); 1964 } 1965 1966 return; 1967 } 1968 }); 1969 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].handleKey(e, 'AccordionMenu', { 1970 open: function open() { 1971 if ($target.is(':hidden')) { 1972 _this.down($target); 1973 1974 $target.find('li').first().find('a').first().focus(); 1975 } 1976 }, 1977 close: function close() { 1978 if ($target.length && !$target.is(':hidden')) { 1979 // close active sub of this item 1980 _this.up($target); 1981 } else if ($element.parent('[data-submenu]').length) { 1982 // close currently open sub 1983 _this.up($element.parent('[data-submenu]')); 1984 1985 $element.parents('li').first().find('a').first().focus(); 1986 } 1987 }, 1988 up: function up() { 1989 $prevElement.focus(); 1990 return true; 1991 }, 1992 down: function down() { 1993 $nextElement.focus(); 1994 return true; 1995 },
vendor: 4,450 bytes, lines 1996-2151
1996 toggle: function toggle() { 1997 if (_this.options.submenuToggle) { 1998 return false; 1999 } 2000 2001 if ($element.children('[data-submenu]').length) { 2002 _this.toggle($element.children('[data-submenu]')); 2003 2004 return true; 2005 } 2006 }, 2007 closeAll: function closeAll() { 2008 _this.hideAll(); 2009 }, 2010 handled: function handled(preventDefault) { 2011 if (preventDefault) { 2012 e.preventDefault(); 2013 } 2014 } 2015 }); 2016 }); //.attr('tabindex', 0); 2017 } 2018 /** 2019 * Closes all panes of the menu. 2020 * @function 2021 */ 2022 2023 }, { 2024 key: "hideAll", 2025 value: function hideAll() { 2026 this.up(this.$element.find('[data-submenu]')); 2027 } 2028 /** 2029 * Opens all panes of the menu. 2030 * @function 2031 */ 2032 2033 }, { 2034 key: "showAll", 2035 value: function showAll() { 2036 this.down(this.$element.find('[data-submenu]')); 2037 } 2038 /** 2039 * Toggles the open/close state of a submenu. 2040 * @function 2041 * @param {jQuery} $target - the submenu to toggle 2042 */ 2043 2044 }, { 2045 key: "toggle", 2046 value: function toggle($target) { 2047 if (!$target.is(':animated')) { 2048 if (!$target.is(':hidden')) { 2049 this.up($target); 2050 } else { 2051 this.down($target); 2052 } 2053 } 2054 } 2055 /** 2056 * Opens the sub-menu defined by `$target`. 2057 * @param {jQuery} $target - Sub-menu to open. 2058 * @fires AccordionMenu#down 2059 */ 2060 2061 }, { 2062 key: "down", 2063 value: function down($target) { 2064 var _this2 = this; 2065 2066 // If having multiple submenus active is disabled, close all the submenus 2067 // that are not parents or children of the targeted submenu. 2068 if (!this.options.multiOpen) { 2069 // The "branch" of the targetted submenu, from the component root to 2070 // the active submenus nested in it. 2071 var $targetBranch = $target.parentsUntil(this.$element).add($target).add($target.find('.is-active')); // All the active submenus that are not in the branch. 2072 2073 var $othersActiveSubmenus = this.$element.find('.is-active').not($targetBranch); 2074 this.up($othersActiveSubmenus); 2075 } 2076 2077 $target.addClass('is-active').attr({ 2078 'aria-hidden': false 2079 }); 2080 2081 if (this.options.submenuToggle) { 2082 $target.prev('.submenu-toggle').attr({ 2083 'aria-expanded': true 2084 }); 2085 } else { 2086 $target.parent('.is-accordion-submenu-parent').attr({ 2087 'aria-expanded': true 2088 }); 2089 } 2090 2091 $target.slideDown(this.options.slideSpeed, function () { 2092 /** 2093 * Fires when the menu is done opening. 2094 * @event AccordionMenu#down 2095 */ 2096 _this2.$element.trigger('down.zf.accordionMenu', [$target]); 2097 }); 2098 } 2099 /** 2100 * Closes the sub-menu defined by `$target`. All sub-menus inside the target will be closed as well. 2101 * @param {jQuery} $target - Sub-menu to close. 2102 * @fires AccordionMenu#up 2103 */ 2104 2105 }, { 2106 key: "up", 2107 value: function up($target) { 2108 var _this3 = this; 2109 2110 var $submenus = $target.find('[data-submenu]'); 2111 var $allmenus = $target.add($submenus); 2112 $submenus.slideUp(0); 2113 $allmenus.removeClass('is-active').attr('aria-hidden', true); 2114 2115 if (this.options.submenuToggle) { 2116 $allmenus.prev('.submenu-toggle').attr('aria-expanded', false); 2117 } else { 2118 $allmenus.parent('.is-accordion-submenu-parent').attr('aria-expanded', false); 2119 } 2120 2121 $target.slideUp(this.options.slideSpeed, function () { 2122 /** 2123 * Fires when the menu is done collapsing up. 2124 * @event AccordionMenu#up 2125 */ 2126 _this3.$element.trigger('up.zf.accordionMenu', [$target]); 2127 }); 2128 } 2129 /** 2130 * Destroys an instance of accordion menu. 2131 * @fires AccordionMenu#destroyed 2132 */ 2133 2134 }, { 2135 key: "_destroy", 2136 value: function _destroy() { 2137 this.$element.find('[data-submenu]').slideDown(0).css('display', ''); 2138 this.$element.find('a').off('click.zf.accordionMenu'); 2139 this.$element.find('[data-is-parent-link]').detach(); 2140 2141 if (this.options.submenuToggle) { 2142 this.$element.find('.has-submenu-toggle').removeClass('has-submenu-toggle'); 2143 this.$element.find('.submenu-toggle').remove(); 2144 } 2145 2146 _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__["Nest"].Burn(this.$element, 'accordion'); 2147 } 2148 }]); 2149 2150 return AccordionMenu; 2151}
2151(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__["Plugin"]); 2152 2153AccordionMenu.defaults = { 2154 /** 2155 * Adds the parent link to the submenu. 2156 * @option 2157 * @type {boolean} 2158 * @default false 2159 */ 2160 parentLink: false, 2161 2162 /** 2163 * Amount of time to animate the opening of a submenu in ms. 2164 * @option 2165 * @type {number} 2166 * @default 250 2167 */ 2168 slideSpeed: 250, 2169 2170 /** 2171 * Adds a separate submenu toggle button. This allows the parent item to have a link. 2172 * @option 2173 * @example true 2174 */ 2175 submenuToggle: false, 2176 2177 /** 2178 * The text used for the submenu toggle if enabled. This is used for screen readers only. 2179 * @option 2180 * @example true 2181 */ 2182 submenuToggleText: 'Toggle menu', 2183 2184 /** 2185 * Allow the menu to have multiple open panes. 2186 * @option 2187 * @type {boolean} 2188 * @default true 2189 */ 2190 multiOpen: true 2191}; 2192 2193 2194/***/ }), 2195
vendor: 10,742 bytes, lines 2196-2470
2196/***/ "./js/foundation.core.js": 2197/*!*******************************!*\ 2198 !*** ./js/foundation.core.js ***! 2199 \*******************************/ 2200/*! exports provided: Foundation */ 2201/***/ (function(module, __webpack_exports__, __webpack_require__) { 2202 2203"use strict"; 2204__webpack_require__.r(__webpack_exports__); 2205/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Foundation", function() { return Foundation; }); 2206/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 2207/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 2208/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 2209/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js"); 2210 2211 2212function _typeof(obj) { 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); } 2213 2214 2215 2216 2217var FOUNDATION_VERSION = '6.6.3'; // Global Foundation object 2218// This is attached to the window, or used as a module for AMD/Browserify 2219 2220var Foundation = { 2221 version: FOUNDATION_VERSION, 2222 2223 /** 2224 * Stores initialized plugins. 2225 */ 2226 _plugins: {}, 2227 2228 /** 2229 * Stores generated unique ids for plugin instances 2230 */ 2231 _uuids: [], 2232 2233 /** 2234 * Defines a Foundation plugin, adding it to the `Foundation` namespace and the list of plugins to initialize when reflowing. 2235 * @param {Object} plugin - The constructor of the plugin. 2236 */ 2237 plugin: function plugin(_plugin, name) { 2238 // Object key to use when adding to global Foundation object 2239 // Examples: Foundation.Reveal, Foundation.OffCanvas 2240 var className = name || functionName(_plugin); // Object key to use when storing the plugin, also used to create the identifying data attribute for the plugin 2241 // Examples: data-reveal, data-off-canvas 2242 2243 var attrName = hyphenate(className); // Add to the Foundation object and the plugins list (for reflowing) 2244 2245 this._plugins[attrName] = this[className] = _plugin; 2246 }, 2247 2248 /** 2249 * @function 2250 * Populates the _uuids array with pointers to each individual plugin instance. 2251 * Adds the `zfPlugin` data-attribute to programmatically created plugins to allow use of $(selector).foundation(method) calls. 2252 * Also fires the initialization event for each plugin, consolidating repetitive code. 2253 * @param {Object} plugin - an instance of a plugin, usually `this` in context. 2254 * @param {String} name - the name of the plugin, passed as a camelCased string. 2255 * @fires Plugin#init 2256 */ 2257 registerPlugin: function registerPlugin(plugin, name) { 2258 var pluginName = name ? hyphenate(name) : functionName(plugin.constructor).toLowerCase(); 2259 plugin.uuid = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["GetYoDigits"])(6, pluginName); 2260 2261 if (!plugin.$element.attr("data-".concat(pluginName))) { 2262 plugin.$element.attr("data-".concat(pluginName), plugin.uuid); 2263 } 2264 2265 if (!plugin.$element.data('zfPlugin')) { 2266 plugin.$element.data('zfPlugin', plugin); 2267 } 2268 /** 2269 * Fires when the plugin has initialized. 2270 * @event Plugin#init 2271 */ 2272 2273 2274 plugin.$element.trigger("init.zf.".concat(pluginName)); 2275 2276 this._uuids.push(plugin.uuid); 2277 2278 return; 2279 }, 2280 2281 /** 2282 * @function 2283 * Removes the plugins uuid from the _uuids array. 2284 * Removes the zfPlugin data attribute, as well as the data-plugin-name attribute. 2285 * Also fires the destroyed event for the plugin, consolidating repetitive code. 2286 * @param {Object} plugin - an instance of a plugin, usually `this` in context. 2287 * @fires Plugin#destroyed 2288 */ 2289 unregisterPlugin: function unregisterPlugin(plugin) { 2290 var pluginName = hyphenate(functionName(plugin.$element.data('zfPlugin').constructor)); 2291 2292 this._uuids.splice(this._uuids.indexOf(plugin.uuid), 1); 2293 2294 plugin.$element.removeAttr("data-".concat(pluginName)).removeData('zfPlugin') 2295 /** 2296 * Fires when the plugin has been destroyed. 2297 * @event Plugin#destroyed 2298 */ 2299 .trigger("destroyed.zf.".concat(pluginName)); 2300 2301 for (var prop in plugin) { 2302 plugin[prop] = null; //clean up script to prep for garbage collection. 2303 } 2304 2305 return; 2306 }, 2307 2308 /** 2309 * @function 2310 * Causes one or more active plugins to re-initialize, resetting event listeners, recalculating positions, etc. 2311 * @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'` 2312 * @default If no argument is passed, reflow all currently active plugins. 2313 */ 2314 reInit: function reInit(plugins) { 2315 var isJQ = plugins instanceof jquery__WEBPACK_IMPORTED_MODULE_0___default.a; 2316 2317 try { 2318 if (isJQ) { 2319 plugins.each(function () { 2320 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('zfPlugin')._init(); 2321 }); 2322 } else { 2323 var type = _typeof(plugins), 2324 _this = this, 2325 fns = { 2326 'object': function object(plgs) { 2327 plgs.forEach(function (p) { 2328 p = hyphenate(p); 2329 jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-' + p + ']').foundation('_init'); 2330 }); 2331 }, 2332 'string': function string() { 2333 plugins = hyphenate(plugins); 2334 jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-' + plugins + ']').foundation('_init'); 2335 }, 2336 'undefined': function undefined() { 2337 this['object'](Object.keys(_this._plugins)); 2338 } 2339 }; 2340 2341 fns[type](plugins); 2342 } 2343 } catch (err) { 2344 console.error(err); 2345 } finally { 2346 return plugins; 2347 } 2348 }, 2349 2350 /** 2351 * Initialize plugins on any elements within `elem` (and `elem` itself) that aren't already initialized. 2352 * @param {Object} elem - jQuery object containing the element to check inside. Also checks the element itself, unless it's the `document` object. 2353 * @param {String|Array} plugins - A list of plugins to initialize. Leave this out to initialize everything. 2354 */ 2355 reflow: function reflow(elem, plugins) { 2356 // If plugins is undefined, just grab everything 2357 if (typeof plugins === 'undefined') { 2358 plugins = Object.keys(this._plugins); 2359 } // If plugins is a string, convert it to an array with one item 2360 else if (typeof plugins === 'string') { 2361 plugins = [plugins]; 2362 } 2363 2364 var _this = this; // Iterate through each plugin 2365 2366 2367 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.each(plugins, function (i, name) { 2368 // Get the current plugin 2369 var plugin = _this._plugins[name]; // Localize the search to all elements inside elem, as well as elem itself, unless elem === document 2370 2371 var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(elem).find('[data-' + name + ']').addBack('[data-' + name + ']').filter(function () { 2372 return typeof jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data("zfPlugin") === 'undefined'; 2373 }); // For each plugin found, initialize it 2374 2375 $elem.each(function () { 2376 var $el = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 2377 opts = { 2378 reflow: true 2379 }; 2380 2381 if ($el.attr('data-options')) { 2382 $el.attr('data-options').split(';').forEach(function (option, _index) { 2383 var opt = option.split(':').map(function (el) { 2384 return el.trim(); 2385 }); 2386 if (opt[0]) opts[opt[0]] = parseValue(opt[1]); 2387 }); 2388 } 2389 2390 try { 2391 $el.data('zfPlugin', new plugin(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), opts)); 2392 } catch (er) { 2393 console.error(er); 2394 } finally { 2395 return; 2396 } 2397 }); 2398 }); 2399 }, 2400 getFnName: functionName, 2401 addToJquery: function addToJquery($) { 2402 // TODO: consider not making this a jQuery function 2403 // TODO: need way to reflow vs. re-initialize 2404 2405 /** 2406 * The Foundation jQuery method. 2407 * @param {String|Array} method - An action to perform on the current jQuery object. 2408 */ 2409 var foundation = function foundation(method) { 2410 var type = _typeof(method), 2411 $noJS = $('.no-js'); 2412 2413 if ($noJS.length) { 2414 $noJS.removeClass('no-js'); 2415 } 2416 2417 if (type === 'undefined') { 2418 //needs to initialize the Foundation object, or an individual plugin. 2419 _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__["MediaQuery"]._init(); 2420 2421 Foundation.reflow(this); 2422 } else if (type === 'string') { 2423 //an individual method to invoke on a plugin or group of plugins 2424 var args = Array.prototype.slice.call(arguments, 1); //collect all the arguments, if necessary 2425 2426 var plugClass = this.data('zfPlugin'); //determine the class of plugin 2427 2428 if (typeof plugClass !== 'undefined' && typeof plugClass[method] !== 'undefined') { 2429 //make sure both the class and method exist 2430 if (this.length === 1) { 2431 //if there's only one, call it directly. 2432 plugClass[method].apply(plugClass, args); 2433 } else { 2434 this.each(function (i, el) { 2435 //otherwise loop through the jQuery collection and invoke the method on each 2436 plugClass[method].apply($(el).data('zfPlugin'), args); 2437 }); 2438 } 2439 } else { 2440 //error for no class or no method 2441 throw new ReferenceError("We're sorry, '" + method + "' is not an available method for " + (plugClass ? functionName(plugClass) : 'this element') + '.'); 2442 } 2443 } else { 2444 //error for invalid argument type 2445 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.")); 2446 } 2447 2448 return this; 2449 }; 2450 2451 $.fn.foundation = foundation; 2452 return $; 2453 } 2454}; 2455Foundation.util = { 2456 /** 2457 * Function for applying a debounce effect to a function call. 2458 * @function 2459 * @param {Function} func - Function to be called at end of timeout. 2460 * @param {Number} delay - Time in ms to delay the call of `func`. 2461 * @returns function 2462 */ 2463 throttle: function throttle(func, delay) { 2464 var timer = null; 2465 return function () { 2466 var context = this, 2467 args = arguments; 2468 2469 if (timer === null) { 2470 timer = setTimeout(function () {
vendor: 2,942 bytes, lines 2471-2572
2471 func.apply(context, args); 2472 timer = null; 2473 }, delay); 2474 } 2475 }; 2476 } 2477}; 2478window.Foundation = Foundation; // Polyfill for requestAnimationFrame 2479 2480(function () { 2481 if (!Date.now || !window.Date.now) window.Date.now = Date.now = function () { 2482 return new Date().getTime(); 2483 }; 2484 var vendors = ['webkit', 'moz']; 2485 2486 for (var i = 0; i < vendors.length && !window.requestAnimationFrame; ++i) { 2487 var vp = vendors[i]; 2488 window.requestAnimationFrame = window[vp + 'RequestAnimationFrame']; 2489 window.cancelAnimationFrame = window[vp + 'CancelAnimationFrame'] || window[vp + 'CancelRequestAnimationFrame']; 2490 } 2491 2492 if (/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent) || !window.requestAnimationFrame || !window.cancelAnimationFrame) { 2493 var lastTime = 0; 2494 2495 window.requestAnimationFrame = function (callback) { 2496 var now = Date.now(); 2497 var nextTime = Math.max(lastTime + 16, now); 2498 return setTimeout(function () { 2499 callback(lastTime = nextTime); 2500 }, nextTime - now); 2501 }; 2502 2503 window.cancelAnimationFrame = clearTimeout; 2504 } 2505 /** 2506 * Polyfill for performance.now, required by rAF 2507 */ 2508 2509 2510 if (!window.performance || !window.performance.now) { 2511 window.performance = { 2512 start: Date.now(), 2513 now: function now() { 2514 return Date.now() - this.start; 2515 } 2516 }; 2517 } 2518})(); 2519 2520if (!Function.prototype.bind) { 2521 Function.prototype.bind = function (oThis) { 2522 if (typeof this !== 'function') { 2523 // closest thing possible to the ECMAScript 5 2524 // internal IsCallable function 2525 throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable'); 2526 } 2527 2528 var aArgs = Array.prototype.slice.call(arguments, 1), 2529 fToBind = this, 2530 fNOP = function fNOP() {}, 2531 fBound = function fBound() { 2532 return fToBind.apply(this instanceof fNOP ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments))); 2533 }; 2534 2535 if (this.prototype) { 2536 // native functions don't have a prototype 2537 fNOP.prototype = this.prototype; 2538 } 2539 2540 fBound.prototype = new fNOP(); 2541 return fBound; 2542 }; 2543} // Polyfill to get the name of a function in IE9 2544 2545 2546function functionName(fn) { 2547 if (typeof Function.prototype.name === 'undefined') { 2548 var funcNameRegex = /function\s([^(]{1,})\(/; 2549 var results = funcNameRegex.exec(fn.toString()); 2550 return results && results.length > 1 ? results[1].trim() : ""; 2551 } else if (typeof fn.prototype === 'undefined') { 2552 return fn.constructor.name; 2553 } else { 2554 return fn.prototype.constructor.name; 2555 } 2556} 2557 2558function parseValue(str) { 2559 if ('true' === str) return true;else if ('false' === str) return false;else if (!isNaN(str * 1)) return parseFloat(str); 2560 return str; 2561} // Convert PascalCase to kebab-case 2562// Thank you: http://stackoverflow.com/a/8955580 2563 2564 2565function hyphenate(str) { 2566 return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(); 2567} 2568 2569 2570 2571/***/ }), 2572
2573/***/ "./js/foundation.core.plugin.js": 2574/*!**************************************!*\ 2575 !*** ./js/foundation.core.plugin.js ***! 2576 \**************************************/ 2577/*! exports provided: Plugin */ 2578/***/ (function(module, __webpack_exports__, __webpack_require__) { 2579 2580"use strict"; 2581__webpack_require__.r(__webpack_exports__); 2582/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Plugin", function() { return Plugin; }); 2583/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 2584/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 2585/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 2586 2587 2588function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 2589 2590function _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); } } 2591 2592function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 2593 2594 2595 // Abstract class for providing lifecycle hooks. Expect plugins to define AT LEAST 2596// {function} _setup (replaces previous constructor), 2597// {function} _destroy (replaces previous destroy) 2598 2599var Plugin = 2600/*#__PURE__*/ 2601function () { 2602 function Plugin(element, options) { 2603 _classCallCheck(this, Plugin); 2604 2605 this._setup(element, options); 2606 2607 var pluginName = getPluginName(this); 2608 this.uuid = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["GetYoDigits"])(6, pluginName); 2609 2610 if (!this.$element.attr("data-".concat(pluginName))) { 2611 this.$element.attr("data-".concat(pluginName), this.uuid); 2612 } 2613 2614 if (!this.$element.data('zfPlugin')) { 2615 this.$element.data('zfPlugin', this); 2616 } 2617 /** 2618 * Fires when the plugin has initialized. 2619 * @event Plugin#init 2620 */ 2621 2622 2623 this.$element.trigger("init.zf.".concat(pluginName)); 2624 } 2625 2626 _createClass(Plugin, [{ 2627 key: "destroy", 2628 value: function destroy() { 2629 this._destroy(); 2630 2631 var pluginName = getPluginName(this); 2632 this.$element.removeAttr("data-".concat(pluginName)).removeData('zfPlugin') 2633 /** 2634 * Fires when the plugin has been destroyed. 2635 * @event Plugin#destroyed 2636 */ 2637 .trigger("destroyed.zf.".concat(pluginName)); 2638 2639 for (var prop in this) { 2640 this[prop] = null; //clean up script to prep for garbage collection. 2641 } 2642 } 2643 }]); 2644 2645 return Plugin; 2646}(); // Convert PascalCase to kebab-case 2647// Thank you: http://stackoverflow.com/a/8955580 2648 2649 2650function hyphenate(str) { 2651 return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(); 2652} 2653 2654function getPluginName(obj) { 2655 return hyphenate(obj.className); 2656} 2657 2658 2659 2660/***/ }), 2661
vendor: 5,122 bytes, lines 2662-2795
2662/***/ "./js/foundation.core.utils.js": 2663/*!*************************************!*\ 2664 !*** ./js/foundation.core.utils.js ***! 2665 \*************************************/ 2666/*! exports provided: rtl, GetYoDigits, RegExpEscape, transitionend, onLoad, ignoreMousedisappear */ 2667/***/ (function(module, __webpack_exports__, __webpack_require__) { 2668 2669"use strict"; 2670__webpack_require__.r(__webpack_exports__); 2671/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rtl", function() { return rtl; }); 2672/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GetYoDigits", function() { return GetYoDigits; }); 2673/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RegExpEscape", function() { return RegExpEscape; }); 2674/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transitionend", function() { return transitionend; }); 2675/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onLoad", function() { return onLoad; }); 2676/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ignoreMousedisappear", function() { return ignoreMousedisappear; }); 2677/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 2678/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 2679 2680 2681 // Core Foundation Utilities, utilized in a number of places. 2682 2683/** 2684 * Returns a boolean for RTL support 2685 */ 2686 2687function rtl() { 2688 return jquery__WEBPACK_IMPORTED_MODULE_0___default()('html').attr('dir') === 'rtl'; 2689} 2690/** 2691 * returns a random base-36 uid with namespacing 2692 * @function 2693 * @param {Number} length - number of random base-36 digits desired. Increase for more random strings. 2694 * @param {String} namespace - name of plugin to be incorporated in uid, optional. 2695 * @default {String} '' - if no plugin name is provided, nothing is appended to the uid. 2696 * @returns {String} - unique id 2697 */ 2698 2699 2700function GetYoDigits() { 2701 var length = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 6; 2702 var namespace = arguments.length > 1 ? arguments[1] : undefined; 2703 var str = ''; 2704 var chars = '0123456789abcdefghijklmnopqrstuvwxyz'; 2705 var charsLength = chars.length; 2706 2707 for (var i = 0; i < length; i++) { 2708 str += chars[Math.floor(Math.random() * charsLength)]; 2709 } 2710 2711 return namespace ? "".concat(str, "-").concat(namespace) : str; 2712} 2713/** 2714 * Escape a string so it can be used as a regexp pattern 2715 * @function 2716 * @see https://stackoverflow.com/a/9310752/4317384 2717 * 2718 * @param {String} str - string to escape. 2719 * @returns {String} - escaped string 2720 */ 2721 2722 2723function RegExpEscape(str) { 2724 return str.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); 2725} 2726 2727function transitionend($elem) { 2728 var transitions = { 2729 'transition': 'transitionend', 2730 'WebkitTransition': 'webkitTransitionEnd', 2731 'MozTransition': 'transitionend', 2732 'OTransition': 'otransitionend' 2733 }; 2734 var elem = document.createElement('div'), 2735 end; 2736 2737 for (var transition in transitions) { 2738 if (typeof elem.style[transition] !== 'undefined') { 2739 end = transitions[transition]; 2740 } 2741 } 2742 2743 if (end) { 2744 return end; 2745 } else { 2746 setTimeout(function () { 2747 $elem.triggerHandler('transitionend', [$elem]); 2748 }, 1); 2749 return 'transitionend'; 2750 } 2751} 2752/** 2753 * Return an event type to listen for window load. 2754 * 2755 * If `$elem` is passed, an event will be triggered on `$elem`. If window is already loaded, the event will still be triggered. 2756 * If `handler` is passed, attach it to the event on `$elem`. 2757 * Calling `onLoad` without handler allows you to get the event type that will be triggered before attaching the handler by yourself. 2758 * @function 2759 * 2760 * @param {Object} [] $elem - jQuery element on which the event will be triggered if passed. 2761 * @param {Function} [] handler - function to attach to the event. 2762 * @returns {String} - event type that should or will be triggered. 2763 */ 2764 2765 2766function onLoad($elem, handler) { 2767 var didLoad = document.readyState === 'complete'; 2768 var eventType = (didLoad ? '_didLoad' : 'load') + '.zf.util.onLoad'; 2769 2770 var cb = function cb() { 2771 return $elem.triggerHandler(eventType); 2772 }; 2773 2774 if ($elem) { 2775 if (handler) $elem.one(eventType, handler); 2776 if (didLoad) setTimeout(cb);else jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).one('load', cb); 2777 } 2778 2779 return eventType; 2780} 2781/** 2782 * Retuns an handler for the `mouseleave` that ignore disappeared mouses. 2783 * 2784 * If the mouse "disappeared" from the document (like when going on a browser UI element, See https://git.io/zf-11410), 2785 * the event is ignored. 2786 * - If the `ignoreLeaveWindow` is `true`, the event is ignored when the user actually left the window 2787 * (like by switching to an other window with [Alt]+[Tab]). 2788 * - If the `ignoreReappear` is `true`, the event will be ignored when the mouse will reappear later on the document 2789 * outside of the element it left. 2790 * 2791 * @function 2792 * 2793 * @param {Function} [] handler - handler for the filtered `mouseleave` event to watch. 2794 * @param {Object} [] options - object of options: 2795 * - {Boolean}
2795 [false] ignoreLeaveWindow - also ignore when the user switched windows. 2796 * - {Boolean} [false] ignoreReappear - also ignore when the mouse reappeared outside of the element it left. 2797 * @returns {Function} - filtered handler to use to listen on the `mouseleave` event. 2798 */ 2799 2800 2801function ignoreMousedisappear(handler) { 2802 var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, 2803 _ref$ignoreLeaveWindo = _ref.ignoreLeaveWindow, 2804 ignoreLeaveWindow = _ref$ignoreLeaveWindo === void 0 ? false : _ref$ignoreLeaveWindo, 2805 _ref$ignoreReappear = _ref.ignoreReappear, 2806 ignoreReappear = _ref$ignoreReappear === void 0 ? false : _ref$ignoreReappear; 2807 2808 return function leaveEventHandler(eLeave) { 2809 for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { 2810 rest[_key - 1] = arguments[_key]; 2811 } 2812 2813 var callback = handler.bind.apply(handler, [this, eLeave].concat(rest)); // The mouse left: call the given callback if the mouse entered elsewhere 2814 2815 if (eLeave.relatedTarget !== null) { 2816 return callback(); 2817 } // Otherwise, check if the mouse actually left the window. 2818 // In firefox if the user switched between windows, the window sill have the focus by the time 2819 // the event is triggered. We have to debounce the event to test this case. 2820 2821 2822 setTimeout(function leaveEventDebouncer() { 2823 if (!ignoreLeaveWindow && document.hasFocus && !document.hasFocus()) { 2824 return callback(); 2825 } // Otherwise, wait for the mouse to reeapear outside of the element, 2826 2827 2828 if (!ignoreReappear) { 2829 jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).one('mouseenter', function reenterEventHandler(eReenter) { 2830 if (!jquery__WEBPACK_IMPORTED_MODULE_0___default()(eLeave.currentTarget).has(eReenter.target).length) { 2831 // Fill where the mouse finally entered. 2832 eLeave.relatedTarget = eReenter.target; 2833 callback(); 2834 } 2835 }); 2836 } 2837 }, 0); 2838 }; 2839} 2840 2841 2842 2843/***/ }), 2844
vendor: 4,843 bytes, lines 2845-2926
2845/***/ "./js/foundation.drilldown.js": 2846/*!************************************!*\ 2847 !*** ./js/foundation.drilldown.js ***! 2848 \************************************/ 2849/*! exports provided: Drilldown */ 2850/***/ (function(module, __webpack_exports__, __webpack_require__) { 2851 2852"use strict"; 2853__webpack_require__.r(__webpack_exports__); 2854/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Drilldown", function() { return Drilldown; }); 2855/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 2856/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 2857/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js"); 2858/* harmony import */ var _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.nest */ "./js/foundation.util.nest.js"); 2859/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 2860/* harmony import */ var _foundation_util_box__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.box */ "./js/foundation.util.box.js"); 2861/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 2862 2863 2864function _typeof(obj) { 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); } 2865 2866function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 2867 2868function _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); } } 2869 2870function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 2871 2872function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 2873 2874function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 2875 2876function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 2877 2878function _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); } 2879 2880function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 2881 2882 2883 2884 2885 2886 2887 2888/** 2889 * Drilldown module. 2890 * @module foundation.drilldown 2891 * @requires foundation.util.keyboard 2892 * @requires foundation.util.nest 2893 * @requires foundation.util.box 2894 */ 2895 2896var Drilldown = 2897/*#__PURE__*/ 2898function (_Plugin) { 2899 _inherits(Drilldown, _Plugin); 2900 2901 function Drilldown() { 2902 _classCallCheck(this, Drilldown); 2903 2904 return _possibleConstructorReturn(this, _getPrototypeOf(Drilldown).apply(this, arguments)); 2905 } 2906 2907 _createClass(Drilldown, [{ 2908 key: "_setup", 2909 2910 /** 2911 * Creates a new instance of a drilldown menu. 2912 * @class 2913 * @name Drilldown 2914 * @param {jQuery} element - jQuery object to make into an accordion menu. 2915 * @param {Object} options - Overrides to the default plugin settings. 2916 */ 2917 value: function _setup(element, options) { 2918 this.$element = element; 2919 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Drilldown.defaults, this.$element.data(), options); 2920 this.className = 'Drilldown'; // ie9 back compat 2921 2922 this._init(); 2923 2924 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].register('Drilldown', { 2925 'ENTER': 'open', 2926 'SPACE': 'open',
vendor: 9,467 bytes, lines 2927-3190
2927 'ARROW_RIGHT': 'next', 2928 'ARROW_UP': 'up', 2929 'ARROW_DOWN': 'down', 2930 'ARROW_LEFT': 'previous', 2931 'ESCAPE': 'close', 2932 'TAB': 'down', 2933 'SHIFT_TAB': 'up' 2934 }); 2935 } 2936 /** 2937 * Initializes the drilldown by creating jQuery collections of elements 2938 * @private 2939 */ 2940 2941 }, { 2942 key: "_init", 2943 value: function _init() { 2944 _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__["Nest"].Feather(this.$element, 'drilldown'); 2945 2946 if (this.options.autoApplyClass) { 2947 this.$element.addClass('drilldown'); 2948 } 2949 2950 this.$element.attr({ 2951 'role': 'tree', 2952 'aria-multiselectable': false 2953 }); 2954 this.$submenuAnchors = this.$element.find('li.is-drilldown-submenu-parent').children('a'); 2955 this.$submenus = this.$submenuAnchors.parent('li').children('[data-submenu]').attr('role', 'group'); 2956 this.$menuItems = this.$element.find('li').not('.js-drilldown-back').attr('role', 'treeitem').find('a'); // Set the main menu as current by default (unless a submenu is selected) 2957 // Used to set the wrapper height when the drilldown is closed/reopened from any (sub)menu 2958 2959 this.$currentMenu = this.$element; 2960 this.$element.attr('data-mutate', this.$element.attr('data-drilldown') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'drilldown')); 2961 2962 this._prepareMenu(); 2963 2964 this._registerEvents(); 2965 2966 this._keyboardEvents(); 2967 } 2968 /** 2969 * prepares drilldown menu by setting attributes to links and elements 2970 * sets a min height to prevent content jumping 2971 * wraps the element if not already wrapped 2972 * @private 2973 * @function 2974 */ 2975 2976 }, { 2977 key: "_prepareMenu", 2978 value: function _prepareMenu() { 2979 var _this = this; // if(!this.options.holdOpen){ 2980 // this._menuLinkEvents(); 2981 // } 2982 2983 2984 this.$submenuAnchors.each(function () { 2985 var $link = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this); 2986 var $sub = $link.parent(); 2987 2988 if (_this.options.parentLink) { 2989 $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>'); 2990 } 2991 2992 $link.data('savedHref', $link.attr('href')).removeAttr('href').attr('tabindex', 0); 2993 $link.children('[data-submenu]').attr({ 2994 'aria-hidden': true, 2995 'tabindex': 0, 2996 'role': 'group' 2997 }); 2998 2999 _this._events($link); 3000 }); 3001 this.$submenus.each(function () { 3002 var $menu = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 3003 $back = $menu.find('.js-drilldown-back'); 3004 3005 if (!$back.length) { 3006 switch (_this.options.backButtonPosition) { 3007 case "bottom": 3008 $menu.append(_this.options.backButton); 3009 break; 3010 3011 case "top": 3012 $menu.prepend(_this.options.backButton); 3013 break; 3014 3015 default: 3016 console.error("Unsupported backButtonPosition value '" + _this.options.backButtonPosition + "'"); 3017 } 3018 } 3019 3020 _this._back($menu); 3021 }); 3022 this.$submenus.addClass('invisible'); 3023 3024 if (!this.options.autoHeight) { 3025 this.$submenus.addClass('drilldown-submenu-cover-previous'); 3026 } // create a wrapper on element if it doesn't exist. 3027 3028 3029 if (!this.$element.parent().hasClass('is-drilldown')) { 3030 this.$wrapper = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.options.wrapper).addClass('is-drilldown'); 3031 if (this.options.animateHeight) this.$wrapper.addClass('animate-height'); 3032 this.$element.wrap(this.$wrapper); 3033 } // set wrapper 3034 3035 3036 this.$wrapper = this.$element.parent(); 3037 this.$wrapper.css(this._getMaxDims()); 3038 } 3039 }, { 3040 key: "_resize", 3041 value: function _resize() { 3042 this.$wrapper.css({ 3043 'max-width': 'none', 3044 'min-height': 'none' 3045 }); // _getMaxDims has side effects (boo) but calling it should update all other necessary heights & widths 3046 3047 this.$wrapper.css(this._getMaxDims()); 3048 } 3049 /** 3050 * Adds event handlers to elements in the menu. 3051 * @function 3052 * @private 3053 * @param {jQuery} $elem - the current menu item to add handlers to. 3054 */ 3055 3056 }, { 3057 key: "_events", 3058 value: function _events($elem) { 3059 var _this = this; 3060 3061 $elem.off('click.zf.drilldown').on('click.zf.drilldown', function (e) { 3062 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).parentsUntil('ul', 'li').hasClass('is-drilldown-submenu-parent')) { 3063 e.preventDefault(); 3064 } // if(e.target !== e.currentTarget.firstElementChild){ 3065 // return false; 3066 // } 3067 3068 3069 _this._show($elem.parent('li')); 3070 3071 if (_this.options.closeOnClick) { 3072 var $body = jquery__WEBPACK_IMPORTED_MODULE_0___default()('body'); 3073 $body.off('.zf.drilldown').on('click.zf.drilldown', function (e) { 3074 if (e.target === _this.$element[0] || jquery__WEBPACK_IMPORTED_MODULE_0___default.a.contains(_this.$element[0], e.target)) { 3075 return; 3076 } 3077 3078 e.preventDefault(); 3079 3080 _this._hideAll(); 3081 3082 $body.off('.zf.drilldown'); 3083 }); 3084 } 3085 }); 3086 } 3087 /** 3088 * Adds event handlers to the menu element. 3089 * @function 3090 * @private 3091 */ 3092 3093 }, { 3094 key: "_registerEvents", 3095 value: function _registerEvents() { 3096 if (this.options.scrollTop) { 3097 this._bindHandler = this._scrollTop.bind(this); 3098 this.$element.on('open.zf.drilldown hide.zf.drilldown close.zf.drilldown closed.zf.drilldown', this._bindHandler); 3099 } 3100 3101 this.$element.on('mutateme.zf.trigger', this._resize.bind(this)); 3102 } 3103 /** 3104 * Scroll to Top of Element or data-scroll-top-element 3105 * @function 3106 * @fires Drilldown#scrollme 3107 */ 3108 3109 }, { 3110 key: "_scrollTop", 3111 value: function _scrollTop() { 3112 var _this = this; 3113 3114 var $scrollTopElement = _this.options.scrollTopElement != '' ? jquery__WEBPACK_IMPORTED_MODULE_0___default()(_this.options.scrollTopElement) : _this.$element, 3115 scrollPos = parseInt($scrollTopElement.offset().top + _this.options.scrollTopOffset, 10); 3116 jquery__WEBPACK_IMPORTED_MODULE_0___default()('html, body').stop(true).animate({ 3117 scrollTop: scrollPos 3118 }, _this.options.animationDuration, _this.options.animationEasing, function () { 3119 /** 3120 * Fires after the menu has scrolled 3121 * @event Drilldown#scrollme 3122 */ 3123 if (this === jquery__WEBPACK_IMPORTED_MODULE_0___default()('html')[0]) _this.$element.trigger('scrollme.zf.drilldown'); 3124 }); 3125 } 3126 /** 3127 * Adds keydown event listener to `li`'s in the menu. 3128 * @private 3129 */ 3130 3131 }, { 3132 key: "_keyboardEvents", 3133 value: function _keyboardEvents() { 3134 var _this = this; 3135 3136 this.$menuItems.add(this.$element.find('.js-drilldown-back > a, .is-submenu-parent-item > a')).on('keydown.zf.drilldown', function (e) { 3137 var $element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 3138 $elements = $element.parent('li').parent('ul').children('li').children('a'), 3139 $prevElement, 3140 $nextElement; 3141 $elements.each(function (i) { 3142 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is($element)) { 3143 $prevElement = $elements.eq(Math.max(0, i - 1)); 3144 $nextElement = $elements.eq(Math.min(i + 1, $elements.length - 1)); 3145 return; 3146 } 3147 }); 3148 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].handleKey(e, 'Drilldown', { 3149 next: function next() { 3150 if ($element.is(_this.$submenuAnchors)) { 3151 _this._show($element.parent('li')); 3152 3153 $element.parent('li').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($element), function () { 3154 $element.parent('li').find('ul li a').not('.js-drilldown-back a').first().focus(); 3155 }); 3156 return true; 3157 } 3158 }, 3159 previous: function previous() { 3160 _this._hide($element.parent('li').parent('ul')); 3161 3162 $element.parent('li').parent('ul').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($element), function () { 3163 setTimeout(function () { 3164 $element.parent('li').parent('ul').parent('li').children('a').first().focus(); 3165 }, 1); 3166 }); 3167 return true; 3168 }, 3169 up: function up() { 3170 $prevElement.focus(); // Don't tap focus on first element in root ul 3171 3172 return !$element.is(_this.$element.find('> li:first-child > a')); 3173 }, 3174 down: function down() { 3175 $nextElement.focus(); // Don't tap focus on last element in root ul 3176 3177 return !$element.is(_this.$element.find('> li:last-child > a')); 3178 }, 3179 close: function close() { 3180 // Don't close on element in root ul 3181 if (!$element.is(_this.$element.find('> li > a'))) { 3182 _this._hide($element.parent().parent()); 3183 3184 $element.parent().parent().siblings('a').focus(); 3185 } 3186 }, 3187 open: function open() { 3188 if (_this.options.parentLink && $element.attr('href')) { 3189 // Link with href 3190 return false;
vendor: 4,589 bytes, lines 3191-3336
3191 } else if (!$element.is(_this.$menuItems)) { 3192 // not menu item means back button 3193 _this._hide($element.parent('li').parent('ul')); 3194 3195 $element.parent('li').parent('ul').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($element), function () { 3196 setTimeout(function () { 3197 $element.parent('li').parent('ul').parent('li').children('a').first().focus(); 3198 }, 1); 3199 }); 3200 return true; 3201 } else if ($element.is(_this.$submenuAnchors)) { 3202 // Sub menu item 3203 _this._show($element.parent('li')); 3204 3205 $element.parent('li').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($element), function () { 3206 $element.parent('li').find('ul li a').not('.js-drilldown-back a').first().focus(); 3207 }); 3208 return true; 3209 } 3210 }, 3211 handled: function handled(preventDefault) { 3212 if (preventDefault) { 3213 e.preventDefault(); 3214 } 3215 } 3216 }); 3217 }); // end keyboardAccess 3218 } 3219 /** 3220 * Closes all open elements, and returns to root menu. 3221 * @function 3222 * @fires Drilldown#close 3223 * @fires Drilldown#closed 3224 */ 3225 3226 }, { 3227 key: "_hideAll", 3228 value: function _hideAll() { 3229 var _this2 = this; 3230 3231 var $elem = this.$element.find('.is-drilldown-submenu.is-active'); 3232 $elem.addClass('is-closing'); 3233 3234 if (this.options.autoHeight) { 3235 var calcHeight = $elem.parent().closest('ul').data('calcHeight'); 3236 this.$wrapper.css({ 3237 height: calcHeight 3238 }); 3239 } 3240 /** 3241 * Fires when the menu is closing. 3242 * @event Drilldown#close 3243 */ 3244 3245 3246 this.$element.trigger('close.zf.drilldown'); 3247 $elem.one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($elem), function () { 3248 $elem.removeClass('is-active is-closing'); 3249 /** 3250 * Fires when the menu is fully closed. 3251 * @event Drilldown#closed 3252 */ 3253 3254 _this2.$element.trigger('closed.zf.drilldown'); 3255 }); 3256 } 3257 /** 3258 * Adds event listener for each `back` button, and closes open menus. 3259 * @function 3260 * @fires Drilldown#back 3261 * @param {jQuery} $elem - the current sub-menu to add `back` event. 3262 */ 3263 3264 }, { 3265 key: "_back", 3266 value: function _back($elem) { 3267 var _this = this; 3268 3269 $elem.off('click.zf.drilldown'); 3270 $elem.children('.js-drilldown-back').on('click.zf.drilldown', function (e) { 3271 // console.log('mouseup on back'); 3272 _this._hide($elem); // If there is a parent submenu, call show 3273 3274 3275 var parentSubMenu = $elem.parent('li').parent('ul').parent('li'); 3276 3277 if (parentSubMenu.length) { 3278 _this._show(parentSubMenu); 3279 } 3280 }); 3281 } 3282 /** 3283 * Adds event listener to menu items w/o submenus to close open menus on click. 3284 * @function 3285 * @private 3286 */ 3287 3288 }, { 3289 key: "_menuLinkEvents", 3290 value: function _menuLinkEvents() { 3291 var _this = this; 3292 3293 this.$menuItems.not('.is-drilldown-submenu-parent').off('click.zf.drilldown').on('click.zf.drilldown', function (e) { 3294 setTimeout(function () { 3295 _this._hideAll(); 3296 }, 0); 3297 }); 3298 } 3299 /** 3300 * Sets the CSS classes for submenu to show it. 3301 * @function 3302 * @private 3303 * @param {jQuery} $elem - the target submenu (`ul` tag) 3304 * @param {boolean} trigger - trigger drilldown event 3305 */ 3306 3307 }, { 3308 key: "_setShowSubMenuClasses", 3309 value: function _setShowSubMenuClasses($elem, trigger) { 3310 $elem.addClass('is-active').removeClass('invisible').attr('aria-hidden', false); 3311 $elem.parent('li').attr('aria-expanded', true); 3312 3313 if (trigger === true) { 3314 this.$element.trigger('open.zf.drilldown', [$elem]); 3315 } 3316 } 3317 /** 3318 * Sets the CSS classes for submenu to hide it. 3319 * @function 3320 * @private 3321 * @param {jQuery} $elem - the target submenu (`ul` tag) 3322 * @param {boolean} trigger - trigger drilldown event 3323 */ 3324 3325 }, { 3326 key: "_setHideSubMenuClasses", 3327 value: function _setHideSubMenuClasses($elem, trigger) { 3328 $elem.removeClass('is-active').addClass('invisible').attr('aria-hidden', true); 3329 $elem.parent('li').attr('aria-expanded', false); 3330 3331 if (trigger === true) { 3332 $elem.trigger('hide.zf.drilldown', [$elem]); 3333 } 3334 } 3335 /** 3336 * Opens a specific drilldown (sub)menu no matter which (sub)menu in
vendor: 6,468 bytes, lines 3336-3505
3336it is currently visible. 3337 * Compared to _show() this lets you jump into any submenu without clicking through every submenu on the way to it. 3338 * @function 3339 * @fires Drilldown#open 3340 * @param {jQuery} $elem - the target (sub)menu (`ul` tag) 3341 * @param {boolean} autoFocus - if true the first link in the target (sub)menu gets auto focused 3342 */ 3343 3344 }, { 3345 key: "_showMenu", 3346 value: function _showMenu($elem, autoFocus) { 3347 var _this = this; // Reset drilldown 3348 3349 3350 var $expandedSubmenus = this.$element.find('li[aria-expanded="true"] > ul[data-submenu]'); 3351 $expandedSubmenus.each(function (index) { 3352 _this._setHideSubMenuClasses(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)); 3353 }); // Save the menu as the currently displayed one. 3354 3355 this.$currentMenu = $elem; // If target menu is root, focus first link & exit 3356 3357 if ($elem.is('[data-drilldown]')) { 3358 if (autoFocus === true) $elem.find('li[role="treeitem"] > a').first().focus(); 3359 if (this.options.autoHeight) this.$wrapper.css('height', $elem.data('calcHeight')); 3360 return; 3361 } // Find all submenus on way to root incl. the element itself 3362 3363 3364 var $submenus = $elem.children().first().parentsUntil('[data-drilldown]', '[data-submenu]'); // Open target menu and all submenus on its way to root 3365 3366 $submenus.each(function (index) { 3367 // Update height of first child (target menu) if autoHeight option true 3368 if (index === 0 && _this.options.autoHeight) { 3369 _this.$wrapper.css('height', jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('calcHeight')); 3370 } 3371 3372 var isLastChild = index == $submenus.length - 1; // Add transitionsend listener to last child (root due to reverse order) to open target menu's first link 3373 // Last child makes sure the event gets always triggered even if going through several menus 3374 3375 if (isLastChild === true) { 3376 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 () { 3377 if (autoFocus === true) { 3378 $elem.find('li[role="treeitem"] > a').first().focus(); 3379 } 3380 }); 3381 } 3382 3383 _this._setShowSubMenuClasses(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), isLastChild); 3384 }); 3385 } 3386 /** 3387 * Opens a submenu. 3388 * @function 3389 * @fires Drilldown#open 3390 * @param {jQuery} $elem - the current element with a submenu to open, i.e. the `li` tag. 3391 */ 3392 3393 }, { 3394 key: "_show", 3395 value: function _show($elem) { 3396 var $submenu = $elem.children('[data-submenu]'); 3397 $elem.attr('aria-expanded', true); 3398 this.$currentMenu = $submenu; 3399 $submenu.addClass('is-active').removeClass('invisible').attr('aria-hidden', false); 3400 3401 if (this.options.autoHeight) { 3402 this.$wrapper.css({ 3403 height: $submenu.data('calcHeight') 3404 }); 3405 } 3406 /** 3407 * Fires when the submenu has opened. 3408 * @event Drilldown#open 3409 */ 3410 3411 3412 this.$element.trigger('open.zf.drilldown', [$elem]); 3413 } 3414 /** 3415 * Hides a submenu 3416 * @function 3417 * @fires Drilldown#hide 3418 * @param {jQuery} $elem - the current sub-menu to hide, i.e. the `ul` tag. 3419 */ 3420 3421 }, { 3422 key: "_hide", 3423 value: function _hide($elem) { 3424 if (this.options.autoHeight) this.$wrapper.css({ 3425 height: $elem.parent().closest('ul').data('calcHeight') 3426 }); 3427 3428 var _this = this; 3429 3430 $elem.parent('li').attr('aria-expanded', false); 3431 $elem.attr('aria-hidden', true); 3432 $elem.addClass('is-closing').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($elem), function () { 3433 $elem.removeClass('is-active is-closing'); 3434 $elem.blur().addClass('invisible'); 3435 }); 3436 /** 3437 * Fires when the submenu has closed. 3438 * @event Drilldown#hide 3439 */ 3440 3441 $elem.trigger('hide.zf.drilldown', [$elem]); 3442 } 3443 /** 3444 * Iterates through the nested menus to calculate the min-height, and max-width for the menu. 3445 * Prevents content jumping. 3446 * @function 3447 * @private 3448 */ 3449 3450 }, { 3451 key: "_getMaxDims", 3452 value: function _getMaxDims() { 3453 var maxHeight = 0, 3454 result = {}, 3455 _this = this; // Recalculate menu heights and total max height 3456 3457 3458 this.$submenus.add(this.$element).each(function () { 3459 var numOfElems = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).children('li').length; 3460 var height = _foundation_util_box__WEBPACK_IMPORTED_MODULE_4__["Box"].GetDimensions(this).height; 3461 maxHeight = height > maxHeight ? height : maxHeight; 3462 3463 if (_this.options.autoHeight) { 3464 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('calcHeight', height); 3465 } 3466 }); 3467 if (this.options.autoHeight) result['height'] = this.$currentMenu.data('calcHeight');else result['min-height'] = "".concat(maxHeight, "px"); 3468 result['max-width'] = "".concat(this.$element[0].getBoundingClientRect().width, "px"); 3469 return result; 3470 } 3471 /** 3472 * Destroys the Drilldown Menu 3473 * @function 3474 */ 3475 3476 }, { 3477 key: "_destroy", 3478 value: function _destroy() { 3479 if (this.options.scrollTop) this.$element.off('.zf.drilldown', this._bindHandler); 3480 3481 this._hideAll(); 3482 3483 this.$element.off('mutateme.zf.trigger'); 3484 _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__["Nest"].Burn(this.$element, 'drilldown'); 3485 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').end().find('[data-submenu]').removeAttr('aria-hidden tabindex role'); 3486 this.$submenuAnchors.each(function () { 3487 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).off('.zf.drilldown'); 3488 }); 3489 this.$element.find('[data-is-parent-link]').detach(); 3490 this.$submenus.removeClass('drilldown-submenu-cover-previous invisible'); 3491 this.$element.find('a').each(function () { 3492 var $link = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this); 3493 $link.removeAttr('tabindex'); 3494 3495 if ($link.data('savedHref')) { 3496 $link.attr('href', $link.data('savedHref')).removeData('savedHref'); 3497 } else { 3498 return; 3499 } 3500 }); 3501 } 3502 }]); 3503 3504 return Drilldown; 3505}
3505(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_5__["Plugin"]); 3506 3507Drilldown.defaults = { 3508 /** 3509 * Drilldowns depend on styles in order to function properly; in the default build of Foundation these are 3510 * on the `drilldown` class. This option auto-applies this class to the drilldown upon initialization. 3511 * @option 3512 * @type {boolean} 3513 * @default true 3514 */ 3515 autoApplyClass: true, 3516 3517 /** 3518 * 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. 3519 * @option 3520 * @type {string} 3521 * @default '<li class="js-drilldown-back"><a tabindex="0">Back</a></li>' 3522 */ 3523 backButton: '<li class="js-drilldown-back"><a tabindex="0">Back</a></li>', 3524 3525 /** 3526 * Position the back button either at the top or bottom of drilldown submenus. Can be `'left'` or `'bottom'`. 3527 * @option 3528 * @type {string} 3529 * @default top 3530 */ 3531 backButtonPosition: 'top', 3532 3533 /** 3534 * 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. 3535 * @option 3536 * @type {string} 3537 * @default '<div></div>' 3538 */ 3539 wrapper: '<div></div>', 3540 3541 /** 3542 * Adds the parent link to the submenu. 3543 * @option 3544 * @type {boolean} 3545 * @default false 3546 */ 3547 parentLink: false, 3548 3549 /** 3550 * Allow the menu to return to root list on body click. 3551 * @option 3552 * @type {boolean} 3553 * @default false 3554 */ 3555 closeOnClick: false, 3556 3557 /** 3558 * Allow the menu to auto adjust height. 3559 * @option 3560 * @type {boolean} 3561 * @default false 3562 */ 3563 autoHeight: false, 3564 3565 /** 3566 * Animate the auto adjust height. 3567 * @option 3568 * @type {boolean} 3569 * @default false 3570 */ 3571 animateHeight: false, 3572 3573 /** 3574 * Scroll to the top of the menu after opening a submenu or navigating back using the menu back button 3575 * @option 3576 * @type {boolean} 3577 * @default false 3578 */ 3579 scrollTop: false, 3580 3581 /** 3582 * String jquery selector (for example 'body') of element to take offset().top from, if empty string the drilldown menu offset().top is taken 3583 * @option 3584 * @type {string} 3585 * @default '' 3586 */ 3587 scrollTopElement: '', 3588 3589 /** 3590 * ScrollTop offset 3591 * @option 3592 * @type {number} 3593 * @default 0 3594 */ 3595 scrollTopOffset: 0, 3596 3597 /** 3598 * Scroll animation duration 3599 * @option 3600 * @type {number} 3601 * @default 500 3602 */ 3603 animationDuration: 500, 3604 3605 /** 3606 * Scroll animation easing. Can be `'swing'` or `'linear'`. 3607 * @option 3608 * @type {string} 3609 * @see {@link https://api.jquery.com/animate|JQuery animate} 3610 * @default 'swing' 3611 */ 3612 animationEasing: 'swing' // holdOpen: false 3613 3614}; 3615 3616 3617/***/ }), 3618
vendor: 5,058 bytes, lines 3619-3694
3619/***/ "./js/foundation.dropdown.js": 3620/*!***********************************!*\ 3621 !*** ./js/foundation.dropdown.js ***! 3622 \***********************************/ 3623/*! exports provided: Dropdown */ 3624/***/ (function(module, __webpack_exports__, __webpack_require__) { 3625 3626"use strict"; 3627__webpack_require__.r(__webpack_exports__); 3628/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Dropdown", function() { return Dropdown; }); 3629/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 3630/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 3631/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js"); 3632/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 3633/* harmony import */ var _foundation_positionable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.positionable */ "./js/foundation.positionable.js"); 3634/* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js"); 3635/* harmony import */ var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.util.touch */ "./js/foundation.util.touch.js"); 3636 3637 3638function _typeof(obj) { 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); } 3639 3640function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 3641 3642function _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); } } 3643 3644function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 3645 3646function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 3647 3648function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 3649 3650function _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); } 3651 3652function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 3653 3654function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 3655 3656function _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); } 3657 3658function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 3659 3660 3661 3662 3663 3664 3665 3666/** 3667 * Dropdown module. 3668 * @module foundation.dropdown 3669 * @requires foundation.util.keyboard 3670 * @requires foundation.util.box 3671 * @requires foundation.util.touch 3672 * @requires foundation.util.triggers 3673 */ 3674 3675var Dropdown = 3676/*#__PURE__*/ 3677function (_Positionable) { 3678 _inherits(Dropdown, _Positionable); 3679 3680 function Dropdown() { 3681 _classCallCheck(this, Dropdown); 3682 3683 return _possibleConstructorReturn(this, _getPrototypeOf(Dropdown).apply(this, arguments)); 3684 } 3685 3686 _createClass(Dropdown, [{ 3687 key: "_setup", 3688 3689 /** 3690 * Creates a new instance of a dropdown. 3691 * @class 3692 * @name Dropdown 3693 * @param {jQuery} element - jQuery object to make into a dropdown. 3694 * Object should be of the dropdown panel, rather than
3694its anchor. 3695 * @param {Object} options - Overrides to the default plugin settings. 3696 */ 3697 value: function _setup(element, options) { 3698 this.$element = element; 3699 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Dropdown.defaults, this.$element.data(), options); 3700 this.className = 'Dropdown'; // ie9 back compat 3701 // Touch and Triggers init are idempotent, just need to make sure they are initialized 3702 3703 _foundation_util_touch__WEBPACK_IMPORTED_MODULE_5__["Touch"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 3704 _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 3705 3706 this._init(); 3707 3708 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].register('Dropdown', { 3709 'ENTER': 'toggle', 3710 'SPACE': 'toggle', 3711 'ESCAPE': 'close' 3712 }); 3713 } 3714 /** 3715 * Initializes the plugin by setting/checking options and attributes, adding helper variables, and saving the anchor. 3716 * @function 3717 * @private 3718 */ 3719 3720 }, { 3721 key: "_init", 3722 value: function _init() { 3723 var $id = this.$element.attr('id'); 3724 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, "\"]")); 3725 this.$anchors.attr({ 3726 'aria-controls': $id, 3727 'data-is-focus': false, 3728 'data-yeti-box': $id, 3729 'aria-haspopup': true, 3730 'aria-expanded': false 3731 }); 3732 3733 this._setCurrentAnchor(this.$anchors.first()); 3734 3735 if (this.options.parentClass) { 3736 this.$parent = this.$element.parents('.' + this.options.parentClass); 3737 } else { 3738 this.$parent = null; 3739 } // Set [aria-labelledby] on the Dropdown if it is not set 3740 3741 3742 if (typeof this.$element.attr('aria-labelledby') === 'undefined') { 3743 // Get the anchor ID or create one 3744 if (typeof this.$currentAnchor.attr('id') === 'undefined') { 3745 this.$currentAnchor.attr('id', Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'dd-anchor')); 3746 } 3747 3748 this.$element.attr('aria-labelledby', this.$currentAnchor.attr('id')); 3749 } 3750 3751 this.$element.attr({ 3752 'aria-hidden': 'true', 3753 'data-yeti-box': $id, 3754 'data-resize': $id 3755 }); 3756 3757 _get(_getPrototypeOf(Dropdown.prototype), "_init", this).call(this); 3758 3759 this._events(); 3760 } 3761 }, { 3762 key: "_getDefaultPosition", 3763 value: function _getDefaultPosition() { 3764 // handle legacy classnames 3765 var position = this.$element[0].className.match(/(top|left|right|bottom)/g); 3766 3767 if (position) { 3768 return position[0]; 3769 } else { 3770 return 'bottom'; 3771 } 3772 } 3773 }, { 3774 key: "_getDefaultAlignment", 3775 value: function _getDefaultAlignment() { 3776 // handle legacy float approach 3777 var horizontalPosition = /float-(\S+)/.exec(this.$currentAnchor.attr('class')); 3778 3779 if (horizontalPosition) { 3780 return horizontalPosition[1]; 3781 } 3782 3783 return _get(_getPrototypeOf(Dropdown.prototype), "_getDefaultAlignment", this).call(this); 3784 } 3785 /** 3786 * Sets the position and orientation of the dropdown pane, checks for collisions if allow-overlap is not true. 3787 * Recursively calls itself if a collision is detected, with a new position class. 3788 * @function 3789 * @private 3790 */ 3791 3792 }, { 3793 key: "_setPosition", 3794 value: function _setPosition() { 3795 this.$element.removeClass("has-position-".concat(this.position, " has-alignment-").concat(this.alignment)); 3796 3797 _get(_getPrototypeOf(Dropdown.prototype), "_setPosition", this).call(this, this.$currentAnchor, this.$element, this.$parent); 3798 3799 this.$element.addClass("has-position-".concat(this.position, " has-alignment-").concat(this.alignment)); 3800 } 3801 /** 3802 * Make it a current anchor. 3803 * Current anchor as the reference for the position of Dropdown panes. 3804 * @param {HTML}
vendor: 5,268 bytes, lines 3804-3956
3804 el - DOM element of the anchor. 3805 * @function 3806 * @private 3807 */ 3808 3809 }, { 3810 key: "_setCurrentAnchor", 3811 value: function _setCurrentAnchor(el) { 3812 this.$currentAnchor = jquery__WEBPACK_IMPORTED_MODULE_0___default()(el); 3813 } 3814 /** 3815 * Adds event listeners to the element utilizing the triggers utility library. 3816 * @function 3817 * @private 3818 */ 3819 3820 }, { 3821 key: "_events", 3822 value: function _events() { 3823 var _this = this, 3824 hasTouch = 'ontouchstart' in window || typeof window.ontouchstart !== 'undefined'; 3825 3826 this.$element.on({ 3827 'open.zf.trigger': this.open.bind(this), 3828 'close.zf.trigger': this.close.bind(this), 3829 'toggle.zf.trigger': this.toggle.bind(this), 3830 'resizeme.zf.trigger': this._setPosition.bind(this) 3831 }); 3832 this.$anchors.off('click.zf.trigger').on('click.zf.trigger', function (e) { 3833 _this._setCurrentAnchor(this); 3834 3835 if ( // if forceFollow false, always prevent default action 3836 _this.options.forceFollow === false || // if forceFollow true and hover option true, only prevent default action on 1st click 3837 // on 2nd click (dropown opened) the default action (e.g. follow a href) gets executed 3838 hasTouch && _this.options.hover && _this.$element.hasClass('is-open') === false) { 3839 e.preventDefault(); 3840 } 3841 }); 3842 3843 if (this.options.hover) { 3844 this.$anchors.off('mouseenter.zf.dropdown mouseleave.zf.dropdown').on('mouseenter.zf.dropdown', function () { 3845 _this._setCurrentAnchor(this); 3846 3847 var bodyData = jquery__WEBPACK_IMPORTED_MODULE_0___default()('body').data(); 3848 3849 if (typeof bodyData.whatinput === 'undefined' || bodyData.whatinput === 'mouse') { 3850 clearTimeout(_this.timeout); 3851 _this.timeout = setTimeout(function () { 3852 _this.open(); 3853 3854 _this.$anchors.data('hover', true); 3855 }, _this.options.hoverDelay); 3856 } 3857 }).on('mouseleave.zf.dropdown', Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["ignoreMousedisappear"])(function () { 3858 clearTimeout(_this.timeout); 3859 _this.timeout = setTimeout(function () { 3860 _this.close(); 3861 3862 _this.$anchors.data('hover', false); 3863 }, _this.options.hoverDelay); 3864 })); 3865 3866 if (this.options.hoverPane) { 3867 this.$element.off('mouseenter.zf.dropdown mouseleave.zf.dropdown').on('mouseenter.zf.dropdown', function () { 3868 clearTimeout(_this.timeout); 3869 }).on('mouseleave.zf.dropdown', Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["ignoreMousedisappear"])(function () { 3870 clearTimeout(_this.timeout); 3871 _this.timeout = setTimeout(function () { 3872 _this.close(); 3873 3874 _this.$anchors.data('hover', false); 3875 }, _this.options.hoverDelay); 3876 })); 3877 } 3878 } 3879 3880 this.$anchors.add(this.$element).on('keydown.zf.dropdown', function (e) { 3881 var $target = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 3882 visibleFocusableElements = _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].findFocusable(_this.$element); 3883 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].handleKey(e, 'Dropdown', { 3884 open: function open() { 3885 if ($target.is(_this.$anchors) && !$target.is('input, textarea')) { 3886 _this.open(); 3887 3888 _this.$element.attr('tabindex', -1).focus(); 3889 3890 e.preventDefault(); 3891 } 3892 }, 3893 close: function close() { 3894 _this.close(); 3895 3896 _this.$anchors.focus(); 3897 } 3898 }); 3899 }); 3900 } 3901 /** 3902 * Adds an event handler to the body to close any dropdowns on a click. 3903 * @function 3904 * @private 3905 */ 3906 3907 }, { 3908 key: "_addBodyHandler", 3909 value: function _addBodyHandler() { 3910 var $body = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.body).not(this.$element), 3911 _this = this; 3912 3913 $body.off('click.zf.dropdown tap.zf.dropdown').on('click.zf.dropdown tap.zf.dropdown', function (e) { 3914 if (_this.$anchors.is(e.target) || _this.$anchors.find(e.target).length) { 3915 return; 3916 } 3917 3918 if (_this.$element.is(e.target) || _this.$element.find(e.target).length) { 3919 return; 3920 } 3921 3922 _this.close(); 3923 3924 $body.off('click.zf.dropdown tap.zf.dropdown'); 3925 }); 3926 } 3927 /** 3928 * Opens the dropdown pane, and fires a bubbling event to close other dropdowns. 3929 * @function 3930 * @fires Dropdown#closeme 3931 * @fires Dropdown#show 3932 */ 3933 3934 }, { 3935 key: "open", 3936 value: function open() { 3937 // var _this = this; 3938 3939 /** 3940 * Fires to close other open dropdowns, typically when dropdown is opening 3941 * @event Dropdown#closeme 3942 */ 3943 this.$element.trigger('closeme.zf.dropdown', this.$element.attr('id')); 3944 this.$anchors.addClass('hover').attr({ 3945 'aria-expanded': true 3946 }); // this.$element/*.show()*/; 3947 3948 this.$element.addClass('is-opening'); 3949 3950 this._setPosition(); 3951 3952 this.$element.removeClass('is-opening').addClass('is-open').attr({ 3953 'aria-hidden': false 3954 }); 3955 3956 if (this.options.autoFocus) {
vendor: 4,783 bytes, lines 3957-4157
3957 var $focusable = _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].findFocusable(this.$element); 3958 3959 if ($focusable.length) { 3960 $focusable.eq(0).focus(); 3961 } 3962 } 3963 3964 if (this.options.closeOnClick) { 3965 this._addBodyHandler(); 3966 } 3967 3968 if (this.options.trapFocus) { 3969 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].trapFocus(this.$element); 3970 } 3971 /** 3972 * Fires once the dropdown is visible. 3973 * @event Dropdown#show 3974 */ 3975 3976 3977 this.$element.trigger('show.zf.dropdown', [this.$element]); 3978 } 3979 /** 3980 * Closes the open dropdown pane. 3981 * @function 3982 * @fires Dropdown#hide 3983 */ 3984 3985 }, { 3986 key: "close", 3987 value: function close() { 3988 if (!this.$element.hasClass('is-open')) { 3989 return false; 3990 } 3991 3992 this.$element.removeClass('is-open').attr({ 3993 'aria-hidden': true 3994 }); 3995 this.$anchors.removeClass('hover').attr('aria-expanded', false); 3996 /** 3997 * Fires once the dropdown is no longer visible. 3998 * @event Dropdown#hide 3999 */ 4000 4001 this.$element.trigger('hide.zf.dropdown', [this.$element]); 4002 4003 if (this.options.trapFocus) { 4004 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].releaseFocus(this.$element); 4005 } 4006 } 4007 /** 4008 * Toggles the dropdown pane's visibility. 4009 * @function 4010 */ 4011 4012 }, { 4013 key: "toggle", 4014 value: function toggle() { 4015 if (this.$element.hasClass('is-open')) { 4016 if (this.$anchors.data('hover')) return; 4017 this.close(); 4018 } else { 4019 this.open(); 4020 } 4021 } 4022 /** 4023 * Destroys the dropdown. 4024 * @function 4025 */ 4026 4027 }, { 4028 key: "_destroy", 4029 value: function _destroy() { 4030 this.$element.off('.zf.trigger').hide(); 4031 this.$anchors.off('.zf.dropdown'); 4032 jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.body).off('click.zf.dropdown tap.zf.dropdown'); 4033 } 4034 }]); 4035 4036 return Dropdown; 4037}(_foundation_positionable__WEBPACK_IMPORTED_MODULE_3__["Positionable"]); 4038 4039Dropdown.defaults = { 4040 /** 4041 * Class that designates bounding container of Dropdown (default: window) 4042 * @option 4043 * @type {?string} 4044 * @default null 4045 */ 4046 parentClass: null, 4047 4048 /** 4049 * Amount of time to delay opening a submenu on hover event. 4050 * @option 4051 * @type {number} 4052 * @default 250 4053 */ 4054 hoverDelay: 250, 4055 4056 /** 4057 * Allow submenus to open on hover events 4058 * @option 4059 * @type {boolean} 4060 * @default false 4061 */ 4062 hover: false, 4063 4064 /** 4065 * Don't close dropdown when hovering over dropdown pane 4066 * @option 4067 * @type {boolean} 4068 * @default false 4069 */ 4070 hoverPane: false, 4071 4072 /** 4073 * Number of pixels between the dropdown pane and the triggering element on open. 4074 * @option 4075 * @type {number} 4076 * @default 0 4077 */ 4078 vOffset: 0, 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 hOffset: 0, 4087 4088 /** 4089 * Position of dropdown. Can be left, right, bottom, top, or auto. 4090 * @option 4091 * @type {string} 4092 * @default 'auto' 4093 */ 4094 position: 'auto', 4095 4096 /** 4097 * Alignment of dropdown relative to anchor. Can be left, right, bottom, top, center, or auto. 4098 * @option 4099 * @type {string} 4100 * @default 'auto' 4101 */ 4102 alignment: 'auto', 4103 4104 /** 4105 * 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. 4106 * @option 4107 * @type {boolean} 4108 * @default false 4109 */ 4110 allowOverlap: false, 4111 4112 /** 4113 * Allow overlap of only the bottom of the container. This is the most common 4114 * behavior for dropdowns, allowing the dropdown to extend the bottom of the 4115 * screen but not otherwise influence or break out of the container. 4116 * @option 4117 * @type {boolean} 4118 * @default true 4119 */ 4120 allowBottomOverlap: true, 4121 4122 /** 4123 * Allow the plugin to trap focus to the dropdown pane if opened with keyboard commands. 4124 * @option 4125 * @type {boolean} 4126 * @default false 4127 */ 4128 trapFocus: false, 4129 4130 /** 4131 * Allow the plugin to set focus to the first focusable element within the pane, regardless of method of opening. 4132 * @option 4133 * @type {boolean} 4134 * @default false 4135 */ 4136 autoFocus: false, 4137 4138 /** 4139 * Allows a click on the body to close the dropdown. 4140 * @option 4141 * @type {boolean} 4142 * @default false 4143 */ 4144 closeOnClick: false, 4145 4146 /** 4147 * 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. 4148 * @option 4149 * @type {boolean} 4150 * @default true 4151 */ 4152 forceFollow: true 4153}; 4154 4155 4156/***/ }), 4157
vendor: 5,147 bytes, lines 4158-4239
4158/***/ "./js/foundation.dropdownMenu.js": 4159/*!***************************************!*\ 4160 !*** ./js/foundation.dropdownMenu.js ***! 4161 \***************************************/ 4162/*! exports provided: DropdownMenu */ 4163/***/ (function(module, __webpack_exports__, __webpack_require__) { 4164 4165"use strict"; 4166__webpack_require__.r(__webpack_exports__); 4167/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DropdownMenu", function() { return DropdownMenu; }); 4168/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 4169/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 4170/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 4171/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 4172/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js"); 4173/* harmony import */ var _foundation_util_nest__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.nest */ "./js/foundation.util.nest.js"); 4174/* harmony import */ var _foundation_util_box__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.util.box */ "./js/foundation.util.box.js"); 4175/* harmony import */ var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./foundation.util.touch */ "./js/foundation.util.touch.js"); 4176 4177 4178function _typeof(obj) { 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); } 4179 4180function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 4181 4182function _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); } } 4183 4184function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 4185 4186function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 4187 4188function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 4189 4190function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 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 4196 4197 4198 4199 4200 4201 4202 4203/** 4204 * DropdownMenu module. 4205 * @module foundation.dropdownMenu 4206 * @requires foundation.util.keyboard 4207 * @requires foundation.util.box 4208 * @requires foundation.util.nest 4209 * @requires foundation.util.touch 4210 */ 4211 4212var DropdownMenu = 4213/*#__PURE__*/ 4214function (_Plugin) { 4215 _inherits(DropdownMenu, _Plugin); 4216 4217 function DropdownMenu() { 4218 _classCallCheck(this, DropdownMenu); 4219 4220 return _possibleConstructorReturn(this, _getPrototypeOf(DropdownMenu).apply(this, arguments)); 4221 } 4222 4223 _createClass(DropdownMenu, [{ 4224 key: "_setup", 4225 4226 /** 4227 * Creates a new instance of DropdownMenu. 4228 * @class 4229 * @name DropdownMenu 4230 * @fires DropdownMenu#init 4231 * @param {jQuery} element - jQuery object to make into a dropdown menu. 4232 * @param {Object} options - Overrides to the default plugin settings. 4233 */ 4234 value: function _setup(element, options) { 4235 this.$element = element; 4236 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, DropdownMenu.defaults, this.$element.data(), options); 4237 this.className = 'DropdownMenu'; // ie9 back compat 4238 4239 _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.
vendor: 15,615 bytes, lines 4240-4736
4240 4241 this._init(); 4242 4243 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].register('DropdownMenu', { 4244 'ENTER': 'open', 4245 'SPACE': 'open', 4246 'ARROW_RIGHT': 'next', 4247 'ARROW_UP': 'up', 4248 'ARROW_DOWN': 'down', 4249 'ARROW_LEFT': 'previous', 4250 'ESCAPE': 'close' 4251 }); 4252 } 4253 /** 4254 * Initializes the plugin, and calls _prepareMenu 4255 * @private 4256 * @function 4257 */ 4258 4259 }, { 4260 key: "_init", 4261 value: function _init() { 4262 _foundation_util_nest__WEBPACK_IMPORTED_MODULE_4__["Nest"].Feather(this.$element, 'dropdown'); 4263 var subs = this.$element.find('li.is-dropdown-submenu-parent'); 4264 this.$element.children('.is-dropdown-submenu-parent').children('.is-dropdown-submenu').addClass('first-sub'); 4265 this.$menuItems = this.$element.find('li[role="none"]'); 4266 this.$tabs = this.$element.children('li[role="none"]'); 4267 this.$tabs.find('ul.is-dropdown-submenu').addClass(this.options.verticalClass); 4268 4269 if (this.options.alignment === 'auto') { 4270 if (this.$element.hasClass(this.options.rightClass) || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["rtl"])() || this.$element.parents('.top-bar-right').is('*')) { 4271 this.options.alignment = 'right'; 4272 subs.addClass('opens-left'); 4273 } else { 4274 this.options.alignment = 'left'; 4275 subs.addClass('opens-right'); 4276 } 4277 } else { 4278 if (this.options.alignment === 'right') { 4279 subs.addClass('opens-left'); 4280 } else { 4281 subs.addClass('opens-right'); 4282 } 4283 } 4284 4285 this.changed = false; 4286 4287 this._events(); 4288 } 4289 }, { 4290 key: "_isVertical", 4291 value: function _isVertical() { 4292 return this.$tabs.css('display') === 'block' || this.$element.css('flex-direction') === 'column'; 4293 } 4294 }, { 4295 key: "_isRtl", 4296 value: function _isRtl() { 4297 return this.$element.hasClass('align-right') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["rtl"])() && !this.$element.hasClass('align-left'); 4298 } 4299 /** 4300 * Adds event listeners to elements within the menu 4301 * @private 4302 * @function 4303 */ 4304 4305 }, { 4306 key: "_events", 4307 value: function _events() { 4308 var _this = this, 4309 hasTouch = 'ontouchstart' in window || typeof window.ontouchstart !== 'undefined', 4310 parClass = 'is-dropdown-submenu-parent'; // used for onClick and in the keyboard handlers 4311 4312 4313 var handleClickFn = function handleClickFn(e) { 4314 var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).parentsUntil('ul', ".".concat(parClass)), 4315 hasSub = $elem.hasClass(parClass), 4316 hasClicked = $elem.attr('data-is-click') === 'true', 4317 $sub = $elem.children('.is-dropdown-submenu'); 4318 4319 if (hasSub) { 4320 if (hasClicked) { 4321 if (!_this.options.closeOnClick || !_this.options.clickOpen && !hasTouch || _this.options.forceFollow && hasTouch) { 4322 return; 4323 } 4324 4325 e.stopImmediatePropagation(); 4326 e.preventDefault(); 4327 4328 _this._hide($elem); 4329 } else { 4330 e.stopImmediatePropagation(); 4331 e.preventDefault(); 4332 4333 _this._show($sub); 4334 4335 $elem.add($elem.parentsUntil(_this.$element, ".".concat(parClass))).attr('data-is-click', true); 4336 } 4337 } 4338 }; 4339 4340 if (this.options.clickOpen || hasTouch) { 4341 this.$menuItems.on('click.zf.dropdownMenu touchstart.zf.dropdownMenu', handleClickFn); 4342 } // Handle Leaf element Clicks 4343 4344 4345 if (_this.options.closeOnClickInside) { 4346 this.$menuItems.on('click.zf.dropdownMenu', function (e) { 4347 var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 4348 hasSub = $elem.hasClass(parClass); 4349 4350 if (!hasSub) { 4351 _this._hide(); 4352 } 4353 }); 4354 } 4355 4356 if (!this.options.disableHover) { 4357 this.$menuItems.on('mouseenter.zf.dropdownMenu', function (e) { 4358 var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 4359 hasSub = $elem.hasClass(parClass); 4360 4361 if (hasSub) { 4362 clearTimeout($elem.data('_delay')); 4363 $elem.data('_delay', setTimeout(function () { 4364 _this._show($elem.children('.is-dropdown-submenu')); 4365 }, _this.options.hoverDelay)); 4366 } 4367 }).on('mouseleave.zf.dropdownMenu', Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["ignoreMousedisappear"])(function (e) { 4368 var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 4369 hasSub = $elem.hasClass(parClass); 4370 4371 if (hasSub && _this.options.autoclose) { 4372 if ($elem.attr('data-is-click') === 'true' && _this.options.clickOpen) { 4373 return false; 4374 } 4375 4376 clearTimeout($elem.data('_delay')); 4377 $elem.data('_delay', setTimeout(function () { 4378 _this._hide($elem); 4379 }, _this.options.closingTime)); 4380 } 4381 })); 4382 } 4383 4384 this.$menuItems.on('keydown.zf.dropdownMenu', function (e) { 4385 var $element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).parentsUntil('ul', '[role="none"]'), 4386 isTab = _this.$tabs.index($element) > -1, 4387 $elements = isTab ? _this.$tabs : $element.siblings('li').add($element), 4388 $prevElement, 4389 $nextElement; 4390 $elements.each(function (i) { 4391 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is($element)) { 4392 $prevElement = $elements.eq(i - 1); 4393 $nextElement = $elements.eq(i + 1); 4394 return; 4395 } 4396 }); 4397 4398 var nextSibling = function nextSibling() { 4399 $nextElement.children('a:first').focus(); 4400 e.preventDefault(); 4401 }, 4402 prevSibling = function prevSibling() { 4403 $prevElement.children('a:first').focus(); 4404 e.preventDefault(); 4405 }, 4406 openSub = function openSub() { 4407 var $sub = $element.children('ul.is-dropdown-submenu'); 4408 4409 if ($sub.length) { 4410 _this._show($sub); 4411 4412 $element.find('li > a:first').focus(); 4413 e.preventDefault(); 4414 } else { 4415 return; 4416 } 4417 }, 4418 closeSub = function closeSub() { 4419 //if ($element.is(':first-child')) { 4420 var close = $element.parent('ul').parent('li'); 4421 close.children('a:first').focus(); 4422 4423 _this._hide(close); 4424 4425 e.preventDefault(); //} 4426 }; 4427 4428 var functions = { 4429 open: openSub, 4430 close: function close() { 4431 _this._hide(_this.$element); 4432 4433 _this.$menuItems.eq(0).children('a').focus(); // focus to first element 4434 4435 4436 e.preventDefault(); 4437 } 4438 }; 4439 4440 if (isTab) { 4441 if (_this._isVertical()) { 4442 // vertical menu 4443 if (_this._isRtl()) { 4444 // right aligned 4445 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, { 4446 down: nextSibling, 4447 up: prevSibling, 4448 next: closeSub, 4449 previous: openSub 4450 }); 4451 } else { 4452 // left aligned 4453 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, { 4454 down: nextSibling, 4455 up: prevSibling, 4456 next: openSub, 4457 previous: closeSub 4458 }); 4459 } 4460 } else { 4461 // horizontal menu 4462 if (_this._isRtl()) { 4463 // right aligned 4464 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, { 4465 next: prevSibling, 4466 previous: nextSibling, 4467 down: openSub, 4468 up: closeSub 4469 }); 4470 } else { 4471 // left aligned 4472 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, { 4473 next: nextSibling, 4474 previous: prevSibling, 4475 down: openSub, 4476 up: closeSub 4477 }); 4478 } 4479 } 4480 } else { 4481 // not tabs -> one sub 4482 if (_this._isRtl()) { 4483 // right aligned 4484 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, { 4485 next: closeSub, 4486 previous: openSub, 4487 down: nextSibling, 4488 up: prevSibling 4489 }); 4490 } else { 4491 // left aligned 4492 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, { 4493 next: openSub, 4494 previous: closeSub, 4495 down: nextSibling, 4496 up: prevSibling 4497 }); 4498 } 4499 } 4500 4501 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].handleKey(e, 'DropdownMenu', functions); 4502 }); 4503 } 4504 /** 4505 * Adds an event handler to the body to close any dropdowns on a click. 4506 * @function 4507 * @private 4508 */ 4509 4510 }, { 4511 key: "_addBodyHandler", 4512 value: function _addBodyHandler() { 4513 var _this2 = this; 4514 4515 var $body = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.body); 4516 4517 this._removeBodyHandler(); 4518 4519 $body.on('click.zf.dropdownMenu tap.zf.dropdownMenu', function (e) { 4520 var isItself = !!jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).closest(_this2.$element).length; 4521 if (isItself) return; 4522 4523 _this2._hide(); 4524 4525 _this2._removeBodyHandler(); 4526 }); 4527 } 4528 /** 4529 * Remove the body event handler. See `_addBodyHandler`. 4530 * @function 4531 * @private 4532 */ 4533 4534 }, { 4535 key: "_removeBodyHandler", 4536 value: function _removeBodyHandler() { 4537 jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.body).off('click.zf.dropdownMenu tap.zf.dropdownMenu'); 4538 } 4539 /** 4540 * Opens a dropdown pane, and checks for collisions first. 4541 * @param {jQuery} $sub - ul element that is a submenu to show 4542 * @function 4543 * @private 4544 * @fires DropdownMenu#show 4545 */ 4546 4547 }, { 4548 key: "_show", 4549 value: function _show($sub) { 4550 var idx = this.$tabs.index(this.$tabs.filter(function (i, el) { 4551 return jquery__WEBPACK_IMPORTED_MODULE_0___default()(el).find($sub).length > 0; 4552 })); 4553 var $sibs = $sub.parent('li.is-dropdown-submenu-parent').siblings('li.is-dropdown-submenu-parent'); 4554 4555 this._hide($sibs, idx); 4556 4557 $sub.css('visibility', 'hidden').addClass('js-dropdown-active').parent('li.is-dropdown-submenu-parent').addClass('is-active'); 4558 var clear = _foundation_util_box__WEBPACK_IMPORTED_MODULE_5__["Box"].ImNotTouchingYou($sub, null, true); 4559 4560 if (!clear) { 4561 var oldClass = this.options.alignment === 'left' ? '-right' : '-left', 4562 $parentLi = $sub.parent('.is-dropdown-submenu-parent'); 4563 $parentLi.removeClass("opens".concat(oldClass)).addClass("opens-".concat(this.options.alignment)); 4564 clear = _foundation_util_box__WEBPACK_IMPORTED_MODULE_5__["Box"].ImNotTouchingYou($sub, null, true); 4565 4566 if (!clear) { 4567 $parentLi.removeClass("opens-".concat(this.options.alignment)).addClass('opens-inner'); 4568 } 4569 4570 this.changed = true; 4571 } 4572 4573 $sub.css('visibility', ''); 4574 4575 if (this.options.closeOnClick) { 4576 this._addBodyHandler(); 4577 } 4578 /** 4579 * Fires when the new dropdown pane is visible. 4580 * @event DropdownMenu#show 4581 */ 4582 4583 4584 this.$element.trigger('show.zf.dropdownMenu', [$sub]); 4585 } 4586 /** 4587 * Hides a single, currently open dropdown pane, if passed a parameter, otherwise, hides everything. 4588 * @function 4589 * @param {jQuery} $elem - element with a submenu to hide 4590 * @param {Number} idx - index of the $tabs collection to hide 4591 * @fires DropdownMenu#hide 4592 * @private 4593 */ 4594 4595 }, { 4596 key: "_hide", 4597 value: function _hide($elem, idx) { 4598 var $toClose; 4599 4600 if ($elem && $elem.length) { 4601 $toClose = $elem; 4602 } else if (typeof idx !== 'undefined') { 4603 $toClose = this.$tabs.not(function (i, el) { 4604 return i === idx; 4605 }); 4606 } else { 4607 $toClose = this.$element; 4608 } 4609 4610 var somethingToClose = $toClose.hasClass('is-active') || $toClose.find('.is-active').length > 0; 4611 4612 if (somethingToClose) { 4613 var $activeItem = $toClose.find('li.is-active'); 4614 $activeItem.add($toClose).attr({ 4615 'data-is-click': false 4616 }).removeClass('is-active'); 4617 $toClose.find('ul.js-dropdown-active').removeClass('js-dropdown-active'); 4618 4619 if (this.changed || $toClose.find('opens-inner').length) { 4620 var oldClass = this.options.alignment === 'left' ? 'right' : 'left'; 4621 $toClose.find('li.is-dropdown-submenu-parent').add($toClose).removeClass("opens-inner opens-".concat(this.options.alignment)).addClass("opens-".concat(oldClass)); 4622 this.changed = false; 4623 } 4624 4625 clearTimeout($activeItem.data('_delay')); 4626 4627 this._removeBodyHandler(); 4628 /** 4629 * Fires when the open menus are closed. 4630 * @event DropdownMenu#hide 4631 */ 4632 4633 4634 this.$element.trigger('hide.zf.dropdownMenu', [$toClose]); 4635 } 4636 } 4637 /** 4638 * Destroys the plugin. 4639 * @function 4640 */ 4641 4642 }, { 4643 key: "_destroy", 4644 value: function _destroy() { 4645 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'); 4646 jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.body).off('.zf.dropdownMenu'); 4647 _foundation_util_nest__WEBPACK_IMPORTED_MODULE_4__["Nest"].Burn(this.$element, 'dropdown'); 4648 } 4649 }]); 4650 4651 return DropdownMenu; 4652}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]); 4653/** 4654 * Default settings for plugin 4655 */ 4656 4657 4658DropdownMenu.defaults = { 4659 /** 4660 * Disallows hover events from opening submenus 4661 * @option 4662 * @type {boolean} 4663 * @default false 4664 */ 4665 disableHover: false, 4666 4667 /** 4668 * Allow a submenu to automatically close on a mouseleave event, if not clicked open. 4669 * @option 4670 * @type {boolean} 4671 * @default true 4672 */ 4673 autoclose: true, 4674 4675 /** 4676 * Amount of time to delay opening a submenu on hover event. 4677 * @option 4678 * @type {number} 4679 * @default 50 4680 */ 4681 hoverDelay: 50, 4682 4683 /** 4684 * Allow a submenu to open/remain open on parent click event. Allows cursor to move away from menu. 4685 * @option 4686 * @type {boolean} 4687 * @default false 4688 */ 4689 clickOpen: false, 4690 4691 /** 4692 * Amount of time to delay closing a submenu on a mouseleave event. 4693 * @option 4694 * @type {number} 4695 * @default 500 4696 */ 4697 closingTime: 500, 4698 4699 /** 4700 * Position of the menu relative to what direction the submenus should open. Handled by JS. Can be `'auto'`, `'left'` or `'right'`. 4701 * @option 4702 * @type {string} 4703 * @default 'auto' 4704 */ 4705 alignment: 'auto', 4706 4707 /** 4708 * Allow clicks on the body to close any open submenus. 4709 * @option 4710 * @type {boolean} 4711 * @default true 4712 */ 4713 closeOnClick: true, 4714 4715 /** 4716 * Allow clicks on leaf anchor links to close any open submenus. 4717 * @option 4718 * @type {boolean} 4719 * @default true 4720 */ 4721 closeOnClickInside: true, 4722 4723 /** 4724 * Class applied to vertical oriented menus, Foundation default is `vertical`. Update this if using your own class. 4725 * @option 4726 * @type {string} 4727 * @default 'vertical' 4728 */ 4729 verticalClass: 'vertical', 4730 4731 /** 4732 * Class applied to right-side oriented menus, Foundation default is `align-right`. Update this if using your own class. 4733 * @option 4734 * @type {string} 4735 * @default 'align-right' 4736 */
4737 rightClass: 'align-right', 4738 4739 /** 4740 * Boolean to force overide the clicking of links to perform default action, on second touch event for mobile. 4741 * @option 4742 * @type {boolean} 4743 * @default true 4744 */ 4745 forceFollow: true 4746}; 4747 4748 4749/***/ }), 4750
4751/***/ "./js/foundation.equalizer.js": 4752/*!************************************!*\ 4753 !*** ./js/foundation.equalizer.js ***! 4754 \************************************/ 4755/*! exports provided: Equalizer */ 4756/***/ (function(module, __webpack_exports__, __webpack_require__) { 4757 4758"use strict"; 4759__webpack_require__.r(__webpack_exports__); 4760/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Equalizer", function() { return Equalizer; }); 4761/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 4762/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 4763/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js"); 4764/* harmony import */ var _foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.imageLoader */ "./js/foundation.util.imageLoader.js"); 4765/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 4766/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 4767 4768 4769function _typeof(obj) { 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); } 4770 4771function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 4772 4773function _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); } } 4774 4775function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 4776 4777function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 4778 4779function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 4780 4781function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 4782 4783function _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); } 4784 4785function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 4786 4787 4788 4789 4790 4791 4792/** 4793 * Equalizer module. 4794 * @module foundation.equalizer 4795 * @requires foundation.util.mediaQuery 4796 * @requires foundation.util.imageLoader if equalizer contains images 4797 */ 4798 4799var Equalizer = 4800/*#__PURE__*/ 4801function (_Plugin) { 4802 _inherits(Equalizer, _Plugin); 4803 4804 function Equalizer() { 4805 _classCallCheck(this, Equalizer); 4806 4807 return _possibleConstructorReturn(this, _getPrototypeOf(Equalizer).apply(this, arguments)); 4808 } 4809 4810 _createClass(Equalizer, [{ 4811 key: "_setup", 4812 4813 /** 4814 * Creates a new instance of Equalizer. 4815 * @class 4816 * @name Equalizer 4817 * @fires Equalizer#init 4818 * @param {Object} element - jQuery object to add the trigger to. 4819 * @param {Object} options - Overrides to the default plugin settings. 4820 */ 4821 value: function _setup(element, options) { 4822 this.$element = element; 4823 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Equalizer.defaults, this.$element.data(), options); 4824 this.className = 'Equalizer'; // ie9 back compat 4825 4826 this._init(); 4827 } 4828 /** 4829 * Initializes the Equalizer plugin and calls functions to get equalizer functioning on load. 4830 * @private 4831 */ 4832 4833 }, { 4834 key: "_init", 4835 value: function _init() { 4836 var eqId = this.$element.attr('data-equalizer') || ''; 4837 var $watched = this.$element.find("[data-equalizer-watch=\"".concat(eqId, "\"]")); 4838 4839 _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"]._init(); 4840 4841 this.$watched = $watched.length ? $watched : this.$element.find('[data-equalizer-watch]'); 4842 this.$element.attr('data-resize', eqId || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'eq')); 4843 this.$element.attr('data-mutate', eqId || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'eq')); 4844 this.hasNested = this.$element.find('[data-equalizer]').length > 0; 4845 this.isNested = this.$element.parentsUntil(document.body, '[data-equalizer]').length > 0; 4846 this.isOn = false;
vendor: 9,213 bytes, lines 4847-5182
4847 this._bindHandler = { 4848 onResizeMeBound: this._onResizeMe.bind(this), 4849 onPostEqualizedBound: this._onPostEqualized.bind(this) 4850 }; 4851 var imgs = this.$element.find('img'); 4852 var tooSmall; 4853 4854 if (this.options.equalizeOn) { 4855 tooSmall = this._checkMQ(); 4856 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', this._checkMQ.bind(this)); 4857 } else { 4858 this._events(); 4859 } 4860 4861 if (typeof tooSmall !== 'undefined' && tooSmall === false || typeof tooSmall === 'undefined') { 4862 if (imgs.length) { 4863 Object(_foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_2__["onImagesLoaded"])(imgs, this._reflow.bind(this)); 4864 } else { 4865 this._reflow(); 4866 } 4867 } 4868 } 4869 /** 4870 * Removes event listeners if the breakpoint is too small. 4871 * @private 4872 */ 4873 4874 }, { 4875 key: "_pauseEvents", 4876 value: function _pauseEvents() { 4877 this.isOn = false; 4878 this.$element.off({ 4879 '.zf.equalizer': this._bindHandler.onPostEqualizedBound, 4880 'resizeme.zf.trigger': this._bindHandler.onResizeMeBound, 4881 'mutateme.zf.trigger': this._bindHandler.onResizeMeBound 4882 }); 4883 } 4884 /** 4885 * function to handle $elements resizeme.zf.trigger, with bound this on _bindHandler.onResizeMeBound 4886 * @private 4887 */ 4888 4889 }, { 4890 key: "_onResizeMe", 4891 value: function _onResizeMe(e) { 4892 this._reflow(); 4893 } 4894 /** 4895 * function to handle $elements postequalized.zf.equalizer, with bound this on _bindHandler.onPostEqualizedBound 4896 * @private 4897 */ 4898 4899 }, { 4900 key: "_onPostEqualized", 4901 value: function _onPostEqualized(e) { 4902 if (e.target !== this.$element[0]) { 4903 this._reflow(); 4904 } 4905 } 4906 /** 4907 * Initializes events for Equalizer. 4908 * @private 4909 */ 4910 4911 }, { 4912 key: "_events", 4913 value: function _events() { 4914 var _this = this; 4915 4916 this._pauseEvents(); 4917 4918 if (this.hasNested) { 4919 this.$element.on('postequalized.zf.equalizer', this._bindHandler.onPostEqualizedBound); 4920 } else { 4921 this.$element.on('resizeme.zf.trigger', this._bindHandler.onResizeMeBound); 4922 this.$element.on('mutateme.zf.trigger', this._bindHandler.onResizeMeBound); 4923 } 4924 4925 this.isOn = true; 4926 } 4927 /** 4928 * Checks the current breakpoint to the minimum required size. 4929 * @private 4930 */ 4931 4932 }, { 4933 key: "_checkMQ", 4934 value: function _checkMQ() { 4935 var tooSmall = !_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].is(this.options.equalizeOn); 4936 4937 if (tooSmall) { 4938 if (this.isOn) { 4939 this._pauseEvents(); 4940 4941 this.$watched.css('height', 'auto'); 4942 } 4943 } else { 4944 if (!this.isOn) { 4945 this._events(); 4946 } 4947 } 4948 4949 return tooSmall; 4950 } 4951 /** 4952 * A noop version for the plugin 4953 * @private 4954 */ 4955 4956 }, { 4957 key: "_killswitch", 4958 value: function _killswitch() { 4959 return; 4960 } 4961 /** 4962 * Calls necessary functions to update Equalizer upon DOM change 4963 * @private 4964 */ 4965 4966 }, { 4967 key: "_reflow", 4968 value: function _reflow() { 4969 if (!this.options.equalizeOnStack) { 4970 if (this._isStacked()) { 4971 this.$watched.css('height', 'auto'); 4972 return false; 4973 } 4974 } 4975 4976 if (this.options.equalizeByRow) { 4977 this.getHeightsByRow(this.applyHeightByRow.bind(this)); 4978 } else { 4979 this.getHeights(this.applyHeight.bind(this)); 4980 } 4981 } 4982 /** 4983 * Manually determines if the first 2 elements are *NOT* stacked. 4984 * @private 4985 */ 4986 4987 }, { 4988 key: "_isStacked", 4989 value: function _isStacked() { 4990 if (!this.$watched[0] || !this.$watched[1]) { 4991 return true; 4992 } 4993 4994 return this.$watched[0].getBoundingClientRect().top !== this.$watched[1].getBoundingClientRect().top; 4995 } 4996 /** 4997 * Finds the outer heights of children contained within an Equalizer parent and returns them in an array 4998 * @param {Function} cb - A non-optional callback to return the heights array to. 4999 * @returns {Array} heights - An array of heights of children within Equalizer container 5000 */ 5001 5002 }, { 5003 key: "getHeights", 5004 value: function getHeights(cb) { 5005 var heights = []; 5006 5007 for (var i = 0, len = this.$watched.length; i < len; i++) { 5008 this.$watched[i].style.height = 'auto'; 5009 heights.push(this.$watched[i].offsetHeight); 5010 } 5011 5012 cb(heights); 5013 } 5014 /** 5015 * Finds the outer heights of children contained within an Equalizer parent and returns them in an array 5016 * @param {Function} cb - A non-optional callback to return the heights array to. 5017 * @returns {Array} groups - An array of heights of children within Equalizer container grouped by row with element,height and max as last child 5018 */ 5019 5020 }, { 5021 key: "getHeightsByRow", 5022 value: function getHeightsByRow(cb) { 5023 var lastElTopOffset = this.$watched.length ? this.$watched.first().offset().top : 0, 5024 groups = [], 5025 group = 0; //group by Row 5026 5027 groups[group] = []; 5028 5029 for (var i = 0, len = this.$watched.length; i < len; i++) { 5030 this.$watched[i].style.height = 'auto'; //maybe could use this.$watched[i].offsetTop 5031 5032 var elOffsetTop = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.$watched[i]).offset().top; 5033 5034 if (elOffsetTop != lastElTopOffset) { 5035 group++; 5036 groups[group] = []; 5037 lastElTopOffset = elOffsetTop; 5038 } 5039 5040 groups[group].push([this.$watched[i], this.$watched[i].offsetHeight]); 5041 } 5042 5043 for (var j = 0, ln = groups.length; j < ln; j++) { 5044 var heights = jquery__WEBPACK_IMPORTED_MODULE_0___default()(groups[j]).map(function () { 5045 return this[1]; 5046 }).get(); 5047 var max = Math.max.apply(null, heights); 5048 groups[j].push(max); 5049 } 5050 5051 cb(groups); 5052 } 5053 /** 5054 * Changes the CSS height property of each child in an Equalizer parent to match the tallest 5055 * @param {array} heights - An array of heights of children within Equalizer container 5056 * @fires Equalizer#preequalized 5057 * @fires Equalizer#postequalized 5058 */ 5059 5060 }, { 5061 key: "applyHeight", 5062 value: function applyHeight(heights) { 5063 var max = Math.max.apply(null, heights); 5064 /** 5065 * Fires before the heights are applied 5066 * @event Equalizer#preequalized 5067 */ 5068 5069 this.$element.trigger('preequalized.zf.equalizer'); 5070 this.$watched.css('height', max); 5071 /** 5072 * Fires when the heights have been applied 5073 * @event Equalizer#postequalized 5074 */ 5075 5076 this.$element.trigger('postequalized.zf.equalizer'); 5077 } 5078 /** 5079 * Changes the CSS height property of each child in an Equalizer parent to match the tallest by row 5080 * @param {array} groups - An array of heights of children within Equalizer container grouped by row with element,height and max as last child 5081 * @fires Equalizer#preequalized 5082 * @fires Equalizer#preequalizedrow 5083 * @fires Equalizer#postequalizedrow 5084 * @fires Equalizer#postequalized 5085 */ 5086 5087 }, { 5088 key: "applyHeightByRow", 5089 value: function applyHeightByRow(groups) { 5090 /** 5091 * Fires before the heights are applied 5092 */ 5093 this.$element.trigger('preequalized.zf.equalizer'); 5094 5095 for (var i = 0, len = groups.length; i < len; i++) { 5096 var groupsILength = groups[i].length, 5097 max = groups[i][groupsILength - 1]; 5098 5099 if (groupsILength <= 2) { 5100 jquery__WEBPACK_IMPORTED_MODULE_0___default()(groups[i][0][0]).css({ 5101 'height': 'auto' 5102 }); 5103 continue; 5104 } 5105 /** 5106 * Fires before the heights per row are applied 5107 * @event Equalizer#preequalizedrow 5108 */ 5109 5110 5111 this.$element.trigger('preequalizedrow.zf.equalizer'); 5112 5113 for (var j = 0, lenJ = groupsILength - 1; j < lenJ; j++) { 5114 jquery__WEBPACK_IMPORTED_MODULE_0___default()(groups[i][j][0]).css({ 5115 'height': max 5116 }); 5117 } 5118 /** 5119 * Fires when the heights per row have been applied 5120 * @event Equalizer#postequalizedrow 5121 */ 5122 5123 5124 this.$element.trigger('postequalizedrow.zf.equalizer'); 5125 } 5126 /** 5127 * Fires when the heights have been applied 5128 */ 5129 5130 5131 this.$element.trigger('postequalized.zf.equalizer'); 5132 } 5133 /** 5134 * Destroys an instance of Equalizer. 5135 * @function 5136 */ 5137 5138 }, { 5139 key: "_destroy", 5140 value: function _destroy() { 5141 this._pauseEvents(); 5142 5143 this.$watched.css('height', 'auto'); 5144 } 5145 }]); 5146 5147 return Equalizer; 5148}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__["Plugin"]); 5149/** 5150 * Default settings for plugin 5151 */ 5152 5153 5154Equalizer.defaults = { 5155 /** 5156 * Enable height equalization when stacked on smaller screens. 5157 * @option 5158 * @type {boolean} 5159 * @default false 5160 */ 5161 equalizeOnStack: false, 5162 5163 /** 5164 * Enable height equalization row by row. 5165 * @option 5166 * @type {boolean} 5167 * @default false 5168 */ 5169 equalizeByRow: false, 5170 5171 /** 5172 * String representing the minimum breakpoint size the plugin should equalize heights on. 5173 * @option 5174 * @type {string} 5175 * @default '' 5176 */ 5177 equalizeOn: '' 5178}; 5179 5180 5181/***/ }), 5182
5183/***/ "./js/foundation.interchange.js": 5184/*!**************************************!*\ 5185 !*** ./js/foundation.interchange.js ***! 5186 \**************************************/ 5187/*! exports provided: Interchange */ 5188/***/ (function(module, __webpack_exports__, __webpack_require__) { 5189 5190"use strict"; 5191__webpack_require__.r(__webpack_exports__); 5192/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Interchange", function() { return Interchange; }); 5193/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 5194/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 5195/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js"); 5196/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 5197/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 5198/* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js"); 5199 5200 5201function _typeof(obj) { 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); } 5202 5203function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 5204 5205function _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); } } 5206 5207function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 5208 5209function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 5210 5211function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 5212 5213function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 5214 5215function _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); } 5216 5217function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 5218 5219 5220 5221 5222 5223 5224/** 5225 * Interchange module. 5226 * @module foundation.interchange 5227 * @requires foundation.util.mediaQuery 5228 */ 5229 5230var Interchange = 5231/*#__PURE__*/ 5232function (_Plugin) { 5233 _inherits(Interchange, _Plugin); 5234 5235 function Interchange() { 5236 _classCallCheck(this, Interchange); 5237 5238 return _possibleConstructorReturn(this, _getPrototypeOf(Interchange).apply(this, arguments)); 5239 } 5240 5241 _createClass(Interchange, [{ 5242 key: "_setup", 5243 5244 /** 5245 * Creates a new instance of Interchange. 5246 * @class 5247 * @name Interchange 5248 * @fires Interchange#init 5249 * @param {Object} element - jQuery object to add the trigger to. 5250 * @param {Object} options - Overrides to the default plugin settings. 5251 */ 5252 value: function _setup(element, options) { 5253 this.$element = element; 5254 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Interchange.defaults, this.$element.data(), options); 5255 this.rules = []; 5256 this.currentPath = ''; 5257 this.className = 'Interchange'; // ie9 back compat 5258 // Triggers init is idempotent, just need to make sure it is initialized 5259 5260 _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 5261 5262 this._init(); 5263 5264 this._events(); 5265 } 5266 /** 5267 * Initializes the Interchange plugin and calls functions to get interchange functioning on load. 5268 * @function 5269 * @private 5270 */ 5271 5272 }, { 5273 key: "_init", 5274 value: function _init() { 5275 _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"]._init(); 5276 5277 var id = this.$element[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'interchange'); 5278 this.$element.attr({ 5279 'data-resize': id, 5280 'id': id 5281 }); 5282 5283 this._parseOptions(); 5284 5285 this._addBreakpoints(); 5286 5287 this._generateRules(); 5288 5289 this._reflow(); 5290 } 5291 /** 5292 * Initializes events for Interchange. 5293 * @function 5294 * @private 5295 */ 5296 5297 }, { 5298 key: "_events", 5299 value: function _events() { 5300 var _this = this; 5301 5302 this.$element.off('resizeme.zf.trigger').on('resizeme.zf.trigger', function () { 5303 return _this._reflow(); 5304 }); 5305 } 5306 /** 5307 * Calls necessary functions to update Interchange upon DOM change 5308 * @function 5309 * @private 5310 */ 5311 5312 }, { 5313 key: "_reflow", 5314 value: function _reflow() { 5315 var match; // Iterate through each rule, but only save the last match 5316 5317 for (var i in this.rules) { 5318 if (this.rules.hasOwnProperty(i)) { 5319 var rule = this.rules[i]; 5320 5321 if (window.matchMedia(rule.query).matches) { 5322 match = rule; 5323 } 5324 } 5325 } 5326 5327 if (match) { 5328 this.replace(match.path); 5329 } 5330 } 5331 /** 5332 * Check options valifity and set defaults for: 5333 * - `data-interchange-type`: if set, enforce the type of replacement (auto, src, background or html) 5334 * @function 5335 * @private 5336 */ 5337 5338 }, { 5339 key: "_parseOptions", 5340 value: function _parseOptions() { 5341 var types = ['auto', 'src', 'background', 'html']; 5342 if (typeof this.options.type === 'undefined') this.options.type = 'auto';else if (types.indexOf(this.options.type) === -1) { 5343 console.log("Warning: invalid value \"".concat(this.options.type, "\" for Interchange option \"type\"")); 5344 this.options.type = 'auto'; 5345 } 5346 } 5347 /** 5348 * Gets the Foundation breakpoints and adds them to the Interchange.SPECIAL_QUERIES object. 5349 * @function 5350 * @private 5351 */ 5352 5353 }, { 5354 key: "_addBreakpoints", 5355 value: function _addBreakpoints() { 5356 for (var i in _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].queries) { 5357 if (_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].queries.hasOwnProperty(i)) { 5358 var query = _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].queries[i]; 5359 Interchange.SPECIAL_QUERIES[query.name] = query.value; 5360 } 5361 } 5362 } 5363 /** 5364 * Checks the Interchange element for the provided media query + content pairings 5365 * @function 5366 * @private 5367 * @param {Object} element - jQuery object that is an Interchange instance 5368 * @returns {Array} scenarios - Array of objects that have 'mq' and 'path' keys with corresponding keys 5369 */ 5370 5371 }, { 5372 key: "_generateRules", 5373 value: function _generateRules(element) { 5374 var rulesList = []; 5375 var rules; 5376 5377 if (this.options.rules) { 5378 rules = this.options.rules; 5379 } else { 5380 rules = this.$element.data('interchange'); 5381 } 5382 5383 rules = typeof rules === 'string' ? rules.match(/\[.*?, .*?\]/g) : rules; 5384 5385 for (var i in rules) { 5386 if (rules.hasOwnProperty(i)) { 5387 var rule = rules[i].slice(1, -1).split(', '); 5388 var path = rule.slice(0, -1).join(''); 5389 var query = rule[rule.length - 1]; 5390 5391 if (Interchange.SPECIAL_QUERIES[query]) { 5392 query = Interchange.SPECIAL_QUERIES[query]; 5393 } 5394 5395 rulesList.push({ 5396 path: path, 5397 query: query 5398 }); 5399 } 5400 } 5401 5402 this.rules = rulesList; 5403 } 5404 /** 5405 * Update the `src` property of an image, or change the HTML of a container, to the specified path. 5406 * @function 5407 * @param {String} path - Path to the image or HTML partial. 5408 * @fires Interchange#replaced 5409 */ 5410 5411 }, { 5412 key: "replace", 5413 value: function replace(path) { 5414 var _this2 = this; 5415 5416 if (this.currentPath === path) return; 5417 var trigger = 'replaced.zf.interchange'; 5418 var type = this.options.type; 5419 5420 if (type === 'auto') { 5421 if (this.$element[0].nodeName === 'IMG') type = 'src';else if (path.match(/\.(gif|jpe?g|png|svg|tiff)([?#].*)?/i)) type = 'background';
vendor: 2,474 bytes, lines 5421-5499
5421else type = 'html'; 5422 } // Replacing images 5423 5424 5425 if (type === 'src') { 5426 this.$element.attr('src', path).on('load', function () { 5427 _this2.currentPath = path; 5428 }).trigger(trigger); 5429 } // Replacing background images 5430 else if (type === 'background') { 5431 path = path.replace(/\(/g, '%28').replace(/\)/g, '%29'); 5432 this.$element.css({ 5433 'background-image': 'url(' + path + ')' 5434 }).trigger(trigger); 5435 } // Replacing HTML 5436 else if (type === 'html') { 5437 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.get(path, function (response) { 5438 _this2.$element.html(response).trigger(trigger); 5439 5440 jquery__WEBPACK_IMPORTED_MODULE_0___default()(response).foundation(); 5441 _this2.currentPath = path; 5442 }); 5443 } 5444 /** 5445 * Fires when content in an Interchange element is done being loaded. 5446 * @event Interchange#replaced 5447 */ 5448 // this.$element.trigger('replaced.zf.interchange'); 5449 5450 } 5451 /** 5452 * Destroys an instance of interchange. 5453 * @function 5454 */ 5455 5456 }, { 5457 key: "_destroy", 5458 value: function _destroy() { 5459 this.$element.off('resizeme.zf.trigger'); 5460 } 5461 }]); 5462 5463 return Interchange; 5464}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__["Plugin"]); 5465/** 5466 * Default settings for plugin 5467 */ 5468 5469 5470Interchange.defaults = { 5471 /** 5472 * Rules to be applied to Interchange elements. Set with the `data-interchange` array notation. 5473 * @option 5474 * @type {?array} 5475 * @default null 5476 */ 5477 rules: null, 5478 5479 /** 5480 * Type of the responsive ressource to replace. It can take the following options: 5481 * - `auto` (default): choose the type according to the element tag or the ressource extension, 5482 * - `src`: replace the `[src]` attribute, recommended for images `<img>`. 5483 * - `background`: replace the `background-image` CSS property. 5484 * - `html`: replace the element content. 5485 * @option 5486 * @type {string} 5487 * @default 'auto' 5488 */ 5489 type: 'auto' 5490}; 5491Interchange.SPECIAL_QUERIES = { 5492 'landscape': 'screen and (orientation: landscape)', 5493 'portrait': 'screen and (orientation: portrait)', 5494 '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)' 5495}; 5496 5497 5498/***/ }), 5499
5500/***/ "./js/foundation.magellan.js": 5501/*!***********************************!*\ 5502 !*** ./js/foundation.magellan.js ***! 5503 \***********************************/ 5504/*! exports provided: Magellan */ 5505/***/ (function(module, __webpack_exports__, __webpack_require__) { 5506 5507"use strict"; 5508__webpack_require__.r(__webpack_exports__); 5509/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Magellan", function() { return Magellan; }); 5510/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 5511/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 5512/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 5513/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 5514/* harmony import */ var _foundation_smoothScroll__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.smoothScroll */ "./js/foundation.smoothScroll.js"); 5515/* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js"); 5516 5517 5518function _typeof(obj) { 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); } 5519 5520function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 5521 5522function _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); } } 5523 5524function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 5525 5526function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 5527 5528function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 5529 5530function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 5531 5532function _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); } 5533 5534function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 5535 5536 5537 5538 5539 5540 5541/** 5542 * Magellan module. 5543 * @module foundation.magellan 5544 * @requires foundation.smoothScroll 5545 * @requires foundation.util.triggers 5546 */ 5547 5548var Magellan = 5549/*#__PURE__*/ 5550function (_Plugin) { 5551 _inherits(Magellan, _Plugin); 5552 5553 function Magellan() { 5554 _classCallCheck(this, Magellan); 5555 5556 return _possibleConstructorReturn(this, _getPrototypeOf(Magellan).apply(this, arguments)); 5557 } 5558 5559 _createClass(Magellan, [{ 5560 key: "_setup", 5561 5562 /** 5563 * Creates a new instance of Magellan. 5564 * @class 5565 * @name Magellan 5566 * @fires Magellan#init 5567 * @param {Object} element - jQuery object to add the trigger to. 5568 * @param {Object} options - Overrides to the default plugin settings. 5569 */ 5570 value: function _setup(element, options) { 5571 this.$element = element; 5572 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Magellan.defaults, this.$element.data(), options); 5573 this.className = 'Magellan'; // ie9 back compat 5574 // Triggers init is idempotent, just need to make sure it is initialized 5575 5576 _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 5577 5578 this._init(); 5579 5580 this.calcPoints(); 5581 } 5582 /** 5583 * Initializes the Magellan plugin and calls functions to get equalizer functioning on load. 5584 * @private 5585 */ 5586 5587 }, { 5588 key: "_init", 5589 value: function _init() { 5590 var id = this.$element[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'magellan'); 5591 5592 var _this = this; 5593 5594 this.$targets = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-magellan-target]'); 5595 this.$links = this.$element.find('a'); 5596 this.$element.attr({ 5597 'data-resize': id, 5598 'data-scroll': id, 5599 'id': id 5600 }); 5601 this.$active = jquery__WEBPACK_IMPORTED_MODULE_0___default()(); 5602 this.scrollPos = parseInt(window.pageYOffset, 10); 5603 5604 this._events(); 5605 } 5606 /** 5607 * Calculates an array of pixel values that are the demarcation lines between locations on the page. 5608 * Can be invoked if new elements are added or the size of a location changes. 5609 * @function 5610 */ 5611 5612 }, { 5613 key: "calcPoints", 5614 value: function calcPoints() { 5615 var _this = this, 5616 body = document.body, 5617 html = document.documentElement; 5618 5619 this.points = []; 5620 this.winHeight = Math.round(Math.max(window.innerHeight, html.clientHeight)); 5621 this.docHeight = Math.round(Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight)); 5622 this.$targets.each(function () { 5623 var $tar = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 5624 pt = Math.round($tar.offset().top - _this.options.threshold); 5625 $tar.targetPoint = pt; 5626 5627 _this.points.push(pt); 5628 }); 5629 } 5630 /** 5631 * Initializes events for Magellan. 5632 * @private 5633 */ 5634 5635 }, { 5636 key: "_events", 5637 value: function _events() { 5638 var _this = this; 5639 5640 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).one('load', function () { 5641 if (_this.options.deepLinking) { 5642 if (location.hash) { 5643 _this.scrollToLoc(location.hash); 5644 } 5645 } 5646 5647 _this.calcPoints(); 5648 5649 _this._updateActive(); 5650 }); 5651 _this.onLoadListener = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () { 5652 _this.$element.on({ 5653 'resizeme.zf.trigger': _this.reflow.bind(_this), 5654 'scrollme.zf.trigger': _this._updateActive.bind(_this) 5655 }).on('click.zf.magellan', 'a[href^="#"]', function (e) { 5656 e.preventDefault(); 5657 var arrival = this.getAttribute('href'); 5658 5659 _this.scrollToLoc(arrival); 5660 }); 5661 }); 5662 5663 this._deepLinkScroll = function (e) { 5664 if (_this.options.deepLinking) { 5665 _this.scrollToLoc(window.location.hash); 5666 } 5667 }; 5668 5669 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('hashchange', this._deepLinkScroll); 5670 } 5671 /** 5672 * Function to scroll to a given location on the page. 5673 * @param {String} loc - a properly formatted jQuery id selector. Example: '#foo' 5674 * @function 5675 */ 5676 5677 }, { 5678 key: "scrollToLoc", 5679 value: function scrollToLoc(loc) { 5680 this._inTransition = true; 5681 5682 var _this = this; 5683 5684 var options = { 5685 animationEasing: this.options.animationEasing, 5686 animationDuration: this.options.animationDuration, 5687 threshold: this.options.threshold, 5688 offset: this.options.offset 5689 }; 5690 _foundation_smoothScroll__WEBPACK_IMPORTED_MODULE_3__["SmoothScroll"].scrollToLoc(loc, options, function () { 5691 _this._inTransition = false;
vendor: 5,148 bytes, lines 5692-5870
5692 }); 5693 } 5694 /** 5695 * Calls necessary functions to update Magellan upon DOM change 5696 * @function 5697 */ 5698 5699 }, { 5700 key: "reflow", 5701 value: function reflow() { 5702 this.calcPoints(); 5703 5704 this._updateActive(); 5705 } 5706 /** 5707 * Updates the visibility of an active location link, and updates the url hash for the page, if deepLinking enabled. 5708 * @private 5709 * @function 5710 * @fires Magellan#update 5711 */ 5712 5713 }, { 5714 key: "_updateActive", 5715 value: function _updateActive() 5716 /*evt, elem, scrollPos*/ 5717 { 5718 var _this2 = this; 5719 5720 if (this._inTransition) return; 5721 var newScrollPos = parseInt(window.pageYOffset, 10); 5722 var isScrollingUp = this.scrollPos > newScrollPos; 5723 this.scrollPos = newScrollPos; 5724 var activeIdx; // Before the first point: no link 5725 5726 if (newScrollPos < this.points[0]) {} 5727 /* do nothing */ 5728 // At the bottom of the page: last link 5729 else if (newScrollPos + this.winHeight === this.docHeight) { 5730 activeIdx = this.points.length - 1; 5731 } // Otherwhise, use the last visible link 5732 else { 5733 var visibleLinks = this.points.filter(function (p, i) { 5734 return p - _this2.options.offset - (isScrollingUp ? _this2.options.threshold : 0) <= newScrollPos; 5735 }); 5736 activeIdx = visibleLinks.length ? visibleLinks.length - 1 : 0; 5737 } // Get the new active link 5738 5739 5740 var $oldActive = this.$active; 5741 var activeHash = ''; 5742 5743 if (typeof activeIdx !== 'undefined') { 5744 this.$active = this.$links.filter('[href="#' + this.$targets.eq(activeIdx).data('magellan-target') + '"]'); 5745 if (this.$active.length) activeHash = this.$active[0].getAttribute('href'); 5746 } else { 5747 this.$active = jquery__WEBPACK_IMPORTED_MODULE_0___default()(); 5748 } 5749 5750 var isNewActive = !(!this.$active.length && !$oldActive.length) && !this.$active.is($oldActive); 5751 var isNewHash = activeHash !== window.location.hash; // Update the active link element 5752 5753 if (isNewActive) { 5754 $oldActive.removeClass(this.options.activeClass); 5755 this.$active.addClass(this.options.activeClass); 5756 } // Update the hash (it may have changed with the same active link) 5757 5758 5759 if (this.options.deepLinking && isNewHash) { 5760 if (window.history.pushState) { 5761 // Set or remove the hash (see: https://stackoverflow.com/a/5298684/4317384 5762 var url = activeHash ? activeHash : window.location.pathname + window.location.search; 5763 5764 if (this.options.updateHistory) { 5765 window.history.pushState({}, '', url); 5766 } else { 5767 window.history.replaceState({}, '', url); 5768 } 5769 } else { 5770 window.location.hash = activeHash; 5771 } 5772 } 5773 5774 if (isNewActive) { 5775 /** 5776 * Fires when magellan is finished updating to the new active element. 5777 * @event Magellan#update 5778 */ 5779 this.$element.trigger('update.zf.magellan', [this.$active]); 5780 } 5781 } 5782 /** 5783 * Destroys an instance of Magellan and resets the url of the window. 5784 * @function 5785 */ 5786 5787 }, { 5788 key: "_destroy", 5789 value: function _destroy() { 5790 this.$element.off('.zf.trigger .zf.magellan').find(".".concat(this.options.activeClass)).removeClass(this.options.activeClass); 5791 5792 if (this.options.deepLinking) { 5793 var hash = this.$active[0].getAttribute('href'); 5794 window.location.hash.replace(hash, ''); 5795 } 5796 5797 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('hashchange', this._deepLinkScroll); 5798 if (this.onLoadListener) jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(this.onLoadListener); 5799 } 5800 }]); 5801 5802 return Magellan; 5803}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]); 5804/** 5805 * Default settings for plugin 5806 */ 5807 5808 5809Magellan.defaults = { 5810 /** 5811 * Amount of time, in ms, the animated scrolling should take between locations. 5812 * @option 5813 * @type {number} 5814 * @default 500 5815 */ 5816 animationDuration: 500, 5817 5818 /** 5819 * Animation style to use when scrolling between locations. Can be `'swing'` or `'linear'`. 5820 * @option 5821 * @type {string} 5822 * @default 'linear' 5823 * @see {@link https://api.jquery.com/animate|Jquery animate} 5824 */ 5825 animationEasing: 'linear', 5826 5827 /** 5828 * Number of pixels to use as a marker for location changes. 5829 * @option 5830 * @type {number} 5831 * @default 50 5832 */ 5833 threshold: 50, 5834 5835 /** 5836 * Class applied to the active locations link on the magellan container. 5837 * @option 5838 * @type {string} 5839 * @default 'is-active' 5840 */ 5841 activeClass: 'is-active', 5842 5843 /** 5844 * Allows the script to manipulate the url of the current page, and if supported, alter the history. 5845 * @option 5846 * @type {boolean} 5847 * @default false 5848 */ 5849 deepLinking: false, 5850 5851 /** 5852 * Update the browser history with the active link, if deep linking is enabled. 5853 * @option 5854 * @type {boolean} 5855 * @default false 5856 */ 5857 updateHistory: false, 5858 5859 /** 5860 * Number of pixels to offset the scroll of the page on item click if using a sticky nav bar. 5861 * @option 5862 * @type {number} 5863 * @default 0 5864 */ 5865 offset: 0 5866}; 5867 5868 5869/***/ }), 5870
vendor: 5,129 bytes, lines 5871-5959
5871/***/ "./js/foundation.offcanvas.js": 5872/*!************************************!*\ 5873 !*** ./js/foundation.offcanvas.js ***! 5874 \************************************/ 5875/*! exports provided: OffCanvas */ 5876/***/ (function(module, __webpack_exports__, __webpack_require__) { 5877 5878"use strict"; 5879__webpack_require__.r(__webpack_exports__); 5880/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OffCanvas", function() { return OffCanvas; }); 5881/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 5882/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 5883/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 5884/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 5885/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js"); 5886/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js"); 5887/* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js"); 5888 5889 5890function _typeof(obj) { 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); } 5891 5892function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 5893 5894function _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); } } 5895 5896function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 5897 5898function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 5899 5900function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 5901 5902function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 5903 5904function _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); } 5905 5906function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 5907 5908 5909 5910 5911 5912 5913 5914/** 5915 * OffCanvas module. 5916 * @module foundation.offCanvas 5917 * @requires foundation.util.keyboard 5918 * @requires foundation.util.mediaQuery 5919 * @requires foundation.util.triggers 5920 */ 5921 5922var OffCanvas = 5923/*#__PURE__*/ 5924function (_Plugin) { 5925 _inherits(OffCanvas, _Plugin); 5926 5927 function OffCanvas() { 5928 _classCallCheck(this, OffCanvas); 5929 5930 return _possibleConstructorReturn(this, _getPrototypeOf(OffCanvas).apply(this, arguments)); 5931 } 5932 5933 _createClass(OffCanvas, [{ 5934 key: "_setup", 5935 5936 /** 5937 * Creates a new instance of an off-canvas wrapper. 5938 * @class 5939 * @name OffCanvas 5940 * @fires OffCanvas#init 5941 * @param {Object} element - jQuery object to initialize. 5942 * @param {Object} options - Overrides to the default plugin settings. 5943 */ 5944 value: function _setup(element, options) { 5945 var _this2 = this; 5946 5947 this.className = 'OffCanvas'; // ie9 back compat 5948 5949 this.$element = element; 5950 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, OffCanvas.defaults, this.$element.data(), options); 5951 this.contentClasses = { 5952 base: [], 5953 reveal: [] 5954 }; 5955 this.$lastTrigger = jquery__WEBPACK_IMPORTED_MODULE_0___default()(); 5956 this.$triggers = jquery__WEBPACK_IMPORTED_MODULE_0___default()(); 5957 this.position = 'left'; 5958 this.$content = jquery__WEBPACK_IMPORTED_MODULE_0___default()(); 5959 this.nested = !!this.options.nested;
vendor: 10,037 bytes, lines 5960-6197
5960 this.$sticky = jquery__WEBPACK_IMPORTED_MODULE_0___default()(); 5961 this.isInCanvas = false; // Defines the CSS transition/position classes of the off-canvas content container. 5962 5963 jquery__WEBPACK_IMPORTED_MODULE_0___default()(['push', 'overlap']).each(function (index, val) { 5964 _this2.contentClasses.base.push('has-transition-' + val); 5965 }); 5966 jquery__WEBPACK_IMPORTED_MODULE_0___default()(['left', 'right', 'top', 'bottom']).each(function (index, val) { 5967 _this2.contentClasses.base.push('has-position-' + val); 5968 5969 _this2.contentClasses.reveal.push('has-reveal-' + val); 5970 }); // Triggers init is idempotent, just need to make sure it is initialized 5971 5972 _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_5__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 5973 5974 _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_4__["MediaQuery"]._init(); 5975 5976 this._init(); 5977 5978 this._events(); 5979 5980 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].register('OffCanvas', { 5981 'ESCAPE': 'close' 5982 }); 5983 } 5984 /** 5985 * Initializes the off-canvas wrapper by adding the exit overlay (if needed). 5986 * @function 5987 * @private 5988 */ 5989 5990 }, { 5991 key: "_init", 5992 value: function _init() { 5993 var id = this.$element.attr('id'); 5994 this.$element.attr('aria-hidden', 'true'); // Find off-canvas content, either by ID (if specified), by siblings or by closest selector (fallback) 5995 5996 if (this.options.contentId) { 5997 this.$content = jquery__WEBPACK_IMPORTED_MODULE_0___default()('#' + this.options.contentId); 5998 } else if (this.$element.siblings('[data-off-canvas-content]').length) { 5999 this.$content = this.$element.siblings('[data-off-canvas-content]').first(); 6000 } else { 6001 this.$content = this.$element.closest('[data-off-canvas-content]').first(); 6002 } 6003 6004 if (!this.options.contentId) { 6005 // Assume that the off-canvas element is nested if it isn't a sibling of the content 6006 this.nested = this.$element.siblings('[data-off-canvas-content]').length === 0; 6007 } else if (this.options.contentId && this.options.nested === null) { 6008 // Warning if using content ID without setting the nested option 6009 // Once the element is nested it is required to work properly in this case 6010 console.warn('Remember to use the nested option if using the content ID option!'); 6011 } 6012 6013 if (this.nested === true) { 6014 // Force transition overlap if nested 6015 this.options.transition = 'overlap'; // Remove appropriate classes if already assigned in markup 6016 6017 this.$element.removeClass('is-transition-push'); 6018 } 6019 6020 this.$element.addClass("is-transition-".concat(this.options.transition, " is-closed")); // Find triggers that affect this element and add aria-expanded to them 6021 6022 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 6023 6024 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 6025 6026 if (this.options.contentOverlay === true) { 6027 var overlay = document.createElement('div'); 6028 var overlayPosition = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.$element).css("position") === 'fixed' ? 'is-overlay-fixed' : 'is-overlay-absolute'; 6029 overlay.setAttribute('class', 'js-off-canvas-overlay ' + overlayPosition); 6030 this.$overlay = jquery__WEBPACK_IMPORTED_MODULE_0___default()(overlay); 6031 6032 if (overlayPosition === 'is-overlay-fixed') { 6033 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.$overlay).insertAfter(this.$element); 6034 } else { 6035 this.$content.append(this.$overlay); 6036 } 6037 } // Get the revealOn option from the class. 6038 6039 6040 var revealOnRegExp = new RegExp(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["RegExpEscape"])(this.options.revealClass) + '([^\\s]+)', 'g'); 6041 var revealOnClass = revealOnRegExp.exec(this.$element[0].className); 6042 6043 if (revealOnClass) { 6044 this.options.isRevealed = true; 6045 this.options.revealOn = this.options.revealOn || revealOnClass[1]; 6046 } // Ensure the `reveal-on-*` class is set. 6047 6048 6049 if (this.options.isRevealed === true && this.options.revealOn) { 6050 this.$element.first().addClass("".concat(this.options.revealClass).concat(this.options.revealOn)); 6051 6052 this._setMQChecker(); 6053 } 6054 6055 if (this.options.transitionTime) { 6056 this.$element.css('transition-duration', this.options.transitionTime); 6057 } // Find fixed elements that should stay fixed while off-canvas is opened 6058 6059 6060 this.$sticky = this.$content.find('[data-off-canvas-sticky]'); 6061 6062 if (this.$sticky.length > 0 && this.options.transition === 'push') { 6063 // If there's at least one match force contentScroll:false because the absolute top value doesn't get recalculated on scroll 6064 // Limit to push transition since there's no transform scope for overlap 6065 this.options.contentScroll = false; 6066 } 6067 6068 var inCanvasFor = this.$element.attr('class').match(/\bin-canvas-for-(\w+)/); 6069 6070 if (inCanvasFor && inCanvasFor.length === 2) { 6071 // Set `inCanvasOn` option if found in-canvas-for-[BREAKPONT] CSS class 6072 this.options.inCanvasOn = inCanvasFor[1]; 6073 } else if (this.options.inCanvasOn) { 6074 // Ensure the CSS class is set 6075 this.$element.addClass("in-canvas-for-".concat(this.options.inCanvasOn)); 6076 } 6077 6078 if (this.options.inCanvasOn) { 6079 this._checkInCanvas(); 6080 } // Initally remove all transition/position CSS classes from off-canvas content container. 6081 6082 6083 this._removeContentClasses(); 6084 } 6085 /** 6086 * Adds event handlers to the off-canvas wrapper and the exit overlay. 6087 * @function 6088 * @private 6089 */ 6090 6091 }, { 6092 key: "_events", 6093 value: function _events() { 6094 var _this3 = this; 6095 6096 this.$element.off('.zf.trigger .zf.offCanvas').on({ 6097 'open.zf.trigger': this.open.bind(this), 6098 'close.zf.trigger': this.close.bind(this), 6099 'toggle.zf.trigger': this.toggle.bind(this), 6100 'keydown.zf.offCanvas': this._handleKeyboard.bind(this) 6101 }); 6102 6103 if (this.options.closeOnClick === true) { 6104 var $target = this.options.contentOverlay ? this.$overlay : this.$content; 6105 $target.on({ 6106 'click.zf.offCanvas': this.close.bind(this) 6107 }); 6108 } 6109 6110 if (this.options.inCanvasOn) { 6111 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', function () { 6112 _this3._checkInCanvas(); 6113 }); 6114 } 6115 } 6116 /** 6117 * Applies event listener for elements that will reveal at certain breakpoints. 6118 * @private 6119 */ 6120 6121 }, { 6122 key: "_setMQChecker", 6123 value: function _setMQChecker() { 6124 var _this = this; 6125 6126 this.onLoadListener = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () { 6127 if (_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_4__["MediaQuery"].atLeast(_this.options.revealOn)) { 6128 _this.reveal(true); 6129 } 6130 }); 6131 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', function () { 6132 if (_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_4__["MediaQuery"].atLeast(_this.options.revealOn)) { 6133 _this.reveal(true); 6134 } else { 6135 _this.reveal(false); 6136 } 6137 }); 6138 } 6139 /** 6140 * Checks if InCanvas on current breakpoint and adjust off-canvas accordingly 6141 * @private 6142 */ 6143 6144 }, { 6145 key: "_checkInCanvas", 6146 value: function _checkInCanvas() { 6147 this.isInCanvas = _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_4__["MediaQuery"].atLeast(this.options.inCanvasOn); 6148 6149 if (this.isInCanvas === true) { 6150 this.close(); 6151 } 6152 } 6153 /** 6154 * Removes the CSS transition/position classes of the off-canvas content container. 6155 * Removing the classes is important when another off-canvas gets opened that uses the same content container. 6156 * @param {Boolean} hasReveal - true if related off-canvas element is revealed. 6157 * @private 6158 */ 6159 6160 }, { 6161 key: "_removeContentClasses", 6162 value: function _removeContentClasses(hasReveal) { 6163 if (typeof hasReveal !== 'boolean') { 6164 this.$content.removeClass(this.contentClasses.base.join(' ')); 6165 } else if (hasReveal === false) { 6166 this.$content.removeClass("has-reveal-".concat(this.position)); 6167 } 6168 } 6169 /** 6170 * Adds the CSS transition/position classes of the off-canvas content container, based on the opening off-canvas element. 6171 * Beforehand any transition/position class gets removed. 6172 * @param {Boolean} hasReveal - true if related off-canvas element is revealed. 6173 * @private 6174 */ 6175 6176 }, { 6177 key: "_addContentClasses", 6178 value: function _addContentClasses(hasReveal) { 6179 this._removeContentClasses(hasReveal); 6180 6181 if (typeof hasReveal !== 'boolean') { 6182 this.$content.addClass("has-transition-".concat(this.options.transition, " has-position-").concat(this.position)); 6183 } else if (hasReveal === true) { 6184 this.$content.addClass("has-reveal-".concat(this.position)); 6185 } 6186 } 6187 /** 6188 * Preserves the fixed behavior of sticky elements on opening an off-canvas with push transition. 6189 * Since the off-canvas container has got a transform scope in such a case, it is done by calculating position absolute values. 6190 * @private 6191 */ 6192 6193 }, { 6194 key: "_fixStickyElements", 6195 value: function _fixStickyElements() { 6196 this.$sticky.each(function (_, el) { 6197 var $el = jquery__WEBPACK_IMPORTED_MODULE_0___default()(el);
6197 // If sticky element is currently fixed, adjust its top value to match absolute position due to transform scope 6198 // Limit to push transition because postion:fixed works without problems for overlap (no transform scope) 6199 6200 if ($el.css('position') === 'fixed') { 6201 // Save current inline styling to restore it if undoing the absolute fixing 6202 var topVal = parseInt($el.css('top'), 10); 6203 $el.data('offCanvasSticky', { 6204 top: topVal 6205 }); 6206 var absoluteTopVal = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).scrollTop() + topVal; 6207 $el.css({ 6208 top: "".concat(absoluteTopVal, "px"), 6209 width: '100%', 6210 transition: 'none' 6211 }); 6212 } 6213 }); 6214 } 6215 /** 6216 * Restores the original fixed styling of sticky elements after having closed an off-canvas that got pseudo fixed beforehand. 6217 * This reverts the changes of _fixStickyElements() 6218 * @private 6219 */ 6220 6221 }, { 6222 key: "_unfixStickyElements", 6223 value: function _unfixStickyElements() { 6224 this.$sticky.each(function (_, el) { 6225 var $el = jquery__WEBPACK_IMPORTED_MODULE_0___default()(el); 6226 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 6227 6228 if (_typeof(stickyData) === 'object') { 6229 $el.css({ 6230 top: "".concat(stickyData.top, "px"), 6231 width: '', 6232 transition: '' 6233 }); 6234 $el.data('offCanvasSticky', ''); 6235 } 6236 }); 6237 } 6238 /** 6239 * Handles the revealing/hiding the off-canvas at breakpoints, not the same as open. 6240 * @param {Boolean} isRevealed - true if element should be revealed. 6241 * @function 6242 */ 6243 6244 }, { 6245 key: "reveal", 6246 value: function reveal(isRevealed) { 6247 if (isRevealed) { 6248 this.close(); 6249 this.isRevealed = true; 6250 this.$element.attr('aria-hidden', 'false'); 6251 this.$element.off('open.zf.trigger toggle.zf.trigger'); 6252 this.$element.removeClass('is-closed'); 6253 } else { 6254 this.isRevealed = false; 6255 this.$element.attr('aria-hidden', 'true'); 6256 this.$element.off('open.zf.trigger toggle.zf.trigger').on({ 6257 'open.zf.trigger': this.open.bind(this), 6258 'toggle.zf.trigger': this.toggle.bind(this) 6259 }); 6260 this.$element.addClass('is-closed'); 6261 } 6262 6263 this._addContentClasses(isRevealed); 6264 } 6265 /** 6266 * Stops scrolling of the body when OffCanvas is open on mobile Safari and other troublesome browsers. 6267 * @function 6268 * @private 6269 */ 6270 6271 }, { 6272 key: "_stopScrolling", 6273 value: function _stopScrolling(event) { 6274 return false; 6275 } 6276 /** 6277 * Tag the element given as context whether it can be scrolled up and down. 6278 * Used to allow or prevent it to scroll. See `_stopScrollPropagation`. 6279 * 6280 * Taken and adapted from http://stackoverflow.com/questions/16889447/prevent-full-page-scrolling-ios 6281 * Only really works for y, not sure how to extend to x or if we need to. 6282 * 6283 * @function 6284 * @private 6285 */ 6286 6287 }, { 6288 key: "_recordScrollable", 6289 value: function _recordScrollable(event) { 6290 var elem = this; // called from event handler context with this as elem 6291 // If the element is scrollable (content overflows), then... 6292 6293 if (elem.scrollHeight !== elem.clientHeight) { 6294 // If we're at the top, scroll down one pixel to allow scrolling up 6295 if (elem.scrollTop === 0) { 6296 elem.scrollTop = 1; 6297 } // If we're at the bottom, scroll up one pixel to allow scrolling down 6298 6299 6300 if (elem.scrollTop === elem.scrollHeight - elem.clientHeight) { 6301 elem.scrollTop = elem.scrollHeight - elem.clientHeight - 1; 6302 } 6303 } 6304 6305 elem.allowUp = elem.scrollTop > 0; 6306 elem.allowDown = elem.scrollTop < elem.scrollHeight - elem.clientHeight; 6307 elem.lastY = event.originalEvent.pageY; 6308 } 6309 /** 6310 * Prevent the given event propagation if the element given as context c
6310an scroll. 6311 * Used to preserve the element scrolling on mobile (`touchmove`) when the document 6312 * scrolling is prevented. See https://git.io/zf-9707. 6313 * @function 6314 * @private 6315 */ 6316 6317 }, { 6318 key: "_stopScrollPropagation", 6319 value: function _stopScrollPropagation(event) { 6320 var elem = this; // called from event handler context with this as elem 6321 6322 var parent; // off-canvas elem if called from inner scrollbox 6323 6324 var up = event.pageY < elem.lastY; 6325 var down = !up; 6326 elem.lastY = event.pageY; 6327 6328 if (up && elem.allowUp || down && elem.allowDown) { 6329 // It is not recommended to stop event propagation (the user cannot watch it), 6330 // but in this case this is the only solution we have. 6331 event.stopPropagation(); // If elem is inner scrollbox we are scrolling the outer off-canvas down/up once the box end has been reached 6332 // This lets the user continue to touch move the off-canvas without the need to place the finger outside the scrollbox 6333 6334 if (elem.hasAttribute('data-off-canvas-scrollbox')) { 6335 parent = elem.closest('[data-off-canvas], [data-off-canvas-scrollbox-outer]'); 6336 6337 if (elem.scrollTop <= 1 && parent.scrollTop > 0) { 6338 parent.scrollTop--; 6339 } else if (elem.scrollTop >= elem.scrollHeight - elem.clientHeight - 1 && parent.scrollTop < parent.scrollHeight - parent.clientHeight) { 6340 parent.scrollTop++; 6341 } 6342 } 6343 } else { 6344 event.preventDefault(); 6345 } 6346 } 6347 /** 6348 * Opens the off-canvas menu. 6349 * @function 6350 * @param {Object} event - Event object passed from listener. 6351 * @param {jQuery} trigger - element that triggered the off-canvas to open. 6352 * @fires OffCanvas#opened 6353 * @todo also trigger 'open' event? 6354 */ 6355 6356 }, { 6357 key: "open", 6358 value: function open(event, trigger) { 6359 var _this4 = this; 6360 6361 if (this.$element.hasClass('is-open') || this.isRevealed || this.isInCanvas) { 6362 return; 6363 } 6364 6365 var _this = this; 6366 6367 if (trigger) { 6368 this.$lastTrigger = trigger; 6369 } 6370 6371 if (this.options.forceTo === 'top') { 6372 window.scrollTo(0, 0); 6373 } else if (this.options.forceTo === 'bottom') { 6374 window.scrollTo(0, document.body.scrollHeight); 6375 } 6376 6377 if (this.options.transitionTime && this.options.transition !== 'overlap') { 6378 this.$element.siblings('[data-off-canvas-content]').css('transition-duration', this.options.transitionTime); 6379 } else { 6380 this.$element.siblings('[data-off-canvas-content]').css('transition-duration', ''); 6381 } 6382 6383 this.$element.addClass('is-open').removeClass('is-closed'); 6384 this.$triggers.attr('aria-expanded', 'true'); 6385 this.$element.attr('aria-hidden', 'false'); 6386 this.$content.addClass('is-open-' + this.position); // If `contentScroll` is set to false, add class and disable scrolling on touch devices. 6387 6388 if (this.options.contentScroll === false) { 6389 jquery__WEBPACK_IMPORTED_MODULE_0___default()('body').addClass('is-off-canvas-open').on('touchmove', this._stopScrolling); 6390 this.$element.on('touchstart', this._recordScrollable); 6391 this.$element.on('touchmove', this._stopScrollPropagation); 6392 this.$element.on('touchstart', '[data-off-canvas-scrollbox]', this._recordScrollable); 6393 this.$element.on('touchmove', '[data-off-canvas-scrollbox]', this._stopScrollPropagation); 6394 } 6395 6396 if (this.options.contentOverlay === true) { 6397 this.$overlay.addClass('is-visible'); 6398 } 6399 6400 if (this.options.closeOnClick === true && this.options.contentOverlay === true) { 6401 this.$overlay.addClass('is-closable'); 6402 } 6403 6404 if (this.options.autoFocus === true) { 6405 this.$element.one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["transitionend"])(this.$element), function () { 6406 if (!_this.$element.hasClass('is-open')) { 6407 return; // exit if prematurely closed 6408 } 6409 6410 var canvasFocus = _this.$element.find('[data-autofocus]'); 6411 6412 if (canvasFocus.length) { 6413 canvasFocus.eq(0).focus(); 6414 } else { 6415 _this.$element.find('a, button').eq(0).focus(); 6416 } 6417 }); 6418 } 6419 6420 if (this.options.trapFocus === true) { 6421 this.$content.attr('tabindex', '-1'); 6422 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].trapFocus(this.$element); 6423 } 6424 6425 if (this.options.transition === 'push') { 6426 this._fixStickyElements(); 6427 } 6428 6429 this._addContentClasses(); 6430 /** 6431 * Fires when the off-canvas menu opens. 6432 * @event OffCanvas#opened 6433 */ 6434 6435 6436 this.$element.trigger('opened.zf.offCanvas'); 6437 /** 6438 * Fires when the off-canvas menu open transition is done. 6439 * @event OffCanvas#openedEnd 6440 */ 6441 6442 this.$element.one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["transitionend"])(this.$element), function () { 6443 _this4.$element.trigger('openedEnd.zf.offCanvas'); 6444 }); 6445 } 6446 /** 6447 * Closes the off-canvas menu. 6448 * @function 6449 * @param {Function} cb - optional cb to fire after closure. 6450 * @fires OffCanvas#close 6451 * @fires OffCanvas#closed 6452 */ 6453 6454 }, { 6455 key: "close", 6456 value: function close(cb) { 6457 var _this5 = this; 6458 6459 if (!this.$element.hasClass('is-open') || this.isRevealed) { 6460 return; 6461 } 6462 /** 6463 * Fires when the off-canvas menu closes. 6464 * @event OffCanvas#close 6465 */ 6466 6467 6468 this.$element.trigger('close.zf.offCanvas'); 6469 6470 var _this = this; 6471 6472 this.$element.removeClass('is-open'); 6473 this.$element.attr('aria-hidden', 'true'); 6474 this.$content.removeClass('is-open-left is-open-top is-open-right is-open-bottom'); 6475 6476 if (this.options.contentOverlay === true) { 6477 this.$overlay.removeClass('is-visible'); 6478 } 6479 6480 if (this.options.closeOnClick === true && this.options.contentOverlay === true) { 6481 this.$overlay.removeClass('is-closable'); 6482 } 6483 6484 this.$triggers.attr('aria-expanded', 'false'); // Listen to transitionEnd: add class, re-enable scrolling and release focus when done. 6485 6486 this.$element.one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["transitionend"])(this.$element), function (e) { 6487 _this5.$element.addClass('is-closed'); 6488 6489 _this5._removeContentClasses(); 6490 6491 if (_this5.options.transition === 'push') { 6492 _this5._unfixStickyElements(); 6493 } // If `contentScroll` is set to false, remove class and re-enable scrolling on touch devices. 6494 6495 6496 if (_this5.options.contentScroll === false) { 6497 jquery__WEBPACK_IMPORTED_MODULE_0___default()('body').removeClass('is-off-canvas-open').off('touchmove', _this5._stopScrolling); 6498 6499 _this5.$element.off('touchstart', _this5._recordScrollable); 6500 6501 _this5.$element.off('touchmove', _this5._stopScrollPropagation); 6502 6503 _this5.$element.off('touchstart', '[data-off-canvas-scrollbox]', _this5._recordScrollable); 6504 6505 _this5.$element.off('touchmove', '[data-off-canvas-scrollbox]', _this5._stopScrollPropagation); 6506 } 6507 6508 if (_this5.options.trapFocus === true) { 6509 _this5.$content.removeAttr('tabindex'); 6510 6511 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].releaseFocus(_this5.$element); 6512 } 6513 /** 6514 * Fires when the off-canvas menu close transition is done. 6515 * @event OffCanvas#closed 6516 */ 6517 6518 6519 _this5.$element.trigger('closed.zf.offCanvas'); 6520 }); 6521 } 6522 /** 6523 * Toggles the off-canvas menu open or closed. 6524 * @function 6525 * @param {Object} event - Event object passed from listener. 6526 * @param {jQuery} trigger - element that triggered the off-canvas to open. 6527 */ 6528 6529 }, { 6530 key: "toggle", 6531 value: function toggle(event, trigger) { 6532 if (this.$element.hasClass('is-open')) { 6533 this.close(event, trigger); 6534 } else { 6535 this.open(event, trigger); 6536 } 6537 } 6538 /** 6539 * 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. 6540 * @function 6541 * @private 6542 */ 6543 6544 }, { 6545 key: "_handleKeyboard", 6546 value: function _handleKeyboard(e) { 6547 var _this6 = this; 6548 6549 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].handleKey(e, 'OffCanvas', { 6550 close: function close() { 6551 _this6.close(); 6552 6553 _this6.$lastTrigger.focus(); 6554 6555 return true; 6556 }, 6557 handled: function handled() { 6558 e.preventDefault(); 6559 } 6560 }); 6561 } 6562 /** 6563 * Destroys the OffCanvas plugin. 6564 * @function 6565 */ 6566 6567 }, { 6568 key: "_destroy", 6569 value: function _destroy() { 6570 this.close(); 6571 this.$element.off('.zf.trigger .zf.offCanvas'); 6572 this.$overlay.off('.zf.offCanvas'); 6573 if (this.onLoadListener) jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(this.onLoadListener); 6574 } 6575 }]); 6576 6577 return OffCanvas; 6578}
6578(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]); 6579 6580OffCanvas.defaults = { 6581 /** 6582 * Allow the user to click outside of the menu to close it. 6583 * @option 6584 * @type {boolean} 6585 * @default true 6586 */ 6587 closeOnClick: true, 6588 6589 /** 6590 * Adds an overlay on top of `[data-off-canvas-content]`. 6591 * @option 6592 * @type {boolean} 6593 * @default true 6594 */ 6595 contentOverlay: true, 6596 6597 /** 6598 * Target an off-canvas content container by ID that may be placed anywhere. If null the closest content container will be taken. 6599 * @option 6600 * @type {?string} 6601 * @default null 6602 */ 6603 contentId: null, 6604 6605 /** 6606 * Define the off-canvas element is nested in an off-canvas content. This is required when using the contentId option for a nested element. 6607 * @option 6608 * @type {boolean} 6609 * @default null 6610 */ 6611 nested: null, 6612 6613 /** 6614 * Enable/disable scrolling of the main content when an off canvas panel is open. 6615 * @option 6616 * @type {boolean} 6617 * @default true 6618 */ 6619 contentScroll: true, 6620 6621 /** 6622 * 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. 6623 * @option 6624 * @type {string} 6625 * @default null 6626 */ 6627 transitionTime: null, 6628 6629 /** 6630 * Type of transition for the OffCanvas menu. Options are 'push', 'detached' or 'slide'. 6631 * @option 6632 * @type {string} 6633 * @default push 6634 */ 6635 transition: 'push', 6636 6637 /** 6638 * Force the page to scroll to top or bottom on open. 6639 * @option 6640 * @type {?string} 6641 * @default null 6642 */ 6643 forceTo: null, 6644 6645 /** 6646 * Allow the OffCanvas to remain open for certain breakpoints. 6647 * @option 6648 * @type {boolean} 6649 * @default false 6650 */ 6651 isRevealed: false, 6652 6653 /** 6654 * Breakpoint at which to reveal. JS will use a RegExp to target standard classes, if changing classnames, pass your class with the `revealClass` option. 6655 * @option 6656 * @type {?string} 6657 * @default null 6658 */ 6659 revealOn: null, 6660 6661 /** 6662 * Breakpoint at which the off-canvas gets moved into canvas content and acts as regular page element. 6663 * @option 6664 * @type {?string} 6665 * @default null 6666 */ 6667 inCanvasOn: null, 6668 6669 /** 6670 * Force focus to the offcanvas on open. If true, will focus the opening trigger on close. 6671 * @option 6672 * @type {boolean} 6673 * @default true 6674 */ 6675 autoFocus: true, 6676 6677 /** 6678 * Class used to force an OffCanvas to remain open. Foundation defaults for this are `reveal-for-large` & `reveal-for-medium`. 6679 * @option 6680 * @type {string} 6681 * @default reveal-for- 6682 * @todo improve the regex testing for this. 6683 */ 6684 revealClass: 'reveal-for-', 6685 6686 /** 6687 * Triggers optional focus trapping when opening an OffCanvas. Sets tabindex of [data-off-canvas-content] to -1 for accessibility purposes. 6688 * @option 6689 * @type {boolean} 6690 * @default false 6691 */ 6692 trapFocus: false 6693}; 6694 6695 6696/***/ }), 6697
vendor: 5,230 bytes, lines 6698-6781
6698/***/ "./js/foundation.orbit.js": 6699/*!********************************!*\ 6700 !*** ./js/foundation.orbit.js ***! 6701 \********************************/ 6702/*! exports provided: Orbit */ 6703/***/ (function(module, __webpack_exports__, __webpack_require__) { 6704 6705"use strict"; 6706__webpack_require__.r(__webpack_exports__); 6707/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Orbit", function() { return Orbit; }); 6708/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 6709/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 6710/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js"); 6711/* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.motion */ "./js/foundation.util.motion.js"); 6712/* harmony import */ var _foundation_util_timer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.timer */ "./js/foundation.util.timer.js"); 6713/* harmony import */ var _foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.imageLoader */ "./js/foundation.util.imageLoader.js"); 6714/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 6715/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 6716/* harmony import */ var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./foundation.util.touch */ "./js/foundation.util.touch.js"); 6717 6718 6719function _typeof(obj) { 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); } 6720 6721function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 6722 6723function _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); } } 6724 6725function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 6726 6727function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 6728 6729function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 6730 6731function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 6732 6733function _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); } 6734 6735function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745/** 6746 * Orbit module. 6747 * @module foundation.orbit 6748 * @requires foundation.util.keyboard 6749 * @requires foundation.util.motion 6750 * @requires foundation.util.timer 6751 * @requires foundation.util.imageLoader 6752 * @requires foundation.util.touch 6753 */ 6754 6755var Orbit = 6756/*#__PURE__*/ 6757function (_Plugin) { 6758 _inherits(Orbit, _Plugin); 6759 6760 function Orbit() { 6761 _classCallCheck(this, Orbit); 6762 6763 return _possibleConstructorReturn(this, _getPrototypeOf(Orbit).apply(this, arguments)); 6764 } 6765 6766 _createClass(Orbit, [{ 6767 key: "_setup", 6768 6769 /** 6770 * Creates a new instance of an orbit carousel. 6771 * @class 6772 * @name Orbit 6773 * @param {jQuery} element - jQuery object to make into an Orbit Carousel. 6774 * @param {Object} options - Overrides to the default plugin settings. 6775 */ 6776 value: function _setup(element, options) { 6777 this.$element = element; 6778 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Orbit.defaults, this.$element.data(), options); 6779 this.className = 'Orbit'; // ie9 back compat 6780 6781 _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.
vendor: 14,226 bytes, lines 6782-7190
6782 6783 this._init(); 6784 6785 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].register('Orbit', { 6786 'ltr': { 6787 'ARROW_RIGHT': 'next', 6788 'ARROW_LEFT': 'previous' 6789 }, 6790 'rtl': { 6791 'ARROW_LEFT': 'next', 6792 'ARROW_RIGHT': 'previous' 6793 } 6794 }); 6795 } 6796 /** 6797 * Initializes the plugin by creating jQuery collections, setting attributes, and starting the animation. 6798 * @function 6799 * @private 6800 */ 6801 6802 }, { 6803 key: "_init", 6804 value: function _init() { 6805 // @TODO: consider discussion on PR #9278 about DOM pollution by changeSlide 6806 this._reset(); 6807 6808 this.$wrapper = this.$element.find(".".concat(this.options.containerClass)); 6809 this.$slides = this.$element.find(".".concat(this.options.slideClass)); 6810 var $images = this.$element.find('img'), 6811 initActive = this.$slides.filter('.is-active'), 6812 id = this.$element[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_5__["GetYoDigits"])(6, 'orbit'); 6813 this.$element.attr({ 6814 'data-resize': id, 6815 'id': id 6816 }); 6817 6818 if (!initActive.length) { 6819 this.$slides.eq(0).addClass('is-active'); 6820 } 6821 6822 if (!this.options.useMUI) { 6823 this.$slides.addClass('no-motionui'); 6824 } 6825 6826 if ($images.length) { 6827 Object(_foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_4__["onImagesLoaded"])($images, this._prepareForOrbit.bind(this)); 6828 } else { 6829 this._prepareForOrbit(); //hehe 6830 6831 } 6832 6833 if (this.options.bullets) { 6834 this._loadBullets(); 6835 } 6836 6837 this._events(); 6838 6839 if (this.options.autoPlay && this.$slides.length > 1) { 6840 this.geoSync(); 6841 } 6842 6843 if (this.options.accessible) { 6844 // allow wrapper to be focusable to enable arrow navigation 6845 this.$wrapper.attr('tabindex', 0); 6846 } 6847 } 6848 /** 6849 * Creates a jQuery collection of bullets, if they are being used. 6850 * @function 6851 * @private 6852 */ 6853 6854 }, { 6855 key: "_loadBullets", 6856 value: function _loadBullets() { 6857 this.$bullets = this.$element.find(".".concat(this.options.boxOfBullets)).find('button'); 6858 } 6859 /** 6860 * Sets a `timer` object on the orbit, and starts the counter for the next slide. 6861 * @function 6862 */ 6863 6864 }, { 6865 key: "geoSync", 6866 value: function geoSync() { 6867 var _this = this; 6868 6869 this.timer = new _foundation_util_timer__WEBPACK_IMPORTED_MODULE_3__["Timer"](this.$element, { 6870 duration: this.options.timerDelay, 6871 infinite: false 6872 }, function () { 6873 _this.changeSlide(true); 6874 }); 6875 this.timer.start(); 6876 } 6877 /** 6878 * Sets wrapper and slide heights for the orbit. 6879 * @function 6880 * @private 6881 */ 6882 6883 }, { 6884 key: "_prepareForOrbit", 6885 value: function _prepareForOrbit() { 6886 var _this = this; 6887 6888 this._setWrapperHeight(); 6889 } 6890 /** 6891 * Calulates the height of each slide in the collection, and uses the tallest one for the wrapper height. 6892 * @function 6893 * @private 6894 * @param {Function} cb - a callback function to fire when complete. 6895 */ 6896 6897 }, { 6898 key: "_setWrapperHeight", 6899 value: function _setWrapperHeight(cb) { 6900 //rewrite this to `for` loop 6901 var max = 0, 6902 temp, 6903 counter = 0, 6904 _this = this; 6905 6906 this.$slides.each(function () { 6907 temp = this.getBoundingClientRect().height; 6908 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('data-slide', counter); // hide all slides but the active one 6909 6910 if (!/mui/g.test(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)[0].className) && _this.$slides.filter('.is-active')[0] !== _this.$slides.eq(counter)[0]) { 6911 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).css({ 6912 'display': 'none' 6913 }); 6914 } 6915 6916 max = temp > max ? temp : max; 6917 counter++; 6918 }); 6919 6920 if (counter === this.$slides.length) { 6921 this.$wrapper.css({ 6922 'height': max 6923 }); //only change the wrapper height property once. 6924 6925 if (cb) { 6926 cb(max); 6927 } //fire callback with max height dimension. 6928 6929 } 6930 } 6931 /** 6932 * Sets the max-height of each slide. 6933 * @function 6934 * @private 6935 */ 6936 6937 }, { 6938 key: "_setSlideHeight", 6939 value: function _setSlideHeight(height) { 6940 this.$slides.each(function () { 6941 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).css('max-height', height); 6942 }); 6943 } 6944 /** 6945 * Adds event listeners to basically everything within the element. 6946 * @function 6947 * @private 6948 */ 6949 6950 }, { 6951 key: "_events", 6952 value: function _events() { 6953 var _this = this; //*************************************** 6954 //**Now using custom event - thanks to:** 6955 //** Yohai Ararat of Toronto ** 6956 //*************************************** 6957 // 6958 6959 6960 this.$element.off('.resizeme.zf.trigger').on({ 6961 'resizeme.zf.trigger': this._prepareForOrbit.bind(this) 6962 }); 6963 6964 if (this.$slides.length > 1) { 6965 if (this.options.swipe) { 6966 this.$slides.off('swipeleft.zf.orbit swiperight.zf.orbit').on('swipeleft.zf.orbit', function (e) { 6967 e.preventDefault(); 6968 6969 _this.changeSlide(true); 6970 }).on('swiperight.zf.orbit', function (e) { 6971 e.preventDefault(); 6972 6973 _this.changeSlide(false); 6974 }); 6975 } //*************************************** 6976 6977 6978 if (this.options.autoPlay) { 6979 this.$slides.on('click.zf.orbit', function () { 6980 _this.$element.data('clickedOn', _this.$element.data('clickedOn') ? false : true); 6981 6982 _this.timer[_this.$element.data('clickedOn') ? 'pause' : 'start'](); 6983 }); 6984 6985 if (this.options.pauseOnHover) { 6986 this.$element.on('mouseenter.zf.orbit', function () { 6987 _this.timer.pause(); 6988 }).on('mouseleave.zf.orbit', function () { 6989 if (!_this.$element.data('clickedOn')) { 6990 _this.timer.start(); 6991 } 6992 }); 6993 } 6994 } 6995 6996 if (this.options.navButtons) { 6997 var $controls = this.$element.find(".".concat(this.options.nextClass, ", .").concat(this.options.prevClass)); 6998 $controls.attr('tabindex', 0) //also need to handle enter/return and spacebar key presses 6999 .on('click.zf.orbit touchend.zf.orbit', function (e) { 7000 e.preventDefault(); 7001 7002 _this.changeSlide(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).hasClass(_this.options.nextClass)); 7003 }); 7004 } 7005 7006 if (this.options.bullets) { 7007 this.$bullets.on('click.zf.orbit touchend.zf.orbit', function () { 7008 if (/is-active/g.test(this.className)) { 7009 return false; 7010 } //if this is active, kick out of function. 7011 7012 7013 var idx = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('slide'), 7014 ltr = idx > _this.$slides.filter('.is-active').data('slide'), 7015 $slide = _this.$slides.eq(idx); 7016 7017 _this.changeSlide(ltr, $slide, idx); 7018 }); 7019 } 7020 7021 if (this.options.accessible) { 7022 this.$wrapper.add(this.$bullets).on('keydown.zf.orbit', function (e) { 7023 // handle keyboard event with keyboard util 7024 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].handleKey(e, 'Orbit', { 7025 next: function next() { 7026 _this.changeSlide(true); 7027 }, 7028 previous: function previous() { 7029 _this.changeSlide(false); 7030 }, 7031 handled: function handled() { 7032 // if bullet is focused, make sure focus moves 7033 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).is(_this.$bullets)) { 7034 _this.$bullets.filter('.is-active').focus(); 7035 } 7036 } 7037 }); 7038 }); 7039 } 7040 } 7041 } 7042 /** 7043 * Resets Orbit so it can be reinitialized 7044 */ 7045 7046 }, { 7047 key: "_reset", 7048 value: function _reset() { 7049 // Don't do anything if there are no slides (first run) 7050 if (typeof this.$slides == 'undefined') { 7051 return; 7052 } 7053 7054 if (this.$slides.length > 1) { 7055 // Remove old events 7056 this.$element.off('.zf.orbit').find('*').off('.zf.orbit'); // Restart timer if autoPlay is enabled 7057 7058 if (this.options.autoPlay) { 7059 this.timer.restart(); 7060 } // Reset all sliddes 7061 7062 7063 this.$slides.each(function (el) { 7064 jquery__WEBPACK_IMPORTED_MODULE_0___default()(el).removeClass('is-active is-active is-in').removeAttr('aria-live').hide(); 7065 }); // Show the first slide 7066 7067 this.$slides.first().addClass('is-active').show(); // Triggers when the slide has finished animating 7068 7069 this.$element.trigger('slidechange.zf.orbit', [this.$slides.first()]); // Select first bullet if bullets are present 7070 7071 if (this.options.bullets) { 7072 this._updateBullets(0); 7073 } 7074 } 7075 } 7076 /** 7077 * Changes the current slide to a new one. 7078 * @function 7079 * @param {Boolean} isLTR - if true the slide moves from right to left, if false the slide moves from left to right. 7080 * @param {jQuery} chosenSlide - the jQuery element of the slide to show next, if one is selected. 7081 * @param {Number} idx - the index of the new slide in its collection, if one chosen. 7082 * @fires Orbit#slidechange 7083 */ 7084 7085 }, { 7086 key: "changeSlide", 7087 value: function changeSlide(isLTR, chosenSlide, idx) { 7088 if (!this.$slides) { 7089 return; 7090 } // Don't freak out if we're in the middle of cleanup 7091 7092 7093 var $curSlide = this.$slides.filter('.is-active').eq(0); 7094 7095 if (/mui/g.test($curSlide[0].className)) { 7096 return false; 7097 } //if the slide is currently animating, kick out of the function 7098 7099 7100 var $firstSlide = this.$slides.first(), 7101 $lastSlide = this.$slides.last(), 7102 dirIn = isLTR ? 'Right' : 'Left', 7103 dirOut = isLTR ? 'Left' : 'Right', 7104 _this = this, 7105 $newSlide; 7106 7107 if (!chosenSlide) { 7108 //most of the time, this will be auto played or clicked from the navButtons. 7109 $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!!!!! 7110 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 7111 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 7112 } else { 7113 $newSlide = chosenSlide; 7114 } 7115 7116 if ($newSlide.length) { 7117 /** 7118 * Triggers before the next slide starts animating in and only if a next slide has been found. 7119 * @event Orbit#beforeslidechange 7120 */ 7121 this.$element.trigger('beforeslidechange.zf.orbit', [$curSlide, $newSlide]); 7122 7123 if (this.options.bullets) { 7124 idx = idx || this.$slides.index($newSlide); //grab index to update bullets 7125 7126 this._updateBullets(idx); 7127 } 7128 7129 if (this.options.useMUI && !this.$element.is(':hidden')) { 7130 _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Motion"].animateIn($newSlide.addClass('is-active'), this.options["animInFrom".concat(dirIn)], function () { 7131 $newSlide.css({ 7132 'display': 'block' 7133 }).attr('aria-live', 'polite'); 7134 }); 7135 _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Motion"].animateOut($curSlide.removeClass('is-active'), this.options["animOutTo".concat(dirOut)], function () { 7136 $curSlide.removeAttr('aria-live'); 7137 7138 if (_this.options.autoPlay && !_this.timer.isPaused) { 7139 _this.timer.restart(); 7140 } //do stuff? 7141 7142 }); 7143 } else { 7144 $curSlide.removeClass('is-active is-in').removeAttr('aria-live').hide(); 7145 $newSlide.addClass('is-active is-in').attr('aria-live', 'polite').show(); 7146 7147 if (this.options.autoPlay && !this.timer.isPaused) { 7148 this.timer.restart(); 7149 } 7150 } 7151 /** 7152 * Triggers when the slide has finished animating in. 7153 * @event Orbit#slidechange 7154 */ 7155 7156 7157 this.$element.trigger('slidechange.zf.orbit', [$newSlide]); 7158 } 7159 } 7160 /** 7161 * Updates the active state of the bullets, if displayed. 7162 * Move the descriptor of the current slide `[data-slide-active-label]` to the newly active bullet. 7163 * If no `[data-slide-active-label]` is set, will move the exceeding `span` element. 7164 * 7165 * @function 7166 * @private 7167 * @param {Number} idx - the index of the current slide. 7168 */ 7169 7170 }, { 7171 key: "_updateBullets", 7172 value: function _updateBullets(idx) { 7173 var $oldBullet = this.$bullets.filter('.is-active'); 7174 var $othersBullets = this.$bullets.not('.is-active'); 7175 var $newBullet = this.$bullets.eq(idx); 7176 $oldBullet.removeClass('is-active').blur(); 7177 $newBullet.addClass('is-active'); // Find the descriptor for the current slide to move it to the new slide button 7178 7179 var activeStateDescriptor = $oldBullet.children('[data-slide-active-label]').last(); // If not explicitely given, search for the last "exceeding" span element (compared to others bullets). 7180 7181 if (!activeStateDescriptor.length) { 7182 var spans = $oldBullet.children('span'); 7183 var spanCountInOthersBullets = $othersBullets.toArray().map(function (b) { 7184 return jquery__WEBPACK_IMPORTED_MODULE_0___default()(b).children('span').length; 7185 }); // If there is an exceeding span element, use it as current slide descriptor 7186 7187 if (spanCountInOthersBullets.every(function (count) { 7188 return count < spans.length; 7189 })) { 7190 activeStateDescriptor = spans.last();
7191 activeStateDescriptor.attr('data-slide-active-label', ''); 7192 } 7193 } // Move the current slide descriptor to the new slide button 7194 7195 7196 if (activeStateDescriptor.length) { 7197 activeStateDescriptor.detach(); 7198 $newBullet.append(activeStateDescriptor); 7199 } 7200 } 7201 /** 7202 * Destroys the carousel and hides the element. 7203 * @function 7204 */ 7205 7206 }, { 7207 key: "_destroy", 7208 value: function _destroy() { 7209 this.$element.off('.zf.orbit').find('*').off('.zf.orbit').end().hide(); 7210 } 7211 }]); 7212 7213 return Orbit; 7214}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_6__["Plugin"]); 7215 7216Orbit.defaults = { 7217 /** 7218 * Tells the JS to look for and loadBullets. 7219 * @option 7220 * @type {boolean} 7221 * @default true 7222 */ 7223 bullets: true, 7224 7225 /** 7226 * Tells the JS to apply event listeners to nav buttons 7227 * @option 7228 * @type {boolean} 7229 * @default true 7230 */ 7231 navButtons: true, 7232 7233 /** 7234 * motion-ui animation class to apply 7235 * @option 7236 * @type {string} 7237 * @default 'slide-in-right' 7238 */ 7239 animInFromRight: 'slide-in-right', 7240 7241 /** 7242 * motion-ui animation class to apply 7243 * @option 7244 * @type {string} 7245 * @default 'slide-out-right' 7246 */ 7247 animOutToRight: 'slide-out-right', 7248 7249 /** 7250 * motion-ui animation class to apply 7251 * @option 7252 * @type {string} 7253 * @default 'slide-in-left' 7254 * 7255 */ 7256 animInFromLeft: 'slide-in-left', 7257 7258 /** 7259 * motion-ui animation class to apply 7260 * @option 7261 * @type {string} 7262 * @default 'slide-out-left' 7263 */ 7264 animOutToLeft: 'slide-out-left', 7265 7266 /** 7267 * Allows Orbit to automatically animate on page load. 7268 * @option 7269 * @type {boolean} 7270 * @default true 7271 */ 7272 autoPlay: true, 7273 7274 /** 7275 * Amount of time, in ms, between slide transitions 7276 * @option 7277 * @type {number} 7278 * @default 5000 7279 */ 7280 timerDelay: 5000, 7281 7282 /** 7283 * Allows Orbit to infinitely loop through the slides 7284 * @option 7285 * @type {boolean} 7286 * @default true 7287 */ 7288 infiniteWrap: true, 7289 7290 /** 7291 * Allows the Orbit slides to bind to swipe events for mobile, requires an additional util library 7292 * @option 7293 * @type {boolean} 7294 * @default true 7295 */ 7296 swipe: true, 7297 7298 /** 7299 * Allows the timing function to pause animation on hover. 7300 * @option 7301 * @type {boolean} 7302 * @default true 7303 */ 7304 pauseOnHover: true, 7305 7306 /** 7307 * Allows Orbit to bind keyboard events to the slider, to animate frames with arrow keys 7308 * @option 7309 * @type {boolean} 7310 * @default true 7311 */ 7312 accessible: true, 7313 7314 /** 7315 * Class applied to the container of Orbit 7316 * @option 7317 * @type {string} 7318 * @default 'orbit-container' 7319 */ 7320 containerClass: 'orbit-container', 7321 7322 /** 7323 * Class applied to individual slides. 7324 * @option 7325 * @type {string} 7326 * @default 'orbit-slide' 7327 */ 7328 slideClass: 'orbit-slide', 7329 7330 /** 7331 * Class applied to the bullet container. You're welcome. 7332 * @option 7333 * @type {string} 7334 * @default 'orbit-bullets' 7335 */ 7336 boxOfBullets: 'orbit-bullets', 7337 7338 /** 7339 * Class applied to the `next` navigation button. 7340 * @option 7341 * @type {string} 7342 * @default 'orbit-next' 7343 */ 7344 nextClass: 'orbit-next', 7345 7346 /** 7347 * Class applied to the `previous` navigation button. 7348 * @option 7349 * @type {string} 7350 * @default 'orbit-previous' 7351 */ 7352 prevClass: 'orbit-previous', 7353 7354 /** 7355 * Boolean to flag the js to use motion ui classes or not. Default to true for backwards compatibility. 7356 * @option 7357 * @type {boolean} 7358 * @default true 7359 */ 7360 useMUI: true 7361}; 7362 7363 7364/***/ }), 7365
7366/***/ "./js/foundation.positionable.js": 7367/*!***************************************!*\ 7368 !*** ./js/foundation.positionable.js ***! 7369 \***************************************/ 7370/*! exports provided: Positionable */ 7371/***/ (function(module, __webpack_exports__, __webpack_require__) { 7372 7373"use strict"; 7374__webpack_require__.r(__webpack_exports__); 7375/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Positionable", function() { return Positionable; }); 7376/* harmony import */ var _foundation_util_box__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./foundation.util.box */ "./js/foundation.util.box.js"); 7377/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 7378/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 7379 7380 7381function _typeof(obj) { 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); } 7382 7383function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 7384 7385function _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); } } 7386 7387function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 7388 7389function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 7390 7391function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 7392 7393function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 7394 7395function _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); } 7396 7397function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 7398 7399 7400 7401 7402var POSITIONS = ['left', 'right', 'top', 'bottom']; 7403var VERTICAL_ALIGNMENTS = ['top', 'bottom', 'center']; 7404var HORIZONTAL_ALIGNMENTS = ['left', 'right', 'center']; 7405var ALIGNMENTS = { 7406 'left': VERTICAL_ALIGNMENTS, 7407 'right': VERTICAL_ALIGNMENTS, 7408 'top': HORIZONTAL_ALIGNMENTS, 7409 'bottom': HORIZONTAL_ALIGNMENTS 7410}; 7411 7412function nextItem(item, array) { 7413 var currentIdx = array.indexOf(item); 7414 7415 if (currentIdx === array.length - 1) { 7416 return array[0]; 7417 } else { 7418 return array[currentIdx + 1]; 7419 } 7420} 7421 7422var Positionable = 7423/*#__PURE__*/ 7424function (_Plugin) { 7425 _inherits(Positionable, _Plugin); 7426 7427 function Positionable() { 7428 _classCallCheck(this, Positionable); 7429 7430 return _possibleConstructorReturn(this, _getPrototypeOf(Positionable).apply(this, arguments)); 7431 } 7432 7433 _createClass(Positionable, [{ 7434 key: "_init", 7435 7436 /** 7437 * Abstract class encapsulating the tether-like explicit positioning logic 7438 * including repositioning based on overlap. 7439 * Expects classes to define defaults for vOffset, hOffset, position, 7440 * alignment, allowOverlap, and allowBottomOverlap. They can do this by 7441 * extending the defaults, or (for now recommended due to the way docs are 7442 * generated) by explicitly declaring them. 7443 * 7444 **/ 7445 value: function _init() { 7446 this.triedPositions = {}; 7447 this.position = this.options.position === 'auto' ? this._getDefaultPosition() : this.options.position; 7448 this.alignment = this.options.alignment === 'auto' ? this._getDefaultAlignment() : this.options.alignment; 7449 this.originalPosition = this.position; 7450 this.originalAlignment = this.alignment; 7451 } 7452 }, { 7453 key: "_getDefaultPosition", 7454 value: function _getDefaultPosition() { 7455 return 'bottom'; 7456 } 7457 }, { 7458 key: "_getDefaultAlignment", 7459 value: function _getDefaultAlignment() { 7460 switch (this.position) { 7461 case 'bottom': 7462 case 'top': 7463 return Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["rtl"])() ? 'right' : 'left'; 7464 7465 case 'left': 7466 case 'right': 7467 return 'bottom'; 7468 } 7469 } 7470 /** 7471 * Adjusts the positionable possible positions by iterating through alignments 7472 * and positions. 7473 * @function 7474 * @private 7475 */ 7476 7477 }, { 7478 key: "_reposition", 7479 value: function _reposition() { 7480 if (this._alignmentsExhausted(this.position)) { 7481 this.position = nextItem(this.position, POSITIONS); 7482 this.alignment = ALIGNMENTS[this.position][0]; 7483 } else { 7484 this._realign(); 7485 } 7486 } 7487 /** 7488 * Adjusts the dropdown pane possible positions by iterating through alignments 7489 * on the current position. 7490 * @function 7491 * @private 7492 */ 7493 7494 }, { 7495 key: "_realign", 7496 value: function _realign() { 7497 this._addTriedPosition(this.position, this.alignment); 7498 7499 this.alignment = nextItem(this.alignment, ALIGNMENTS[this.position]); 7500 } 7501 }, { 7502 key: "_addTriedPosition", 7503 value: function _addTriedPosition(position, alignment) { 7504 this.triedPositions[position] = this.triedPositions[position] || []; 7505 this.triedPositions[position].push(alignment); 7506 } 7507 }, { 7508 key: "_positionsExhausted", 7509 value: function _positionsExhausted() { 7510 var isExhausted = true; 7511 7512 for (var i = 0; i < POSITIONS.length; i++) { 7513 isExhausted = isExhausted && this._alignmentsExhausted(POSITIONS[i]); 7514 } 7515 7516 return isExhausted; 7517 } 7518 }, { 7519 key: "_alignmentsExhausted", 7520 value: function _alignmentsExhausted(position) { 7521 return this.triedPositions[position] && this.triedPositions[position].length == ALIGNMENTS[position].length; 7522 } // When we're trying to center, we don't want to apply offset that's going to 7523 // take us just off center, so wrap around to return 0 for the appropriate 7524 // offset in those alignments. TODO: Figure out if we want to make this 7525 // configurable behavior... it feels more intuitive, especially for tooltips, but 7526 // it's possible someone might actually want to start from center and then nudge 7527 // slightly off. 7528 7529 }, { 7530 key: "_getVOffset", 7531 value: function _getVOffset() { 7532 return this.options.vOffset; 7533 } 7534 }, { 7535 key: "_getHOffset", 7536 value: function _getHOffset() { 7537 return this.options.hOffset; 7538 } 7539 }, { 7540 key: "_setPosition", 7541 value: function _setPosition($anchor, $element, $parent) { 7542 if ($anchor.attr('aria-expanded') === 'false') { 7543 return false;
7544 } 7545 7546 if (!this.options.allowOverlap) { 7547 // restore original position & alignment before checking overlap 7548 this.position = this.originalPosition; 7549 this.alignment = this.originalAlignment; 7550 } 7551 7552 $element.offset(_foundation_util_box__WEBPACK_IMPORTED_MODULE_0__["Box"].GetExplicitOffsets($element, $anchor, this.position, this.alignment, this._getVOffset(), this._getHOffset())); 7553 7554 if (!this.options.allowOverlap) { 7555 var minOverlap = 100000000; // default coordinates to how we start, in case we can't figure out better 7556 7557 var minCoordinates = { 7558 position: this.position, 7559 alignment: this.alignment 7560 }; 7561 7562 while (!this._positionsExhausted()) { 7563 var overlap = _foundation_util_box__WEBPACK_IMPORTED_MODULE_0__["Box"].OverlapArea($element, $parent, false, false, this.options.allowBottomOverlap); 7564 7565 if (overlap === 0) { 7566 return; 7567 } 7568 7569 if (overlap < minOverlap) { 7570 minOverlap = overlap; 7571 minCoordinates = { 7572 position: this.position, 7573 alignment: this.alignment 7574 }; 7575 } 7576 7577 this._reposition(); 7578 7579 $element.offset(_foundation_util_box__WEBPACK_IMPORTED_MODULE_0__["Box"].GetExplicitOffsets($element, $anchor, this.position, this.alignment, this._getVOffset(), this._getHOffset())); 7580 } // If we get through the entire loop, there was no non-overlapping 7581 // position available. Pick the version with least overlap. 7582 7583 7584 this.position = minCoordinates.position; 7585 this.alignment = minCoordinates.alignment; 7586 $element.offset(_foundation_util_box__WEBPACK_IMPORTED_MODULE_0__["Box"].GetExplicitOffsets($element, $anchor, this.position, this.alignment, this._getVOffset(), this._getHOffset())); 7587 } 7588 } 7589 }]); 7590 7591 return Positionable; 7592}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]); 7593 7594Positionable.defaults = { 7595 /** 7596 * Position of positionable relative to anchor. Can be left, right, bottom, top, or auto. 7597 * @option 7598 * @type {string} 7599 * @default 'auto' 7600 */ 7601 position: 'auto', 7602 7603 /** 7604 * Alignment of positionable relative to anchor. Can be left, right, bottom, top, center, or auto. 7605 * @option 7606 * @type {string} 7607 * @default 'auto' 7608 */ 7609 alignment: 'auto', 7610 7611 /** 7612 * Allow overlap of container/window. If false, dropdown positionable first 7613 * try to position as defined by data-position and data-alignment, but 7614 * reposition if it would cause an overflow. 7615 * @option 7616 * @type {boolean} 7617 * @default false 7618 */ 7619 allowOverlap: false, 7620 7621 /** 7622 * Allow overlap of only the bottom of the container. This is the most common 7623 * behavior for dropdowns, allowing the dropdown to extend the bottom of the 7624 * screen but not otherwise influence or break out of the container. 7625 * @option 7626 * @type {boolean} 7627 * @default true 7628 */ 7629 allowBottomOverlap: true, 7630 7631 /** 7632 * Number of pixels the positionable should be separated vertically from anchor 7633 * @option 7634 * @type {number} 7635 * @default 0 7636 */ 7637 vOffset: 0, 7638 7639 /** 7640 * Number of pixels the positionable should be separated horizontally from anchor 7641 * @option 7642 * @type {number} 7643 * @default 0 7644 */ 7645 hOffset: 0 7646}; 7647 7648 7649/***/ }), 7650
7651/***/ "./js/foundation.responsiveAccordionTabs.js": 7652/*!**************************************************!*\ 7653 !*** ./js/foundation.responsiveAccordionTabs.js ***! 7654 \**************************************************/ 7655/*! exports provided: ResponsiveAccordionTabs */ 7656/***/ (function(module, __webpack_exports__, __webpack_require__) { 7657 7658"use strict"; 7659__webpack_require__.r(__webpack_exports__); 7660/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResponsiveAccordionTabs", function() { return ResponsiveAccordionTabs; }); 7661/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 7662/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 7663/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js"); 7664/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 7665/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 7666/* harmony import */ var _foundation_accordion__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.accordion */ "./js/foundation.accordion.js"); 7667/* harmony import */ var _foundation_tabs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.tabs */ "./js/foundation.tabs.js"); 7668 7669 7670function _typeof(obj) { 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); } 7671 7672function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 7673 7674function _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); } } 7675 7676function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 7677 7678function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 7679 7680function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 7681 7682function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 7683 7684function _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); } 7685 7686function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 7687 7688 7689 7690 7691 7692 7693 // The plugin matches the plugin classes with these plugin instances. 7694 7695var MenuPlugins = { 7696 tabs: { 7697 cssClass: 'tabs', 7698 plugin: _foundation_tabs__WEBPACK_IMPORTED_MODULE_5__["Tabs"], 7699 open: function open(plugin, target) { 7700 return plugin.selectTab(target); 7701 }, 7702 close: null 7703 /* not supported */ 7704 , 7705 toggle: null 7706 /* not supported */ 7707 7708 }, 7709 accordion: { 7710 cssClass: 'accordion', 7711 plugin: _foundation_accordion__WEBPACK_IMPORTED_MODULE_4__["Accordion"], 7712 open: function open(plugin, target) { 7713 return plugin.down(jquery__WEBPACK_IMPORTED_MODULE_0___default()(target)); 7714 }, 7715 close: function close(plugin, target) { 7716 return plugin.up(jquery__WEBPACK_IMPORTED_MODULE_0___default()(target)); 7717 }, 7718 toggle: function toggle(plugin, target) { 7719 return plugin.toggle(jquery__WEBPACK_IMPORTED_MODULE_0___default()(target)); 7720 } 7721 } 7722}; 7723/** 7724 * ResponsiveAccordionTabs module. 7725 * @module foundation.responsiveAccordionTabs 7726 * @requires foundation.util.motion 7727 * @requires foundation.accordion 7728 * @requires foundation.tabs 7729 */ 7730 7731var ResponsiveAccordionTabs = 7732/*#__PURE__*/ 7733function (_Plugin) { 7734 _inherits(ResponsiveAccordionTabs, _Plugin); 7735 7736 function ResponsiveAccordionTabs(element, options) { 7737 var _this2; 7738 7739 _classCallCheck(this, ResponsiveAccordionTabs); 7740 7741 _this2 = _possibleConstructorReturn(this, _getPrototypeOf(ResponsiveAccordionTabs).call(this, element, options)); 7742 return _possibleConstructorReturn(_this2, _this2.options.reflow && _this2.storezfData || _assertThisInitialized(_this2)); 7743 } 7744 /** 7745 * Creates a new instance of a responsive accordion tabs. 7746 * @class 7747 * @name ResponsiveAccordionTabs 7748 * @fires ResponsiveAccordionTabs#init 7749 * @param {jQuery} element - jQuery object to make into Responsive Accordion Tabs. 7750 * @param {Object} options - Overrides to the default plugin settings. 7751 */ 7752 7753 7754 _createClass(ResponsiveAccordionTabs, [{ 7755 key: "_setup", 7756 value: function _setup(element, options) { 7757 this.$element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(element); 7758 this.$element.data('zfPluginBase', this); 7759 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, ResponsiveAccordionTabs.defaults, this.$element.data(), options); 7760 this.rules = this.$element.data('responsive-accordion-tabs'); 7761 this.currentMq = null; 7762 this.currentRule = null; 7763 this.currentPlugin = null; 7764 this.className = 'ResponsiveAccordionTabs'; // ie9 back compat 7765 7766 if (!this.$element.attr('id')) { 7767 this.$element.attr('id', Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'responsiveaccordiontabs')); 7768 } 7769 7770 this._init(); 7771 7772 this._events(); 7773 } 7774 /** 7775 * Initializes the Menu by parsing the classes from the 'data-responsive-accordion-tabs' attribute on the element. 7776 * @function 7777 * @private 7778 */ 7779 7780 }, { 7781 key: "_init", 7782 value: function _init() { 7783 _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 7784 7785 7786 if (typeof this.rules === 'string') { 7787 var rulesTree = {}; // Parse rules from "classes" pulled from data attribute 7788 7789 var rules = this.rules.split(' '); // Iterate through every rule found 7790 7791 for (var i = 0; i < rules.length; i++) { 7792 var rule = rules[i].split('-'); 7793 var ruleSize = rule.length > 1 ? rule[0] : 'small'; 7794 var rulePlugin = rule.length > 1 ? rule[1] : rule[0]; 7795 7796 if (MenuPlugins[rulePlugin] !== null) { 7797 rulesTree[ruleSize] = MenuPlugins[rulePlugin]; 7798 } 7799 } 7800 7801 this.rules = rulesTree; 7802 } 7803 7804 this._getAllOptions(); 7805 7806 if (!jquery__WEBPACK_IMPORTED_MODULE_0___default.a.isEmptyObject(this.rules)) { 7807 this._checkMediaQueries(); 7808 } 7809 } 7810 }, { 7811 key: "_getAllOptions", 7812 value: function _getAllOptions() { 7813 //get all defaults and options 7814 var _this = this; 7815 7816 _this.allOptions = {}; 7817 7818 for (var key in MenuPlugins) { 7819 if (MenuPlugins.hasOwnProperty(key)) { 7820 var obj = MenuPlugins[key]; 7821 7822 try { 7823 var dummyPlugin = jquery__WEBPACK_IMPORTED_MODULE_0___default()('<ul></ul>'); 7824 var tmpPlugin = new obj.plugin(dummyPlugin, _this.options); 7825 7826 for (var keyKey in tmpPlugin.options) { 7827 if (tmpPlugin.options.hasOwnProperty(keyKey) && keyKey !== 'zfPlugin') { 7828 var objObj = tmpPlugin.options[keyKey]; 7829 _this.allOptions[keyKey] = objObj; 7830 } 7831 } 7832 7833 tmpPlugin.destroy(); 7834 } catch (e) {} 7835 } 7836 } 7837 } 7838 /** 7839 * Initializes events for the Menu. 7840 * @function 7841 * @private 7842 */ 7843 7844 }, { 7845 key: "_events", 7846 value: function _events() { 7847 this._changedZfMediaQueryHandler = this._checkMediaQueries.bind(this); 7848 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', this._changedZfMediaQueryHandler); 7849 } 7850 /** 7851 * 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. 7852 * @function 7853 * @private 7854 */ 7855 7856 }, { 7857 key: "_checkMediaQueries", 7858 value: function _checkMediaQueries() { 7859 var matchedMq, 7860 _this = this; // Iterate through each rule and find the last matching rule 7861 7862 7863 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.each(this.rules, function (key) { 7864 if (_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].atLeast(key)) { 7865 matchedMq = key; 7866 } 7867 }); // No match? No dice 7868 7869 if (!matchedMq) return; // Plugin already initialized? We good 7870 7871 if (this.currentPlugin instanceof this.rules[matchedMq].plugin) return; // Remove existing plugin-specific CSS classes 7872 7873 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.each(MenuPlugins, function (key, value) { 7874 _this.$element.removeClass(value.cssClass); 7875 }); // Add the CSS class for the new plugin 7876 7877 this.$element.addClass(this.rules[matchedMq].cssClass); // Create an instance of the new plugin 7878 7879 if (this.currentPlugin) {
vendor: 6,717 bytes, lines 7880-8035
7880 //don't know why but on nested elements data zfPlugin get's lost 7881 if (!this.currentPlugin.$element.data('zfPlugin') && this.storezfData) this.currentPlugin.$element.data('zfPlugin', this.storezfData); 7882 this.currentPlugin.destroy(); 7883 } 7884 7885 this._handleMarkup(this.rules[matchedMq].cssClass); 7886 7887 this.currentRule = this.rules[matchedMq]; 7888 this.currentPlugin = new this.currentRule.plugin(this.$element, this.options); 7889 this.storezfData = this.currentPlugin.$element.data('zfPlugin'); 7890 } 7891 }, { 7892 key: "_handleMarkup", 7893 value: function _handleMarkup(toSet) { 7894 var _this = this, 7895 fromString = 'accordion'; 7896 7897 var $panels = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-tabs-content=' + this.$element.attr('id') + ']'); 7898 if ($panels.length) fromString = 'tabs'; 7899 7900 if (fromString === toSet) { 7901 return; 7902 } 7903 7904 var tabsTitle = _this.allOptions.linkClass ? _this.allOptions.linkClass : 'tabs-title'; 7905 var tabsPanel = _this.allOptions.panelClass ? _this.allOptions.panelClass : 'tabs-panel'; 7906 this.$element.removeAttr('role'); 7907 var $liHeads = this.$element.children('.' + tabsTitle + ',[data-accordion-item]').removeClass(tabsTitle).removeClass('accordion-item').removeAttr('data-accordion-item'); 7908 var $liHeadsA = $liHeads.children('a').removeClass('accordion-title'); 7909 7910 if (fromString === 'tabs') { 7911 $panels = $panels.children('.' + tabsPanel).removeClass(tabsPanel).removeAttr('role').removeAttr('aria-hidden').removeAttr('aria-labelledby'); 7912 $panels.children('a').removeAttr('role').removeAttr('aria-controls').removeAttr('aria-selected'); 7913 } else { 7914 $panels = $liHeads.children('[data-tab-content]').removeClass('accordion-content'); 7915 } 7916 7917 $panels.css({ 7918 display: '', 7919 visibility: '' 7920 }); 7921 $liHeads.css({ 7922 display: '', 7923 visibility: '' 7924 }); 7925 7926 if (toSet === 'accordion') { 7927 $panels.each(function (key, value) { 7928 jquery__WEBPACK_IMPORTED_MODULE_0___default()(value).appendTo($liHeads.get(key)).addClass('accordion-content').attr('data-tab-content', '').removeClass('is-active').css({ 7929 height: '' 7930 }); 7931 jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-tabs-content=' + _this.$element.attr('id') + ']').after('<div id="tabs-placeholder-' + _this.$element.attr('id') + '"></div>').detach(); 7932 $liHeads.addClass('accordion-item').attr('data-accordion-item', ''); 7933 $liHeadsA.addClass('accordion-title'); 7934 }); 7935 } else if (toSet === 'tabs') { 7936 var $tabsContent = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-tabs-content=' + _this.$element.attr('id') + ']'); 7937 var $placeholder = jquery__WEBPACK_IMPORTED_MODULE_0___default()('#tabs-placeholder-' + _this.$element.attr('id')); 7938 7939 if ($placeholder.length) { 7940 $tabsContent = jquery__WEBPACK_IMPORTED_MODULE_0___default()('<div class="tabs-content"></div>').insertAfter($placeholder).attr('data-tabs-content', _this.$element.attr('id')); 7941 $placeholder.remove(); 7942 } else { 7943 $tabsContent = jquery__WEBPACK_IMPORTED_MODULE_0___default()('<div class="tabs-content"></div>').insertAfter(_this.$element).attr('data-tabs-content', _this.$element.attr('id')); 7944 } 7945 7946 $panels.each(function (key, value) { 7947 var tempValue = jquery__WEBPACK_IMPORTED_MODULE_0___default()(value).appendTo($tabsContent).addClass(tabsPanel); 7948 var hash = $liHeadsA.get(key).hash.slice(1); 7949 var id = jquery__WEBPACK_IMPORTED_MODULE_0___default()(value).attr('id') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'accordion'); 7950 7951 if (hash !== id) { 7952 if (hash !== '') { 7953 jquery__WEBPACK_IMPORTED_MODULE_0___default()(value).attr('id', hash); 7954 } else { 7955 hash = id; 7956 jquery__WEBPACK_IMPORTED_MODULE_0___default()(value).attr('id', hash); 7957 jquery__WEBPACK_IMPORTED_MODULE_0___default()($liHeadsA.get(key)).attr('href', jquery__WEBPACK_IMPORTED_MODULE_0___default()($liHeadsA.get(key)).attr('href').replace('#', '') + '#' + hash); 7958 } 7959 } 7960 7961 var isActive = jquery__WEBPACK_IMPORTED_MODULE_0___default()($liHeads.get(key)).hasClass('is-active'); 7962 7963 if (isActive) { 7964 tempValue.addClass('is-active'); 7965 } 7966 }); 7967 $liHeads.addClass(tabsTitle); 7968 } 7969 7970 ; 7971 } 7972 /** 7973 * Opens the plugin pane defined by `target`. 7974 * @param {jQuery | String} target - jQuery object or string of the id of the pane to open. 7975 * @see Accordion.down 7976 * @see Tabs.selectTab 7977 * @function 7978 */ 7979 7980 }, { 7981 key: "open", 7982 value: function open(_target) { 7983 if (this.currentRule && typeof this.currentRule.open === 'function') { 7984 var _this$currentRule; 7985 7986 return (_this$currentRule = this.currentRule).open.apply(_this$currentRule, [this.currentPlugin].concat(Array.prototype.slice.call(arguments))); 7987 } 7988 } 7989 /** 7990 * Closes the plugin pane defined by `target`. Not availaible for Tabs. 7991 * @param {jQuery | String} target - jQuery object or string of the id of the pane to close. 7992 * @see Accordion.up 7993 * @function 7994 */ 7995 7996 }, { 7997 key: "close", 7998 value: function close(_target) { 7999 if (this.currentRule && typeof this.currentRule.close === 'function') { 8000 var _this$currentRule2; 8001 8002 return (_this$currentRule2 = this.currentRule).close.apply(_this$currentRule2, [this.currentPlugin].concat(Array.prototype.slice.call(arguments))); 8003 } 8004 } 8005 /** 8006 * Toggles the plugin pane defined by `target`. Not availaible for Tabs. 8007 * @param {jQuery | String} target - jQuery object or string of the id of the pane to toggle. 8008 * @see Accordion.toggle 8009 * @function 8010 */ 8011 8012 }, { 8013 key: "toggle", 8014 value: function toggle(_target) { 8015 if (this.currentRule && typeof this.currentRule.toggle === 'function') { 8016 var _this$currentRule3; 8017 8018 return (_this$currentRule3 = this.currentRule).toggle.apply(_this$currentRule3, [this.currentPlugin].concat(Array.prototype.slice.call(arguments))); 8019 } 8020 } 8021 /** 8022 * Destroys the instance of the current plugin on this element, as well as the window resize handler that switches the plugins out. 8023 * @function 8024 */ 8025 8026 }, { 8027 key: "_destroy", 8028 value: function _destroy() { 8029 if (this.currentPlugin) this.currentPlugin.destroy(); 8030 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('changed.zf.mediaquery', this._changedZfMediaQueryHandler); 8031 } 8032 }]); 8033 8034 return ResponsiveAccordionTabs; 8035}
8035(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__["Plugin"]); 8036 8037ResponsiveAccordionTabs.defaults = {}; 8038 8039 8040/***/ }), 8041
8042/***/ "./js/foundation.responsiveMenu.js": 8043/*!*****************************************!*\ 8044 !*** ./js/foundation.responsiveMenu.js ***! 8045 \*****************************************/ 8046/*! exports provided: ResponsiveMenu */ 8047/***/ (function(module, __webpack_exports__, __webpack_require__) { 8048 8049"use strict"; 8050__webpack_require__.r(__webpack_exports__); 8051/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResponsiveMenu", function() { return ResponsiveMenu; }); 8052/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 8053/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 8054/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js"); 8055/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 8056/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 8057/* harmony import */ var _foundation_dropdownMenu__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.dropdownMenu */ "./js/foundation.dropdownMenu.js"); 8058/* harmony import */ var _foundation_drilldown__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.drilldown */ "./js/foundation.drilldown.js"); 8059/* harmony import */ var _foundation_accordionMenu__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./foundation.accordionMenu */ "./js/foundation.accordionMenu.js"); 8060 8061 8062function _typeof(obj) { 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); } 8063 8064function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 8065 8066function _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); } } 8067 8068function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 8069 8070function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 8071 8072function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 8073 8074function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 8075 8076function _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); } 8077 8078function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 8079 8080 8081 8082 8083 8084 8085 8086 8087var MenuPlugins = { 8088 dropdown: { 8089 cssClass: 'dropdown', 8090 plugin: _foundation_dropdownMenu__WEBPACK_IMPORTED_MODULE_4__["DropdownMenu"] 8091 }, 8092 drilldown: { 8093 cssClass: 'drilldown', 8094 plugin: _foundation_drilldown__WEBPACK_IMPORTED_MODULE_5__["Drilldown"] 8095 }, 8096 accordion: { 8097 cssClass: 'accordion-menu', 8098 plugin: _foundation_accordionMenu__WEBPACK_IMPORTED_MODULE_6__["AccordionMenu"] 8099 } 8100}; // import "foundation.util.triggers.js"; 8101 8102/** 8103 * ResponsiveMenu module. 8104 * @module foundation.responsiveMenu 8105 * @requires foundation.util.triggers 8106 * @requires foundation.util.mediaQuery 8107 */ 8108 8109var ResponsiveMenu = 8110/*#__PURE__*/ 8111function (_Plugin) { 8112 _inherits(ResponsiveMenu, _Plugin); 8113 8114 function ResponsiveMenu() { 8115 _classCallCheck(this, ResponsiveMenu); 8116 8117 return _possibleConstructorReturn(this, _getPrototypeOf(ResponsiveMenu).apply(this, arguments)); 8118 } 8119 8120 _createClass(ResponsiveMenu, [{ 8121 key: "_setup", 8122 8123 /** 8124 * Creates a new instance of a responsive menu. 8125 * @class 8126 * @name ResponsiveMenu 8127 * @fires ResponsiveMenu#init 8128 * @param {jQuery} element - jQuery object to make into a dropdown menu. 8129 * @param {Object} options - Overrides to the default plugin settings. 8130 */ 8131 value: function _setup(element, options) { 8132 this.$element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(element); 8133 this.rules = this.$element.data('responsive-menu'); 8134 this.currentMq = null; 8135 this.currentPlugin = null; 8136 this.className = 'ResponsiveMenu'; // ie9 back compat 8137 8138 this._init(); 8139 8140 this._events(); 8141 } 8142 /** 8143 * Initializes the Menu by parsing the classes from the 'data-ResponsiveMenu' attribute on the element. 8144 * @function 8145 * @private 8146 */ 8147 8148 }, { 8149 key: "_init", 8150 value: function _init() { 8151 _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 8152 8153 8154 if (typeof this.rules === 'string') { 8155 var rulesTree = {}; // Parse rules from "classes" pulled from data attribute 8156 8157 var rules = this.rules.split(' '); // Iterate through every rule found 8158 8159 for (var i = 0; i < rules.length; i++) { 8160 var rule = rules[i].split('-'); 8161 var ruleSize = rule.length > 1 ? rule[0] : 'small'; 8162 var rulePlugin = rule.length > 1 ? rule[1] : rule[0]; 8163 8164 if (MenuPlugins[rulePlugin] !== null) { 8165 rulesTree[ruleSize] = MenuPlugins[rulePlugin]; 8166 } 8167 } 8168 8169 this.rules = rulesTree; 8170 } 8171 8172 if (!jquery__WEBPACK_IMPORTED_MODULE_0___default.a.isEmptyObject(this.rules)) { 8173 this._checkMediaQueries(); 8174 } // Add data-mutate since children may need it. 8175 8176 8177 this.$element.attr('data-mutate', this.$element.attr('data-mutate') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'responsive-menu')); 8178 } 8179 /** 8180 * Initializes events for the Menu. 8181 * @function 8182 * @private 8183 */ 8184 8185 }, { 8186 key: "_events", 8187 value: function _events() { 8188 var _this = this; 8189 8190 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', function () { 8191 _this._checkMediaQueries(); 8192 }); // $(window).on('resize.zf.ResponsiveMenu', function() { 8193 // _this._checkMediaQueries(); 8194 // }); 8195 } 8196 /** 8197 * 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. 8198 * @function 8199 * @private 8200 */ 8201 8202 }, { 8203 key: "_checkMediaQueries", 8204 value: function _checkMediaQueries() { 8205 var matchedMq, 8206 _this = this; // Iterate through each rule and find the last matching rule 8207 8208 8209 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.each(this.rules, function (key) { 8210 if (_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].atLeast(key)) { 8211 matchedMq = key; 8212 } 8213 }); // No match? No dice 8214 8215 if (!matchedMq) return; // Plugin already initialized? We good 8216 8217 if (this.currentPlugin instanceof this.rules[matchedMq].plugin) return; // Remove existing plugin-specific CSS classes 8218 8219 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.each(MenuPlugins, function (key, value) { 8220 _this.$element.removeClass(value.cssClass); 8221 }); // Add the CSS class for the new plugin 8222 8223 this.$element.addClass(this.rules[matchedMq].cssClass); // Create an instance of the new plugin 8224 8225 if (this.currentPlugin) this.currentPlugin.destroy(); 8226 this.currentPlugin = new this.rules[matchedMq].plugin(this.$element, {}); 8227 } 8228 /** 8229 * Destroys the instance of the current plugin on this element, as well as the window resize handler that switches the plugins out. 8230 * @function 8231 */ 8232 8233 }, { 8234 key: "_destroy", 8235 value: function _destroy() { 8236 this.currentPlugin.destroy(); 8237 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('.zf.ResponsiveMenu'); 8238 } 8239 }]); 8240 8241 return ResponsiveMenu; 8242}
8242(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__["Plugin"]); 8243 8244ResponsiveMenu.defaults = {}; 8245 8246 8247/***/ }), 8248
8249/***/ "./js/foundation.responsiveToggle.js": 8250/*!*******************************************!*\ 8251 !*** ./js/foundation.responsiveToggle.js ***! 8252 \*******************************************/ 8253/*! exports provided: ResponsiveToggle */ 8254/***/ (function(module, __webpack_exports__, __webpack_require__) { 8255 8256"use strict"; 8257__webpack_require__.r(__webpack_exports__); 8258/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResponsiveToggle", function() { return ResponsiveToggle; }); 8259/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 8260/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 8261/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js"); 8262/* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.motion */ "./js/foundation.util.motion.js"); 8263/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 8264 8265 8266function _typeof(obj) { 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); } 8267 8268function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 8269 8270function _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); } } 8271 8272function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 8273 8274function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 8275 8276function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 8277 8278function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 8279 8280function _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); } 8281 8282function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 8283 8284 8285 8286 8287 8288/** 8289 * ResponsiveToggle module. 8290 * @module foundation.responsiveToggle 8291 * @requires foundation.util.mediaQuery 8292 * @requires foundation.util.motion 8293 */ 8294 8295var ResponsiveToggle = 8296/*#__PURE__*/ 8297function (_Plugin) { 8298 _inherits(ResponsiveToggle, _Plugin); 8299 8300 function ResponsiveToggle() { 8301 _classCallCheck(this, ResponsiveToggle); 8302 8303 return _possibleConstructorReturn(this, _getPrototypeOf(ResponsiveToggle).apply(this, arguments)); 8304 } 8305 8306 _createClass(ResponsiveToggle, [{ 8307 key: "_setup", 8308 8309 /** 8310 * Creates a new instance of Tab Bar. 8311 * @class 8312 * @name ResponsiveToggle 8313 * @fires ResponsiveToggle#init 8314 * @param {jQuery} element - jQuery object to attach tab bar functionality to. 8315 * @param {Object} options - Overrides to the default plugin settings. 8316 */ 8317 value: function _setup(element, options) { 8318 this.$element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(element); 8319 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, ResponsiveToggle.defaults, this.$element.data(), options); 8320 this.className = 'ResponsiveToggle'; // ie9 back compat 8321 8322 this._init(); 8323 8324 this._events(); 8325 } 8326 /** 8327 * Initializes the tab bar by finding the target element, toggling element, and running update(). 8328 * @function 8329 * @private 8330 */ 8331 8332 }, { 8333 key: "_init", 8334 value: function _init() { 8335 _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"]._init(); 8336 8337 var targetID = this.$element.data('responsive-toggle'); 8338 8339 if (!targetID) { 8340 console.error('Your tab bar needs an ID of a Menu as the value of data-tab-bar.'); 8341 } 8342 8343 this.$targetMenu = jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(targetID)); 8344 this.$toggler = this.$element.find('[data-toggle]').filter(function () { 8345 var target = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('toggle'); 8346 return target === targetID || target === ""; 8347 }); 8348 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, this.options, this.$targetMenu.data()); // If they were set, parse the animation classes 8349 8350 if (this.options.animate) { 8351 var input = this.options.animate.split(' '); 8352 this.animationIn = input[0]; 8353 this.animationOut = input[1] || null; 8354 } 8355 8356 this._update(); 8357 } 8358 /** 8359 * Adds necessary event handlers for the tab bar to work. 8360 * @function 8361 * @private 8362 */ 8363 8364 }, { 8365 key: "_events", 8366 value: function _events() { 8367 var _this = this; 8368 8369 this._updateMqHandler = this._update.bind(this); 8370 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', this._updateMqHandler); 8371 this.$toggler.on('click.zf.responsiveToggle', this.toggleMenu.bind(this)); 8372 } 8373 /** 8374 * Checks the current media query to determine if the tab bar should be visible or hidden. 8375 * @function 8376 * @private 8377 */ 8378 8379 }, { 8380 key: "_update", 8381 value: function _update() { 8382 // Mobile 8383 if (!_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].atLeast(this.options.hideFor)) { 8384 this.$element.show(); 8385 this.$targetMenu.hide(); 8386 } // Desktop 8387 else { 8388 this.$element.hide(); 8389 this.$targetMenu.show(); 8390 } 8391 } 8392 /** 8393 * Toggles the element attached to the tab bar. The toggle only happens if the screen is small enough to allow it. 8394 * @function 8395 * @fires ResponsiveToggle#toggled 8396 */ 8397 8398 }, { 8399 key: "toggleMenu", 8400 value: function toggleMenu() { 8401 var _this2 = this; 8402 8403 if (!_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].atLeast(this.options.hideFor)) { 8404 /** 8405 * Fires when the element attached to the tab bar toggles. 8406 * @event ResponsiveToggle#toggled 8407 */ 8408 if (this.options.animate) { 8409 if (this.$targetMenu.is(':hidden')) { 8410 _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Motion"].animateIn(this.$targetMenu, this.animationIn, function () { 8411 _this2.$element.trigger('toggled.zf.responsiveToggle'); 8412 8413 _this2.$targetMenu.find('[data-mutate]').triggerHandler('mutateme.zf.trigger'); 8414 }); 8415 } else { 8416 _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Motion"].animateOut(this.$targetMenu, this.animationOut, function () { 8417 _this2.$element.trigger('toggled.zf.responsiveToggle'); 8418 }); 8419 } 8420 } else { 8421 this.$targetMenu.toggle(0); 8422 this.$targetMenu.find('[data-mutate]').trigger('mutateme.zf.trigger'); 8423 this.$element.trigger('toggled.zf.responsiveToggle'); 8424 } 8425 } 8426 } 8427 }, { 8428 key: "_destroy", 8429 value: function _destroy() { 8430 this.$element.off('.zf.responsiveToggle'); 8431 this.$toggler.off('.zf.responsiveToggle'); 8432 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('changed.zf.mediaquery', this._updateMqHandler); 8433 } 8434 }]); 8435 8436 return ResponsiveToggle; 8437}
8437(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__["Plugin"]); 8438 8439ResponsiveToggle.defaults = { 8440 /** 8441 * The breakpoint after which the menu is always shown, and the tab bar is hidden. 8442 * @option 8443 * @type {string} 8444 * @default 'medium' 8445 */ 8446 hideFor: 'medium', 8447 8448 /** 8449 * To decide if the toggle should be animated or not. 8450 * @option 8451 * @type {boolean} 8452 * @default false 8453 */ 8454 animate: false 8455}; 8456 8457 8458/***/ }), 8459
8460/***/ "./js/foundation.reveal.js": 8461/*!*********************************!*\ 8462 !*** ./js/foundation.reveal.js ***! 8463 \*********************************/ 8464/*! exports provided: Reveal */ 8465/***/ (function(module, __webpack_exports__, __webpack_require__) { 8466 8467"use strict"; 8468__webpack_require__.r(__webpack_exports__); 8469/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Reveal", function() { return Reveal; }); 8470/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 8471/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 8472/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 8473/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 8474/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js"); 8475/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js"); 8476/* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.util.motion */ "./js/foundation.util.motion.js"); 8477/* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js"); 8478/* harmony import */ var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./foundation.util.touch */ "./js/foundation.util.touch.js"); 8479 8480 8481function _typeof(obj) { 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); } 8482 8483function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 8484 8485function _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); } } 8486 8487function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 8488 8489function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 8490 8491function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 8492 8493function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 8494 8495function _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); } 8496 8497function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 8498 8499 8500 8501 8502 8503 8504 8505 8506 8507/** 8508 * Reveal module. 8509 * @module foundation.reveal 8510 * @requires foundation.util.keyboard 8511 * @requires foundation.util.touch 8512 * @requires foundation.util.triggers 8513 * @requires foundation.util.mediaQuery 8514 * @requires foundation.util.motion if using animations 8515 */ 8516 8517var Reveal = 8518/*#__PURE__*/ 8519function (_Plugin) { 8520 _inherits(Reveal, _Plugin); 8521 8522 function Reveal() { 8523 _classCallCheck(this, Reveal); 8524 8525 return _possibleConstructorReturn(this, _getPrototypeOf(Reveal).apply(this, arguments)); 8526 } 8527 8528 _createClass(Reveal, [{ 8529 key: "_setup", 8530 8531 /** 8532 * Creates a new instance of Reveal. 8533 * @class 8534 * @name Reveal 8535 * @param {jQuery} element - jQuery object to use for the modal. 8536 * @param {Object} options - optional parameters. 8537 */ 8538 value: function _setup(element, options) { 8539 this.$element = element; 8540 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Reveal.defaults, this.$element.data(), options); 8541 this.className = 'Reveal'; // ie9 back compat 8542 8543 this._init(); // Touch and Triggers init are idempotent, just need to make sure they are initialized 8544 8545 8546 _foundation_util_touch__WEBPACK_IMPORTED_MODULE_7__["Touch"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 8547 _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_6__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 8548 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].register('Reveal', { 8549 'ESCAPE': 'close' 8550 }); 8551 } 8552 /** 8553 * Initializes the modal by adding the overlay and close buttons, (if selected). 8554 * @private 8555 */ 8556 8557 }, { 8558 key: "_init", 8559 value: function _init() { 8560 var _this2 = this; 8561 8562 _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_4__["MediaQuery"]._init(); 8563 8564 this.id = this.$element.attr('id'); 8565 this.isActive = false;
vendor: 17,847 bytes, lines 8566-9096
8566 this.cached = { 8567 mq: _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_4__["MediaQuery"].current 8568 }; 8569 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, "\"]")); 8570 this.$anchor.attr({ 8571 'aria-controls': this.id, 8572 'aria-haspopup': true, 8573 'tabindex': 0 8574 }); 8575 8576 if (this.options.fullScreen || this.$element.hasClass('full')) { 8577 this.options.fullScreen = true; 8578 this.options.overlay = false; 8579 } 8580 8581 if (this.options.overlay && !this.$overlay) { 8582 this.$overlay = this._makeOverlay(this.id); 8583 } 8584 8585 this.$element.attr({ 8586 'role': 'dialog', 8587 'aria-hidden': true, 8588 'data-yeti-box': this.id, 8589 'data-resize': this.id 8590 }); 8591 8592 if (this.$overlay) { 8593 this.$element.detach().appendTo(this.$overlay); 8594 } else { 8595 this.$element.detach().appendTo(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.options.appendTo)); 8596 this.$element.addClass('without-overlay'); 8597 } 8598 8599 this._events(); 8600 8601 if (this.options.deepLink && window.location.hash === "#".concat(this.id)) { 8602 this.onLoadListener = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () { 8603 return _this2.open(); 8604 }); 8605 } 8606 } 8607 /** 8608 * Creates an overlay div to display behind the modal. 8609 * @private 8610 */ 8611 8612 }, { 8613 key: "_makeOverlay", 8614 value: function _makeOverlay() { 8615 var additionalOverlayClasses = ''; 8616 8617 if (this.options.additionalOverlayClasses) { 8618 additionalOverlayClasses = ' ' + this.options.additionalOverlayClasses; 8619 } 8620 8621 return jquery__WEBPACK_IMPORTED_MODULE_0___default()('<div></div>').addClass('reveal-overlay' + additionalOverlayClasses).appendTo(this.options.appendTo); 8622 } 8623 /** 8624 * Updates position of modal 8625 * TODO: Figure out if we actually need to cache these values or if it doesn't matter 8626 * @private 8627 */ 8628 8629 }, { 8630 key: "_updatePosition", 8631 value: function _updatePosition() { 8632 var width = this.$element.outerWidth(); 8633 var outerWidth = jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).width(); 8634 var height = this.$element.outerHeight(); 8635 var outerHeight = jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).height(); 8636 var left, 8637 top = null; 8638 8639 if (this.options.hOffset === 'auto') { 8640 left = parseInt((outerWidth - width) / 2, 10); 8641 } else { 8642 left = parseInt(this.options.hOffset, 10); 8643 } 8644 8645 if (this.options.vOffset === 'auto') { 8646 if (height > outerHeight) { 8647 top = parseInt(Math.min(100, outerHeight / 10), 10); 8648 } else { 8649 top = parseInt((outerHeight - height) / 4, 10); 8650 } 8651 } else if (this.options.vOffset !== null) { 8652 top = parseInt(this.options.vOffset, 10); 8653 } 8654 8655 if (top !== null) { 8656 this.$element.css({ 8657 top: top + 'px' 8658 }); 8659 } // only worry about left if we don't have an overlay or we have a horizontal offset, 8660 // otherwise we're perfectly in the middle 8661 8662 8663 if (!this.$overlay || this.options.hOffset !== 'auto') { 8664 this.$element.css({ 8665 left: left + 'px' 8666 }); 8667 this.$element.css({ 8668 margin: '0px' 8669 }); 8670 } 8671 } 8672 /** 8673 * Adds event handlers for the modal. 8674 * @private 8675 */ 8676 8677 }, { 8678 key: "_events", 8679 value: function _events() { 8680 var _this3 = this; 8681 8682 var _this = this; 8683 8684 this.$element.on({ 8685 'open.zf.trigger': this.open.bind(this), 8686 'close.zf.trigger': function closeZfTrigger(event, $element) { 8687 if (event.target === _this.$element[0] || jquery__WEBPACK_IMPORTED_MODULE_0___default()(event.target).parents('[data-closable]')[0] === $element) { 8688 // only close reveal when it's explicitly called 8689 return _this3.close.apply(_this3); 8690 } 8691 }, 8692 'toggle.zf.trigger': this.toggle.bind(this), 8693 'resizeme.zf.trigger': function resizemeZfTrigger() { 8694 _this._updatePosition(); 8695 } 8696 }); 8697 8698 if (this.options.closeOnClick && this.options.overlay) { 8699 this.$overlay.off('.zf.reveal').on('click.zf.dropdown tap.zf.dropdown', function (e) { 8700 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)) { 8701 return; 8702 } 8703 8704 _this.close(); 8705 }); 8706 } 8707 8708 if (this.options.deepLink) { 8709 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on("hashchange.zf.reveal:".concat(this.id), this._handleState.bind(this)); 8710 } 8711 } 8712 /** 8713 * Handles modal methods on back/forward button clicks or any other event that triggers hashchange. 8714 * @private 8715 */ 8716 8717 }, { 8718 key: "_handleState", 8719 value: function _handleState(e) { 8720 if (window.location.hash === '#' + this.id && !this.isActive) { 8721 this.open(); 8722 } else { 8723 this.close(); 8724 } 8725 } 8726 /** 8727 * Disables the scroll when Reveal is shown to prevent the background from shifting 8728 * @param {number} scrollTop - Scroll to visually apply, window current scroll by default 8729 */ 8730 8731 }, { 8732 key: "_disableScroll", 8733 value: function _disableScroll(scrollTop) { 8734 scrollTop = scrollTop || jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).scrollTop(); 8735 8736 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).height() > jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).height()) { 8737 jquery__WEBPACK_IMPORTED_MODULE_0___default()("html").css("top", -scrollTop); 8738 } 8739 } 8740 /** 8741 * Reenables the scroll when Reveal closes 8742 * @param {number} scrollTop - Scroll to restore, html "top" property by default (as set by `_disableScroll`) 8743 */ 8744 8745 }, { 8746 key: "_enableScroll", 8747 value: function _enableScroll(scrollTop) { 8748 scrollTop = scrollTop || parseInt(jquery__WEBPACK_IMPORTED_MODULE_0___default()("html").css("top")); 8749 8750 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).height() > jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).height()) { 8751 jquery__WEBPACK_IMPORTED_MODULE_0___default()("html").css("top", ""); 8752 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).scrollTop(-scrollTop); 8753 } 8754 } 8755 /** 8756 * Opens the modal controlled by `this.$anchor`, and closes all others by default. 8757 * @function 8758 * @fires Reveal#closeme 8759 * @fires Reveal#open 8760 */ 8761 8762 }, { 8763 key: "open", 8764 value: function open() { 8765 var _this4 = this; 8766 8767 // either update or replace browser history 8768 var hash = "#".concat(this.id); 8769 8770 if (this.options.deepLink && window.location.hash !== hash) { 8771 if (window.history.pushState) { 8772 if (this.options.updateHistory) { 8773 window.history.pushState({}, '', hash); 8774 } else { 8775 window.history.replaceState({}, '', hash); 8776 } 8777 } else { 8778 window.location.hash = hash; 8779 } 8780 } // Remember anchor that opened it to set focus back later, have general anchors as fallback 8781 8782 8783 this.$activeAnchor = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.activeElement).is(this.$anchor) ? jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.activeElement) : this.$anchor; 8784 this.isActive = true; // Make elements invisible, but remove display: none so we can get size and positioning 8785 8786 this.$element.css({ 8787 'visibility': 'hidden' 8788 }).show().scrollTop(0); 8789 8790 if (this.options.overlay) { 8791 this.$overlay.css({ 8792 'visibility': 'hidden' 8793 }).show(); 8794 } 8795 8796 this._updatePosition(); 8797 8798 this.$element.hide().css({ 8799 'visibility': '' 8800 }); 8801 8802 if (this.$overlay) { 8803 this.$overlay.css({ 8804 'visibility': '' 8805 }).hide(); 8806 8807 if (this.$element.hasClass('fast')) { 8808 this.$overlay.addClass('fast'); 8809 } else if (this.$element.hasClass('slow')) { 8810 this.$overlay.addClass('slow'); 8811 } 8812 } 8813 8814 if (!this.options.multipleOpened) { 8815 /** 8816 * Fires immediately before the modal opens. 8817 * Closes any other modals that are currently open 8818 * @event Reveal#closeme 8819 */ 8820 this.$element.trigger('closeme.zf.reveal', this.id); 8821 } 8822 8823 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()('.reveal:visible').length === 0) { 8824 this._disableScroll(); 8825 } 8826 8827 var _this = this; // Motion UI method of reveal 8828 8829 8830 if (this.options.animationIn) { 8831 var afterAnimation = function afterAnimation() { 8832 _this.$element.attr({ 8833 'aria-hidden': false, 8834 'tabindex': -1 8835 }).focus(); 8836 8837 _this._addGlobalClasses(); 8838 8839 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].trapFocus(_this.$element); 8840 }; 8841 8842 if (this.options.overlay) { 8843 _foundation_util_motion__WEBPACK_IMPORTED_MODULE_5__["Motion"].animateIn(this.$overlay, 'fade-in'); 8844 } 8845 8846 _foundation_util_motion__WEBPACK_IMPORTED_MODULE_5__["Motion"].animateIn(this.$element, this.options.animationIn, function () { 8847 if (_this4.$element) { 8848 // protect against object having been removed 8849 _this4.focusableElements = _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].findFocusable(_this4.$element); 8850 afterAnimation(); 8851 } 8852 }); 8853 } // jQuery method of reveal 8854 else { 8855 if (this.options.overlay) { 8856 this.$overlay.show(0); 8857 } 8858 8859 this.$element.show(this.options.showDelay); 8860 } // handle accessibility 8861 8862 8863 this.$element.attr({ 8864 'aria-hidden': false, 8865 'tabindex': -1 8866 }).focus(); 8867 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].trapFocus(this.$element); 8868 8869 this._addGlobalClasses(); 8870 8871 this._addGlobalListeners(); 8872 /** 8873 * Fires when the modal has successfully opened. 8874 * @event Reveal#open 8875 */ 8876 8877 8878 this.$element.trigger('open.zf.reveal'); 8879 } 8880 /** 8881 * Adds classes and listeners on document required by open modals. 8882 * 8883 * The following classes are added and updated: 8884 * - `.is-reveal-open` - Prevents the scroll on document 8885 * - `.zf-has-scroll` - Displays a disabled scrollbar on document if required like if the 8886 * scroll was not disabled. This prevent a "shift" of the page content due 8887 * the scrollbar disappearing when the modal opens. 8888 * 8889 * @private 8890 */ 8891 8892 }, { 8893 key: "_addGlobalClasses", 8894 value: function _addGlobalClasses() { 8895 var updateScrollbarClass = function updateScrollbarClass() { 8896 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())); 8897 }; 8898 8899 this.$element.on('resizeme.zf.trigger.revealScrollbarListener', function () { 8900 return updateScrollbarClass(); 8901 }); 8902 updateScrollbarClass(); 8903 jquery__WEBPACK_IMPORTED_MODULE_0___default()('html').addClass('is-reveal-open'); 8904 } 8905 /** 8906 * Removes classes and listeners on document that were required by open modals. 8907 * @private 8908 */ 8909 8910 }, { 8911 key: "_removeGlobalClasses", 8912 value: function _removeGlobalClasses() { 8913 this.$element.off('resizeme.zf.trigger.revealScrollbarListener'); 8914 jquery__WEBPACK_IMPORTED_MODULE_0___default()('html').removeClass('is-reveal-open'); 8915 jquery__WEBPACK_IMPORTED_MODULE_0___default()('html').removeClass('zf-has-scroll'); 8916 } 8917 /** 8918 * Adds extra event handlers for the body and window if necessary. 8919 * @private 8920 */ 8921 8922 }, { 8923 key: "_addGlobalListeners", 8924 value: function _addGlobalListeners() { 8925 var _this = this; 8926 8927 if (!this.$element) { 8928 return; 8929 } // If we're in the middle of cleanup, don't freak out 8930 8931 8932 this.focusableElements = _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].findFocusable(this.$element); 8933 8934 if (!this.options.overlay && this.options.closeOnClick && !this.options.fullScreen) { 8935 jquery__WEBPACK_IMPORTED_MODULE_0___default()('body').on('click.zf.dropdown tap.zf.dropdown', function (e) { 8936 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)) { 8937 return; 8938 } 8939 8940 _this.close(); 8941 }); 8942 } 8943 8944 if (this.options.closeOnEsc) { 8945 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('keydown.zf.reveal', function (e) { 8946 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].handleKey(e, 'Reveal', { 8947 close: function close() { 8948 if (_this.options.closeOnEsc) { 8949 _this.close(); 8950 } 8951 } 8952 }); 8953 }); 8954 } 8955 } 8956 /** 8957 * Closes the modal. 8958 * @function 8959 * @fires Reveal#closed 8960 */ 8961 8962 }, { 8963 key: "close", 8964 value: function close() { 8965 if (!this.isActive || !this.$element.is(':visible')) { 8966 return false; 8967 } 8968 8969 var _this = this; // Motion UI method of hiding 8970 8971 8972 if (this.options.animationOut) { 8973 if (this.options.overlay) { 8974 _foundation_util_motion__WEBPACK_IMPORTED_MODULE_5__["Motion"].animateOut(this.$overlay, 'fade-out'); 8975 } 8976 8977 _foundation_util_motion__WEBPACK_IMPORTED_MODULE_5__["Motion"].animateOut(this.$element, this.options.animationOut, finishUp); 8978 } // jQuery method of hiding 8979 else { 8980 this.$element.hide(this.options.hideDelay); 8981 8982 if (this.options.overlay) { 8983 this.$overlay.hide(0, finishUp); 8984 } else { 8985 finishUp(); 8986 } 8987 } // Conditionals to remove extra event listeners added on open 8988 8989 8990 if (this.options.closeOnEsc) { 8991 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('keydown.zf.reveal'); 8992 } 8993 8994 if (!this.options.overlay && this.options.closeOnClick) { 8995 jquery__WEBPACK_IMPORTED_MODULE_0___default()('body').off('click.zf.dropdown tap.zf.dropdown'); 8996 } 8997 8998 this.$element.off('keydown.zf.reveal'); 8999 9000 function finishUp() { 9001 // Get the current top before the modal is closed and restore the scroll after. 9002 // TODO: use component properties instead of HTML properties 9003 // See https://github.com/foundation/foundation-sites/pull/10786 9004 var scrollTop = parseInt(jquery__WEBPACK_IMPORTED_MODULE_0___default()("html").css("top")); 9005 9006 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()('.reveal:visible').length === 0) { 9007 _this._removeGlobalClasses(); // also remove .is-reveal-open from the html element when there is no opened reveal 9008 9009 } 9010 9011 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].releaseFocus(_this.$element); 9012 9013 _this.$element.attr('aria-hidden', true); 9014 9015 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()('.reveal:visible').length === 0) { 9016 _this._enableScroll(scrollTop); 9017 } 9018 /** 9019 * Fires when the modal is done closing. 9020 * @event Reveal#closed 9021 */ 9022 9023 9024 _this.$element.trigger('closed.zf.reveal'); 9025 } 9026 /** 9027 * Resets the modal content 9028 * This prevents a running video to keep going in the background 9029 */ 9030 9031 9032 if (this.options.resetOnClose) { 9033 this.$element.html(this.$element.html()); 9034 } 9035 9036 this.isActive = false; // If deepLink and we did not switched to an other modal... 9037 9038 if (_this.options.deepLink && window.location.hash === "#".concat(this.id)) { 9039 // Remove the history hash 9040 if (window.history.replaceState) { 9041 var urlWithoutHash = window.location.pathname + window.location.search; 9042 9043 if (this.options.updateHistory) { 9044 window.history.pushState({}, '', urlWithoutHash); // remove the hash 9045 } else { 9046 window.history.replaceState('', document.title, urlWithoutHash); 9047 } 9048 } else { 9049 window.location.hash = ''; 9050 } 9051 } 9052 9053 this.$activeAnchor.focus(); 9054 } 9055 /** 9056 * Toggles the open/closed state of a modal. 9057 * @function 9058 */ 9059 9060 }, { 9061 key: "toggle", 9062 value: function toggle() { 9063 if (this.isActive) { 9064 this.close(); 9065 } else { 9066 this.open(); 9067 } 9068 } 9069 }, { 9070 key: "_destroy", 9071 9072 /** 9073 * Destroys an instance of a modal. 9074 * @function 9075 */ 9076 value: function _destroy() { 9077 if (this.options.overlay) { 9078 this.$element.appendTo(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.options.appendTo)); // move $element outside of $overlay to prevent error unregisterPlugin() 9079 9080 this.$overlay.hide().off().remove(); 9081 } 9082 9083 this.$element.hide().off(); 9084 this.$anchor.off('.zf'); 9085 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(".zf.reveal:".concat(this.id)); 9086 if (this.onLoadListener) jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(this.onLoadListener); 9087 9088 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()('.reveal:visible').length === 0) { 9089 this._removeGlobalClasses(); // also remove .is-reveal-open from the html element when there is no opened reveal 9090 9091 } 9092 } 9093 }]); 9094 9095 return Reveal; 9096}
9096(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]); 9097 9098Reveal.defaults = { 9099 /** 9100 * Motion-UI class to use for animated elements. If none used, defaults to simple show/hide. 9101 * @option 9102 * @type {string} 9103 * @default '' 9104 */ 9105 animationIn: '', 9106 9107 /** 9108 * Motion-UI class to use for animated elements. If none used, defaults to simple show/hide. 9109 * @option 9110 * @type {string} 9111 * @default '' 9112 */ 9113 animationOut: '', 9114 9115 /** 9116 * Time, in ms, to delay the opening of a modal after a click if no animation used. 9117 * @option 9118 * @type {number} 9119 * @default 0 9120 */ 9121 showDelay: 0, 9122 9123 /** 9124 * Time, in ms, to delay the closing of a modal after a click if no animation used. 9125 * @option 9126 * @type {number} 9127 * @default 0 9128 */ 9129 hideDelay: 0, 9130 9131 /** 9132 * Allows a click on the body/overlay to close the modal. 9133 * @option 9134 * @type {boolean} 9135 * @default true 9136 */ 9137 closeOnClick: true, 9138 9139 /** 9140 * Allows the modal to close if the user presses the `ESCAPE` key. 9141 * @option 9142 * @type {boolean} 9143 * @default true 9144 */ 9145 closeOnEsc: true, 9146 9147 /** 9148 * If true, allows multiple modals to be displayed at once. 9149 * @option 9150 * @type {boolean} 9151 * @default false 9152 */ 9153 multipleOpened: false, 9154 9155 /** 9156 * Distance, in pixels, the modal should push down from the top of the screen. 9157 * @option 9158 * @type {number|string} 9159 * @default auto 9160 */ 9161 vOffset: 'auto', 9162 9163 /** 9164 * Distance, in pixels, the modal should push in from the side of the screen. 9165 * @option 9166 * @type {number|string} 9167 * @default auto 9168 */ 9169 hOffset: 'auto', 9170 9171 /** 9172 * Allows the modal to be fullscreen, completely blocking out the rest of the view. JS checks for this as well. 9173 * @option 9174 * @type {boolean} 9175 * @default false 9176 */ 9177 fullScreen: false, 9178 9179 /** 9180 * Allows the modal to generate an overlay div, which will cover the view when modal opens. 9181 * @option 9182 * @type {boolean} 9183 * @default true 9184 */ 9185 overlay: true, 9186 9187 /** 9188 * 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. 9189 * @option 9190 * @type {boolean} 9191 * @default false 9192 */ 9193 resetOnClose: false, 9194 9195 /** 9196 * Link the location hash to the modal. 9197 * Set the location hash when the modal is opened/closed, and open/close the modal when the location changes. 9198 * @option 9199 * @type {boolean} 9200 * @default false 9201 */ 9202 deepLink: false, 9203 9204 /** 9205 * If `deepLink` is enabled, update the browser history with the open modal 9206 * @option 9207 * @default false 9208 */ 9209 updateHistory: false, 9210 9211 /** 9212 * Allows the modal to append to custom div. 9213 * @option 9214 * @type {string} 9215 * @default "body" 9216 */ 9217 appendTo: "body", 9218 9219 /** 9220 * Allows adding additional class names to the reveal overlay. 9221 * @option 9222 * @type {string} 9223 * @default '' 9224 */ 9225 additionalOverlayClasses: '' 9226}; 9227 9228 9229/***/ }), 9230
vendor: 4,940 bytes, lines 9231-9310
9231/***/ "./js/foundation.slider.js": 9232/*!*********************************!*\ 9233 !*** ./js/foundation.slider.js ***! 9234 \*********************************/ 9235/*! exports provided: Slider */ 9236/***/ (function(module, __webpack_exports__, __webpack_require__) { 9237 9238"use strict"; 9239__webpack_require__.r(__webpack_exports__); 9240/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Slider", function() { return Slider; }); 9241/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 9242/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 9243/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js"); 9244/* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.motion */ "./js/foundation.util.motion.js"); 9245/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 9246/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 9247/* harmony import */ var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.util.touch */ "./js/foundation.util.touch.js"); 9248/* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js"); 9249 9250 9251function _typeof(obj) { 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); } 9252 9253function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 9254 9255function _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); } } 9256 9257function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 9258 9259function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 9260 9261function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 9262 9263function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 9264 9265function _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); } 9266 9267function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 9268 9269 9270 9271 9272 9273 9274 9275 9276/** 9277 * Slider module. 9278 * @module foundation.slider 9279 * @requires foundation.util.motion 9280 * @requires foundation.util.triggers 9281 * @requires foundation.util.keyboard 9282 * @requires foundation.util.touch 9283 */ 9284 9285var Slider = 9286/*#__PURE__*/ 9287function (_Plugin) { 9288 _inherits(Slider, _Plugin); 9289 9290 function Slider() { 9291 _classCallCheck(this, Slider); 9292 9293 return _possibleConstructorReturn(this, _getPrototypeOf(Slider).apply(this, arguments)); 9294 } 9295 9296 _createClass(Slider, [{ 9297 key: "_setup", 9298 9299 /** 9300 * Creates a new instance of a slider control. 9301 * @class 9302 * @name Slider 9303 * @param {jQuery} element - jQuery object to make into a slider control. 9304 * @param {Object} options - Overrides to the default plugin settings. 9305 */ 9306 value: function _setup(element, options) { 9307 this.$element = element; 9308 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Slider.defaults, this.$element.data(), options); 9309 this.className = 'Slider'; // ie9 back compat 9310 // Touch and Triggers inits are idempotent, we just need to make sure it's initialied.
vendor: 21,475 bytes, lines 9311-9910
9311 9312 _foundation_util_touch__WEBPACK_IMPORTED_MODULE_5__["Touch"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 9313 _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_6__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 9314 9315 this._init(); 9316 9317 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].register('Slider', { 9318 'ltr': { 9319 'ARROW_RIGHT': 'increase', 9320 'ARROW_UP': 'increase', 9321 'ARROW_DOWN': 'decrease', 9322 'ARROW_LEFT': 'decrease', 9323 'SHIFT_ARROW_RIGHT': 'increase_fast', 9324 'SHIFT_ARROW_UP': 'increase_fast', 9325 'SHIFT_ARROW_DOWN': 'decrease_fast', 9326 'SHIFT_ARROW_LEFT': 'decrease_fast', 9327 'HOME': 'min', 9328 'END': 'max' 9329 }, 9330 'rtl': { 9331 'ARROW_LEFT': 'increase', 9332 'ARROW_RIGHT': 'decrease', 9333 'SHIFT_ARROW_LEFT': 'increase_fast', 9334 'SHIFT_ARROW_RIGHT': 'decrease_fast' 9335 } 9336 }); 9337 } 9338 /** 9339 * Initilizes the plugin by reading/setting attributes, creating collections and setting the initial position of the handle(s). 9340 * @function 9341 * @private 9342 */ 9343 9344 }, { 9345 key: "_init", 9346 value: function _init() { 9347 this.inputs = this.$element.find('input'); 9348 this.handles = this.$element.find('[data-slider-handle]'); 9349 this.$handle = this.handles.eq(0); 9350 this.$input = this.inputs.length ? this.inputs.eq(0) : jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(this.$handle.attr('aria-controls'))); 9351 this.$fill = this.$element.find('[data-slider-fill]').css(this.options.vertical ? 'height' : 'width', 0); 9352 9353 var _this = this; 9354 9355 if (this.options.disabled || this.$element.hasClass(this.options.disabledClass)) { 9356 this.options.disabled = true; 9357 this.$element.addClass(this.options.disabledClass); 9358 } 9359 9360 if (!this.inputs.length) { 9361 this.inputs = jquery__WEBPACK_IMPORTED_MODULE_0___default()().add(this.$input); 9362 this.options.binding = true; 9363 } 9364 9365 this._setInitAttr(0); 9366 9367 if (this.handles[1]) { 9368 this.options.doubleSided = true; 9369 this.$handle2 = this.handles.eq(1); 9370 this.$input2 = this.inputs.length > 1 ? this.inputs.eq(1) : jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(this.$handle2.attr('aria-controls'))); 9371 9372 if (!this.inputs[1]) { 9373 this.inputs = this.inputs.add(this.$input2); 9374 } // this.$handle.triggerHandler('click.zf.slider'); 9375 9376 9377 this._setInitAttr(1); 9378 } // Set handle positions 9379 9380 9381 this.setHandles(); 9382 9383 this._events(); 9384 } 9385 }, { 9386 key: "setHandles", 9387 value: function setHandles() { 9388 var _this2 = this; 9389 9390 if (this.handles[1]) { 9391 this._setHandlePos(this.$handle, this.inputs.eq(0).val(), function () { 9392 _this2._setHandlePos(_this2.$handle2, _this2.inputs.eq(1).val()); 9393 }); 9394 } else { 9395 this._setHandlePos(this.$handle, this.inputs.eq(0).val()); 9396 } 9397 } 9398 }, { 9399 key: "_reflow", 9400 value: function _reflow() { 9401 this.setHandles(); 9402 } 9403 /** 9404 * @function 9405 * @private 9406 * @param {Number} value - floating point (the value) to be transformed using to a relative position on the slider (the inverse of _value) 9407 */ 9408 9409 }, { 9410 key: "_pctOfBar", 9411 value: function _pctOfBar(value) { 9412 var pctOfBar = percent(value - this.options.start, this.options.end - this.options.start); 9413 9414 switch (this.options.positionValueFunction) { 9415 case "pow": 9416 pctOfBar = this._logTransform(pctOfBar); 9417 break; 9418 9419 case "log": 9420 pctOfBar = this._powTransform(pctOfBar); 9421 break; 9422 } 9423 9424 return pctOfBar.toFixed(2); 9425 } 9426 /** 9427 * @function 9428 * @private 9429 * @param {Number} pctOfBar - floating point, the relative position of the slider (typically between 0-1) to be transformed to a value 9430 */ 9431 9432 }, { 9433 key: "_value", 9434 value: function _value(pctOfBar) { 9435 switch (this.options.positionValueFunction) { 9436 case "pow": 9437 pctOfBar = this._powTransform(pctOfBar); 9438 break; 9439 9440 case "log": 9441 pctOfBar = this._logTransform(pctOfBar); 9442 break; 9443 } 9444 9445 var value; 9446 9447 if (this.options.vertical) { 9448 // linear interpolation which is working with negative values for start 9449 // https://math.stackexchange.com/a/1019084 9450 value = parseFloat(this.options.end) + pctOfBar * (this.options.start - this.options.end); 9451 } else { 9452 value = (this.options.end - this.options.start) * pctOfBar + parseFloat(this.options.start); 9453 } 9454 9455 return value; 9456 } 9457 /** 9458 * @function 9459 * @private 9460 * @param {Number} value - floating point (typically between 0-1) to be transformed using the log function 9461 */ 9462 9463 }, { 9464 key: "_logTransform", 9465 value: function _logTransform(value) { 9466 return baseLog(this.options.nonLinearBase, value * (this.options.nonLinearBase - 1) + 1); 9467 } 9468 /** 9469 * @function 9470 * @private 9471 * @param {Number} value - floating point (typically between 0-1) to be transformed using the power function 9472 */ 9473 9474 }, { 9475 key: "_powTransform", 9476 value: function _powTransform(value) { 9477 return (Math.pow(this.options.nonLinearBase, value) - 1) / (this.options.nonLinearBase - 1); 9478 } 9479 /** 9480 * Sets the position of the selected handle and fill bar. 9481 * @function 9482 * @private 9483 * @param {jQuery} $hndl - the selected handle to move. 9484 * @param {Number} location - floating point between the start and end values of the slider bar. 9485 * @param {Function} cb - callback function to fire on completion. 9486 * @fires Slider#moved 9487 * @fires Slider#changed 9488 */ 9489 9490 }, { 9491 key: "_setHandlePos", 9492 value: function _setHandlePos($hndl, location, cb) { 9493 // don't move if the slider has been disabled since its initialization 9494 if (this.$element.hasClass(this.options.disabledClass)) { 9495 return; 9496 } //might need to alter that slightly for bars that will have odd number selections. 9497 9498 9499 location = parseFloat(location); //on input change events, convert string to number...grumble. 9500 // prevent slider from running out of bounds, if value exceeds the limits set through options, override the value to min/max 9501 9502 if (location < this.options.start) { 9503 location = this.options.start; 9504 } else if (location > this.options.end) { 9505 location = this.options.end; 9506 } 9507 9508 var isDbl = this.options.doubleSided; 9509 9510 if (isDbl) { 9511 //this block is to prevent 2 handles from crossing eachother. Could/should be improved. 9512 if (this.handles.index($hndl) === 0) { 9513 var h2Val = parseFloat(this.$handle2.attr('aria-valuenow')); 9514 location = location >= h2Val ? h2Val - this.options.step : location; 9515 } else { 9516 var h1Val = parseFloat(this.$handle.attr('aria-valuenow')); 9517 location = location <= h1Val ? h1Val + this.options.step : location; 9518 } 9519 } 9520 9521 var _this = this, 9522 vert = this.options.vertical, 9523 hOrW = vert ? 'height' : 'width', 9524 lOrT = vert ? 'top' : 'left', 9525 handleDim = $hndl[0].getBoundingClientRect()[hOrW], 9526 elemDim = this.$element[0].getBoundingClientRect()[hOrW], 9527 //percentage of bar min/max value based on click or drag point 9528 pctOfBar = this._pctOfBar(location), 9529 //number of actual pixels to shift the handle, based on the percentage obtained above 9530 pxToMove = (elemDim - handleDim) * pctOfBar, 9531 //percentage of bar to shift the handle 9532 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 9533 9534 9535 location = parseFloat(location.toFixed(this.options.decimal)); // declare empty object for css adjustments, only used with 2 handled-sliders 9536 9537 var css = {}; 9538 9539 this._setValues($hndl, location); // TODO update to calculate based on values set to respective inputs?? 9540 9541 9542 if (isDbl) { 9543 var isLeftHndl = this.handles.index($hndl) === 0, 9544 //empty variable, will be used for min-height/width for fill bar 9545 dim, 9546 //percentage w/h of the handle compared to the slider bar 9547 handlePct = ~~(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 9548 9549 if (isLeftHndl) { 9550 //left or top percentage value to apply to the fill bar. 9551 css[lOrT] = "".concat(movement, "%"); //calculate the new min-height/width for the fill bar. 9552 9553 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 9554 //plus, it means we don't care if 'dim' isNaN on init, it won't be in the future. 9555 9556 if (cb && typeof cb === 'function') { 9557 cb(); 9558 } //this is only needed for the initialization of 2 handled sliders 9559 9560 } else { 9561 //just caching the value of the left/bottom handle's left/top property 9562 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 9563 //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 9564 9565 dim = movement - (isNaN(handlePos) ? (this.options.initialStart - this.options.start) / ((this.options.end - this.options.start) / 100) : handlePos) + handlePct; 9566 } // assign the min-height/width to our css object 9567 9568 9569 css["min-".concat(hOrW)] = "".concat(dim, "%"); 9570 } 9571 9572 this.$element.one('finished.zf.animate', function () { 9573 /** 9574 * Fires when the handle is done moving. 9575 * @event Slider#moved 9576 */ 9577 _this.$element.trigger('moved.zf.slider', [$hndl]); 9578 }); //because we don't know exactly how the handle will be moved, check the amount of time it should take to move. 9579 9580 var moveTime = this.$element.data('dragging') ? 1000 / 60 : this.options.moveTime; 9581 Object(_foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Move"])(moveTime, $hndl, function () { 9582 // adjusting the left/top property of the handle, based on the percentage calculated above 9583 // if movement isNaN, that is because the slider is hidden and we cannot determine handle width, 9584 // fall back to next best guess. 9585 if (isNaN(movement)) { 9586 $hndl.css(lOrT, "".concat(pctOfBar * 100, "%")); 9587 } else { 9588 $hndl.css(lOrT, "".concat(movement, "%")); 9589 } 9590 9591 if (!_this.options.doubleSided) { 9592 //if single-handled, a simple method to expand the fill bar 9593 _this.$fill.css(hOrW, "".concat(pctOfBar * 100, "%")); 9594 } else { 9595 //otherwise, use the css object we created above 9596 _this.$fill.css(css); 9597 } 9598 }); 9599 /** 9600 * Fires when the value has not been change for a given time. 9601 * @event Slider#changed 9602 */ 9603 9604 clearTimeout(_this.timeout); 9605 _this.timeout = setTimeout(function () { 9606 _this.$element.trigger('changed.zf.slider', [$hndl]); 9607 }, _this.options.changedDelay); 9608 } 9609 /** 9610 * Sets the initial attribute for the slider element. 9611 * @function 9612 * @private 9613 * @param {Number} idx - index of the current handle/input to use. 9614 */ 9615 9616 }, { 9617 key: "_setInitAttr", 9618 value: function _setInitAttr(idx) { 9619 var initVal = idx === 0 ? this.options.initialStart : this.options.initialEnd; 9620 var id = this.inputs.eq(idx).attr('id') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'slider'); 9621 this.inputs.eq(idx).attr({ 9622 'id': id, 9623 'max': this.options.end, 9624 'min': this.options.start, 9625 'step': this.options.step 9626 }); 9627 this.inputs.eq(idx).val(initVal); 9628 this.handles.eq(idx).attr({ 9629 'role': 'slider', 9630 'aria-controls': id, 9631 'aria-valuemax': this.options.end, 9632 'aria-valuemin': this.options.start, 9633 'aria-valuenow': initVal, 9634 'aria-orientation': this.options.vertical ? 'vertical' : 'horizontal', 9635 'tabindex': 0 9636 }); 9637 } 9638 /** 9639 * Sets the input and `aria-valuenow` values for the slider element. 9640 * @function 9641 * @private 9642 * @param {jQuery} $handle - the currently selected handle. 9643 * @param {Number} val - floating point of the new value. 9644 */ 9645 9646 }, { 9647 key: "_setValues", 9648 value: function _setValues($handle, val) { 9649 var idx = this.options.doubleSided ? this.handles.index($handle) : 0; 9650 this.inputs.eq(idx).val(val); 9651 $handle.attr('aria-valuenow', val); 9652 } 9653 /** 9654 * Handles events on the slider element. 9655 * Calculates the new location of the current handle. 9656 * If there are two handles and the bar was clicked, it determines which handle to move. 9657 * @function 9658 * @private 9659 * @param {Object} e - the `event` object passed from the listener. 9660 * @param {jQuery} $handle - the current handle to calculate for, if selected. 9661 * @param {Number} val - floating point number for the new value of the slider. 9662 * TODO clean this up, there's a lot of repeated code between this and the _setHandlePos fn. 9663 */ 9664 9665 }, { 9666 key: "_handleEvent", 9667 value: function _handleEvent(e, $handle, val) { 9668 var value, hasVal; 9669 9670 if (!val) { 9671 //click or drag events 9672 e.preventDefault(); 9673 9674 var _this = this, 9675 vertical = this.options.vertical, 9676 param = vertical ? 'height' : 'width', 9677 direction = vertical ? 'top' : 'left', 9678 eventOffset = vertical ? e.pageY : e.pageX, 9679 barDim = this.$element[0].getBoundingClientRect()[param], 9680 windowScroll = vertical ? jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).scrollTop() : jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).scrollLeft(); 9681 9682 var elemOffset = this.$element.offset()[direction]; // touch events emulated by the touch util give position relative to screen, add window.scroll to event coordinates... 9683 // best way to guess this is simulated is if clientY == pageY 9684 9685 if (e.clientY === e.pageY) { 9686 eventOffset = eventOffset + windowScroll; 9687 } 9688 9689 var eventFromBar = eventOffset - elemOffset; 9690 var barXY; 9691 9692 if (eventFromBar < 0) { 9693 barXY = 0; 9694 } else if (eventFromBar > barDim) { 9695 barXY = barDim; 9696 } else { 9697 barXY = eventFromBar; 9698 } 9699 9700 var offsetPct = percent(barXY, barDim); 9701 value = this._value(offsetPct); // turn everything around for RTL, yay math! 9702 9703 if (Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["rtl"])() && !this.options.vertical) { 9704 value = this.options.end - value; 9705 } 9706 9707 value = _this._adjustValue(null, value); //boolean flag for the setHandlePos fn, specifically for vertical sliders 9708 9709 hasVal = false; 9710 9711 if (!$handle) { 9712 //figure out which handle it is, pass it to the next function. 9713 var firstHndlPos = absPosition(this.$handle, direction, barXY, param), 9714 secndHndlPos = absPosition(this.$handle2, direction, barXY, param); 9715 $handle = firstHndlPos <= secndHndlPos ? this.$handle : this.$handle2; 9716 } 9717 } else { 9718 //change event on input 9719 value = this._adjustValue(null, val); 9720 hasVal = true; 9721 } 9722 9723 this._setHandlePos($handle, value); 9724 } 9725 /** 9726 * Adjustes value for handle in regard to step value. returns adjusted value 9727 * @function 9728 * @private 9729 * @param {jQuery} $handle - the selected handle. 9730 * @param {Number} value - value to adjust. used if $handle is falsy 9731 */ 9732 9733 }, { 9734 key: "_adjustValue", 9735 value: function _adjustValue($handle, value) { 9736 var val, 9737 step = this.options.step, 9738 div = parseFloat(step / 2), 9739 left, 9740 prev_val, 9741 next_val; 9742 9743 if (!!$handle) { 9744 val = parseFloat($handle.attr('aria-valuenow')); 9745 } else { 9746 val = value; 9747 } 9748 9749 if (val >= 0) { 9750 left = val % step; 9751 } else { 9752 left = step + val % step; 9753 } 9754 9755 prev_val = val - left; 9756 next_val = prev_val + step; 9757 9758 if (left === 0) { 9759 return val; 9760 } 9761 9762 val = val >= prev_val + div ? next_val : prev_val; 9763 return val; 9764 } 9765 /** 9766 * Adds event listeners to the slider elements. 9767 * @function 9768 * @private 9769 */ 9770 9771 }, { 9772 key: "_events", 9773 value: function _events() { 9774 this._eventsForHandle(this.$handle); 9775 9776 if (this.handles[1]) { 9777 this._eventsForHandle(this.$handle2); 9778 } 9779 } 9780 /** 9781 * Adds event listeners a particular handle 9782 * @function 9783 * @private 9784 * @param {jQuery} $handle - the current handle to apply listeners to. 9785 */ 9786 9787 }, { 9788 key: "_eventsForHandle", 9789 value: function _eventsForHandle($handle) { 9790 var _this = this, 9791 curHandle; 9792 9793 var handleChangeEvent = function handleChangeEvent(e) { 9794 var idx = _this.inputs.index(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)); 9795 9796 _this._handleEvent(e, _this.handles.eq(idx), jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).val()); 9797 }; // IE only triggers the change event when the input loses focus which strictly follows the HTML specification 9798 // listen for the enter key and trigger a change 9799 // @see https://html.spec.whatwg.org/multipage/input.html#common-input-element-events 9800 9801 9802 this.inputs.off('keyup.zf.slider').on('keyup.zf.slider', function (e) { 9803 if (e.keyCode == 13) handleChangeEvent.call(this, e); 9804 }); 9805 this.inputs.off('change.zf.slider').on('change.zf.slider', handleChangeEvent); 9806 9807 if (this.options.clickSelect) { 9808 this.$element.off('click.zf.slider').on('click.zf.slider', function (e) { 9809 if (_this.$element.data('dragging')) { 9810 return false; 9811 } 9812 9813 if (!jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).is('[data-slider-handle]')) { 9814 if (_this.options.doubleSided) { 9815 _this._handleEvent(e); 9816 } else { 9817 _this._handleEvent(e, _this.$handle); 9818 } 9819 } 9820 }); 9821 } 9822 9823 if (this.options.draggable) { 9824 this.handles.addTouch(); 9825 var $body = jquery__WEBPACK_IMPORTED_MODULE_0___default()('body'); 9826 $handle.off('mousedown.zf.slider').on('mousedown.zf.slider', function (e) { 9827 $handle.addClass('is-dragging'); 9828 9829 _this.$fill.addClass('is-dragging'); // 9830 9831 9832 _this.$element.data('dragging', true); 9833 9834 curHandle = jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.currentTarget); 9835 $body.on('mousemove.zf.slider', function (e) { 9836 e.preventDefault(); 9837 9838 _this._handleEvent(e, curHandle); 9839 }).on('mouseup.zf.slider', function (e) { 9840 _this._handleEvent(e, curHandle); 9841 9842 $handle.removeClass('is-dragging'); 9843 9844 _this.$fill.removeClass('is-dragging'); 9845 9846 _this.$element.data('dragging', false); 9847 9848 $body.off('mousemove.zf.slider mouseup.zf.slider'); 9849 }); 9850 }) // prevent events triggered by touch 9851 .on('selectstart.zf.slider touchmove.zf.slider', function (e) { 9852 e.preventDefault(); 9853 }); 9854 } 9855 9856 $handle.off('keydown.zf.slider').on('keydown.zf.slider', function (e) { 9857 var _$handle = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 9858 idx = _this.options.doubleSided ? _this.handles.index(_$handle) : 0, 9859 oldValue = parseFloat(_this.inputs.eq(idx).val()), 9860 newValue; // handle keyboard event with keyboard util 9861 9862 9863 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].handleKey(e, 'Slider', { 9864 decrease: function decrease() { 9865 newValue = oldValue - _this.options.step; 9866 }, 9867 increase: function increase() { 9868 newValue = oldValue + _this.options.step; 9869 }, 9870 decrease_fast: function decrease_fast() { 9871 newValue = oldValue - _this.options.step * 10; 9872 }, 9873 increase_fast: function increase_fast() { 9874 newValue = oldValue + _this.options.step * 10; 9875 }, 9876 min: function min() { 9877 newValue = _this.options.start; 9878 }, 9879 max: function max() { 9880 newValue = _this.options.end; 9881 }, 9882 handled: function handled() { 9883 // only set handle pos when event was handled specially 9884 e.preventDefault(); 9885 9886 _this._setHandlePos(_$handle, newValue); 9887 } 9888 }); 9889 /*if (newValue) { // if pressed key has special function, update value 9890 e.preventDefault(); 9891 _this._setHandlePos(_$handle, newValue); 9892 }*/ 9893 }); 9894 } 9895 /** 9896 * Destroys the slider plugin. 9897 */ 9898 9899 }, { 9900 key: "_destroy", 9901 value: function _destroy() { 9902 this.handles.off('.zf.slider'); 9903 this.inputs.off('.zf.slider'); 9904 this.$element.off('.zf.slider'); 9905 clearTimeout(this.timeout); 9906 } 9907 }]); 9908 9909 return Slider; 9910}
9910(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__["Plugin"]); 9911 9912Slider.defaults = { 9913 /** 9914 * Minimum value for the slider scale. 9915 * @option 9916 * @type {number} 9917 * @default 0 9918 */ 9919 start: 0, 9920 9921 /** 9922 * Maximum value for the slider scale. 9923 * @option 9924 * @type {number} 9925 * @default 100 9926 */ 9927 end: 100, 9928 9929 /** 9930 * Minimum value change per change event. 9931 * @option 9932 * @type {number} 9933 * @default 1 9934 */ 9935 step: 1, 9936 9937 /** 9938 * Value at which the handle/input *(left handle/first input)* should be set to on initialization. 9939 * @option 9940 * @type {number} 9941 * @default 0 9942 */ 9943 initialStart: 0, 9944 9945 /** 9946 * Value at which the right handle/second input should be set to on initialization. 9947 * @option 9948 * @type {number} 9949 * @default 100 9950 */ 9951 initialEnd: 100, 9952 9953 /** 9954 * Allows the input to be located outside the container and visible. Set to by the JS 9955 * @option 9956 * @type {boolean} 9957 * @default false 9958 */ 9959 binding: false, 9960 9961 /** 9962 * Allows the user to click/tap on the slider bar to select a value. 9963 * @option 9964 * @type {boolean} 9965 * @default true 9966 */ 9967 clickSelect: true, 9968 9969 /** 9970 * Set to true and use the `vertical` class to change alignment to vertical. 9971 * @option 9972 * @type {boolean} 9973 * @default false 9974 */ 9975 vertical: false, 9976 9977 /** 9978 * Allows the user to drag the slider handle(s) to select a value. 9979 * @option 9980 * @type {boolean} 9981 * @default true 9982 */ 9983 draggable: true, 9984 9985 /** 9986 * Disables the slider and prevents event listeners from being applied. Double checked by JS with `disabledClass`. 9987 * @option 9988 * @type {boolean} 9989 * @default false 9990 */ 9991 disabled: false, 9992 9993 /** 9994 * Allows the use of two handles. Double checked by the JS. Changes some logic handling. 9995 * @option 9996 * @type {boolean} 9997 * @default false 9998 */ 9999 doubleSided: false, 10000 10001 /** 10002 * Potential future feature. 10003 */ 10004 // steps: 100, 10005 10006 /** 10007 * Number of decimal places the plugin should go to for floating point precision. 10008 * @option 10009 * @type {number} 10010 * @default 2 10011 */ 10012 decimal: 2, 10013 10014 /** 10015 * Time delay for dragged elements. 10016 */ 10017 // dragDelay: 0, 10018 10019 /** 10020 * 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. 10021 * @option 10022 * @type {number} 10023 * @default 200 10024 */ 10025 moveTime: 200, 10026 //update this if changing the transition time in the sass 10027 10028 /** 10029 * Class applied to disabled sliders. 10030 * @option 10031 * @type {string} 10032 * @default 'disabled' 10033 */ 10034 disabledClass: 'disabled', 10035 10036 /** 10037 * Will invert the default layout for a vertical<span data-tooltip title="who would do this???"> </span>slider. 10038 * @option 10039 * @type {boolean} 10040 * @default false 10041 */ 10042 invertVertical: false, 10043 10044 /** 10045 * Milliseconds before the `changed.zf-slider` event is triggered after value change. 10046 * @option 10047 * @type {number} 10048 * @default 500 10049 */ 10050 changedDelay: 500, 10051 10052 /** 10053 * Basevalue for non-linear sliders 10054 * @option 10055 * @type {number} 10056 * @default 5 10057 */ 10058 nonLinearBase: 5, 10059 10060 /** 10061 * Basevalue for non-linear sliders, possible values are: `'linear'`, `'pow'` & `'log'`. Pow and Log use the nonLinearBase setting. 10062 * @option 10063 * @type {string} 10064 * @default 'linear' 10065 */ 10066 positionValueFunction: 'linear' 10067}; 10068 10069function percent(frac, num) { 10070 return frac / num; 10071} 10072 10073function absPosition($handle, dir, clickPos, param) { 10074 return Math.abs($handle.position()[dir] + $handle[param]() / 2 - clickPos); 10075} 10076 10077function baseLog(base, value) { 10078 return Math.log(value) / Math.log(base); 10079} 10080 10081 10082 10083/***/ }), 10084
10085/***/ "./js/foundation.smoothScroll.js": 10086/*!***************************************!*\ 10087 !*** ./js/foundation.smoothScroll.js ***! 10088 \***************************************/ 10089/*! exports provided: SmoothScroll */ 10090/***/ (function(module, __webpack_exports__, __webpack_require__) { 10091 10092"use strict"; 10093__webpack_require__.r(__webpack_exports__); 10094/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SmoothScroll", function() { return SmoothScroll; }); 10095/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 10096/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 10097/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 10098/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 10099function _typeof(obj) { 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); } 10100 10101function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 10102 10103function _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); } } 10104 10105function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 10106 10107function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 10108 10109function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 10110 10111function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 10112 10113function _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); } 10114 10115function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 10116 10117 10118 10119 10120/** 10121 * SmoothScroll module. 10122 * @module foundation.smoothScroll 10123 */ 10124 10125var SmoothScroll = 10126/*#__PURE__*/ 10127function (_Plugin) { 10128 _inherits(SmoothScroll, _Plugin); 10129 10130 function SmoothScroll() { 10131 _classCallCheck(this, SmoothScroll); 10132 10133 return _possibleConstructorReturn(this, _getPrototypeOf(SmoothScroll).apply(this, arguments)); 10134 } 10135 10136 _createClass(SmoothScroll, [{ 10137 key: "_setup", 10138 10139 /** 10140 * Creates a new instance of SmoothScroll. 10141 * @class 10142 * @name SmoothScroll 10143 * @fires SmoothScroll#init 10144 * @param {Object} element - jQuery object to add the trigger to. 10145 * @param {Object} options - Overrides to the default plugin settings. 10146 */ 10147 value: function _setup(element, options) { 10148 this.$element = element; 10149 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, SmoothScroll.defaults, this.$element.data(), options); 10150 this.className = 'SmoothScroll'; // ie9 back compat 10151 10152 this._init(); 10153 } 10154 /** 10155 * Initialize the SmoothScroll plugin 10156 * @private 10157 */ 10158 10159 }, { 10160 key: "_init", 10161 value: function _init() { 10162 var id = this.$element[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["GetYoDigits"])(6, 'smooth-scroll'); 10163 this.$element.attr({ 10164 id: id 10165 }); 10166 10167 this._events(); 10168 } 10169 /** 10170 * Initializes events for SmoothScroll. 10171 * @private 10172 */ 10173 10174 }, { 10175 key: "_events", 10176 value: function _events() { 10177 this._linkClickListener = this._handleLinkClick.bind(this); 10178 this.$element.on('click.zf.smoothScroll', this._linkClickListener); 10179 this.$element.on('click.zf.smoothScroll', 'a[href^="#"]', this._linkClickListener); 10180 } 10181 /**
vendor: 3,000 bytes, lines 10182-10285
10182 * Handle the given event to smoothly scroll to the anchor pointed by the event target. 10183 * @param {*} e - event 10184 * @function 10185 * @private 10186 */ 10187 10188 }, { 10189 key: "_handleLinkClick", 10190 value: function _handleLinkClick(e) { 10191 var _this = this; 10192 10193 // Follow the link if it does not point to an anchor. 10194 if (!jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.currentTarget).is('a[href^="#"]')) return; 10195 var arrival = e.currentTarget.getAttribute('href'); 10196 this._inTransition = true; 10197 SmoothScroll.scrollToLoc(arrival, this.options, function () { 10198 _this._inTransition = false; 10199 }); 10200 e.preventDefault(); 10201 } 10202 }, { 10203 key: "_destroy", 10204 10205 /** 10206 * Destroys the SmoothScroll instance. 10207 * @function 10208 */ 10209 value: function _destroy() { 10210 this.$element.off('click.zf.smoothScroll', this._linkClickListener); 10211 this.$element.off('click.zf.smoothScroll', 'a[href^="#"]', this._linkClickListener); 10212 } 10213 }], [{ 10214 key: "scrollToLoc", 10215 10216 /** 10217 * Function to scroll to a given location on the page. 10218 * @param {String} loc - A properly formatted jQuery id selector. Example: '#foo' 10219 * @param {Object} options - The options to use. 10220 * @param {Function} callback - The callback function. 10221 * @static 10222 * @function 10223 */ 10224 value: function scrollToLoc(loc) { 10225 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : SmoothScroll.defaults; 10226 var callback = arguments.length > 2 ? arguments[2] : undefined; 10227 var $loc = jquery__WEBPACK_IMPORTED_MODULE_0___default()(loc); // Do nothing if target does not exist to prevent errors 10228 10229 if (!$loc.length) return false; 10230 var scrollPos = Math.round($loc.offset().top - options.threshold / 2 - options.offset); 10231 jquery__WEBPACK_IMPORTED_MODULE_0___default()('html, body').stop(true).animate({ 10232 scrollTop: scrollPos 10233 }, options.animationDuration, options.animationEasing, function () { 10234 if (typeof callback === 'function') { 10235 callback(); 10236 } 10237 }); 10238 } 10239 }]); 10240 10241 return SmoothScroll; 10242}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__["Plugin"]); 10243/** 10244 * Default settings for plugin. 10245 */ 10246 10247 10248SmoothScroll.defaults = { 10249 /** 10250 * Amount of time, in ms, the animated scrolling should take between locations. 10251 * @option 10252 * @type {number} 10253 * @default 500 10254 */ 10255 animationDuration: 500, 10256 10257 /** 10258 * Animation style to use when scrolling between locations. Can be `'swing'` or `'linear'`. 10259 * @option 10260 * @type {string} 10261 * @default 'linear' 10262 * @see {@link https://api.jquery.com/animate|Jquery animate} 10263 */ 10264 animationEasing: 'linear', 10265 10266 /** 10267 * Number of pixels to use as a marker for location changes. 10268 * @option 10269 * @type {number} 10270 * @default 50 10271 */ 10272 threshold: 50, 10273 10274 /** 10275 * Number of pixels to offset the scroll of the page on item click if using a sticky nav bar. 10276 * @option 10277 * @type {number} 10278 * @default 0 10279 */ 10280 offset: 0 10281}; 10282 10283 10284/***/ }), 10285
10286/***/ "./js/foundation.sticky.js": 10287/*!*********************************!*\ 10288 !*** ./js/foundation.sticky.js ***! 10289 \*********************************/ 10290/*! exports provided: Sticky */ 10291/***/ (function(module, __webpack_exports__, __webpack_require__) { 10292 10293"use strict"; 10294__webpack_require__.r(__webpack_exports__); 10295/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Sticky", function() { return Sticky; }); 10296/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 10297/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 10298/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 10299/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 10300/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js"); 10301/* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js"); 10302 10303 10304function _typeof(obj) { 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); } 10305 10306function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 10307 10308function _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); } } 10309 10310function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 10311 10312function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 10313 10314function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 10315 10316function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 10317 10318function _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); } 10319 10320function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 10321 10322 10323 10324 10325 10326 10327/** 10328 * Sticky module. 10329 * @module foundation.sticky 10330 * @requires foundation.util.triggers 10331 * @requires foundation.util.mediaQuery 10332 */ 10333 10334var Sticky = 10335/*#__PURE__*/ 10336function (_Plugin) { 10337 _inherits(Sticky, _Plugin); 10338 10339 function Sticky() { 10340 _classCallCheck(this, Sticky); 10341 10342 return _possibleConstructorReturn(this, _getPrototypeOf(Sticky).apply(this, arguments)); 10343 } 10344 10345 _createClass(Sticky, [{ 10346 key: "_setup", 10347 10348 /** 10349 * Creates a new instance of a sticky thing. 10350 * @class 10351 * @name Sticky 10352 * @param {jQuery} element - jQuery object to make sticky. 10353 * @param {Object} options - options object passed when creating the element programmatically. 10354 */ 10355 value: function _setup(element, options) { 10356 this.$element = element; 10357 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Sticky.defaults, this.$element.data(), options); 10358 this.className = 'Sticky'; // ie9 back compat 10359 // Triggers init is idempotent, just need to make sure it is initialized 10360 10361 _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 10362 10363 this._init(); 10364 } 10365 /** 10366 * Initializes the sticky element by adding classes, getting/setting dimensions, breakpoints and attributes 10367 * @function 10368 * @private 10369 */ 10370 10371 }, { 10372 key: "_init", 10373 value: function _init() { 10374 _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_3__["MediaQuery"]._init(); 10375 10376 var $parent = this.$element.parent('[data-sticky-container]'), 10377 id = this.$element[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'sticky'), 10378 _this = this; 10379 10380 if ($parent.length) { 10381 this.$container = $parent; 10382 } else { 10383 this.wasWrapped = true; 10384 this.$element.wrap(this.options.container); 10385 this.$container = this.$element.parent(); 10386 } 10387 10388 this.$container.addClass(this.options.containerClass); 10389 this.$element.addClass(this.options.stickyClass).attr({ 10390 'data-resize': id, 10391 'data-mutate': id 10392 }); 10393 10394 if (this.options.anchor !== '') { 10395 jquery__WEBPACK_IMPORTED_MODULE_0___default()('#' + _this.options.anchor).attr({ 10396 'data-mutate': id 10397 }); 10398 } 10399 10400 this.scrollCount = this.options.checkEvery; 10401 this.isStuck = false;
vendor: 4,371 bytes, lines 10402-10544
10402 this.onLoadListener = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () { 10403 //We calculate the container height to have correct values for anchor points offset calculation. 10404 _this.containerHeight = _this.$element.css("display") == "none" ? 0 : _this.$element[0].getBoundingClientRect().height; 10405 10406 _this.$container.css('height', _this.containerHeight); 10407 10408 _this.elemHeight = _this.containerHeight; 10409 10410 if (_this.options.anchor !== '') { 10411 _this.$anchor = jquery__WEBPACK_IMPORTED_MODULE_0___default()('#' + _this.options.anchor); 10412 } else { 10413 _this._parsePoints(); 10414 } 10415 10416 _this._setSizes(function () { 10417 var scroll = window.pageYOffset; 10418 10419 _this._calc(false, scroll); //Unstick the element will ensure that proper classes are set. 10420 10421 10422 if (!_this.isStuck) { 10423 _this._removeSticky(scroll >= _this.topPoint ? false : true); 10424 } 10425 }); 10426 10427 _this._events(id.split('-').reverse().join('-')); 10428 }); 10429 } 10430 /** 10431 * If using multiple elements as anchors, calculates the top and bottom pixel values the sticky thing should stick and unstick on. 10432 * @function 10433 * @private 10434 */ 10435 10436 }, { 10437 key: "_parsePoints", 10438 value: function _parsePoints() { 10439 var top = this.options.topAnchor == "" ? 1 : this.options.topAnchor, 10440 btm = this.options.btmAnchor == "" ? document.documentElement.scrollHeight : this.options.btmAnchor, 10441 pts = [top, btm], 10442 breaks = {}; 10443 10444 for (var i = 0, len = pts.length; i < len && pts[i]; i++) { 10445 var pt; 10446 10447 if (typeof pts[i] === 'number') { 10448 pt = pts[i]; 10449 } else { 10450 var place = pts[i].split(':'), 10451 anchor = jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(place[0])); 10452 pt = anchor.offset().top; 10453 10454 if (place[1] && place[1].toLowerCase() === 'bottom') { 10455 pt += anchor[0].getBoundingClientRect().height; 10456 } 10457 } 10458 10459 breaks[i] = pt; 10460 } 10461 10462 this.points = breaks; 10463 return; 10464 } 10465 /** 10466 * Adds event handlers for the scrolling element. 10467 * @private 10468 * @param {String} id - pseudo-random id for unique scroll event listener. 10469 */ 10470 10471 }, { 10472 key: "_events", 10473 value: function _events(id) { 10474 var _this = this, 10475 scrollListener = this.scrollListener = "scroll.zf.".concat(id); 10476 10477 if (this.isOn) { 10478 return; 10479 } 10480 10481 if (this.canStick) { 10482 this.isOn = true; 10483 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(scrollListener).on(scrollListener, function (e) { 10484 if (_this.scrollCount === 0) { 10485 _this.scrollCount = _this.options.checkEvery; 10486 10487 _this._setSizes(function () { 10488 _this._calc(false, window.pageYOffset); 10489 }); 10490 } else { 10491 _this.scrollCount--; 10492 10493 _this._calc(false, window.pageYOffset); 10494 } 10495 }); 10496 } 10497 10498 this.$element.off('resizeme.zf.trigger').on('resizeme.zf.trigger', function (e, el) { 10499 _this._eventsHandler(id); 10500 }); 10501 this.$element.on('mutateme.zf.trigger', function (e, el) { 10502 _this._eventsHandler(id); 10503 }); 10504 10505 if (this.$anchor) { 10506 this.$anchor.on('mutateme.zf.trigger', function (e, el) { 10507 _this._eventsHandler(id); 10508 }); 10509 } 10510 } 10511 /** 10512 * Handler for events. 10513 * @private 10514 * @param {String} id - pseudo-random id for unique scroll event listener. 10515 */ 10516 10517 }, { 10518 key: "_eventsHandler", 10519 value: function _eventsHandler(id) { 10520 var _this = this, 10521 scrollListener = this.scrollListener = "scroll.zf.".concat(id); 10522 10523 _this._setSizes(function () { 10524 _this._calc(false); 10525 10526 if (_this.canStick) { 10527 if (!_this.isOn) { 10528 _this._events(id); 10529 } 10530 } else if (_this.isOn) { 10531 _this._pauseListeners(scrollListener); 10532 } 10533 }); 10534 } 10535 /** 10536 * Removes event handlers for scroll and change events on anchor. 10537 * @fires Sticky#pause 10538 * @param {String} scrollListener - unique, namespaced scroll listener attached to `window` 10539 */ 10540 10541 }, { 10542 key: "_pauseListeners", 10543 value: function _pauseListeners(scrollListener) { 10544 this.isOn = false;
vendor: 5,605 bytes, lines 10545-10710
10545 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(scrollListener); 10546 /** 10547 * Fires when the plugin is paused due to resize event shrinking the view. 10548 * @event Sticky#pause 10549 * @private 10550 */ 10551 10552 this.$element.trigger('pause.zf.sticky'); 10553 } 10554 /** 10555 * Called on every `scroll` event and on `_init` 10556 * fires functions based on booleans and cached values 10557 * @param {Boolean} checkSizes - true if plugin should recalculate sizes and breakpoints. 10558 * @param {Number} scroll - current scroll position passed from scroll event cb function. If not passed, defaults to `window.pageYOffset`. 10559 */ 10560 10561 }, { 10562 key: "_calc", 10563 value: function _calc(checkSizes, scroll) { 10564 if (checkSizes) { 10565 this._setSizes(); 10566 } 10567 10568 if (!this.canStick) { 10569 if (this.isStuck) { 10570 this._removeSticky(true); 10571 } 10572 10573 return false; 10574 } 10575 10576 if (!scroll) { 10577 scroll = window.pageYOffset; 10578 } 10579 10580 if (scroll >= this.topPoint) { 10581 if (scroll <= this.bottomPoint) { 10582 if (!this.isStuck) { 10583 this._setSticky(); 10584 } 10585 } else { 10586 if (this.isStuck) { 10587 this._removeSticky(false); 10588 } 10589 } 10590 } else { 10591 if (this.isStuck) { 10592 this._removeSticky(true); 10593 } 10594 } 10595 } 10596 /** 10597 * Causes the $element to become stuck. 10598 * Adds `position: fixed;`, and helper classes. 10599 * @fires Sticky#stuckto 10600 * @function 10601 * @private 10602 */ 10603 10604 }, { 10605 key: "_setSticky", 10606 value: function _setSticky() { 10607 var _this = this, 10608 stickTo = this.options.stickTo, 10609 mrgn = stickTo === 'top' ? 'marginTop' : 'marginBottom', 10610 notStuckTo = stickTo === 'top' ? 'bottom' : 'top', 10611 css = {}; 10612 10613 css[mrgn] = "".concat(this.options[mrgn], "em"); 10614 css[stickTo] = 0; 10615 css[notStuckTo] = 'auto'; 10616 this.isStuck = true; 10617 this.$element.removeClass("is-anchored is-at-".concat(notStuckTo)).addClass("is-stuck is-at-".concat(stickTo)).css(css) 10618 /** 10619 * Fires when the $element has become `position: fixed;` 10620 * Namespaced to `top` or `bottom`, e.g. `sticky.zf.stuckto:top` 10621 * @event Sticky#stuckto 10622 */ 10623 .trigger("sticky.zf.stuckto:".concat(stickTo)); 10624 this.$element.on("transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd", function () { 10625 _this._setSizes(); 10626 }); 10627 } 10628 /** 10629 * Causes the $element to become unstuck. 10630 * Removes `position: fixed;`, and helper classes. 10631 * Adds other helper classes. 10632 * @param {Boolean} isTop - tells the function if the $element should anchor to the top or bottom of its $anchor element. 10633 * @fires Sticky#unstuckfrom 10634 * @private 10635 */ 10636 10637 }, { 10638 key: "_removeSticky", 10639 value: function _removeSticky(isTop) { 10640 var stickTo = this.options.stickTo, 10641 stickToTop = stickTo === 'top', 10642 css = {}, 10643 anchorPt = (this.points ? this.points[1] - this.points[0] : this.anchorHeight) - this.elemHeight, 10644 mrgn = stickToTop ? 'marginTop' : 'marginBottom', 10645 topOrBottom = isTop ? 'top' : 'bottom'; 10646 css[mrgn] = 0; 10647 css['bottom'] = 'auto'; 10648 10649 if (isTop) { 10650 css['top'] = 0; 10651 } else { 10652 css['top'] = anchorPt; 10653 } 10654 10655 this.isStuck = false; 10656 this.$element.removeClass("is-stuck is-at-".concat(stickTo)).addClass("is-anchored is-at-".concat(topOrBottom)).css(css) 10657 /** 10658 * Fires when the $element has become anchored. 10659 * Namespaced to `top` or `bottom`, e.g. `sticky.zf.unstuckfrom:bottom` 10660 * @event Sticky#unstuckfrom 10661 */ 10662 .trigger("sticky.zf.unstuckfrom:".concat(topOrBottom)); 10663 } 10664 /** 10665 * Sets the $element and $container sizes for plugin. 10666 * Calls `_setBreakPoints`. 10667 * @param {Function} cb - optional callback function to fire on completion of `_setBreakPoints`. 10668 * @private 10669 */ 10670 10671 }, { 10672 key: "_setSizes", 10673 value: function _setSizes(cb) { 10674 this.canStick = _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_3__["MediaQuery"].is(this.options.stickyOn); 10675 10676 if (!this.canStick) { 10677 if (cb && typeof cb === 'function') { 10678 cb(); 10679 } 10680 } 10681 10682 var _this = this, 10683 newElemWidth = this.$container[0].getBoundingClientRect().width, 10684 comp = window.getComputedStyle(this.$container[0]), 10685 pdngl = parseInt(comp['padding-left'], 10), 10686 pdngr = parseInt(comp['padding-right'], 10); 10687 10688 if (this.$anchor && this.$anchor.length) { 10689 this.anchorHeight = this.$anchor[0].getBoundingClientRect().height; 10690 } else { 10691 this._parsePoints(); 10692 } 10693 10694 this.$element.css({ 10695 'max-width': "".concat(newElemWidth - pdngl - pdngr, "px") 10696 }); // Recalculate the height only if it is "dynamic" 10697 10698 if (this.options.dynamicHeight || !this.containerHeight) { 10699 // Get the sticked element height and apply it to the container to "hold the place" 10700 var newContainerHeight = this.$element[0].getBoundingClientRect().height || this.containerHeight; 10701 newContainerHeight = this.$element.css("display") == "none" ? 0 : newContainerHeight; 10702 this.$container.css('height', newContainerHeight); 10703 this.containerHeight = newContainerHeight; 10704 } 10705 10706 this.elemHeight = this.containerHeight; 10707 10708 if (!this.isStuck) { 10709 if (this.$element.hasClass('is-at-bottom')) { 10710 var anchorPt = (this.points ? this.points[1] - this.$container.offset().top : this.anchorHeight) - this.elemHeight;
vendor: 5,425 bytes, lines 10711-10911
10711 this.$element.css('top', anchorPt); 10712 } 10713 } 10714 10715 this._setBreakPoints(this.containerHeight, function () { 10716 if (cb && typeof cb === 'function') { 10717 cb(); 10718 } 10719 }); 10720 } 10721 /** 10722 * Sets the upper and lower breakpoints for the element to become sticky/unsticky. 10723 * @param {Number} elemHeight - px value for sticky.$element height, calculated by `_setSizes`. 10724 * @param {Function} cb - optional callback function to be called on completion. 10725 * @private 10726 */ 10727 10728 }, { 10729 key: "_setBreakPoints", 10730 value: function _setBreakPoints(elemHeight, cb) { 10731 if (!this.canStick) { 10732 if (cb && typeof cb === 'function') { 10733 cb(); 10734 } else { 10735 return false; 10736 } 10737 } 10738 10739 var mTop = emCalc(this.options.marginTop), 10740 mBtm = emCalc(this.options.marginBottom), 10741 topPoint = this.points ? this.points[0] : this.$anchor.offset().top, 10742 bottomPoint = this.points ? this.points[1] : topPoint + this.anchorHeight, 10743 // topPoint = this.$anchor.offset().top || this.points[0], 10744 // bottomPoint = topPoint + this.anchorHeight || this.points[1], 10745 winHeight = window.innerHeight; 10746 10747 if (this.options.stickTo === 'top') { 10748 topPoint -= mTop; 10749 bottomPoint -= elemHeight + mTop; 10750 } else if (this.options.stickTo === 'bottom') { 10751 topPoint -= winHeight - (elemHeight + mBtm); 10752 bottomPoint -= winHeight - mBtm; 10753 } else {//this would be the stickTo: both option... tricky 10754 } 10755 10756 this.topPoint = topPoint; 10757 this.bottomPoint = bottomPoint; 10758 10759 if (cb && typeof cb === 'function') { 10760 cb(); 10761 } 10762 } 10763 /** 10764 * Destroys the current sticky element. 10765 * Resets the element to the top position first. 10766 * Removes event listeners, JS-added css properties and classes, and unwraps the $element if the JS added the $container. 10767 * @function 10768 */ 10769 10770 }, { 10771 key: "_destroy", 10772 value: function _destroy() { 10773 this._removeSticky(true); 10774 10775 this.$element.removeClass("".concat(this.options.stickyClass, " is-anchored is-at-top")).css({ 10776 height: '', 10777 top: '', 10778 bottom: '', 10779 'max-width': '' 10780 }).off('resizeme.zf.trigger').off('mutateme.zf.trigger'); 10781 10782 if (this.$anchor && this.$anchor.length) { 10783 this.$anchor.off('change.zf.sticky'); 10784 } 10785 10786 if (this.scrollListener) jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(this.scrollListener); 10787 if (this.onLoadListener) jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(this.onLoadListener); 10788 10789 if (this.wasWrapped) { 10790 this.$element.unwrap(); 10791 } else { 10792 this.$container.removeClass(this.options.containerClass).css({ 10793 height: '' 10794 }); 10795 } 10796 } 10797 }]); 10798 10799 return Sticky; 10800}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]); 10801 10802Sticky.defaults = { 10803 /** 10804 * Customizable container template. Add your own classes for styling and sizing. 10805 * @option 10806 * @type {string} 10807 * @default '<div data-sticky-container></div>' 10808 */ 10809 container: '<div data-sticky-container></div>', 10810 10811 /** 10812 * Location in the view the element sticks to. Can be `'top'` or `'bottom'`. 10813 * @option 10814 * @type {string} 10815 * @default 'top' 10816 */ 10817 stickTo: 'top', 10818 10819 /** 10820 * If anchored to a single element, the id of that element. 10821 * @option 10822 * @type {string} 10823 * @default '' 10824 */ 10825 anchor: '', 10826 10827 /** 10828 * If using more than one element as anchor points, the id of the top anchor. 10829 * @option 10830 * @type {string} 10831 * @default '' 10832 */ 10833 topAnchor: '', 10834 10835 /** 10836 * If using more than one element as anchor points, the id of the bottom anchor. 10837 * @option 10838 * @type {string} 10839 * @default '' 10840 */ 10841 btmAnchor: '', 10842 10843 /** 10844 * Margin, in `em`'s to apply to the top of the element when it becomes sticky. 10845 * @option 10846 * @type {number} 10847 * @default 1 10848 */ 10849 marginTop: 1, 10850 10851 /** 10852 * Margin, in `em`'s to apply to the bottom of the element when it becomes sticky. 10853 * @option 10854 * @type {number} 10855 * @default 1 10856 */ 10857 marginBottom: 1, 10858 10859 /** 10860 * Breakpoint string that is the minimum screen size an element should become sticky. 10861 * @option 10862 * @type {string} 10863 * @default 'medium' 10864 */ 10865 stickyOn: 'medium', 10866 10867 /** 10868 * Class applied to sticky element, and removed on destruction. Foundation defaults to `sticky`. 10869 * @option 10870 * @type {string} 10871 * @default 'sticky' 10872 */ 10873 stickyClass: 'sticky', 10874 10875 /** 10876 * Class applied to sticky container. Foundation defaults to `sticky-container`. 10877 * @option 10878 * @type {string} 10879 * @default 'sticky-container' 10880 */ 10881 containerClass: 'sticky-container', 10882 10883 /** 10884 * 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. 10885 * @option 10886 * @type {boolean} 10887 * @default true 10888 */ 10889 dynamicHeight: true, 10890 10891 /** 10892 * 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. 10893 * @option 10894 * @type {number} 10895 * @default -1 10896 */ 10897 checkEvery: -1 10898}; 10899/** 10900 * Helper function to calculate em values 10901 * @param Number {em} - number of em's to calculate into pixels 10902 */ 10903 10904function emCalc(em) { 10905 return parseInt(window.getComputedStyle(document.body, null).fontSize, 10) * em; 10906} 10907 10908 10909 10910/***/ }), 10911
vendor: 4,606 bytes, lines 10912-10991
10912/***/ "./js/foundation.tabs.js": 10913/*!*******************************!*\ 10914 !*** ./js/foundation.tabs.js ***! 10915 \*******************************/ 10916/*! exports provided: Tabs */ 10917/***/ (function(module, __webpack_exports__, __webpack_require__) { 10918 10919"use strict"; 10920__webpack_require__.r(__webpack_exports__); 10921/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Tabs", function() { return Tabs; }); 10922/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 10923/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 10924/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 10925/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 10926/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js"); 10927/* harmony import */ var _foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.imageLoader */ "./js/foundation.util.imageLoader.js"); 10928 10929 10930function _typeof(obj) { 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); } 10931 10932function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 10933 10934function _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); } } 10935 10936function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 10937 10938function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 10939 10940function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 10941 10942function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 10943 10944function _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); } 10945 10946function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 10947 10948 10949 10950 10951 10952 10953/** 10954 * Tabs module. 10955 * @module foundation.tabs 10956 * @requires foundation.util.keyboard 10957 * @requires foundation.util.imageLoader if tabs contain images 10958 */ 10959 10960var Tabs = 10961/*#__PURE__*/ 10962function (_Plugin) { 10963 _inherits(Tabs, _Plugin); 10964 10965 function Tabs() { 10966 _classCallCheck(this, Tabs); 10967 10968 return _possibleConstructorReturn(this, _getPrototypeOf(Tabs).apply(this, arguments)); 10969 } 10970 10971 _createClass(Tabs, [{ 10972 key: "_setup", 10973 10974 /** 10975 * Creates a new instance of tabs. 10976 * @class 10977 * @name Tabs 10978 * @fires Tabs#init 10979 * @param {jQuery} element - jQuery object to make into tabs. 10980 * @param {Object} options - Overrides to the default plugin settings. 10981 */ 10982 value: function _setup(element, options) { 10983 this.$element = element; 10984 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Tabs.defaults, this.$element.data(), options); 10985 this.className = 'Tabs'; // ie9 back compat 10986 10987 this._init(); 10988 10989 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].register('Tabs', { 10990 'ENTER': 'open', 10991 'SPACE': 'open',
vendor: 13,897 bytes, lines 10992-11417
10992 'ARROW_RIGHT': 'next', 10993 'ARROW_UP': 'previous', 10994 'ARROW_DOWN': 'next', 10995 'ARROW_LEFT': 'previous' // 'TAB': 'next', 10996 // 'SHIFT_TAB': 'previous' 10997 10998 }); 10999 } 11000 /** 11001 * Initializes the tabs by showing and focusing (if autoFocus=true) the preset active tab. 11002 * @private 11003 */ 11004 11005 }, { 11006 key: "_init", 11007 value: function _init() { 11008 var _this2 = this; 11009 11010 var _this = this; 11011 11012 this._isInitializing = true; 11013 this.$element.attr({ 11014 'role': 'tablist' 11015 }); 11016 this.$tabTitles = this.$element.find(".".concat(this.options.linkClass)); 11017 this.$tabContent = jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-tabs-content=\"".concat(this.$element[0].id, "\"]")); 11018 this.$tabTitles.each(function () { 11019 var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 11020 $link = $elem.find('a'), 11021 isActive = $elem.hasClass("".concat(_this.options.linkActiveClass)), 11022 hash = $link.attr('data-tabs-target') || $link[0].hash.slice(1), 11023 linkId = $link[0].id ? $link[0].id : "".concat(hash, "-label"), 11024 $tabContent = jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(hash)); 11025 $elem.attr({ 11026 'role': 'presentation' 11027 }); 11028 $link.attr({ 11029 'role': 'tab', 11030 'aria-controls': hash, 11031 'aria-selected': isActive, 11032 'id': linkId, 11033 'tabindex': isActive ? '0' : '-1' 11034 }); 11035 $tabContent.attr({ 11036 'role': 'tabpanel', 11037 'aria-labelledby': linkId 11038 }); // Save up the initial hash to return to it later when going back in history 11039 11040 if (isActive) { 11041 _this._initialAnchor = "#".concat(hash); 11042 } 11043 11044 if (!isActive) { 11045 $tabContent.attr('aria-hidden', 'true'); 11046 } 11047 11048 if (isActive && _this.options.autoFocus) { 11049 _this.onLoadListener = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () { 11050 jquery__WEBPACK_IMPORTED_MODULE_0___default()('html, body').animate({ 11051 scrollTop: $elem.offset().top 11052 }, _this.options.deepLinkSmudgeDelay, function () { 11053 $link.focus(); 11054 }); 11055 }); 11056 } 11057 }); 11058 11059 if (this.options.matchHeight) { 11060 var $images = this.$tabContent.find('img'); 11061 11062 if ($images.length) { 11063 Object(_foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_4__["onImagesLoaded"])($images, this._setHeight.bind(this)); 11064 } else { 11065 this._setHeight(); 11066 } 11067 } // Current context-bound function to open tabs on page load or history hashchange 11068 11069 11070 this._checkDeepLink = function () { 11071 var anchor = window.location.hash; 11072 11073 if (!anchor.length) { 11074 // If we are still initializing and there is no anchor, then there is nothing to do 11075 if (_this2._isInitializing) return; // Otherwise, move to the initial anchor 11076 11077 if (_this2._initialAnchor) anchor = _this2._initialAnchor; 11078 } 11079 11080 var anchorNoHash = anchor.indexOf('#') >= 0 ? anchor.slice(1) : anchor; 11081 var $anchor = anchorNoHash && jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(anchorNoHash)); 11082 11083 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 11084 11085 11086 var isOwnAnchor = !!($anchor.length && $link.length); 11087 11088 if (isOwnAnchor) { 11089 // If there is an anchor for the hash, select it 11090 if ($anchor && $anchor.length && $link && $link.length) { 11091 _this2.selectTab($anchor, true); 11092 } // Otherwise, collapse everything 11093 else { 11094 _this2._collapse(); 11095 } // Roll up a little to show the titles 11096 11097 11098 if (_this2.options.deepLinkSmudge) { 11099 var offset = _this2.$element.offset(); 11100 11101 jquery__WEBPACK_IMPORTED_MODULE_0___default()('html, body').animate({ 11102 scrollTop: offset.top 11103 }, _this2.options.deepLinkSmudgeDelay); 11104 } 11105 /** 11106 * Fires when the plugin has deeplinked at pageload 11107 * @event Tabs#deeplink 11108 */ 11109 11110 11111 _this2.$element.trigger('deeplink.zf.tabs', [$link, $anchor]); 11112 } 11113 }; //use browser to open a tab, if it exists in this tabset 11114 11115 11116 if (this.options.deepLink) { 11117 this._checkDeepLink(); 11118 } 11119 11120 this._events(); 11121 11122 this._isInitializing = false; 11123 } 11124 /** 11125 * Adds event handlers for items within the tabs. 11126 * @private 11127 */ 11128 11129 }, { 11130 key: "_events", 11131 value: function _events() { 11132 this._addKeyHandler(); 11133 11134 this._addClickHandler(); 11135 11136 this._setHeightMqHandler = null; 11137 11138 if (this.options.matchHeight) { 11139 this._setHeightMqHandler = this._setHeight.bind(this); 11140 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', this._setHeightMqHandler); 11141 } 11142 11143 if (this.options.deepLink) { 11144 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('hashchange', this._checkDeepLink); 11145 } 11146 } 11147 /** 11148 * Adds click handlers for items within the tabs. 11149 * @private 11150 */ 11151 11152 }, { 11153 key: "_addClickHandler", 11154 value: function _addClickHandler() { 11155 var _this = this; 11156 11157 this.$element.off('click.zf.tabs').on('click.zf.tabs', ".".concat(this.options.linkClass), function (e) { 11158 e.preventDefault(); 11159 11160 _this._handleTabChange(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)); 11161 }); 11162 } 11163 /** 11164 * Adds keyboard event handlers for items within the tabs. 11165 * @private 11166 */ 11167 11168 }, { 11169 key: "_addKeyHandler", 11170 value: function _addKeyHandler() { 11171 var _this = this; 11172 11173 this.$tabTitles.off('keydown.zf.tabs').on('keydown.zf.tabs', function (e) { 11174 if (e.which === 9) return; 11175 var $element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 11176 $elements = $element.parent('ul').children('li'), 11177 $prevElement, 11178 $nextElement; 11179 $elements.each(function (i) { 11180 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is($element)) { 11181 if (_this.options.wrapOnKeys) { 11182 $prevElement = i === 0 ? $elements.last() : $elements.eq(i - 1); 11183 $nextElement = i === $elements.length - 1 ? $elements.first() : $elements.eq(i + 1); 11184 } else { 11185 $prevElement = $elements.eq(Math.max(0, i - 1)); 11186 $nextElement = $elements.eq(Math.min(i + 1, $elements.length - 1)); 11187 } 11188 11189 return; 11190 } 11191 }); // handle keyboard event with keyboard util 11192 11193 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].handleKey(e, 'Tabs', { 11194 open: function open() { 11195 $element.find('[role="tab"]').focus(); 11196 11197 _this._handleTabChange($element); 11198 }, 11199 previous: function previous() { 11200 $prevElement.find('[role="tab"]').focus(); 11201 11202 _this._handleTabChange($prevElement); 11203 }, 11204 next: function next() { 11205 $nextElement.find('[role="tab"]').focus(); 11206 11207 _this._handleTabChange($nextElement); 11208 }, 11209 handled: function handled() { 11210 e.preventDefault(); 11211 } 11212 }); 11213 }); 11214 } 11215 /** 11216 * Opens the tab `$targetContent` defined by `$target`. Collapses active tab. 11217 * @param {jQuery} $target - Tab to open. 11218 * @param {boolean} historyHandled - browser has already handled a history update 11219 * @fires Tabs#change 11220 * @function 11221 */ 11222 11223 }, { 11224 key: "_handleTabChange", 11225 value: function _handleTabChange($target, historyHandled) { 11226 // With `activeCollapse`, if the target is the active Tab, collapse it. 11227 if ($target.hasClass("".concat(this.options.linkActiveClass))) { 11228 if (this.options.activeCollapse) { 11229 this._collapse(); 11230 } 11231 11232 return; 11233 } 11234 11235 var $oldTab = this.$element.find(".".concat(this.options.linkClass, ".").concat(this.options.linkActiveClass)), 11236 $tabLink = $target.find('[role="tab"]'), 11237 target = $tabLink.attr('data-tabs-target'), 11238 anchor = target && target.length ? "#".concat(target) : $tabLink[0].hash, 11239 $targetContent = this.$tabContent.find(anchor); //close old tab 11240 11241 this._collapseTab($oldTab); //open new tab 11242 11243 11244 this._openTab($target); //either replace or update browser history 11245 11246 11247 if (this.options.deepLink && !historyHandled) { 11248 if (this.options.updateHistory) { 11249 history.pushState({}, '', anchor); 11250 } else { 11251 history.replaceState({}, '', anchor); 11252 } 11253 } 11254 /** 11255 * Fires when the plugin has successfully changed tabs. 11256 * @event Tabs#change 11257 */ 11258 11259 11260 this.$element.trigger('change.zf.tabs', [$target, $targetContent]); //fire to children a mutation event 11261 11262 $targetContent.find("[data-mutate]").trigger("mutateme.zf.trigger"); 11263 } 11264 /** 11265 * Opens the tab `$targetContent` defined by `$target`. 11266 * @param {jQuery} $target - Tab to open. 11267 * @function 11268 */ 11269 11270 }, { 11271 key: "_openTab", 11272 value: function _openTab($target) { 11273 var $tabLink = $target.find('[role="tab"]'), 11274 hash = $tabLink.attr('data-tabs-target') || $tabLink[0].hash.slice(1), 11275 $targetContent = this.$tabContent.find("#".concat(hash)); 11276 $target.addClass("".concat(this.options.linkActiveClass)); 11277 $tabLink.attr({ 11278 'aria-selected': 'true', 11279 'tabindex': '0' 11280 }); 11281 $targetContent.addClass("".concat(this.options.panelActiveClass)).removeAttr('aria-hidden'); 11282 } 11283 /** 11284 * Collapses `$targetContent` defined by `$target`. 11285 * @param {jQuery} $target - Tab to collapse. 11286 * @function 11287 */ 11288 11289 }, { 11290 key: "_collapseTab", 11291 value: function _collapseTab($target) { 11292 var $target_anchor = $target.removeClass("".concat(this.options.linkActiveClass)).find('[role="tab"]').attr({ 11293 'aria-selected': 'false', 11294 'tabindex': -1 11295 }); 11296 jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat($target_anchor.attr('aria-controls'))).removeClass("".concat(this.options.panelActiveClass)).attr({ 11297 'aria-hidden': 'true' 11298 }); 11299 } 11300 /** 11301 * Collapses the active Tab. 11302 * @fires Tabs#collapse 11303 * @function 11304 */ 11305 11306 }, { 11307 key: "_collapse", 11308 value: function _collapse() { 11309 var $activeTab = this.$element.find(".".concat(this.options.linkClass, ".").concat(this.options.linkActiveClass)); 11310 11311 if ($activeTab.length) { 11312 this._collapseTab($activeTab); 11313 /** 11314 * Fires when the plugin has successfully collapsed tabs. 11315 * @event Tabs#collapse 11316 */ 11317 11318 11319 this.$element.trigger('collapse.zf.tabs', [$activeTab]); 11320 } 11321 } 11322 /** 11323 * Public method for selecting a content pane to display. 11324 * @param {jQuery | String} elem - jQuery object or string of the id of the pane to display. 11325 * @param {boolean} historyHandled - browser has already handled a history update 11326 * @function 11327 */ 11328 11329 }, { 11330 key: "selectTab", 11331 value: function selectTab(elem, historyHandled) { 11332 var idStr, hashIdStr; 11333 11334 if (_typeof(elem) === 'object') { 11335 idStr = elem[0].id; 11336 } else { 11337 idStr = elem; 11338 } 11339 11340 if (idStr.indexOf('#') < 0) { 11341 hashIdStr = "#".concat(idStr); 11342 } else { 11343 hashIdStr = idStr; 11344 idStr = idStr.slice(1); 11345 } 11346 11347 var $target = this.$tabTitles.has("[href$=\"".concat(hashIdStr, "\"],[data-tabs-target=\"").concat(idStr, "\"]")).first(); 11348 11349 this._handleTabChange($target, historyHandled); 11350 } 11351 }, { 11352 key: "_setHeight", 11353 11354 /** 11355 * Sets the height of each panel to the height of the tallest panel. 11356 * If enabled in options, gets called on media query change. 11357 * If loading content via external source, can be called directly or with _reflow. 11358 * If enabled with `data-match-height="true"`, tabs sets to equal height 11359 * @function 11360 * @private 11361 */ 11362 value: function _setHeight() { 11363 var max = 0, 11364 _this = this; // Lock down the `this` value for the root tabs object 11365 11366 11367 this.$tabContent.find(".".concat(this.options.panelClass)).css('height', '').each(function () { 11368 var panel = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 11369 isActive = panel.hasClass("".concat(_this.options.panelActiveClass)); // get the options from the parent instead of trying to get them from the child 11370 11371 if (!isActive) { 11372 panel.css({ 11373 'visibility': 'hidden', 11374 'display': 'block' 11375 }); 11376 } 11377 11378 var temp = this.getBoundingClientRect().height; 11379 11380 if (!isActive) { 11381 panel.css({ 11382 'visibility': '', 11383 'display': '' 11384 }); 11385 } 11386 11387 max = temp > max ? temp : max; 11388 }).css('height', "".concat(max, "px")); 11389 } 11390 /** 11391 * Destroys an instance of tabs. 11392 * @fires Tabs#destroyed 11393 */ 11394 11395 }, { 11396 key: "_destroy", 11397 value: function _destroy() { 11398 this.$element.find(".".concat(this.options.linkClass)).off('.zf.tabs').hide().end().find(".".concat(this.options.panelClass)).hide(); 11399 11400 if (this.options.matchHeight) { 11401 if (this._setHeightMqHandler != null) { 11402 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('changed.zf.mediaquery', this._setHeightMqHandler); 11403 } 11404 } 11405 11406 if (this.options.deepLink) { 11407 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('hashchange', this._checkDeepLink); 11408 } 11409 11410 if (this.onLoadListener) { 11411 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(this.onLoadListener); 11412 } 11413 } 11414 }]); 11415 11416 return Tabs; 11417}
11417(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]); 11418 11419Tabs.defaults = { 11420 /** 11421 * Link the location hash to the active pane. 11422 * Set the location hash when the active pane changes, and open the corresponding pane when the location changes. 11423 * @option 11424 * @type {boolean} 11425 * @default false 11426 */ 11427 deepLink: false, 11428 11429 /** 11430 * If `deepLink` is enabled, adjust the deep link scroll to make sure the top of the tab panel is visible 11431 * @option 11432 * @type {boolean} 11433 * @default false 11434 */ 11435 deepLinkSmudge: false, 11436 11437 /** 11438 * If `deepLinkSmudge` is enabled, animation time (ms) for the deep link adjustment 11439 * @option 11440 * @type {number} 11441 * @default 300 11442 */ 11443 deepLinkSmudgeDelay: 300, 11444 11445 /** 11446 * If `deepLink` is enabled, update the browser history with the open tab 11447 * @option 11448 * @type {boolean} 11449 * @default false 11450 */ 11451 updateHistory: false, 11452 11453 /** 11454 * Allows the window to scroll to content of active pane on load. 11455 * Not recommended if more than one tab panel per page. 11456 * @option 11457 * @type {boolean} 11458 * @default false 11459 */ 11460 autoFocus: false, 11461 11462 /** 11463 * Allows keyboard input to 'wrap' around the tab links. 11464 * @option 11465 * @type {boolean} 11466 * @default true 11467 */ 11468 wrapOnKeys: true, 11469 11470 /** 11471 * Allows the tab content panes to match heights if set to true. 11472 * @option 11473 * @type {boolean} 11474 * @default false 11475 */ 11476 matchHeight: false, 11477 11478 /** 11479 * Allows active tabs to collapse when clicked. 11480 * @option 11481 * @type {boolean} 11482 * @default false 11483 */ 11484 activeCollapse: false, 11485 11486 /** 11487 * Class applied to `li`'s in tab link list. 11488 * @option 11489 * @type {string} 11490 * @default 'tabs-title' 11491 */ 11492 linkClass: 'tabs-title', 11493 11494 /** 11495 * Class applied to the active `li` in tab link list. 11496 * @option 11497 * @type {string} 11498 * @default 'is-active' 11499 */ 11500 linkActiveClass: 'is-active', 11501 11502 /** 11503 * Class applied to the content containers. 11504 * @option 11505 * @type {string} 11506 * @default 'tabs-panel' 11507 */ 11508 panelClass: 'tabs-panel', 11509 11510 /** 11511 * Class applied to the active content container. 11512 * @option 11513 * @type {string} 11514 * @default 'is-active' 11515 */ 11516 panelActiveClass: 'is-active' 11517}; 11518 11519 11520/***/ }), 11521
vendor: 4,970 bytes, lines 11522-11613
11522/***/ "./js/foundation.toggler.js": 11523/*!**********************************!*\ 11524 !*** ./js/foundation.toggler.js ***! 11525 \**********************************/ 11526/*! exports provided: Toggler */ 11527/***/ (function(module, __webpack_exports__, __webpack_require__) { 11528 11529"use strict"; 11530__webpack_require__.r(__webpack_exports__); 11531/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Toggler", function() { return Toggler; }); 11532/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 11533/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 11534/* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.motion */ "./js/foundation.util.motion.js"); 11535/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 11536/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 11537/* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js"); 11538 11539 11540function _typeof(obj) { 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); } 11541 11542function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 11543 11544function _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); } } 11545 11546function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 11547 11548function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 11549 11550function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 11551 11552function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 11553 11554function _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); } 11555 11556function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 11557 11558 11559 11560 11561 11562 11563/** 11564 * Toggler module. 11565 * @module foundation.toggler 11566 * @requires foundation.util.motion 11567 * @requires foundation.util.triggers 11568 */ 11569 11570var Toggler = 11571/*#__PURE__*/ 11572function (_Plugin) { 11573 _inherits(Toggler, _Plugin); 11574 11575 function Toggler() { 11576 _classCallCheck(this, Toggler); 11577 11578 return _possibleConstructorReturn(this, _getPrototypeOf(Toggler).apply(this, arguments)); 11579 } 11580 11581 _createClass(Toggler, [{ 11582 key: "_setup", 11583 11584 /** 11585 * Creates a new instance of Toggler. 11586 * @class 11587 * @name Toggler 11588 * @fires Toggler#init 11589 * @param {Object} element - jQuery object to add the trigger to. 11590 * @param {Object} options - Overrides to the default plugin settings. 11591 */ 11592 value: function _setup(element, options) { 11593 this.$element = element; 11594 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Toggler.defaults, element.data(), options); 11595 this.className = ''; 11596 this.className = 'Toggler'; // ie9 back compat 11597 // Triggers init is idempotent, just need to make sure it is initialized 11598 11599 _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 11600 11601 this._init(); 11602 11603 this._events(); 11604 } 11605 /** 11606 * Initializes the Toggler plugin by parsing the toggle class from data-toggler, or animation classes from data-animate. 11607 * @function 11608 * @private 11609 */ 11610 11611 }, { 11612 key: "_init", 11613 value: function _init() {
vendor: 4,334 bytes, lines 11614-11736
11614 // Collect triggers to set ARIA attributes to 11615 var id = this.$element[0].id, 11616 $triggers = jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-open~=\"".concat(id, "\"], [data-close~=\"").concat(id, "\"], [data-toggle~=\"").concat(id, "\"]")); 11617 var input; // Parse animation classes if they were set 11618 11619 if (this.options.animate) { 11620 input = this.options.animate.split(' '); 11621 this.animationIn = input[0]; 11622 this.animationOut = input[1] || null; // - aria-expanded: according to the element visibility. 11623 11624 $triggers.attr('aria-expanded', !this.$element.is(':hidden')); 11625 } // Otherwise, parse toggle class 11626 else { 11627 input = this.options.toggler; 11628 11629 if (typeof input !== 'string' || !input.length) { 11630 throw new Error("The 'toogler' option containing the target class is required, got \"".concat(input, "\"")); 11631 } // Allow for a . at the beginning of the string 11632 11633 11634 this.className = input[0] === '.' ? input.slice(1) : input; // - aria-expanded: according to the elements class set. 11635 11636 $triggers.attr('aria-expanded', this.$element.hasClass(this.className)); 11637 } // - aria-controls: adding the element id to it if not already in it. 11638 11639 11640 $triggers.each(function (index, trigger) { 11641 var $trigger = jquery__WEBPACK_IMPORTED_MODULE_0___default()(trigger); 11642 var controls = $trigger.attr('aria-controls') || ''; 11643 var containsId = new RegExp("\\b".concat(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["RegExpEscape"])(id), "\\b")).test(controls); 11644 if (!containsId) $trigger.attr('aria-controls', controls ? "".concat(controls, " ").concat(id) : id); 11645 }); 11646 } 11647 /** 11648 * Initializes events for the toggle trigger. 11649 * @function 11650 * @private 11651 */ 11652 11653 }, { 11654 key: "_events", 11655 value: function _events() { 11656 this.$element.off('toggle.zf.trigger').on('toggle.zf.trigger', this.toggle.bind(this)); 11657 } 11658 /** 11659 * 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". 11660 * @function 11661 * @fires Toggler#on 11662 * @fires Toggler#off 11663 */ 11664 11665 }, { 11666 key: "toggle", 11667 value: function toggle() { 11668 this[this.options.animate ? '_toggleAnimate' : '_toggleClass'](); 11669 } 11670 }, { 11671 key: "_toggleClass", 11672 value: function _toggleClass() { 11673 this.$element.toggleClass(this.className); 11674 var isOn = this.$element.hasClass(this.className); 11675 11676 if (isOn) { 11677 /** 11678 * Fires if the target element has the class after a toggle. 11679 * @event Toggler#on 11680 */ 11681 this.$element.trigger('on.zf.toggler'); 11682 } else { 11683 /** 11684 * Fires if the target element does not have the class after a toggle. 11685 * @event Toggler#off 11686 */ 11687 this.$element.trigger('off.zf.toggler'); 11688 } 11689 11690 this._updateARIA(isOn); 11691 11692 this.$element.find('[data-mutate]').trigger('mutateme.zf.trigger'); 11693 } 11694 }, { 11695 key: "_toggleAnimate", 11696 value: function _toggleAnimate() { 11697 var _this = this; 11698 11699 if (this.$element.is(':hidden')) { 11700 _foundation_util_motion__WEBPACK_IMPORTED_MODULE_1__["Motion"].animateIn(this.$element, this.animationIn, function () { 11701 _this._updateARIA(true); 11702 11703 this.trigger('on.zf.toggler'); 11704 this.find('[data-mutate]').trigger('mutateme.zf.trigger'); 11705 }); 11706 } else { 11707 _foundation_util_motion__WEBPACK_IMPORTED_MODULE_1__["Motion"].animateOut(this.$element, this.animationOut, function () { 11708 _this._updateARIA(false); 11709 11710 this.trigger('off.zf.toggler'); 11711 this.find('[data-mutate]').trigger('mutateme.zf.trigger'); 11712 }); 11713 } 11714 } 11715 }, { 11716 key: "_updateARIA", 11717 value: function _updateARIA(isOn) { 11718 var id = this.$element[0].id; 11719 jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-open=\"".concat(id, "\"], [data-close=\"").concat(id, "\"], [data-toggle=\"").concat(id, "\"]")).attr({ 11720 'aria-expanded': isOn ? true : false 11721 }); 11722 } 11723 /** 11724 * Destroys the instance of Toggler on the element. 11725 * @function 11726 */ 11727 11728 }, { 11729 key: "_destroy", 11730 value: function _destroy() { 11731 this.$element.off('.zf.toggler'); 11732 } 11733 }]); 11734 11735 return Toggler; 11736}
11736(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__["Plugin"]); 11737 11738Toggler.defaults = { 11739 /** 11740 * Class of the element to toggle. It can be provided with or without "." 11741 * @option 11742 * @type {string} 11743 */ 11744 toggler: undefined, 11745 11746 /** 11747 * Tells the plugin if the element should animated when toggled. 11748 * @option 11749 * @type {boolean} 11750 * @default false 11751 */ 11752 animate: false 11753}; 11754 11755 11756/***/ }), 11757
vendor: 5,183 bytes, lines 11758-11838
11758/***/ "./js/foundation.tooltip.js": 11759/*!**********************************!*\ 11760 !*** ./js/foundation.tooltip.js ***! 11761 \**********************************/ 11762/*! exports provided: Tooltip */ 11763/***/ (function(module, __webpack_exports__, __webpack_require__) { 11764 11765"use strict"; 11766__webpack_require__.r(__webpack_exports__); 11767/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Tooltip", function() { return Tooltip; }); 11768/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 11769/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 11770/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 11771/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js"); 11772/* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js"); 11773/* harmony import */ var _foundation_positionable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.positionable */ "./js/foundation.positionable.js"); 11774 11775 11776function _typeof(obj) { 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); } 11777 11778function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 11779 11780function _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); } } 11781 11782function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 11783 11784function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 11785 11786function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 11787 11788function _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); } 11789 11790function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 11791 11792function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 11793 11794function _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); } 11795 11796function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 11797 11798 11799 11800 11801 11802 11803/** 11804 * Tooltip module. 11805 * @module foundation.tooltip 11806 * @requires foundation.util.box 11807 * @requires foundation.util.mediaQuery 11808 * @requires foundation.util.triggers 11809 */ 11810 11811var Tooltip = 11812/*#__PURE__*/ 11813function (_Positionable) { 11814 _inherits(Tooltip, _Positionable); 11815 11816 function Tooltip() { 11817 _classCallCheck(this, Tooltip); 11818 11819 return _possibleConstructorReturn(this, _getPrototypeOf(Tooltip).apply(this, arguments)); 11820 } 11821 11822 _createClass(Tooltip, [{ 11823 key: "_setup", 11824 11825 /** 11826 * Creates a new instance of a Tooltip. 11827 * @class 11828 * @name Tooltip 11829 * @fires Tooltip#init 11830 * @param {jQuery} element - jQuery object to attach a tooltip to. 11831 * @param {Object} options - object to extend the default configuration. 11832 */ 11833 value: function _setup(element, options) { 11834 this.$element = element; 11835 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Tooltip.defaults, this.$element.data(), options); 11836 this.className = 'Tooltip'; // ie9 back compat 11837 11838 this.isActive = false;
11839 this.isClick = false; // Triggers init is idempotent, just need to make sure it is initialized 11840 11841 _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_3__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 11842 11843 this._init(); 11844 } 11845 /** 11846 * Initializes the tooltip by setting the creating the tip element, adding it's text, setting private variables and setting attributes on the anchor. 11847 * @private 11848 */ 11849 11850 }, { 11851 key: "_init", 11852 value: function _init() { 11853 _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__["MediaQuery"]._init(); 11854 11855 var elemId = this.$element.attr('aria-describedby') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["GetYoDigits"])(6, 'tooltip'); 11856 this.options.tipText = this.options.tipText || this.$element.attr('title'); 11857 this.template = this.options.template ? jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.options.template) : this._buildTemplate(elemId); 11858 11859 if (this.options.allowHtml) { 11860 this.template.appendTo(document.body).html(this.options.tipText).hide(); 11861 } else { 11862 this.template.appendTo(document.body).text(this.options.tipText).hide(); 11863 } 11864 11865 this.$element.attr({ 11866 'title': '', 11867 'aria-describedby': elemId, 11868 'data-yeti-box': elemId, 11869 'data-toggle': elemId, 11870 'data-resize': elemId 11871 }).addClass(this.options.triggerClass); 11872 11873 _get(_getPrototypeOf(Tooltip.prototype), "_init", this).call(this); 11874 11875 this._events(); 11876 } 11877 }, { 11878 key: "_getDefaultPosition", 11879 value: function _getDefaultPosition() { 11880 // handle legacy classnames 11881 var elementClassName = this.$element[0].className; 11882 11883 if (this.$element[0] instanceof SVGElement) { 11884 elementClassName = elementClassName.baseVal; 11885 } 11886 11887 var position = elementClassName.match(/\b(top|left|right|bottom)\b/g); 11888 return position ? position[0] : 'top'; 11889 } 11890 }, { 11891 key: "_getDefaultAlignment", 11892 value: function _getDefaultAlignment() { 11893 return 'center'; 11894 } 11895 }, { 11896 key: "_getHOffset", 11897 value: function _getHOffset() { 11898 if (this.position === 'left' || this.position === 'right') { 11899 return this.options.hOffset + this.options.tooltipWidth; 11900 } else { 11901 return this.options.hOffset; 11902 } 11903 } 11904 }, { 11905 key: "_getVOffset", 11906 value: function _getVOffset() { 11907 if (this.position === 'top' || this.position === 'bottom') { 11908 return this.options.vOffset + this.options.tooltipHeight; 11909 } else { 11910 return this.options.vOffset; 11911 } 11912 } 11913 /** 11914 * builds the tooltip element, adds attributes, and returns the template. 11915 * @private 11916 */ 11917 11918 }, { 11919 key: "_buildTemplate", 11920 value: function _buildTemplate(id) { 11921 var templateClasses = "".concat(this.options.tooltipClass, " ").concat(this.options.templateClasses).trim(); 11922 var $template = jquery__WEBPACK_IMPORTED_MODULE_0___default()('<div></div>').addClass(templateClasses).attr({ 11923 'role': 'tooltip', 11924 'aria-hidden': true, 11925 'data-is-active': false, 11926 'data-is-focus': false, 11927 'id': id 11928 }); 11929 return $template; 11930 } 11931 /** 11932 * 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. 11933 * if the tooltip is larger than the screen width, default to full width - any user selected margin 11934 * @private 11935 */ 11936 11937 }, { 11938 key: "_setPosition", 11939 value: function _setPosition() { 11940 _get(_getPrototypeOf(Tooltip.prototype), "_setPosition", this).call(this, this.$element, this.template); 11941 } 11942 /** 11943 * reveals the tooltip, and fires an event to close any other open tooltips on the page 11944 * @fires Tooltip#closeme 11945 * @fires Tooltip#show 11946 * @function 11947 */ 11948 11949 }, { 11950 key: "show", 11951 value: function show() { 11952 if (this.options.showOn !== 'all' && !_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__["MediaQuery"].is(this.options.showOn)) { 11953 // console.error('The screen is too small to display this tooltip'); 11954 return false;
vendor: 1,706 bytes, lines 11955-12013
11955 } 11956 11957 var _this = this; 11958 11959 this.template.css('visibility', 'hidden').show(); 11960 11961 this._setPosition(); 11962 11963 this.template.removeClass('top bottom left right').addClass(this.position); 11964 this.template.removeClass('align-top align-bottom align-left align-right align-center').addClass('align-' + this.alignment); 11965 /** 11966 * Fires to close all other open tooltips on the page 11967 * @event Closeme#tooltip 11968 */ 11969 11970 this.$element.trigger('closeme.zf.tooltip', this.template.attr('id')); 11971 this.template.attr({ 11972 'data-is-active': true, 11973 'aria-hidden': false 11974 }); 11975 _this.isActive = true; // console.log(this.template); 11976 11977 this.template.stop().hide().css('visibility', '').fadeIn(this.options.fadeInDuration, function () {//maybe do stuff? 11978 }); 11979 /** 11980 * Fires when the tooltip is shown 11981 * @event Tooltip#show 11982 */ 11983 11984 this.$element.trigger('show.zf.tooltip'); 11985 } 11986 /** 11987 * Hides the current tooltip, and resets the positioning class if it was changed due to collision 11988 * @fires Tooltip#hide 11989 * @function 11990 */ 11991 11992 }, { 11993 key: "hide", 11994 value: function hide() { 11995 // console.log('hiding', this.$element.data('yeti-box')); 11996 var _this = this; 11997 11998 this.template.stop().attr({ 11999 'aria-hidden': true, 12000 'data-is-active': false 12001 }).fadeOut(this.options.fadeOutDuration, function () { 12002 _this.isActive = false; 12003 _this.isClick = false; 12004 }); 12005 /** 12006 * fires when the tooltip is hidden 12007 * @event Tooltip#hide 12008 */ 12009 12010 this.$element.trigger('hide.zf.tooltip'); 12011 } 12012 /** 12013 * adds event listeners for the tooltip and its anchor
vendor: 6,564 bytes, lines 12014-12266
12014 * TODO combine some of the listeners like focus and mouseenter, etc. 12015 * @private 12016 */ 12017 12018 }, { 12019 key: "_events", 12020 value: function _events() { 12021 var _this = this; 12022 12023 var hasTouch = 'ontouchstart' in window || typeof window.ontouchstart !== 'undefined'; 12024 var $template = this.template; 12025 var isFocus = false; // `disableForTouch: Fully disable the tooltip on touch devices 12026 12027 if (hasTouch && this.options.disableForTouch) return; 12028 12029 if (!this.options.disableHover) { 12030 this.$element.on('mouseenter.zf.tooltip', function (e) { 12031 if (!_this.isActive) { 12032 _this.timeout = setTimeout(function () { 12033 _this.show(); 12034 }, _this.options.hoverDelay); 12035 } 12036 }).on('mouseleave.zf.tooltip', Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["ignoreMousedisappear"])(function (e) { 12037 clearTimeout(_this.timeout); 12038 12039 if (!isFocus || _this.isClick && !_this.options.clickOpen) { 12040 _this.hide(); 12041 } 12042 })); 12043 } 12044 12045 if (hasTouch) { 12046 this.$element.on('tap.zf.tooltip touchend.zf.tooltip', function (e) { 12047 _this.isActive ? _this.hide() : _this.show(); 12048 }); 12049 } 12050 12051 if (this.options.clickOpen) { 12052 this.$element.on('mousedown.zf.tooltip', function (e) { 12053 if (_this.isClick) {//_this.hide(); 12054 // _this.isClick = false; 12055 } else { 12056 _this.isClick = true; 12057 12058 if ((_this.options.disableHover || !_this.$element.attr('tabindex')) && !_this.isActive) { 12059 _this.show(); 12060 } 12061 } 12062 }); 12063 } else { 12064 this.$element.on('mousedown.zf.tooltip', function (e) { 12065 _this.isClick = true; 12066 }); 12067 } 12068 12069 this.$element.on({ 12070 // 'toggle.zf.trigger': this.toggle.bind(this), 12071 // 'close.zf.trigger': this.hide.bind(this) 12072 'close.zf.trigger': this.hide.bind(this) 12073 }); 12074 this.$element.on('focus.zf.tooltip', function (e) { 12075 isFocus = true; 12076 12077 if (_this.isClick) { 12078 // If we're not showing open on clicks, we need to pretend a click-launched focus isn't 12079 // a real focus, otherwise on hover and come back we get bad behavior 12080 if (!_this.options.clickOpen) { 12081 isFocus = false; 12082 } 12083 12084 return false; 12085 } else { 12086 _this.show(); 12087 } 12088 }).on('focusout.zf.tooltip', function (e) { 12089 isFocus = false; 12090 _this.isClick = false; 12091 12092 _this.hide(); 12093 }).on('resizeme.zf.trigger', function () { 12094 if (_this.isActive) { 12095 _this._setPosition(); 12096 } 12097 }); 12098 } 12099 /** 12100 * adds a toggle method, in addition to the static show() & hide() functions 12101 * @function 12102 */ 12103 12104 }, { 12105 key: "toggle", 12106 value: function toggle() { 12107 if (this.isActive) { 12108 this.hide(); 12109 } else { 12110 this.show(); 12111 } 12112 } 12113 /** 12114 * Destroys an instance of tooltip, removes template element from the view. 12115 * @function 12116 */ 12117 12118 }, { 12119 key: "_destroy", 12120 value: function _destroy() { 12121 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'); 12122 this.template.remove(); 12123 } 12124 }]); 12125 12126 return Tooltip; 12127}(_foundation_positionable__WEBPACK_IMPORTED_MODULE_4__["Positionable"]); 12128 12129Tooltip.defaults = { 12130 /** 12131 * Time, in ms, before a tooltip should open on hover. 12132 * @option 12133 * @type {number} 12134 * @default 200 12135 */ 12136 hoverDelay: 200, 12137 12138 /** 12139 * Time, in ms, a tooltip should take to fade into view. 12140 * @option 12141 * @type {number} 12142 * @default 150 12143 */ 12144 fadeInDuration: 150, 12145 12146 /** 12147 * Time, in ms, a tooltip should take to fade out of view. 12148 * @option 12149 * @type {number} 12150 * @default 150 12151 */ 12152 fadeOutDuration: 150, 12153 12154 /** 12155 * Disables hover events from opening the tooltip if set to true 12156 * @option 12157 * @type {boolean} 12158 * @default false 12159 */ 12160 disableHover: false, 12161 12162 /** 12163 * Disable the tooltip for touch devices. 12164 * This can be useful to make elements with a tooltip on it trigger their 12165 * action on the first tap instead of displaying the tooltip. 12166 * @option 12167 * @type {booelan} 12168 * @default false 12169 */ 12170 disableForTouch: false, 12171 12172 /** 12173 * Optional addtional classes to apply to the tooltip template on init. 12174 * @option 12175 * @type {string} 12176 * @default '' 12177 */ 12178 templateClasses: '', 12179 12180 /** 12181 * Non-optional class added to tooltip templates. Foundation default is 'tooltip'. 12182 * @option 12183 * @type {string} 12184 * @default 'tooltip' 12185 */ 12186 tooltipClass: 'tooltip', 12187 12188 /** 12189 * Class applied to the tooltip anchor element. 12190 * @option 12191 * @type {string} 12192 * @default 'has-tip' 12193 */ 12194 triggerClass: 'has-tip', 12195 12196 /** 12197 * Minimum breakpoint size at which to open the tooltip. 12198 * @option 12199 * @type {string} 12200 * @default 'small' 12201 */ 12202 showOn: 'small', 12203 12204 /** 12205 * Custom template to be used to generate markup for tooltip. 12206 * @option 12207 * @type {string} 12208 * @default '' 12209 */ 12210 template: '', 12211 12212 /** 12213 * Text displayed in the tooltip template on open. 12214 * @option 12215 * @type {string} 12216 * @default '' 12217 */ 12218 tipText: '', 12219 touchCloseText: 'Tap to close.', 12220 12221 /** 12222 * Allows the tooltip to remain open if triggered with a click or touch event. 12223 * @option 12224 * @type {boolean} 12225 * @default true 12226 */ 12227 clickOpen: true, 12228 12229 /** 12230 * Position of tooltip. Can be left, right, bottom, top, or auto. 12231 * @option 12232 * @type {string} 12233 * @default 'auto' 12234 */ 12235 position: 'auto', 12236 12237 /** 12238 * Alignment of tooltip relative to anchor. Can be left, right, bottom, top, center, or auto. 12239 * @option 12240 * @type {string} 12241 * @default 'auto' 12242 */ 12243 alignment: 'auto', 12244 12245 /** 12246 * Allow overlap of container/window. If false, tooltip will first try to 12247 * position as defined by data-position and data-alignment, but reposition if 12248 * it would cause an overflow. @option 12249 * @type {boolean} 12250 * @default false 12251 */ 12252 allowOverlap: false, 12253 12254 /** 12255 * Allow overlap of only the bottom of the container. This is the most common 12256 * behavior for dropdowns, allowing the dropdown to extend the bottom of the 12257 * screen but not otherwise influence or break out of the container. 12258 * Less common for tooltips. 12259 * @option 12260 * @type {boolean} 12261 * @default false 12262 */ 12263 allowBottomOverlap: false, 12264 12265 /** 12266 * Distance, in pixels, the template should push away from the anch
12266or on the Y axis. 12267 * @option 12268 * @type {number} 12269 * @default 0 12270 */ 12271 vOffset: 0, 12272 12273 /** 12274 * Distance, in pixels, the template should push away from the anchor on the X axis 12275 * @option 12276 * @type {number} 12277 * @default 0 12278 */ 12279 hOffset: 0, 12280 12281 /** 12282 * Distance, in pixels, the template spacing auto-adjust for a vertical tooltip 12283 * @option 12284 * @type {number} 12285 * @default 14 12286 */ 12287 tooltipHeight: 14, 12288 12289 /** 12290 * Distance, in pixels, the template spacing auto-adjust for a horizontal tooltip 12291 * @option 12292 * @type {number} 12293 * @default 12 12294 */ 12295 tooltipWidth: 12, 12296 12297 /** 12298 * Allow HTML in tooltip. Warning: If you are loading user-generated content into tooltips, 12299 * allowing HTML may open yourself up to XSS attacks. 12300 * @option 12301 * @type {boolean} 12302 * @default false 12303 */ 12304 allowHtml: false 12305}; 12306/** 12307 * TODO utilize resize event trigger 12308 */ 12309 12310 12311 12312/***/ }), 12313
vendor: 6,807 bytes, lines 12314-12520
12314/***/ "./js/foundation.util.box.js": 12315/*!***********************************!*\ 12316 !*** ./js/foundation.util.box.js ***! 12317 \***********************************/ 12318/*! exports provided: Box */ 12319/***/ (function(module, __webpack_exports__, __webpack_require__) { 12320 12321"use strict"; 12322__webpack_require__.r(__webpack_exports__); 12323/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Box", function() { return Box; }); 12324 12325 12326var Box = { 12327 ImNotTouchingYou: ImNotTouchingYou, 12328 OverlapArea: OverlapArea, 12329 GetDimensions: GetDimensions, 12330 GetExplicitOffsets: GetExplicitOffsets 12331 /** 12332 * Compares the dimensions of an element to a container and determines collision events with container. 12333 * @function 12334 * @param {jQuery} element - jQuery object to test for collisions. 12335 * @param {jQuery} parent - jQuery object to use as bounding container. 12336 * @param {Boolean} lrOnly - set to true to check left and right values only. 12337 * @param {Boolean} tbOnly - set to true to check top and bottom values only. 12338 * @default if no parent object passed, detects collisions with `window`. 12339 * @returns {Boolean} - true if collision free, false if a collision in any direction. 12340 */ 12341 12342}; 12343 12344function ImNotTouchingYou(element, parent, lrOnly, tbOnly, ignoreBottom) { 12345 return OverlapArea(element, parent, lrOnly, tbOnly, ignoreBottom) === 0; 12346} 12347 12348function OverlapArea(element, parent, lrOnly, tbOnly, ignoreBottom) { 12349 var eleDims = GetDimensions(element), 12350 topOver, 12351 bottomOver, 12352 leftOver, 12353 rightOver; 12354 12355 if (parent) { 12356 var parDims = GetDimensions(parent); 12357 bottomOver = parDims.height + parDims.offset.top - (eleDims.offset.top + eleDims.height); 12358 topOver = eleDims.offset.top - parDims.offset.top; 12359 leftOver = eleDims.offset.left - parDims.offset.left; 12360 rightOver = parDims.width + parDims.offset.left - (eleDims.offset.left + eleDims.width); 12361 } else { 12362 bottomOver = eleDims.windowDims.height + eleDims.windowDims.offset.top - (eleDims.offset.top + eleDims.height); 12363 topOver = eleDims.offset.top - eleDims.windowDims.offset.top; 12364 leftOver = eleDims.offset.left - eleDims.windowDims.offset.left; 12365 rightOver = eleDims.windowDims.width - (eleDims.offset.left + eleDims.width); 12366 } 12367 12368 bottomOver = ignoreBottom ? 0 : Math.min(bottomOver, 0); 12369 topOver = Math.min(topOver, 0); 12370 leftOver = Math.min(leftOver, 0); 12371 rightOver = Math.min(rightOver, 0); 12372 12373 if (lrOnly) { 12374 return leftOver + rightOver; 12375 } 12376 12377 if (tbOnly) { 12378 return topOver + bottomOver; 12379 } // use sum of squares b/c we care about overlap area. 12380 12381 12382 return Math.sqrt(topOver * topOver + bottomOver * bottomOver + leftOver * leftOver + rightOver * rightOver); 12383} 12384/** 12385 * Uses native methods to return an object of dimension values. 12386 * @function 12387 * @param {jQuery || HTML} element - jQuery object or DOM element for which to get the dimensions. Can be any element other that document or window. 12388 * @returns {Object} - nested object of integer pixel values 12389 * TODO - if element is window, return only those values. 12390 */ 12391 12392 12393function GetDimensions(elem) { 12394 elem = elem.length ? elem[0] : elem; 12395 12396 if (elem === window || elem === document) { 12397 throw new Error("I'm sorry, Dave. I'm afraid I can't do that."); 12398 } 12399 12400 var rect = elem.getBoundingClientRect(), 12401 parRect = elem.parentNode.getBoundingClientRect(), 12402 winRect = document.body.getBoundingClientRect(), 12403 winY = window.pageYOffset, 12404 winX = window.pageXOffset; 12405 return { 12406 width: rect.width, 12407 height: rect.height, 12408 offset: { 12409 top: rect.top + winY, 12410 left: rect.left + winX 12411 }, 12412 parentDims: { 12413 width: parRect.width, 12414 height: parRect.height, 12415 offset: { 12416 top: parRect.top + winY, 12417 left: parRect.left + winX 12418 } 12419 }, 12420 windowDims: { 12421 width: winRect.width, 12422 height: winRect.height, 12423 offset: { 12424 top: winY, 12425 left: winX 12426 } 12427 } 12428 }; 12429} 12430/** 12431 * Returns an object of top and left integer pixel values for dynamically rendered elements, 12432 * such as: Tooltip, Reveal, and Dropdown. Maintained for backwards compatibility, and where 12433 * you don't know alignment, but generally from 12434 * 6.4 forward you should use GetExplicitOffsets, as GetOffsets conflates position and alignment. 12435 * @function 12436 * @param {jQuery} element - jQuery object for the element being positioned. 12437 * @param {jQuery} anchor - jQuery object for the element's anchor point. 12438 * @param {String} position - a string relating to the desired position of the element, relative to it's anchor 12439 * @param {Number} vOffset - integer pixel value of desired vertical separation between anchor and element. 12440 * @param {Number} hOffset - integer pixel value of desired horizontal separation between anchor and element. 12441 * @param {Boolean} isOverflow - if a collision event is detected, sets to true to default the element to full width - any desired offset. 12442 * TODO alter/rewrite to work with `em` values as well/instead of pixels 12443 */ 12444 12445 12446function GetExplicitOffsets(element, anchor, position, alignment, vOffset, hOffset, isOverflow) { 12447 var $eleDims = GetDimensions(element), 12448 $anchorDims = anchor ? GetDimensions(anchor) : null; 12449 var topVal, leftVal; 12450 12451 if ($anchorDims !== null) { 12452 // set position related attribute 12453 switch (position) { 12454 case 'top': 12455 topVal = $anchorDims.offset.top - ($eleDims.height + vOffset); 12456 break; 12457 12458 case 'bottom': 12459 topVal = $anchorDims.offset.top + $anchorDims.height + vOffset; 12460 break; 12461 12462 case 'left': 12463 leftVal = $anchorDims.offset.left - ($eleDims.width + hOffset); 12464 break; 12465 12466 case 'right': 12467 leftVal = $anchorDims.offset.left + $anchorDims.width + hOffset; 12468 break; 12469 } // set alignment related attribute 12470 12471 12472 switch (position) { 12473 case 'top': 12474 case 'bottom': 12475 switch (alignment) { 12476 case 'left': 12477 leftVal = $anchorDims.offset.left + hOffset; 12478 break; 12479 12480 case 'right': 12481 leftVal = $anchorDims.offset.left - $eleDims.width + $anchorDims.width - hOffset; 12482 break; 12483 12484 case 'center': 12485 leftVal = isOverflow ? hOffset : $anchorDims.offset.left + $anchorDims.width / 2 - $eleDims.width / 2 + hOffset; 12486 break; 12487 } 12488 12489 break; 12490 12491 case 'right': 12492 case 'left': 12493 switch (alignment) { 12494 case 'bottom': 12495 topVal = $anchorDims.offset.top - vOffset + $anchorDims.height - $eleDims.height; 12496 break; 12497 12498 case 'top': 12499 topVal = $anchorDims.offset.top + vOffset; 12500 break; 12501 12502 case 'center': 12503 topVal = $anchorDims.offset.top + vOffset + $anchorDims.height / 2 - $eleDims.height / 2; 12504 break; 12505 } 12506 12507 break; 12508 } 12509 } 12510 12511 return { 12512 top: topVal, 12513 left: leftVal 12514 }; 12515} 12516 12517 12518 12519/***/ }), 12520
vendor: 7,531 bytes, lines 12521-12721
12521/***/ "./js/foundation.util.imageLoader.js": 12522/*!*******************************************!*\ 12523 !*** ./js/foundation.util.imageLoader.js ***! 12524 \*******************************************/ 12525/*! exports provided: onImagesLoaded */ 12526/***/ (function(module, __webpack_exports__, __webpack_require__) { 12527 12528"use strict"; 12529__webpack_require__.r(__webpack_exports__); 12530/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onImagesLoaded", function() { return onImagesLoaded; }); 12531/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 12532/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 12533 12534 12535 12536/** 12537 * Runs a callback function when images are fully loaded. 12538 * @param {Object} images - Image(s) to check if loaded. 12539 * @param {Func} callback - Function to execute when image is fully loaded. 12540 */ 12541 12542function onImagesLoaded(images, callback) { 12543 var self = this, 12544 unloaded = images.length; 12545 12546 if (unloaded === 0) { 12547 callback(); 12548 } 12549 12550 images.each(function () { 12551 // Check if image is loaded 12552 if (this.complete && typeof this.naturalWidth !== 'undefined') { 12553 singleImageLoaded(); 12554 } else { 12555 // If the above check failed, simulate loading on detached element. 12556 var image = new Image(); // Still count image as loaded if it finalizes with an error. 12557 12558 var events = "load.zf.images error.zf.images"; 12559 jquery__WEBPACK_IMPORTED_MODULE_0___default()(image).one(events, function me(event) { 12560 // Unbind the event listeners. We're using 'one' but only one of the two events will have fired. 12561 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).off(events, me); 12562 singleImageLoaded(); 12563 }); 12564 image.src = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('src'); 12565 } 12566 }); 12567 12568 function singleImageLoaded() { 12569 unloaded--; 12570 12571 if (unloaded === 0) { 12572 callback(); 12573 } 12574 } 12575} 12576 12577 12578 12579/***/ }), 12580 12581/***/ "./js/foundation.util.keyboard.js": 12582/*!****************************************!*\ 12583 !*** ./js/foundation.util.keyboard.js ***! 12584 \****************************************/ 12585/*! exports provided: Keyboard */ 12586/***/ (function(module, __webpack_exports__, __webpack_require__) { 12587 12588"use strict"; 12589__webpack_require__.r(__webpack_exports__); 12590/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Keyboard", function() { return Keyboard; }); 12591/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 12592/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 12593/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 12594/******************************************* 12595 * * 12596 * This util was created by Marius Olbertz * 12597 * Please thank Marius on GitHub /owlbertz * 12598 * or the web http://www.mariusolbertz.de/ * 12599 * * 12600 ******************************************/ 12601 12602 12603 12604 12605var keyCodes = { 12606 9: 'TAB', 12607 13: 'ENTER', 12608 27: 'ESCAPE', 12609 32: 'SPACE', 12610 35: 'END', 12611 36: 'HOME', 12612 37: 'ARROW_LEFT', 12613 38: 'ARROW_UP', 12614 39: 'ARROW_RIGHT', 12615 40: 'ARROW_DOWN' 12616}; 12617var commands = {}; // Functions pulled out to be referenceable from internals 12618 12619function findFocusable($element) { 12620 if (!$element) { 12621 return false; 12622 } 12623 12624 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 () { 12625 if (!jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is(':visible') || jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('tabindex') < 0) { 12626 return false; 12627 } //only have visible elements and those that have a tabindex greater or equal 0 12628 12629 12630 return true; 12631 }); 12632} 12633 12634function parseKey(event) { 12635 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 12636 12637 key = key.replace(/\W+/, ''); 12638 if (event.shiftKey) key = "SHIFT_".concat(key); 12639 if (event.ctrlKey) key = "CTRL_".concat(key); 12640 if (event.altKey) key = "ALT_".concat(key); // Remove trailing underscore, in case only modifiers were used (e.g. only `CTRL_ALT`) 12641 12642 key = key.replace(/_$/, ''); 12643 return key; 12644} 12645 12646var Keyboard = { 12647 keys: getKeyCodes(keyCodes), 12648 12649 /** 12650 * Parses the (keyboard) event and returns a String that represents its key 12651 * Can be used like Foundation.parseKey(event) === Foundation.keys.SPACE 12652 * @param {Event} event - the event generated by the event handler 12653 * @return String key - String that represents the key pressed 12654 */ 12655 parseKey: parseKey, 12656 12657 /** 12658 * Handles the given (keyboard) event 12659 * @param {Event} event - the event generated by the event handler 12660 * @param {String} component - Foundation component's name, e.g. Slider or Reveal 12661 * @param {Objects} functions - collection of functions that are to be executed 12662 */ 12663 handleKey: function handleKey(event, component, functions) { 12664 var commandList = commands[component], 12665 keyCode = this.parseKey(event), 12666 cmds, 12667 command, 12668 fn; 12669 if (!commandList) return console.warn('Component not defined!'); // Ignore the event if it was already handled 12670 12671 if (event.zfIsKeyHandled === true) return; // This component does not differentiate between ltr and rtl 12672 12673 if (typeof commandList.ltr === 'undefined') { 12674 cmds = commandList; // use plain list 12675 } else { 12676 // merge ltr and rtl: if document is rtl, rtl overwrites ltr and vice versa 12677 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); 12678 } 12679 12680 command = cmds[keyCode]; 12681 fn = functions[command]; // Execute the handler if found 12682 12683 if (fn && typeof fn === 'function') { 12684 var returnValue = fn.apply(); // Mark the event as "handled" to prevent future handlings 12685 12686 event.zfIsKeyHandled = true; // Execute function when event was handled 12687 12688 if (functions.handled || typeof functions.handled === 'function') { 12689 functions.handled(returnValue); 12690 } 12691 } else { 12692 // Execute function when event was not handled 12693 if (functions.unhandled || typeof functions.unhandled === 'function') { 12694 functions.unhandled(); 12695 } 12696 } 12697 }, 12698 12699 /** 12700 * Finds all focusable elements within the given `$element` 12701 * @param {jQuery} $element - jQuery object to search within 12702 * @return {jQuery} $focusable - all focusable elements within `$element` 12703 */ 12704 findFocusable: findFocusable, 12705 12706 /** 12707 * Returns the component name name 12708 * @param {Object} component - Foundation component, e.g. Slider or Reveal 12709 * @return String componentName 12710 */ 12711 register: function register(componentName, cmds) { 12712 commands[componentName] = cmds; 12713 }, 12714 // TODO9438: These references to Keyboard need to not require global. Will 'this' work in this context? 12715 // 12716 12717 /** 12718 * Traps the focus in the given element. 12719 * @param {jQuery} $element jQuery object to trap the foucs into. 12720 */ 12721 trapFocus: function trapFocus($element) {
12722 var $focusable = findFocusable($element), 12723 $firstFocusable = $focusable.eq(0), 12724 $lastFocusable = $focusable.eq(-1); 12725 $element.on('keydown.zf.trapfocus', function (event) { 12726 if (event.target === $lastFocusable[0] && parseKey(event) === 'TAB') { 12727 event.preventDefault(); 12728 $firstFocusable.focus(); 12729 } else if (event.target === $firstFocusable[0] && parseKey(event) === 'SHIFT_TAB') { 12730 event.preventDefault(); 12731 $lastFocusable.focus(); 12732 } 12733 }); 12734 }, 12735 12736 /** 12737 * Releases the trapped focus from the given element. 12738 * @param {jQuery} $element jQuery object to release the focus for. 12739 */ 12740 releaseFocus: function releaseFocus($element) { 12741 $element.off('keydown.zf.trapfocus'); 12742 } 12743}; 12744/* 12745 * Constants for easier comparing. 12746 * Can be used like Foundation.parseKey(event) === Foundation.keys.SPACE 12747 */ 12748 12749function getKeyCodes(kcs) { 12750 var k = {}; 12751 12752 for (var kc in kcs) { 12753 k[kcs[kc]] = kcs[kc]; 12754 } 12755 12756 return k; 12757} 12758 12759 12760 12761/***/ }), 12762
12763/***/ "./js/foundation.util.mediaQuery.js": 12764/*!******************************************!*\ 12765 !*** ./js/foundation.util.mediaQuery.js ***! 12766 \******************************************/ 12767/*! exports provided: MediaQuery */ 12768/***/ (function(module, __webpack_exports__, __webpack_require__) { 12769 12770"use strict"; 12771__webpack_require__.r(__webpack_exports__); 12772/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MediaQuery", function() { return MediaQuery; }); 12773/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 12774/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 12775 12776 12777function _typeof(obj) { 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); } 12778 12779function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } 12780 12781function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } 12782 12783function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_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; } 12784 12785function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } 12786 12787 // Default set of media queries 12788 12789var defaultQueries = { 12790 'default': 'only screen', 12791 landscape: 'only screen and (orientation: landscape)', 12792 portrait: 'only screen and (orientation: portrait)', 12793 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)' 12794}; // matchMedia() polyfill - Test a CSS media type/query in JS. 12795// Authors & copyright © 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. MIT license 12796 12797/* eslint-disable */ 12798 12799window.matchMedia || (window.matchMedia = function () { 12800 "use strict"; // For browsers that support matchMedium api such as IE 9 and webkit 12801 12802 var styleMedia = window.styleMedia || window.media; // For those that don't support matchMedium 12803 12804 if (!styleMedia) { 12805 var style = document.createElement('style'), 12806 script = document.getElementsByTagName('script')[0], 12807 info = null; 12808 style.type = 'text/css'; 12809 style.id = 'matchmediajs-test'; 12810 12811 if (!script) { 12812 document.head.appendChild(style); 12813 } else { 12814 script.parentNode.insertBefore(style, script); 12815 } // 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers 12816 12817 12818 info = 'getComputedStyle' in window && window.getComputedStyle(style, null) || style.currentStyle; 12819 styleMedia = { 12820 matchMedium: function matchMedium(media) { 12821 var text = '@media ' + media + '{ #matchmediajs-test { width: 1px; } }'; // 'style.styleSheet' is used by IE <= 8 and 'style.textContent' for all other browsers 12822 12823 if (style.styleSheet) { 12824 style.styleSheet.cssText = text; 12825 } else { 12826 style.textContent = text; 12827 } // Test if media query is true or false 12828 12829 12830 return info.width === '1px'; 12831 } 12832 }; 12833 } 12834 12835 return function (media) { 12836 return { 12837 matches: styleMedia.matchMedium(media || 'all'), 12838 media: media || 'all' 12839 }; 12840 }; 12841}()); 12842/* eslint-enable */ 12843 12844var MediaQuery = { 12845 queries: [], 12846 current: '', 12847 12848 /** 12849 * Initializes the media query helper, by extracting the breakpoint list from the CSS and activating the breakpoint watcher. 12850 * @function 12851 * @private 12852 */ 12853 _init: function _init() { 12854 // make sure the initialization is only done once when calling _init() several times 12855 if (this.isInitialized === true) { 12856 return; 12857 } else { 12858 this.isInitialized = true; 12859 } 12860 12861 var self = this; 12862 var $meta = jquery__WEBPACK_IMPORTED_MODULE_0___default()('meta.foundation-mq'); 12863 12864 if (!$meta.length) { 12865 jquery__WEBPACK_IMPORTED_MODULE_0___default()('<meta class="foundation-mq">').appendTo(document.head); 12866 } 12867 12868 var extractedStyles = jquery__WEBPACK_IMPORTED_MODULE_0___default()('.foundation-mq').css('font-family'); 12869 var namedQueries; 12870 namedQueries = parseStyleToObject(extractedStyles); 12871 self.queries = []; // reset 12872
vendor: 4,471 bytes, lines 12873-13021
12873 for (var key in namedQueries) { 12874 if (namedQueries.hasOwnProperty(key)) { 12875 self.queries.push({ 12876 name: key, 12877 value: "only screen and (min-width: ".concat(namedQueries[key], ")") 12878 }); 12879 } 12880 } 12881 12882 this.current = this._getCurrentSize(); 12883 12884 this._watcher(); 12885 }, 12886 12887 /** 12888 * Reinitializes the media query helper. 12889 * Useful if your CSS breakpoint configuration has just been loaded or has changed since the initialization. 12890 * @function 12891 * @private 12892 */ 12893 _reInit: function _reInit() { 12894 this.isInitialized = false; 12895 12896 this._init(); 12897 }, 12898 12899 /** 12900 * Checks if the screen is at least as wide as a breakpoint. 12901 * @function 12902 * @param {String} size - Name of the breakpoint to check. 12903 * @returns {Boolean} `true` if the breakpoint matches, `false` if it's smaller. 12904 */ 12905 atLeast: function atLeast(size) { 12906 var query = this.get(size); 12907 12908 if (query) { 12909 return window.matchMedia(query).matches; 12910 } 12911 12912 return false; 12913 }, 12914 12915 /** 12916 * Checks if the screen is within the given breakpoint. 12917 * If smaller than the breakpoint of larger than its upper limit it returns false. 12918 * @function 12919 * @param {String} size - Name of the breakpoint to check. 12920 * @returns {Boolean} `true` if the breakpoint matches, `false` otherwise. 12921 */ 12922 only: function only(size) { 12923 return size === this._getCurrentSize(); 12924 }, 12925 12926 /** 12927 * Checks if the screen is within a breakpoint or smaller. 12928 * @function 12929 * @param {String} size - Name of the breakpoint to check. 12930 * @returns {Boolean} `true` if the breakpoint matches, `false` if it's larger. 12931 */ 12932 upTo: function upTo(size) { 12933 var nextSize = this.next(size); // If the next breakpoint does not match, the screen is smaller than 12934 // the upper limit of this breakpoint. 12935 12936 if (nextSize) { 12937 return !this.atLeast(nextSize); 12938 } // If there is no next breakpoint, the "size" breakpoint does not have 12939 // an upper limit and the screen will always be within it or smaller. 12940 12941 12942 return true; 12943 }, 12944 12945 /** 12946 * Checks if the screen matches to a breakpoint. 12947 * @function 12948 * @param {String} size - Name of the breakpoint to check, either 'small only' or 'small'. Omitting 'only' falls back to using atLeast() method. 12949 * @returns {Boolean} `true` if the breakpoint matches, `false` if it does not. 12950 */ 12951 is: function is(size) { 12952 var parts = size.trim().split(' ').filter(function (p) { 12953 return !!p.length; 12954 }); 12955 12956 var _parts = _slicedToArray(parts, 2), 12957 bpSize = _parts[0], 12958 _parts$ = _parts[1], 12959 bpModifier = _parts$ === void 0 ? '' : _parts$; // Only the breakpont 12960 12961 12962 if (bpModifier === 'only') { 12963 return this.only(bpSize); 12964 } // At least the breakpoint (included) 12965 12966 12967 if (!bpModifier || bpModifier === 'up') { 12968 return this.atLeast(bpSize); 12969 } // Up to the breakpoint (included) 12970 12971 12972 if (bpModifier === 'down') { 12973 return this.upTo(bpSize); 12974 } 12975 12976 throw new Error("\n Invalid breakpoint passed to MediaQuery.is().\n Expected a breakpoint name formatted like \"<size> <modifier>\", got \"".concat(size, "\".\n ")); 12977 }, 12978 12979 /** 12980 * Gets the media query of a breakpoint. 12981 * @function 12982 * @param {String} size - Name of the breakpoint to get. 12983 * @returns {String|null} - The media query of the breakpoint, or `null` if the breakpoint doesn't exist. 12984 */ 12985 get: function get(size) { 12986 for (var i in this.queries) { 12987 if (this.queries.hasOwnProperty(i)) { 12988 var query = this.queries[i]; 12989 if (size === query.name) return query.value; 12990 } 12991 } 12992 12993 return null; 12994 }, 12995 12996 /** 12997 * Get the breakpoint following the given breakpoint. 12998 * @function 12999 * @param {String} size - Name of the breakpoint. 13000 * @returns {String|null} - The name of the following breakpoint, or `null` if the passed breakpoint was the last one. 13001 */ 13002 next: function next(size) { 13003 var _this = this; 13004 13005 var queryIndex = this.queries.findIndex(function (q) { 13006 return _this._getQueryName(q) === size; 13007 }); 13008 13009 if (queryIndex === -1) { 13010 throw new Error("\n Unknown breakpoint \"".concat(size, "\" passed to MediaQuery.next().\n Ensure it is present in your Sass \"$breakpoints\" setting.\n ")); 13011 } 13012 13013 var nextQuery = this.queries[queryIndex + 1]; 13014 return nextQuery ? nextQuery.name : null; 13015 }, 13016 13017 /** 13018 * Returns the name of the breakpoint related to the given value. 13019 * @function 13020 * @private 13021 * @param {String|Object}
vendor: 11,315 bytes, lines 13021-13372
13021 value - Breakpoint name or query object. 13022 * @returns {String} Name of the breakpoint. 13023 */ 13024 _getQueryName: function _getQueryName(value) { 13025 if (typeof value === 'string') return value; 13026 if (_typeof(value) === 'object') return value.name; 13027 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 ")); 13028 }, 13029 13030 /** 13031 * Gets the current breakpoint name by testing every breakpoint and returning the last one to match (the biggest one). 13032 * @function 13033 * @private 13034 * @returns {String} Name of the current breakpoint. 13035 */ 13036 _getCurrentSize: function _getCurrentSize() { 13037 var matched; 13038 13039 for (var i = 0; i < this.queries.length; i++) { 13040 var query = this.queries[i]; 13041 13042 if (window.matchMedia(query.value).matches) { 13043 matched = query; 13044 } 13045 } 13046 13047 return matched && this._getQueryName(matched); 13048 }, 13049 13050 /** 13051 * Activates the breakpoint watcher, which fires an event on the window whenever the breakpoint changes. 13052 * @function 13053 * @private 13054 */ 13055 _watcher: function _watcher() { 13056 var _this2 = this; 13057 13058 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('resize.zf.mediaquery').on('resize.zf.mediaquery', function () { 13059 var newSize = _this2._getCurrentSize(), 13060 currentSize = _this2.current; 13061 13062 if (newSize !== currentSize) { 13063 // Change the current media query 13064 _this2.current = newSize; // Broadcast the media query change on the window 13065 13066 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).trigger('changed.zf.mediaquery', [newSize, currentSize]); 13067 } 13068 }); 13069 } 13070}; // Thank you: https://github.com/sindresorhus/query-string 13071 13072function parseStyleToObject(str) { 13073 var styleObject = {}; 13074 13075 if (typeof str !== 'string') { 13076 return styleObject; 13077 } 13078 13079 str = str.trim().slice(1, -1); // browsers re-quote string style values 13080 13081 if (!str) { 13082 return styleObject; 13083 } 13084 13085 styleObject = str.split('&').reduce(function (ret, param) { 13086 var parts = param.replace(/\+/g, ' ').split('='); 13087 var key = parts[0]; 13088 var val = parts[1]; 13089 key = decodeURIComponent(key); // missing `=` should be `null`: 13090 // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters 13091 13092 val = typeof val === 'undefined' ? null : decodeURIComponent(val); 13093 13094 if (!ret.hasOwnProperty(key)) { 13095 ret[key] = val; 13096 } else if (Array.isArray(ret[key])) { 13097 ret[key].push(val); 13098 } else { 13099 ret[key] = [ret[key], val]; 13100 } 13101 13102 return ret; 13103 }, {}); 13104 return styleObject; 13105} 13106 13107 13108 13109/***/ }), 13110 13111/***/ "./js/foundation.util.motion.js": 13112/*!**************************************!*\ 13113 !*** ./js/foundation.util.motion.js ***! 13114 \**************************************/ 13115/*! exports provided: Move, Motion */ 13116/***/ (function(module, __webpack_exports__, __webpack_require__) { 13117 13118"use strict"; 13119__webpack_require__.r(__webpack_exports__); 13120/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Move", function() { return Move; }); 13121/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Motion", function() { return Motion; }); 13122/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 13123/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 13124/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 13125 13126 13127 13128 13129/** 13130 * Motion module. 13131 * @module foundation.motion 13132 */ 13133 13134var initClasses = ['mui-enter', 'mui-leave']; 13135var activeClasses = ['mui-enter-active', 'mui-leave-active']; 13136var Motion = { 13137 animateIn: function animateIn(element, animation, cb) { 13138 animate(true, element, animation, cb); 13139 }, 13140 animateOut: function animateOut(element, animation, cb) { 13141 animate(false, element, animation, cb); 13142 } 13143}; 13144 13145function Move(duration, elem, fn) { 13146 var anim, 13147 prog, 13148 start = null; // console.log('called'); 13149 13150 if (duration === 0) { 13151 fn.apply(elem); 13152 elem.trigger('finished.zf.animate', [elem]).triggerHandler('finished.zf.animate', [elem]); 13153 return; 13154 } 13155 13156 function move(ts) { 13157 if (!start) start = ts; // console.log(start, ts); 13158 13159 prog = ts - start; 13160 fn.apply(elem); 13161 13162 if (prog < duration) { 13163 anim = window.requestAnimationFrame(move, elem); 13164 } else { 13165 window.cancelAnimationFrame(anim); 13166 elem.trigger('finished.zf.animate', [elem]).triggerHandler('finished.zf.animate', [elem]); 13167 } 13168 } 13169 13170 anim = window.requestAnimationFrame(move); 13171} 13172/** 13173 * Animates an element in or out using a CSS transition class. 13174 * @function 13175 * @private 13176 * @param {Boolean} isIn - Defines if the animation is in or out. 13177 * @param {Object} element - jQuery or HTML object to animate. 13178 * @param {String} animation - CSS class to use. 13179 * @param {Function} cb - Callback to run when animation is finished. 13180 */ 13181 13182 13183function animate(isIn, element, animation, cb) { 13184 element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(element).eq(0); 13185 if (!element.length) return; 13186 var initClass = isIn ? initClasses[0] : initClasses[1]; 13187 var activeClass = isIn ? activeClasses[0] : activeClasses[1]; // Set up the animation 13188 13189 reset(); 13190 element.addClass(animation).css('transition', 'none'); 13191 requestAnimationFrame(function () { 13192 element.addClass(initClass); 13193 if (isIn) element.show(); 13194 }); // Start the animation 13195 13196 requestAnimationFrame(function () { 13197 // will trigger the browser to synchronously calculate the style and layout 13198 // also called reflow or layout thrashing 13199 // see https://gist.github.com/paulirish/5d52fb081b3570c81e3a 13200 element[0].offsetWidth; 13201 element.css('transition', '').addClass(activeClass); 13202 }); // Clean up the animation when it finishes 13203 13204 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 13205 13206 function finish() { 13207 if (!isIn) element.hide(); 13208 reset(); 13209 if (cb) cb.apply(element); 13210 } // Resets transitions and removes motion-specific classes 13211 13212 13213 function reset() { 13214 element[0].style.transitionDuration = 0; 13215 element.removeClass("".concat(initClass, " ").concat(activeClass, " ").concat(animation)); 13216 } 13217} 13218 13219 13220 13221/***/ }), 13222 13223/***/ "./js/foundation.util.nest.js": 13224/*!************************************!*\ 13225 !*** ./js/foundation.util.nest.js ***! 13226 \************************************/ 13227/*! exports provided: Nest */ 13228/***/ (function(module, __webpack_exports__, __webpack_require__) { 13229 13230"use strict"; 13231__webpack_require__.r(__webpack_exports__); 13232/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Nest", function() { return Nest; }); 13233/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 13234/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 13235 13236 13237 13238var Nest = { 13239 Feather: function Feather(menu) { 13240 var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'zf'; 13241 menu.attr('role', 'menubar'); 13242 menu.find('a').attr({ 13243 'role': 'menuitem' 13244 }); 13245 var items = menu.find('li').attr({ 13246 'role': 'none' 13247 }), 13248 subMenuClass = "is-".concat(type, "-submenu"), 13249 subItemClass = "".concat(subMenuClass, "-item"), 13250 hasSubClass = "is-".concat(type, "-submenu-parent"), 13251 applyAria = type !== 'accordion'; // Accordions handle their own ARIA attriutes. 13252 13253 items.each(function () { 13254 var $item = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 13255 $sub = $item.children('ul'); 13256 13257 if ($sub.length) { 13258 $item.addClass(hasSubClass); 13259 13260 if (applyAria) { 13261 $item.attr({ 13262 'aria-haspopup': true, 13263 'aria-label': $item.children('a:first').text() 13264 }); // Note: Drilldowns behave differently in how they hide, and so need 13265 // additional attributes. We should look if this possibly over-generalized 13266 // utility (Nest) is appropriate when we rework menus in 6.4 13267 13268 if (type === 'drilldown') { 13269 $item.attr({ 13270 'aria-expanded': false 13271 }); 13272 } 13273 } 13274 13275 $sub.addClass("submenu ".concat(subMenuClass)).attr({ 13276 'data-submenu': '', 13277 'role': 'menubar' 13278 }); 13279 13280 if (type === 'drilldown') { 13281 $sub.attr({ 13282 'aria-hidden': true 13283 }); 13284 } 13285 } 13286 13287 if ($item.parent('[data-submenu]').length) { 13288 $item.addClass("is-submenu-item ".concat(subItemClass)); 13289 } 13290 }); 13291 return; 13292 }, 13293 Burn: function Burn(menu, type) { 13294 var //items = menu.find('li'), 13295 subMenuClass = "is-".concat(type, "-submenu"), 13296 subItemClass = "".concat(subMenuClass, "-item"), 13297 hasSubClass = "is-".concat(type, "-submenu-parent"); 13298 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', ''); 13299 } 13300}; 13301 13302 13303/***/ }), 13304 13305/***/ "./js/foundation.util.timer.js": 13306/*!*************************************!*\ 13307 !*** ./js/foundation.util.timer.js ***! 13308 \*************************************/ 13309/*! exports provided: Timer */ 13310/***/ (function(module, __webpack_exports__, __webpack_require__) { 13311 13312"use strict"; 13313__webpack_require__.r(__webpack_exports__); 13314/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Timer", function() { return Timer; }); 13315/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 13316/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 13317 13318 13319 13320 13321function Timer(elem, options, cb) { 13322 var _this = this, 13323 duration = options.duration, 13324 //options is an object for easily adding features later. 13325 nameSpace = Object.keys(elem.data())[0] || 'timer', 13326 remain = -1, 13327 start, 13328 timer; 13329 13330 this.isPaused = false; 13331 13332 this.restart = function () { 13333 remain = -1; 13334 clearTimeout(timer); 13335 this.start(); 13336 }; 13337 13338 this.start = function () { 13339 this.isPaused = false; // if(!elem.data('paused')){ return false; }//maybe implement this sanity check if used for other things. 13340 13341 clearTimeout(timer); 13342 remain = remain <= 0 ? duration : remain; 13343 elem.data('paused', false); 13344 start = Date.now(); 13345 timer = setTimeout(function () { 13346 if (options.infinite) { 13347 _this.restart(); //rerun the timer. 13348 13349 } 13350 13351 if (cb && typeof cb === 'function') { 13352 cb(); 13353 } 13354 }, remain); 13355 elem.trigger("timerstart.zf.".concat(nameSpace)); 13356 }; 13357 13358 this.pause = function () { 13359 this.isPaused = true; //if(elem.data('paused')){ return false; }//maybe implement this sanity check if used for other things. 13360 13361 clearTimeout(timer); 13362 elem.data('paused', true); 13363 var end = Date.now(); 13364 remain = remain - (end - start); 13365 elem.trigger("timerpaused.zf.".concat(nameSpace)); 13366 }; 13367} 13368 13369 13370 13371/***/ }), 13372
13373/***/ "./js/foundation.util.touch.js": 13374/*!*************************************!*\ 13375 !*** ./js/foundation.util.touch.js ***! 13376 \*************************************/ 13377/*! exports provided: Touch */ 13378/***/ (function(module, __webpack_exports__, __webpack_require__) { 13379 13380"use strict"; 13381__webpack_require__.r(__webpack_exports__); 13382/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Touch", function() { return Touch; }); 13383/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 13384/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 13385function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 13386 13387function _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); } } 13388 13389function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 13390 13391//************************************************** 13392//**Work inspired by multiple jquery swipe plugins** 13393//**Done by Yohai Ararat *************************** 13394//************************************************** 13395 13396var Touch = {}; 13397var startPosX, 13398 startPosY, 13399 startTime, 13400 elapsedTime, 13401 startEvent, 13402 isMoving = false, 13403 didMoved = false; 13404 13405function onTouchEnd(e) { 13406 this.removeEventListener('touchmove', onTouchMove); 13407 this.removeEventListener('touchend', onTouchEnd); // If the touch did not move, consider it as a "tap" 13408 13409 if (!didMoved) { 13410 var tapEvent = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.Event('tap', startEvent || e); 13411 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).trigger(tapEvent); 13412 } 13413 13414 startEvent = null; 13415 isMoving = false; 13416 didMoved = false; 13417} 13418 13419function onTouchMove(e) { 13420 if (jquery__WEBPACK_IMPORTED_MODULE_0___default.a.spotSwipe.preventDefault) { 13421 e.preventDefault(); 13422 } 13423 13424 if (isMoving) { 13425 var x = e.touches[0].pageX; 13426 var y = e.touches[0].pageY; 13427 var dx = startPosX - x; 13428 var dy = startPosY - y; 13429 var dir; 13430 didMoved = true; 13431 elapsedTime = new Date().getTime() - startTime; 13432 13433 if (Math.abs(dx) >= jquery__WEBPACK_IMPORTED_MODULE_0___default.a.spotSwipe.moveThreshold && elapsedTime <= jquery__WEBPACK_IMPORTED_MODULE_0___default.a.spotSwipe.timeThreshold) { 13434 dir = dx > 0 ? 'left' : 'right'; 13435 } // else if(Math.abs(dy) >= $.spotSwipe.moveThreshold && elapsedTime <= $.spotSwipe.timeThreshold) { 13436 // dir = dy > 0 ? 'down' : 'up'; 13437 // } 13438 13439 13440 if (dir) { 13441 e.preventDefault(); 13442 onTouchEnd.apply(this, arguments); 13443 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))); 13444 } 13445 } 13446} 13447 13448function onTouchStart(e) { 13449 if (e.touches.length == 1) { 13450 startPosX = e.touches[0].pageX; 13451 startPosY = e.touches[0].pageY; 13452 startEvent = e; 13453 isMoving = true; 13454 didMoved = false; 13455 startTime = new Date().getTime(); 13456 this.addEventListener('touchmove', onTouchMove, false); 13457 this.addEventListener('touchend', onTouchEnd, false); 13458 } 13459} 13460 13461function init() { 13462 this.addEventListener && this.addEventListener('touchstart', onTouchStart, false); 13463} 13464 13465function teardown() { 13466 this.removeEventListener('touchstart', onTouchStart); 13467} 13468 13469var SpotSwipe = 13470/*#__PURE__*/ 13471function () { 13472 function SpotSwipe($) { 13473 _classCallCheck(this, SpotSwipe); 13474 13475 this.version = '1.0.0'; 13476 this.enabled = 'ontouchstart' in document.documentElement; 13477 this.preventDefault = false;
vendor: 2,686 bytes, lines 13478-13575
13478 this.moveThreshold = 75; 13479 this.timeThreshold = 200; 13480 this.$ = $; 13481 13482 this._init(); 13483 } 13484 13485 _createClass(SpotSwipe, [{ 13486 key: "_init", 13487 value: function _init() { 13488 var $ = this.$; 13489 $.event.special.swipe = { 13490 setup: init 13491 }; 13492 $.event.special.tap = { 13493 setup: init 13494 }; 13495 $.each(['left', 'up', 'down', 'right'], function () { 13496 $.event.special["swipe".concat(this)] = { 13497 setup: function setup() { 13498 $(this).on('swipe', $.noop); 13499 } 13500 }; 13501 }); 13502 } 13503 }]); 13504 13505 return SpotSwipe; 13506}(); 13507/**************************************************** 13508 * As far as I can tell, both setupSpotSwipe and * 13509 * setupTouchHandler should be idempotent, * 13510 * because they directly replace functions & * 13511 * values, and do not add event handlers directly. * 13512 ****************************************************/ 13513 13514 13515Touch.setupSpotSwipe = function ($) { 13516 $.spotSwipe = new SpotSwipe($); 13517}; 13518/**************************************************** 13519 * Method for adding pseudo drag events to elements * 13520 ***************************************************/ 13521 13522 13523Touch.setupTouchHandler = function ($) { 13524 $.fn.addTouch = function () { 13525 this.each(function (i, el) { 13526 $(el).bind('touchstart touchmove touchend touchcancel', function (event) { 13527 //we pass the original event object because the jQuery event 13528 //object is normalized to w3c specs and does not provide the TouchList 13529 handleTouch(event); 13530 }); 13531 }); 13532 13533 var handleTouch = function handleTouch(event) { 13534 var touches = event.changedTouches, 13535 first = touches[0], 13536 eventTypes = { 13537 touchstart: 'mousedown', 13538 touchmove: 'mousemove', 13539 touchend: 'mouseup' 13540 }, 13541 type = eventTypes[event.type], 13542 simulatedEvent; 13543 13544 if ('MouseEvent' in window && typeof window.MouseEvent === 'function') { 13545 simulatedEvent = new window.MouseEvent(type, { 13546 'bubbles': true, 13547 'cancelable': true, 13548 'screenX': first.screenX, 13549 'screenY': first.screenY, 13550 'clientX': first.clientX, 13551 'clientY': first.clientY 13552 }); 13553 } else { 13554 simulatedEvent = document.createEvent('MouseEvent'); 13555 simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 0 13556 /*left*/ 13557 , null); 13558 } 13559 13560 first.target.dispatchEvent(simulatedEvent); 13561 }; 13562 }; 13563}; 13564 13565Touch.init = function ($) { 13566 if (typeof $.spotSwipe === 'undefined') { 13567 Touch.setupSpotSwipe($); 13568 Touch.setupTouchHandler($); 13569 } 13570}; 13571 13572 13573 13574/***/ }), 13575
vendor: 8,561 bytes, lines 13576-13781
13576/***/ "./js/foundation.util.triggers.js": 13577/*!****************************************!*\ 13578 !*** ./js/foundation.util.triggers.js ***! 13579 \****************************************/ 13580/*! exports provided: Triggers */ 13581/***/ (function(module, __webpack_exports__, __webpack_require__) { 13582 13583"use strict"; 13584__webpack_require__.r(__webpack_exports__); 13585/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Triggers", function() { return Triggers; }); 13586/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 13587/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 13588/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 13589/* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.motion */ "./js/foundation.util.motion.js"); 13590 13591 13592function _typeof(obj) { 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); } 13593 13594 13595 13596 13597 13598var MutationObserver = function () { 13599 var prefixes = ['WebKit', 'Moz', 'O', 'Ms', '']; 13600 13601 for (var i = 0; i < prefixes.length; i++) { 13602 if ("".concat(prefixes[i], "MutationObserver") in window) { 13603 return window["".concat(prefixes[i], "MutationObserver")]; 13604 } 13605 } 13606 13607 return false; 13608}(); 13609 13610var triggers = function triggers(el, type) { 13611 el.data(type).split(' ').forEach(function (id) { 13612 jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(id))[type === 'close' ? 'trigger' : 'triggerHandler']("".concat(type, ".zf.trigger"), [el]); 13613 }); 13614}; 13615 13616var Triggers = { 13617 Listeners: { 13618 Basic: {}, 13619 Global: {} 13620 }, 13621 Initializers: {} 13622}; 13623Triggers.Listeners.Basic = { 13624 openListener: function openListener() { 13625 triggers(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 'open'); 13626 }, 13627 closeListener: function closeListener() { 13628 var id = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('close'); 13629 13630 if (id) { 13631 triggers(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 'close'); 13632 } else { 13633 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).trigger('close.zf.trigger'); 13634 } 13635 }, 13636 toggleListener: function toggleListener() { 13637 var id = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('toggle'); 13638 13639 if (id) { 13640 triggers(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 'toggle'); 13641 } else { 13642 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).trigger('toggle.zf.trigger'); 13643 } 13644 }, 13645 closeableListener: function closeableListener(e) { 13646 var animation = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('closable'); // Only close the first closable element. See https://git.io/zf-7833 13647 13648 e.stopPropagation(); 13649 13650 if (animation !== '') { 13651 _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Motion"].animateOut(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), animation, function () { 13652 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).trigger('closed.zf'); 13653 }); 13654 } else { 13655 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).fadeOut().trigger('closed.zf'); 13656 } 13657 }, 13658 toggleFocusListener: function toggleFocusListener() { 13659 var id = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('toggle-focus'); 13660 jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(id)).triggerHandler('toggle.zf.trigger', [jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)]); 13661 } 13662}; // Elements with [data-open] will reveal a plugin that supports it when clicked. 13663 13664Triggers.Initializers.addOpenListener = function ($elem) { 13665 $elem.off('click.zf.trigger', Triggers.Listeners.Basic.openListener); 13666 $elem.on('click.zf.trigger', '[data-open]', Triggers.Listeners.Basic.openListener); 13667}; // Elements with [data-close] will close a plugin that supports it when clicked. 13668// If used without a value on [data-close], the event will bubble, allowing it to close a parent component. 13669 13670 13671Triggers.Initializers.addCloseListener = function ($elem) { 13672 $elem.off('click.zf.trigger', Triggers.Listeners.Basic.closeListener); 13673 $elem.on('click.zf.trigger', '[data-close]', Triggers.Listeners.Basic.closeListener); 13674}; // Elements with [data-toggle] will toggle a plugin that supports it when clicked. 13675 13676 13677Triggers.Initializers.addToggleListener = function ($elem) { 13678 $elem.off('click.zf.trigger', Triggers.Listeners.Basic.toggleListener); 13679 $elem.on('click.zf.trigger', '[data-toggle]', Triggers.Listeners.Basic.toggleListener); 13680}; // Elements with [data-closable] will respond to close.zf.trigger events. 13681 13682 13683Triggers.Initializers.addCloseableListener = function ($elem) { 13684 $elem.off('close.zf.trigger', Triggers.Listeners.Basic.closeableListener); 13685 $elem.on('close.zf.trigger', '[data-closeable], [data-closable]', Triggers.Listeners.Basic.closeableListener); 13686}; // Elements with [data-toggle-focus] will respond to coming in and out of focus 13687 13688 13689Triggers.Initializers.addToggleFocusListener = function ($elem) { 13690 $elem.off('focus.zf.trigger blur.zf.trigger', Triggers.Listeners.Basic.toggleFocusListener); 13691 $elem.on('focus.zf.trigger blur.zf.trigger', '[data-toggle-focus]', Triggers.Listeners.Basic.toggleFocusListener); 13692}; // More Global/complex listeners and triggers 13693 13694 13695Triggers.Listeners.Global = { 13696 resizeListener: function resizeListener($nodes) { 13697 if (!MutationObserver) { 13698 //fallback for IE 9 13699 $nodes.each(function () { 13700 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).triggerHandler('resizeme.zf.trigger'); 13701 }); 13702 } //trigger all listening elements and signal a resize event 13703 13704 13705 $nodes.attr('data-events', "resize"); 13706 }, 13707 scrollListener: function scrollListener($nodes) { 13708 if (!MutationObserver) { 13709 //fallback for IE 9 13710 $nodes.each(function () { 13711 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).triggerHandler('scrollme.zf.trigger'); 13712 }); 13713 } //trigger all listening elements and signal a scroll event 13714 13715 13716 $nodes.attr('data-events', "scroll"); 13717 }, 13718 closeMeListener: function closeMeListener(e, pluginId) { 13719 var plugin = e.namespace.split('.')[0]; 13720 var plugins = jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-".concat(plugin, "]")).not("[data-yeti-box=\"".concat(pluginId, "\"]")); 13721 plugins.each(function () { 13722 var _this = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this); 13723 13724 _this.triggerHandler('close.zf.trigger', [_this]); 13725 }); 13726 } // Global, parses whole document. 13727 13728}; 13729 13730Triggers.Initializers.addClosemeListener = function (pluginName) { 13731 var yetiBoxes = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-yeti-box]'), 13732 plugNames = ['dropdown', 'tooltip', 'reveal']; 13733 13734 if (pluginName) { 13735 if (typeof pluginName === 'string') { 13736 plugNames.push(pluginName); 13737 } else if (_typeof(pluginName) === 'object' && typeof pluginName[0] === 'string') { 13738 plugNames = plugNames.concat(pluginName); 13739 } else { 13740 console.error('Plugin names must be strings'); 13741 } 13742 } 13743 13744 if (yetiBoxes.length) { 13745 var listeners = plugNames.map(function (name) { 13746 return "closeme.zf.".concat(name); 13747 }).join(' '); 13748 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(listeners).on(listeners, Triggers.Listeners.Global.closeMeListener); 13749 } 13750}; 13751 13752function debounceGlobalListener(debounce, trigger, listener) { 13753 var timer, 13754 args = Array.prototype.slice.call(arguments, 3); 13755 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(trigger).on(trigger, function (e) { 13756 if (timer) { 13757 clearTimeout(timer); 13758 } 13759 13760 timer = setTimeout(function () { 13761 listener.apply(null, args); 13762 }, debounce || 10); //default time to emit scroll event 13763 }); 13764} 13765 13766Triggers.Initializers.addResizeListener = function (debounce) { 13767 var $nodes = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-resize]'); 13768 13769 if ($nodes.length) { 13770 debounceGlobalListener(debounce, 'resize.zf.trigger', Triggers.Listeners.Global.resizeListener, $nodes); 13771 } 13772}; 13773 13774Triggers.Initializers.addScrollListener = function (debounce) { 13775 var $nodes = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-scroll]'); 13776 13777 if ($nodes.length) { 13778 debounceGlobalListener(debounce, 'scroll.zf.trigger', Triggers.Listeners.Global.scrollListener, $nodes); 13779 } 13780}; 13781
vendor: 3,263 bytes, lines 13782-13870
13782Triggers.Initializers.addMutationEventsListener = function ($elem) { 13783 if (!MutationObserver) { 13784 return false; 13785 } 13786 13787 var $nodes = $elem.find('[data-resize], [data-scroll], [data-mutate]'); //element callback 13788 13789 var listeningElementsMutation = function listeningElementsMutation(mutationRecordsList) { 13790 var $target = jquery__WEBPACK_IMPORTED_MODULE_0___default()(mutationRecordsList[0].target); //trigger the event handler for the element depending on type 13791 13792 switch (mutationRecordsList[0].type) { 13793 case "attributes": 13794 if ($target.attr("data-events") === "scroll" && mutationRecordsList[0].attributeName === "data-events") { 13795 $target.triggerHandler('scrollme.zf.trigger', [$target, window.pageYOffset]); 13796 } 13797 13798 if ($target.attr("data-events") === "resize" && mutationRecordsList[0].attributeName === "data-events") { 13799 $target.triggerHandler('resizeme.zf.trigger', [$target]); 13800 } 13801 13802 if (mutationRecordsList[0].attributeName === "style") { 13803 $target.closest("[data-mutate]").attr("data-events", "mutate"); 13804 $target.closest("[data-mutate]").triggerHandler('mutateme.zf.trigger', [$target.closest("[data-mutate]")]); 13805 } 13806 13807 break; 13808 13809 case "childList": 13810 $target.closest("[data-mutate]").attr("data-events", "mutate"); 13811 $target.closest("[data-mutate]").triggerHandler('mutateme.zf.trigger', [$target.closest("[data-mutate]")]); 13812 break; 13813 13814 default: 13815 return false; 13816 //nothing 13817 } 13818 }; 13819 13820 if ($nodes.length) { 13821 //for each element that needs to listen for resizing, scrolling, or mutation add a single observer 13822 for (var i = 0; i <= $nodes.length - 1; i++) { 13823 var elementObserver = new MutationObserver(listeningElementsMutation); 13824 elementObserver.observe($nodes[i], { 13825 attributes: true, 13826 childList: true, 13827 characterData: false, 13828 subtree: true, 13829 attributeFilter: ["data-events", "style"] 13830 }); 13831 } 13832 } 13833}; 13834 13835Triggers.Initializers.addSimpleListeners = function () { 13836 var $document = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document); 13837 Triggers.Initializers.addOpenListener($document); 13838 Triggers.Initializers.addCloseListener($document); 13839 Triggers.Initializers.addToggleListener($document); 13840 Triggers.Initializers.addCloseableListener($document); 13841 Triggers.Initializers.addToggleFocusListener($document); 13842}; 13843 13844Triggers.Initializers.addGlobalListeners = function () { 13845 var $document = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document); 13846 Triggers.Initializers.addMutationEventsListener($document); 13847 Triggers.Initializers.addResizeListener(); 13848 Triggers.Initializers.addScrollListener(); 13849 Triggers.Initializers.addClosemeListener(); 13850}; 13851 13852Triggers.init = function ($, Foundation) { 13853 Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["onLoad"])($(window), function () { 13854 if ($.triggersInitialized !== true) { 13855 Triggers.Initializers.addSimpleListeners(); 13856 Triggers.Initializers.addGlobalListeners(); 13857 $.triggersInitialized = true; 13858 } 13859 }); 13860 13861 if (Foundation) { 13862 Foundation.Triggers = Triggers; // Legacy included to be backwards compatible for now. 13863 13864 Foundation.IHearYou = Triggers.Initializers.addGlobalListeners; 13865 } 13866}; 13867 13868 13869 13870/***/ })
13870, 13871 13872/***/ 0: 13873/*!****************************************!*\ 13874 !*** multi ./js/entries/foundation.js ***! 13875 \****************************************/ 13876/*! no static exports found */ 13877/***/ (function(module, exports, __webpack_require__) { 13878 13879module.exports = __webpack_require__(/*! /Users/joeworkman/Development/foundation-sites/js/entries/foundation.js */"./js/entries/foundation.js"); 13880 13881 13882/***/ }), 13883 13884/***/ "jquery": 13885/*!********************************************************************************************!*\ 13886 !*** external {"root":["jQuery"],"amd":"jquery","commonjs":"jquery","commonjs2":"jquery"} ***! 13887 \********************************************************************************************/ 13888/*! no static exports found */ 13889/***/ (function(module, exports) { 13890 13891module.exports = __WEBPACK_EXTERNAL_MODULE_jquery__; 13892 13893/***/ }) 13894 13895/******/ }); 13896}); 13897//# 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.