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,399 bytes, lines 287-369
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.className = 'Abide'; // ie9 back compat 356 357 this._init(); 358 } 359 /** 360 * Initializes the Abide plugin and calls functions to get Abide functioning on load. 361 * @private 362 */ 363 364 }, { 365 key: "_init", 366 value: function _init() { 367 var _this2 = this; 368 369 this.$inputs = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.merge
vendor: 10,563 bytes, lines 369-692
369( // Consider as input to validate: 370 this.$element.find('input').not('[type=submit]'), // * all input fields expect submit 371 this.$element.find('textarea, select') // * all textareas and select fields 372 ); 373 var $globalErrors = this.$element.find('[data-abide-error]'); // Add a11y attributes to all fields 374 375 if (this.options.a11yAttributes) { 376 this.$inputs.each(function (i, input) { 377 return _this2.addA11yAttributes(jquery__WEBPACK_IMPORTED_MODULE_0___default()(input)); 378 }); 379 $globalErrors.each(function (i, error) { 380 return _this2.addGlobalErrorA11yAttributes(jquery__WEBPACK_IMPORTED_MODULE_0___default()(error)); 381 }); 382 } 383 384 this._events(); 385 } 386 /** 387 * Initializes events for Abide. 388 * @private 389 */ 390 391 }, { 392 key: "_events", 393 value: function _events() { 394 var _this3 = this; 395 396 this.$element.off('.abide').on('reset.zf.abide', function () { 397 _this3.resetForm(); 398 }).on('submit.zf.abide', function () { 399 return _this3.validateForm(); 400 }); 401 402 if (this.options.validateOn === 'fieldChange') { 403 this.$inputs.off('change.zf.abide').on('change.zf.abide', function (e) { 404 _this3.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target)); 405 }); 406 } 407 408 if (this.options.liveValidate) { 409 this.$inputs.off('input.zf.abide').on('input.zf.abide', function (e) { 410 _this3.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target)); 411 }); 412 } 413 414 if (this.options.validateOnBlur) { 415 this.$inputs.off('blur.zf.abide').on('blur.zf.abide', function (e) { 416 _this3.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target)); 417 }); 418 } 419 } 420 /** 421 * Calls necessary functions to update Abide upon DOM change 422 * @private 423 */ 424 425 }, { 426 key: "_reflow", 427 value: function _reflow() { 428 this._init(); 429 } 430 /** 431 * Checks whether or not a form element has the required attribute and if it's checked or not 432 * @param {Object} element - jQuery object to check for required attribute 433 * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty 434 */ 435 436 }, { 437 key: "requiredCheck", 438 value: function requiredCheck($el) { 439 if (!$el.attr('required')) return true; 440 var isGood = true; 441 442 switch ($el[0].type) { 443 case 'checkbox': 444 isGood = $el[0].checked; 445 break; 446 447 case 'select': 448 case 'select-one': 449 case 'select-multiple': 450 var opt = $el.find('option:selected'); 451 if (!opt.length || !opt.val()) isGood = false; 452 break; 453 454 default: 455 if (!$el.val() || !$el.val().length) isGood = false; 456 } 457 458 return isGood; 459 } 460 /** 461 * Get: 462 * - Based on $el, the first element(s) corresponding to `formErrorSelector` in this order: 463 * 1. The element's direct sibling('s). 464 * 2. The element's parent's children. 465 * - Element(s) with the attribute `[data-form-error-for]` set with the element's id. 466 * 467 * This allows for multiple form errors per input, though if none are found, no form errors will be shown. 468 * 469 * @param {Object} $el - jQuery object to use as reference to find the form error selector. 470 * @returns {Object} jQuery object with the selector. 471 */ 472 473 }, { 474 key: "findFormError", 475 value: function findFormError($el) { 476 var id = $el[0].id; 477 var $error = $el.siblings(this.options.formErrorSelector); 478 479 if (!$error.length) { 480 $error = $el.parent().find(this.options.formErrorSelector); 481 } 482 483 if (id) { 484 $error = $error.add(this.$element.find("[data-form-error-for=\"".concat(id, "\"]"))); 485 } 486 487 return $error; 488 } 489 /** 490 * Get the first element in this order: 491 * 2. The <label> with the attribute `[for="someInputId"]` 492 * 3. The `.closest()` <label> 493 * 494 * @param {Object} $el - jQuery object to check for required attribute 495 * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty 496 */ 497 498 }, { 499 key: "findLabel", 500 value: function findLabel($el) { 501 var id = $el[0].id; 502 var $label = this.$element.find("label[for=\"".concat(id, "\"]")); 503 504 if (!$label.length) { 505 return $el.closest('label'); 506 } 507 508 return $label; 509 } 510 /** 511 * Get the set of labels associated with a set of radio els in this order 512 * 2. The <label> with the attribute `[for="someInputId"]` 513 * 3. The `.closest()` <label> 514 * 515 * @param {Object} $el - jQuery object to check for required attribute 516 * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty 517 */ 518 519 }, { 520 key: "findRadioLabels", 521 value: function findRadioLabels($els) { 522 var _this4 = this; 523 524 var labels = $els.map(function (i, el) { 525 var id = el.id; 526 527 var $label = _this4.$element.find("label[for=\"".concat(id, "\"]")); 528 529 if (!$label.length) { 530 $label = jquery__WEBPACK_IMPORTED_MODULE_0___default()(el).closest('label'); 531 } 532 533 return $label[0]; 534 }); 535 return jquery__WEBPACK_IMPORTED_MODULE_0___default()(labels); 536 } 537 /** 538 * Adds the CSS error class as specified by the Abide settings to the label, input, and the form 539 * @param {Object} $el - jQuery object to add the class to 540 */ 541 542 }, { 543 key: "addErrorClasses", 544 value: function addErrorClasses($el) { 545 var $label = this.findLabel($el); 546 var $formError = this.findFormError($el); 547 548 if ($label.length) { 549 $label.addClass(this.options.labelErrorClass); 550 } 551 552 if ($formError.length) { 553 $formError.addClass(this.options.formErrorClass); 554 } 555 556 $el.addClass(this.options.inputErrorClass).attr({ 557 'data-invalid': '', 558 'aria-invalid': true 559 }); 560 } 561 /** 562 * Adds [for] and [role=alert] attributes to all form error targetting $el, 563 * and [aria-describedby] attribute to $el toward the first form error. 564 * @param {Object} $el - jQuery object 565 */ 566 567 }, { 568 key: "addA11yAttributes", 569 value: function addA11yAttributes($el) { 570 var $errors = this.findFormError($el); 571 var $labels = $errors.filter('label'); 572 var $error = $errors.first(); 573 if (!$errors.length) return; // Set [aria-describedby] on the input toward the first form error if it is not set 574 575 if (typeof $el.attr('aria-describedby') === 'undefined') { 576 // Get the first error ID or create one 577 var errorId = $error.attr('id'); 578 579 if (typeof errorId === 'undefined') { 580 errorId = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'abide-error'); 581 $error.attr('id', errorId); 582 } 583 584 ; 585 $el.attr('aria-describedby', errorId); 586 } 587 588 if ($labels.filter('[for]').length < $labels.length) { 589 // Get the input ID or create one 590 var elemId = $el.attr('id'); 591 592 if (typeof elemId === 'undefined') { 593 elemId = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'abide-input'); 594 $el.attr('id', elemId); 595 } 596 597 ; // For each label targeting $el, set [for] if it is not set. 598 599 $labels.each(function (i, label) { 600 var $label = jquery__WEBPACK_IMPORTED_MODULE_0___default()(label); 601 if (typeof $label.attr('for') === 'undefined') $label.attr('for', elemId); 602 }); 603 } // For each error targeting $el, set [role=alert] if it is not set. 604 605 606 $errors.each(function (i, label) { 607 var $label = jquery__WEBPACK_IMPORTED_MODULE_0___default()(label); 608 if (typeof $label.attr('role') === 'undefined') $label.attr('role', 'alert'); 609 }).end(); 610 } 611 /** 612 * Adds [aria-live] attribute to the given global form error $el. 613 * @param {Object} $el - jQuery object to add the attribute to 614 */ 615 616 }, { 617 key: "addGlobalErrorA11yAttributes", 618 value: function addGlobalErrorA11yAttributes($el) { 619 if (typeof $el.attr('aria-live') === 'undefined') $el.attr('aria-live', this.options.a11yErrorLevel); 620 } 621 /** 622 * Remove CSS error classes etc from an entire radio button group 623 * @param {String} groupName - A string that specifies the name of a radio button group 624 * 625 */ 626 627 }, { 628 key: "removeRadioErrorClasses", 629 value: function removeRadioErrorClasses(groupName) { 630 var $els = this.$element.find(":radio[name=\"".concat(groupName, "\"]")); 631 var $labels = this.findRadioLabels($els); 632 var $formErrors = this.findFormError($els); 633 634 if ($labels.length) { 635 $labels.removeClass(this.options.labelErrorClass); 636 } 637 638 if ($formErrors.length) { 639 $formErrors.removeClass(this.options.formErrorClass); 640 } 641 642 $els.removeClass(this.options.inputErrorClass).attr({ 643 'data-invalid': null, 644 'aria-invalid': null 645 }); 646 } 647 /** 648 * Removes CSS error class as specified by the Abide settings from the label, input, and the form 649 * @param {Object} $el - jQuery object to remove the class from 650 */ 651 652 }, { 653 key: "removeErrorClasses", 654 value: function removeErrorClasses($el) { 655 // radios need to clear all of the els 656 if ($el[0].type == 'radio') { 657 return this.removeRadioErrorClasses($el.attr('name')); 658 } 659 660 var $label = this.findLabel($el); 661 var $formError = this.findFormError($el); 662 663 if ($label.length) { 664 $label.removeClass(this.options.labelErrorClass); 665 } 666 667 if ($formError.length) { 668 $formError.removeClass(this.options.formErrorClass); 669 } 670 671 $el.removeClass(this.options.inputErrorClass).attr({ 672 'data-invalid': null, 673 'aria-invalid': null 674 }); 675 } 676 /** 677 * Goes through a form to find inputs and proceeds to validate them in ways specific to their type. 678 * Ignores inputs with data-abide-ignore, type="hidden" or disabled attributes set 679 * @fires Abide#invalid 680 * @fires Abide#valid 681 * @param {Object} element - jQuery object to validate, should be an HTML input 682 * @returns {Boolean} goodToGo - If the input is valid or not. 683 */ 684 685 }, { 686 key: "validateInput", 687 value: function validateInput($el) { 688 var clearRequire = this.requiredCheck($el), 689 validated = false, 690 customValidator = true, 691 validator = $el.attr('data-validator'), 692 equalTo = true;
692 // don't validate ignored inputs or hidden inputs or disabled inputs 693 694 if ($el.is('[data-abide-ignore]') || $el.is('[type="hidden"]') || $el.is('[disabled]')) { 695 return true; 696 } 697 698 switch ($el[0].type) { 699 case 'radio': 700 validated = this.validateRadio($el.attr('name')); 701 break; 702 703 case 'checkbox': 704 validated = clearRequire; 705 break; 706 707 case 'select': 708 case 'select-one': 709 case 'select-multiple': 710 validated = clearRequire; 711 break; 712 713 default: 714 validated = this.validateText($el); 715 } 716 717 if (validator) { 718 customValidator = this.matchValidation($el, validator, $el.attr('required')); 719 } 720 721 if ($el.attr('data-equalto')) { 722 equalTo = this.options.validators.equalTo($el); 723 } 724 725 var goodToGo = [clearRequire, validated, customValidator, equalTo].indexOf(false) === -1; 726 var message = (goodToGo ? 'valid' : 'invalid') + '.zf.abide'; 727 728 if (goodToGo) { 729 // Re-validate inputs that depend on this one with equalto 730 var dependentElements = this.$element.find("[data-equalto=\"".concat($el.attr('id'), "\"]")); 731 732 if (dependentElements.length) { 733 var _this = this; 734 735 dependentElements.each(function () { 736 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).val()) { 737 _this.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)); 738 } 739 }); 740 } 741 } 742 743 this[goodToGo ? 'removeErrorClasses' : 'addErrorClasses']($el); 744 /** 745 * Fires when the input is done checking for validation. Event trigger is either `valid.zf.abide` or `invalid.zf.abide` 746 * Trigger includes the DOM element of the input. 747 * @event Abide#valid 748 * @event Abide#invalid 749 */ 750 751 $el.trigger(message, [$el]); 752 return goodToGo; 753 } 754 /** 755 * Goes through a form and if there are any invalid inputs, it will display the form error element 756 * @returns {Boolean} noError - true if no errors were detected... 757 * @fires Abide#formvalid 758 * @fires Abide#forminvalid 759 */ 760 761 }, { 762 key: "validateForm", 763 value: function validateForm() { 764 var _this5 = this; 765 766 var acc = []; 767 768 var _this = this; 769 770 this.$inputs.each(function () { 771 acc.push(_this.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this))); 772 }); 773 var noError = acc.indexOf(false) === -1; 774 this.$element.find('[data-abide-error]').each(function (i, elem) { 775 var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(elem); // Ensure a11y attributes are set 776 777 if (_this5.options.a11yAttributes) _this5.addGlobalErrorA11yAttributes($elem); // Show or hide the error 778 779 $elem.css('display', noError ? 'none' : 'block'); 780 }); 781 /** 782 * Fires when the form is finished validating. Event trigger is either `formvalid.zf.abide` or `forminvalid.zf.abide`. 783 * Trigger includes the element of the form. 784 * @event Abide#formvalid 785 * @event Abide#forminvalid 786 */ 787 788 this.$element.trigger((noError ? 'formvalid' : 'forminvalid') + '.zf.abide', [this.$element]); 789 return noError; 790 } 791 /** 792 * 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. 793 * @param {Object} $el - jQuery object to validate, should be a text input HTML element 794 * @param {String} pattern - string value of one of the RegEx patterns in Abide.options.patterns 795 * @returns {Boolean} Boolean value depends on whether or not the input value matches the pattern specified 796 */ 797 798 }, { 799 key: "validateText", 800 value: function validateText($el, pattern) { 801 // A pattern can be passed to this function, or it will be infered from the input's "pattern" attribute, or it's "type" attribute 802 pattern = pattern || $el.attr('pattern') || $el.attr('type'); 803 var inputText = $el.val(); 804 var valid = false; 805 806 if (inputText.length) { 807 // If the pattern attribute on the element is in Abide's list of patterns, then test that regexp 808 if (this.options.patterns.hasOwnProperty(pattern)) { 809 valid = this.options.patterns[pattern].test(inputText); 810 } // If the pattern name isn't also the type attribute of the field, then test it as a regexp 811 else if (pattern !== $el.attr('type')) { 812 valid = new RegExp(pattern).test(inputText); 813 } else { 814 valid = true; 815 } 816 } // An empty field is valid if it's not required 817 else if (!$el.prop('required')) { 818 valid = true; 819 } 820 821 return valid; 822 } 823 /** 824 * 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. 825 * @param {String} groupName - A string that specifies the name of a radio button group 826 * @returns {Boolean} Boolean value depends on whether or not at least one radio input has been selected (if it's required) 827 */ 828 829 }, { 830 key: "validateRadio", 831 value: function validateRadio(groupName) { 832 // If at least one radio in the group has the `required` attribute, the group is considered required 833 // Per W3C spec, all radio buttons in a group should have `required`, but we're being nice 834 var $group = this.$element.find(":radio[name=\"".concat(groupName, "\"]"));
vendor: 5,530 bytes, lines 835-1011
835 var valid = false, 836 required = false; // For the group to be required, at least one radio needs to be required 837 838 $group.each(function (i, e) { 839 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e).attr('required')) { 840 required = true; 841 } 842 }); 843 if (!required) valid = true; 844 845 if (!valid) { 846 // For the group to be valid, at least one radio needs to be checked 847 $group.each(function (i, e) { 848 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e).prop('checked')) { 849 valid = true; 850 } 851 }); 852 } 853 854 ; 855 return valid; 856 } 857 /** 858 * 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. 859 * @param {Object} $el - jQuery input element. 860 * @param {String} validators - a string of function names matching functions in the Abide.options.validators object. 861 * @param {Boolean} required - self explanatory? 862 * @returns {Boolean} - true if validations passed. 863 */ 864 865 }, { 866 key: "matchValidation", 867 value: function matchValidation($el, validators, required) { 868 var _this6 = this; 869 870 required = required ? true : false; 871 var clear = validators.split(' ').map(function (v) { 872 return _this6.options.validators[v]($el, required, $el.parent()); 873 }); 874 return clear.indexOf(false) === -1; 875 } 876 /** 877 * Resets form inputs and styles 878 * @fires Abide#formreset 879 */ 880 881 }, { 882 key: "resetForm", 883 value: function resetForm() { 884 var $form = this.$element, 885 opts = this.options; 886 jquery__WEBPACK_IMPORTED_MODULE_0___default()(".".concat(opts.labelErrorClass), $form).not('small').removeClass(opts.labelErrorClass); 887 jquery__WEBPACK_IMPORTED_MODULE_0___default()(".".concat(opts.inputErrorClass), $form).not('small').removeClass(opts.inputErrorClass); 888 jquery__WEBPACK_IMPORTED_MODULE_0___default()("".concat(opts.formErrorSelector, ".").concat(opts.formErrorClass)).removeClass(opts.formErrorClass); 889 $form.find('[data-abide-error]').css('display', 'none'); 890 jquery__WEBPACK_IMPORTED_MODULE_0___default()(':input', $form).not(':button, :submit, :reset, :hidden, :radio, :checkbox, [data-abide-ignore]').val('').attr({ 891 'data-invalid': null, 892 'aria-invalid': null 893 }); 894 jquery__WEBPACK_IMPORTED_MODULE_0___default()(':input:radio', $form).not('[data-abide-ignore]').prop('checked', false).attr({ 895 'data-invalid': null, 896 'aria-invalid': null 897 }); 898 jquery__WEBPACK_IMPORTED_MODULE_0___default()(':input:checkbox', $form).not('[data-abide-ignore]').prop('checked', false).attr({ 899 'data-invalid': null, 900 'aria-invalid': null 901 }); 902 /** 903 * Fires when the form has been reset. 904 * @event Abide#formreset 905 */ 906 907 $form.trigger('formreset.zf.abide', [$form]); 908 } 909 /** 910 * Destroys an instance of Abide. 911 * Removes error styles and classes from elements, without resetting their values. 912 */ 913 914 }, { 915 key: "_destroy", 916 value: function _destroy() { 917 var _this = this; 918 919 this.$element.off('.abide').find('[data-abide-error]').css('display', 'none'); 920 this.$inputs.off('.abide').each(function () { 921 _this.removeErrorClasses(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)); 922 }); 923 } 924 }]); 925 926 return Abide; 927}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]); 928/** 929 * Default settings for plugin 930 */ 931 932 933Abide.defaults = { 934 /** 935 * The default event to validate inputs. Checkboxes and radios validate immediately. 936 * Remove or change this value for manual validation. 937 * @option 938 * @type {?string} 939 * @default 'fieldChange' 940 */ 941 validateOn: 'fieldChange', 942 943 /** 944 * Class to be applied to input labels on failed validation. 945 * @option 946 * @type {string} 947 * @default 'is-invalid-label' 948 */ 949 labelErrorClass: 'is-invalid-label', 950 951 /** 952 * Class to be applied to inputs on failed validation. 953 * @option 954 * @type {string} 955 * @default 'is-invalid-input' 956 */ 957 inputErrorClass: 'is-invalid-input', 958 959 /** 960 * Class selector to use to target Form Errors for show/hide. 961 * @option 962 * @type {string} 963 * @default '.form-error' 964 */ 965 formErrorSelector: '.form-error', 966 967 /** 968 * Class added to Form Errors on failed validation. 969 * @option 970 * @type {string} 971 * @default 'is-visible' 972 */ 973 formErrorClass: 'is-visible', 974 975 /** 976 * If true, automatically insert when possible: 977 * - `[aria-describedby]` on fields 978 * - `[role=alert]` on form errors and `[for]` on form error labels 979 * - `[aria-live]` on global errors `[data-abide-error]` (see option `a11yErrorLevel`). 980 * @option 981 * @type {boolean} 982 * @default true 983 */ 984 a11yAttributes: true, 985 986 /** 987 * [aria-live] attribute value to be applied on global errors `[data-abide-error]`. 988 * Options are: 'assertive', 'polite' and 'off'/null 989 * @option 990 * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions 991 * @type {string} 992 * @default 'assertive' 993 */ 994 a11yErrorLevel: 'assertive', 995 996 /** 997 * Set to true to validate text inputs on any value change. 998 * @option 999 * @type {boolean} 1000 * @default false 1001 */ 1002 liveValidate: false, 1003 1004 /** 1005 * Set to true to validate inputs on blur. 1006 * @option 1007 * @type {boolean} 1008 * @default false 1009 */ 1010 validateOnBlur: false, 1011 patterns: {
1012 alpha: /^[a-zA-Z]+$/, 1013 alpha_numeric: /^[a-zA-Z0-9]+$/, 1014 integer: /^[-+]?\d+$/, 1015 number: /^[-+]?\d*(?:[\.\,]\d+)?$/, 1016 // amex, visa, diners 1017 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})$/, 1018 cvv: /^([0-9]){3,4}$/, 1019 // http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#valid-e-mail-address 1020 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])?)+$/, 1021 // From CommonRegexJS (@talyssonoc) 1022 // https://github.com/talyssonoc/CommonRegexJS/blob/e2901b9f57222bc14069dc8f0598d5f412555411/lib/commonregex.js#L76 1023 // For more restrictive URL Regexs, see https://mathiasbynens.be/demo/url-regex. 1024 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]))$/, 1025 // abc.de 1026 domain: /^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,8}$/, 1027 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))$/, 1028 // YYYY-MM-DD 1029 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))$/, 1030 // HH:MM:SS 1031 time: /^(0[0-9]|1[0-9]|2[0-3])(:[0-5][0-9]){2}$/, 1032 dateISO: /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/, 1033 // MM/DD/YYYY 1034 month_day_year: /^(0[1-9]|1[012])[- \/.](0[1-9]|[12][0-9]|3[01])[- \/.]\d{4}$/, 1035 // DD/MM/YYYY 1036 day_month_year: /^(0[1-9]|[12][0-9]|3[01])[- \/.](0[1-9]|1[012])[- \/.]\d{4}$/, 1037 // #FFF or #FFFFFF 1038 color: /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/, 1039 // Domain || URL 1040 website: { 1041 test: function test(text) { 1042 return Abide.defaults.patterns['domain'].test(text) || Abide.defaults.patterns['url'].test(text); 1043 } 1044 } 1045 }, 1046 1047 /** 1048 * Optional validation functions to be used. `equalTo` being the only default included function. 1049 * Functions should return only a boolean if the input is valid or not. Functions are given the following arguments: 1050 * el : The jQuery element to validate. 1051 * required : Boolean value of the required attribute be present or not. 1052 * parent : The direct parent of the input. 1053 * @option 1054 */ 1055 validators: { 1056 equalTo: function equalTo(el, required, parent) { 1057 return jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(el.attr('data-equalto'))).val() === el.val(); 1058 } 1059 } 1060}; 1061 1062 1063/***/ }), 1064
1065/***/ "./js/foundation.accordion.js": 1066/*!************************************!*\ 1067 !*** ./js/foundation.accordion.js ***! 1068 \************************************/ 1069/*! exports provided: Accordion */ 1070/***/ (function(module, __webpack_exports__, __webpack_require__) { 1071 1072"use strict"; 1073__webpack_require__.r(__webpack_exports__); 1074/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Accordion", function() { return Accordion; }); 1075/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 1076/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 1077/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 1078/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js"); 1079/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 1080 1081 1082function _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); } 1083 1084function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 1085 1086function _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); } } 1087 1088function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 1089 1090function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 1091 1092function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 1093 1094function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 1095 1096function _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); } 1097 1098function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 1099 1100 1101 1102 1103 1104/** 1105 * Accordion module. 1106 * @module foundation.accordion 1107 * @requires foundation.util.keyboard 1108 */ 1109 1110var Accordion = 1111/*#__PURE__*/ 1112function (_Plugin) { 1113 _inherits(Accordion, _Plugin); 1114 1115 function Accordion() { 1116 _classCallCheck(this, Accordion); 1117 1118 return _possibleConstructorReturn(this, _getPrototypeOf(Accordion).apply(this, arguments)); 1119 } 1120 1121 _createClass(Accordion, [{ 1122 key: "_setup", 1123 1124 /** 1125 * Creates a new instance of an accordion. 1126 * @class 1127 * @name Accordion 1128 * @fires Accordion#init 1129 * @param {jQuery} element - jQuery object to make into an accordion. 1130 * @param {Object} options - a plain object with settings to override the default options. 1131 */ 1132 value: function _setup(element, options) { 1133 this.$element = element; 1134 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Accordion.defaults, this.$element.data(), options); 1135 this.className = 'Accordion'; // ie9 back compat 1136 1137 this._init(); 1138 1139 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].register('Accordion', { 1140 'ENTER': 'toggle', 1141 'SPACE': 'toggle', 1142 'ARROW_DOWN': 'next', 1143 'ARROW_UP': 'previous' 1144 }); 1145 } 1146 /** 1147 * Initializes the accordion by animating the preset active pane(s). 1148 * @private 1149 */ 1150 1151 }, { 1152 key: "_init", 1153 value: function _init() { 1154 var _this2 = this; 1155 1156 this._isInitializing = true; 1157 this.$element.attr('role', 'tablist'); 1158 this.$tabs = this.$element.children('[data-accordion-item]'); 1159 this.$tabs.each(function (idx, el) { 1160 var $el = jquery__WEBPACK_IMPORTED_MODULE_0___default()(el), 1161 $content = $el.children('[data-tab-content]'), 1162 id = $content[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["GetYoDigits"])(6, 'accordion'), 1163 linkId = el.id ? "".concat(el.id, "-label") : "".concat(id, "-label"); 1164 $el.find('a:first').attr({ 1165 'aria-controls': id, 1166 'role': 'tab', 1167 'id': linkId, 1168 'aria-expanded': false, 1169 'aria-selected': false 1170 }); 1171 $content.attr({ 1172 'role': 'tabpanel', 1173 'aria-labelledby': linkId, 1174 'aria-hidden': true, 1175 'id': id 1176 }); 1177 }); 1178 var $initActive = this.$element.find('.is-active').children('[data-tab-content]'); 1179 1180 if ($initActive.length) { 1181 // Save up the initial hash to return to it later when going back in history 1182 this._initialAnchor = $initActive.prev('a').attr('href'); 1183 1184 this._openSingleTab($initActive); 1185 } 1186 1187 this._checkDeepLink = function () { 1188 var anchor = window.location.hash; 1189 1190 if (!anchor.length) { 1191 // If we are still initializing and there is no anchor, then there is nothing to do 1192 if (_this2._isInitializing) return; // Otherwise, move to the initial anchor 1193 1194 if (_this2._initialAnchor) anchor = _this2._initialAnchor; 1195 } 1196 1197 var $anchor = anchor && jquery__WEBPACK_IMPORTED_MODULE_0___default()(anchor); 1198 1199 var $link = anchor && _this2.$element.find("[href$=\"".concat(anchor, "\"]"));
vendor: 9,078 bytes, lines 1199-1507
1199 // Whether the anchor element that has been found is part of this element 1200 1201 1202 var isOwnAnchor = !!($anchor.length && $link.length); // If there is an anchor for the hash, open it (if not already active) 1203 1204 if ($anchor && $link && $link.length) { 1205 if (!$link.parent('[data-accordion-item]').hasClass('is-active')) { 1206 _this2._openSingleTab($anchor); 1207 } 1208 1209 ; 1210 } // Otherwise, close everything 1211 else { 1212 _this2._closeAllTabs(); 1213 } 1214 1215 if (isOwnAnchor) { 1216 // Roll up a little to show the titles 1217 if (_this2.options.deepLinkSmudge) { 1218 Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () { 1219 var offset = _this2.$element.offset(); 1220 1221 jquery__WEBPACK_IMPORTED_MODULE_0___default()('html, body').animate({ 1222 scrollTop: offset.top 1223 }, _this2.options.deepLinkSmudgeDelay); 1224 }); 1225 } 1226 /** 1227 * Fires when the plugin has deeplinked at pageload 1228 * @event Accordion#deeplink 1229 */ 1230 1231 1232 _this2.$element.trigger('deeplink.zf.accordion', [$link, $anchor]); 1233 } 1234 }; //use browser to open a tab, if it exists in this tabset 1235 1236 1237 if (this.options.deepLink) { 1238 this._checkDeepLink(); 1239 } 1240 1241 this._events(); 1242 1243 this._isInitializing = false; 1244 } 1245 /** 1246 * Adds event handlers for items within the accordion. 1247 * @private 1248 */ 1249 1250 }, { 1251 key: "_events", 1252 value: function _events() { 1253 var _this = this; 1254 1255 this.$tabs.each(function () { 1256 var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this); 1257 var $tabContent = $elem.children('[data-tab-content]'); 1258 1259 if ($tabContent.length) { 1260 $elem.children('a').off('click.zf.accordion keydown.zf.accordion').on('click.zf.accordion', function (e) { 1261 e.preventDefault(); 1262 1263 _this.toggle($tabContent); 1264 }).on('keydown.zf.accordion', function (e) { 1265 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].handleKey(e, 'Accordion', { 1266 toggle: function toggle() { 1267 _this.toggle($tabContent); 1268 }, 1269 next: function next() { 1270 var $a = $elem.next().find('a').focus(); 1271 1272 if (!_this.options.multiExpand) { 1273 $a.trigger('click.zf.accordion'); 1274 } 1275 }, 1276 previous: function previous() { 1277 var $a = $elem.prev().find('a').focus(); 1278 1279 if (!_this.options.multiExpand) { 1280 $a.trigger('click.zf.accordion'); 1281 } 1282 }, 1283 handled: function handled() { 1284 e.preventDefault(); 1285 e.stopPropagation(); 1286 } 1287 }); 1288 }); 1289 } 1290 }); 1291 1292 if (this.options.deepLink) { 1293 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('hashchange', this._checkDeepLink); 1294 } 1295 } 1296 /** 1297 * Toggles the selected content pane's open/close state. 1298 * @param {jQuery} $target - jQuery object of the pane to toggle (`.accordion-content`). 1299 * @function 1300 */ 1301 1302 }, { 1303 key: "toggle", 1304 value: function toggle($target) { 1305 if ($target.closest('[data-accordion]').is('[disabled]')) { 1306 console.info('Cannot toggle an accordion that is disabled.'); 1307 return; 1308 } 1309 1310 if ($target.parent().hasClass('is-active')) { 1311 this.up($target); 1312 } else { 1313 this.down($target); 1314 } //either replace or update browser history 1315 1316 1317 if (this.options.deepLink) { 1318 var anchor = $target.prev('a').attr('href'); 1319 1320 if (this.options.updateHistory) { 1321 history.pushState({}, '', anchor); 1322 } else { 1323 history.replaceState({}, '', anchor); 1324 } 1325 } 1326 } 1327 /** 1328 * Opens the accordion tab defined by `$target`. 1329 * @param {jQuery} $target - Accordion pane to open (`.accordion-content`). 1330 * @fires Accordion#down 1331 * @function 1332 */ 1333 1334 }, { 1335 key: "down", 1336 value: function down($target) { 1337 if ($target.closest('[data-accordion]').is('[disabled]')) { 1338 console.info('Cannot call down on an accordion that is disabled.'); 1339 return; 1340 } 1341 1342 if (this.options.multiExpand) this._openTab($target);else this._openSingleTab($target); 1343 } 1344 /** 1345 * Closes the tab defined by `$target`. 1346 * It may be ignored if the Accordion options don't allow it. 1347 * 1348 * @param {jQuery} $target - Accordion tab to close (`.accordion-content`). 1349 * @fires Accordion#up 1350 * @function 1351 */ 1352 1353 }, { 1354 key: "up", 1355 value: function up($target) { 1356 if (this.$element.is('[disabled]')) { 1357 console.info('Cannot call up on an accordion that is disabled.'); 1358 return; 1359 } // Don't close the item if it is already closed 1360 1361 1362 var $targetItem = $target.parent(); 1363 if (!$targetItem.hasClass('is-active')) return; // Don't close the item if there is no other active item (unless with `allowAllClosed`) 1364 1365 var $othersItems = $targetItem.siblings(); 1366 if (!this.options.allowAllClosed && !$othersItems.hasClass('is-active')) return; 1367 1368 this._closeTab($target); 1369 } 1370 /** 1371 * Make the tab defined by `$target` the only opened tab, closing all others tabs. 1372 * @param {jQuery} $target - Accordion tab to open (`.accordion-content`). 1373 * @function 1374 * @private 1375 */ 1376 1377 }, { 1378 key: "_openSingleTab", 1379 value: function _openSingleTab($target) { 1380 // Close all the others active tabs. 1381 var $activeContents = this.$element.children('.is-active').children('[data-tab-content]'); 1382 1383 if ($activeContents.length) { 1384 this._closeTab($activeContents.not($target)); 1385 } // Then open the target. 1386 1387 1388 this._openTab($target); 1389 } 1390 /** 1391 * Opens the tab defined by `$target`. 1392 * @param {jQuery} $target - Accordion tab to open (`.accordion-content`). 1393 * @fires Accordion#down 1394 * @function 1395 * @private 1396 */ 1397 1398 }, { 1399 key: "_openTab", 1400 value: function _openTab($target) { 1401 var _this3 = this; 1402 1403 var $targetItem = $target.parent(); 1404 var targetContentId = $target.attr('aria-labelledby'); 1405 $target.attr('aria-hidden', false); 1406 $targetItem.addClass('is-active'); 1407 jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(targetContentId)).attr({ 1408 'aria-expanded': true, 1409 'aria-selected': true 1410 }); 1411 $target.slideDown(this.options.slideSpeed, function () { 1412 /** 1413 * Fires when the tab is done opening. 1414 * @event Accordion#down 1415 */ 1416 _this3.$element.trigger('down.zf.accordion', [$target]); 1417 }); 1418 } 1419 /** 1420 * Closes the tab defined by `$target`. 1421 * @param {jQuery} $target - Accordion tab to close (`.accordion-content`). 1422 * @fires Accordion#up 1423 * @function 1424 * @private 1425 */ 1426 1427 }, { 1428 key: "_closeTab", 1429 value: function _closeTab($target) { 1430 var _this4 = this; 1431 1432 var $targetItem = $target.parent(); 1433 var targetContentId = $target.attr('aria-labelledby'); 1434 $target.attr('aria-hidden', true); 1435 $targetItem.removeClass('is-active'); 1436 jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(targetContentId)).attr({ 1437 'aria-expanded': false, 1438 'aria-selected': false 1439 }); 1440 $target.slideUp(this.options.slideSpeed, function () { 1441 /** 1442 * Fires when the tab is done collapsing up. 1443 * @event Accordion#up 1444 */ 1445 _this4.$element.trigger('up.zf.accordion', [$target]); 1446 }); 1447 } 1448 /** 1449 * Closes all active tabs 1450 * @fires Accordion#up 1451 * @function 1452 * @private 1453 */ 1454 1455 }, { 1456 key: "_closeAllTabs", 1457 value: function _closeAllTabs() { 1458 var $activeTabs = this.$element.children('.is-active').children('[data-tab-content]'); 1459 1460 if ($activeTabs.length) { 1461 this._closeTab($activeTabs); 1462 } 1463 } 1464 /** 1465 * Destroys an instance of an accordion. 1466 * @fires Accordion#destroyed 1467 * @function 1468 */ 1469 1470 }, { 1471 key: "_destroy", 1472 value: function _destroy() { 1473 this.$element.find('[data-tab-content]').stop(true).slideUp(0).css('display', ''); 1474 this.$element.find('a').off('.zf.accordion'); 1475 1476 if (this.options.deepLink) { 1477 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('hashchange', this._checkDeepLink); 1478 } 1479 } 1480 }]); 1481 1482 return Accordion; 1483}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__["Plugin"]); 1484 1485Accordion.defaults = { 1486 /** 1487 * Amount of time to animate the opening of an accordion pane. 1488 * @option 1489 * @type {number} 1490 * @default 250 1491 */ 1492 slideSpeed: 250, 1493 1494 /** 1495 * Allow the accordion to have multiple open panes. 1496 * @option 1497 * @type {boolean} 1498 * @default false 1499 */ 1500 multiExpand: false, 1501 1502 /** 1503 * Allow the accordion to close all panes. 1504 * @option 1505 * @type {boolean} 1506 * @default false 1507 */
1508 allowAllClosed: false, 1509 1510 /** 1511 * Link the location hash to the open pane. 1512 * Set the location hash when the opened pane changes, and open and scroll to the corresponding pane when the location changes. 1513 * @option 1514 * @type {boolean} 1515 * @default false 1516 */ 1517 deepLink: false, 1518 1519 /** 1520 * If `deepLink` is enabled, adjust the deep link scroll to make sure the top of the accordion panel is visible 1521 * @option 1522 * @type {boolean} 1523 * @default false 1524 */ 1525 deepLinkSmudge: false, 1526 1527 /** 1528 * If `deepLinkSmudge` is enabled, animation time (ms) for the deep link adjustment 1529 * @option 1530 * @type {number} 1531 * @default 300 1532 */ 1533 deepLinkSmudgeDelay: 300, 1534 1535 /** 1536 * If `deepLink` is enabled, update the browser history with the open accordion 1537 * @option 1538 * @type {boolean} 1539 * @default false 1540 */ 1541 updateHistory: false 1542}; 1543 1544 1545/***/ }), 1546
vendor: 5,377 bytes, lines 1547-1649
1547/***/ "./js/foundation.accordionMenu.js": 1548/*!****************************************!*\ 1549 !*** ./js/foundation.accordionMenu.js ***! 1550 \****************************************/ 1551/*! exports provided: AccordionMenu */ 1552/***/ (function(module, __webpack_exports__, __webpack_require__) { 1553 1554"use strict"; 1555__webpack_require__.r(__webpack_exports__); 1556/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AccordionMenu", function() { return AccordionMenu; }); 1557/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 1558/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 1559/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js"); 1560/* harmony import */ var _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.nest */ "./js/foundation.util.nest.js"); 1561/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 1562/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 1563 1564 1565function _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); } 1566 1567function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 1568 1569function _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); } } 1570 1571function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 1572 1573function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 1574 1575function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 1576 1577function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 1578 1579function _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); } 1580 1581function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 1582 1583 1584 1585 1586 1587 1588/** 1589 * AccordionMenu module. 1590 * @module foundation.accordionMenu 1591 * @requires foundation.util.keyboard 1592 * @requires foundation.util.nest 1593 */ 1594 1595var AccordionMenu = 1596/*#__PURE__*/ 1597function (_Plugin) { 1598 _inherits(AccordionMenu, _Plugin); 1599 1600 function AccordionMenu() { 1601 _classCallCheck(this, AccordionMenu); 1602 1603 return _possibleConstructorReturn(this, _getPrototypeOf(AccordionMenu).apply(this, arguments)); 1604 } 1605 1606 _createClass(AccordionMenu, [{ 1607 key: "_setup", 1608 1609 /** 1610 * Creates a new instance of an accordion menu. 1611 * @class 1612 * @name AccordionMenu 1613 * @fires AccordionMenu#init 1614 * @param {jQuery} element - jQuery object to make into an accordion menu. 1615 * @param {Object} options - Overrides to the default plugin settings. 1616 */ 1617 value: function _setup(element, options) { 1618 this.$element = element; 1619 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, AccordionMenu.defaults, this.$element.data(), options); 1620 this.className = 'AccordionMenu'; // ie9 back compat 1621 1622 this._init(); 1623 1624 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].register('AccordionMenu', { 1625 'ENTER': 'toggle', 1626 'SPACE': 'toggle', 1627 'ARROW_RIGHT': 'open', 1628 'ARROW_UP': 'up', 1629 'ARROW_DOWN': 'down', 1630 'ARROW_LEFT': 'close', 1631 'ESCAPE': 'closeAll' 1632 }); 1633 } 1634 /** 1635 * Initializes the accordion menu by hiding all nested menus. 1636 * @private 1637 */ 1638 1639 }, { 1640 key: "_init", 1641 value: function _init() { 1642 _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__["Nest"].Feather(this.$element, 'accordion'); 1643 1644 var _this = this; 1645 1646 this.$element.find('[data-submenu]').not('.is-active').slideUp(0); //.find('a').css('padding-left', '1rem'); 1647 1648 this.$element.attr({ 1649 'role': 'tree',
vendor: 5,406 bytes, lines 1650-1782
1650 'aria-multiselectable': this.options.multiOpen 1651 }); 1652 this.$menuLinks = this.$element.find('.is-accordion-submenu-parent'); 1653 this.$menuLinks.each(function () { 1654 var linkId = this.id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'acc-menu-link'), 1655 $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 1656 $sub = $elem.children('[data-submenu]'), 1657 subId = $sub[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'acc-menu'), 1658 isActive = $sub.hasClass('is-active'); 1659 1660 if (_this.options.parentLink) { 1661 var $anchor = $elem.children('a'); 1662 $anchor.clone().prependTo($sub).wrap('<li data-is-parent-link class="is-submenu-parent-item is-submenu-item is-accordion-submenu-item"></li>'); 1663 } 1664 1665 if (_this.options.submenuToggle) { 1666 $elem.addClass('has-submenu-toggle'); 1667 $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>'); 1668 } else { 1669 $elem.attr({ 1670 'aria-controls': subId, 1671 'aria-expanded': isActive, 1672 'id': linkId 1673 }); 1674 } 1675 1676 $sub.attr({ 1677 'aria-labelledby': linkId, 1678 'aria-hidden': !isActive, 1679 'role': 'group', 1680 'id': subId 1681 }); 1682 }); 1683 this.$element.find('li').attr({ 1684 'role': 'treeitem' 1685 }); 1686 var initPanes = this.$element.find('.is-active'); 1687 1688 if (initPanes.length) { 1689 var _this = this; 1690 1691 initPanes.each(function () { 1692 _this.down(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)); 1693 }); 1694 } 1695 1696 this._events(); 1697 } 1698 /** 1699 * Adds event handlers for items within the menu. 1700 * @private 1701 */ 1702 1703 }, { 1704 key: "_events", 1705 value: function _events() { 1706 var _this = this; 1707 1708 this.$element.find('li').each(function () { 1709 var $submenu = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).children('[data-submenu]'); 1710 1711 if ($submenu.length) { 1712 if (_this.options.submenuToggle) { 1713 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).children('.submenu-toggle').off('click.zf.accordionMenu').on('click.zf.accordionMenu', function (e) { 1714 _this.toggle($submenu); 1715 }); 1716 } else { 1717 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).children('a').off('click.zf.accordionMenu').on('click.zf.accordionMenu', function (e) { 1718 e.preventDefault(); 1719 1720 _this.toggle($submenu); 1721 }); 1722 } 1723 } 1724 }).on('keydown.zf.accordionmenu', function (e) { 1725 var $element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 1726 $elements = $element.parent('ul').children('li'), 1727 $prevElement, 1728 $nextElement, 1729 $target = $element.children('[data-submenu]'); 1730 $elements.each(function (i) { 1731 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is($element)) { 1732 $prevElement = $elements.eq(Math.max(0, i - 1)).find('a').first(); 1733 $nextElement = $elements.eq(Math.min(i + 1, $elements.length - 1)).find('a').first(); 1734 1735 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).children('[data-submenu]:visible').length) { 1736 // has open sub menu 1737 $nextElement = $element.find('li:first-child').find('a').first(); 1738 } 1739 1740 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is(':first-child')) { 1741 // is first element of sub menu 1742 $prevElement = $element.parents('li').first().find('a').first(); 1743 } else if ($prevElement.parents('li').first().children('[data-submenu]:visible').length) { 1744 // if previous element has open sub menu 1745 $prevElement = $prevElement.parents('li').find('li:last-child').find('a').first(); 1746 } 1747 1748 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is(':last-child')) { 1749 // is last element of sub menu 1750 $nextElement = $element.parents('li').first().next('li').find('a').first(); 1751 } 1752 1753 return; 1754 } 1755 }); 1756 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].handleKey(e, 'AccordionMenu', { 1757 open: function open() { 1758 if ($target.is(':hidden')) { 1759 _this.down($target); 1760 1761 $target.find('li').first().find('a').first().focus(); 1762 } 1763 }, 1764 close: function close() { 1765 if ($target.length && !$target.is(':hidden')) { 1766 // close active sub of this item 1767 _this.up($target); 1768 } else if ($element.parent('[data-submenu]').length) { 1769 // close currently open sub 1770 _this.up($element.parent('[data-submenu]')); 1771 1772 $element.parents('li').first().find('a').first().focus(); 1773 } 1774 }, 1775 up: function up() { 1776 $prevElement.focus(); 1777 return true; 1778 }, 1779 down: function down() { 1780 $nextElement.focus(); 1781 return true; 1782 },
vendor: 4,493 bytes, lines 1783-1940
1783 toggle: function toggle() { 1784 if (_this.options.submenuToggle) { 1785 return false; 1786 } 1787 1788 if ($element.children('[data-submenu]').length) { 1789 _this.toggle($element.children('[data-submenu]')); 1790 1791 return true; 1792 } 1793 }, 1794 closeAll: function closeAll() { 1795 _this.hideAll(); 1796 }, 1797 handled: function handled(preventDefault) { 1798 if (preventDefault) { 1799 e.preventDefault(); 1800 } 1801 1802 e.stopImmediatePropagation(); 1803 } 1804 }); 1805 }); //.attr('tabindex', 0); 1806 } 1807 /** 1808 * Closes all panes of the menu. 1809 * @function 1810 */ 1811 1812 }, { 1813 key: "hideAll", 1814 value: function hideAll() { 1815 this.up(this.$element.find('[data-submenu]')); 1816 } 1817 /** 1818 * Opens all panes of the menu. 1819 * @function 1820 */ 1821 1822 }, { 1823 key: "showAll", 1824 value: function showAll() { 1825 this.down(this.$element.find('[data-submenu]')); 1826 } 1827 /** 1828 * Toggles the open/close state of a submenu. 1829 * @function 1830 * @param {jQuery} $target - the submenu to toggle 1831 */ 1832 1833 }, { 1834 key: "toggle", 1835 value: function toggle($target) { 1836 if (!$target.is(':animated')) { 1837 if (!$target.is(':hidden')) { 1838 this.up($target); 1839 } else { 1840 this.down($target); 1841 } 1842 } 1843 } 1844 /** 1845 * Opens the sub-menu defined by `$target`. 1846 * @param {jQuery} $target - Sub-menu to open. 1847 * @fires AccordionMenu#down 1848 */ 1849 1850 }, { 1851 key: "down", 1852 value: function down($target) { 1853 var _this2 = this; 1854 1855 // If having multiple submenus active is disabled, close all the submenus 1856 // that are not parents or children of the targeted submenu. 1857 if (!this.options.multiOpen) { 1858 // The "branch" of the targetted submenu, from the component root to 1859 // the active submenus nested in it. 1860 var $targetBranch = $target.parentsUntil(this.$element).add($target).add($target.find('.is-active')); // All the active submenus that are not in the branch. 1861 1862 var $othersActiveSubmenus = this.$element.find('.is-active').not($targetBranch); 1863 this.up($othersActiveSubmenus); 1864 } 1865 1866 $target.addClass('is-active').attr({ 1867 'aria-hidden': false 1868 }); 1869 1870 if (this.options.submenuToggle) { 1871 $target.prev('.submenu-toggle').attr({ 1872 'aria-expanded': true 1873 }); 1874 } else { 1875 $target.parent('.is-accordion-submenu-parent').attr({ 1876 'aria-expanded': true 1877 }); 1878 } 1879 1880 $target.slideDown(this.options.slideSpeed, function () { 1881 /** 1882 * Fires when the menu is done opening. 1883 * @event AccordionMenu#down 1884 */ 1885 _this2.$element.trigger('down.zf.accordionMenu', [$target]); 1886 }); 1887 } 1888 /** 1889 * Closes the sub-menu defined by `$target`. All sub-menus inside the target will be closed as well. 1890 * @param {jQuery} $target - Sub-menu to close. 1891 * @fires AccordionMenu#up 1892 */ 1893 1894 }, { 1895 key: "up", 1896 value: function up($target) { 1897 var _this3 = this; 1898 1899 var $submenus = $target.find('[data-submenu]'); 1900 var $allmenus = $target.add($submenus); 1901 $submenus.slideUp(0); 1902 $allmenus.removeClass('is-active').attr('aria-hidden', true); 1903 1904 if (this.options.submenuToggle) { 1905 $allmenus.prev('.submenu-toggle').attr('aria-expanded', false); 1906 } else { 1907 $allmenus.parent('.is-accordion-submenu-parent').attr('aria-expanded', false); 1908 } 1909 1910 $target.slideUp(this.options.slideSpeed, function () { 1911 /** 1912 * Fires when the menu is done collapsing up. 1913 * @event AccordionMenu#up 1914 */ 1915 _this3.$element.trigger('up.zf.accordionMenu', [$target]); 1916 }); 1917 } 1918 /** 1919 * Destroys an instance of accordion menu. 1920 * @fires AccordionMenu#destroyed 1921 */ 1922 1923 }, { 1924 key: "_destroy", 1925 value: function _destroy() { 1926 this.$element.find('[data-submenu]').slideDown(0).css('display', ''); 1927 this.$element.find('a').off('click.zf.accordionMenu'); 1928 this.$element.find('[data-is-parent-link]').detach(); 1929 1930 if (this.options.submenuToggle) { 1931 this.$element.find('.has-submenu-toggle').removeClass('has-submenu-toggle'); 1932 this.$element.find('.submenu-toggle').remove(); 1933 } 1934 1935 _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__["Nest"].Burn(this.$element, 'accordion'); 1936 } 1937 }]); 1938 1939 return AccordionMenu; 1940}
1940(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__["Plugin"]); 1941 1942AccordionMenu.defaults = { 1943 /** 1944 * Adds the parent link to the submenu. 1945 * @option 1946 * @type {boolean} 1947 * @default false 1948 */ 1949 parentLink: false, 1950 1951 /** 1952 * Amount of time to animate the opening of a submenu in ms. 1953 * @option 1954 * @type {number} 1955 * @default 250 1956 */ 1957 slideSpeed: 250, 1958 1959 /** 1960 * Adds a separate submenu toggle button. This allows the parent item to have a link. 1961 * @option 1962 * @example true 1963 */ 1964 submenuToggle: false, 1965 1966 /** 1967 * The text used for the submenu toggle if enabled. This is used for screen readers only. 1968 * @option 1969 * @example true 1970 */ 1971 submenuToggleText: 'Toggle menu', 1972 1973 /** 1974 * Allow the menu to have multiple open panes. 1975 * @option 1976 * @type {boolean} 1977 * @default true 1978 */ 1979 multiOpen: true 1980}; 1981 1982 1983/***/ }), 1984
vendor: 10,777 bytes, lines 1985-2260
1985/***/ "./js/foundation.core.js": 1986/*!*******************************!*\ 1987 !*** ./js/foundation.core.js ***! 1988 \*******************************/ 1989/*! exports provided: Foundation */ 1990/***/ (function(module, __webpack_exports__, __webpack_require__) { 1991 1992"use strict"; 1993__webpack_require__.r(__webpack_exports__); 1994/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Foundation", function() { return Foundation; }); 1995/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 1996/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 1997/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 1998/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js"); 1999 2000 2001function _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); } 2002 2003 2004 2005 2006var FOUNDATION_VERSION = '6.5.3'; // Global Foundation object 2007// This is attached to the window, or used as a module for AMD/Browserify 2008 2009var Foundation = { 2010 version: FOUNDATION_VERSION, 2011 2012 /** 2013 * Stores initialized plugins. 2014 */ 2015 _plugins: {}, 2016 2017 /** 2018 * Stores generated unique ids for plugin instances 2019 */ 2020 _uuids: [], 2021 2022 /** 2023 * Defines a Foundation plugin, adding it to the `Foundation` namespace and the list of plugins to initialize when reflowing. 2024 * @param {Object} plugin - The constructor of the plugin. 2025 */ 2026 plugin: function plugin(_plugin, name) { 2027 // Object key to use when adding to global Foundation object 2028 // Examples: Foundation.Reveal, Foundation.OffCanvas 2029 var className = name || functionName(_plugin); // Object key to use when storing the plugin, also used to create the identifying data attribute for the plugin 2030 // Examples: data-reveal, data-off-canvas 2031 2032 var attrName = hyphenate(className); // Add to the Foundation object and the plugins list (for reflowing) 2033 2034 this._plugins[attrName] = this[className] = _plugin; 2035 }, 2036 2037 /** 2038 * @function 2039 * Populates the _uuids array with pointers to each individual plugin instance. 2040 * Adds the `zfPlugin` data-attribute to programmatically created plugins to allow use of $(selector).foundation(method) calls. 2041 * Also fires the initialization event for each plugin, consolidating repetitive code. 2042 * @param {Object} plugin - an instance of a plugin, usually `this` in context. 2043 * @param {String} name - the name of the plugin, passed as a camelCased string. 2044 * @fires Plugin#init 2045 */ 2046 registerPlugin: function registerPlugin(plugin, name) { 2047 var pluginName = name ? hyphenate(name) : functionName(plugin.constructor).toLowerCase(); 2048 plugin.uuid = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["GetYoDigits"])(6, pluginName); 2049 2050 if (!plugin.$element.attr("data-".concat(pluginName))) { 2051 plugin.$element.attr("data-".concat(pluginName), plugin.uuid); 2052 } 2053 2054 if (!plugin.$element.data('zfPlugin')) { 2055 plugin.$element.data('zfPlugin', plugin); 2056 } 2057 /** 2058 * Fires when the plugin has initialized. 2059 * @event Plugin#init 2060 */ 2061 2062 2063 plugin.$element.trigger("init.zf.".concat(pluginName)); 2064 2065 this._uuids.push(plugin.uuid); 2066 2067 return; 2068 }, 2069 2070 /** 2071 * @function 2072 * Removes the plugins uuid from the _uuids array. 2073 * Removes the zfPlugin data attribute, as well as the data-plugin-name attribute. 2074 * Also fires the destroyed event for the plugin, consolidating repetitive code. 2075 * @param {Object} plugin - an instance of a plugin, usually `this` in context. 2076 * @fires Plugin#destroyed 2077 */ 2078 unregisterPlugin: function unregisterPlugin(plugin) { 2079 var pluginName = hyphenate(functionName(plugin.$element.data('zfPlugin').constructor)); 2080 2081 this._uuids.splice(this._uuids.indexOf(plugin.uuid), 1); 2082 2083 plugin.$element.removeAttr("data-".concat(pluginName)).removeData('zfPlugin') 2084 /** 2085 * Fires when the plugin has been destroyed. 2086 * @event Plugin#destroyed 2087 */ 2088 .trigger("destroyed.zf.".concat(pluginName)); 2089 2090 for (var prop in plugin) { 2091 plugin[prop] = null; //clean up script to prep for garbage collection. 2092 } 2093 2094 return; 2095 }, 2096 2097 /** 2098 * @function 2099 * Causes one or more active plugins to re-initialize, resetting event listeners, recalculating positions, etc. 2100 * @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'` 2101 * @default If no argument is passed, reflow all currently active plugins. 2102 */ 2103 reInit: function reInit(plugins) { 2104 var isJQ = plugins instanceof jquery__WEBPACK_IMPORTED_MODULE_0___default.a; 2105 2106 try { 2107 if (isJQ) { 2108 plugins.each(function () { 2109 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('zfPlugin')._init(); 2110 }); 2111 } else { 2112 var type = _typeof(plugins), 2113 _this = this, 2114 fns = { 2115 'object': function object(plgs) { 2116 plgs.forEach(function (p) { 2117 p = hyphenate(p); 2118 jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-' + p + ']').foundation('_init'); 2119 }); 2120 }, 2121 'string': function string() { 2122 plugins = hyphenate(plugins); 2123 jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-' + plugins + ']').foundation('_init'); 2124 }, 2125 'undefined': function undefined() { 2126 this['object'](Object.keys(_this._plugins)); 2127 } 2128 }; 2129 2130 fns[type](plugins); 2131 } 2132 } catch (err) { 2133 console.error(err); 2134 } finally { 2135 return plugins; 2136 } 2137 }, 2138 2139 /** 2140 * Initialize plugins on any elements within `elem` (and `elem` itself) that aren't already initialized. 2141 * @param {Object} elem - jQuery object containing the element to check inside. Also checks the element itself, unless it's the `document` object. 2142 * @param {String|Array} plugins - A list of plugins to initialize. Leave this out to initialize everything. 2143 */ 2144 reflow: function reflow(elem, plugins) { 2145 // If plugins is undefined, just grab everything 2146 if (typeof plugins === 'undefined') { 2147 plugins = Object.keys(this._plugins); 2148 } // If plugins is a string, convert it to an array with one item 2149 else if (typeof plugins === 'string') { 2150 plugins = [plugins]; 2151 } 2152 2153 var _this = this; // Iterate through each plugin 2154 2155 2156 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.each(plugins, function (i, name) { 2157 // Get the current plugin 2158 var plugin = _this._plugins[name]; // Localize the search to all elements inside elem, as well as elem itself, unless elem === document 2159 2160 var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(elem).find('[data-' + name + ']').addBack('[data-' + name + ']'); // For each plugin found, initialize it 2161 2162 $elem.each(function () { 2163 var $el = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 2164 opts = {}; // Don't double-dip on plugins 2165 2166 if ($el.data('zfPlugin')) { 2167 console.warn("Tried to initialize " + name + " on an element that already has a Foundation plugin."); 2168 return; 2169 } 2170 2171 if ($el.attr('data-options')) { 2172 var thing = $el.attr('data-options').split(';').forEach(function (e, i) { 2173 var opt = e.split(':').map(function (el) { 2174 return el.trim(); 2175 }); 2176 if (opt[0]) opts[opt[0]] = parseValue(opt[1]); 2177 }); 2178 } 2179 2180 try { 2181 $el.data('zfPlugin', new plugin(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), opts)); 2182 } catch (er) { 2183 console.error(er); 2184 } finally { 2185 return; 2186 } 2187 }); 2188 }); 2189 }, 2190 getFnName: functionName, 2191 addToJquery: function addToJquery($) { 2192 // TODO: consider not making this a jQuery function 2193 // TODO: need way to reflow vs. re-initialize 2194 2195 /** 2196 * The Foundation jQuery method. 2197 * @param {String|Array} method - An action to perform on the current jQuery object. 2198 */ 2199 var foundation = function foundation(method) { 2200 var type = _typeof(method), 2201 $noJS = $('.no-js'); 2202 2203 if ($noJS.length) { 2204 $noJS.removeClass('no-js'); 2205 } 2206 2207 if (type === 'undefined') { 2208 //needs to initialize the Foundation object, or an individual plugin. 2209 _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__["MediaQuery"]._init(); 2210 2211 Foundation.reflow(this); 2212 } else if (type === 'string') { 2213 //an individual method to invoke on a plugin or group of plugins 2214 var args = Array.prototype.slice.call(arguments, 1); //collect all the arguments, if necessary 2215 2216 var plugClass = this.data('zfPlugin'); //determine the class of plugin 2217 2218 if (typeof plugClass !== 'undefined' && typeof plugClass[method] !== 'undefined') { 2219 //make sure both the class and method exist 2220 if (this.length === 1) { 2221 //if there's only one, call it directly. 2222 plugClass[method].apply(plugClass, args); 2223 } else { 2224 this.each(function (i, el) { 2225 //otherwise loop through the jQuery collection and invoke the method on each 2226 plugClass[method].apply($(el).data('zfPlugin'), args); 2227 }); 2228 } 2229 } else { 2230 //error for no class or no method 2231 throw new ReferenceError("We're sorry, '" + method + "' is not an available method for " + (plugClass ? functionName(plugClass) : 'this element') + '.'); 2232 } 2233 } else { 2234 //error for invalid argument type 2235 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.")); 2236 } 2237 2238 return this; 2239 }; 2240 2241 $.fn.foundation = foundation; 2242 return $; 2243 } 2244}; 2245Foundation.util = { 2246 /** 2247 * Function for applying a debounce effect to a function call. 2248 * @function 2249 * @param {Function} func - Function to be called at end of timeout. 2250 * @param {Number} delay - Time in ms to delay the call of `func`. 2251 * @returns function 2252 */ 2253 throttle: function throttle(func, delay) { 2254 var timer = null; 2255 return function () { 2256 var context = this, 2257 args = arguments; 2258 2259 if (timer === null) { 2260 timer = setTimeout(function () {
vendor: 2,942 bytes, lines 2261-2362
2261 func.apply(context, args); 2262 timer = null; 2263 }, delay); 2264 } 2265 }; 2266 } 2267}; 2268window.Foundation = Foundation; // Polyfill for requestAnimationFrame 2269 2270(function () { 2271 if (!Date.now || !window.Date.now) window.Date.now = Date.now = function () { 2272 return new Date().getTime(); 2273 }; 2274 var vendors = ['webkit', 'moz']; 2275 2276 for (var i = 0; i < vendors.length && !window.requestAnimationFrame; ++i) { 2277 var vp = vendors[i]; 2278 window.requestAnimationFrame = window[vp + 'RequestAnimationFrame']; 2279 window.cancelAnimationFrame = window[vp + 'CancelAnimationFrame'] || window[vp + 'CancelRequestAnimationFrame']; 2280 } 2281 2282 if (/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent) || !window.requestAnimationFrame || !window.cancelAnimationFrame) { 2283 var lastTime = 0; 2284 2285 window.requestAnimationFrame = function (callback) { 2286 var now = Date.now(); 2287 var nextTime = Math.max(lastTime + 16, now); 2288 return setTimeout(function () { 2289 callback(lastTime = nextTime); 2290 }, nextTime - now); 2291 }; 2292 2293 window.cancelAnimationFrame = clearTimeout; 2294 } 2295 /** 2296 * Polyfill for performance.now, required by rAF 2297 */ 2298 2299 2300 if (!window.performance || !window.performance.now) { 2301 window.performance = { 2302 start: Date.now(), 2303 now: function now() { 2304 return Date.now() - this.start; 2305 } 2306 }; 2307 } 2308})(); 2309 2310if (!Function.prototype.bind) { 2311 Function.prototype.bind = function (oThis) { 2312 if (typeof this !== 'function') { 2313 // closest thing possible to the ECMAScript 5 2314 // internal IsCallable function 2315 throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable'); 2316 } 2317 2318 var aArgs = Array.prototype.slice.call(arguments, 1), 2319 fToBind = this, 2320 fNOP = function fNOP() {}, 2321 fBound = function fBound() { 2322 return fToBind.apply(this instanceof fNOP ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments))); 2323 }; 2324 2325 if (this.prototype) { 2326 // native functions don't have a prototype 2327 fNOP.prototype = this.prototype; 2328 } 2329 2330 fBound.prototype = new fNOP(); 2331 return fBound; 2332 }; 2333} // Polyfill to get the name of a function in IE9 2334 2335 2336function functionName(fn) { 2337 if (typeof Function.prototype.name === 'undefined') { 2338 var funcNameRegex = /function\s([^(]{1,})\(/; 2339 var results = funcNameRegex.exec(fn.toString()); 2340 return results && results.length > 1 ? results[1].trim() : ""; 2341 } else if (typeof fn.prototype === 'undefined') { 2342 return fn.constructor.name; 2343 } else { 2344 return fn.prototype.constructor.name; 2345 } 2346} 2347 2348function parseValue(str) { 2349 if ('true' === str) return true;else if ('false' === str) return false;else if (!isNaN(str * 1)) return parseFloat(str); 2350 return str; 2351} // Convert PascalCase to kebab-case 2352// Thank you: http://stackoverflow.com/a/8955580 2353 2354 2355function hyphenate(str) { 2356 return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(); 2357} 2358 2359 2360 2361/***/ }), 2362
2363/***/ "./js/foundation.core.plugin.js": 2364/*!**************************************!*\ 2365 !*** ./js/foundation.core.plugin.js ***! 2366 \**************************************/ 2367/*! exports provided: Plugin */ 2368/***/ (function(module, __webpack_exports__, __webpack_require__) { 2369 2370"use strict"; 2371__webpack_require__.r(__webpack_exports__); 2372/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Plugin", function() { return Plugin; }); 2373/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 2374/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 2375/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 2376 2377 2378function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 2379 2380function _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); } } 2381 2382function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 2383 2384 2385 // Abstract class for providing lifecycle hooks. Expect plugins to define AT LEAST 2386// {function} _setup (replaces previous constructor), 2387// {function} _destroy (replaces previous destroy) 2388 2389var Plugin = 2390/*#__PURE__*/ 2391function () { 2392 function Plugin(element, options) { 2393 _classCallCheck(this, Plugin); 2394 2395 this._setup(element, options); 2396 2397 var pluginName = getPluginName(this); 2398 this.uuid = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["GetYoDigits"])(6, pluginName); 2399 2400 if (!this.$element.attr("data-".concat(pluginName))) { 2401 this.$element.attr("data-".concat(pluginName), this.uuid); 2402 } 2403 2404 if (!this.$element.data('zfPlugin')) { 2405 this.$element.data('zfPlugin', this); 2406 } 2407 /** 2408 * Fires when the plugin has initialized. 2409 * @event Plugin#init 2410 */ 2411 2412 2413 this.$element.trigger("init.zf.".concat(pluginName)); 2414 } 2415 2416 _createClass(Plugin, [{ 2417 key: "destroy", 2418 value: function destroy() { 2419 this._destroy(); 2420 2421 var pluginName = getPluginName(this); 2422 this.$element.removeAttr("data-".concat(pluginName)).removeData('zfPlugin') 2423 /** 2424 * Fires when the plugin has been destroyed. 2425 * @event Plugin#destroyed 2426 */ 2427 .trigger("destroyed.zf.".concat(pluginName)); 2428 2429 for (var prop in this) { 2430 this[prop] = null; //clean up script to prep for garbage collection. 2431 } 2432 } 2433 }]); 2434 2435 return Plugin; 2436}(); // Convert PascalCase to kebab-case 2437// Thank you: http://stackoverflow.com/a/8955580 2438 2439 2440function hyphenate(str) { 2441 return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(); 2442} 2443 2444function getPluginName(obj) { 2445 if (typeof obj.constructor.name !== 'undefined') { 2446 return hyphenate(obj.constructor.name); 2447 } else { 2448 return hyphenate(obj.className); 2449 } 2450} 2451 2452 2453 2454/***/ }), 2455
vendor: 6,911 bytes, lines 2456-2629
2456/***/ "./js/foundation.core.utils.js": 2457/*!*************************************!*\ 2458 !*** ./js/foundation.core.utils.js ***! 2459 \*************************************/ 2460/*! exports provided: rtl, GetYoDigits, RegExpEscape, transitionend, onLoad, ignoreMousedisappear */ 2461/***/ (function(module, __webpack_exports__, __webpack_require__) { 2462 2463"use strict"; 2464__webpack_require__.r(__webpack_exports__); 2465/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rtl", function() { return rtl; }); 2466/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GetYoDigits", function() { return GetYoDigits; }); 2467/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RegExpEscape", function() { return RegExpEscape; }); 2468/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transitionend", function() { return transitionend; }); 2469/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onLoad", function() { return onLoad; }); 2470/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ignoreMousedisappear", function() { return ignoreMousedisappear; }); 2471/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 2472/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 2473 2474 2475 // Core Foundation Utilities, utilized in a number of places. 2476 2477/** 2478 * Returns a boolean for RTL support 2479 */ 2480 2481function rtl() { 2482 return jquery__WEBPACK_IMPORTED_MODULE_0___default()('html').attr('dir') === 'rtl'; 2483} 2484/** 2485 * returns a random base-36 uid with namespacing 2486 * @function 2487 * @param {Number} length - number of random base-36 digits desired. Increase for more random strings. 2488 * @param {String} namespace - name of plugin to be incorporated in uid, optional. 2489 * @default {String} '' - if no plugin name is provided, nothing is appended to the uid. 2490 * @returns {String} - unique id 2491 */ 2492 2493 2494function GetYoDigits(length, namespace) { 2495 length = length || 6; 2496 return Math.round(Math.pow(36, length + 1) - Math.random() * Math.pow(36, length)).toString(36).slice(1) + (namespace ? "-".concat(namespace) : ''); 2497} 2498/** 2499 * Escape a string so it can be used as a regexp pattern 2500 * @function 2501 * @see https://stackoverflow.com/a/9310752/4317384 2502 * 2503 * @param {String} str - string to escape. 2504 * @returns {String} - escaped string 2505 */ 2506 2507 2508function RegExpEscape(str) { 2509 return str.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); 2510} 2511 2512function transitionend($elem) { 2513 var transitions = { 2514 'transition': 'transitionend', 2515 'WebkitTransition': 'webkitTransitionEnd', 2516 'MozTransition': 'transitionend', 2517 'OTransition': 'otransitionend' 2518 }; 2519 var elem = document.createElement('div'), 2520 end; 2521 2522 for (var t in transitions) { 2523 if (typeof elem.style[t] !== 'undefined') { 2524 end = transitions[t]; 2525 } 2526 } 2527 2528 if (end) { 2529 return end; 2530 } else { 2531 end = setTimeout(function () { 2532 $elem.triggerHandler('transitionend', [$elem]); 2533 }, 1); 2534 return 'transitionend'; 2535 } 2536} 2537/** 2538 * Return an event type to listen for window load. 2539 * 2540 * If `$elem` is passed, an event will be triggered on `$elem`. If window is already loaded, the event will still be triggered. 2541 * If `handler` is passed, attach it to the event on `$elem`. 2542 * Calling `onLoad` without handler allows you to get the event type that will be triggered before attaching the handler by yourself. 2543 * @function 2544 * 2545 * @param {Object} [] $elem - jQuery element on which the event will be triggered if passed. 2546 * @param {Function} [] handler - function to attach to the event. 2547 * @returns {String} - event type that should or will be triggered. 2548 */ 2549 2550 2551function onLoad($elem, handler) { 2552 var didLoad = document.readyState === 'complete'; 2553 var eventType = (didLoad ? '_didLoad' : 'load') + '.zf.util.onLoad'; 2554 2555 var cb = function cb() { 2556 return $elem.triggerHandler(eventType); 2557 }; 2558 2559 if ($elem) { 2560 if (handler) $elem.one(eventType, handler); 2561 if (didLoad) setTimeout(cb);else jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).one('load', cb); 2562 } 2563 2564 return eventType; 2565} 2566/** 2567 * Retuns an handler for the `mouseleave` that ignore disappeared mouses. 2568 * 2569 * If the mouse "disappeared" from the document (like when going on a browser UI element, See https://git.io/zf-11410), 2570 * the event is ignored. 2571 * - If the `ignoreLeaveWindow` is `true`, the event is ignored when the user actually left the window 2572 * (like by switching to an other window with [Alt]+[Tab]). 2573 * - If the `ignoreReappear` is `true`, the event will be ignored when the mouse will reappear later on the document 2574 * outside of the element it left. 2575 * 2576 * @function 2577 * 2578 * @param {Function} [] handler - handler for the filtered `mouseleave` event to watch. 2579 * @param {Object} [] options - object of options: 2580 * - {Boolean} [false] ignoreLeaveWindow - also ignore when the user switched windows. 2581 * - {Boolean} [false] ignoreReappear - also ignore when the mouse reappeared outside of the element it left. 2582 * @returns {Function} - filtered handler to use to listen on the `mouseleave` event. 2583 */ 2584 2585 2586function ignoreMousedisappear(handler) { 2587 var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, 2588 _ref$ignoreLeaveWindo = _ref.ignoreLeaveWindow, 2589 ignoreLeaveWindow = _ref$ignoreLeaveWindo === void 0 ? false : _ref$ignoreLeaveWindo, 2590 _ref$ignoreReappear = _ref.ignoreReappear, 2591 ignoreReappear = _ref$ignoreReappear === void 0 ? false : _ref$ignoreReappear; 2592 2593 return function leaveEventHandler(eLeave) { 2594 for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { 2595 rest[_key - 1] = arguments[_key]; 2596 } 2597 2598 var callback = handler.bind.apply(handler, [this, eLeave].concat(rest)); // The mouse left: call the given callback if the mouse entered elsewhere 2599 2600 if (eLeave.relatedTarget !== null) { 2601 return callback(); 2602 } // Otherwise, check if the mouse actually left the window. 2603 // In firefox if the user switched between windows, the window sill have the focus by the time 2604 // the event is triggered. We have to debounce the event to test this case. 2605 2606 2607 setTimeout(function leaveEventDebouncer() { 2608 if (!ignoreLeaveWindow && document.hasFocus && !document.hasFocus()) { 2609 return callback(); 2610 } // Otherwise, wait for the mouse to reeapear outside of the element, 2611 2612 2613 if (!ignoreReappear) { 2614 jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).one('mouseenter', function reenterEventHandler(eReenter) { 2615 if (!jquery__WEBPACK_IMPORTED_MODULE_0___default()(eLeave.currentTarget).has(eReenter.target).length) { 2616 // Fill where the mouse finally entered. 2617 eLeave.relatedTarget = eReenter.target; 2618 callback(); 2619 } 2620 }); 2621 } 2622 }, 0); 2623 }; 2624} 2625 2626 2627 2628/***/ }), 2629
vendor: 4,843 bytes, lines 2630-2711
2630/***/ "./js/foundation.drilldown.js": 2631/*!************************************!*\ 2632 !*** ./js/foundation.drilldown.js ***! 2633 \************************************/ 2634/*! exports provided: Drilldown */ 2635/***/ (function(module, __webpack_exports__, __webpack_require__) { 2636 2637"use strict"; 2638__webpack_require__.r(__webpack_exports__); 2639/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Drilldown", function() { return Drilldown; }); 2640/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 2641/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 2642/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js"); 2643/* harmony import */ var _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.nest */ "./js/foundation.util.nest.js"); 2644/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 2645/* harmony import */ var _foundation_util_box__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.box */ "./js/foundation.util.box.js"); 2646/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 2647 2648 2649function _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); } 2650 2651function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 2652 2653function _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); } } 2654 2655function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 2656 2657function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 2658 2659function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 2660 2661function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 2662 2663function _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); } 2664 2665function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 2666 2667 2668 2669 2670 2671 2672 2673/** 2674 * Drilldown module. 2675 * @module foundation.drilldown 2676 * @requires foundation.util.keyboard 2677 * @requires foundation.util.nest 2678 * @requires foundation.util.box 2679 */ 2680 2681var Drilldown = 2682/*#__PURE__*/ 2683function (_Plugin) { 2684 _inherits(Drilldown, _Plugin); 2685 2686 function Drilldown() { 2687 _classCallCheck(this, Drilldown); 2688 2689 return _possibleConstructorReturn(this, _getPrototypeOf(Drilldown).apply(this, arguments)); 2690 } 2691 2692 _createClass(Drilldown, [{ 2693 key: "_setup", 2694 2695 /** 2696 * Creates a new instance of a drilldown menu. 2697 * @class 2698 * @name Drilldown 2699 * @param {jQuery} element - jQuery object to make into an accordion menu. 2700 * @param {Object} options - Overrides to the default plugin settings. 2701 */ 2702 value: function _setup(element, options) { 2703 this.$element = element; 2704 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Drilldown.defaults, this.$element.data(), options); 2705 this.className = 'Drilldown'; // ie9 back compat 2706 2707 this._init(); 2708 2709 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].register('Drilldown', { 2710 'ENTER': 'open', 2711 'SPACE': 'open',
vendor: 20,378 bytes, lines 2712-3280
2712 'ARROW_RIGHT': 'next', 2713 'ARROW_UP': 'up', 2714 'ARROW_DOWN': 'down', 2715 'ARROW_LEFT': 'previous', 2716 'ESCAPE': 'close', 2717 'TAB': 'down', 2718 'SHIFT_TAB': 'up' 2719 }); 2720 } 2721 /** 2722 * Initializes the drilldown by creating jQuery collections of elements 2723 * @private 2724 */ 2725 2726 }, { 2727 key: "_init", 2728 value: function _init() { 2729 _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__["Nest"].Feather(this.$element, 'drilldown'); 2730 2731 if (this.options.autoApplyClass) { 2732 this.$element.addClass('drilldown'); 2733 } 2734 2735 this.$element.attr({ 2736 'role': 'tree', 2737 'aria-multiselectable': false 2738 }); 2739 this.$submenuAnchors = this.$element.find('li.is-drilldown-submenu-parent').children('a'); 2740 this.$submenus = this.$submenuAnchors.parent('li').children('[data-submenu]').attr('role', 'group'); 2741 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) 2742 // Used to set the wrapper height when the drilldown is closed/reopened from any (sub)menu 2743 2744 this.$currentMenu = this.$element; 2745 this.$element.attr('data-mutate', this.$element.attr('data-drilldown') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'drilldown')); 2746 2747 this._prepareMenu(); 2748 2749 this._registerEvents(); 2750 2751 this._keyboardEvents(); 2752 } 2753 /** 2754 * prepares drilldown menu by setting attributes to links and elements 2755 * sets a min height to prevent content jumping 2756 * wraps the element if not already wrapped 2757 * @private 2758 * @function 2759 */ 2760 2761 }, { 2762 key: "_prepareMenu", 2763 value: function _prepareMenu() { 2764 var _this = this; // if(!this.options.holdOpen){ 2765 // this._menuLinkEvents(); 2766 // } 2767 2768 2769 this.$submenuAnchors.each(function () { 2770 var $link = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this); 2771 var $sub = $link.parent(); 2772 2773 if (_this.options.parentLink) { 2774 $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="menuitem"></li>'); 2775 } 2776 2777 $link.data('savedHref', $link.attr('href')).removeAttr('href').attr('tabindex', 0); 2778 $link.children('[data-submenu]').attr({ 2779 'aria-hidden': true, 2780 'tabindex': 0, 2781 'role': 'group' 2782 }); 2783 2784 _this._events($link); 2785 }); 2786 this.$submenus.each(function () { 2787 var $menu = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 2788 $back = $menu.find('.js-drilldown-back'); 2789 2790 if (!$back.length) { 2791 switch (_this.options.backButtonPosition) { 2792 case "bottom": 2793 $menu.append(_this.options.backButton); 2794 break; 2795 2796 case "top": 2797 $menu.prepend(_this.options.backButton); 2798 break; 2799 2800 default: 2801 console.error("Unsupported backButtonPosition value '" + _this.options.backButtonPosition + "'"); 2802 } 2803 } 2804 2805 _this._back($menu); 2806 }); 2807 this.$submenus.addClass('invisible'); 2808 2809 if (!this.options.autoHeight) { 2810 this.$submenus.addClass('drilldown-submenu-cover-previous'); 2811 } // create a wrapper on element if it doesn't exist. 2812 2813 2814 if (!this.$element.parent().hasClass('is-drilldown')) { 2815 this.$wrapper = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.options.wrapper).addClass('is-drilldown'); 2816 if (this.options.animateHeight) this.$wrapper.addClass('animate-height'); 2817 this.$element.wrap(this.$wrapper); 2818 } // set wrapper 2819 2820 2821 this.$wrapper = this.$element.parent(); 2822 this.$wrapper.css(this._getMaxDims()); 2823 } 2824 }, { 2825 key: "_resize", 2826 value: function _resize() { 2827 this.$wrapper.css({ 2828 'max-width': 'none', 2829 'min-height': 'none' 2830 }); // _getMaxDims has side effects (boo) but calling it should update all other necessary heights & widths 2831 2832 this.$wrapper.css(this._getMaxDims()); 2833 } 2834 /** 2835 * Adds event handlers to elements in the menu. 2836 * @function 2837 * @private 2838 * @param {jQuery} $elem - the current menu item to add handlers to. 2839 */ 2840 2841 }, { 2842 key: "_events", 2843 value: function _events($elem) { 2844 var _this = this; 2845 2846 $elem.off('click.zf.drilldown').on('click.zf.drilldown', function (e) { 2847 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).parentsUntil('ul', 'li').hasClass('is-drilldown-submenu-parent')) { 2848 e.stopImmediatePropagation(); 2849 e.preventDefault(); 2850 } // if(e.target !== e.currentTarget.firstElementChild){ 2851 // return false; 2852 // } 2853 2854 2855 _this._show($elem.parent('li')); 2856 2857 if (_this.options.closeOnClick) { 2858 var $body = jquery__WEBPACK_IMPORTED_MODULE_0___default()('body'); 2859 $body.off('.zf.drilldown').on('click.zf.drilldown', function (e) { 2860 if (e.target === _this.$element[0] || jquery__WEBPACK_IMPORTED_MODULE_0___default.a.contains(_this.$element[0], e.target)) { 2861 return; 2862 } 2863 2864 e.preventDefault(); 2865 2866 _this._hideAll(); 2867 2868 $body.off('.zf.drilldown'); 2869 }); 2870 } 2871 }); 2872 } 2873 /** 2874 * Adds event handlers to the menu element. 2875 * @function 2876 * @private 2877 */ 2878 2879 }, { 2880 key: "_registerEvents", 2881 value: function _registerEvents() { 2882 if (this.options.scrollTop) { 2883 this._bindHandler = this._scrollTop.bind(this); 2884 this.$element.on('open.zf.drilldown hide.zf.drilldown closed.zf.drilldown', this._bindHandler); 2885 } 2886 2887 this.$element.on('mutateme.zf.trigger', this._resize.bind(this)); 2888 } 2889 /** 2890 * Scroll to Top of Element or data-scroll-top-element 2891 * @function 2892 * @fires Drilldown#scrollme 2893 */ 2894 2895 }, { 2896 key: "_scrollTop", 2897 value: function _scrollTop() { 2898 var _this = this; 2899 2900 var $scrollTopElement = _this.options.scrollTopElement != '' ? jquery__WEBPACK_IMPORTED_MODULE_0___default()(_this.options.scrollTopElement) : _this.$element, 2901 scrollPos = parseInt($scrollTopElement.offset().top + _this.options.scrollTopOffset, 10); 2902 jquery__WEBPACK_IMPORTED_MODULE_0___default()('html, body').stop(true).animate({ 2903 scrollTop: scrollPos 2904 }, _this.options.animationDuration, _this.options.animationEasing, function () { 2905 /** 2906 * Fires after the menu has scrolled 2907 * @event Drilldown#scrollme 2908 */ 2909 if (this === jquery__WEBPACK_IMPORTED_MODULE_0___default()('html')[0]) _this.$element.trigger('scrollme.zf.drilldown'); 2910 }); 2911 } 2912 /** 2913 * Adds keydown event listener to `li`'s in the menu. 2914 * @private 2915 */ 2916 2917 }, { 2918 key: "_keyboardEvents", 2919 value: function _keyboardEvents() { 2920 var _this = this; 2921 2922 this.$menuItems.add(this.$element.find('.js-drilldown-back > a, .is-submenu-parent-item > a')).on('keydown.zf.drilldown', function (e) { 2923 var $element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 2924 $elements = $element.parent('li').parent('ul').children('li').children('a'), 2925 $prevElement, 2926 $nextElement; 2927 $elements.each(function (i) { 2928 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is($element)) { 2929 $prevElement = $elements.eq(Math.max(0, i - 1)); 2930 $nextElement = $elements.eq(Math.min(i + 1, $elements.length - 1)); 2931 return; 2932 } 2933 }); 2934 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].handleKey(e, 'Drilldown', { 2935 next: function next() { 2936 if ($element.is(_this.$submenuAnchors)) { 2937 _this._show($element.parent('li')); 2938 2939 $element.parent('li').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($element), function () { 2940 $element.parent('li').find('ul li a').not('.js-drilldown-back a').first().focus(); 2941 }); 2942 return true; 2943 } 2944 }, 2945 previous: function previous() { 2946 _this._hide($element.parent('li').parent('ul')); 2947 2948 $element.parent('li').parent('ul').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($element), function () { 2949 setTimeout(function () { 2950 $element.parent('li').parent('ul').parent('li').children('a').first().focus(); 2951 }, 1); 2952 }); 2953 return true; 2954 }, 2955 up: function up() { 2956 $prevElement.focus(); // Don't tap focus on first element in root ul 2957 2958 return !$element.is(_this.$element.find('> li:first-child > a')); 2959 }, 2960 down: function down() { 2961 $nextElement.focus(); // Don't tap focus on last element in root ul 2962 2963 return !$element.is(_this.$element.find('> li:last-child > a')); 2964 }, 2965 close: function close() { 2966 // Don't close on element in root ul 2967 if (!$element.is(_this.$element.find('> li > a'))) { 2968 _this._hide($element.parent().parent()); 2969 2970 $element.parent().parent().siblings('a').focus(); 2971 } 2972 }, 2973 open: function open() { 2974 if (_this.options.parentLink && $element.attr('href')) { 2975 // Link with href 2976 return false; 2977 } else if (!$element.is(_this.$menuItems)) { 2978 // not menu item means back button 2979 _this._hide($element.parent('li').parent('ul')); 2980 2981 $element.parent('li').parent('ul').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($element), function () { 2982 setTimeout(function () { 2983 $element.parent('li').parent('ul').parent('li').children('a').first().focus(); 2984 }, 1); 2985 }); 2986 return true; 2987 } else if ($element.is(_this.$submenuAnchors)) { 2988 // Sub menu item 2989 _this._show($element.parent('li')); 2990 2991 $element.parent('li').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($element), function () { 2992 $element.parent('li').find('ul li a').not('.js-drilldown-back a').first().focus(); 2993 }); 2994 return true; 2995 } 2996 }, 2997 handled: function handled(preventDefault) { 2998 if (preventDefault) { 2999 e.preventDefault(); 3000 } 3001 3002 e.stopImmediatePropagation(); 3003 } 3004 }); 3005 }); // end keyboardAccess 3006 } 3007 /** 3008 * Closes all open elements, and returns to root menu. 3009 * @function 3010 * @fires Drilldown#closed 3011 */ 3012 3013 }, { 3014 key: "_hideAll", 3015 value: function _hideAll() { 3016 var $elem = this.$element.find('.is-drilldown-submenu.is-active').addClass('is-closing'); 3017 if (this.options.autoHeight) this.$wrapper.css({ 3018 height: $elem.parent().closest('ul').data('calcHeight') 3019 }); 3020 $elem.one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($elem), function (e) { 3021 $elem.removeClass('is-active is-closing'); 3022 }); 3023 /** 3024 * Fires when the menu is fully closed. 3025 * @event Drilldown#closed 3026 */ 3027 3028 this.$element.trigger('closed.zf.drilldown'); 3029 } 3030 /** 3031 * Adds event listener for each `back` button, and closes open menus. 3032 * @function 3033 * @fires Drilldown#back 3034 * @param {jQuery} $elem - the current sub-menu to add `back` event. 3035 */ 3036 3037 }, { 3038 key: "_back", 3039 value: function _back($elem) { 3040 var _this = this; 3041 3042 $elem.off('click.zf.drilldown'); 3043 $elem.children('.js-drilldown-back').on('click.zf.drilldown', function (e) { 3044 e.stopImmediatePropagation(); // console.log('mouseup on back'); 3045 3046 _this._hide($elem); // If there is a parent submenu, call show 3047 3048 3049 var parentSubMenu = $elem.parent('li').parent('ul').parent('li'); 3050 3051 if (parentSubMenu.length) { 3052 _this._show(parentSubMenu); 3053 } 3054 }); 3055 } 3056 /** 3057 * Adds event listener to menu items w/o submenus to close open menus on click. 3058 * @function 3059 * @private 3060 */ 3061 3062 }, { 3063 key: "_menuLinkEvents", 3064 value: function _menuLinkEvents() { 3065 var _this = this; 3066 3067 this.$menuItems.not('.is-drilldown-submenu-parent').off('click.zf.drilldown').on('click.zf.drilldown', function (e) { 3068 // e.stopImmediatePropagation(); 3069 setTimeout(function () { 3070 _this._hideAll(); 3071 }, 0); 3072 }); 3073 } 3074 /** 3075 * Sets the CSS classes for submenu to show it. 3076 * @function 3077 * @private 3078 * @param {jQuery} $elem - the target submenu (`ul` tag) 3079 * @param {boolean} trigger - trigger drilldown event 3080 */ 3081 3082 }, { 3083 key: "_setShowSubMenuClasses", 3084 value: function _setShowSubMenuClasses($elem, trigger) { 3085 $elem.addClass('is-active').removeClass('invisible').attr('aria-hidden', false); 3086 $elem.parent('li').attr('aria-expanded', true); 3087 3088 if (trigger === true) { 3089 this.$element.trigger('open.zf.drilldown', [$elem]); 3090 } 3091 } 3092 /** 3093 * Sets the CSS classes for submenu to hide it. 3094 * @function 3095 * @private 3096 * @param {jQuery} $elem - the target submenu (`ul` tag) 3097 * @param {boolean} trigger - trigger drilldown event 3098 */ 3099 3100 }, { 3101 key: "_setHideSubMenuClasses", 3102 value: function _setHideSubMenuClasses($elem, trigger) { 3103 $elem.removeClass('is-active').addClass('invisible').attr('aria-hidden', true); 3104 $elem.parent('li').attr('aria-expanded', false); 3105 3106 if (trigger === true) { 3107 $elem.trigger('hide.zf.drilldown', [$elem]); 3108 } 3109 } 3110 /** 3111 * Opens a specific drilldown (sub)menu no matter which (sub)menu in it is currently visible. 3112 * Compared to _show() this lets you jump into any submenu without clicking through every submenu on the way to it. 3113 * @function 3114 * @fires Drilldown#open 3115 * @param {jQuery} $elem - the target (sub)menu (`ul` tag) 3116 * @param {boolean} autoFocus - if true the first link in the target (sub)menu gets auto focused 3117 */ 3118 3119 }, { 3120 key: "_showMenu", 3121 value: function _showMenu($elem, autoFocus) { 3122 var _this = this; // Reset drilldown 3123 3124 3125 var $expandedSubmenus = this.$element.find('li[aria-expanded="true"] > ul[data-submenu]'); 3126 $expandedSubmenus.each(function (index) { 3127 _this._setHideSubMenuClasses(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)); 3128 }); // Save the menu as the currently displayed one. 3129 3130 this.$currentMenu = $elem; // If target menu is root, focus first link & exit 3131 3132 if ($elem.is('[data-drilldown]')) { 3133 if (autoFocus === true) $elem.find('li[role="treeitem"] > a').first().focus(); 3134 if (this.options.autoHeight) this.$wrapper.css('height', $elem.data('calcHeight')); 3135 return; 3136 } // Find all submenus on way to root incl. the element itself 3137 3138 3139 var $submenus = $elem.children().first().parentsUntil('[data-drilldown]', '[data-submenu]'); // Open target menu and all submenus on its way to root 3140 3141 $submenus.each(function (index) { 3142 // Update height of first child (target menu) if autoHeight option true 3143 if (index === 0 && _this.options.autoHeight) { 3144 _this.$wrapper.css('height', jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('calcHeight')); 3145 } 3146 3147 var isLastChild = index == $submenus.length - 1; // Add transitionsend listener to last child (root due to reverse order) to open target menu's first link 3148 // Last child makes sure the event gets always triggered even if going through several menus 3149 3150 if (isLastChild === true) { 3151 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 () { 3152 if (autoFocus === true) { 3153 $elem.find('li[role="treeitem"] > a').first().focus(); 3154 } 3155 }); 3156 } 3157 3158 _this._setShowSubMenuClasses(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), isLastChild); 3159 }); 3160 } 3161 /** 3162 * Opens a submenu. 3163 * @function 3164 * @fires Drilldown#open 3165 * @param {jQuery} $elem - the current element with a submenu to open, i.e. the `li` tag. 3166 */ 3167 3168 }, { 3169 key: "_show", 3170 value: function _show($elem) { 3171 var $submenu = $elem.children('[data-submenu]'); 3172 $elem.attr('aria-expanded', true); 3173 this.$currentMenu = $submenu; 3174 $submenu.addClass('is-active').removeClass('invisible').attr('aria-hidden', false); 3175 3176 if (this.options.autoHeight) { 3177 this.$wrapper.css({ 3178 height: $submenu.data('calcHeight') 3179 }); 3180 } 3181 /** 3182 * Fires when the submenu has opened. 3183 * @event Drilldown#open 3184 */ 3185 3186 3187 this.$element.trigger('open.zf.drilldown', [$elem]); 3188 } 3189 /** 3190 * Hides a submenu 3191 * @function 3192 * @fires Drilldown#hide 3193 * @param {jQuery} $elem - the current sub-menu to hide, i.e. the `ul` tag. 3194 */ 3195 3196 }, { 3197 key: "_hide", 3198 value: function _hide($elem) { 3199 if (this.options.autoHeight) this.$wrapper.css({ 3200 height: $elem.parent().closest('ul').data('calcHeight') 3201 }); 3202 3203 var _this = this; 3204 3205 $elem.parent('li').attr('aria-expanded', false); 3206 $elem.attr('aria-hidden', true); 3207 $elem.addClass('is-closing').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($elem), function () { 3208 $elem.removeClass('is-active is-closing'); 3209 $elem.blur().addClass('invisible'); 3210 }); 3211 /** 3212 * Fires when the submenu has closed. 3213 * @event Drilldown#hide 3214 */ 3215 3216 $elem.trigger('hide.zf.drilldown', [$elem]); 3217 } 3218 /** 3219 * Iterates through the nested menus to calculate the min-height, and max-width for the menu. 3220 * Prevents content jumping. 3221 * @function 3222 * @private 3223 */ 3224 3225 }, { 3226 key: "_getMaxDims", 3227 value: function _getMaxDims() { 3228 var maxHeight = 0, 3229 result = {}, 3230 _this = this; // Recalculate menu heights and total max height 3231 3232 3233 this.$submenus.add(this.$element).each(function () { 3234 var numOfElems = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).children('li').length; 3235 var height = _foundation_util_box__WEBPACK_IMPORTED_MODULE_4__["Box"].GetDimensions(this).height; 3236 maxHeight = height > maxHeight ? height : maxHeight; 3237 3238 if (_this.options.autoHeight) { 3239 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('calcHeight', height); 3240 } 3241 }); 3242 if (this.options.autoHeight) result['height'] = this.$currentMenu.data('calcHeight');else result['min-height'] = "".concat(maxHeight, "px"); 3243 result['max-width'] = "".concat(this.$element[0].getBoundingClientRect().width, "px"); 3244 return result; 3245 } 3246 /** 3247 * Destroys the Drilldown Menu 3248 * @function 3249 */ 3250 3251 }, { 3252 key: "_destroy", 3253 value: function _destroy() { 3254 if (this.options.scrollTop) this.$element.off('.zf.drilldown', this._bindHandler); 3255 3256 this._hideAll(); 3257 3258 this.$element.off('mutateme.zf.trigger'); 3259 _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__["Nest"].Burn(this.$element, 'drilldown'); 3260 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'); 3261 this.$submenuAnchors.each(function () { 3262 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).off('.zf.drilldown'); 3263 }); 3264 this.$element.find('[data-is-parent-link]').detach(); 3265 this.$submenus.removeClass('drilldown-submenu-cover-previous invisible'); 3266 this.$element.find('a').each(function () { 3267 var $link = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this); 3268 $link.removeAttr('tabindex'); 3269 3270 if ($link.data('savedHref')) { 3271 $link.attr('href', $link.data('savedHref')).removeData('savedHref'); 3272 } else { 3273 return; 3274 } 3275 }); 3276 } 3277 }]); 3278 3279 return Drilldown; 3280}
3280(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_5__["Plugin"]); 3281 3282Drilldown.defaults = { 3283 /** 3284 * Drilldowns depend on styles in order to function properly; in the default build of Foundation these are 3285 * on the `drilldown` class. This option auto-applies this class to the drilldown upon initialization. 3286 * @option 3287 * @type {boolian} 3288 * @default true 3289 */ 3290 autoApplyClass: true, 3291 3292 /** 3293 * 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. 3294 * @option 3295 * @type {string} 3296 * @default '<li class="js-drilldown-back"><a tabindex="0">Back</a></li>' 3297 */ 3298 backButton: '<li class="js-drilldown-back"><a tabindex="0">Back</a></li>', 3299 3300 /** 3301 * Position the back button either at the top or bottom of drilldown submenus. Can be `'left'` or `'bottom'`. 3302 * @option 3303 * @type {string} 3304 * @default top 3305 */ 3306 backButtonPosition: 'top', 3307 3308 /** 3309 * 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. 3310 * @option 3311 * @type {string} 3312 * @default '<div></div>' 3313 */ 3314 wrapper: '<div></div>', 3315 3316 /** 3317 * Adds the parent link to the submenu. 3318 * @option 3319 * @type {boolean} 3320 * @default false 3321 */ 3322 parentLink: false, 3323 3324 /** 3325 * Allow the menu to return to root list on body click. 3326 * @option 3327 * @type {boolean} 3328 * @default false 3329 */ 3330 closeOnClick: false, 3331 3332 /** 3333 * Allow the menu to auto adjust height. 3334 * @option 3335 * @type {boolean} 3336 * @default false 3337 */ 3338 autoHeight: false, 3339 3340 /** 3341 * Animate the auto adjust height. 3342 * @option 3343 * @type {boolean} 3344 * @default false 3345 */ 3346 animateHeight: false, 3347 3348 /** 3349 * Scroll to the top of the menu after opening a submenu or navigating back using the menu back button 3350 * @option 3351 * @type {boolean} 3352 * @default false 3353 */ 3354 scrollTop: false, 3355 3356 /** 3357 * String jquery selector (for example 'body') of element to take offset().top from, if empty string the drilldown menu offset().top is taken 3358 * @option 3359 * @type {string} 3360 * @default '' 3361 */ 3362 scrollTopElement: '', 3363 3364 /** 3365 * ScrollTop offset 3366 * @option 3367 * @type {number} 3368 * @default 0 3369 */ 3370 scrollTopOffset: 0, 3371 3372 /** 3373 * Scroll animation duration 3374 * @option 3375 * @type {number} 3376 * @default 500 3377 */ 3378 animationDuration: 500, 3379 3380 /** 3381 * Scroll animation easing. Can be `'swing'` or `'linear'`. 3382 * @option 3383 * @type {string} 3384 * @see {@link https://api.jquery.com/animate|JQuery animate} 3385 * @default 'swing' 3386 */ 3387 animationEasing: 'swing' // holdOpen: false 3388 3389}; 3390 3391 3392/***/ }), 3393
vendor: 5,023 bytes, lines 3394-3468
3394/***/ "./js/foundation.dropdown.js": 3395/*!***********************************!*\ 3396 !*** ./js/foundation.dropdown.js ***! 3397 \***********************************/ 3398/*! exports provided: Dropdown */ 3399/***/ (function(module, __webpack_exports__, __webpack_require__) { 3400 3401"use strict"; 3402__webpack_require__.r(__webpack_exports__); 3403/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Dropdown", function() { return Dropdown; }); 3404/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 3405/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 3406/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js"); 3407/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 3408/* harmony import */ var _foundation_positionable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.positionable */ "./js/foundation.positionable.js"); 3409/* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js"); 3410/* harmony import */ var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.util.touch */ "./js/foundation.util.touch.js"); 3411 3412 3413function _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); } 3414 3415function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 3416 3417function _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); } } 3418 3419function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 3420 3421function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 3422 3423function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 3424 3425function _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); } 3426 3427function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 3428 3429function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 3430 3431function _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); } 3432 3433function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 3434 3435 3436 3437 3438 3439 3440 3441/** 3442 * Dropdown module. 3443 * @module foundation.dropdown 3444 * @requires foundation.util.keyboard 3445 * @requires foundation.util.box 3446 * @requires foundation.util.triggers 3447 */ 3448 3449var Dropdown = 3450/*#__PURE__*/ 3451function (_Positionable) { 3452 _inherits(Dropdown, _Positionable); 3453 3454 function Dropdown() { 3455 _classCallCheck(this, Dropdown); 3456 3457 return _possibleConstructorReturn(this, _getPrototypeOf(Dropdown).apply(this, arguments)); 3458 } 3459 3460 _createClass(Dropdown, [{ 3461 key: "_setup", 3462 3463 /** 3464 * Creates a new instance of a dropdown. 3465 * @class 3466 * @name Dropdown 3467 * @param {jQuery} element - jQuery object to make into a dropdown. 3468 * Object should be of the dropdown panel, rather than
vendor: 8,678 bytes, lines 3468-3722
3468its anchor. 3469 * @param {Object} options - Overrides to the default plugin settings. 3470 */ 3471 value: function _setup(element, options) { 3472 this.$element = element; 3473 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Dropdown.defaults, this.$element.data(), options); 3474 this.className = 'Dropdown'; // ie9 back compat 3475 // Triggers init is idempotent, just need to make sure it is initialized 3476 3477 _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 3478 3479 this._init(); 3480 3481 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].register('Dropdown', { 3482 'ENTER': 'toggle', 3483 'SPACE': 'toggle', 3484 'ESCAPE': 'close' 3485 }); 3486 } 3487 /** 3488 * Initializes the plugin by setting/checking options and attributes, adding helper variables, and saving the anchor. 3489 * @function 3490 * @private 3491 */ 3492 3493 }, { 3494 key: "_init", 3495 value: function _init() { 3496 var $id = this.$element.attr('id'); 3497 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, "\"]")); 3498 this.$anchors.attr({ 3499 'aria-controls': $id, 3500 'data-is-focus': false, 3501 'data-yeti-box': $id, 3502 'aria-haspopup': true, 3503 'aria-expanded': false 3504 }); 3505 3506 this._setCurrentAnchor(this.$anchors.first()); 3507 3508 if (this.options.parentClass) { 3509 this.$parent = this.$element.parents('.' + this.options.parentClass); 3510 } else { 3511 this.$parent = null; 3512 } // Set [aria-labelledby] on the Dropdown if it is not set 3513 3514 3515 if (typeof this.$element.attr('aria-labelledby') === 'undefined') { 3516 // Get the anchor ID or create one 3517 if (typeof this.$currentAnchor.attr('id') === 'undefined') { 3518 this.$currentAnchor.attr('id', Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'dd-anchor')); 3519 } 3520 3521 ; 3522 this.$element.attr('aria-labelledby', this.$currentAnchor.attr('id')); 3523 } 3524 3525 this.$element.attr({ 3526 'aria-hidden': 'true', 3527 'data-yeti-box': $id, 3528 'data-resize': $id 3529 }); 3530 3531 _get(_getPrototypeOf(Dropdown.prototype), "_init", this).call(this); 3532 3533 this._events(); 3534 } 3535 }, { 3536 key: "_getDefaultPosition", 3537 value: function _getDefaultPosition() { 3538 // handle legacy classnames 3539 var position = this.$element[0].className.match(/(top|left|right|bottom)/g); 3540 3541 if (position) { 3542 return position[0]; 3543 } else { 3544 return 'bottom'; 3545 } 3546 } 3547 }, { 3548 key: "_getDefaultAlignment", 3549 value: function _getDefaultAlignment() { 3550 // handle legacy float approach 3551 var horizontalPosition = /float-(\S+)/.exec(this.$currentAnchor.attr('class')); 3552 3553 if (horizontalPosition) { 3554 return horizontalPosition[1]; 3555 } 3556 3557 return _get(_getPrototypeOf(Dropdown.prototype), "_getDefaultAlignment", this).call(this); 3558 } 3559 /** 3560 * Sets the position and orientation of the dropdown pane, checks for collisions if allow-overlap is not true. 3561 * Recursively calls itself if a collision is detected, with a new position class. 3562 * @function 3563 * @private 3564 */ 3565 3566 }, { 3567 key: "_setPosition", 3568 value: function _setPosition() { 3569 this.$element.removeClass("has-position-".concat(this.position, " has-alignment-").concat(this.alignment)); 3570 3571 _get(_getPrototypeOf(Dropdown.prototype), "_setPosition", this).call(this, this.$currentAnchor, this.$element, this.$parent); 3572 3573 this.$element.addClass("has-position-".concat(this.position, " has-alignment-").concat(this.alignment)); 3574 } 3575 /** 3576 * Make it a current anchor. 3577 * Current anchor as the reference for the position of Dropdown panes. 3578 * @param {HTML} el - DOM element of the anchor. 3579 * @function 3580 * @private 3581 */ 3582 3583 }, { 3584 key: "_setCurrentAnchor", 3585 value: function _setCurrentAnchor(el) { 3586 this.$currentAnchor = jquery__WEBPACK_IMPORTED_MODULE_0___default()(el); 3587 } 3588 /** 3589 * Adds event listeners to the element utilizing the triggers utility library. 3590 * @function 3591 * @private 3592 */ 3593 3594 }, { 3595 key: "_events", 3596 value: function _events() { 3597 var _this = this; 3598 3599 this.$element.on({ 3600 'open.zf.trigger': this.open.bind(this), 3601 'close.zf.trigger': this.close.bind(this), 3602 'toggle.zf.trigger': this.toggle.bind(this), 3603 'resizeme.zf.trigger': this._setPosition.bind(this) 3604 }); 3605 this.$anchors.off('click.zf.trigger').on('click.zf.trigger', function () { 3606 _this._setCurrentAnchor(this); 3607 }); 3608 3609 if (this.options.hover) { 3610 this.$anchors.off('mouseenter.zf.dropdown mouseleave.zf.dropdown').on('mouseenter.zf.dropdown', function () { 3611 _this._setCurrentAnchor(this); 3612 3613 var bodyData = jquery__WEBPACK_IMPORTED_MODULE_0___default()('body').data(); 3614 3615 if (typeof bodyData.whatinput === 'undefined' || bodyData.whatinput === 'mouse') { 3616 clearTimeout(_this.timeout); 3617 _this.timeout = setTimeout(function () { 3618 _this.open(); 3619 3620 _this.$anchors.data('hover', true); 3621 }, _this.options.hoverDelay); 3622 } 3623 }).on('mouseleave.zf.dropdown', Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["ignoreMousedisappear"])(function () { 3624 clearTimeout(_this.timeout); 3625 _this.timeout = setTimeout(function () { 3626 _this.close(); 3627 3628 _this.$anchors.data('hover', false); 3629 }, _this.options.hoverDelay); 3630 })); 3631 3632 if (this.options.hoverPane) { 3633 this.$element.off('mouseenter.zf.dropdown mouseleave.zf.dropdown').on('mouseenter.zf.dropdown', function () { 3634 clearTimeout(_this.timeout); 3635 }).on('mouseleave.zf.dropdown', Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["ignoreMousedisappear"])(function () { 3636 clearTimeout(_this.timeout); 3637 _this.timeout = setTimeout(function () { 3638 _this.close(); 3639 3640 _this.$anchors.data('hover', false); 3641 }, _this.options.hoverDelay); 3642 })); 3643 } 3644 } 3645 3646 this.$anchors.add(this.$element).on('keydown.zf.dropdown', function (e) { 3647 var $target = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 3648 visibleFocusableElements = _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].findFocusable(_this.$element); 3649 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].handleKey(e, 'Dropdown', { 3650 open: function open() { 3651 if ($target.is(_this.$anchors) && !$target.is('input, textarea')) { 3652 _this.open(); 3653 3654 _this.$element.attr('tabindex', -1).focus(); 3655 3656 e.preventDefault(); 3657 } 3658 }, 3659 close: function close() { 3660 _this.close(); 3661 3662 _this.$anchors.focus(); 3663 } 3664 }); 3665 }); 3666 } 3667 /** 3668 * Adds an event handler to the body to close any dropdowns on a click. 3669 * @function 3670 * @private 3671 */ 3672 3673 }, { 3674 key: "_addBodyHandler", 3675 value: function _addBodyHandler() { 3676 var $body = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.body).not(this.$element), 3677 _this = this; 3678 3679 $body.off('click.zf.dropdown').on('click.zf.dropdown', function (e) { 3680 if (_this.$anchors.is(e.target) || _this.$anchors.find(e.target).length) { 3681 return; 3682 } 3683 3684 if (_this.$element.is(e.target) || _this.$element.find(e.target).length) { 3685 return; 3686 } 3687 3688 _this.close(); 3689 3690 $body.off('click.zf.dropdown'); 3691 }); 3692 } 3693 /** 3694 * Opens the dropdown pane, and fires a bubbling event to close other dropdowns. 3695 * @function 3696 * @fires Dropdown#closeme 3697 * @fires Dropdown#show 3698 */ 3699 3700 }, { 3701 key: "open", 3702 value: function open() { 3703 // var _this = this; 3704 3705 /** 3706 * Fires to close other open dropdowns, typically when dropdown is opening 3707 * @event Dropdown#closeme 3708 */ 3709 this.$element.trigger('closeme.zf.dropdown', this.$element.attr('id')); 3710 this.$anchors.addClass('hover').attr({ 3711 'aria-expanded': true 3712 }); // this.$element/*.show()*/; 3713 3714 this.$element.addClass('is-opening'); 3715 3716 this._setPosition(); 3717 3718 this.$element.removeClass('is-opening').addClass('is-open').attr({ 3719 'aria-hidden': false 3720 }); 3721 3722 if (this.options.autoFocus) {
vendor: 4,444 bytes, lines 3723-3915
3723 var $focusable = _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].findFocusable(this.$element); 3724 3725 if ($focusable.length) { 3726 $focusable.eq(0).focus(); 3727 } 3728 } 3729 3730 if (this.options.closeOnClick) { 3731 this._addBodyHandler(); 3732 } 3733 3734 if (this.options.trapFocus) { 3735 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].trapFocus(this.$element); 3736 } 3737 /** 3738 * Fires once the dropdown is visible. 3739 * @event Dropdown#show 3740 */ 3741 3742 3743 this.$element.trigger('show.zf.dropdown', [this.$element]); 3744 } 3745 /** 3746 * Closes the open dropdown pane. 3747 * @function 3748 * @fires Dropdown#hide 3749 */ 3750 3751 }, { 3752 key: "close", 3753 value: function close() { 3754 if (!this.$element.hasClass('is-open')) { 3755 return false; 3756 } 3757 3758 this.$element.removeClass('is-open').attr({ 3759 'aria-hidden': true 3760 }); 3761 this.$anchors.removeClass('hover').attr('aria-expanded', false); 3762 /** 3763 * Fires once the dropdown is no longer visible. 3764 * @event Dropdown#hide 3765 */ 3766 3767 this.$element.trigger('hide.zf.dropdown', [this.$element]); 3768 3769 if (this.options.trapFocus) { 3770 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].releaseFocus(this.$element); 3771 } 3772 } 3773 /** 3774 * Toggles the dropdown pane's visibility. 3775 * @function 3776 */ 3777 3778 }, { 3779 key: "toggle", 3780 value: function toggle() { 3781 if (this.$element.hasClass('is-open')) { 3782 if (this.$anchors.data('hover')) return; 3783 this.close(); 3784 } else { 3785 this.open(); 3786 } 3787 } 3788 /** 3789 * Destroys the dropdown. 3790 * @function 3791 */ 3792 3793 }, { 3794 key: "_destroy", 3795 value: function _destroy() { 3796 this.$element.off('.zf.trigger').hide(); 3797 this.$anchors.off('.zf.dropdown'); 3798 jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.body).off('click.zf.dropdown'); 3799 } 3800 }]); 3801 3802 return Dropdown; 3803}(_foundation_positionable__WEBPACK_IMPORTED_MODULE_3__["Positionable"]); 3804 3805Dropdown.defaults = { 3806 /** 3807 * Class that designates bounding container of Dropdown (default: window) 3808 * @option 3809 * @type {?string} 3810 * @default null 3811 */ 3812 parentClass: null, 3813 3814 /** 3815 * Amount of time to delay opening a submenu on hover event. 3816 * @option 3817 * @type {number} 3818 * @default 250 3819 */ 3820 hoverDelay: 250, 3821 3822 /** 3823 * Allow submenus to open on hover events 3824 * @option 3825 * @type {boolean} 3826 * @default false 3827 */ 3828 hover: false, 3829 3830 /** 3831 * Don't close dropdown when hovering over dropdown pane 3832 * @option 3833 * @type {boolean} 3834 * @default false 3835 */ 3836 hoverPane: false, 3837 3838 /** 3839 * Number of pixels between the dropdown pane and the triggering element on open. 3840 * @option 3841 * @type {number} 3842 * @default 0 3843 */ 3844 vOffset: 0, 3845 3846 /** 3847 * Number of pixels between the dropdown pane and the triggering element on open. 3848 * @option 3849 * @type {number} 3850 * @default 0 3851 */ 3852 hOffset: 0, 3853 3854 /** 3855 * Position of dropdown. Can be left, right, bottom, top, or auto. 3856 * @option 3857 * @type {string} 3858 * @default 'auto' 3859 */ 3860 position: 'auto', 3861 3862 /** 3863 * Alignment of dropdown relative to anchor. Can be left, right, bottom, top, center, or auto. 3864 * @option 3865 * @type {string} 3866 * @default 'auto' 3867 */ 3868 alignment: 'auto', 3869 3870 /** 3871 * 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. 3872 * @option 3873 * @type {boolean} 3874 * @default false 3875 */ 3876 allowOverlap: false, 3877 3878 /** 3879 * Allow overlap of only the bottom of the container. This is the most common 3880 * behavior for dropdowns, allowing the dropdown to extend the bottom of the 3881 * screen but not otherwise influence or break out of the container. 3882 * @option 3883 * @type {boolean} 3884 * @default true 3885 */ 3886 allowBottomOverlap: true, 3887 3888 /** 3889 * Allow the plugin to trap focus to the dropdown pane if opened with keyboard commands. 3890 * @option 3891 * @type {boolean} 3892 * @default false 3893 */ 3894 trapFocus: false, 3895 3896 /** 3897 * Allow the plugin to set focus to the first focusable element within the pane, regardless of method of opening. 3898 * @option 3899 * @type {boolean} 3900 * @default false 3901 */ 3902 autoFocus: false, 3903 3904 /** 3905 * Allows a click on the body to close the dropdown. 3906 * @option 3907 * @type {boolean} 3908 * @default false 3909 */ 3910 closeOnClick: false 3911}; 3912 3913 3914/***/ }), 3915
vendor: 4,927 bytes, lines 3916-3998
3916/***/ "./js/foundation.dropdownMenu.js": 3917/*!***************************************!*\ 3918 !*** ./js/foundation.dropdownMenu.js ***! 3919 \***************************************/ 3920/*! exports provided: DropdownMenu */ 3921/***/ (function(module, __webpack_exports__, __webpack_require__) { 3922 3923"use strict"; 3924__webpack_require__.r(__webpack_exports__); 3925/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DropdownMenu", function() { return DropdownMenu; }); 3926/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 3927/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 3928/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 3929/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 3930/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js"); 3931/* harmony import */ var _foundation_util_nest__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.nest */ "./js/foundation.util.nest.js"); 3932/* harmony import */ var _foundation_util_box__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.util.box */ "./js/foundation.util.box.js"); 3933 3934 3935function _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); } 3936 3937function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 3938 3939function _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); } } 3940 3941function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 3942 3943function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 3944 3945function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 3946 3947function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 3948 3949function _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); } 3950 3951function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 3952 3953 3954 3955 3956 3957 3958 3959/** 3960 * DropdownMenu module. 3961 * @module foundation.dropdown-menu 3962 * @requires foundation.util.keyboard 3963 * @requires foundation.util.box 3964 * @requires foundation.util.nest 3965 */ 3966 3967var DropdownMenu = 3968/*#__PURE__*/ 3969function (_Plugin) { 3970 _inherits(DropdownMenu, _Plugin); 3971 3972 function DropdownMenu() { 3973 _classCallCheck(this, DropdownMenu); 3974 3975 return _possibleConstructorReturn(this, _getPrototypeOf(DropdownMenu).apply(this, arguments)); 3976 } 3977 3978 _createClass(DropdownMenu, [{ 3979 key: "_setup", 3980 3981 /** 3982 * Creates a new instance of DropdownMenu. 3983 * @class 3984 * @name DropdownMenu 3985 * @fires DropdownMenu#init 3986 * @param {jQuery} element - jQuery object to make into a dropdown menu. 3987 * @param {Object} options - Overrides to the default plugin settings. 3988 */ 3989 value: function _setup(element, options) { 3990 this.$element = element; 3991 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, DropdownMenu.defaults, this.$element.data(), options); 3992 this.className = 'DropdownMenu'; // ie9 back compat 3993 3994 this._init(); 3995 3996 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].register('DropdownMenu', { 3997 'ENTER': 'open', 3998 'SPACE': 'open',
vendor: 15,123 bytes, lines 3999-4475
3999 'ARROW_RIGHT': 'next', 4000 'ARROW_UP': 'up', 4001 'ARROW_DOWN': 'down', 4002 'ARROW_LEFT': 'previous', 4003 'ESCAPE': 'close' 4004 }); 4005 } 4006 /** 4007 * Initializes the plugin, and calls _prepareMenu 4008 * @private 4009 * @function 4010 */ 4011 4012 }, { 4013 key: "_init", 4014 value: function _init() { 4015 _foundation_util_nest__WEBPACK_IMPORTED_MODULE_4__["Nest"].Feather(this.$element, 'dropdown'); 4016 var subs = this.$element.find('li.is-dropdown-submenu-parent'); 4017 this.$element.children('.is-dropdown-submenu-parent').children('.is-dropdown-submenu').addClass('first-sub'); 4018 this.$menuItems = this.$element.find('[role="menuitem"]'); 4019 this.$tabs = this.$element.children('[role="menuitem"]'); 4020 this.$tabs.find('ul.is-dropdown-submenu').addClass(this.options.verticalClass); 4021 4022 if (this.options.alignment === 'auto') { 4023 if (this.$element.hasClass(this.options.rightClass) || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["rtl"])() || this.$element.parents('.top-bar-right').is('*')) { 4024 this.options.alignment = 'right'; 4025 subs.addClass('opens-left'); 4026 } else { 4027 this.options.alignment = 'left'; 4028 subs.addClass('opens-right'); 4029 } 4030 } else { 4031 if (this.options.alignment === 'right') { 4032 subs.addClass('opens-left'); 4033 } else { 4034 subs.addClass('opens-right'); 4035 } 4036 } 4037 4038 this.changed = false; 4039 4040 this._events(); 4041 } 4042 }, { 4043 key: "_isVertical", 4044 value: function _isVertical() { 4045 return this.$tabs.css('display') === 'block' || this.$element.css('flex-direction') === 'column'; 4046 } 4047 }, { 4048 key: "_isRtl", 4049 value: function _isRtl() { 4050 return this.$element.hasClass('align-right') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["rtl"])() && !this.$element.hasClass('align-left'); 4051 } 4052 /** 4053 * Adds event listeners to elements within the menu 4054 * @private 4055 * @function 4056 */ 4057 4058 }, { 4059 key: "_events", 4060 value: function _events() { 4061 var _this = this, 4062 hasTouch = 'ontouchstart' in window || typeof window.ontouchstart !== 'undefined', 4063 parClass = 'is-dropdown-submenu-parent'; // used for onClick and in the keyboard handlers 4064 4065 4066 var handleClickFn = function handleClickFn(e) { 4067 var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).parentsUntil('ul', ".".concat(parClass)), 4068 hasSub = $elem.hasClass(parClass), 4069 hasClicked = $elem.attr('data-is-click') === 'true', 4070 $sub = $elem.children('.is-dropdown-submenu'); 4071 4072 if (hasSub) { 4073 if (hasClicked) { 4074 if (!_this.options.closeOnClick || !_this.options.clickOpen && !hasTouch || _this.options.forceFollow && hasTouch) { 4075 return; 4076 } else { 4077 e.stopImmediatePropagation(); 4078 e.preventDefault(); 4079 4080 _this._hide($elem); 4081 } 4082 } else { 4083 e.preventDefault(); 4084 e.stopImmediatePropagation(); 4085 4086 _this._show($sub); 4087 4088 $elem.add($elem.parentsUntil(_this.$element, ".".concat(parClass))).attr('data-is-click', true); 4089 } 4090 } 4091 }; 4092 4093 if (this.options.clickOpen || hasTouch) { 4094 this.$menuItems.on('click.zf.dropdownmenu touchstart.zf.dropdownmenu', handleClickFn); 4095 } // Handle Leaf element Clicks 4096 4097 4098 if (_this.options.closeOnClickInside) { 4099 this.$menuItems.on('click.zf.dropdownmenu', function (e) { 4100 var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 4101 hasSub = $elem.hasClass(parClass); 4102 4103 if (!hasSub) { 4104 _this._hide(); 4105 } 4106 }); 4107 } 4108 4109 if (!this.options.disableHover) { 4110 this.$menuItems.on('mouseenter.zf.dropdownmenu', function (e) { 4111 var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 4112 hasSub = $elem.hasClass(parClass); 4113 4114 if (hasSub) { 4115 clearTimeout($elem.data('_delay')); 4116 $elem.data('_delay', setTimeout(function () { 4117 _this._show($elem.children('.is-dropdown-submenu')); 4118 }, _this.options.hoverDelay)); 4119 } 4120 }).on('mouseleave.zf.dropdownMenu', Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["ignoreMousedisappear"])(function (e) { 4121 var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 4122 hasSub = $elem.hasClass(parClass); 4123 4124 if (hasSub && _this.options.autoclose) { 4125 if ($elem.attr('data-is-click') === 'true' && _this.options.clickOpen) { 4126 return false; 4127 } 4128 4129 clearTimeout($elem.data('_delay')); 4130 $elem.data('_delay', setTimeout(function () { 4131 _this._hide($elem); 4132 }, _this.options.closingTime)); 4133 } 4134 })); 4135 } 4136 4137 this.$menuItems.on('keydown.zf.dropdownmenu', function (e) { 4138 var $element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).parentsUntil('ul', '[role="menuitem"]'), 4139 isTab = _this.$tabs.index($element) > -1, 4140 $elements = isTab ? _this.$tabs : $element.siblings('li').add($element), 4141 $prevElement, 4142 $nextElement; 4143 $elements.each(function (i) { 4144 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is($element)) { 4145 $prevElement = $elements.eq(i - 1); 4146 $nextElement = $elements.eq(i + 1); 4147 return; 4148 } 4149 }); 4150 4151 var nextSibling = function nextSibling() { 4152 $nextElement.children('a:first').focus(); 4153 e.preventDefault(); 4154 }, 4155 prevSibling = function prevSibling() { 4156 $prevElement.children('a:first').focus(); 4157 e.preventDefault(); 4158 }, 4159 openSub = function openSub() { 4160 var $sub = $element.children('ul.is-dropdown-submenu'); 4161 4162 if ($sub.length) { 4163 _this._show($sub); 4164 4165 $element.find('li > a:first').focus(); 4166 e.preventDefault(); 4167 } else { 4168 return; 4169 } 4170 }, 4171 closeSub = function closeSub() { 4172 //if ($element.is(':first-child')) { 4173 var close = $element.parent('ul').parent('li'); 4174 close.children('a:first').focus(); 4175 4176 _this._hide(close); 4177 4178 e.preventDefault(); //} 4179 }; 4180 4181 var functions = { 4182 open: openSub, 4183 close: function close() { 4184 _this._hide(_this.$element); 4185 4186 _this.$menuItems.eq(0).children('a').focus(); // focus to first element 4187 4188 4189 e.preventDefault(); 4190 }, 4191 handled: function handled() { 4192 e.stopImmediatePropagation(); 4193 } 4194 }; 4195 4196 if (isTab) { 4197 if (_this._isVertical()) { 4198 // vertical menu 4199 if (_this._isRtl()) { 4200 // right aligned 4201 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, { 4202 down: nextSibling, 4203 up: prevSibling, 4204 next: closeSub, 4205 previous: openSub 4206 }); 4207 } else { 4208 // left aligned 4209 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, { 4210 down: nextSibling, 4211 up: prevSibling, 4212 next: openSub, 4213 previous: closeSub 4214 }); 4215 } 4216 } else { 4217 // horizontal menu 4218 if (_this._isRtl()) { 4219 // right aligned 4220 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, { 4221 next: prevSibling, 4222 previous: nextSibling, 4223 down: openSub, 4224 up: closeSub 4225 }); 4226 } else { 4227 // left aligned 4228 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, { 4229 next: nextSibling, 4230 previous: prevSibling, 4231 down: openSub, 4232 up: closeSub 4233 }); 4234 } 4235 } 4236 } else { 4237 // not tabs -> one sub 4238 if (_this._isRtl()) { 4239 // right aligned 4240 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, { 4241 next: closeSub, 4242 previous: openSub, 4243 down: nextSibling, 4244 up: prevSibling 4245 }); 4246 } else { 4247 // left aligned 4248 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, { 4249 next: openSub, 4250 previous: closeSub, 4251 down: nextSibling, 4252 up: prevSibling 4253 }); 4254 } 4255 } 4256 4257 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].handleKey(e, 'DropdownMenu', functions); 4258 }); 4259 } 4260 /** 4261 * Adds an event handler to the body to close any dropdowns on a click. 4262 * @function 4263 * @private 4264 */ 4265 4266 }, { 4267 key: "_addBodyHandler", 4268 value: function _addBodyHandler() { 4269 var $body = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.body), 4270 _this = this; 4271 4272 $body.off('mouseup.zf.dropdownmenu touchend.zf.dropdownmenu').on('mouseup.zf.dropdownmenu touchend.zf.dropdownmenu', function (e) { 4273 var $link = _this.$element.find(e.target); 4274 4275 if ($link.length) { 4276 return; 4277 } 4278 4279 _this._hide(); 4280 4281 $body.off('mouseup.zf.dropdownmenu touchend.zf.dropdownmenu'); 4282 }); 4283 } 4284 /** 4285 * Opens a dropdown pane, and checks for collisions first. 4286 * @param {jQuery} $sub - ul element that is a submenu to show 4287 * @function 4288 * @private 4289 * @fires Dropdownmenu#show 4290 */ 4291 4292 }, { 4293 key: "_show", 4294 value: function _show($sub) { 4295 var idx = this.$tabs.index(this.$tabs.filter(function (i, el) { 4296 return jquery__WEBPACK_IMPORTED_MODULE_0___default()(el).find($sub).length > 0; 4297 })); 4298 var $sibs = $sub.parent('li.is-dropdown-submenu-parent').siblings('li.is-dropdown-submenu-parent'); 4299 4300 this._hide($sibs, idx); 4301 4302 $sub.css('visibility', 'hidden').addClass('js-dropdown-active').parent('li.is-dropdown-submenu-parent').addClass('is-active'); 4303 var clear = _foundation_util_box__WEBPACK_IMPORTED_MODULE_5__["Box"].ImNotTouchingYou($sub, null, true); 4304 4305 if (!clear) { 4306 var oldClass = this.options.alignment === 'left' ? '-right' : '-left', 4307 $parentLi = $sub.parent('.is-dropdown-submenu-parent'); 4308 $parentLi.removeClass("opens".concat(oldClass)).addClass("opens-".concat(this.options.alignment)); 4309 clear = _foundation_util_box__WEBPACK_IMPORTED_MODULE_5__["Box"].ImNotTouchingYou($sub, null, true); 4310 4311 if (!clear) { 4312 $parentLi.removeClass("opens-".concat(this.options.alignment)).addClass('opens-inner'); 4313 } 4314 4315 this.changed = true; 4316 } 4317 4318 $sub.css('visibility', ''); 4319 4320 if (this.options.closeOnClick) { 4321 this._addBodyHandler(); 4322 } 4323 /** 4324 * Fires when the new dropdown pane is visible. 4325 * @event Dropdownmenu#show 4326 */ 4327 4328 4329 this.$element.trigger('show.zf.dropdownmenu', [$sub]); 4330 } 4331 /** 4332 * Hides a single, currently open dropdown pane, if passed a parameter, otherwise, hides everything. 4333 * @function 4334 * @param {jQuery} $elem - element with a submenu to hide 4335 * @param {Number} idx - index of the $tabs collection to hide 4336 * @private 4337 */ 4338 4339 }, { 4340 key: "_hide", 4341 value: function _hide($elem, idx) { 4342 var $toClose; 4343 4344 if ($elem && $elem.length) { 4345 $toClose = $elem; 4346 } else if (typeof idx !== 'undefined') { 4347 $toClose = this.$tabs.not(function (i, el) { 4348 return i === idx; 4349 }); 4350 } else { 4351 $toClose = this.$element; 4352 } 4353 4354 var somethingToClose = $toClose.hasClass('is-active') || $toClose.find('.is-active').length > 0; 4355 4356 if (somethingToClose) { 4357 $toClose.find('li.is-active').add($toClose).attr({ 4358 'data-is-click': false 4359 }).removeClass('is-active'); 4360 $toClose.find('ul.js-dropdown-active').removeClass('js-dropdown-active'); 4361 4362 if (this.changed || $toClose.find('opens-inner').length) { 4363 var oldClass = this.options.alignment === 'left' ? 'right' : 'left'; 4364 $toClose.find('li.is-dropdown-submenu-parent').add($toClose).removeClass("opens-inner opens-".concat(this.options.alignment)).addClass("opens-".concat(oldClass)); 4365 this.changed = false; 4366 } 4367 /** 4368 * Fires when the open menus are closed. 4369 * @event Dropdownmenu#hide 4370 */ 4371 4372 4373 this.$element.trigger('hide.zf.dropdownmenu', [$toClose]); 4374 } 4375 } 4376 /** 4377 * Destroys the plugin. 4378 * @function 4379 */ 4380 4381 }, { 4382 key: "_destroy", 4383 value: function _destroy() { 4384 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'); 4385 jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.body).off('.zf.dropdownmenu'); 4386 _foundation_util_nest__WEBPACK_IMPORTED_MODULE_4__["Nest"].Burn(this.$element, 'dropdown'); 4387 } 4388 }]); 4389 4390 return DropdownMenu; 4391}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]); 4392/** 4393 * Default settings for plugin 4394 */ 4395 4396 4397DropdownMenu.defaults = { 4398 /** 4399 * Disallows hover events from opening submenus 4400 * @option 4401 * @type {boolean} 4402 * @default false 4403 */ 4404 disableHover: false, 4405 4406 /** 4407 * Allow a submenu to automatically close on a mouseleave event, if not clicked open. 4408 * @option 4409 * @type {boolean} 4410 * @default true 4411 */ 4412 autoclose: true, 4413 4414 /** 4415 * Amount of time to delay opening a submenu on hover event. 4416 * @option 4417 * @type {number} 4418 * @default 50 4419 */ 4420 hoverDelay: 50, 4421 4422 /** 4423 * Allow a submenu to open/remain open on parent click event. Allows cursor to move away from menu. 4424 * @option 4425 * @type {boolean} 4426 * @default false 4427 */ 4428 clickOpen: false, 4429 4430 /** 4431 * Amount of time to delay closing a submenu on a mouseleave event. 4432 * @option 4433 * @type {number} 4434 * @default 500 4435 */ 4436 closingTime: 500, 4437 4438 /** 4439 * Position of the menu relative to what direction the submenus should open. Handled by JS. Can be `'auto'`, `'left'` or `'right'`. 4440 * @option 4441 * @type {string} 4442 * @default 'auto' 4443 */ 4444 alignment: 'auto', 4445 4446 /** 4447 * Allow clicks on the body to close any open submenus. 4448 * @option 4449 * @type {boolean} 4450 * @default true 4451 */ 4452 closeOnClick: true, 4453 4454 /** 4455 * Allow clicks on leaf anchor links to close any open submenus. 4456 * @option 4457 * @type {boolean} 4458 * @default true 4459 */ 4460 closeOnClickInside: true, 4461 4462 /** 4463 * Class applied to vertical oriented menus, Foundation default is `vertical`. Update this if using your own class. 4464 * @option 4465 * @type {string} 4466 * @default 'vertical' 4467 */ 4468 verticalClass: 'vertical', 4469 4470 /** 4471 * Class applied to right-side oriented menus, Foundation default is `align-right`. Update this if using your own class. 4472 * @option 4473 * @type {string} 4474 * @default 'align-right' 4475 */
4476 rightClass: 'align-right', 4477 4478 /** 4479 * Boolean to force overide the clicking of links to perform default action, on second touch event for mobile. 4480 * @option 4481 * @type {boolean} 4482 * @default true 4483 */ 4484 forceFollow: true 4485}; 4486 4487 4488/***/ }), 4489
vendor: 5,571 bytes, lines 4490-4585
4490/***/ "./js/foundation.equalizer.js": 4491/*!************************************!*\ 4492 !*** ./js/foundation.equalizer.js ***! 4493 \************************************/ 4494/*! exports provided: Equalizer */ 4495/***/ (function(module, __webpack_exports__, __webpack_require__) { 4496 4497"use strict"; 4498__webpack_require__.r(__webpack_exports__); 4499/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Equalizer", function() { return Equalizer; }); 4500/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 4501/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 4502/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js"); 4503/* harmony import */ var _foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.imageLoader */ "./js/foundation.util.imageLoader.js"); 4504/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 4505/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 4506 4507 4508function _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); } 4509 4510function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 4511 4512function _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); } } 4513 4514function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 4515 4516function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 4517 4518function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 4519 4520function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 4521 4522function _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); } 4523 4524function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 4525 4526 4527 4528 4529 4530 4531/** 4532 * Equalizer module. 4533 * @module foundation.equalizer 4534 * @requires foundation.util.mediaQuery 4535 * @requires foundation.util.imageLoader if equalizer contains images 4536 */ 4537 4538var Equalizer = 4539/*#__PURE__*/ 4540function (_Plugin) { 4541 _inherits(Equalizer, _Plugin); 4542 4543 function Equalizer() { 4544 _classCallCheck(this, Equalizer); 4545 4546 return _possibleConstructorReturn(this, _getPrototypeOf(Equalizer).apply(this, arguments)); 4547 } 4548 4549 _createClass(Equalizer, [{ 4550 key: "_setup", 4551 4552 /** 4553 * Creates a new instance of Equalizer. 4554 * @class 4555 * @name Equalizer 4556 * @fires Equalizer#init 4557 * @param {Object} element - jQuery object to add the trigger to. 4558 * @param {Object} options - Overrides to the default plugin settings. 4559 */ 4560 value: function _setup(element, options) { 4561 this.$element = element; 4562 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Equalizer.defaults, this.$element.data(), options); 4563 this.className = 'Equalizer'; // ie9 back compat 4564 4565 this._init(); 4566 } 4567 /** 4568 * Initializes the Equalizer plugin and calls functions to get equalizer functioning on load. 4569 * @private 4570 */ 4571 4572 }, { 4573 key: "_init", 4574 value: function _init() { 4575 var eqId = this.$element.attr('data-equalizer') || ''; 4576 var $watched = this.$element.find("[data-equalizer-watch=\"".concat(eqId, "\"]")); 4577 4578 _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"]._init(); 4579 4580 this.$watched = $watched.length ? $watched : this.$element.find('[data-equalizer-watch]'); 4581 this.$element.attr('data-resize', eqId || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'eq')); 4582 this.$element.attr('data-mutate', eqId || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'eq')); 4583 this.hasNested = this.$element.find('[data-equalizer]').length > 0; 4584 this.isNested = this.$element.parentsUntil(document.body, '[data-equalizer]').length > 0; 4585 this.isOn = false;
vendor: 9,213 bytes, lines 4586-4921
4586 this._bindHandler = { 4587 onResizeMeBound: this._onResizeMe.bind(this), 4588 onPostEqualizedBound: this._onPostEqualized.bind(this) 4589 }; 4590 var imgs = this.$element.find('img'); 4591 var tooSmall; 4592 4593 if (this.options.equalizeOn) { 4594 tooSmall = this._checkMQ(); 4595 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', this._checkMQ.bind(this)); 4596 } else { 4597 this._events(); 4598 } 4599 4600 if (typeof tooSmall !== 'undefined' && tooSmall === false || typeof tooSmall === 'undefined') { 4601 if (imgs.length) { 4602 Object(_foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_2__["onImagesLoaded"])(imgs, this._reflow.bind(this)); 4603 } else { 4604 this._reflow(); 4605 } 4606 } 4607 } 4608 /** 4609 * Removes event listeners if the breakpoint is too small. 4610 * @private 4611 */ 4612 4613 }, { 4614 key: "_pauseEvents", 4615 value: function _pauseEvents() { 4616 this.isOn = false; 4617 this.$element.off({ 4618 '.zf.equalizer': this._bindHandler.onPostEqualizedBound, 4619 'resizeme.zf.trigger': this._bindHandler.onResizeMeBound, 4620 'mutateme.zf.trigger': this._bindHandler.onResizeMeBound 4621 }); 4622 } 4623 /** 4624 * function to handle $elements resizeme.zf.trigger, with bound this on _bindHandler.onResizeMeBound 4625 * @private 4626 */ 4627 4628 }, { 4629 key: "_onResizeMe", 4630 value: function _onResizeMe(e) { 4631 this._reflow(); 4632 } 4633 /** 4634 * function to handle $elements postequalized.zf.equalizer, with bound this on _bindHandler.onPostEqualizedBound 4635 * @private 4636 */ 4637 4638 }, { 4639 key: "_onPostEqualized", 4640 value: function _onPostEqualized(e) { 4641 if (e.target !== this.$element[0]) { 4642 this._reflow(); 4643 } 4644 } 4645 /** 4646 * Initializes events for Equalizer. 4647 * @private 4648 */ 4649 4650 }, { 4651 key: "_events", 4652 value: function _events() { 4653 var _this = this; 4654 4655 this._pauseEvents(); 4656 4657 if (this.hasNested) { 4658 this.$element.on('postequalized.zf.equalizer', this._bindHandler.onPostEqualizedBound); 4659 } else { 4660 this.$element.on('resizeme.zf.trigger', this._bindHandler.onResizeMeBound); 4661 this.$element.on('mutateme.zf.trigger', this._bindHandler.onResizeMeBound); 4662 } 4663 4664 this.isOn = true; 4665 } 4666 /** 4667 * Checks the current breakpoint to the minimum required size. 4668 * @private 4669 */ 4670 4671 }, { 4672 key: "_checkMQ", 4673 value: function _checkMQ() { 4674 var tooSmall = !_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].is(this.options.equalizeOn); 4675 4676 if (tooSmall) { 4677 if (this.isOn) { 4678 this._pauseEvents(); 4679 4680 this.$watched.css('height', 'auto'); 4681 } 4682 } else { 4683 if (!this.isOn) { 4684 this._events(); 4685 } 4686 } 4687 4688 return tooSmall; 4689 } 4690 /** 4691 * A noop version for the plugin 4692 * @private 4693 */ 4694 4695 }, { 4696 key: "_killswitch", 4697 value: function _killswitch() { 4698 return; 4699 } 4700 /** 4701 * Calls necessary functions to update Equalizer upon DOM change 4702 * @private 4703 */ 4704 4705 }, { 4706 key: "_reflow", 4707 value: function _reflow() { 4708 if (!this.options.equalizeOnStack) { 4709 if (this._isStacked()) { 4710 this.$watched.css('height', 'auto'); 4711 return false; 4712 } 4713 } 4714 4715 if (this.options.equalizeByRow) { 4716 this.getHeightsByRow(this.applyHeightByRow.bind(this)); 4717 } else { 4718 this.getHeights(this.applyHeight.bind(this)); 4719 } 4720 } 4721 /** 4722 * Manually determines if the first 2 elements are *NOT* stacked. 4723 * @private 4724 */ 4725 4726 }, { 4727 key: "_isStacked", 4728 value: function _isStacked() { 4729 if (!this.$watched[0] || !this.$watched[1]) { 4730 return true; 4731 } 4732 4733 return this.$watched[0].getBoundingClientRect().top !== this.$watched[1].getBoundingClientRect().top; 4734 } 4735 /** 4736 * Finds the outer heights of children contained within an Equalizer parent and returns them in an array 4737 * @param {Function} cb - A non-optional callback to return the heights array to. 4738 * @returns {Array} heights - An array of heights of children within Equalizer container 4739 */ 4740 4741 }, { 4742 key: "getHeights", 4743 value: function getHeights(cb) { 4744 var heights = []; 4745 4746 for (var i = 0, len = this.$watched.length; i < len; i++) { 4747 this.$watched[i].style.height = 'auto'; 4748 heights.push(this.$watched[i].offsetHeight); 4749 } 4750 4751 cb(heights); 4752 } 4753 /** 4754 * Finds the outer heights of children contained within an Equalizer parent and returns them in an array 4755 * @param {Function} cb - A non-optional callback to return the heights array to. 4756 * @returns {Array} groups - An array of heights of children within Equalizer container grouped by row with element,height and max as last child 4757 */ 4758 4759 }, { 4760 key: "getHeightsByRow", 4761 value: function getHeightsByRow(cb) { 4762 var lastElTopOffset = this.$watched.length ? this.$watched.first().offset().top : 0, 4763 groups = [], 4764 group = 0; //group by Row 4765 4766 groups[group] = []; 4767 4768 for (var i = 0, len = this.$watched.length; i < len; i++) { 4769 this.$watched[i].style.height = 'auto'; //maybe could use this.$watched[i].offsetTop 4770 4771 var elOffsetTop = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.$watched[i]).offset().top; 4772 4773 if (elOffsetTop != lastElTopOffset) { 4774 group++; 4775 groups[group] = []; 4776 lastElTopOffset = elOffsetTop; 4777 } 4778 4779 groups[group].push([this.$watched[i], this.$watched[i].offsetHeight]); 4780 } 4781 4782 for (var j = 0, ln = groups.length; j < ln; j++) { 4783 var heights = jquery__WEBPACK_IMPORTED_MODULE_0___default()(groups[j]).map(function () { 4784 return this[1]; 4785 }).get(); 4786 var max = Math.max.apply(null, heights); 4787 groups[j].push(max); 4788 } 4789 4790 cb(groups); 4791 } 4792 /** 4793 * Changes the CSS height property of each child in an Equalizer parent to match the tallest 4794 * @param {array} heights - An array of heights of children within Equalizer container 4795 * @fires Equalizer#preequalized 4796 * @fires Equalizer#postequalized 4797 */ 4798 4799 }, { 4800 key: "applyHeight", 4801 value: function applyHeight(heights) { 4802 var max = Math.max.apply(null, heights); 4803 /** 4804 * Fires before the heights are applied 4805 * @event Equalizer#preequalized 4806 */ 4807 4808 this.$element.trigger('preequalized.zf.equalizer'); 4809 this.$watched.css('height', max); 4810 /** 4811 * Fires when the heights have been applied 4812 * @event Equalizer#postequalized 4813 */ 4814 4815 this.$element.trigger('postequalized.zf.equalizer'); 4816 } 4817 /** 4818 * Changes the CSS height property of each child in an Equalizer parent to match the tallest by row 4819 * @param {array} groups - An array of heights of children within Equalizer container grouped by row with element,height and max as last child 4820 * @fires Equalizer#preequalized 4821 * @fires Equalizer#preequalizedrow 4822 * @fires Equalizer#postequalizedrow 4823 * @fires Equalizer#postequalized 4824 */ 4825 4826 }, { 4827 key: "applyHeightByRow", 4828 value: function applyHeightByRow(groups) { 4829 /** 4830 * Fires before the heights are applied 4831 */ 4832 this.$element.trigger('preequalized.zf.equalizer'); 4833 4834 for (var i = 0, len = groups.length; i < len; i++) { 4835 var groupsILength = groups[i].length, 4836 max = groups[i][groupsILength - 1]; 4837 4838 if (groupsILength <= 2) { 4839 jquery__WEBPACK_IMPORTED_MODULE_0___default()(groups[i][0][0]).css({ 4840 'height': 'auto' 4841 }); 4842 continue; 4843 } 4844 /** 4845 * Fires before the heights per row are applied 4846 * @event Equalizer#preequalizedrow 4847 */ 4848 4849 4850 this.$element.trigger('preequalizedrow.zf.equalizer'); 4851 4852 for (var j = 0, lenJ = groupsILength - 1; j < lenJ; j++) { 4853 jquery__WEBPACK_IMPORTED_MODULE_0___default()(groups[i][j][0]).css({ 4854 'height': max 4855 }); 4856 } 4857 /** 4858 * Fires when the heights per row have been applied 4859 * @event Equalizer#postequalizedrow 4860 */ 4861 4862 4863 this.$element.trigger('postequalizedrow.zf.equalizer'); 4864 } 4865 /** 4866 * Fires when the heights have been applied 4867 */ 4868 4869 4870 this.$element.trigger('postequalized.zf.equalizer'); 4871 } 4872 /** 4873 * Destroys an instance of Equalizer. 4874 * @function 4875 */ 4876 4877 }, { 4878 key: "_destroy", 4879 value: function _destroy() { 4880 this._pauseEvents(); 4881 4882 this.$watched.css('height', 'auto'); 4883 } 4884 }]); 4885 4886 return Equalizer; 4887}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__["Plugin"]); 4888/** 4889 * Default settings for plugin 4890 */ 4891 4892 4893Equalizer.defaults = { 4894 /** 4895 * Enable height equalization when stacked on smaller screens. 4896 * @option 4897 * @type {boolean} 4898 * @default false 4899 */ 4900 equalizeOnStack: false, 4901 4902 /** 4903 * Enable height equalization row by row. 4904 * @option 4905 * @type {boolean} 4906 * @default false 4907 */ 4908 equalizeByRow: false, 4909 4910 /** 4911 * String representing the minimum breakpoint size the plugin should equalize heights on. 4912 * @option 4913 * @type {string} 4914 * @default '' 4915 */ 4916 equalizeOn: '' 4917}; 4918 4919 4920/***/ }), 4921
4922/***/ "./js/foundation.interchange.js": 4923/*!**************************************!*\ 4924 !*** ./js/foundation.interchange.js ***! 4925 \**************************************/ 4926/*! exports provided: Interchange */ 4927/***/ (function(module, __webpack_exports__, __webpack_require__) { 4928 4929"use strict"; 4930__webpack_require__.r(__webpack_exports__); 4931/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Interchange", function() { return Interchange; }); 4932/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 4933/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 4934/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js"); 4935/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 4936/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 4937 4938 4939function _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); } 4940 4941function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 4942 4943function _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); } } 4944 4945function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 4946 4947function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 4948 4949function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 4950 4951function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 4952 4953function _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); } 4954 4955function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 4956 4957 4958 4959 4960 4961/** 4962 * Interchange module. 4963 * @module foundation.interchange 4964 * @requires foundation.util.mediaQuery 4965 */ 4966 4967var Interchange = 4968/*#__PURE__*/ 4969function (_Plugin) { 4970 _inherits(Interchange, _Plugin); 4971 4972 function Interchange() { 4973 _classCallCheck(this, Interchange); 4974 4975 return _possibleConstructorReturn(this, _getPrototypeOf(Interchange).apply(this, arguments)); 4976 } 4977 4978 _createClass(Interchange, [{ 4979 key: "_setup", 4980 4981 /** 4982 * Creates a new instance of Interchange. 4983 * @class 4984 * @name Interchange 4985 * @fires Interchange#init 4986 * @param {Object} element - jQuery object to add the trigger to. 4987 * @param {Object} options - Overrides to the default plugin settings. 4988 */ 4989 value: function _setup(element, options) { 4990 this.$element = element; 4991 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Interchange.defaults, options); 4992 this.rules = []; 4993 this.currentPath = ''; 4994 this.className = 'Interchange'; // ie9 back compat 4995 4996 this._init(); 4997 4998 this._events(); 4999 } 5000 /** 5001 * Initializes the Interchange plugin and calls functions to get interchange functioning on load. 5002 * @function 5003 * @private 5004 */ 5005 5006 }, { 5007 key: "_init", 5008 value: function _init() { 5009 _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"]._init(); 5010 5011 var id = this.$element[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'interchange'); 5012 this.$element.attr({ 5013 'data-resize': id, 5014 'id': id 5015 }); 5016 5017 this._addBreakpoints(); 5018 5019 this._generateRules(); 5020 5021 this._reflow(); 5022 } 5023 /** 5024 * Initializes events for Interchange. 5025 * @function 5026 * @private 5027 */ 5028 5029 }, { 5030 key: "_events", 5031 value: function _events() { 5032 var _this2 = this; 5033 5034 this.$element.off('resizeme.zf.trigger').on('resizeme.zf.trigger', function () { 5035 return _this2._reflow(); 5036 }); 5037 } 5038 /** 5039 * Calls necessary functions to update Interchange upon DOM change 5040 * @function 5041 * @private 5042 */ 5043 5044 }, { 5045 key: "_reflow", 5046 value: function _reflow() { 5047 var match; // Iterate through each rule, but only save the last match 5048 5049 for (var i in this.rules) { 5050 if (this.rules.hasOwnProperty(i)) { 5051 var rule = this.rules[i]; 5052 5053 if (window.matchMedia(rule.query).matches) { 5054 match = rule; 5055 } 5056 } 5057 } 5058 5059 if (match) { 5060 this.replace(match.path); 5061 } 5062 } 5063 /** 5064 * Gets the Foundation breakpoints and adds them to the Interchange.SPECIAL_QUERIES object. 5065 * @function 5066 * @private 5067 */ 5068 5069 }, { 5070 key: "_addBreakpoints", 5071 value: function _addBreakpoints() { 5072 for (var i in _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].queries) { 5073 if (_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].queries.hasOwnProperty(i)) { 5074 var query = _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].queries[i]; 5075 Interchange.SPECIAL_QUERIES[query.name] = query.value; 5076 } 5077 } 5078 } 5079 /** 5080 * Checks the Interchange element for the provided media query + content pairings 5081 * @function 5082 * @private 5083 * @param {Object} element - jQuery object that is an Interchange instance 5084 * @returns {Array} scenarios - Array of objects that have 'mq' and 'path' keys with corresponding keys 5085 */ 5086 5087 }, { 5088 key: "_generateRules", 5089 value: function _generateRules(element) { 5090 var rulesList = []; 5091 var rules; 5092 5093 if (this.options.rules) { 5094 rules = this.options.rules; 5095 } else { 5096 rules = this.$element.data('interchange'); 5097 } 5098 5099 rules = typeof rules === 'string' ? rules.match(/\[.*?, .*?\]/g) : rules; 5100 5101 for (var i in rules) { 5102 if (rules.hasOwnProperty(i)) { 5103 var rule = rules[i].slice(1, -1).split(', '); 5104 var path = rule.slice(0, -1).join(''); 5105 var query = rule[rule.length - 1]; 5106 5107 if (Interchange.SPECIAL_QUERIES[query]) { 5108 query = Interchange.SPECIAL_QUERIES[query]; 5109 } 5110 5111 rulesList.push({ 5112 path: path, 5113 query: query 5114 }); 5115 } 5116 } 5117 5118 this.rules = rulesList; 5119 } 5120 /** 5121 * Update the `src` property of an image, or change the HTML of a container, to the specified path. 5122 * @function 5123 * @param {String} path - Path to the image or HTML partial. 5124 * @fires Interchange#replaced 5125 */ 5126 5127 }, { 5128 key: "replace", 5129 value: function replace(path) { 5130 if (this.currentPath === path) return; 5131 5132 var _this = this, 5133 trigger = 'replaced.zf.interchange'; // Replacing images 5134 5135 5136 if (this.$element[0].nodeName === 'IMG') { 5137 this.$element.attr('src', path).on('load', function () { 5138 _this.currentPath = path; 5139 }).trigger(trigger); 5140 } // Replacing background images 5141 else if (path.match(/\.(gif|jpg|jpeg|png|svg|tiff)([?#].*)?/i)) { 5142 path = path.replace(/\(/g, '%28').replace(/\)/g, '%29'); 5143 this.$element.css({ 5144 'background-image': 'url(' + path + ')' 5145 }).trigger(trigger); 5146 } // Replacing HTML 5147 else { 5148 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.get(path, function (response) { 5149 _this.$element.html(response).trigger(trigger); 5150 5151 jquery__WEBPACK_IMPORTED_MODULE_0___default()(response).foundation(); 5152 _this.currentPath = path; 5153 }); 5154 } 5155 /** 5156 * Fires when content in an Interchange element is done being loaded. 5157 * @event Interchange#replaced 5158 */ 5159 // this.$element.trigger('replaced.zf.interchange'); 5160 5161 } 5162 /** 5163 * Destroys an instance of interchange. 5164 * @function 5165 */ 5166 5167 }, { 5168 key: "_destroy", 5169 value: function _destroy() { 5170 this.$element.off('resizeme.zf.trigger'); 5171 } 5172 }]); 5173 5174 return Interchange; 5175}
5175(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__["Plugin"]); 5176/** 5177 * Default settings for plugin 5178 */ 5179 5180 5181Interchange.defaults = { 5182 /** 5183 * Rules to be applied to Interchange elements. Set with the `data-interchange` array notation. 5184 * @option 5185 * @type {?array} 5186 * @default null 5187 */ 5188 rules: null 5189}; 5190Interchange.SPECIAL_QUERIES = { 5191 'landscape': 'screen and (orientation: landscape)', 5192 'portrait': 'screen and (orientation: portrait)', 5193 '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)' 5194}; 5195 5196 5197/***/ }), 5198
5199/***/ "./js/foundation.magellan.js": 5200/*!***********************************!*\ 5201 !*** ./js/foundation.magellan.js ***! 5202 \***********************************/ 5203/*! exports provided: Magellan */ 5204/***/ (function(module, __webpack_exports__, __webpack_require__) { 5205 5206"use strict"; 5207__webpack_require__.r(__webpack_exports__); 5208/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Magellan", function() { return Magellan; }); 5209/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 5210/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 5211/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 5212/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 5213/* harmony import */ var _foundation_smoothScroll__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.smoothScroll */ "./js/foundation.smoothScroll.js"); 5214 5215 5216function _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); } 5217 5218function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 5219 5220function _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); } } 5221 5222function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 5223 5224function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 5225 5226function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 5227 5228function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 5229 5230function _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); } 5231 5232function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 5233 5234 5235 5236 5237 5238/** 5239 * Magellan module. 5240 * @module foundation.magellan 5241 * @requires foundation.smoothScroll 5242 */ 5243 5244var Magellan = 5245/*#__PURE__*/ 5246function (_Plugin) { 5247 _inherits(Magellan, _Plugin); 5248 5249 function Magellan() { 5250 _classCallCheck(this, Magellan); 5251 5252 return _possibleConstructorReturn(this, _getPrototypeOf(Magellan).apply(this, arguments)); 5253 } 5254 5255 _createClass(Magellan, [{ 5256 key: "_setup", 5257 5258 /** 5259 * Creates a new instance of Magellan. 5260 * @class 5261 * @name Magellan 5262 * @fires Magellan#init 5263 * @param {Object} element - jQuery object to add the trigger to. 5264 * @param {Object} options - Overrides to the default plugin settings. 5265 */ 5266 value: function _setup(element, options) { 5267 this.$element = element; 5268 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Magellan.defaults, this.$element.data(), options); 5269 this.className = 'Magellan'; // ie9 back compat 5270 5271 this._init(); 5272 5273 this.calcPoints(); 5274 } 5275 /** 5276 * Initializes the Magellan plugin and calls functions to get equalizer functioning on load. 5277 * @private 5278 */ 5279 5280 }, { 5281 key: "_init", 5282 value: function _init() { 5283 var id = this.$element[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["GetYoDigits"])(6, 'magellan'); 5284 5285 var _this = this; 5286 5287 this.$targets = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-magellan-target]'); 5288 this.$links = this.$element.find('a'); 5289 this.$element.attr({ 5290 'data-resize': id, 5291 'data-scroll': id, 5292 'id': id 5293 }); 5294 this.$active = jquery__WEBPACK_IMPORTED_MODULE_0___default()(); 5295 this.scrollPos = parseInt(window.pageYOffset, 10); 5296 5297 this._events(); 5298 } 5299 /** 5300 * Calculates an array of pixel values that are the demarcation lines between locations on the page. 5301 * Can be invoked if new elements are added or the size of a location changes. 5302 * @function 5303 */ 5304 5305 }, { 5306 key: "calcPoints", 5307 value: function calcPoints() { 5308 var _this = this, 5309 body = document.body, 5310 html = document.documentElement; 5311 5312 this.points = []; 5313 this.winHeight = Math.round(Math.max(window.innerHeight, html.clientHeight)); 5314 this.docHeight = Math.round(Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight)); 5315 this.$targets.each(function () { 5316 var $tar = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 5317 pt = Math.round($tar.offset().top - _this.options.threshold); 5318 $tar.targetPoint = pt; 5319 5320 _this.points.push(pt); 5321 }); 5322 } 5323 /** 5324 * Initializes events for Magellan. 5325 * @private 5326 */ 5327 5328 }, { 5329 key: "_events", 5330 value: function _events() { 5331 var _this = this, 5332 $body = jquery__WEBPACK_IMPORTED_MODULE_0___default()('html, body'), 5333 opts = { 5334 duration: _this.options.animationDuration, 5335 easing: _this.options.animationEasing 5336 }; 5337 5338 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).one('load', function () { 5339 if (_this.options.deepLinking) { 5340 if (location.hash) { 5341 _this.scrollToLoc(location.hash); 5342 } 5343 } 5344 5345 _this.calcPoints(); 5346 5347 _this._updateActive(); 5348 }); 5349 _this.onLoadListener = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () { 5350 _this.$element.on({ 5351 'resizeme.zf.trigger': _this.reflow.bind(_this), 5352 'scrollme.zf.trigger': _this._updateActive.bind(_this) 5353 }).on('click.zf.magellan', 'a[href^="#"]', function (e) { 5354 e.preventDefault(); 5355 var arrival = this.getAttribute('href'); 5356 5357 _this.scrollToLoc(arrival); 5358 }); 5359 }); 5360 5361 this._deepLinkScroll = function (e) { 5362 if (_this.options.deepLinking) { 5363 _this.scrollToLoc(window.location.hash); 5364 } 5365 }; 5366 5367 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('hashchange', this._deepLinkScroll); 5368 } 5369 /** 5370 * Function to scroll to a given location on the page. 5371 * @param {String} loc - a properly formatted jQuery id selector. Example: '#foo' 5372 * @function 5373 */ 5374 5375 }, { 5376 key: "scrollToLoc", 5377 value: function scrollToLoc(loc) { 5378 this._inTransition = true; 5379 5380 var _this = this; 5381 5382 var options = { 5383 animationEasing: this.options.animationEasing, 5384 animationDuration: this.options.animationDuration, 5385 threshold: this.options.threshold, 5386 offset: this.options.offset 5387 }; 5388 _foundation_smoothScroll__WEBPACK_IMPORTED_MODULE_3__["SmoothScroll"].scrollToLoc(loc, options, function () { 5389 _this._inTransition = false;
vendor: 4,847 bytes, lines 5390-5555
5390 }); 5391 } 5392 /** 5393 * Calls necessary functions to update Magellan upon DOM change 5394 * @function 5395 */ 5396 5397 }, { 5398 key: "reflow", 5399 value: function reflow() { 5400 this.calcPoints(); 5401 5402 this._updateActive(); 5403 } 5404 /** 5405 * Updates the visibility of an active location link, and updates the url hash for the page, if deepLinking enabled. 5406 * @private 5407 * @function 5408 * @fires Magellan#update 5409 */ 5410 5411 }, { 5412 key: "_updateActive", 5413 value: function _updateActive() 5414 /*evt, elem, scrollPos*/ 5415 { 5416 var _this2 = this; 5417 5418 if (this._inTransition) return; 5419 var newScrollPos = parseInt(window.pageYOffset, 10); 5420 var isScrollingUp = this.scrollPos > newScrollPos; 5421 this.scrollPos = newScrollPos; 5422 var activeIdx; // Before the first point: no link 5423 5424 if (newScrollPos < this.points[0]) {} 5425 /* do nothing */ 5426 // At the bottom of the page: last link 5427 else if (newScrollPos + this.winHeight === this.docHeight) { 5428 activeIdx = this.points.length - 1; 5429 } // Otherwhise, use the last visible link 5430 else { 5431 var visibleLinks = this.points.filter(function (p, i) { 5432 return p - _this2.options.offset - (isScrollingUp ? _this2.options.threshold : 0) <= newScrollPos; 5433 }); 5434 activeIdx = visibleLinks.length ? visibleLinks.length - 1 : 0; 5435 } // Get the new active link 5436 5437 5438 var $oldActive = this.$active; 5439 var activeHash = ''; 5440 5441 if (typeof activeIdx !== 'undefined') { 5442 this.$active = this.$links.filter('[href="#' + this.$targets.eq(activeIdx).data('magellan-target') + '"]'); 5443 if (this.$active.length) activeHash = this.$active[0].getAttribute('href'); 5444 } else { 5445 this.$active = jquery__WEBPACK_IMPORTED_MODULE_0___default()(); 5446 } 5447 5448 var isNewActive = !(!this.$active.length && !$oldActive.length) && !this.$active.is($oldActive); 5449 var isNewHash = activeHash !== window.location.hash; // Update the active link element 5450 5451 if (isNewActive) { 5452 $oldActive.removeClass(this.options.activeClass); 5453 this.$active.addClass(this.options.activeClass); 5454 } // Update the hash (it may have changed with the same active link) 5455 5456 5457 if (this.options.deepLinking && isNewHash) { 5458 if (window.history.pushState) { 5459 // Set or remove the hash (see: https://stackoverflow.com/a/5298684/4317384 5460 var url = activeHash ? activeHash : window.location.pathname + window.location.search; 5461 window.history.pushState(null, null, url); 5462 } else { 5463 window.location.hash = activeHash; 5464 } 5465 } 5466 5467 if (isNewActive) { 5468 /** 5469 * Fires when magellan is finished updating to the new active element. 5470 * @event Magellan#update 5471 */ 5472 this.$element.trigger('update.zf.magellan', [this.$active]); 5473 } 5474 } 5475 /** 5476 * Destroys an instance of Magellan and resets the url of the window. 5477 * @function 5478 */ 5479 5480 }, { 5481 key: "_destroy", 5482 value: function _destroy() { 5483 this.$element.off('.zf.trigger .zf.magellan').find(".".concat(this.options.activeClass)).removeClass(this.options.activeClass); 5484 5485 if (this.options.deepLinking) { 5486 var hash = this.$active[0].getAttribute('href'); 5487 window.location.hash.replace(hash, ''); 5488 } 5489 5490 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('hashchange', this._deepLinkScroll); 5491 if (this.onLoadListener) jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(this.onLoadListener); 5492 } 5493 }]); 5494 5495 return Magellan; 5496}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__["Plugin"]); 5497/** 5498 * Default settings for plugin 5499 */ 5500 5501 5502Magellan.defaults = { 5503 /** 5504 * Amount of time, in ms, the animated scrolling should take between locations. 5505 * @option 5506 * @type {number} 5507 * @default 500 5508 */ 5509 animationDuration: 500, 5510 5511 /** 5512 * Animation style to use when scrolling between locations. Can be `'swing'` or `'linear'`. 5513 * @option 5514 * @type {string} 5515 * @default 'linear' 5516 * @see {@link https://api.jquery.com/animate|Jquery animate} 5517 */ 5518 animationEasing: 'linear', 5519 5520 /** 5521 * Number of pixels to use as a marker for location changes. 5522 * @option 5523 * @type {number} 5524 * @default 50 5525 */ 5526 threshold: 50, 5527 5528 /** 5529 * Class applied to the active locations link on the magellan container. 5530 * @option 5531 * @type {string} 5532 * @default 'is-active' 5533 */ 5534 activeClass: 'is-active', 5535 5536 /** 5537 * Allows the script to manipulate the url of the current page, and if supported, alter the history. 5538 * @option 5539 * @type {boolean} 5540 * @default false 5541 */ 5542 deepLinking: false, 5543 5544 /** 5545 * Number of pixels to offset the scroll of the page on item click if using a sticky nav bar. 5546 * @option 5547 * @type {number} 5548 * @default 0 5549 */ 5550 offset: 0 5551}; 5552 5553 5554/***/ }), 5555
vendor: 5,647 bytes, lines 5556-5653
5556/***/ "./js/foundation.offcanvas.js": 5557/*!************************************!*\ 5558 !*** ./js/foundation.offcanvas.js ***! 5559 \************************************/ 5560/*! exports provided: OffCanvas */ 5561/***/ (function(module, __webpack_exports__, __webpack_require__) { 5562 5563"use strict"; 5564__webpack_require__.r(__webpack_exports__); 5565/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OffCanvas", function() { return OffCanvas; }); 5566/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 5567/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 5568/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 5569/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js"); 5570/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js"); 5571/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 5572/* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js"); 5573 5574 5575function _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); } 5576 5577function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 5578 5579function _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); } } 5580 5581function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 5582 5583function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 5584 5585function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 5586 5587function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 5588 5589function _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); } 5590 5591function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 5592 5593 5594 5595 5596 5597 5598 5599/** 5600 * OffCanvas module. 5601 * @module foundation.offcanvas 5602 * @requires foundation.util.keyboard 5603 * @requires foundation.util.mediaQuery 5604 * @requires foundation.util.triggers 5605 */ 5606 5607var OffCanvas = 5608/*#__PURE__*/ 5609function (_Plugin) { 5610 _inherits(OffCanvas, _Plugin); 5611 5612 function OffCanvas() { 5613 _classCallCheck(this, OffCanvas); 5614 5615 return _possibleConstructorReturn(this, _getPrototypeOf(OffCanvas).apply(this, arguments)); 5616 } 5617 5618 _createClass(OffCanvas, [{ 5619 key: "_setup", 5620 5621 /** 5622 * Creates a new instance of an off-canvas wrapper. 5623 * @class 5624 * @name OffCanvas 5625 * @fires OffCanvas#init 5626 * @param {Object} element - jQuery object to initialize. 5627 * @param {Object} options - Overrides to the default plugin settings. 5628 */ 5629 value: function _setup(element, options) { 5630 var _this2 = this; 5631 5632 this.className = 'OffCanvas'; // ie9 back compat 5633 5634 this.$element = element; 5635 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, OffCanvas.defaults, this.$element.data(), options); 5636 this.contentClasses = { 5637 base: [], 5638 reveal: [] 5639 }; 5640 this.$lastTrigger = jquery__WEBPACK_IMPORTED_MODULE_0___default()(); 5641 this.$triggers = jquery__WEBPACK_IMPORTED_MODULE_0___default()(); 5642 this.position = 'left'; 5643 this.$content = jquery__WEBPACK_IMPORTED_MODULE_0___default()(); 5644 this.nested = !!this.options.nested; // Defines the CSS transition/position classes of the off-canvas content container. 5645 5646 jquery__WEBPACK_IMPORTED_MODULE_0___default()(['push', 'overlap']).each(function (index, val) { 5647 _this2.contentClasses.base.push('has-transition-' + val); 5648 }); 5649 jquery__WEBPACK_IMPORTED_MODULE_0___default()(['left', 'right', 'top', 'bottom']).each(function (index, val) { 5650 _this2.contentClasses.base.push('has-position-' + val); 5651 5652 _this2.contentClasses.reveal.push('has-reveal-' + val); 5653 });
vendor: 16,198 bytes, lines 5653-6094
5653 // Triggers init is idempotent, just need to make sure it is initialized 5654 5655 _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_5__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 5656 5657 _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_3__["MediaQuery"]._init(); 5658 5659 this._init(); 5660 5661 this._events(); 5662 5663 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].register('OffCanvas', { 5664 'ESCAPE': 'close' 5665 }); 5666 } 5667 /** 5668 * Initializes the off-canvas wrapper by adding the exit overlay (if needed). 5669 * @function 5670 * @private 5671 */ 5672 5673 }, { 5674 key: "_init", 5675 value: function _init() { 5676 var id = this.$element.attr('id'); 5677 this.$element.attr('aria-hidden', 'true'); // Find off-canvas content, either by ID (if specified), by siblings or by closest selector (fallback) 5678 5679 if (this.options.contentId) { 5680 this.$content = jquery__WEBPACK_IMPORTED_MODULE_0___default()('#' + this.options.contentId); 5681 } else if (this.$element.siblings('[data-off-canvas-content]').length) { 5682 this.$content = this.$element.siblings('[data-off-canvas-content]').first(); 5683 } else { 5684 this.$content = this.$element.closest('[data-off-canvas-content]').first(); 5685 } 5686 5687 if (!this.options.contentId) { 5688 // Assume that the off-canvas element is nested if it isn't a sibling of the content 5689 this.nested = this.$element.siblings('[data-off-canvas-content]').length === 0; 5690 } else if (this.options.contentId && this.options.nested === null) { 5691 // Warning if using content ID without setting the nested option 5692 // Once the element is nested it is required to work properly in this case 5693 console.warn('Remember to use the nested option if using the content ID option!'); 5694 } 5695 5696 if (this.nested === true) { 5697 // Force transition overlap if nested 5698 this.options.transition = 'overlap'; // Remove appropriate classes if already assigned in markup 5699 5700 this.$element.removeClass('is-transition-push'); 5701 } 5702 5703 this.$element.addClass("is-transition-".concat(this.options.transition, " is-closed")); // Find triggers that affect this element and add aria-expanded to them 5704 5705 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 5706 5707 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 5708 5709 if (this.options.contentOverlay === true) { 5710 var overlay = document.createElement('div'); 5711 var overlayPosition = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.$element).css("position") === 'fixed' ? 'is-overlay-fixed' : 'is-overlay-absolute'; 5712 overlay.setAttribute('class', 'js-off-canvas-overlay ' + overlayPosition); 5713 this.$overlay = jquery__WEBPACK_IMPORTED_MODULE_0___default()(overlay); 5714 5715 if (overlayPosition === 'is-overlay-fixed') { 5716 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.$overlay).insertAfter(this.$element); 5717 } else { 5718 this.$content.append(this.$overlay); 5719 } 5720 } // Get the revealOn option from the class. 5721 5722 5723 var revealOnRegExp = new RegExp(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["RegExpEscape"])(this.options.revealClass) + '([^\\s]+)', 'g'); 5724 var revealOnClass = revealOnRegExp.exec(this.$element[0].className); 5725 5726 if (revealOnClass) { 5727 this.options.isRevealed = true; 5728 this.options.revealOn = this.options.revealOn || revealOnClass[1]; 5729 } // Ensure the `reveal-on-*` class is set. 5730 5731 5732 if (this.options.isRevealed === true && this.options.revealOn) { 5733 this.$element.first().addClass("".concat(this.options.revealClass).concat(this.options.revealOn)); 5734 5735 this._setMQChecker(); 5736 } 5737 5738 if (this.options.transitionTime) { 5739 this.$element.css('transition-duration', this.options.transitionTime); 5740 } // Initally remove all transition/position CSS classes from off-canvas content container. 5741 5742 5743 this._removeContentClasses(); 5744 } 5745 /** 5746 * Adds event handlers to the off-canvas wrapper and the exit overlay. 5747 * @function 5748 * @private 5749 */ 5750 5751 }, { 5752 key: "_events", 5753 value: function _events() { 5754 this.$element.off('.zf.trigger .zf.offcanvas').on({ 5755 'open.zf.trigger': this.open.bind(this), 5756 'close.zf.trigger': this.close.bind(this), 5757 'toggle.zf.trigger': this.toggle.bind(this), 5758 'keydown.zf.offcanvas': this._handleKeyboard.bind(this) 5759 }); 5760 5761 if (this.options.closeOnClick === true) { 5762 var $target = this.options.contentOverlay ? this.$overlay : this.$content; 5763 $target.on({ 5764 'click.zf.offcanvas': this.close.bind(this) 5765 }); 5766 } 5767 } 5768 /** 5769 * Applies event listener for elements that will reveal at certain breakpoints. 5770 * @private 5771 */ 5772 5773 }, { 5774 key: "_setMQChecker", 5775 value: function _setMQChecker() { 5776 var _this = this; 5777 5778 this.onLoadListener = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () { 5779 if (_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_3__["MediaQuery"].atLeast(_this.options.revealOn)) { 5780 _this.reveal(true); 5781 } 5782 }); 5783 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', function () { 5784 if (_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_3__["MediaQuery"].atLeast(_this.options.revealOn)) { 5785 _this.reveal(true); 5786 } else { 5787 _this.reveal(false); 5788 } 5789 }); 5790 } 5791 /** 5792 * Removes the CSS transition/position classes of the off-canvas content container. 5793 * Removing the classes is important when another off-canvas gets opened that uses the same content container. 5794 * @param {Boolean} hasReveal - true if related off-canvas element is revealed. 5795 * @private 5796 */ 5797 5798 }, { 5799 key: "_removeContentClasses", 5800 value: function _removeContentClasses(hasReveal) { 5801 if (typeof hasReveal !== 'boolean') { 5802 this.$content.removeClass(this.contentClasses.base.join(' ')); 5803 } else if (hasReveal === false) { 5804 this.$content.removeClass("has-reveal-".concat(this.position)); 5805 } 5806 } 5807 /** 5808 * Adds the CSS transition/position classes of the off-canvas content container, based on the opening off-canvas element. 5809 * Beforehand any transition/position class gets removed. 5810 * @param {Boolean} hasReveal - true if related off-canvas element is revealed. 5811 * @private 5812 */ 5813 5814 }, { 5815 key: "_addContentClasses", 5816 value: function _addContentClasses(hasReveal) { 5817 this._removeContentClasses(hasReveal); 5818 5819 if (typeof hasReveal !== 'boolean') { 5820 this.$content.addClass("has-transition-".concat(this.options.transition, " has-position-").concat(this.position)); 5821 } else if (hasReveal === true) { 5822 this.$content.addClass("has-reveal-".concat(this.position)); 5823 } 5824 } 5825 /** 5826 * Handles the revealing/hiding the off-canvas at breakpoints, not the same as open. 5827 * @param {Boolean} isRevealed - true if element should be revealed. 5828 * @function 5829 */ 5830 5831 }, { 5832 key: "reveal", 5833 value: function reveal(isRevealed) { 5834 if (isRevealed) { 5835 this.close(); 5836 this.isRevealed = true; 5837 this.$element.attr('aria-hidden', 'false'); 5838 this.$element.off('open.zf.trigger toggle.zf.trigger'); 5839 this.$element.removeClass('is-closed'); 5840 } else { 5841 this.isRevealed = false; 5842 this.$element.attr('aria-hidden', 'true'); 5843 this.$element.off('open.zf.trigger toggle.zf.trigger').on({ 5844 'open.zf.trigger': this.open.bind(this), 5845 'toggle.zf.trigger': this.toggle.bind(this) 5846 }); 5847 this.$element.addClass('is-closed'); 5848 } 5849 5850 this._addContentClasses(isRevealed); 5851 } 5852 /** 5853 * Stops scrolling of the body when offcanvas is open on mobile Safari and other troublesome browsers. 5854 * @private 5855 */ 5856 5857 }, { 5858 key: "_stopScrolling", 5859 value: function _stopScrolling(event) { 5860 return false; 5861 } // Taken and adapted from http://stackoverflow.com/questions/16889447/prevent-full-page-scrolling-ios 5862 // Only really works for y, not sure how to extend to x or if we need to. 5863 5864 }, { 5865 key: "_recordScrollable", 5866 value: function _recordScrollable(event) { 5867 var elem = this; // called from event handler context with this as elem 5868 // If the element is scrollable (content overflows), then... 5869 5870 if (elem.scrollHeight !== elem.clientHeight) { 5871 // If we're at the top, scroll down one pixel to allow scrolling up 5872 if (elem.scrollTop === 0) { 5873 elem.scrollTop = 1; 5874 } // If we're at the bottom, scroll up one pixel to allow scrolling down 5875 5876 5877 if (elem.scrollTop === elem.scrollHeight - elem.clientHeight) { 5878 elem.scrollTop = elem.scrollHeight - elem.clientHeight - 1; 5879 } 5880 } 5881 5882 elem.allowUp = elem.scrollTop > 0; 5883 elem.allowDown = elem.scrollTop < elem.scrollHeight - elem.clientHeight; 5884 elem.lastY = event.originalEvent.pageY; 5885 } 5886 }, { 5887 key: "_stopScrollPropagation", 5888 value: function _stopScrollPropagation(event) { 5889 var elem = this; // called from event handler context with this as elem 5890 5891 var up = event.pageY < elem.lastY; 5892 var down = !up; 5893 elem.lastY = event.pageY; 5894 5895 if (up && elem.allowUp || down && elem.allowDown) { 5896 event.stopPropagation(); 5897 } else { 5898 event.preventDefault(); 5899 } 5900 } 5901 /** 5902 * Opens the off-canvas menu. 5903 * @function 5904 * @param {Object} event - Event object passed from listener. 5905 * @param {jQuery} trigger - element that triggered the off-canvas to open. 5906 * @fires Offcanvas#opened 5907 * @todo also trigger 'open' event? 5908 */ 5909 5910 }, { 5911 key: "open", 5912 value: function open(event, trigger) { 5913 if (this.$element.hasClass('is-open') || this.isRevealed) { 5914 return; 5915 } 5916 5917 var _this = this; 5918 5919 if (trigger) { 5920 this.$lastTrigger = trigger; 5921 } 5922 5923 if (this.options.forceTo === 'top') { 5924 window.scrollTo(0, 0); 5925 } else if (this.options.forceTo === 'bottom') { 5926 window.scrollTo(0, document.body.scrollHeight); 5927 } 5928 5929 if (this.options.transitionTime && this.options.transition !== 'overlap') { 5930 this.$element.siblings('[data-off-canvas-content]').css('transition-duration', this.options.transitionTime); 5931 } else { 5932 this.$element.siblings('[data-off-canvas-content]').css('transition-duration', ''); 5933 } 5934 5935 this.$element.addClass('is-open').removeClass('is-closed'); 5936 this.$triggers.attr('aria-expanded', 'true'); 5937 this.$element.attr('aria-hidden', 'false'); 5938 this.$content.addClass('is-open-' + this.position); // If `contentScroll` is set to false, add class and disable scrolling on touch devices. 5939 5940 if (this.options.contentScroll === false) { 5941 jquery__WEBPACK_IMPORTED_MODULE_0___default()('body').addClass('is-off-canvas-open').on('touchmove', this._stopScrolling); 5942 this.$element.on('touchstart', this._recordScrollable); 5943 this.$element.on('touchmove', this._stopScrollPropagation); 5944 } 5945 5946 if (this.options.contentOverlay === true) { 5947 this.$overlay.addClass('is-visible'); 5948 } 5949 5950 if (this.options.closeOnClick === true && this.options.contentOverlay === true) { 5951 this.$overlay.addClass('is-closable'); 5952 } 5953 5954 if (this.options.autoFocus === true) { 5955 this.$element.one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["transitionend"])(this.$element), function () { 5956 if (!_this.$element.hasClass('is-open')) { 5957 return; // exit if prematurely closed 5958 } 5959 5960 var canvasFocus = _this.$element.find('[data-autofocus]'); 5961 5962 if (canvasFocus.length) { 5963 canvasFocus.eq(0).focus(); 5964 } else { 5965 _this.$element.find('a, button').eq(0).focus(); 5966 } 5967 }); 5968 } 5969 5970 if (this.options.trapFocus === true) { 5971 this.$content.attr('tabindex', '-1'); 5972 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].trapFocus(this.$element); 5973 } 5974 5975 this._addContentClasses(); 5976 /** 5977 * Fires when the off-canvas menu opens. 5978 * @event Offcanvas#opened 5979 */ 5980 5981 5982 this.$element.trigger('opened.zf.offcanvas'); 5983 } 5984 /** 5985 * Closes the off-canvas menu. 5986 * @function 5987 * @param {Function} cb - optional cb to fire after closure. 5988 * @fires Offcanvas#closed 5989 */ 5990 5991 }, { 5992 key: "close", 5993 value: function close(cb) { 5994 if (!this.$element.hasClass('is-open') || this.isRevealed) { 5995 return; 5996 } 5997 5998 var _this = this; 5999 6000 this.$element.removeClass('is-open'); 6001 this.$element.attr('aria-hidden', 'true') 6002 /** 6003 * Fires when the off-canvas menu opens. 6004 * @event Offcanvas#closed 6005 */ 6006 .trigger('closed.zf.offcanvas'); 6007 this.$content.removeClass('is-open-left is-open-top is-open-right is-open-bottom'); // If `contentScroll` is set to false, remove class and re-enable scrolling on touch devices. 6008 6009 if (this.options.contentScroll === false) { 6010 jquery__WEBPACK_IMPORTED_MODULE_0___default()('body').removeClass('is-off-canvas-open').off('touchmove', this._stopScrolling); 6011 this.$element.off('touchstart', this._recordScrollable); 6012 this.$element.off('touchmove', this._stopScrollPropagation); 6013 } 6014 6015 if (this.options.contentOverlay === true) { 6016 this.$overlay.removeClass('is-visible'); 6017 } 6018 6019 if (this.options.closeOnClick === true && this.options.contentOverlay === true) { 6020 this.$overlay.removeClass('is-closable'); 6021 } 6022 6023 this.$triggers.attr('aria-expanded', 'false'); 6024 6025 if (this.options.trapFocus === true) { 6026 this.$content.removeAttr('tabindex'); 6027 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].releaseFocus(this.$element); 6028 } // Listen to transitionEnd and add class when done. 6029 6030 6031 this.$element.one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["transitionend"])(this.$element), function (e) { 6032 _this.$element.addClass('is-closed'); 6033 6034 _this._removeContentClasses(); 6035 }); 6036 } 6037 /** 6038 * Toggles the off-canvas menu open or closed. 6039 * @function 6040 * @param {Object} event - Event object passed from listener. 6041 * @param {jQuery} trigger - element that triggered the off-canvas to open. 6042 */ 6043 6044 }, { 6045 key: "toggle", 6046 value: function toggle(event, trigger) { 6047 if (this.$element.hasClass('is-open')) { 6048 this.close(event, trigger); 6049 } else { 6050 this.open(event, trigger); 6051 } 6052 } 6053 /** 6054 * 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. 6055 * @function 6056 * @private 6057 */ 6058 6059 }, { 6060 key: "_handleKeyboard", 6061 value: function _handleKeyboard(e) { 6062 var _this3 = this; 6063 6064 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].handleKey(e, 'OffCanvas', { 6065 close: function close() { 6066 _this3.close(); 6067 6068 _this3.$lastTrigger.focus(); 6069 6070 return true; 6071 }, 6072 handled: function handled() { 6073 e.stopPropagation(); 6074 e.preventDefault(); 6075 } 6076 }); 6077 } 6078 /** 6079 * Destroys the offcanvas plugin. 6080 * @function 6081 */ 6082 6083 }, { 6084 key: "_destroy", 6085 value: function _destroy() { 6086 this.close(); 6087 this.$element.off('.zf.trigger .zf.offcanvas'); 6088 this.$overlay.off('.zf.offcanvas'); 6089 if (this.onLoadListener) jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(this.onLoadListener); 6090 } 6091 }]); 6092 6093 return OffCanvas; 6094}
6094(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__["Plugin"]); 6095 6096OffCanvas.defaults = { 6097 /** 6098 * Allow the user to click outside of the menu to close it. 6099 * @option 6100 * @type {boolean} 6101 * @default true 6102 */ 6103 closeOnClick: true, 6104 6105 /** 6106 * Adds an overlay on top of `[data-off-canvas-content]`. 6107 * @option 6108 * @type {boolean} 6109 * @default true 6110 */ 6111 contentOverlay: true, 6112 6113 /** 6114 * Target an off-canvas content container by ID that may be placed anywhere. If null the closest content container will be taken. 6115 * @option 6116 * @type {?string} 6117 * @default null 6118 */ 6119 contentId: null, 6120 6121 /** 6122 * Define the off-canvas element is nested in an off-canvas content. This is required when using the contentId option for a nested element. 6123 * @option 6124 * @type {boolean} 6125 * @default null 6126 */ 6127 nested: null, 6128 6129 /** 6130 * Enable/disable scrolling of the main content when an off canvas panel is open. 6131 * @option 6132 * @type {boolean} 6133 * @default true 6134 */ 6135 contentScroll: true, 6136 6137 /** 6138 * Amount of time in ms the open and close transition requires. If none selected, pulls from body style. 6139 * @option 6140 * @type {number} 6141 * @default null 6142 */ 6143 transitionTime: null, 6144 6145 /** 6146 * Type of transition for the offcanvas menu. Options are 'push', 'detached' or 'slide'. 6147 * @option 6148 * @type {string} 6149 * @default push 6150 */ 6151 transition: 'push', 6152 6153 /** 6154 * Force the page to scroll to top or bottom on open. 6155 * @option 6156 * @type {?string} 6157 * @default null 6158 */ 6159 forceTo: null, 6160 6161 /** 6162 * Allow the offcanvas to remain open for certain breakpoints. 6163 * @option 6164 * @type {boolean} 6165 * @default false 6166 */ 6167 isRevealed: false, 6168 6169 /** 6170 * Breakpoint at which to reveal. JS will use a RegExp to target standard classes, if changing classnames, pass your class with the `revealClass` option. 6171 * @option 6172 * @type {?string} 6173 * @default null 6174 */ 6175 revealOn: null, 6176 6177 /** 6178 * Force focus to the offcanvas on open. If true, will focus the opening trigger on close. 6179 * @option 6180 * @type {boolean} 6181 * @default true 6182 */ 6183 autoFocus: true, 6184 6185 /** 6186 * Class used to force an offcanvas to remain open. Foundation defaults for this are `reveal-for-large` & `reveal-for-medium`. 6187 * @option 6188 * @type {string} 6189 * @default reveal-for- 6190 * @todo improve the regex testing for this. 6191 */ 6192 revealClass: 'reveal-for-', 6193 6194 /** 6195 * Triggers optional focus trapping when opening an offcanvas. Sets tabindex of [data-off-canvas-content] to -1 for accessibility purposes. 6196 * @option 6197 * @type {boolean} 6198 * @default false 6199 */ 6200 trapFocus: false 6201}; 6202 6203 6204/***/ }), 6205
vendor: 5,230 bytes, lines 6206-6289
6206/***/ "./js/foundation.orbit.js": 6207/*!********************************!*\ 6208 !*** ./js/foundation.orbit.js ***! 6209 \********************************/ 6210/*! exports provided: Orbit */ 6211/***/ (function(module, __webpack_exports__, __webpack_require__) { 6212 6213"use strict"; 6214__webpack_require__.r(__webpack_exports__); 6215/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Orbit", function() { return Orbit; }); 6216/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 6217/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 6218/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js"); 6219/* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.motion */ "./js/foundation.util.motion.js"); 6220/* harmony import */ var _foundation_util_timer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.timer */ "./js/foundation.util.timer.js"); 6221/* harmony import */ var _foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.imageLoader */ "./js/foundation.util.imageLoader.js"); 6222/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 6223/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 6224/* harmony import */ var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./foundation.util.touch */ "./js/foundation.util.touch.js"); 6225 6226 6227function _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); } 6228 6229function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 6230 6231function _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); } } 6232 6233function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 6234 6235function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 6236 6237function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 6238 6239function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 6240 6241function _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); } 6242 6243function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253/** 6254 * Orbit module. 6255 * @module foundation.orbit 6256 * @requires foundation.util.keyboard 6257 * @requires foundation.util.motion 6258 * @requires foundation.util.timer 6259 * @requires foundation.util.imageLoader 6260 * @requires foundation.util.touch 6261 */ 6262 6263var Orbit = 6264/*#__PURE__*/ 6265function (_Plugin) { 6266 _inherits(Orbit, _Plugin); 6267 6268 function Orbit() { 6269 _classCallCheck(this, Orbit); 6270 6271 return _possibleConstructorReturn(this, _getPrototypeOf(Orbit).apply(this, arguments)); 6272 } 6273 6274 _createClass(Orbit, [{ 6275 key: "_setup", 6276 6277 /** 6278 * Creates a new instance of an orbit carousel. 6279 * @class 6280 * @name Orbit 6281 * @param {jQuery} element - jQuery object to make into an Orbit Carousel. 6282 * @param {Object} options - Overrides to the default plugin settings. 6283 */ 6284 value: function _setup(element, options) { 6285 this.$element = element; 6286 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Orbit.defaults, this.$element.data(), options); 6287 this.className = 'Orbit'; // ie9 back compat 6288 6289 _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: 9,751 bytes, lines 6290-6604
6290 6291 this._init(); 6292 6293 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].register('Orbit', { 6294 'ltr': { 6295 'ARROW_RIGHT': 'next', 6296 'ARROW_LEFT': 'previous' 6297 }, 6298 'rtl': { 6299 'ARROW_LEFT': 'next', 6300 'ARROW_RIGHT': 'previous' 6301 } 6302 }); 6303 } 6304 /** 6305 * Initializes the plugin by creating jQuery collections, setting attributes, and starting the animation. 6306 * @function 6307 * @private 6308 */ 6309 6310 }, { 6311 key: "_init", 6312 value: function _init() { 6313 // @TODO: consider discussion on PR #9278 about DOM pollution by changeSlide 6314 this._reset(); 6315 6316 this.$wrapper = this.$element.find(".".concat(this.options.containerClass)); 6317 this.$slides = this.$element.find(".".concat(this.options.slideClass)); 6318 var $images = this.$element.find('img'), 6319 initActive = this.$slides.filter('.is-active'), 6320 id = this.$element[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_5__["GetYoDigits"])(6, 'orbit'); 6321 this.$element.attr({ 6322 'data-resize': id, 6323 'id': id 6324 }); 6325 6326 if (!initActive.length) { 6327 this.$slides.eq(0).addClass('is-active'); 6328 } 6329 6330 if (!this.options.useMUI) { 6331 this.$slides.addClass('no-motionui'); 6332 } 6333 6334 if ($images.length) { 6335 Object(_foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_4__["onImagesLoaded"])($images, this._prepareForOrbit.bind(this)); 6336 } else { 6337 this._prepareForOrbit(); //hehe 6338 6339 } 6340 6341 if (this.options.bullets) { 6342 this._loadBullets(); 6343 } 6344 6345 this._events(); 6346 6347 if (this.options.autoPlay && this.$slides.length > 1) { 6348 this.geoSync(); 6349 } 6350 6351 if (this.options.accessible) { 6352 // allow wrapper to be focusable to enable arrow navigation 6353 this.$wrapper.attr('tabindex', 0); 6354 } 6355 } 6356 /** 6357 * Creates a jQuery collection of bullets, if they are being used. 6358 * @function 6359 * @private 6360 */ 6361 6362 }, { 6363 key: "_loadBullets", 6364 value: function _loadBullets() { 6365 this.$bullets = this.$element.find(".".concat(this.options.boxOfBullets)).find('button'); 6366 } 6367 /** 6368 * Sets a `timer` object on the orbit, and starts the counter for the next slide. 6369 * @function 6370 */ 6371 6372 }, { 6373 key: "geoSync", 6374 value: function geoSync() { 6375 var _this = this; 6376 6377 this.timer = new _foundation_util_timer__WEBPACK_IMPORTED_MODULE_3__["Timer"](this.$element, { 6378 duration: this.options.timerDelay, 6379 infinite: false 6380 }, function () { 6381 _this.changeSlide(true); 6382 }); 6383 this.timer.start(); 6384 } 6385 /** 6386 * Sets wrapper and slide heights for the orbit. 6387 * @function 6388 * @private 6389 */ 6390 6391 }, { 6392 key: "_prepareForOrbit", 6393 value: function _prepareForOrbit() { 6394 var _this = this; 6395 6396 this._setWrapperHeight(); 6397 } 6398 /** 6399 * Calulates the height of each slide in the collection, and uses the tallest one for the wrapper height. 6400 * @function 6401 * @private 6402 * @param {Function} cb - a callback function to fire when complete. 6403 */ 6404 6405 }, { 6406 key: "_setWrapperHeight", 6407 value: function _setWrapperHeight(cb) { 6408 //rewrite this to `for` loop 6409 var max = 0, 6410 temp, 6411 counter = 0, 6412 _this = this; 6413 6414 this.$slides.each(function () { 6415 temp = this.getBoundingClientRect().height; 6416 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('data-slide', counter); // hide all slides but the active one 6417 6418 if (!/mui/g.test(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)[0].className) && _this.$slides.filter('.is-active')[0] !== _this.$slides.eq(counter)[0]) { 6419 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).css({ 6420 'display': 'none' 6421 }); 6422 } 6423 6424 max = temp > max ? temp : max; 6425 counter++; 6426 }); 6427 6428 if (counter === this.$slides.length) { 6429 this.$wrapper.css({ 6430 'height': max 6431 }); //only change the wrapper height property once. 6432 6433 if (cb) { 6434 cb(max); 6435 } //fire callback with max height dimension. 6436 6437 } 6438 } 6439 /** 6440 * Sets the max-height of each slide. 6441 * @function 6442 * @private 6443 */ 6444 6445 }, { 6446 key: "_setSlideHeight", 6447 value: function _setSlideHeight(height) { 6448 this.$slides.each(function () { 6449 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).css('max-height', height); 6450 }); 6451 } 6452 /** 6453 * Adds event listeners to basically everything within the element. 6454 * @function 6455 * @private 6456 */ 6457 6458 }, { 6459 key: "_events", 6460 value: function _events() { 6461 var _this = this; //*************************************** 6462 //**Now using custom event - thanks to:** 6463 //** Yohai Ararat of Toronto ** 6464 //*************************************** 6465 // 6466 6467 6468 this.$element.off('.resizeme.zf.trigger').on({ 6469 'resizeme.zf.trigger': this._prepareForOrbit.bind(this) 6470 }); 6471 6472 if (this.$slides.length > 1) { 6473 if (this.options.swipe) { 6474 this.$slides.off('swipeleft.zf.orbit swiperight.zf.orbit').on('swipeleft.zf.orbit', function (e) { 6475 e.preventDefault(); 6476 6477 _this.changeSlide(true); 6478 }).on('swiperight.zf.orbit', function (e) { 6479 e.preventDefault(); 6480 6481 _this.changeSlide(false); 6482 }); 6483 } //*************************************** 6484 6485 6486 if (this.options.autoPlay) { 6487 this.$slides.on('click.zf.orbit', function () { 6488 _this.$element.data('clickedOn', _this.$element.data('clickedOn') ? false : true); 6489 6490 _this.timer[_this.$element.data('clickedOn') ? 'pause' : 'start'](); 6491 }); 6492 6493 if (this.options.pauseOnHover) { 6494 this.$element.on('mouseenter.zf.orbit', function () { 6495 _this.timer.pause(); 6496 }).on('mouseleave.zf.orbit', function () { 6497 if (!_this.$element.data('clickedOn')) { 6498 _this.timer.start(); 6499 } 6500 }); 6501 } 6502 } 6503 6504 if (this.options.navButtons) { 6505 var $controls = this.$element.find(".".concat(this.options.nextClass, ", .").concat(this.options.prevClass)); 6506 $controls.attr('tabindex', 0) //also need to handle enter/return and spacebar key presses 6507 .on('click.zf.orbit touchend.zf.orbit', function (e) { 6508 e.preventDefault(); 6509 6510 _this.changeSlide(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).hasClass(_this.options.nextClass)); 6511 }); 6512 } 6513 6514 if (this.options.bullets) { 6515 this.$bullets.on('click.zf.orbit touchend.zf.orbit', function () { 6516 if (/is-active/g.test(this.className)) { 6517 return false; 6518 } //if this is active, kick out of function. 6519 6520 6521 var idx = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('slide'), 6522 ltr = idx > _this.$slides.filter('.is-active').data('slide'), 6523 $slide = _this.$slides.eq(idx); 6524 6525 _this.changeSlide(ltr, $slide, idx); 6526 }); 6527 } 6528 6529 if (this.options.accessible) { 6530 this.$wrapper.add(this.$bullets).on('keydown.zf.orbit', function (e) { 6531 // handle keyboard event with keyboard util 6532 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].handleKey(e, 'Orbit', { 6533 next: function next() { 6534 _this.changeSlide(true); 6535 }, 6536 previous: function previous() { 6537 _this.changeSlide(false); 6538 }, 6539 handled: function handled() { 6540 // if bullet is focused, make sure focus moves 6541 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).is(_this.$bullets)) { 6542 _this.$bullets.filter('.is-active').focus(); 6543 } 6544 } 6545 }); 6546 }); 6547 } 6548 } 6549 } 6550 /** 6551 * Resets Orbit so it can be reinitialized 6552 */ 6553 6554 }, { 6555 key: "_reset", 6556 value: function _reset() { 6557 // Don't do anything if there are no slides (first run) 6558 if (typeof this.$slides == 'undefined') { 6559 return; 6560 } 6561 6562 if (this.$slides.length > 1) { 6563 // Remove old events 6564 this.$element.off('.zf.orbit').find('*').off('.zf.orbit'); // Restart timer if autoPlay is enabled 6565 6566 if (this.options.autoPlay) { 6567 this.timer.restart(); 6568 } // Reset all sliddes 6569 6570 6571 this.$slides.each(function (el) { 6572 jquery__WEBPACK_IMPORTED_MODULE_0___default()(el).removeClass('is-active is-active is-in').removeAttr('aria-live').hide(); 6573 }); // Show the first slide 6574 6575 this.$slides.first().addClass('is-active').show(); // Triggers when the slide has finished animating 6576 6577 this.$element.trigger('slidechange.zf.orbit', [this.$slides.first()]); // Select first bullet if bullets are present 6578 6579 if (this.options.bullets) { 6580 this._updateBullets(0); 6581 } 6582 } 6583 } 6584 /** 6585 * Changes the current slide to a new one. 6586 * @function 6587 * @param {Boolean} isLTR - if true the slide moves from right to left, if false the slide moves from left to right. 6588 * @param {jQuery} chosenSlide - the jQuery element of the slide to show next, if one is selected. 6589 * @param {Number} idx - the index of the new slide in its collection, if one chosen. 6590 * @fires Orbit#slidechange 6591 */ 6592 6593 }, { 6594 key: "changeSlide", 6595 value: function changeSlide(isLTR, chosenSlide, idx) { 6596 if (!this.$slides) { 6597 return; 6598 } // Don't freak out if we're in the middle of cleanup 6599 6600 6601 var $curSlide = this.$slides.filter('.is-active').eq(0); 6602 6603 if (/mui/g.test($curSlide[0].className)) { 6604 return false;
vendor: 6,583 bytes, lines 6605-6846
6605 } //if the slide is currently animating, kick out of the function 6606 6607 6608 var $firstSlide = this.$slides.first(), 6609 $lastSlide = this.$slides.last(), 6610 dirIn = isLTR ? 'Right' : 'Left', 6611 dirOut = isLTR ? 'Left' : 'Right', 6612 _this = this, 6613 $newSlide; 6614 6615 if (!chosenSlide) { 6616 //most of the time, this will be auto played or clicked from the navButtons. 6617 $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!!!!! 6618 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 6619 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 6620 } else { 6621 $newSlide = chosenSlide; 6622 } 6623 6624 if ($newSlide.length) { 6625 /** 6626 * Triggers before the next slide starts animating in and only if a next slide has been found. 6627 * @event Orbit#beforeslidechange 6628 */ 6629 this.$element.trigger('beforeslidechange.zf.orbit', [$curSlide, $newSlide]); 6630 6631 if (this.options.bullets) { 6632 idx = idx || this.$slides.index($newSlide); //grab index to update bullets 6633 6634 this._updateBullets(idx); 6635 } 6636 6637 if (this.options.useMUI && !this.$element.is(':hidden')) { 6638 _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Motion"].animateIn($newSlide.addClass('is-active'), this.options["animInFrom".concat(dirIn)], function () { 6639 $newSlide.css({ 6640 'display': 'block' 6641 }).attr('aria-live', 'polite'); 6642 }); 6643 _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Motion"].animateOut($curSlide.removeClass('is-active'), this.options["animOutTo".concat(dirOut)], function () { 6644 $curSlide.removeAttr('aria-live'); 6645 6646 if (_this.options.autoPlay && !_this.timer.isPaused) { 6647 _this.timer.restart(); 6648 } //do stuff? 6649 6650 }); 6651 } else { 6652 $curSlide.removeClass('is-active is-in').removeAttr('aria-live').hide(); 6653 $newSlide.addClass('is-active is-in').attr('aria-live', 'polite').show(); 6654 6655 if (this.options.autoPlay && !this.timer.isPaused) { 6656 this.timer.restart(); 6657 } 6658 } 6659 /** 6660 * Triggers when the slide has finished animating in. 6661 * @event Orbit#slidechange 6662 */ 6663 6664 6665 this.$element.trigger('slidechange.zf.orbit', [$newSlide]); 6666 } 6667 } 6668 /** 6669 * Updates the active state of the bullets, if displayed. 6670 * @function 6671 * @private 6672 * @param {Number} idx - the index of the current slide. 6673 */ 6674 6675 }, { 6676 key: "_updateBullets", 6677 value: function _updateBullets(idx) { 6678 var $oldBullet = this.$element.find(".".concat(this.options.boxOfBullets)).find('.is-active').removeClass('is-active').blur(), 6679 span = $oldBullet.find('span:last').detach(), 6680 $newBullet = this.$bullets.eq(idx).addClass('is-active').append(span); 6681 } 6682 /** 6683 * Destroys the carousel and hides the element. 6684 * @function 6685 */ 6686 6687 }, { 6688 key: "_destroy", 6689 value: function _destroy() { 6690 this.$element.off('.zf.orbit').find('*').off('.zf.orbit').end().hide(); 6691 } 6692 }]); 6693 6694 return Orbit; 6695}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_6__["Plugin"]); 6696 6697Orbit.defaults = { 6698 /** 6699 * Tells the JS to look for and loadBullets. 6700 * @option 6701 * @type {boolean} 6702 * @default true 6703 */ 6704 bullets: true, 6705 6706 /** 6707 * Tells the JS to apply event listeners to nav buttons 6708 * @option 6709 * @type {boolean} 6710 * @default true 6711 */ 6712 navButtons: true, 6713 6714 /** 6715 * motion-ui animation class to apply 6716 * @option 6717 * @type {string} 6718 * @default 'slide-in-right' 6719 */ 6720 animInFromRight: 'slide-in-right', 6721 6722 /** 6723 * motion-ui animation class to apply 6724 * @option 6725 * @type {string} 6726 * @default 'slide-out-right' 6727 */ 6728 animOutToRight: 'slide-out-right', 6729 6730 /** 6731 * motion-ui animation class to apply 6732 * @option 6733 * @type {string} 6734 * @default 'slide-in-left' 6735 * 6736 */ 6737 animInFromLeft: 'slide-in-left', 6738 6739 /** 6740 * motion-ui animation class to apply 6741 * @option 6742 * @type {string} 6743 * @default 'slide-out-left' 6744 */ 6745 animOutToLeft: 'slide-out-left', 6746 6747 /** 6748 * Allows Orbit to automatically animate on page load. 6749 * @option 6750 * @type {boolean} 6751 * @default true 6752 */ 6753 autoPlay: true, 6754 6755 /** 6756 * Amount of time, in ms, between slide transitions 6757 * @option 6758 * @type {number} 6759 * @default 5000 6760 */ 6761 timerDelay: 5000, 6762 6763 /** 6764 * Allows Orbit to infinitely loop through the slides 6765 * @option 6766 * @type {boolean} 6767 * @default true 6768 */ 6769 infiniteWrap: true, 6770 6771 /** 6772 * Allows the Orbit slides to bind to swipe events for mobile, requires an additional util library 6773 * @option 6774 * @type {boolean} 6775 * @default true 6776 */ 6777 swipe: true, 6778 6779 /** 6780 * Allows the timing function to pause animation on hover. 6781 * @option 6782 * @type {boolean} 6783 * @default true 6784 */ 6785 pauseOnHover: true, 6786 6787 /** 6788 * Allows Orbit to bind keyboard events to the slider, to animate frames with arrow keys 6789 * @option 6790 * @type {boolean} 6791 * @default true 6792 */ 6793 accessible: true, 6794 6795 /** 6796 * Class applied to the container of Orbit 6797 * @option 6798 * @type {string} 6799 * @default 'orbit-container' 6800 */ 6801 containerClass: 'orbit-container', 6802 6803 /** 6804 * Class applied to individual slides. 6805 * @option 6806 * @type {string} 6807 * @default 'orbit-slide' 6808 */ 6809 slideClass: 'orbit-slide', 6810 6811 /** 6812 * Class applied to the bullet container. You're welcome. 6813 * @option 6814 * @type {string} 6815 * @default 'orbit-bullets' 6816 */ 6817 boxOfBullets: 'orbit-bullets', 6818 6819 /** 6820 * Class applied to the `next` navigation button. 6821 * @option 6822 * @type {string} 6823 * @default 'orbit-next' 6824 */ 6825 nextClass: 'orbit-next', 6826 6827 /** 6828 * Class applied to the `previous` navigation button. 6829 * @option 6830 * @type {string} 6831 * @default 'orbit-previous' 6832 */ 6833 prevClass: 'orbit-previous', 6834 6835 /** 6836 * Boolean to flag the js to use motion ui classes or not. Default to true for backwards compatibility. 6837 * @option 6838 * @type {boolean} 6839 * @default true 6840 */ 6841 useMUI: true 6842}; 6843 6844 6845/***/ }), 6846
6847/***/ "./js/foundation.positionable.js": 6848/*!***************************************!*\ 6849 !*** ./js/foundation.positionable.js ***! 6850 \***************************************/ 6851/*! exports provided: Positionable */ 6852/***/ (function(module, __webpack_exports__, __webpack_require__) { 6853 6854"use strict"; 6855__webpack_require__.r(__webpack_exports__); 6856/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Positionable", function() { return Positionable; }); 6857/* harmony import */ var _foundation_util_box__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./foundation.util.box */ "./js/foundation.util.box.js"); 6858/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 6859/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 6860 6861 6862function _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); } 6863 6864function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 6865 6866function _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); } } 6867 6868function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 6869 6870function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 6871 6872function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 6873 6874function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 6875 6876function _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); } 6877 6878function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 6879 6880 6881 6882 6883var POSITIONS = ['left', 'right', 'top', 'bottom']; 6884var VERTICAL_ALIGNMENTS = ['top', 'bottom', 'center']; 6885var HORIZONTAL_ALIGNMENTS = ['left', 'right', 'center']; 6886var ALIGNMENTS = { 6887 'left': VERTICAL_ALIGNMENTS, 6888 'right': VERTICAL_ALIGNMENTS, 6889 'top': HORIZONTAL_ALIGNMENTS, 6890 'bottom': HORIZONTAL_ALIGNMENTS 6891}; 6892 6893function nextItem(item, array) { 6894 var currentIdx = array.indexOf(item); 6895 6896 if (currentIdx === array.length - 1) { 6897 return array[0]; 6898 } else { 6899 return array[currentIdx + 1]; 6900 } 6901} 6902 6903var Positionable = 6904/*#__PURE__*/ 6905function (_Plugin) { 6906 _inherits(Positionable, _Plugin); 6907 6908 function Positionable() { 6909 _classCallCheck(this, Positionable); 6910 6911 return _possibleConstructorReturn(this, _getPrototypeOf(Positionable).apply(this, arguments)); 6912 } 6913 6914 _createClass(Positionable, [{ 6915 key: "_init", 6916 6917 /** 6918 * Abstract class encapsulating the tether-like explicit positioning logic 6919 * including repositioning based on overlap. 6920 * Expects classes to define defaults for vOffset, hOffset, position, 6921 * alignment, allowOverlap, and allowBottomOverlap. They can do this by 6922 * extending the defaults, or (for now recommended due to the way docs are 6923 * generated) by explicitly declaring them. 6924 * 6925 **/ 6926 value: function _init() { 6927 this.triedPositions = {}; 6928 this.position = this.options.position === 'auto' ? this._getDefaultPosition() : this.options.position; 6929 this.alignment = this.options.alignment === 'auto' ? this._getDefaultAlignment() : this.options.alignment; 6930 this.originalPosition = this.position; 6931 this.originalAlignment = this.alignment; 6932 } 6933 }, { 6934 key: "_getDefaultPosition", 6935 value: function _getDefaultPosition() { 6936 return 'bottom'; 6937 } 6938 }, { 6939 key: "_getDefaultAlignment", 6940 value: function _getDefaultAlignment() { 6941 switch (this.position) { 6942 case 'bottom': 6943 case 'top': 6944 return Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["rtl"])() ? 'right' : 'left'; 6945 6946 case 'left': 6947 case 'right': 6948 return 'bottom'; 6949 } 6950 } 6951 /** 6952 * Adjusts the positionable possible positions by iterating through alignments 6953 * and positions. 6954 * @function 6955 * @private 6956 */ 6957 6958 }, { 6959 key: "_reposition", 6960 value: function _reposition() { 6961 if (this._alignmentsExhausted(this.position)) { 6962 this.position = nextItem(this.position, POSITIONS); 6963 this.alignment = ALIGNMENTS[this.position][0]; 6964 } else { 6965 this._realign(); 6966 } 6967 } 6968 /** 6969 * Adjusts the dropdown pane possible positions by iterating through alignments 6970 * on the current position. 6971 * @function 6972 * @private 6973 */ 6974 6975 }, { 6976 key: "_realign", 6977 value: function _realign() { 6978 this._addTriedPosition(this.position, this.alignment); 6979 6980 this.alignment = nextItem(this.alignment, ALIGNMENTS[this.position]); 6981 } 6982 }, { 6983 key: "_addTriedPosition", 6984 value: function _addTriedPosition(position, alignment) { 6985 this.triedPositions[position] = this.triedPositions[position] || []; 6986 this.triedPositions[position].push(alignment); 6987 } 6988 }, { 6989 key: "_positionsExhausted", 6990 value: function _positionsExhausted() { 6991 var isExhausted = true; 6992 6993 for (var i = 0; i < POSITIONS.length; i++) { 6994 isExhausted = isExhausted && this._alignmentsExhausted(POSITIONS[i]); 6995 } 6996 6997 return isExhausted; 6998 } 6999 }, { 7000 key: "_alignmentsExhausted", 7001 value: function _alignmentsExhausted(position) { 7002 return this.triedPositions[position] && this.triedPositions[position].length == ALIGNMENTS[position].length; 7003 } // When we're trying to center, we don't want to apply offset that's going to 7004 // take us just off center, so wrap around to return 0 for the appropriate 7005 // offset in those alignments. TODO: Figure out if we want to make this 7006 // configurable behavior... it feels more intuitive, especially for tooltips, but 7007 // it's possible someone might actually want to start from center and then nudge 7008 // slightly off. 7009 7010 }, { 7011 key: "_getVOffset", 7012 value: function _getVOffset() { 7013 return this.options.vOffset; 7014 } 7015 }, { 7016 key: "_getHOffset", 7017 value: function _getHOffset() { 7018 return this.options.hOffset; 7019 } 7020 }, { 7021 key: "_setPosition", 7022 value: function _setPosition($anchor, $element, $parent) { 7023 if ($anchor.attr('aria-expanded') === 'false') { 7024 return false;
7025 } 7026 7027 var $eleDims = _foundation_util_box__WEBPACK_IMPORTED_MODULE_0__["Box"].GetDimensions($element), 7028 $anchorDims = _foundation_util_box__WEBPACK_IMPORTED_MODULE_0__["Box"].GetDimensions($anchor); 7029 7030 if (!this.options.allowOverlap) { 7031 // restore original position & alignment before checking overlap 7032 this.position = this.originalPosition; 7033 this.alignment = this.originalAlignment; 7034 } 7035 7036 $element.offset(_foundation_util_box__WEBPACK_IMPORTED_MODULE_0__["Box"].GetExplicitOffsets($element, $anchor, this.position, this.alignment, this._getVOffset(), this._getHOffset())); 7037 7038 if (!this.options.allowOverlap) { 7039 var overlaps = {}; 7040 var minOverlap = 100000000; // default coordinates to how we start, in case we can't figure out better 7041 7042 var minCoordinates = { 7043 position: this.position, 7044 alignment: this.alignment 7045 }; 7046 7047 while (!this._positionsExhausted()) { 7048 var overlap = _foundation_util_box__WEBPACK_IMPORTED_MODULE_0__["Box"].OverlapArea($element, $parent, false, false, this.options.allowBottomOverlap); 7049 7050 if (overlap === 0) { 7051 return; 7052 } 7053 7054 if (overlap < minOverlap) { 7055 minOverlap = overlap; 7056 minCoordinates = { 7057 position: this.position, 7058 alignment: this.alignment 7059 }; 7060 } 7061 7062 this._reposition(); 7063 7064 $element.offset(_foundation_util_box__WEBPACK_IMPORTED_MODULE_0__["Box"].GetExplicitOffsets($element, $anchor, this.position, this.alignment, this._getVOffset(), this._getHOffset())); 7065 } // If we get through the entire loop, there was no non-overlapping 7066 // position available. Pick the version with least overlap. 7067 7068 7069 this.position = minCoordinates.position; 7070 this.alignment = minCoordinates.alignment; 7071 $element.offset(_foundation_util_box__WEBPACK_IMPORTED_MODULE_0__["Box"].GetExplicitOffsets($element, $anchor, this.position, this.alignment, this._getVOffset(), this._getHOffset())); 7072 } 7073 } 7074 }]); 7075 7076 return Positionable; 7077}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]); 7078 7079Positionable.defaults = { 7080 /** 7081 * Position of positionable relative to anchor. Can be left, right, bottom, top, or auto. 7082 * @option 7083 * @type {string} 7084 * @default 'auto' 7085 */ 7086 position: 'auto', 7087 7088 /** 7089 * Alignment of positionable relative to anchor. Can be left, right, bottom, top, center, or auto. 7090 * @option 7091 * @type {string} 7092 * @default 'auto' 7093 */ 7094 alignment: 'auto', 7095 7096 /** 7097 * Allow overlap of container/window. If false, dropdown positionable first 7098 * try to position as defined by data-position and data-alignment, but 7099 * reposition if it would cause an overflow. 7100 * @option 7101 * @type {boolean} 7102 * @default false 7103 */ 7104 allowOverlap: false, 7105 7106 /** 7107 * Allow overlap of only the bottom of the container. This is the most common 7108 * behavior for dropdowns, allowing the dropdown to extend the bottom of the 7109 * screen but not otherwise influence or break out of the container. 7110 * @option 7111 * @type {boolean} 7112 * @default true 7113 */ 7114 allowBottomOverlap: true, 7115 7116 /** 7117 * Number of pixels the positionable should be separated vertically from anchor 7118 * @option 7119 * @type {number} 7120 * @default 0 7121 */ 7122 vOffset: 0, 7123 7124 /** 7125 * Number of pixels the positionable should be separated horizontally from anchor 7126 * @option 7127 * @type {number} 7128 * @default 0 7129 */ 7130 hOffset: 0 7131}; 7132 7133 7134/***/ }), 7135
7136/***/ "./js/foundation.responsiveAccordionTabs.js": 7137/*!**************************************************!*\ 7138 !*** ./js/foundation.responsiveAccordionTabs.js ***! 7139 \**************************************************/ 7140/*! exports provided: ResponsiveAccordionTabs */ 7141/***/ (function(module, __webpack_exports__, __webpack_require__) { 7142 7143"use strict"; 7144__webpack_require__.r(__webpack_exports__); 7145/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResponsiveAccordionTabs", function() { return ResponsiveAccordionTabs; }); 7146/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 7147/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 7148/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js"); 7149/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 7150/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 7151/* harmony import */ var _foundation_accordion__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.accordion */ "./js/foundation.accordion.js"); 7152/* harmony import */ var _foundation_tabs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.tabs */ "./js/foundation.tabs.js"); 7153 7154 7155function _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); } 7156 7157function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 7158 7159function _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); } } 7160 7161function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 7162 7163function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 7164 7165function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 7166 7167function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 7168 7169function _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); } 7170 7171function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 7172 7173 7174 7175 7176 7177 7178 // The plugin matches the plugin classes with these plugin instances. 7179 7180var MenuPlugins = { 7181 tabs: { 7182 cssClass: 'tabs', 7183 plugin: _foundation_tabs__WEBPACK_IMPORTED_MODULE_5__["Tabs"] 7184 }, 7185 accordion: { 7186 cssClass: 'accordion', 7187 plugin: _foundation_accordion__WEBPACK_IMPORTED_MODULE_4__["Accordion"] 7188 } 7189}; 7190/** 7191 * ResponsiveAccordionTabs module. 7192 * @module foundation.responsiveAccordionTabs 7193 * @requires foundation.util.motion 7194 * @requires foundation.accordion 7195 * @requires foundation.tabs 7196 */ 7197 7198var ResponsiveAccordionTabs = 7199/*#__PURE__*/ 7200function (_Plugin) { 7201 _inherits(ResponsiveAccordionTabs, _Plugin); 7202 7203 function ResponsiveAccordionTabs() { 7204 _classCallCheck(this, ResponsiveAccordionTabs); 7205 7206 return _possibleConstructorReturn(this, _getPrototypeOf(ResponsiveAccordionTabs).apply(this, arguments)); 7207 } 7208 7209 _createClass(ResponsiveAccordionTabs, [{ 7210 key: "_setup", 7211 7212 /** 7213 * Creates a new instance of a responsive accordion tabs. 7214 * @class 7215 * @name ResponsiveAccordionTabs 7216 * @fires ResponsiveAccordionTabs#init 7217 * @param {jQuery} element - jQuery object to make into Responsive Accordion Tabs. 7218 * @param {Object} options - Overrides to the default plugin settings. 7219 */ 7220 value: function _setup(element, options) { 7221 this.$element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(element); 7222 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, this.$element.data(), options); 7223 this.rules = this.$element.data('responsive-accordion-tabs'); 7224 this.currentMq = null; 7225 this.currentPlugin = null; 7226 this.className = 'ResponsiveAccordionTabs'; // ie9 back compat 7227 7228 if (!this.$element.attr('id')) { 7229 this.$element.attr('id', Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'responsiveaccordiontabs')); 7230 } 7231 7232 ; 7233 7234 this._init(); 7235 7236 this._events(); 7237 } 7238 /** 7239 * Initializes the Menu by parsing the classes from the 'data-responsive-accordion-tabs' attribute on the element. 7240 * @function 7241 * @private 7242 */ 7243 7244 }, { 7245 key: "_init", 7246 value: function _init() { 7247 _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 7248 7249 7250 if (typeof this.rules === 'string') { 7251 var rulesTree = {}; // Parse rules from "classes" pulled from data attribute 7252 7253 var rules = this.rules.split(' '); // Iterate through every rule found 7254 7255 for (var i = 0; i < rules.length; i++) { 7256 var rule = rules[i].split('-'); 7257 var ruleSize = rule.length > 1 ? rule[0] : 'small'; 7258 var rulePlugin = rule.length > 1 ? rule[1] : rule[0]; 7259 7260 if (MenuPlugins[rulePlugin] !== null) { 7261 rulesTree[ruleSize] = MenuPlugins[rulePlugin]; 7262 } 7263 } 7264 7265 this.rules = rulesTree; 7266 } 7267 7268 this._getAllOptions(); 7269 7270 if (!jquery__WEBPACK_IMPORTED_MODULE_0___default.a.isEmptyObject(this.rules)) { 7271 this._checkMediaQueries(); 7272 } 7273 } 7274 }, { 7275 key: "_getAllOptions", 7276 value: function _getAllOptions() { 7277 //get all defaults and options 7278 var _this = this; 7279 7280 _this.allOptions = {}; 7281 7282 for (var key in MenuPlugins) { 7283 if (MenuPlugins.hasOwnProperty(key)) { 7284 var obj = MenuPlugins[key]; 7285 7286 try { 7287 var dummyPlugin = jquery__WEBPACK_IMPORTED_MODULE_0___default()('<ul></ul>'); 7288 var tmpPlugin = new obj.plugin(dummyPlugin, _this.options); 7289 7290 for (var keyKey in tmpPlugin.options) { 7291 if (tmpPlugin.options.hasOwnProperty(keyKey) && keyKey !== 'zfPlugin') { 7292 var objObj = tmpPlugin.options[keyKey]; 7293 _this.allOptions[keyKey] = objObj; 7294 } 7295 } 7296 7297 tmpPlugin.destroy(); 7298 } catch (e) {} 7299 } 7300 } 7301 } 7302 /** 7303 * Initializes events for the Menu. 7304 * @function 7305 * @private 7306 */ 7307 7308 }, { 7309 key: "_events", 7310 value: function _events() { 7311 this._changedZfMediaQueryHandler = this._checkMediaQueries.bind(this); 7312 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', this._changedZfMediaQueryHandler); 7313 } 7314 /** 7315 * 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. 7316 * @function 7317 * @private 7318 */ 7319 7320 }, { 7321 key: "_checkMediaQueries", 7322 value: function _checkMediaQueries() { 7323 var matchedMq, 7324 _this = this; // Iterate through each rule and find the last matching rule 7325 7326 7327 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.each(this.rules, function (key) { 7328 if (_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].atLeast(key)) { 7329 matchedMq = key; 7330 } 7331 }); // No match? No dice 7332 7333 if (!matchedMq) return; // Plugin already initialized? We good 7334 7335 if (this.currentPlugin instanceof this.rules[matchedMq].plugin) return; // Remove existing plugin-specific CSS classes 7336 7337 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.each(MenuPlugins, function (key, value) { 7338 _this.$element.removeClass(value.cssClass); 7339 }); // Add the CSS class for the new plugin 7340 7341 this.$element.addClass(this.rules[matchedMq].cssClass); // Create an instance of the new plugin 7342 7343 if (this.currentPlugin) {
vendor: 5,000 bytes, lines 7344-7457
7344 //don't know why but on nested elements data zfPlugin get's lost 7345 if (!this.currentPlugin.$element.data('zfPlugin') && this.storezfData) this.currentPlugin.$element.data('zfPlugin', this.storezfData); 7346 this.currentPlugin.destroy(); 7347 } 7348 7349 this._handleMarkup(this.rules[matchedMq].cssClass); 7350 7351 this.currentPlugin = new this.rules[matchedMq].plugin(this.$element, {}); 7352 this.storezfData = this.currentPlugin.$element.data('zfPlugin'); 7353 } 7354 }, { 7355 key: "_handleMarkup", 7356 value: function _handleMarkup(toSet) { 7357 var _this = this, 7358 fromString = 'accordion'; 7359 7360 var $panels = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-tabs-content=' + this.$element.attr('id') + ']'); 7361 if ($panels.length) fromString = 'tabs'; 7362 7363 if (fromString === toSet) { 7364 return; 7365 } 7366 7367 ; 7368 var tabsTitle = _this.allOptions.linkClass ? _this.allOptions.linkClass : 'tabs-title'; 7369 var tabsPanel = _this.allOptions.panelClass ? _this.allOptions.panelClass : 'tabs-panel'; 7370 this.$element.removeAttr('role'); 7371 var $liHeads = this.$element.children('.' + tabsTitle + ',[data-accordion-item]').removeClass(tabsTitle).removeClass('accordion-item').removeAttr('data-accordion-item'); 7372 var $liHeadsA = $liHeads.children('a').removeClass('accordion-title'); 7373 7374 if (fromString === 'tabs') { 7375 $panels = $panels.children('.' + tabsPanel).removeClass(tabsPanel).removeAttr('role').removeAttr('aria-hidden').removeAttr('aria-labelledby'); 7376 $panels.children('a').removeAttr('role').removeAttr('aria-controls').removeAttr('aria-selected'); 7377 } else { 7378 $panels = $liHeads.children('[data-tab-content]').removeClass('accordion-content'); 7379 } 7380 7381 ; 7382 $panels.css({ 7383 display: '', 7384 visibility: '' 7385 }); 7386 $liHeads.css({ 7387 display: '', 7388 visibility: '' 7389 }); 7390 7391 if (toSet === 'accordion') { 7392 $panels.each(function (key, value) { 7393 jquery__WEBPACK_IMPORTED_MODULE_0___default()(value).appendTo($liHeads.get(key)).addClass('accordion-content').attr('data-tab-content', '').removeClass('is-active').css({ 7394 height: '' 7395 }); 7396 jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-tabs-content=' + _this.$element.attr('id') + ']').after('<div id="tabs-placeholder-' + _this.$element.attr('id') + '"></div>').detach(); 7397 $liHeads.addClass('accordion-item').attr('data-accordion-item', ''); 7398 $liHeadsA.addClass('accordion-title'); 7399 }); 7400 } else if (toSet === 'tabs') { 7401 var $tabsContent = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-tabs-content=' + _this.$element.attr('id') + ']'); 7402 var $placeholder = jquery__WEBPACK_IMPORTED_MODULE_0___default()('#tabs-placeholder-' + _this.$element.attr('id')); 7403 7404 if ($placeholder.length) { 7405 $tabsContent = jquery__WEBPACK_IMPORTED_MODULE_0___default()('<div class="tabs-content"></div>').insertAfter($placeholder).attr('data-tabs-content', _this.$element.attr('id')); 7406 $placeholder.remove(); 7407 } else { 7408 $tabsContent = jquery__WEBPACK_IMPORTED_MODULE_0___default()('<div class="tabs-content"></div>').insertAfter(_this.$element).attr('data-tabs-content', _this.$element.attr('id')); 7409 } 7410 7411 ; 7412 $panels.each(function (key, value) { 7413 var tempValue = jquery__WEBPACK_IMPORTED_MODULE_0___default()(value).appendTo($tabsContent).addClass(tabsPanel); 7414 var hash = $liHeadsA.get(key).hash.slice(1); 7415 var id = jquery__WEBPACK_IMPORTED_MODULE_0___default()(value).attr('id') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'accordion'); 7416 7417 if (hash !== id) { 7418 if (hash !== '') { 7419 jquery__WEBPACK_IMPORTED_MODULE_0___default()(value).attr('id', hash); 7420 } else { 7421 hash = id; 7422 jquery__WEBPACK_IMPORTED_MODULE_0___default()(value).attr('id', hash); 7423 jquery__WEBPACK_IMPORTED_MODULE_0___default()($liHeadsA.get(key)).attr('href', jquery__WEBPACK_IMPORTED_MODULE_0___default()($liHeadsA.get(key)).attr('href').replace('#', '') + '#' + hash); 7424 } 7425 7426 ; 7427 } 7428 7429 ; 7430 var isActive = jquery__WEBPACK_IMPORTED_MODULE_0___default()($liHeads.get(key)).hasClass('is-active'); 7431 7432 if (isActive) { 7433 tempValue.addClass('is-active'); 7434 } 7435 7436 ; 7437 }); 7438 $liHeads.addClass(tabsTitle); 7439 } 7440 7441 ; 7442 } 7443 /** 7444 * Destroys the instance of the current plugin on this element, as well as the window resize handler that switches the plugins out. 7445 * @function 7446 */ 7447 7448 }, { 7449 key: "_destroy", 7450 value: function _destroy() { 7451 if (this.currentPlugin) this.currentPlugin.destroy(); 7452 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('changed.zf.mediaquery', this._changedZfMediaQueryHandler); 7453 } 7454 }]); 7455 7456 return ResponsiveAccordionTabs; 7457}
7457(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__["Plugin"]); 7458 7459ResponsiveAccordionTabs.defaults = {}; 7460 7461 7462/***/ }), 7463
7464/***/ "./js/foundation.responsiveMenu.js": 7465/*!*****************************************!*\ 7466 !*** ./js/foundation.responsiveMenu.js ***! 7467 \*****************************************/ 7468/*! exports provided: ResponsiveMenu */ 7469/***/ (function(module, __webpack_exports__, __webpack_require__) { 7470 7471"use strict"; 7472__webpack_require__.r(__webpack_exports__); 7473/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResponsiveMenu", function() { return ResponsiveMenu; }); 7474/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 7475/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 7476/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js"); 7477/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 7478/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 7479/* harmony import */ var _foundation_dropdownMenu__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.dropdownMenu */ "./js/foundation.dropdownMenu.js"); 7480/* harmony import */ var _foundation_drilldown__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.drilldown */ "./js/foundation.drilldown.js"); 7481/* harmony import */ var _foundation_accordionMenu__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./foundation.accordionMenu */ "./js/foundation.accordionMenu.js"); 7482 7483 7484function _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); } 7485 7486function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 7487 7488function _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); } } 7489 7490function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 7491 7492function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 7493 7494function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 7495 7496function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 7497 7498function _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); } 7499 7500function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 7501 7502 7503 7504 7505 7506 7507 7508 7509var MenuPlugins = { 7510 dropdown: { 7511 cssClass: 'dropdown', 7512 plugin: _foundation_dropdownMenu__WEBPACK_IMPORTED_MODULE_4__["DropdownMenu"] 7513 }, 7514 drilldown: { 7515 cssClass: 'drilldown', 7516 plugin: _foundation_drilldown__WEBPACK_IMPORTED_MODULE_5__["Drilldown"] 7517 }, 7518 accordion: { 7519 cssClass: 'accordion-menu', 7520 plugin: _foundation_accordionMenu__WEBPACK_IMPORTED_MODULE_6__["AccordionMenu"] 7521 } 7522}; // import "foundation.util.triggers.js"; 7523 7524/** 7525 * ResponsiveMenu module. 7526 * @module foundation.responsiveMenu 7527 * @requires foundation.util.triggers 7528 * @requires foundation.util.mediaQuery 7529 */ 7530 7531var ResponsiveMenu = 7532/*#__PURE__*/ 7533function (_Plugin) { 7534 _inherits(ResponsiveMenu, _Plugin); 7535 7536 function ResponsiveMenu() { 7537 _classCallCheck(this, ResponsiveMenu); 7538 7539 return _possibleConstructorReturn(this, _getPrototypeOf(ResponsiveMenu).apply(this, arguments)); 7540 } 7541 7542 _createClass(ResponsiveMenu, [{ 7543 key: "_setup", 7544 7545 /** 7546 * Creates a new instance of a responsive menu. 7547 * @class 7548 * @name ResponsiveMenu 7549 * @fires ResponsiveMenu#init 7550 * @param {jQuery} element - jQuery object to make into a dropdown menu. 7551 * @param {Object} options - Overrides to the default plugin settings. 7552 */ 7553 value: function _setup(element, options) { 7554 this.$element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(element); 7555 this.rules = this.$element.data('responsive-menu'); 7556 this.currentMq = null; 7557 this.currentPlugin = null; 7558 this.className = 'ResponsiveMenu'; // ie9 back compat 7559 7560 this._init(); 7561 7562 this._events(); 7563 } 7564 /** 7565 * Initializes the Menu by parsing the classes from the 'data-ResponsiveMenu' attribute on the element. 7566 * @function 7567 * @private 7568 */ 7569 7570 }, { 7571 key: "_init", 7572 value: function _init() { 7573 _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 7574 7575 7576 if (typeof this.rules === 'string') { 7577 var rulesTree = {}; // Parse rules from "classes" pulled from data attribute 7578 7579 var rules = this.rules.split(' '); // Iterate through every rule found 7580 7581 for (var i = 0; i < rules.length; i++) { 7582 var rule = rules[i].split('-'); 7583 var ruleSize = rule.length > 1 ? rule[0] : 'small'; 7584 var rulePlugin = rule.length > 1 ? rule[1] : rule[0]; 7585 7586 if (MenuPlugins[rulePlugin] !== null) { 7587 rulesTree[ruleSize] = MenuPlugins[rulePlugin]; 7588 } 7589 } 7590 7591 this.rules = rulesTree; 7592 } 7593 7594 if (!jquery__WEBPACK_IMPORTED_MODULE_0___default.a.isEmptyObject(this.rules)) { 7595 this._checkMediaQueries(); 7596 } // Add data-mutate since children may need it. 7597 7598 7599 this.$element.attr('data-mutate', this.$element.attr('data-mutate') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'responsive-menu')); 7600 } 7601 /** 7602 * Initializes events for the Menu. 7603 * @function 7604 * @private 7605 */ 7606 7607 }, { 7608 key: "_events", 7609 value: function _events() { 7610 var _this = this; 7611 7612 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', function () { 7613 _this._checkMediaQueries(); 7614 }); // $(window).on('resize.zf.ResponsiveMenu', function() { 7615 // _this._checkMediaQueries(); 7616 // }); 7617 } 7618 /** 7619 * 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. 7620 * @function 7621 * @private 7622 */ 7623 7624 }, { 7625 key: "_checkMediaQueries", 7626 value: function _checkMediaQueries() { 7627 var matchedMq, 7628 _this = this; // Iterate through each rule and find the last matching rule 7629 7630 7631 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.each(this.rules, function (key) { 7632 if (_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].atLeast(key)) { 7633 matchedMq = key; 7634 } 7635 }); // No match? No dice 7636 7637 if (!matchedMq) return; // Plugin already initialized? We good 7638 7639 if (this.currentPlugin instanceof this.rules[matchedMq].plugin) return; // Remove existing plugin-specific CSS classes 7640 7641 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.each(MenuPlugins, function (key, value) { 7642 _this.$element.removeClass(value.cssClass); 7643 }); // Add the CSS class for the new plugin 7644 7645 this.$element.addClass(this.rules[matchedMq].cssClass); // Create an instance of the new plugin 7646 7647 if (this.currentPlugin) this.currentPlugin.destroy(); 7648 this.currentPlugin = new this.rules[matchedMq].plugin(this.$element, {}); 7649 } 7650 /** 7651 * Destroys the instance of the current plugin on this element, as well as the window resize handler that switches the plugins out. 7652 * @function 7653 */ 7654 7655 }, { 7656 key: "_destroy", 7657 value: function _destroy() { 7658 this.currentPlugin.destroy(); 7659 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('.zf.ResponsiveMenu'); 7660 } 7661 }]); 7662 7663 return ResponsiveMenu; 7664}
7664(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__["Plugin"]); 7665 7666ResponsiveMenu.defaults = {}; 7667 7668 7669/***/ }), 7670
7671/***/ "./js/foundation.responsiveToggle.js": 7672/*!*******************************************!*\ 7673 !*** ./js/foundation.responsiveToggle.js ***! 7674 \*******************************************/ 7675/*! exports provided: ResponsiveToggle */ 7676/***/ (function(module, __webpack_exports__, __webpack_require__) { 7677 7678"use strict"; 7679__webpack_require__.r(__webpack_exports__); 7680/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResponsiveToggle", function() { return ResponsiveToggle; }); 7681/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 7682/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 7683/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js"); 7684/* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.motion */ "./js/foundation.util.motion.js"); 7685/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 7686 7687 7688function _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); } 7689 7690function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 7691 7692function _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); } } 7693 7694function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 7695 7696function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 7697 7698function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 7699 7700function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 7701 7702function _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); } 7703 7704function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 7705 7706 7707 7708 7709 7710/** 7711 * ResponsiveToggle module. 7712 * @module foundation.responsiveToggle 7713 * @requires foundation.util.mediaQuery 7714 * @requires foundation.util.motion 7715 */ 7716 7717var ResponsiveToggle = 7718/*#__PURE__*/ 7719function (_Plugin) { 7720 _inherits(ResponsiveToggle, _Plugin); 7721 7722 function ResponsiveToggle() { 7723 _classCallCheck(this, ResponsiveToggle); 7724 7725 return _possibleConstructorReturn(this, _getPrototypeOf(ResponsiveToggle).apply(this, arguments)); 7726 } 7727 7728 _createClass(ResponsiveToggle, [{ 7729 key: "_setup", 7730 7731 /** 7732 * Creates a new instance of Tab Bar. 7733 * @class 7734 * @name ResponsiveToggle 7735 * @fires ResponsiveToggle#init 7736 * @param {jQuery} element - jQuery object to attach tab bar functionality to. 7737 * @param {Object} options - Overrides to the default plugin settings. 7738 */ 7739 value: function _setup(element, options) { 7740 this.$element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(element); 7741 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, ResponsiveToggle.defaults, this.$element.data(), options); 7742 this.className = 'ResponsiveToggle'; // ie9 back compat 7743 7744 this._init(); 7745 7746 this._events(); 7747 } 7748 /** 7749 * Initializes the tab bar by finding the target element, toggling element, and running update(). 7750 * @function 7751 * @private 7752 */ 7753 7754 }, { 7755 key: "_init", 7756 value: function _init() { 7757 _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"]._init(); 7758 7759 var targetID = this.$element.data('responsive-toggle'); 7760 7761 if (!targetID) { 7762 console.error('Your tab bar needs an ID of a Menu as the value of data-tab-bar.'); 7763 } 7764 7765 this.$targetMenu = jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(targetID)); 7766 this.$toggler = this.$element.find('[data-toggle]').filter(function () { 7767 var target = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('toggle'); 7768 return target === targetID || target === ""; 7769 }); 7770 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, this.options, this.$targetMenu.data()); // If they were set, parse the animation classes 7771 7772 if (this.options.animate) { 7773 var input = this.options.animate.split(' '); 7774 this.animationIn = input[0]; 7775 this.animationOut = input[1] || null; 7776 } 7777 7778 this._update(); 7779 } 7780 /** 7781 * Adds necessary event handlers for the tab bar to work. 7782 * @function 7783 * @private 7784 */ 7785 7786 }, { 7787 key: "_events", 7788 value: function _events() { 7789 var _this = this; 7790 7791 this._updateMqHandler = this._update.bind(this); 7792 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', this._updateMqHandler); 7793 this.$toggler.on('click.zf.responsiveToggle', this.toggleMenu.bind(this)); 7794 } 7795 /** 7796 * Checks the current media query to determine if the tab bar should be visible or hidden. 7797 * @function 7798 * @private 7799 */ 7800 7801 }, { 7802 key: "_update", 7803 value: function _update() { 7804 // Mobile 7805 if (!_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].atLeast(this.options.hideFor)) { 7806 this.$element.show(); 7807 this.$targetMenu.hide(); 7808 } // Desktop 7809 else { 7810 this.$element.hide(); 7811 this.$targetMenu.show(); 7812 } 7813 } 7814 /** 7815 * Toggles the element attached to the tab bar. The toggle only happens if the screen is small enough to allow it. 7816 * @function 7817 * @fires ResponsiveToggle#toggled 7818 */ 7819 7820 }, { 7821 key: "toggleMenu", 7822 value: function toggleMenu() { 7823 var _this2 = this; 7824 7825 if (!_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].atLeast(this.options.hideFor)) { 7826 /** 7827 * Fires when the element attached to the tab bar toggles. 7828 * @event ResponsiveToggle#toggled 7829 */ 7830 if (this.options.animate) { 7831 if (this.$targetMenu.is(':hidden')) { 7832 _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Motion"].animateIn(this.$targetMenu, this.animationIn, function () { 7833 _this2.$element.trigger('toggled.zf.responsiveToggle'); 7834 7835 _this2.$targetMenu.find('[data-mutate]').triggerHandler('mutateme.zf.trigger'); 7836 }); 7837 } else { 7838 _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Motion"].animateOut(this.$targetMenu, this.animationOut, function () { 7839 _this2.$element.trigger('toggled.zf.responsiveToggle'); 7840 }); 7841 } 7842 } else { 7843 this.$targetMenu.toggle(0); 7844 this.$targetMenu.find('[data-mutate]').trigger('mutateme.zf.trigger'); 7845 this.$element.trigger('toggled.zf.responsiveToggle'); 7846 } 7847 } 7848 } 7849 }, { 7850 key: "_destroy", 7851 value: function _destroy() { 7852 this.$element.off('.zf.responsiveToggle'); 7853 this.$toggler.off('.zf.responsiveToggle'); 7854 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('changed.zf.mediaquery', this._updateMqHandler); 7855 } 7856 }]); 7857 7858 return ResponsiveToggle; 7859}
7859(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__["Plugin"]); 7860 7861ResponsiveToggle.defaults = { 7862 /** 7863 * The breakpoint after which the menu is always shown, and the tab bar is hidden. 7864 * @option 7865 * @type {string} 7866 * @default 'medium' 7867 */ 7868 hideFor: 'medium', 7869 7870 /** 7871 * To decide if the toggle should be animated or not. 7872 * @option 7873 * @type {boolean} 7874 * @default false 7875 */ 7876 animate: false 7877}; 7878 7879 7880/***/ }), 7881
7882/***/ "./js/foundation.reveal.js": 7883/*!*********************************!*\ 7884 !*** ./js/foundation.reveal.js ***! 7885 \*********************************/ 7886/*! exports provided: Reveal */ 7887/***/ (function(module, __webpack_exports__, __webpack_require__) { 7888 7889"use strict"; 7890__webpack_require__.r(__webpack_exports__); 7891/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Reveal", function() { return Reveal; }); 7892/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 7893/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 7894/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 7895/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js"); 7896/* harmony
vendor: 4,701 bytes, lines 7896-7985
7896import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js"); 7897/* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.motion */ "./js/foundation.util.motion.js"); 7898/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 7899/* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js"); 7900/* harmony import */ var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./foundation.util.touch */ "./js/foundation.util.touch.js"); 7901 7902 7903function _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); } 7904 7905function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 7906 7907function _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); } } 7908 7909function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 7910 7911function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 7912 7913function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 7914 7915function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 7916 7917function _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); } 7918 7919function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929/** 7930 * Reveal module. 7931 * @module foundation.reveal 7932 * @requires foundation.util.keyboard 7933 * @requires foundation.util.triggers 7934 * @requires foundation.util.mediaQuery 7935 * @requires foundation.util.motion if using animations 7936 */ 7937 7938var Reveal = 7939/*#__PURE__*/ 7940function (_Plugin) { 7941 _inherits(Reveal, _Plugin); 7942 7943 function Reveal() { 7944 _classCallCheck(this, Reveal); 7945 7946 return _possibleConstructorReturn(this, _getPrototypeOf(Reveal).apply(this, arguments)); 7947 } 7948 7949 _createClass(Reveal, [{ 7950 key: "_setup", 7951 7952 /** 7953 * Creates a new instance of Reveal. 7954 * @class 7955 * @name Reveal 7956 * @param {jQuery} element - jQuery object to use for the modal. 7957 * @param {Object} options - optional parameters. 7958 */ 7959 value: function _setup(element, options) { 7960 this.$element = element; 7961 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Reveal.defaults, this.$element.data(), options); 7962 this.className = 'Reveal'; // ie9 back compat 7963 7964 this._init(); // Triggers init is idempotent, just need to make sure it is initialized 7965 7966 7967 _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_6__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 7968 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].register('Reveal', { 7969 'ESCAPE': 'close' 7970 }); 7971 } 7972 /** 7973 * Initializes the modal by adding the overlay and close buttons, (if selected). 7974 * @private 7975 */ 7976 7977 }, { 7978 key: "_init", 7979 value: function _init() { 7980 var _this2 = this; 7981 7982 _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_3__["MediaQuery"]._init(); 7983 7984 this.id = this.$element.attr('id'); 7985 this.isActive = false;
vendor: 20,450 bytes, lines 7986-8640
7986 this.cached = { 7987 mq: _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_3__["MediaQuery"].current 7988 }; 7989 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, "\"]")); 7990 this.$anchor.attr({ 7991 'aria-controls': this.id, 7992 'aria-haspopup': true, 7993 'tabindex': 0 7994 }); 7995 7996 if (this.options.fullScreen || this.$element.hasClass('full')) { 7997 this.options.fullScreen = true; 7998 this.options.overlay = false; 7999 } 8000 8001 if (this.options.overlay && !this.$overlay) { 8002 this.$overlay = this._makeOverlay(this.id); 8003 } 8004 8005 this.$element.attr({ 8006 'role': 'dialog', 8007 'aria-hidden': true, 8008 'data-yeti-box': this.id, 8009 'data-resize': this.id 8010 }); 8011 8012 if (this.$overlay) { 8013 this.$element.detach().appendTo(this.$overlay); 8014 } else { 8015 this.$element.detach().appendTo(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.options.appendTo)); 8016 this.$element.addClass('without-overlay'); 8017 } 8018 8019 this._events(); 8020 8021 if (this.options.deepLink && window.location.hash === "#".concat(this.id)) { 8022 this.onLoadListener = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () { 8023 return _this2.open(); 8024 }); 8025 } 8026 } 8027 /** 8028 * Creates an overlay div to display behind the modal. 8029 * @private 8030 */ 8031 8032 }, { 8033 key: "_makeOverlay", 8034 value: function _makeOverlay() { 8035 var additionalOverlayClasses = ''; 8036 8037 if (this.options.additionalOverlayClasses) { 8038 additionalOverlayClasses = ' ' + this.options.additionalOverlayClasses; 8039 } 8040 8041 return jquery__WEBPACK_IMPORTED_MODULE_0___default()('<div></div>').addClass('reveal-overlay' + additionalOverlayClasses).appendTo(this.options.appendTo); 8042 } 8043 /** 8044 * Updates position of modal 8045 * TODO: Figure out if we actually need to cache these values or if it doesn't matter 8046 * @private 8047 */ 8048 8049 }, { 8050 key: "_updatePosition", 8051 value: function _updatePosition() { 8052 var width = this.$element.outerWidth(); 8053 var outerWidth = jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).width(); 8054 var height = this.$element.outerHeight(); 8055 var outerHeight = jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).height(); 8056 var left, 8057 top = null; 8058 8059 if (this.options.hOffset === 'auto') { 8060 left = parseInt((outerWidth - width) / 2, 10); 8061 } else { 8062 left = parseInt(this.options.hOffset, 10); 8063 } 8064 8065 if (this.options.vOffset === 'auto') { 8066 if (height > outerHeight) { 8067 top = parseInt(Math.min(100, outerHeight / 10), 10); 8068 } else { 8069 top = parseInt((outerHeight - height) / 4, 10); 8070 } 8071 } else if (this.options.vOffset !== null) { 8072 top = parseInt(this.options.vOffset, 10); 8073 } 8074 8075 if (top !== null) { 8076 this.$element.css({ 8077 top: top + 'px' 8078 }); 8079 } // only worry about left if we don't have an overlay or we have a horizontal offset, 8080 // otherwise we're perfectly in the middle 8081 8082 8083 if (!this.$overlay || this.options.hOffset !== 'auto') { 8084 this.$element.css({ 8085 left: left + 'px' 8086 }); 8087 this.$element.css({ 8088 margin: '0px' 8089 }); 8090 } 8091 } 8092 /** 8093 * Adds event handlers for the modal. 8094 * @private 8095 */ 8096 8097 }, { 8098 key: "_events", 8099 value: function _events() { 8100 var _this3 = this; 8101 8102 var _this = this; 8103 8104 this.$element.on({ 8105 'open.zf.trigger': this.open.bind(this), 8106 'close.zf.trigger': function closeZfTrigger(event, $element) { 8107 if (event.target === _this.$element[0] || jquery__WEBPACK_IMPORTED_MODULE_0___default()(event.target).parents('[data-closable]')[0] === $element) { 8108 // only close reveal when it's explicitly called 8109 return _this3.close.apply(_this3); 8110 } 8111 }, 8112 'toggle.zf.trigger': this.toggle.bind(this), 8113 'resizeme.zf.trigger': function resizemeZfTrigger() { 8114 _this._updatePosition(); 8115 } 8116 }); 8117 8118 if (this.options.closeOnClick && this.options.overlay) { 8119 this.$overlay.off('.zf.reveal').on('click.zf.reveal', function (e) { 8120 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)) { 8121 return; 8122 } 8123 8124 _this.close(); 8125 }); 8126 } 8127 8128 if (this.options.deepLink) { 8129 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on("hashchange.zf.reveal:".concat(this.id), this._handleState.bind(this)); 8130 } 8131 } 8132 /** 8133 * Handles modal methods on back/forward button clicks or any other event that triggers hashchange. 8134 * @private 8135 */ 8136 8137 }, { 8138 key: "_handleState", 8139 value: function _handleState(e) { 8140 if (window.location.hash === '#' + this.id && !this.isActive) { 8141 this.open(); 8142 } else { 8143 this.close(); 8144 } 8145 } 8146 /** 8147 * Disables the scroll when Reveal is shown to prevent the background from shifting 8148 * @param {number} scrollTop - Scroll to visually apply, window current scroll by default 8149 */ 8150 8151 }, { 8152 key: "_disableScroll", 8153 value: function _disableScroll(scrollTop) { 8154 scrollTop = scrollTop || jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).scrollTop(); 8155 8156 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).height() > jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).height()) { 8157 jquery__WEBPACK_IMPORTED_MODULE_0___default()("html").css("top", -scrollTop); 8158 } 8159 } 8160 /** 8161 * Reenables the scroll when Reveal closes 8162 * @param {number} scrollTop - Scroll to restore, html "top" property by default (as set by `_disableScroll`) 8163 */ 8164 8165 }, { 8166 key: "_enableScroll", 8167 value: function _enableScroll(scrollTop) { 8168 scrollTop = scrollTop || parseInt(jquery__WEBPACK_IMPORTED_MODULE_0___default()("html").css("top")); 8169 8170 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).height() > jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).height()) { 8171 jquery__WEBPACK_IMPORTED_MODULE_0___default()("html").css("top", ""); 8172 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).scrollTop(-scrollTop); 8173 } 8174 } 8175 /** 8176 * Opens the modal controlled by `this.$anchor`, and closes all others by default. 8177 * @function 8178 * @fires Reveal#closeme 8179 * @fires Reveal#open 8180 */ 8181 8182 }, { 8183 key: "open", 8184 value: function open() { 8185 var _this4 = this; 8186 8187 // either update or replace browser history 8188 var hash = "#".concat(this.id); 8189 8190 if (this.options.deepLink && window.location.hash !== hash) { 8191 if (window.history.pushState) { 8192 if (this.options.updateHistory) { 8193 window.history.pushState({}, '', hash); 8194 } else { 8195 window.history.replaceState({}, '', hash); 8196 } 8197 } else { 8198 window.location.hash = hash; 8199 } 8200 } // Remember anchor that opened it to set focus back later, have general anchors as fallback 8201 8202 8203 this.$activeAnchor = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.activeElement).is(this.$anchor) ? jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.activeElement) : this.$anchor; 8204 this.isActive = true; // Make elements invisible, but remove display: none so we can get size and positioning 8205 8206 this.$element.css({ 8207 'visibility': 'hidden' 8208 }).show().scrollTop(0); 8209 8210 if (this.options.overlay) { 8211 this.$overlay.css({ 8212 'visibility': 'hidden' 8213 }).show(); 8214 } 8215 8216 this._updatePosition(); 8217 8218 this.$element.hide().css({ 8219 'visibility': '' 8220 }); 8221 8222 if (this.$overlay) { 8223 this.$overlay.css({ 8224 'visibility': '' 8225 }).hide(); 8226 8227 if (this.$element.hasClass('fast')) { 8228 this.$overlay.addClass('fast'); 8229 } else if (this.$element.hasClass('slow')) { 8230 this.$overlay.addClass('slow'); 8231 } 8232 } 8233 8234 if (!this.options.multipleOpened) { 8235 /** 8236 * Fires immediately before the modal opens. 8237 * Closes any other modals that are currently open 8238 * @event Reveal#closeme 8239 */ 8240 this.$element.trigger('closeme.zf.reveal', this.id); 8241 } 8242 8243 this._disableScroll(); 8244 8245 var _this = this; // Motion UI method of reveal 8246 8247 8248 if (this.options.animationIn) { 8249 var afterAnimation = function afterAnimation() { 8250 _this.$element.attr({ 8251 'aria-hidden': false, 8252 'tabindex': -1 8253 }).focus(); 8254 8255 _this._addGlobalClasses(); 8256 8257 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].trapFocus(_this.$element); 8258 }; 8259 8260 if (this.options.overlay) { 8261 _foundation_util_motion__WEBPACK_IMPORTED_MODULE_4__["Motion"].animateIn(this.$overlay, 'fade-in'); 8262 } 8263 8264 _foundation_util_motion__WEBPACK_IMPORTED_MODULE_4__["Motion"].animateIn(this.$element, this.options.animationIn, function () { 8265 if (_this4.$element) { 8266 // protect against object having been removed 8267 _this4.focusableElements = _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].findFocusable(_this4.$element); 8268 afterAnimation(); 8269 } 8270 }); 8271 } // jQuery method of reveal 8272 else { 8273 if (this.options.overlay) { 8274 this.$overlay.show(0); 8275 } 8276 8277 this.$element.show(this.options.showDelay); 8278 } // handle accessibility 8279 8280 8281 this.$element.attr({ 8282 'aria-hidden': false, 8283 'tabindex': -1 8284 }).focus(); 8285 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].trapFocus(this.$element); 8286 8287 this._addGlobalClasses(); 8288 8289 this._addGlobalListeners(); 8290 /** 8291 * Fires when the modal has successfully opened. 8292 * @event Reveal#open 8293 */ 8294 8295 8296 this.$element.trigger('open.zf.reveal'); 8297 } 8298 /** 8299 * Adds classes and listeners on document required by open modals. 8300 * 8301 * The following classes are added and updated: 8302 * - `.is-reveal-open` - Prevents the scroll on document 8303 * - `.zf-has-scroll` - Displays a disabled scrollbar on document if required like if the 8304 * scroll was not disabled. This prevent a "shift" of the page content due 8305 * the scrollbar disappearing when the modal opens. 8306 * 8307 * @private 8308 */ 8309 8310 }, { 8311 key: "_addGlobalClasses", 8312 value: function _addGlobalClasses() { 8313 var updateScrollbarClass = function updateScrollbarClass() { 8314 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())); 8315 }; 8316 8317 this.$element.on('resizeme.zf.trigger.revealScrollbarListener', function () { 8318 return updateScrollbarClass(); 8319 }); 8320 updateScrollbarClass(); 8321 jquery__WEBPACK_IMPORTED_MODULE_0___default()('html').addClass('is-reveal-open'); 8322 } 8323 /** 8324 * Removes classes and listeners on document that were required by open modals. 8325 * @private 8326 */ 8327 8328 }, { 8329 key: "_removeGlobalClasses", 8330 value: function _removeGlobalClasses() { 8331 this.$element.off('resizeme.zf.trigger.revealScrollbarListener'); 8332 jquery__WEBPACK_IMPORTED_MODULE_0___default()('html').removeClass('is-reveal-open'); 8333 jquery__WEBPACK_IMPORTED_MODULE_0___default()('html').removeClass('zf-has-scroll'); 8334 } 8335 /** 8336 * Adds extra event handlers for the body and window if necessary. 8337 * @private 8338 */ 8339 8340 }, { 8341 key: "_addGlobalListeners", 8342 value: function _addGlobalListeners() { 8343 var _this = this; 8344 8345 if (!this.$element) { 8346 return; 8347 } // If we're in the middle of cleanup, don't freak out 8348 8349 8350 this.focusableElements = _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].findFocusable(this.$element); 8351 8352 if (!this.options.overlay && this.options.closeOnClick && !this.options.fullScreen) { 8353 jquery__WEBPACK_IMPORTED_MODULE_0___default()('body').on('click.zf.reveal', function (e) { 8354 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)) { 8355 return; 8356 } 8357 8358 _this.close(); 8359 }); 8360 } 8361 8362 if (this.options.closeOnEsc) { 8363 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('keydown.zf.reveal', function (e) { 8364 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].handleKey(e, 'Reveal', { 8365 close: function close() { 8366 if (_this.options.closeOnEsc) { 8367 _this.close(); 8368 } 8369 } 8370 }); 8371 }); 8372 } 8373 } 8374 /** 8375 * Closes the modal. 8376 * @function 8377 * @fires Reveal#closed 8378 */ 8379 8380 }, { 8381 key: "close", 8382 value: function close() { 8383 if (!this.isActive || !this.$element.is(':visible')) { 8384 return false; 8385 } 8386 8387 var _this = this; // Motion UI method of hiding 8388 8389 8390 if (this.options.animationOut) { 8391 if (this.options.overlay) { 8392 _foundation_util_motion__WEBPACK_IMPORTED_MODULE_4__["Motion"].animateOut(this.$overlay, 'fade-out'); 8393 } 8394 8395 _foundation_util_motion__WEBPACK_IMPORTED_MODULE_4__["Motion"].animateOut(this.$element, this.options.animationOut, finishUp); 8396 } // jQuery method of hiding 8397 else { 8398 this.$element.hide(this.options.hideDelay); 8399 8400 if (this.options.overlay) { 8401 this.$overlay.hide(0, finishUp); 8402 } else { 8403 finishUp(); 8404 } 8405 } // Conditionals to remove extra event listeners added on open 8406 8407 8408 if (this.options.closeOnEsc) { 8409 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('keydown.zf.reveal'); 8410 } 8411 8412 if (!this.options.overlay && this.options.closeOnClick) { 8413 jquery__WEBPACK_IMPORTED_MODULE_0___default()('body').off('click.zf.reveal'); 8414 } 8415 8416 this.$element.off('keydown.zf.reveal'); 8417 8418 function finishUp() { 8419 // Get the current top before the modal is closed and restore the scroll after. 8420 // TODO: use component properties instead of HTML properties 8421 // See https://github.com/zurb/foundation-sites/pull/10786 8422 var scrollTop = parseInt(jquery__WEBPACK_IMPORTED_MODULE_0___default()("html").css("top")); 8423 8424 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()('.reveal:visible').length === 0) { 8425 _this._removeGlobalClasses(); // also remove .is-reveal-open from the html element when there is no opened reveal 8426 8427 } 8428 8429 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].releaseFocus(_this.$element); 8430 8431 _this.$element.attr('aria-hidden', true); 8432 8433 _this._enableScroll(scrollTop); 8434 /** 8435 * Fires when the modal is done closing. 8436 * @event Reveal#closed 8437 */ 8438 8439 8440 _this.$element.trigger('closed.zf.reveal'); 8441 } 8442 /** 8443 * Resets the modal content 8444 * This prevents a running video to keep going in the background 8445 */ 8446 8447 8448 if (this.options.resetOnClose) { 8449 this.$element.html(this.$element.html()); 8450 } 8451 8452 this.isActive = false; // If deepLink and we did not switched to an other modal... 8453 8454 if (_this.options.deepLink && window.location.hash === "#".concat(this.id)) { 8455 // Remove the history hash 8456 if (window.history.replaceState) { 8457 var urlWithoutHash = window.location.pathname + window.location.search; 8458 8459 if (this.options.updateHistory) { 8460 window.history.pushState({}, '', urlWithoutHash); // remove the hash 8461 } else { 8462 window.history.replaceState('', document.title, urlWithoutHash); 8463 } 8464 } else { 8465 window.location.hash = ''; 8466 } 8467 } 8468 8469 this.$activeAnchor.focus(); 8470 } 8471 /** 8472 * Toggles the open/closed state of a modal. 8473 * @function 8474 */ 8475 8476 }, { 8477 key: "toggle", 8478 value: function toggle() { 8479 if (this.isActive) { 8480 this.close(); 8481 } else { 8482 this.open(); 8483 } 8484 } 8485 }, { 8486 key: "_destroy", 8487 8488 /** 8489 * Destroys an instance of a modal. 8490 * @function 8491 */ 8492 value: function _destroy() { 8493 if (this.options.overlay) { 8494 this.$element.appendTo(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.options.appendTo)); // move $element outside of $overlay to prevent error unregisterPlugin() 8495 8496 this.$overlay.hide().off().remove(); 8497 } 8498 8499 this.$element.hide().off(); 8500 this.$anchor.off('.zf'); 8501 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(".zf.reveal:".concat(this.id)); 8502 if (this.onLoadListener) jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(this.onLoadListener); 8503 8504 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()('.reveal:visible').length === 0) { 8505 this._removeGlobalClasses(); // also remove .is-reveal-open from the html element when there is no opened reveal 8506 8507 } 8508 } 8509 }]); 8510 8511 return Reveal; 8512}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_5__["Plugin"]); 8513 8514Reveal.defaults = { 8515 /** 8516 * Motion-UI class to use for animated elements. If none used, defaults to simple show/hide. 8517 * @option 8518 * @type {string} 8519 * @default '' 8520 */ 8521 animationIn: '', 8522 8523 /** 8524 * Motion-UI class to use for animated elements. If none used, defaults to simple show/hide. 8525 * @option 8526 * @type {string} 8527 * @default '' 8528 */ 8529 animationOut: '', 8530 8531 /** 8532 * Time, in ms, to delay the opening of a modal after a click if no animation used. 8533 * @option 8534 * @type {number} 8535 * @default 0 8536 */ 8537 showDelay: 0, 8538 8539 /** 8540 * Time, in ms, to delay the closing of a modal after a click if no animation used. 8541 * @option 8542 * @type {number} 8543 * @default 0 8544 */ 8545 hideDelay: 0, 8546 8547 /** 8548 * Allows a click on the body/overlay to close the modal. 8549 * @option 8550 * @type {boolean} 8551 * @default true 8552 */ 8553 closeOnClick: true, 8554 8555 /** 8556 * Allows the modal to close if the user presses the `ESCAPE` key. 8557 * @option 8558 * @type {boolean} 8559 * @default true 8560 */ 8561 closeOnEsc: true, 8562 8563 /** 8564 * If true, allows multiple modals to be displayed at once. 8565 * @option 8566 * @type {boolean} 8567 * @default false 8568 */ 8569 multipleOpened: false, 8570 8571 /** 8572 * Distance, in pixels, the modal should push down from the top of the screen. 8573 * @option 8574 * @type {number|string} 8575 * @default auto 8576 */ 8577 vOffset: 'auto', 8578 8579 /** 8580 * Distance, in pixels, the modal should push in from the side of the screen. 8581 * @option 8582 * @type {number|string} 8583 * @default auto 8584 */ 8585 hOffset: 'auto', 8586 8587 /** 8588 * Allows the modal to be fullscreen, completely blocking out the rest of the view. JS checks for this as well. 8589 * @option 8590 * @type {boolean} 8591 * @default false 8592 */ 8593 fullScreen: false, 8594 8595 /** 8596 * Allows the modal to generate an overlay div, which will cover the view when modal opens. 8597 * @option 8598 * @type {boolean} 8599 * @default true 8600 */ 8601 overlay: true, 8602 8603 /** 8604 * 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. 8605 * @option 8606 * @type {boolean} 8607 * @default false 8608 */ 8609 resetOnClose: false, 8610 8611 /** 8612 * Link the location hash to the modal. 8613 * Set the location hash when the modal is opened/closed, and open/close the modal when the location changes. 8614 * @option 8615 * @type {boolean} 8616 * @default false 8617 */ 8618 deepLink: false, 8619 8620 /** 8621 * If `deepLink` is enabled, update the browser history with the open modal 8622 * @option 8623 * @default false 8624 */ 8625 updateHistory: false, 8626 8627 /** 8628 * Allows the modal to append to custom div. 8629 * @option 8630 * @type {string} 8631 * @default "body" 8632 */ 8633 appendTo: "body", 8634 8635 /** 8636 * Allows adding additional class names to the reveal overlay. 8637 * @option 8638 * @type {string} 8639 * @default '' 8640 */
8641 additionalOverlayClasses: '' 8642}; 8643 8644 8645/***/ }), 8646
vendor: 4,940 bytes, lines 8647-8726
8647/***/ "./js/foundation.slider.js": 8648/*!*********************************!*\ 8649 !*** ./js/foundation.slider.js ***! 8650 \*********************************/ 8651/*! exports provided: Slider */ 8652/***/ (function(module, __webpack_exports__, __webpack_require__) { 8653 8654"use strict"; 8655__webpack_require__.r(__webpack_exports__); 8656/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Slider", function() { return Slider; }); 8657/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 8658/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 8659/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js"); 8660/* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.motion */ "./js/foundation.util.motion.js"); 8661/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 8662/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 8663/* harmony import */ var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.util.touch */ "./js/foundation.util.touch.js"); 8664/* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js"); 8665 8666 8667function _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); } 8668 8669function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 8670 8671function _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); } } 8672 8673function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 8674 8675function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 8676 8677function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 8678 8679function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 8680 8681function _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); } 8682 8683function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 8684 8685 8686 8687 8688 8689 8690 8691 8692/** 8693 * Slider module. 8694 * @module foundation.slider 8695 * @requires foundation.util.motion 8696 * @requires foundation.util.triggers 8697 * @requires foundation.util.keyboard 8698 * @requires foundation.util.touch 8699 */ 8700 8701var Slider = 8702/*#__PURE__*/ 8703function (_Plugin) { 8704 _inherits(Slider, _Plugin); 8705 8706 function Slider() { 8707 _classCallCheck(this, Slider); 8708 8709 return _possibleConstructorReturn(this, _getPrototypeOf(Slider).apply(this, arguments)); 8710 } 8711 8712 _createClass(Slider, [{ 8713 key: "_setup", 8714 8715 /** 8716 * Creates a new instance of a slider control. 8717 * @class 8718 * @name Slider 8719 * @param {jQuery} element - jQuery object to make into a slider control. 8720 * @param {Object} options - Overrides to the default plugin settings. 8721 */ 8722 value: function _setup(element, options) { 8723 this.$element = element; 8724 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Slider.defaults, this.$element.data(), options); 8725 this.className = 'Slider'; // ie9 back compat 8726 // Touch and Triggers inits are idempotent, we just need to make sure it's initialied.
vendor: 6,269 bytes, lines 8727-8917
8727 8728 _foundation_util_touch__WEBPACK_IMPORTED_MODULE_5__["Touch"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 8729 _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_6__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 8730 8731 this._init(); 8732 8733 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].register('Slider', { 8734 'ltr': { 8735 'ARROW_RIGHT': 'increase', 8736 'ARROW_UP': 'increase', 8737 'ARROW_DOWN': 'decrease', 8738 'ARROW_LEFT': 'decrease', 8739 'SHIFT_ARROW_RIGHT': 'increase_fast', 8740 'SHIFT_ARROW_UP': 'increase_fast', 8741 'SHIFT_ARROW_DOWN': 'decrease_fast', 8742 'SHIFT_ARROW_LEFT': 'decrease_fast', 8743 'HOME': 'min', 8744 'END': 'max' 8745 }, 8746 'rtl': { 8747 'ARROW_LEFT': 'increase', 8748 'ARROW_RIGHT': 'decrease', 8749 'SHIFT_ARROW_LEFT': 'increase_fast', 8750 'SHIFT_ARROW_RIGHT': 'decrease_fast' 8751 } 8752 }); 8753 } 8754 /** 8755 * Initilizes the plugin by reading/setting attributes, creating collections and setting the initial position of the handle(s). 8756 * @function 8757 * @private 8758 */ 8759 8760 }, { 8761 key: "_init", 8762 value: function _init() { 8763 this.inputs = this.$element.find('input'); 8764 this.handles = this.$element.find('[data-slider-handle]'); 8765 this.$handle = this.handles.eq(0); 8766 this.$input = this.inputs.length ? this.inputs.eq(0) : jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(this.$handle.attr('aria-controls'))); 8767 this.$fill = this.$element.find('[data-slider-fill]').css(this.options.vertical ? 'height' : 'width', 0); 8768 8769 var isDbl = false, 8770 _this = this; 8771 8772 if (this.options.disabled || this.$element.hasClass(this.options.disabledClass)) { 8773 this.options.disabled = true; 8774 this.$element.addClass(this.options.disabledClass); 8775 } 8776 8777 if (!this.inputs.length) { 8778 this.inputs = jquery__WEBPACK_IMPORTED_MODULE_0___default()().add(this.$input); 8779 this.options.binding = true; 8780 } 8781 8782 this._setInitAttr(0); 8783 8784 if (this.handles[1]) { 8785 this.options.doubleSided = true; 8786 this.$handle2 = this.handles.eq(1); 8787 this.$input2 = this.inputs.length > 1 ? this.inputs.eq(1) : jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(this.$handle2.attr('aria-controls'))); 8788 8789 if (!this.inputs[1]) { 8790 this.inputs = this.inputs.add(this.$input2); 8791 } 8792 8793 isDbl = true; // this.$handle.triggerHandler('click.zf.slider'); 8794 8795 this._setInitAttr(1); 8796 } // Set handle positions 8797 8798 8799 this.setHandles(); 8800 8801 this._events(); 8802 } 8803 }, { 8804 key: "setHandles", 8805 value: function setHandles() { 8806 var _this2 = this; 8807 8808 if (this.handles[1]) { 8809 this._setHandlePos(this.$handle, this.inputs.eq(0).val(), true, function () { 8810 _this2._setHandlePos(_this2.$handle2, _this2.inputs.eq(1).val(), true); 8811 }); 8812 } else { 8813 this._setHandlePos(this.$handle, this.inputs.eq(0).val(), true); 8814 } 8815 } 8816 }, { 8817 key: "_reflow", 8818 value: function _reflow() { 8819 this.setHandles(); 8820 } 8821 /** 8822 * @function 8823 * @private 8824 * @param {Number} value - floating point (the value) to be transformed using to a relative position on the slider (the inverse of _value) 8825 */ 8826 8827 }, { 8828 key: "_pctOfBar", 8829 value: function _pctOfBar(value) { 8830 var pctOfBar = percent(value - this.options.start, this.options.end - this.options.start); 8831 8832 switch (this.options.positionValueFunction) { 8833 case "pow": 8834 pctOfBar = this._logTransform(pctOfBar); 8835 break; 8836 8837 case "log": 8838 pctOfBar = this._powTransform(pctOfBar); 8839 break; 8840 } 8841 8842 return pctOfBar.toFixed(2); 8843 } 8844 /** 8845 * @function 8846 * @private 8847 * @param {Number} pctOfBar - floating point, the relative position of the slider (typically between 0-1) to be transformed to a value 8848 */ 8849 8850 }, { 8851 key: "_value", 8852 value: function _value(pctOfBar) { 8853 switch (this.options.positionValueFunction) { 8854 case "pow": 8855 pctOfBar = this._powTransform(pctOfBar); 8856 break; 8857 8858 case "log": 8859 pctOfBar = this._logTransform(pctOfBar); 8860 break; 8861 } 8862 8863 var value = (this.options.end - this.options.start) * pctOfBar + parseFloat(this.options.start); 8864 return value; 8865 } 8866 /** 8867 * @function 8868 * @private 8869 * @param {Number} value - floating point (typically between 0-1) to be transformed using the log function 8870 */ 8871 8872 }, { 8873 key: "_logTransform", 8874 value: function _logTransform(value) { 8875 return baseLog(this.options.nonLinearBase, value * (this.options.nonLinearBase - 1) + 1); 8876 } 8877 /** 8878 * @function 8879 * @private 8880 * @param {Number} value - floating point (typically between 0-1) to be transformed using the power function 8881 */ 8882 8883 }, { 8884 key: "_powTransform", 8885 value: function _powTransform(value) { 8886 return (Math.pow(this.options.nonLinearBase, value) - 1) / (this.options.nonLinearBase - 1); 8887 } 8888 /** 8889 * Sets the position of the selected handle and fill bar. 8890 * @function 8891 * @private 8892 * @param {jQuery} $hndl - the selected handle to move. 8893 * @param {Number} location - floating point between the start and end values of the slider bar. 8894 * @param {Function} cb - callback function to fire on completion. 8895 * @fires Slider#moved 8896 * @fires Slider#changed 8897 */ 8898 8899 }, { 8900 key: "_setHandlePos", 8901 value: function _setHandlePos($hndl, location, noInvert, cb) { 8902 // don't move if the slider has been disabled since its initialization 8903 if (this.$element.hasClass(this.options.disabledClass)) { 8904 return; 8905 } //might need to alter that slightly for bars that will have odd number selections. 8906 8907 8908 location = parseFloat(location); //on input change events, convert string to number...grumble. 8909 // prevent slider from running out of bounds, if value exceeds the limits set through options, override the value to min/max 8910 8911 if (location < this.options.start) { 8912 location = this.options.start; 8913 } else if (location > this.options.end) { 8914 location = this.options.end; 8915 } 8916 8917 var isDbl = this.options.doubleSided;
vendor: 4,315 bytes, lines 8917-8996
8917 //this is for single-handled vertical sliders, it adjusts the value to account for the slider being "upside-down" 8918 //for click and drag events, it's weird due to the scale(-1, 1) css property 8919 8920 if (this.options.vertical && !noInvert) { 8921 location = this.options.end - location; 8922 } 8923 8924 if (isDbl) { 8925 //this block is to prevent 2 handles from crossing eachother. Could/should be improved. 8926 if (this.handles.index($hndl) === 0) { 8927 var h2Val = parseFloat(this.$handle2.attr('aria-valuenow')); 8928 location = location >= h2Val ? h2Val - this.options.step : location; 8929 } else { 8930 var h1Val = parseFloat(this.$handle.attr('aria-valuenow')); 8931 location = location <= h1Val ? h1Val + this.options.step : location; 8932 } 8933 } 8934 8935 var _this = this, 8936 vert = this.options.vertical, 8937 hOrW = vert ? 'height' : 'width', 8938 lOrT = vert ? 'top' : 'left', 8939 handleDim = $hndl[0].getBoundingClientRect()[hOrW], 8940 elemDim = this.$element[0].getBoundingClientRect()[hOrW], 8941 //percentage of bar min/max value based on click or drag point 8942 pctOfBar = this._pctOfBar(location), 8943 //number of actual pixels to shift the handle, based on the percentage obtained above 8944 pxToMove = (elemDim - handleDim) * pctOfBar, 8945 //percentage of bar to shift the handle 8946 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 8947 8948 8949 location = parseFloat(location.toFixed(this.options.decimal)); // declare empty object for css adjustments, only used with 2 handled-sliders 8950 8951 var css = {}; 8952 8953 this._setValues($hndl, location); // TODO update to calculate based on values set to respective inputs?? 8954 8955 8956 if (isDbl) { 8957 var isLeftHndl = this.handles.index($hndl) === 0, 8958 //empty variable, will be used for min-height/width for fill bar 8959 dim, 8960 //percentage w/h of the handle compared to the slider bar 8961 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 8962 8963 if (isLeftHndl) { 8964 //left or top percentage value to apply to the fill bar. 8965 css[lOrT] = "".concat(movement, "%"); //calculate the new min-height/width for the fill bar. 8966 8967 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 8968 //plus, it means we don't care if 'dim' isNaN on init, it won't be in the future. 8969 8970 if (cb && typeof cb === 'function') { 8971 cb(); 8972 } //this is only needed for the initialization of 2 handled sliders 8973 8974 } else { 8975 //just caching the value of the left/bottom handle's left/top property 8976 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 8977 //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 8978 8979 dim = movement - (isNaN(handlePos) ? (this.options.initialStart - this.options.start) / ((this.options.end - this.options.start) / 100) : handlePos) + handlePct; 8980 } // assign the min-height/width to our css object 8981 8982 8983 css["min-".concat(hOrW)] = "".concat(dim, "%"); 8984 } 8985 8986 this.$element.one('finished.zf.animate', function () { 8987 /** 8988 * Fires when the handle is done moving. 8989 * @event Slider#moved 8990 */ 8991 _this.$element.trigger('moved.zf.slider', [$hndl]); 8992 }); //because we don't know exactly how the handle will be moved, check the amount of time it should take to move. 8993 8994 var moveTime = this.$element.data('dragging') ? 1000 / 60 : this.options.moveTime; 8995 Object(_foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Move"])(moveTime, $hndl, function () { 8996 // adjusting the left/top property of the handle, based on the percentage c
vendor: 11,072 bytes, lines 8996-9326
8996alculated above 8997 // if movement isNaN, that is because the slider is hidden and we cannot determine handle width, 8998 // fall back to next best guess. 8999 if (isNaN(movement)) { 9000 $hndl.css(lOrT, "".concat(pctOfBar * 100, "%")); 9001 } else { 9002 $hndl.css(lOrT, "".concat(movement, "%")); 9003 } 9004 9005 if (!_this.options.doubleSided) { 9006 //if single-handled, a simple method to expand the fill bar 9007 _this.$fill.css(hOrW, "".concat(pctOfBar * 100, "%")); 9008 } else { 9009 //otherwise, use the css object we created above 9010 _this.$fill.css(css); 9011 } 9012 }); 9013 /** 9014 * Fires when the value has not been change for a given time. 9015 * @event Slider#changed 9016 */ 9017 9018 clearTimeout(_this.timeout); 9019 _this.timeout = setTimeout(function () { 9020 _this.$element.trigger('changed.zf.slider', [$hndl]); 9021 }, _this.options.changedDelay); 9022 } 9023 /** 9024 * Sets the initial attribute for the slider element. 9025 * @function 9026 * @private 9027 * @param {Number} idx - index of the current handle/input to use. 9028 */ 9029 9030 }, { 9031 key: "_setInitAttr", 9032 value: function _setInitAttr(idx) { 9033 var initVal = idx === 0 ? this.options.initialStart : this.options.initialEnd; 9034 var id = this.inputs.eq(idx).attr('id') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'slider'); 9035 this.inputs.eq(idx).attr({ 9036 'id': id, 9037 'max': this.options.end, 9038 'min': this.options.start, 9039 'step': this.options.step 9040 }); 9041 this.inputs.eq(idx).val(initVal); 9042 this.handles.eq(idx).attr({ 9043 'role': 'slider', 9044 'aria-controls': id, 9045 'aria-valuemax': this.options.end, 9046 'aria-valuemin': this.options.start, 9047 'aria-valuenow': initVal, 9048 'aria-orientation': this.options.vertical ? 'vertical' : 'horizontal', 9049 'tabindex': 0 9050 }); 9051 } 9052 /** 9053 * Sets the input and `aria-valuenow` values for the slider element. 9054 * @function 9055 * @private 9056 * @param {jQuery} $handle - the currently selected handle. 9057 * @param {Number} val - floating point of the new value. 9058 */ 9059 9060 }, { 9061 key: "_setValues", 9062 value: function _setValues($handle, val) { 9063 var idx = this.options.doubleSided ? this.handles.index($handle) : 0; 9064 this.inputs.eq(idx).val(val); 9065 $handle.attr('aria-valuenow', val); 9066 } 9067 /** 9068 * Handles events on the slider element. 9069 * Calculates the new location of the current handle. 9070 * If there are two handles and the bar was clicked, it determines which handle to move. 9071 * @function 9072 * @private 9073 * @param {Object} e - the `event` object passed from the listener. 9074 * @param {jQuery} $handle - the current handle to calculate for, if selected. 9075 * @param {Number} val - floating point number for the new value of the slider. 9076 * TODO clean this up, there's a lot of repeated code between this and the _setHandlePos fn. 9077 */ 9078 9079 }, { 9080 key: "_handleEvent", 9081 value: function _handleEvent(e, $handle, val) { 9082 var value, hasVal; 9083 9084 if (!val) { 9085 //click or drag events 9086 e.preventDefault(); 9087 9088 var _this = this, 9089 vertical = this.options.vertical, 9090 param = vertical ? 'height' : 'width', 9091 direction = vertical ? 'top' : 'left', 9092 eventOffset = vertical ? e.pageY : e.pageX, 9093 halfOfHandle = this.$handle[0].getBoundingClientRect()[param] / 2, 9094 barDim = this.$element[0].getBoundingClientRect()[param], 9095 windowScroll = vertical ? jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).scrollTop() : jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).scrollLeft(); 9096 9097 var elemOffset = this.$element.offset()[direction]; // touch events emulated by the touch util give position relative to screen, add window.scroll to event coordinates... 9098 // best way to guess this is simulated is if clientY == pageY 9099 9100 if (e.clientY === e.pageY) { 9101 eventOffset = eventOffset + windowScroll; 9102 } 9103 9104 var eventFromBar = eventOffset - elemOffset; 9105 var barXY; 9106 9107 if (eventFromBar < 0) { 9108 barXY = 0; 9109 } else if (eventFromBar > barDim) { 9110 barXY = barDim; 9111 } else { 9112 barXY = eventFromBar; 9113 } 9114 9115 var offsetPct = percent(barXY, barDim); 9116 value = this._value(offsetPct); // turn everything around for RTL, yay math! 9117 9118 if (Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["rtl"])() && !this.options.vertical) { 9119 value = this.options.end - value; 9120 } 9121 9122 value = _this._adjustValue(null, value); //boolean flag for the setHandlePos fn, specifically for vertical sliders 9123 9124 hasVal = false; 9125 9126 if (!$handle) { 9127 //figure out which handle it is, pass it to the next function. 9128 var firstHndlPos = absPosition(this.$handle, direction, barXY, param), 9129 secndHndlPos = absPosition(this.$handle2, direction, barXY, param); 9130 $handle = firstHndlPos <= secndHndlPos ? this.$handle : this.$handle2; 9131 } 9132 } else { 9133 //change event on input 9134 value = this._adjustValue(null, val); 9135 hasVal = true; 9136 } 9137 9138 this._setHandlePos($handle, value, hasVal); 9139 } 9140 /** 9141 * Adjustes value for handle in regard to step value. returns adjusted value 9142 * @function 9143 * @private 9144 * @param {jQuery} $handle - the selected handle. 9145 * @param {Number} value - value to adjust. used if $handle is falsy 9146 */ 9147 9148 }, { 9149 key: "_adjustValue", 9150 value: function _adjustValue($handle, value) { 9151 var val, 9152 step = this.options.step, 9153 div = parseFloat(step / 2), 9154 left, 9155 prev_val, 9156 next_val; 9157 9158 if (!!$handle) { 9159 val = parseFloat($handle.attr('aria-valuenow')); 9160 } else { 9161 val = value; 9162 } 9163 9164 if (val >= 0) { 9165 left = val % step; 9166 } else { 9167 left = step + val % step; 9168 } 9169 9170 prev_val = val - left; 9171 next_val = prev_val + step; 9172 9173 if (left === 0) { 9174 return val; 9175 } 9176 9177 val = val >= prev_val + div ? next_val : prev_val; 9178 return val; 9179 } 9180 /** 9181 * Adds event listeners to the slider elements. 9182 * @function 9183 * @private 9184 */ 9185 9186 }, { 9187 key: "_events", 9188 value: function _events() { 9189 this._eventsForHandle(this.$handle); 9190 9191 if (this.handles[1]) { 9192 this._eventsForHandle(this.$handle2); 9193 } 9194 } 9195 /** 9196 * Adds event listeners a particular handle 9197 * @function 9198 * @private 9199 * @param {jQuery} $handle - the current handle to apply listeners to. 9200 */ 9201 9202 }, { 9203 key: "_eventsForHandle", 9204 value: function _eventsForHandle($handle) { 9205 var _this = this, 9206 curHandle, 9207 timer; 9208 9209 var handleChangeEvent = function handleChangeEvent(e) { 9210 var idx = _this.inputs.index(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)); 9211 9212 _this._handleEvent(e, _this.handles.eq(idx), jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).val()); 9213 }; // IE only triggers the change event when the input loses focus which strictly follows the HTML specification 9214 // listen for the enter key and trigger a change 9215 // @see https://html.spec.whatwg.org/multipage/input.html#common-input-element-events 9216 9217 9218 this.inputs.off('keyup.zf.slider').on('keyup.zf.slider', function (e) { 9219 if (e.keyCode == 13) handleChangeEvent.call(this, e); 9220 }); 9221 this.inputs.off('change.zf.slider').on('change.zf.slider', handleChangeEvent); 9222 9223 if (this.options.clickSelect) { 9224 this.$element.off('click.zf.slider').on('click.zf.slider', function (e) { 9225 if (_this.$element.data('dragging')) { 9226 return false; 9227 } 9228 9229 if (!jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).is('[data-slider-handle]')) { 9230 if (_this.options.doubleSided) { 9231 _this._handleEvent(e); 9232 } else { 9233 _this._handleEvent(e, _this.$handle); 9234 } 9235 } 9236 }); 9237 } 9238 9239 if (this.options.draggable) { 9240 this.handles.addTouch(); 9241 var $body = jquery__WEBPACK_IMPORTED_MODULE_0___default()('body'); 9242 $handle.off('mousedown.zf.slider').on('mousedown.zf.slider', function (e) { 9243 $handle.addClass('is-dragging'); 9244 9245 _this.$fill.addClass('is-dragging'); // 9246 9247 9248 _this.$element.data('dragging', true); 9249 9250 curHandle = jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.currentTarget); 9251 $body.on('mousemove.zf.slider', function (e) { 9252 e.preventDefault(); 9253 9254 _this._handleEvent(e, curHandle); 9255 }).on('mouseup.zf.slider', function (e) { 9256 _this._handleEvent(e, curHandle); 9257 9258 $handle.removeClass('is-dragging'); 9259 9260 _this.$fill.removeClass('is-dragging'); 9261 9262 _this.$element.data('dragging', false); 9263 9264 $body.off('mousemove.zf.slider mouseup.zf.slider'); 9265 }); 9266 }) // prevent events triggered by touch 9267 .on('selectstart.zf.slider touchmove.zf.slider', function (e) { 9268 e.preventDefault(); 9269 }); 9270 } 9271 9272 $handle.off('keydown.zf.slider').on('keydown.zf.slider', function (e) { 9273 var _$handle = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 9274 idx = _this.options.doubleSided ? _this.handles.index(_$handle) : 0, 9275 oldValue = parseFloat(_this.inputs.eq(idx).val()), 9276 newValue; // handle keyboard event with keyboard util 9277 9278 9279 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].handleKey(e, 'Slider', { 9280 decrease: function decrease() { 9281 newValue = oldValue - _this.options.step; 9282 }, 9283 increase: function increase() { 9284 newValue = oldValue + _this.options.step; 9285 }, 9286 decrease_fast: function decrease_fast() { 9287 newValue = oldValue - _this.options.step * 10; 9288 }, 9289 increase_fast: function increase_fast() { 9290 newValue = oldValue + _this.options.step * 10; 9291 }, 9292 min: function min() { 9293 newValue = _this.options.start; 9294 }, 9295 max: function max() { 9296 newValue = _this.options.end; 9297 }, 9298 handled: function handled() { 9299 // only set handle pos when event was handled specially 9300 e.preventDefault(); 9301 9302 _this._setHandlePos(_$handle, newValue, true); 9303 } 9304 }); 9305 /*if (newValue) { // if pressed key has special function, update value 9306 e.preventDefault(); 9307 _this._setHandlePos(_$handle, newValue); 9308 }*/ 9309 }); 9310 } 9311 /** 9312 * Destroys the slider plugin. 9313 */ 9314 9315 }, { 9316 key: "_destroy", 9317 value: function _destroy() { 9318 this.handles.off('.zf.slider'); 9319 this.inputs.off('.zf.slider'); 9320 this.$element.off('.zf.slider'); 9321 clearTimeout(this.timeout); 9322 } 9323 }]); 9324 9325 return Slider; 9326}
9326(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__["Plugin"]); 9327 9328Slider.defaults = { 9329 /** 9330 * Minimum value for the slider scale. 9331 * @option 9332 * @type {number} 9333 * @default 0 9334 */ 9335 start: 0, 9336 9337 /** 9338 * Maximum value for the slider scale. 9339 * @option 9340 * @type {number} 9341 * @default 100 9342 */ 9343 end: 100, 9344 9345 /** 9346 * Minimum value change per change event. 9347 * @option 9348 * @type {number} 9349 * @default 1 9350 */ 9351 step: 1, 9352 9353 /** 9354 * Value at which the handle/input *(left handle/first input)* should be set to on initialization. 9355 * @option 9356 * @type {number} 9357 * @default 0 9358 */ 9359 initialStart: 0, 9360 9361 /** 9362 * Value at which the right handle/second input should be set to on initialization. 9363 * @option 9364 * @type {number} 9365 * @default 100 9366 */ 9367 initialEnd: 100, 9368 9369 /** 9370 * Allows the input to be located outside the container and visible. Set to by the JS 9371 * @option 9372 * @type {boolean} 9373 * @default false 9374 */ 9375 binding: false, 9376 9377 /** 9378 * Allows the user to click/tap on the slider bar to select a value. 9379 * @option 9380 * @type {boolean} 9381 * @default true 9382 */ 9383 clickSelect: true, 9384 9385 /** 9386 * Set to true and use the `vertical` class to change alignment to vertical. 9387 * @option 9388 * @type {boolean} 9389 * @default false 9390 */ 9391 vertical: false, 9392 9393 /** 9394 * Allows the user to drag the slider handle(s) to select a value. 9395 * @option 9396 * @type {boolean} 9397 * @default true 9398 */ 9399 draggable: true, 9400 9401 /** 9402 * Disables the slider and prevents event listeners from being applied. Double checked by JS with `disabledClass`. 9403 * @option 9404 * @type {boolean} 9405 * @default false 9406 */ 9407 disabled: false, 9408 9409 /** 9410 * Allows the use of two handles. Double checked by the JS. Changes some logic handling. 9411 * @option 9412 * @type {boolean} 9413 * @default false 9414 */ 9415 doubleSided: false, 9416 9417 /** 9418 * Potential future feature. 9419 */ 9420 // steps: 100, 9421 9422 /** 9423 * Number of decimal places the plugin should go to for floating point precision. 9424 * @option 9425 * @type {number} 9426 * @default 2 9427 */ 9428 decimal: 2, 9429 9430 /** 9431 * Time delay for dragged elements. 9432 */ 9433 // dragDelay: 0, 9434 9435 /** 9436 * 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. 9437 * @option 9438 * @type {number} 9439 * @default 200 9440 */ 9441 moveTime: 200, 9442 //update this if changing the transition time in the sass 9443 9444 /** 9445 * Class applied to disabled sliders. 9446 * @option 9447 * @type {string} 9448 * @default 'disabled' 9449 */ 9450 disabledClass: 'disabled', 9451 9452 /** 9453 * Will invert the default layout for a vertical<span data-tooltip title="who would do this???"> </span>slider. 9454 * @option 9455 * @type {boolean} 9456 * @default false 9457 */ 9458 invertVertical: false, 9459 9460 /** 9461 * Milliseconds before the `changed.zf-slider` event is triggered after value change. 9462 * @option 9463 * @type {number} 9464 * @default 500 9465 */ 9466 changedDelay: 500, 9467 9468 /** 9469 * Basevalue for non-linear sliders 9470 * @option 9471 * @type {number} 9472 * @default 5 9473 */ 9474 nonLinearBase: 5, 9475 9476 /** 9477 * Basevalue for non-linear sliders, possible values are: `'linear'`, `'pow'` & `'log'`. Pow and Log use the nonLinearBase setting. 9478 * @option 9479 * @type {string} 9480 * @default 'linear' 9481 */ 9482 positionValueFunction: 'linear' 9483}; 9484 9485function percent(frac, num) { 9486 return frac / num; 9487} 9488 9489function absPosition($handle, dir, clickPos, param) { 9490 return Math.abs($handle.position()[dir] + $handle[param]() / 2 - clickPos); 9491} 9492 9493function baseLog(base, value) { 9494 return Math.log(value) / Math.log(base); 9495} 9496 9497 9498 9499/***/ }), 9500
vendor: 4,898 bytes, lines 9501-9597
9501/***/ "./js/foundation.smoothScroll.js": 9502/*!***************************************!*\ 9503 !*** ./js/foundation.smoothScroll.js ***! 9504 \***************************************/ 9505/*! exports provided: SmoothScroll */ 9506/***/ (function(module, __webpack_exports__, __webpack_require__) { 9507 9508"use strict"; 9509__webpack_require__.r(__webpack_exports__); 9510/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SmoothScroll", function() { return SmoothScroll; }); 9511/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 9512/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 9513/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 9514/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 9515function _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); } 9516 9517function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 9518 9519function _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); } } 9520 9521function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 9522 9523function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 9524 9525function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 9526 9527function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 9528 9529function _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); } 9530 9531function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 9532 9533 9534 9535 9536/** 9537 * SmoothScroll module. 9538 * @module foundation.smooth-scroll 9539 */ 9540 9541var SmoothScroll = 9542/*#__PURE__*/ 9543function (_Plugin) { 9544 _inherits(SmoothScroll, _Plugin); 9545 9546 function SmoothScroll() { 9547 _classCallCheck(this, SmoothScroll); 9548 9549 return _possibleConstructorReturn(this, _getPrototypeOf(SmoothScroll).apply(this, arguments)); 9550 } 9551 9552 _createClass(SmoothScroll, [{ 9553 key: "_setup", 9554 9555 /** 9556 * Creates a new instance of SmoothScroll. 9557 * @class 9558 * @name SmoothScroll 9559 * @fires SmoothScroll#init 9560 * @param {Object} element - jQuery object to add the trigger to. 9561 * @param {Object} options - Overrides to the default plugin settings. 9562 */ 9563 value: function _setup(element, options) { 9564 this.$element = element; 9565 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, SmoothScroll.defaults, this.$element.data(), options); 9566 this.className = 'SmoothScroll'; // ie9 back compat 9567 9568 this._init(); 9569 } 9570 /** 9571 * Initialize the SmoothScroll plugin 9572 * @private 9573 */ 9574 9575 }, { 9576 key: "_init", 9577 value: function _init() { 9578 var id = this.$element[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["GetYoDigits"])(6, 'smooth-scroll'); 9579 this.$element.attr({ 9580 id: id 9581 }); 9582 9583 this._events(); 9584 } 9585 /** 9586 * Initializes events for SmoothScroll. 9587 * @private 9588 */ 9589 9590 }, { 9591 key: "_events", 9592 value: function _events() { 9593 this._linkClickListener = this._handleLinkClick.bind(this); 9594 this.$element.on('click.zf.smoothScroll', this._linkClickListener); 9595 this.$element.on('click.zf.smoothScroll', 'a[href^="#"]', this._linkClickListener); 9596 } 9597 /**
vendor: 3,000 bytes, lines 9598-9701
9598 * Handle the given event to smoothly scroll to the anchor pointed by the event target. 9599 * @param {*} e - event 9600 * @function 9601 * @private 9602 */ 9603 9604 }, { 9605 key: "_handleLinkClick", 9606 value: function _handleLinkClick(e) { 9607 var _this = this; 9608 9609 // Follow the link if it does not point to an anchor. 9610 if (!jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.currentTarget).is('a[href^="#"]')) return; 9611 var arrival = e.currentTarget.getAttribute('href'); 9612 this._inTransition = true; 9613 SmoothScroll.scrollToLoc(arrival, this.options, function () { 9614 _this._inTransition = false; 9615 }); 9616 e.preventDefault(); 9617 } 9618 }, { 9619 key: "_destroy", 9620 9621 /** 9622 * Destroys the SmoothScroll instance. 9623 * @function 9624 */ 9625 value: function _destroy() { 9626 this.$element.off('click.zf.smoothScroll', this._linkClickListener); 9627 this.$element.off('click.zf.smoothScroll', 'a[href^="#"]', this._linkClickListener); 9628 } 9629 }], [{ 9630 key: "scrollToLoc", 9631 9632 /** 9633 * Function to scroll to a given location on the page. 9634 * @param {String} loc - A properly formatted jQuery id selector. Example: '#foo' 9635 * @param {Object} options - The options to use. 9636 * @param {Function} callback - The callback function. 9637 * @static 9638 * @function 9639 */ 9640 value: function scrollToLoc(loc) { 9641 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : SmoothScroll.defaults; 9642 var callback = arguments.length > 2 ? arguments[2] : undefined; 9643 var $loc = jquery__WEBPACK_IMPORTED_MODULE_0___default()(loc); // Do nothing if target does not exist to prevent errors 9644 9645 if (!$loc.length) return false; 9646 var scrollPos = Math.round($loc.offset().top - options.threshold / 2 - options.offset); 9647 jquery__WEBPACK_IMPORTED_MODULE_0___default()('html, body').stop(true).animate({ 9648 scrollTop: scrollPos 9649 }, options.animationDuration, options.animationEasing, function () { 9650 if (typeof callback === 'function') { 9651 callback(); 9652 } 9653 }); 9654 } 9655 }]); 9656 9657 return SmoothScroll; 9658}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__["Plugin"]); 9659/** 9660 * Default settings for plugin. 9661 */ 9662 9663 9664SmoothScroll.defaults = { 9665 /** 9666 * Amount of time, in ms, the animated scrolling should take between locations. 9667 * @option 9668 * @type {number} 9669 * @default 500 9670 */ 9671 animationDuration: 500, 9672 9673 /** 9674 * Animation style to use when scrolling between locations. Can be `'swing'` or `'linear'`. 9675 * @option 9676 * @type {string} 9677 * @default 'linear' 9678 * @see {@link https://api.jquery.com/animate|Jquery animate} 9679 */ 9680 animationEasing: 'linear', 9681 9682 /** 9683 * Number of pixels to use as a marker for location changes. 9684 * @option 9685 * @type {number} 9686 * @default 50 9687 */ 9688 threshold: 50, 9689 9690 /** 9691 * Number of pixels to offset the scroll of the page on item click if using a sticky nav bar. 9692 * @option 9693 * @type {number} 9694 * @default 0 9695 */ 9696 offset: 0 9697}; 9698 9699 9700/***/ }), 9701
9702/***/ "./js/foundation.sticky.js": 9703/*!*********************************!*\ 9704 !*** ./js/foundation.sticky.js ***! 9705 \*********************************/ 9706/*! exports provided: Sticky */ 9707/***/ (function(module, __webpack_exports__, __webpack_require__) { 9708 9709"use strict"; 9710__webpack_require__.r(__webpack_exports__); 9711/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Sticky", function() { return Sticky; }); 9712/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 9713/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 9714/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 9715/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js"); 9716/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 9717/* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js"); 9718 9719 9720function _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); } 9721 9722function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 9723 9724function _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); } } 9725 9726function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 9727 9728function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 9729 9730function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 9731 9732function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 9733 9734function _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); } 9735 9736function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 9737 9738 9739 9740 9741 9742 9743/** 9744 * Sticky module. 9745 * @module foundation.sticky 9746 * @requires foundation.util.triggers 9747 * @requires foundation.util.mediaQuery 9748 */ 9749 9750var Sticky = 9751/*#__PURE__*/ 9752function (_Plugin) { 9753 _inherits(Sticky, _Plugin); 9754 9755 function Sticky() { 9756 _classCallCheck(this, Sticky); 9757 9758 return _possibleConstructorReturn(this, _getPrototypeOf(Sticky).apply(this, arguments)); 9759 } 9760 9761 _createClass(Sticky, [{ 9762 key: "_setup", 9763 9764 /** 9765 * Creates a new instance of a sticky thing. 9766 * @class 9767 * @name Sticky 9768 * @param {jQuery} element - jQuery object to make sticky. 9769 * @param {Object} options - options object passed when creating the element programmatically. 9770 */ 9771 value: function _setup(element, options) { 9772 this.$element = element; 9773 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Sticky.defaults, this.$element.data(), options); 9774 this.className = 'Sticky'; // ie9 back compat 9775 // Triggers init is idempotent, just need to make sure it is initialized 9776 9777 _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 9778 9779 this._init(); 9780 } 9781 /** 9782 * Initializes the sticky element by adding classes, getting/setting dimensions, breakpoints and attributes 9783 * @function 9784 * @private 9785 */ 9786 9787 }, { 9788 key: "_init", 9789 value: function _init() { 9790 _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__["MediaQuery"]._init(); 9791 9792 var $parent = this.$element.parent('[data-sticky-container]'), 9793 id = this.$element[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["GetYoDigits"])(6, 'sticky'), 9794 _this = this; 9795 9796 if ($parent.length) { 9797 this.$container = $parent; 9798 } else { 9799 this.wasWrapped = true; 9800 this.$element.wrap(this.options.container); 9801 this.$container = this.$element.parent(); 9802 } 9803 9804 this.$container.addClass(this.options.containerClass); 9805 this.$element.addClass(this.options.stickyClass).attr({ 9806 'data-resize': id, 9807 'data-mutate': id 9808 }); 9809 9810 if (this.options.anchor !== '') { 9811 jquery__WEBPACK_IMPORTED_MODULE_0___default()('#' + _this.options.anchor).attr({ 9812 'data-mutate': id 9813 }); 9814 } 9815 9816 this.scrollCount = this.options.checkEvery; 9817 this.isStuck = false;
vendor: 4,371 bytes, lines 9818-9960
9818 this.onLoadListener = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () { 9819 //We calculate the container height to have correct values for anchor points offset calculation. 9820 _this.containerHeight = _this.$element.css("display") == "none" ? 0 : _this.$element[0].getBoundingClientRect().height; 9821 9822 _this.$container.css('height', _this.containerHeight); 9823 9824 _this.elemHeight = _this.containerHeight; 9825 9826 if (_this.options.anchor !== '') { 9827 _this.$anchor = jquery__WEBPACK_IMPORTED_MODULE_0___default()('#' + _this.options.anchor); 9828 } else { 9829 _this._parsePoints(); 9830 } 9831 9832 _this._setSizes(function () { 9833 var scroll = window.pageYOffset; 9834 9835 _this._calc(false, scroll); //Unstick the element will ensure that proper classes are set. 9836 9837 9838 if (!_this.isStuck) { 9839 _this._removeSticky(scroll >= _this.topPoint ? false : true); 9840 } 9841 }); 9842 9843 _this._events(id.split('-').reverse().join('-')); 9844 }); 9845 } 9846 /** 9847 * If using multiple elements as anchors, calculates the top and bottom pixel values the sticky thing should stick and unstick on. 9848 * @function 9849 * @private 9850 */ 9851 9852 }, { 9853 key: "_parsePoints", 9854 value: function _parsePoints() { 9855 var top = this.options.topAnchor == "" ? 1 : this.options.topAnchor, 9856 btm = this.options.btmAnchor == "" ? document.documentElement.scrollHeight : this.options.btmAnchor, 9857 pts = [top, btm], 9858 breaks = {}; 9859 9860 for (var i = 0, len = pts.length; i < len && pts[i]; i++) { 9861 var pt; 9862 9863 if (typeof pts[i] === 'number') { 9864 pt = pts[i]; 9865 } else { 9866 var place = pts[i].split(':'), 9867 anchor = jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(place[0])); 9868 pt = anchor.offset().top; 9869 9870 if (place[1] && place[1].toLowerCase() === 'bottom') { 9871 pt += anchor[0].getBoundingClientRect().height; 9872 } 9873 } 9874 9875 breaks[i] = pt; 9876 } 9877 9878 this.points = breaks; 9879 return; 9880 } 9881 /** 9882 * Adds event handlers for the scrolling element. 9883 * @private 9884 * @param {String} id - pseudo-random id for unique scroll event listener. 9885 */ 9886 9887 }, { 9888 key: "_events", 9889 value: function _events(id) { 9890 var _this = this, 9891 scrollListener = this.scrollListener = "scroll.zf.".concat(id); 9892 9893 if (this.isOn) { 9894 return; 9895 } 9896 9897 if (this.canStick) { 9898 this.isOn = true; 9899 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(scrollListener).on(scrollListener, function (e) { 9900 if (_this.scrollCount === 0) { 9901 _this.scrollCount = _this.options.checkEvery; 9902 9903 _this._setSizes(function () { 9904 _this._calc(false, window.pageYOffset); 9905 }); 9906 } else { 9907 _this.scrollCount--; 9908 9909 _this._calc(false, window.pageYOffset); 9910 } 9911 }); 9912 } 9913 9914 this.$element.off('resizeme.zf.trigger').on('resizeme.zf.trigger', function (e, el) { 9915 _this._eventsHandler(id); 9916 }); 9917 this.$element.on('mutateme.zf.trigger', function (e, el) { 9918 _this._eventsHandler(id); 9919 }); 9920 9921 if (this.$anchor) { 9922 this.$anchor.on('mutateme.zf.trigger', function (e, el) { 9923 _this._eventsHandler(id); 9924 }); 9925 } 9926 } 9927 /** 9928 * Handler for events. 9929 * @private 9930 * @param {String} id - pseudo-random id for unique scroll event listener. 9931 */ 9932 9933 }, { 9934 key: "_eventsHandler", 9935 value: function _eventsHandler(id) { 9936 var _this = this, 9937 scrollListener = this.scrollListener = "scroll.zf.".concat(id); 9938 9939 _this._setSizes(function () { 9940 _this._calc(false); 9941 9942 if (_this.canStick) { 9943 if (!_this.isOn) { 9944 _this._events(id); 9945 } 9946 } else if (_this.isOn) { 9947 _this._pauseListeners(scrollListener); 9948 } 9949 }); 9950 } 9951 /** 9952 * Removes event handlers for scroll and change events on anchor. 9953 * @fires Sticky#pause 9954 * @param {String} scrollListener - unique, namespaced scroll listener attached to `window` 9955 */ 9956 9957 }, { 9958 key: "_pauseListeners", 9959 value: function _pauseListeners(scrollListener) { 9960 this.isOn = false;
vendor: 5,450 bytes, lines 9961-10128
9961 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(scrollListener); 9962 /** 9963 * Fires when the plugin is paused due to resize event shrinking the view. 9964 * @event Sticky#pause 9965 * @private 9966 */ 9967 9968 this.$element.trigger('pause.zf.sticky'); 9969 } 9970 /** 9971 * Called on every `scroll` event and on `_init` 9972 * fires functions based on booleans and cached values 9973 * @param {Boolean} checkSizes - true if plugin should recalculate sizes and breakpoints. 9974 * @param {Number} scroll - current scroll position passed from scroll event cb function. If not passed, defaults to `window.pageYOffset`. 9975 */ 9976 9977 }, { 9978 key: "_calc", 9979 value: function _calc(checkSizes, scroll) { 9980 if (checkSizes) { 9981 this._setSizes(); 9982 } 9983 9984 if (!this.canStick) { 9985 if (this.isStuck) { 9986 this._removeSticky(true); 9987 } 9988 9989 return false; 9990 } 9991 9992 if (!scroll) { 9993 scroll = window.pageYOffset; 9994 } 9995 9996 if (scroll >= this.topPoint) { 9997 if (scroll <= this.bottomPoint) { 9998 if (!this.isStuck) { 9999 this._setSticky(); 10000 } 10001 } else { 10002 if (this.isStuck) { 10003 this._removeSticky(false); 10004 } 10005 } 10006 } else { 10007 if (this.isStuck) { 10008 this._removeSticky(true); 10009 } 10010 } 10011 } 10012 /** 10013 * Causes the $element to become stuck. 10014 * Adds `position: fixed;`, and helper classes. 10015 * @fires Sticky#stuckto 10016 * @function 10017 * @private 10018 */ 10019 10020 }, { 10021 key: "_setSticky", 10022 value: function _setSticky() { 10023 var _this = this, 10024 stickTo = this.options.stickTo, 10025 mrgn = stickTo === 'top' ? 'marginTop' : 'marginBottom', 10026 notStuckTo = stickTo === 'top' ? 'bottom' : 'top', 10027 css = {}; 10028 10029 css[mrgn] = "".concat(this.options[mrgn], "em"); 10030 css[stickTo] = 0; 10031 css[notStuckTo] = 'auto'; 10032 this.isStuck = true; 10033 this.$element.removeClass("is-anchored is-at-".concat(notStuckTo)).addClass("is-stuck is-at-".concat(stickTo)).css(css) 10034 /** 10035 * Fires when the $element has become `position: fixed;` 10036 * Namespaced to `top` or `bottom`, e.g. `sticky.zf.stuckto:top` 10037 * @event Sticky#stuckto 10038 */ 10039 .trigger("sticky.zf.stuckto:".concat(stickTo)); 10040 this.$element.on("transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd", function () { 10041 _this._setSizes(); 10042 }); 10043 } 10044 /** 10045 * Causes the $element to become unstuck. 10046 * Removes `position: fixed;`, and helper classes. 10047 * Adds other helper classes. 10048 * @param {Boolean} isTop - tells the function if the $element should anchor to the top or bottom of its $anchor element. 10049 * @fires Sticky#unstuckfrom 10050 * @private 10051 */ 10052 10053 }, { 10054 key: "_removeSticky", 10055 value: function _removeSticky(isTop) { 10056 var stickTo = this.options.stickTo, 10057 stickToTop = stickTo === 'top', 10058 css = {}, 10059 anchorPt = (this.points ? this.points[1] - this.points[0] : this.anchorHeight) - this.elemHeight, 10060 mrgn = stickToTop ? 'marginTop' : 'marginBottom', 10061 notStuckTo = stickToTop ? 'bottom' : 'top', 10062 topOrBottom = isTop ? 'top' : 'bottom'; 10063 css[mrgn] = 0; 10064 css['bottom'] = 'auto'; 10065 10066 if (isTop) { 10067 css['top'] = 0; 10068 } else { 10069 css['top'] = anchorPt; 10070 } 10071 10072 this.isStuck = false; 10073 this.$element.removeClass("is-stuck is-at-".concat(stickTo)).addClass("is-anchored is-at-".concat(topOrBottom)).css(css) 10074 /** 10075 * Fires when the $element has become anchored. 10076 * Namespaced to `top` or `bottom`, e.g. `sticky.zf.unstuckfrom:bottom` 10077 * @event Sticky#unstuckfrom 10078 */ 10079 .trigger("sticky.zf.unstuckfrom:".concat(topOrBottom)); 10080 } 10081 /** 10082 * Sets the $element and $container sizes for plugin. 10083 * Calls `_setBreakPoints`. 10084 * @param {Function} cb - optional callback function to fire on completion of `_setBreakPoints`. 10085 * @private 10086 */ 10087 10088 }, { 10089 key: "_setSizes", 10090 value: function _setSizes(cb) { 10091 this.canStick = _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__["MediaQuery"].is(this.options.stickyOn); 10092 10093 if (!this.canStick) { 10094 if (cb && typeof cb === 'function') { 10095 cb(); 10096 } 10097 } 10098 10099 var _this = this, 10100 newElemWidth = this.$container[0].getBoundingClientRect().width, 10101 comp = window.getComputedStyle(this.$container[0]), 10102 pdngl = parseInt(comp['padding-left'], 10), 10103 pdngr = parseInt(comp['padding-right'], 10); 10104 10105 if (this.$anchor && this.$anchor.length) { 10106 this.anchorHeight = this.$anchor[0].getBoundingClientRect().height; 10107 } else { 10108 this._parsePoints(); 10109 } 10110 10111 this.$element.css({ 10112 'max-width': "".concat(newElemWidth - pdngl - pdngr, "px") 10113 }); 10114 var newContainerHeight = this.$element[0].getBoundingClientRect().height || this.containerHeight; 10115 10116 if (this.$element.css("display") == "none") { 10117 newContainerHeight = 0; 10118 } 10119 10120 this.containerHeight = newContainerHeight; 10121 this.$container.css({ 10122 height: newContainerHeight 10123 }); 10124 this.elemHeight = newContainerHeight; 10125 10126 if (!this.isStuck) { 10127 if (this.$element.hasClass('is-at-bottom')) { 10128 var anchorPt = (this.points ? this.points[1] - this.$container.offset().top : this.anchorHeight) - this.elemHeight;
vendor: 5,184 bytes, lines 10129-10321
10129 this.$element.css('top', anchorPt); 10130 } 10131 } 10132 10133 this._setBreakPoints(newContainerHeight, function () { 10134 if (cb && typeof cb === 'function') { 10135 cb(); 10136 } 10137 }); 10138 } 10139 /** 10140 * Sets the upper and lower breakpoints for the element to become sticky/unsticky. 10141 * @param {Number} elemHeight - px value for sticky.$element height, calculated by `_setSizes`. 10142 * @param {Function} cb - optional callback function to be called on completion. 10143 * @private 10144 */ 10145 10146 }, { 10147 key: "_setBreakPoints", 10148 value: function _setBreakPoints(elemHeight, cb) { 10149 if (!this.canStick) { 10150 if (cb && typeof cb === 'function') { 10151 cb(); 10152 } else { 10153 return false; 10154 } 10155 } 10156 10157 var mTop = emCalc(this.options.marginTop), 10158 mBtm = emCalc(this.options.marginBottom), 10159 topPoint = this.points ? this.points[0] : this.$anchor.offset().top, 10160 bottomPoint = this.points ? this.points[1] : topPoint + this.anchorHeight, 10161 // topPoint = this.$anchor.offset().top || this.points[0], 10162 // bottomPoint = topPoint + this.anchorHeight || this.points[1], 10163 winHeight = window.innerHeight; 10164 10165 if (this.options.stickTo === 'top') { 10166 topPoint -= mTop; 10167 bottomPoint -= elemHeight + mTop; 10168 } else if (this.options.stickTo === 'bottom') { 10169 topPoint -= winHeight - (elemHeight + mBtm); 10170 bottomPoint -= winHeight - mBtm; 10171 } else {//this would be the stickTo: both option... tricky 10172 } 10173 10174 this.topPoint = topPoint; 10175 this.bottomPoint = bottomPoint; 10176 10177 if (cb && typeof cb === 'function') { 10178 cb(); 10179 } 10180 } 10181 /** 10182 * Destroys the current sticky element. 10183 * Resets the element to the top position first. 10184 * Removes event listeners, JS-added css properties and classes, and unwraps the $element if the JS added the $container. 10185 * @function 10186 */ 10187 10188 }, { 10189 key: "_destroy", 10190 value: function _destroy() { 10191 this._removeSticky(true); 10192 10193 this.$element.removeClass("".concat(this.options.stickyClass, " is-anchored is-at-top")).css({ 10194 height: '', 10195 top: '', 10196 bottom: '', 10197 'max-width': '' 10198 }).off('resizeme.zf.trigger').off('mutateme.zf.trigger'); 10199 10200 if (this.$anchor && this.$anchor.length) { 10201 this.$anchor.off('change.zf.sticky'); 10202 } 10203 10204 if (this.scrollListener) jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(this.scrollListener); 10205 if (this.onLoadListener) jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(this.onLoadListener); 10206 10207 if (this.wasWrapped) { 10208 this.$element.unwrap(); 10209 } else { 10210 this.$container.removeClass(this.options.containerClass).css({ 10211 height: '' 10212 }); 10213 } 10214 } 10215 }]); 10216 10217 return Sticky; 10218}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__["Plugin"]); 10219 10220Sticky.defaults = { 10221 /** 10222 * Customizable container template. Add your own classes for styling and sizing. 10223 * @option 10224 * @type {string} 10225 * @default '<div data-sticky-container></div>' 10226 */ 10227 container: '<div data-sticky-container></div>', 10228 10229 /** 10230 * Location in the view the element sticks to. Can be `'top'` or `'bottom'`. 10231 * @option 10232 * @type {string} 10233 * @default 'top' 10234 */ 10235 stickTo: 'top', 10236 10237 /** 10238 * If anchored to a single element, the id of that element. 10239 * @option 10240 * @type {string} 10241 * @default '' 10242 */ 10243 anchor: '', 10244 10245 /** 10246 * If using more than one element as anchor points, the id of the top anchor. 10247 * @option 10248 * @type {string} 10249 * @default '' 10250 */ 10251 topAnchor: '', 10252 10253 /** 10254 * If using more than one element as anchor points, the id of the bottom anchor. 10255 * @option 10256 * @type {string} 10257 * @default '' 10258 */ 10259 btmAnchor: '', 10260 10261 /** 10262 * Margin, in `em`'s to apply to the top of the element when it becomes sticky. 10263 * @option 10264 * @type {number} 10265 * @default 1 10266 */ 10267 marginTop: 1, 10268 10269 /** 10270 * Margin, in `em`'s to apply to the bottom of the element when it becomes sticky. 10271 * @option 10272 * @type {number} 10273 * @default 1 10274 */ 10275 marginBottom: 1, 10276 10277 /** 10278 * Breakpoint string that is the minimum screen size an element should become sticky. 10279 * @option 10280 * @type {string} 10281 * @default 'medium' 10282 */ 10283 stickyOn: 'medium', 10284 10285 /** 10286 * Class applied to sticky element, and removed on destruction. Foundation defaults to `sticky`. 10287 * @option 10288 * @type {string} 10289 * @default 'sticky' 10290 */ 10291 stickyClass: 'sticky', 10292 10293 /** 10294 * Class applied to sticky container. Foundation defaults to `sticky-container`. 10295 * @option 10296 * @type {string} 10297 * @default 'sticky-container' 10298 */ 10299 containerClass: 'sticky-container', 10300 10301 /** 10302 * 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. 10303 * @option 10304 * @type {number} 10305 * @default -1 10306 */ 10307 checkEvery: -1 10308}; 10309/** 10310 * Helper function to calculate em values 10311 * @param Number {em} - number of em's to calculate into pixels 10312 */ 10313 10314function emCalc(em) { 10315 return parseInt(window.getComputedStyle(document.body, null).fontSize, 10) * em; 10316} 10317 10318 10319 10320/***/ }), 10321
vendor: 4,606 bytes, lines 10322-10401
10322/***/ "./js/foundation.tabs.js": 10323/*!*******************************!*\ 10324 !*** ./js/foundation.tabs.js ***! 10325 \*******************************/ 10326/*! exports provided: Tabs */ 10327/***/ (function(module, __webpack_exports__, __webpack_require__) { 10328 10329"use strict"; 10330__webpack_require__.r(__webpack_exports__); 10331/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Tabs", function() { return Tabs; }); 10332/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 10333/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 10334/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 10335/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js"); 10336/* harmony import */ var _foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.imageLoader */ "./js/foundation.util.imageLoader.js"); 10337/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 10338 10339 10340function _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); } 10341 10342function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 10343 10344function _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); } } 10345 10346function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 10347 10348function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 10349 10350function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 10351 10352function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 10353 10354function _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); } 10355 10356function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 10357 10358 10359 10360 10361 10362 10363/** 10364 * Tabs module. 10365 * @module foundation.tabs 10366 * @requires foundation.util.keyboard 10367 * @requires foundation.util.imageLoader if tabs contain images 10368 */ 10369 10370var Tabs = 10371/*#__PURE__*/ 10372function (_Plugin) { 10373 _inherits(Tabs, _Plugin); 10374 10375 function Tabs() { 10376 _classCallCheck(this, Tabs); 10377 10378 return _possibleConstructorReturn(this, _getPrototypeOf(Tabs).apply(this, arguments)); 10379 } 10380 10381 _createClass(Tabs, [{ 10382 key: "_setup", 10383 10384 /** 10385 * Creates a new instance of tabs. 10386 * @class 10387 * @name Tabs 10388 * @fires Tabs#init 10389 * @param {jQuery} element - jQuery object to make into tabs. 10390 * @param {Object} options - Overrides to the default plugin settings. 10391 */ 10392 value: function _setup(element, options) { 10393 this.$element = element; 10394 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Tabs.defaults, this.$element.data(), options); 10395 this.className = 'Tabs'; // ie9 back compat 10396 10397 this._init(); 10398 10399 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].register('Tabs', { 10400 'ENTER': 'open', 10401 'SPACE': 'open',
vendor: 13,635 bytes, lines 10402-10824
10402 'ARROW_RIGHT': 'next', 10403 'ARROW_UP': 'previous', 10404 'ARROW_DOWN': 'next', 10405 'ARROW_LEFT': 'previous' // 'TAB': 'next', 10406 // 'SHIFT_TAB': 'previous' 10407 10408 }); 10409 } 10410 /** 10411 * Initializes the tabs by showing and focusing (if autoFocus=true) the preset active tab. 10412 * @private 10413 */ 10414 10415 }, { 10416 key: "_init", 10417 value: function _init() { 10418 var _this2 = this; 10419 10420 var _this = this; 10421 10422 this._isInitializing = true; 10423 this.$element.attr({ 10424 'role': 'tablist' 10425 }); 10426 this.$tabTitles = this.$element.find(".".concat(this.options.linkClass)); 10427 this.$tabContent = jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-tabs-content=\"".concat(this.$element[0].id, "\"]")); 10428 this.$tabTitles.each(function () { 10429 var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 10430 $link = $elem.find('a'), 10431 isActive = $elem.hasClass("".concat(_this.options.linkActiveClass)), 10432 hash = $link.attr('data-tabs-target') || $link[0].hash.slice(1), 10433 linkId = $link[0].id ? $link[0].id : "".concat(hash, "-label"), 10434 $tabContent = jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(hash)); 10435 $elem.attr({ 10436 'role': 'presentation' 10437 }); 10438 $link.attr({ 10439 'role': 'tab', 10440 'aria-controls': hash, 10441 'aria-selected': isActive, 10442 'id': linkId, 10443 'tabindex': isActive ? '0' : '-1' 10444 }); 10445 $tabContent.attr({ 10446 'role': 'tabpanel', 10447 'aria-labelledby': linkId 10448 }); // Save up the initial hash to return to it later when going back in history 10449 10450 if (isActive) { 10451 _this._initialAnchor = "#".concat(hash); 10452 } 10453 10454 if (!isActive) { 10455 $tabContent.attr('aria-hidden', 'true'); 10456 } 10457 10458 if (isActive && _this.options.autoFocus) { 10459 _this.onLoadListener = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () { 10460 jquery__WEBPACK_IMPORTED_MODULE_0___default()('html, body').animate({ 10461 scrollTop: $elem.offset().top 10462 }, _this.options.deepLinkSmudgeDelay, function () { 10463 $link.focus(); 10464 }); 10465 }); 10466 } 10467 }); 10468 10469 if (this.options.matchHeight) { 10470 var $images = this.$tabContent.find('img'); 10471 10472 if ($images.length) { 10473 Object(_foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_3__["onImagesLoaded"])($images, this._setHeight.bind(this)); 10474 } else { 10475 this._setHeight(); 10476 } 10477 } // Current context-bound function to open tabs on page load or history hashchange 10478 10479 10480 this._checkDeepLink = function () { 10481 var anchor = window.location.hash; 10482 10483 if (!anchor.length) { 10484 // If we are still initializing and there is no anchor, then there is nothing to do 10485 if (_this2._isInitializing) return; // Otherwise, move to the initial anchor 10486 10487 if (_this2._initialAnchor) anchor = _this2._initialAnchor; 10488 } 10489 10490 var $anchor = anchor && jquery__WEBPACK_IMPORTED_MODULE_0___default()(anchor); 10491 10492 var $link = anchor && _this2.$element.find('[href$="' + anchor + '"]'); // Whether the anchor element that has been found is part of this element 10493 10494 10495 var isOwnAnchor = !!($anchor.length && $link.length); // If there is an anchor for the hash, select it 10496 10497 if ($anchor && $anchor.length && $link && $link.length) { 10498 _this2.selectTab($anchor, true); 10499 } // Otherwise, collapse everything 10500 else { 10501 _this2._collapse(); 10502 } 10503 10504 if (isOwnAnchor) { 10505 // Roll up a little to show the titles 10506 if (_this2.options.deepLinkSmudge) { 10507 var offset = _this2.$element.offset(); 10508 10509 jquery__WEBPACK_IMPORTED_MODULE_0___default()('html, body').animate({ 10510 scrollTop: offset.top 10511 }, _this2.options.deepLinkSmudgeDelay); 10512 } 10513 /** 10514 * Fires when the plugin has deeplinked at pageload 10515 * @event Tabs#deeplink 10516 */ 10517 10518 10519 _this2.$element.trigger('deeplink.zf.tabs', [$link, $anchor]); 10520 } 10521 }; //use browser to open a tab, if it exists in this tabset 10522 10523 10524 if (this.options.deepLink) { 10525 this._checkDeepLink(); 10526 } 10527 10528 this._events(); 10529 10530 this._isInitializing = false; 10531 } 10532 /** 10533 * Adds event handlers for items within the tabs. 10534 * @private 10535 */ 10536 10537 }, { 10538 key: "_events", 10539 value: function _events() { 10540 this._addKeyHandler(); 10541 10542 this._addClickHandler(); 10543 10544 this._setHeightMqHandler = null; 10545 10546 if (this.options.matchHeight) { 10547 this._setHeightMqHandler = this._setHeight.bind(this); 10548 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', this._setHeightMqHandler); 10549 } 10550 10551 if (this.options.deepLink) { 10552 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('hashchange', this._checkDeepLink); 10553 } 10554 } 10555 /** 10556 * Adds click handlers for items within the tabs. 10557 * @private 10558 */ 10559 10560 }, { 10561 key: "_addClickHandler", 10562 value: function _addClickHandler() { 10563 var _this = this; 10564 10565 this.$element.off('click.zf.tabs').on('click.zf.tabs', ".".concat(this.options.linkClass), function (e) { 10566 e.preventDefault(); 10567 e.stopPropagation(); 10568 10569 _this._handleTabChange(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)); 10570 }); 10571 } 10572 /** 10573 * Adds keyboard event handlers for items within the tabs. 10574 * @private 10575 */ 10576 10577 }, { 10578 key: "_addKeyHandler", 10579 value: function _addKeyHandler() { 10580 var _this = this; 10581 10582 this.$tabTitles.off('keydown.zf.tabs').on('keydown.zf.tabs', function (e) { 10583 if (e.which === 9) return; 10584 var $element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 10585 $elements = $element.parent('ul').children('li'), 10586 $prevElement, 10587 $nextElement; 10588 $elements.each(function (i) { 10589 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is($element)) { 10590 if (_this.options.wrapOnKeys) { 10591 $prevElement = i === 0 ? $elements.last() : $elements.eq(i - 1); 10592 $nextElement = i === $elements.length - 1 ? $elements.first() : $elements.eq(i + 1); 10593 } else { 10594 $prevElement = $elements.eq(Math.max(0, i - 1)); 10595 $nextElement = $elements.eq(Math.min(i + 1, $elements.length - 1)); 10596 } 10597 10598 return; 10599 } 10600 }); // handle keyboard event with keyboard util 10601 10602 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__["Keyboard"].handleKey(e, 'Tabs', { 10603 open: function open() { 10604 $element.find('[role="tab"]').focus(); 10605 10606 _this._handleTabChange($element); 10607 }, 10608 previous: function previous() { 10609 $prevElement.find('[role="tab"]').focus(); 10610 10611 _this._handleTabChange($prevElement); 10612 }, 10613 next: function next() { 10614 $nextElement.find('[role="tab"]').focus(); 10615 10616 _this._handleTabChange($nextElement); 10617 }, 10618 handled: function handled() { 10619 e.stopPropagation(); 10620 e.preventDefault(); 10621 } 10622 }); 10623 }); 10624 } 10625 /** 10626 * Opens the tab `$targetContent` defined by `$target`. Collapses active tab. 10627 * @param {jQuery} $target - Tab to open. 10628 * @param {boolean} historyHandled - browser has already handled a history update 10629 * @fires Tabs#change 10630 * @function 10631 */ 10632 10633 }, { 10634 key: "_handleTabChange", 10635 value: function _handleTabChange($target, historyHandled) { 10636 // With `activeCollapse`, if the target is the active Tab, collapse it. 10637 if ($target.hasClass("".concat(this.options.linkActiveClass))) { 10638 if (this.options.activeCollapse) { 10639 this._collapse(); 10640 } 10641 10642 return; 10643 } 10644 10645 var $oldTab = this.$element.find(".".concat(this.options.linkClass, ".").concat(this.options.linkActiveClass)), 10646 $tabLink = $target.find('[role="tab"]'), 10647 target = $tabLink.attr('data-tabs-target'), 10648 anchor = target && target.length ? "#".concat(target) : $tabLink[0].hash, 10649 $targetContent = this.$tabContent.find(anchor); //close old tab 10650 10651 this._collapseTab($oldTab); //open new tab 10652 10653 10654 this._openTab($target); //either replace or update browser history 10655 10656 10657 if (this.options.deepLink && !historyHandled) { 10658 if (this.options.updateHistory) { 10659 history.pushState({}, '', anchor); 10660 } else { 10661 history.replaceState({}, '', anchor); 10662 } 10663 } 10664 /** 10665 * Fires when the plugin has successfully changed tabs. 10666 * @event Tabs#change 10667 */ 10668 10669 10670 this.$element.trigger('change.zf.tabs', [$target, $targetContent]); //fire to children a mutation event 10671 10672 $targetContent.find("[data-mutate]").trigger("mutateme.zf.trigger"); 10673 } 10674 /** 10675 * Opens the tab `$targetContent` defined by `$target`. 10676 * @param {jQuery} $target - Tab to open. 10677 * @function 10678 */ 10679 10680 }, { 10681 key: "_openTab", 10682 value: function _openTab($target) { 10683 var $tabLink = $target.find('[role="tab"]'), 10684 hash = $tabLink.attr('data-tabs-target') || $tabLink[0].hash.slice(1), 10685 $targetContent = this.$tabContent.find("#".concat(hash)); 10686 $target.addClass("".concat(this.options.linkActiveClass)); 10687 $tabLink.attr({ 10688 'aria-selected': 'true', 10689 'tabindex': '0' 10690 }); 10691 $targetContent.addClass("".concat(this.options.panelActiveClass)).removeAttr('aria-hidden'); 10692 } 10693 /** 10694 * Collapses `$targetContent` defined by `$target`. 10695 * @param {jQuery} $target - Tab to collapse. 10696 * @function 10697 */ 10698 10699 }, { 10700 key: "_collapseTab", 10701 value: function _collapseTab($target) { 10702 var $target_anchor = $target.removeClass("".concat(this.options.linkActiveClass)).find('[role="tab"]').attr({ 10703 'aria-selected': 'false', 10704 'tabindex': -1 10705 }); 10706 jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat($target_anchor.attr('aria-controls'))).removeClass("".concat(this.options.panelActiveClass)).attr({ 10707 'aria-hidden': 'true' 10708 }); 10709 } 10710 /** 10711 * Collapses the active Tab. 10712 * @fires Tabs#collapse 10713 * @function 10714 */ 10715 10716 }, { 10717 key: "_collapse", 10718 value: function _collapse() { 10719 var $activeTab = this.$element.find(".".concat(this.options.linkClass, ".").concat(this.options.linkActiveClass)); 10720 10721 if ($activeTab.length) { 10722 this._collapseTab($activeTab); 10723 /** 10724 * Fires when the plugin has successfully collapsed tabs. 10725 * @event Tabs#collapse 10726 */ 10727 10728 10729 this.$element.trigger('collapse.zf.tabs', [$activeTab]); 10730 } 10731 } 10732 /** 10733 * Public method for selecting a content pane to display. 10734 * @param {jQuery | String} elem - jQuery object or string of the id of the pane to display. 10735 * @param {boolean} historyHandled - browser has already handled a history update 10736 * @function 10737 */ 10738 10739 }, { 10740 key: "selectTab", 10741 value: function selectTab(elem, historyHandled) { 10742 var idStr; 10743 10744 if (_typeof(elem) === 'object') { 10745 idStr = elem[0].id; 10746 } else { 10747 idStr = elem; 10748 } 10749 10750 if (idStr.indexOf('#') < 0) { 10751 idStr = "#".concat(idStr); 10752 } 10753 10754 var $target = this.$tabTitles.has("[href$=\"".concat(idStr, "\"]")); 10755 10756 this._handleTabChange($target, historyHandled); 10757 } 10758 }, { 10759 key: "_setHeight", 10760 10761 /** 10762 * Sets the height of each panel to the height of the tallest panel. 10763 * If enabled in options, gets called on media query change. 10764 * If loading content via external source, can be called directly or with _reflow. 10765 * If enabled with `data-match-height="true"`, tabs sets to equal height 10766 * @function 10767 * @private 10768 */ 10769 value: function _setHeight() { 10770 var max = 0, 10771 _this = this; // Lock down the `this` value for the root tabs object 10772 10773 10774 this.$tabContent.find(".".concat(this.options.panelClass)).css('height', '').each(function () { 10775 var panel = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 10776 isActive = panel.hasClass("".concat(_this.options.panelActiveClass)); // get the options from the parent instead of trying to get them from the child 10777 10778 if (!isActive) { 10779 panel.css({ 10780 'visibility': 'hidden', 10781 'display': 'block' 10782 }); 10783 } 10784 10785 var temp = this.getBoundingClientRect().height; 10786 10787 if (!isActive) { 10788 panel.css({ 10789 'visibility': '', 10790 'display': '' 10791 }); 10792 } 10793 10794 max = temp > max ? temp : max; 10795 }).css('height', "".concat(max, "px")); 10796 } 10797 /** 10798 * Destroys an instance of tabs. 10799 * @fires Tabs#destroyed 10800 */ 10801 10802 }, { 10803 key: "_destroy", 10804 value: function _destroy() { 10805 this.$element.find(".".concat(this.options.linkClass)).off('.zf.tabs').hide().end().find(".".concat(this.options.panelClass)).hide(); 10806 10807 if (this.options.matchHeight) { 10808 if (this._setHeightMqHandler != null) { 10809 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('changed.zf.mediaquery', this._setHeightMqHandler); 10810 } 10811 } 10812 10813 if (this.options.deepLink) { 10814 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('hashchange', this._checkDeepLink); 10815 } 10816 10817 if (this.onLoadListener) { 10818 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(this.onLoadListener); 10819 } 10820 } 10821 }]); 10822 10823 return Tabs; 10824}
10824(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__["Plugin"]); 10825 10826Tabs.defaults = { 10827 /** 10828 * Link the location hash to the active pane. 10829 * Set the location hash when the active pane changes, and open the corresponding pane when the location changes. 10830 * @option 10831 * @type {boolean} 10832 * @default false 10833 */ 10834 deepLink: false, 10835 10836 /** 10837 * If `deepLink` is enabled, adjust the deep link scroll to make sure the top of the tab panel is visible 10838 * @option 10839 * @type {boolean} 10840 * @default false 10841 */ 10842 deepLinkSmudge: false, 10843 10844 /** 10845 * If `deepLinkSmudge` is enabled, animation time (ms) for the deep link adjustment 10846 * @option 10847 * @type {number} 10848 * @default 300 10849 */ 10850 deepLinkSmudgeDelay: 300, 10851 10852 /** 10853 * If `deepLink` is enabled, update the browser history with the open tab 10854 * @option 10855 * @type {boolean} 10856 * @default false 10857 */ 10858 updateHistory: false, 10859 10860 /** 10861 * Allows the window to scroll to content of active pane on load. 10862 * Not recommended if more than one tab panel per page. 10863 * @option 10864 * @type {boolean} 10865 * @default false 10866 */ 10867 autoFocus: false, 10868 10869 /** 10870 * Allows keyboard input to 'wrap' around the tab links. 10871 * @option 10872 * @type {boolean} 10873 * @default true 10874 */ 10875 wrapOnKeys: true, 10876 10877 /** 10878 * Allows the tab content panes to match heights if set to true. 10879 * @option 10880 * @type {boolean} 10881 * @default false 10882 */ 10883 matchHeight: false, 10884 10885 /** 10886 * Allows active tabs to collapse when clicked. 10887 * @option 10888 * @type {boolean} 10889 * @default false 10890 */ 10891 activeCollapse: false, 10892 10893 /** 10894 * Class applied to `li`'s in tab link list. 10895 * @option 10896 * @type {string} 10897 * @default 'tabs-title' 10898 */ 10899 linkClass: 'tabs-title', 10900 10901 /** 10902 * Class applied to the active `li` in tab link list. 10903 * @option 10904 * @type {string} 10905 * @default 'is-active' 10906 */ 10907 linkActiveClass: 'is-active', 10908 10909 /** 10910 * Class applied to the content containers. 10911 * @option 10912 * @type {string} 10913 * @default 'tabs-panel' 10914 */ 10915 panelClass: 'tabs-panel', 10916 10917 /** 10918 * Class applied to the active content container. 10919 * @option 10920 * @type {string} 10921 * @default 'is-active' 10922 */ 10923 panelActiveClass: 'is-active' 10924}; 10925 10926 10927/***/ }), 10928
10929/***/ "./js/foundation.toggler.js": 10930/*!**********************************!*\ 10931 !*** ./js/foundation.toggler.js ***! 10932 \**********************************/ 10933/*! exports provided: Toggler */ 10934/***/ (function(module, __webpack_exports__, __webpack_require__) { 10935 10936"use strict"; 10937__webpack_require__.r(__webpack_exports__); 10938/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Toggler", function() { return Toggler; }); 10939/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 10940/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 10941/* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.motion */ "./js/foundation.util.motion.js"); 10942/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 10943/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 10944/* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js"); 10945 10946 10947function _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); } 10948 10949function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 10950 10951function _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); } } 10952 10953function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 10954 10955function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 10956 10957function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 10958 10959function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 10960 10961function _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); } 10962 10963function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 10964 10965 10966 10967 10968 10969 10970/** 10971 * Toggler module. 10972 * @module foundation.toggler 10973 * @requires foundation.util.motion 10974 * @requires foundation.util.triggers 10975 */ 10976 10977var Toggler = 10978/*#__PURE__*/ 10979function (_Plugin) { 10980 _inherits(Toggler, _Plugin); 10981 10982 function Toggler() { 10983 _classCallCheck(this, Toggler); 10984 10985 return _possibleConstructorReturn(this, _getPrototypeOf(Toggler).apply(this, arguments)); 10986 } 10987 10988 _createClass(Toggler, [{ 10989 key: "_setup", 10990 10991 /** 10992 * Creates a new instance of Toggler. 10993 * @class 10994 * @name Toggler 10995 * @fires Toggler#init 10996 * @param {Object} element - jQuery object to add the trigger to. 10997 * @param {Object} options - Overrides to the default plugin settings. 10998 */ 10999 value: function _setup(element, options) { 11000 this.$element = element; 11001 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Toggler.defaults, element.data(), options); 11002 this.className = ''; 11003 this.className = 'Toggler'; // ie9 back compat 11004 // Triggers init is idempotent, just need to make sure it is initialized 11005 11006 _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 11007 11008 this._init(); 11009 11010 this._events(); 11011 } 11012 /** 11013 * Initializes the Toggler plugin by parsing the toggle class from data-toggler, or animation classes from data-animate. 11014 * @function 11015 * @private 11016 */ 11017 11018 }, { 11019 key: "_init", 11020 value: function _init() { 11021 var input; // Parse animation classes if they were set 11022 11023 if (this.options.animate) { 11024 input = this.options.animate.split(' '); 11025 this.animationIn = input[0]; 11026 this.animationOut = input[1] || null; 11027 } // Otherwise, parse toggle class 11028 else { 11029 input = this.$element.data('toggler'); // Allow for a . at the beginning of the string 11030 11031 this.className = input[0] === '.' ? input.slice(1) : input; 11032 } // Add ARIA attributes to triggers: 11033 11034 11035 var id = this.$element[0].id, 11036 $triggers = jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-open~=\"".concat(id, "\"], [data-close~=\"").concat(id, "\"], [data-toggle~=\"").concat(id, "\"]")); // - aria-expanded: according to the element visibility. 11037 11038 $triggers.attr('aria-expanded', !this.$element.is(':hidden')); // - aria-controls: adding the element id to it if not already in it. 11039 11040 $triggers.each(function (index, trigger) { 11041 var $trigger = jquery__WEBPACK_IMPORTED_MODULE_0___default()(trigger); 11042 var controls = $trigger.attr('aria-controls') || ''; 11043 var containsId = new RegExp("\\b".concat(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["RegExpEscape"])(id), "\\b")).test(control
vendor: 2,997 bytes, lines 11043-11150
11043s); 11044 if (!containsId) $trigger.attr('aria-controls', controls ? "".concat(controls, " ").concat(id) : id); 11045 }); 11046 } 11047 /** 11048 * Initializes events for the toggle trigger. 11049 * @function 11050 * @private 11051 */ 11052 11053 }, { 11054 key: "_events", 11055 value: function _events() { 11056 this.$element.off('toggle.zf.trigger').on('toggle.zf.trigger', this.toggle.bind(this)); 11057 } 11058 /** 11059 * 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". 11060 * @function 11061 * @fires Toggler#on 11062 * @fires Toggler#off 11063 */ 11064 11065 }, { 11066 key: "toggle", 11067 value: function toggle() { 11068 this[this.options.animate ? '_toggleAnimate' : '_toggleClass'](); 11069 } 11070 }, { 11071 key: "_toggleClass", 11072 value: function _toggleClass() { 11073 this.$element.toggleClass(this.className); 11074 var isOn = this.$element.hasClass(this.className); 11075 11076 if (isOn) { 11077 /** 11078 * Fires if the target element has the class after a toggle. 11079 * @event Toggler#on 11080 */ 11081 this.$element.trigger('on.zf.toggler'); 11082 } else { 11083 /** 11084 * Fires if the target element does not have the class after a toggle. 11085 * @event Toggler#off 11086 */ 11087 this.$element.trigger('off.zf.toggler'); 11088 } 11089 11090 this._updateARIA(isOn); 11091 11092 this.$element.find('[data-mutate]').trigger('mutateme.zf.trigger'); 11093 } 11094 }, { 11095 key: "_toggleAnimate", 11096 value: function _toggleAnimate() { 11097 var _this = this; 11098 11099 if (this.$element.is(':hidden')) { 11100 _foundation_util_motion__WEBPACK_IMPORTED_MODULE_1__["Motion"].animateIn(this.$element, this.animationIn, function () { 11101 _this._updateARIA(true); 11102 11103 this.trigger('on.zf.toggler'); 11104 this.find('[data-mutate]').trigger('mutateme.zf.trigger'); 11105 }); 11106 } else { 11107 _foundation_util_motion__WEBPACK_IMPORTED_MODULE_1__["Motion"].animateOut(this.$element, this.animationOut, function () { 11108 _this._updateARIA(false); 11109 11110 this.trigger('off.zf.toggler'); 11111 this.find('[data-mutate]').trigger('mutateme.zf.trigger'); 11112 }); 11113 } 11114 } 11115 }, { 11116 key: "_updateARIA", 11117 value: function _updateARIA(isOn) { 11118 var id = this.$element[0].id; 11119 jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-open=\"".concat(id, "\"], [data-close=\"").concat(id, "\"], [data-toggle=\"").concat(id, "\"]")).attr({ 11120 'aria-expanded': isOn ? true : false 11121 }); 11122 } 11123 /** 11124 * Destroys the instance of Toggler on the element. 11125 * @function 11126 */ 11127 11128 }, { 11129 key: "_destroy", 11130 value: function _destroy() { 11131 this.$element.off('.zf.toggler'); 11132 } 11133 }]); 11134 11135 return Toggler; 11136}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__["Plugin"]); 11137 11138Toggler.defaults = { 11139 /** 11140 * Tells the plugin if the element should animated when toggled. 11141 * @option 11142 * @type {boolean} 11143 * @default false 11144 */ 11145 animate: false 11146}; 11147 11148 11149/***/ }), 11150
vendor: 5,183 bytes, lines 11151-11231
11151/***/ "./js/foundation.tooltip.js": 11152/*!**********************************!*\ 11153 !*** ./js/foundation.tooltip.js ***! 11154 \**********************************/ 11155/*! exports provided: Tooltip */ 11156/***/ (function(module, __webpack_exports__, __webpack_require__) { 11157 11158"use strict"; 11159__webpack_require__.r(__webpack_exports__); 11160/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Tooltip", function() { return Tooltip; }); 11161/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 11162/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 11163/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 11164/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js"); 11165/* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js"); 11166/* harmony import */ var _foundation_positionable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.positionable */ "./js/foundation.positionable.js"); 11167 11168 11169function _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); } 11170 11171function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 11172 11173function _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); } } 11174 11175function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 11176 11177function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 11178 11179function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 11180 11181function _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); } 11182 11183function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 11184 11185function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 11186 11187function _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); } 11188 11189function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 11190 11191 11192 11193 11194 11195 11196/** 11197 * Tooltip module. 11198 * @module foundation.tooltip 11199 * @requires foundation.util.box 11200 * @requires foundation.util.mediaQuery 11201 * @requires foundation.util.triggers 11202 */ 11203 11204var Tooltip = 11205/*#__PURE__*/ 11206function (_Positionable) { 11207 _inherits(Tooltip, _Positionable); 11208 11209 function Tooltip() { 11210 _classCallCheck(this, Tooltip); 11211 11212 return _possibleConstructorReturn(this, _getPrototypeOf(Tooltip).apply(this, arguments)); 11213 } 11214 11215 _createClass(Tooltip, [{ 11216 key: "_setup", 11217 11218 /** 11219 * Creates a new instance of a Tooltip. 11220 * @class 11221 * @name Tooltip 11222 * @fires Tooltip#init 11223 * @param {jQuery} element - jQuery object to attach a tooltip to. 11224 * @param {Object} options - object to extend the default configuration. 11225 */ 11226 value: function _setup(element, options) { 11227 this.$element = element; 11228 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Tooltip.defaults, this.$element.data(), options); 11229 this.className = 'Tooltip'; // ie9 back compat 11230 11231 this.isActive = false;
vendor: 4,267 bytes, lines 11232-11351
11232 this.isClick = false; // Triggers init is idempotent, just need to make sure it is initialized 11233 11234 _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_3__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 11235 11236 this._init(); 11237 } 11238 /** 11239 * Initializes the tooltip by setting the creating the tip element, adding it's text, setting private variables and setting attributes on the anchor. 11240 * @private 11241 */ 11242 11243 }, { 11244 key: "_init", 11245 value: function _init() { 11246 _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__["MediaQuery"]._init(); 11247 11248 var elemId = this.$element.attr('aria-describedby') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["GetYoDigits"])(6, 'tooltip'); 11249 this.options.tipText = this.options.tipText || this.$element.attr('title'); 11250 this.template = this.options.template ? jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.options.template) : this._buildTemplate(elemId); 11251 11252 if (this.options.allowHtml) { 11253 this.template.appendTo(document.body).html(this.options.tipText).hide(); 11254 } else { 11255 this.template.appendTo(document.body).text(this.options.tipText).hide(); 11256 } 11257 11258 this.$element.attr({ 11259 'title': '', 11260 'aria-describedby': elemId, 11261 'data-yeti-box': elemId, 11262 'data-toggle': elemId, 11263 'data-resize': elemId 11264 }).addClass(this.options.triggerClass); 11265 11266 _get(_getPrototypeOf(Tooltip.prototype), "_init", this).call(this); 11267 11268 this._events(); 11269 } 11270 }, { 11271 key: "_getDefaultPosition", 11272 value: function _getDefaultPosition() { 11273 // handle legacy classnames 11274 var position = this.$element[0].className.match(/\b(top|left|right|bottom)\b/g); 11275 return position ? position[0] : 'top'; 11276 } 11277 }, { 11278 key: "_getDefaultAlignment", 11279 value: function _getDefaultAlignment() { 11280 return 'center'; 11281 } 11282 }, { 11283 key: "_getHOffset", 11284 value: function _getHOffset() { 11285 if (this.position === 'left' || this.position === 'right') { 11286 return this.options.hOffset + this.options.tooltipWidth; 11287 } else { 11288 return this.options.hOffset; 11289 } 11290 } 11291 }, { 11292 key: "_getVOffset", 11293 value: function _getVOffset() { 11294 if (this.position === 'top' || this.position === 'bottom') { 11295 return this.options.vOffset + this.options.tooltipHeight; 11296 } else { 11297 return this.options.vOffset; 11298 } 11299 } 11300 /** 11301 * builds the tooltip element, adds attributes, and returns the template. 11302 * @private 11303 */ 11304 11305 }, { 11306 key: "_buildTemplate", 11307 value: function _buildTemplate(id) { 11308 var templateClasses = "".concat(this.options.tooltipClass, " ").concat(this.options.templateClasses).trim(); 11309 var $template = jquery__WEBPACK_IMPORTED_MODULE_0___default()('<div></div>').addClass(templateClasses).attr({ 11310 'role': 'tooltip', 11311 'aria-hidden': true, 11312 'data-is-active': false, 11313 'data-is-focus': false, 11314 'id': id 11315 }); 11316 return $template; 11317 } 11318 /** 11319 * 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. 11320 * if the tooltip is larger than the screen width, default to full width - any user selected margin 11321 * @private 11322 */ 11323 11324 }, { 11325 key: "_setPosition", 11326 value: function _setPosition() { 11327 _get(_getPrototypeOf(Tooltip.prototype), "_setPosition", this).call(this, this.$element, this.template); 11328 } 11329 /** 11330 * reveals the tooltip, and fires an event to close any other open tooltips on the page 11331 * @fires Tooltip#closeme 11332 * @fires Tooltip#show 11333 * @function 11334 */ 11335 11336 }, { 11337 key: "show", 11338 value: function show() { 11339 if (this.options.showOn !== 'all' && !_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__["MediaQuery"].is(this.options.showOn)) { 11340 // console.error('The screen is too small to display this tooltip'); 11341 return false; 11342 } 11343 11344 var _this = this; 11345 11346 this.template.css('visibility', 'hidden').show(); 11347 11348 this._setPosition(); 11349 11350 this.template.removeClass('top bottom left right').addClass(this.position); 11351 this.template.removeClass('align-top align-bottom align-left align-right al
vendor: 1,424 bytes, lines 11351-11400
11351ign-center').addClass('align-' + this.alignment); 11352 /** 11353 * Fires to close all other open tooltips on the page 11354 * @event Closeme#tooltip 11355 */ 11356 11357 this.$element.trigger('closeme.zf.tooltip', this.template.attr('id')); 11358 this.template.attr({ 11359 'data-is-active': true, 11360 'aria-hidden': false 11361 }); 11362 _this.isActive = true; // console.log(this.template); 11363 11364 this.template.stop().hide().css('visibility', '').fadeIn(this.options.fadeInDuration, function () {//maybe do stuff? 11365 }); 11366 /** 11367 * Fires when the tooltip is shown 11368 * @event Tooltip#show 11369 */ 11370 11371 this.$element.trigger('show.zf.tooltip'); 11372 } 11373 /** 11374 * Hides the current tooltip, and resets the positioning class if it was changed due to collision 11375 * @fires Tooltip#hide 11376 * @function 11377 */ 11378 11379 }, { 11380 key: "hide", 11381 value: function hide() { 11382 // console.log('hiding', this.$element.data('yeti-box')); 11383 var _this = this; 11384 11385 this.template.stop().attr({ 11386 'aria-hidden': true, 11387 'data-is-active': false 11388 }).fadeOut(this.options.fadeOutDuration, function () { 11389 _this.isActive = false; 11390 _this.isClick = false; 11391 }); 11392 /** 11393 * fires when the tooltip is hidden 11394 * @event Tooltip#hide 11395 */ 11396 11397 this.$element.trigger('hide.zf.tooltip'); 11398 } 11399 /** 11400 * adds event listeners for the tooltip and its anchor
vendor: 6,198 bytes, lines 11401-11645
11401 * TODO combine some of the listeners like focus and mouseenter, etc. 11402 * @private 11403 */ 11404 11405 }, { 11406 key: "_events", 11407 value: function _events() { 11408 var _this = this; 11409 11410 var $template = this.template; 11411 var isFocus = false; 11412 11413 if (!this.options.disableHover) { 11414 this.$element.on('mouseenter.zf.tooltip', function (e) { 11415 if (!_this.isActive) { 11416 _this.timeout = setTimeout(function () { 11417 _this.show(); 11418 }, _this.options.hoverDelay); 11419 } 11420 }).on('mouseleave.zf.tooltip', Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["ignoreMousedisappear"])(function (e) { 11421 clearTimeout(_this.timeout); 11422 11423 if (!isFocus || _this.isClick && !_this.options.clickOpen) { 11424 _this.hide(); 11425 } 11426 })); 11427 } 11428 11429 if (this.options.clickOpen) { 11430 this.$element.on('mousedown.zf.tooltip', function (e) { 11431 e.stopImmediatePropagation(); 11432 11433 if (_this.isClick) {//_this.hide(); 11434 // _this.isClick = false; 11435 } else { 11436 _this.isClick = true; 11437 11438 if ((_this.options.disableHover || !_this.$element.attr('tabindex')) && !_this.isActive) { 11439 _this.show(); 11440 } 11441 } 11442 }); 11443 } else { 11444 this.$element.on('mousedown.zf.tooltip', function (e) { 11445 e.stopImmediatePropagation(); 11446 _this.isClick = true; 11447 }); 11448 } 11449 11450 if (!this.options.disableForTouch) { 11451 this.$element.on('tap.zf.tooltip touchend.zf.tooltip', function (e) { 11452 _this.isActive ? _this.hide() : _this.show(); 11453 }); 11454 } 11455 11456 this.$element.on({ 11457 // 'toggle.zf.trigger': this.toggle.bind(this), 11458 // 'close.zf.trigger': this.hide.bind(this) 11459 'close.zf.trigger': this.hide.bind(this) 11460 }); 11461 this.$element.on('focus.zf.tooltip', function (e) { 11462 isFocus = true; 11463 11464 if (_this.isClick) { 11465 // If we're not showing open on clicks, we need to pretend a click-launched focus isn't 11466 // a real focus, otherwise on hover and come back we get bad behavior 11467 if (!_this.options.clickOpen) { 11468 isFocus = false; 11469 } 11470 11471 return false; 11472 } else { 11473 _this.show(); 11474 } 11475 }).on('focusout.zf.tooltip', function (e) { 11476 isFocus = false; 11477 _this.isClick = false; 11478 11479 _this.hide(); 11480 }).on('resizeme.zf.trigger', function () { 11481 if (_this.isActive) { 11482 _this._setPosition(); 11483 } 11484 }); 11485 } 11486 /** 11487 * adds a toggle method, in addition to the static show() & hide() functions 11488 * @function 11489 */ 11490 11491 }, { 11492 key: "toggle", 11493 value: function toggle() { 11494 if (this.isActive) { 11495 this.hide(); 11496 } else { 11497 this.show(); 11498 } 11499 } 11500 /** 11501 * Destroys an instance of tooltip, removes template element from the view. 11502 * @function 11503 */ 11504 11505 }, { 11506 key: "_destroy", 11507 value: function _destroy() { 11508 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'); 11509 this.template.remove(); 11510 } 11511 }]); 11512 11513 return Tooltip; 11514}(_foundation_positionable__WEBPACK_IMPORTED_MODULE_4__["Positionable"]); 11515 11516Tooltip.defaults = { 11517 disableForTouch: false, 11518 11519 /** 11520 * Time, in ms, before a tooltip should open on hover. 11521 * @option 11522 * @type {number} 11523 * @default 200 11524 */ 11525 hoverDelay: 200, 11526 11527 /** 11528 * Time, in ms, a tooltip should take to fade into view. 11529 * @option 11530 * @type {number} 11531 * @default 150 11532 */ 11533 fadeInDuration: 150, 11534 11535 /** 11536 * Time, in ms, a tooltip should take to fade out of view. 11537 * @option 11538 * @type {number} 11539 * @default 150 11540 */ 11541 fadeOutDuration: 150, 11542 11543 /** 11544 * Disables hover events from opening the tooltip if set to true 11545 * @option 11546 * @type {boolean} 11547 * @default false 11548 */ 11549 disableHover: false, 11550 11551 /** 11552 * Optional addtional classes to apply to the tooltip template on init. 11553 * @option 11554 * @type {string} 11555 * @default '' 11556 */ 11557 templateClasses: '', 11558 11559 /** 11560 * Non-optional class added to tooltip templates. Foundation default is 'tooltip'. 11561 * @option 11562 * @type {string} 11563 * @default 'tooltip' 11564 */ 11565 tooltipClass: 'tooltip', 11566 11567 /** 11568 * Class applied to the tooltip anchor element. 11569 * @option 11570 * @type {string} 11571 * @default 'has-tip' 11572 */ 11573 triggerClass: 'has-tip', 11574 11575 /** 11576 * Minimum breakpoint size at which to open the tooltip. 11577 * @option 11578 * @type {string} 11579 * @default 'small' 11580 */ 11581 showOn: 'small', 11582 11583 /** 11584 * Custom template to be used to generate markup for tooltip. 11585 * @option 11586 * @type {string} 11587 * @default '' 11588 */ 11589 template: '', 11590 11591 /** 11592 * Text displayed in the tooltip template on open. 11593 * @option 11594 * @type {string} 11595 * @default '' 11596 */ 11597 tipText: '', 11598 touchCloseText: 'Tap to close.', 11599 11600 /** 11601 * Allows the tooltip to remain open if triggered with a click or touch event. 11602 * @option 11603 * @type {boolean} 11604 * @default true 11605 */ 11606 clickOpen: true, 11607 11608 /** 11609 * Position of tooltip. Can be left, right, bottom, top, or auto. 11610 * @option 11611 * @type {string} 11612 * @default 'auto' 11613 */ 11614 position: 'auto', 11615 11616 /** 11617 * Alignment of tooltip relative to anchor. Can be left, right, bottom, top, center, or auto. 11618 * @option 11619 * @type {string} 11620 * @default 'auto' 11621 */ 11622 alignment: 'auto', 11623 11624 /** 11625 * Allow overlap of container/window. If false, tooltip will first try to 11626 * position as defined by data-position and data-alignment, but reposition if 11627 * it would cause an overflow. @option 11628 * @type {boolean} 11629 * @default false 11630 */ 11631 allowOverlap: false, 11632 11633 /** 11634 * Allow overlap of only the bottom of the container. This is the most common 11635 * behavior for dropdowns, allowing the dropdown to extend the bottom of the 11636 * screen but not otherwise influence or break out of the container. 11637 * Less common for tooltips. 11638 * @option 11639 * @type {boolean} 11640 * @default false 11641 */ 11642 allowBottomOverlap: false, 11643 11644 /** 11645 * Distance, in pixels, the template should push away from the anch
11645or on the Y axis. 11646 * @option 11647 * @type {number} 11648 * @default 0 11649 */ 11650 vOffset: 0, 11651 11652 /** 11653 * Distance, in pixels, the template should push away from the anchor on the X axis 11654 * @option 11655 * @type {number} 11656 * @default 0 11657 */ 11658 hOffset: 0, 11659 11660 /** 11661 * Distance, in pixels, the template spacing auto-adjust for a vertical tooltip 11662 * @option 11663 * @type {number} 11664 * @default 14 11665 */ 11666 tooltipHeight: 14, 11667 11668 /** 11669 * Distance, in pixels, the template spacing auto-adjust for a horizontal tooltip 11670 * @option 11671 * @type {number} 11672 * @default 12 11673 */ 11674 tooltipWidth: 12, 11675 11676 /** 11677 * Allow HTML in tooltip. Warning: If you are loading user-generated content into tooltips, 11678 * allowing HTML may open yourself up to XSS attacks. 11679 * @option 11680 * @type {boolean} 11681 * @default false 11682 */ 11683 allowHtml: false 11684}; 11685/** 11686 * TODO utilize resize event trigger 11687 */ 11688 11689 11690 11691/***/ }), 11692
vendor: 5,135 bytes, lines 11693-11829
11693/***/ "./js/foundation.util.box.js": 11694/*!***********************************!*\ 11695 !*** ./js/foundation.util.box.js ***! 11696 \***********************************/ 11697/*! exports provided: Box */ 11698/***/ (function(module, __webpack_exports__, __webpack_require__) { 11699 11700"use strict"; 11701__webpack_require__.r(__webpack_exports__); 11702/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Box", function() { return Box; }); 11703/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 11704 11705 11706 11707var Box = { 11708 ImNotTouchingYou: ImNotTouchingYou, 11709 OverlapArea: OverlapArea, 11710 GetDimensions: GetDimensions, 11711 GetOffsets: GetOffsets, 11712 GetExplicitOffsets: GetExplicitOffsets 11713 /** 11714 * Compares the dimensions of an element to a container and determines collision events with container. 11715 * @function 11716 * @param {jQuery} element - jQuery object to test for collisions. 11717 * @param {jQuery} parent - jQuery object to use as bounding container. 11718 * @param {Boolean} lrOnly - set to true to check left and right values only. 11719 * @param {Boolean} tbOnly - set to true to check top and bottom values only. 11720 * @default if no parent object passed, detects collisions with `window`. 11721 * @returns {Boolean} - true if collision free, false if a collision in any direction. 11722 */ 11723 11724}; 11725 11726function ImNotTouchingYou(element, parent, lrOnly, tbOnly, ignoreBottom) { 11727 return OverlapArea(element, parent, lrOnly, tbOnly, ignoreBottom) === 0; 11728} 11729 11730; 11731 11732function OverlapArea(element, parent, lrOnly, tbOnly, ignoreBottom) { 11733 var eleDims = GetDimensions(element), 11734 topOver, 11735 bottomOver, 11736 leftOver, 11737 rightOver; 11738 11739 if (parent) { 11740 var parDims = GetDimensions(parent); 11741 bottomOver = parDims.height + parDims.offset.top - (eleDims.offset.top + eleDims.height); 11742 topOver = eleDims.offset.top - parDims.offset.top; 11743 leftOver = eleDims.offset.left - parDims.offset.left; 11744 rightOver = parDims.width + parDims.offset.left - (eleDims.offset.left + eleDims.width); 11745 } else { 11746 bottomOver = eleDims.windowDims.height + eleDims.windowDims.offset.top - (eleDims.offset.top + eleDims.height); 11747 topOver = eleDims.offset.top - eleDims.windowDims.offset.top; 11748 leftOver = eleDims.offset.left - eleDims.windowDims.offset.left; 11749 rightOver = eleDims.windowDims.width - (eleDims.offset.left + eleDims.width); 11750 } 11751 11752 bottomOver = ignoreBottom ? 0 : Math.min(bottomOver, 0); 11753 topOver = Math.min(topOver, 0); 11754 leftOver = Math.min(leftOver, 0); 11755 rightOver = Math.min(rightOver, 0); 11756 11757 if (lrOnly) { 11758 return leftOver + rightOver; 11759 } 11760 11761 if (tbOnly) { 11762 return topOver + bottomOver; 11763 } // use sum of squares b/c we care about overlap area. 11764 11765 11766 return Math.sqrt(topOver * topOver + bottomOver * bottomOver + leftOver * leftOver + rightOver * rightOver); 11767} 11768/** 11769 * Uses native methods to return an object of dimension values. 11770 * @function 11771 * @param {jQuery || HTML} element - jQuery object or DOM element for which to get the dimensions. Can be any element other that document or window. 11772 * @returns {Object} - nested object of integer pixel values 11773 * TODO - if element is window, return only those values. 11774 */ 11775 11776 11777function GetDimensions(elem) { 11778 elem = elem.length ? elem[0] : elem; 11779 11780 if (elem === window || elem === document) { 11781 throw new Error("I'm sorry, Dave. I'm afraid I can't do that."); 11782 } 11783 11784 var rect = elem.getBoundingClientRect(), 11785 parRect = elem.parentNode.getBoundingClientRect(), 11786 winRect = document.body.getBoundingClientRect(), 11787 winY = window.pageYOffset, 11788 winX = window.pageXOffset; 11789 return { 11790 width: rect.width, 11791 height: rect.height, 11792 offset: { 11793 top: rect.top + winY, 11794 left: rect.left + winX 11795 }, 11796 parentDims: { 11797 width: parRect.width, 11798 height: parRect.height, 11799 offset: { 11800 top: parRect.top + winY, 11801 left: parRect.left + winX 11802 } 11803 }, 11804 windowDims: { 11805 width: winRect.width, 11806 height: winRect.height, 11807 offset: { 11808 top: winY, 11809 left: winX 11810 } 11811 } 11812 }; 11813} 11814/** 11815 * Returns an object of top and left integer pixel values for dynamically rendered elements, 11816 * such as: Tooltip, Reveal, and Dropdown. Maintained for backwards compatibility, and where 11817 * you don't know alignment, but generally from 11818 * 6.4 forward you should use GetExplicitOffsets, as GetOffsets conflates position and alignment. 11819 * @function 11820 * @param {jQuery} element - jQuery object for the element being positioned. 11821 * @param {jQuery} anchor - jQuery object for the element's anchor point. 11822 * @param {String} position - a string relating to the desired position of the element, relative to it's anchor 11823 * @param {Number} vOffset - integer pixel value of desired vertical separation between anchor and element. 11824 * @param {Number} hOffset - integer pixel value of desired horizontal separation between anchor and element. 11825 * @param {Boolean} isOverflow - if a collision event is detected, sets to true to default the element to full width - any desired offset. 11826 * TODO alter/rewrite to work with `em` values as well/instead of pixels 11827 */ 11828 11829
11830function GetOffsets(element, anchor, position, vOffset, hOffset, isOverflow) { 11831 console.log("NOTE: GetOffsets is deprecated in favor of GetExplicitOffsets and will be removed in 6.5"); 11832 11833 switch (position) { 11834 case 'top': 11835 return Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_0__["rtl"])() ? GetExplicitOffsets(element, anchor, 'top', 'left', vOffset, hOffset, isOverflow) : GetExplicitOffsets(element, anchor, 'top', 'right', vOffset, hOffset, isOverflow); 11836 11837 case 'bottom': 11838 return Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_0__["rtl"])() ? GetExplicitOffsets(element, anchor, 'bottom', 'left', vOffset, hOffset, isOverflow) : GetExplicitOffsets(element, anchor, 'bottom', 'right', vOffset, hOffset, isOverflow); 11839 11840 case 'center top': 11841 return GetExplicitOffsets(element, anchor, 'top', 'center', vOffset, hOffset, isOverflow); 11842 11843 case 'center bottom': 11844 return GetExplicitOffsets(element, anchor, 'bottom', 'center', vOffset, hOffset, isOverflow); 11845 11846 case 'center left': 11847 return GetExplicitOffsets(element, anchor, 'left', 'center', vOffset, hOffset, isOverflow); 11848 11849 case 'center right': 11850 return GetExplicitOffsets(element, anchor, 'right', 'center', vOffset, hOffset, isOverflow); 11851 11852 case 'left bottom': 11853 return GetExplicitOffsets(element, anchor, 'bottom', 'left', vOffset, hOffset, isOverflow); 11854 11855 case 'right bottom': 11856 return GetExplicitOffsets(element, anchor, 'bottom', 'right', vOffset, hOffset, isOverflow); 11857 // Backwards compatibility... this along with the reveal and reveal full 11858 // classes are the only ones that didn't reference anchor 11859 11860 case 'center': 11861 return { 11862 left: $eleDims.windowDims.offset.left + $eleDims.windowDims.width / 2 - $eleDims.width / 2 + hOffset, 11863 top: $eleDims.windowDims.offset.top + $eleDims.windowDims.height / 2 - ($eleDims.height / 2 + vOffset) 11864 }; 11865 11866 case 'reveal': 11867 return { 11868 left: ($eleDims.windowDims.width - $eleDims.width) / 2 + hOffset, 11869 top: $eleDims.windowDims.offset.top + vOffset 11870 }; 11871 11872 case 'reveal full': 11873 return { 11874 left: $eleDims.windowDims.offset.left, 11875 top: $eleDims.windowDims.offset.top 11876 }; 11877 break; 11878 11879 default: 11880 return { 11881 left: Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_0__["rtl"])() ? $anchorDims.offset.left - $eleDims.width + $anchorDims.width - hOffset : $anchorDims.offset.left + hOffset, 11882 top: $anchorDims.offset.top + $anchorDims.height + vOffset 11883 }; 11884 } 11885} 11886 11887function GetExplicitOffsets(element, anchor, position, alignment, vOffset, hOffset, isOverflow) { 11888 var $eleDims = GetDimensions(element), 11889 $anchorDims = anchor ? GetDimensions(anchor) : null; 11890 var topVal, leftVal; // set position related attribute 11891 11892 switch (position) { 11893 case 'top': 11894 topVal = $anchorDims.offset.top - ($eleDims.height + vOffset); 11895 break; 11896 11897 case 'bottom': 11898 topVal = $anchorDims.offset.top + $anchorDims.height + vOffset; 11899 break; 11900 11901 case 'left': 11902 leftVal = $anchorDims.offset.left - ($eleDims.width + hOffset); 11903 break; 11904 11905 case 'right': 11906 leftVal = $anchorDims.offset.left + $anchorDims.width + hOffset; 11907 break; 11908 } // set alignment related attribute 11909 11910 11911 switch (position) { 11912 case 'top': 11913 case 'bottom': 11914 switch (alignment) { 11915 case 'left': 11916 leftVal = $anchorDims.offset.left + hOffset; 11917 break; 11918 11919 case 'right': 11920 leftVal = $anchorDims.offset.left - $eleDims.width + $anchorDims.width - hOffset; 11921 break; 11922 11923 case 'center': 11924 leftVal = isOverflow ? hOffset : $anchorDims.offset.left + $anchorDims.width / 2 - $eleDims.width / 2 + hOffset; 11925 break; 11926 } 11927 11928 break; 11929 11930 case 'right': 11931 case 'left': 11932 switch (alignment) { 11933 case 'bottom': 11934 topVal = $anchorDims.offset.top - vOffset + $anchorDims.height - $eleDims.height; 11935 break; 11936 11937 case 'top': 11938 topVal = $anchorDims.offset.top + vOffset; 11939 break; 11940 11941 case 'center': 11942 topVal = $anchorDims.offset.top + vOffset + $anchorDims.height / 2 - $eleDims.height / 2; 11943 break; 11944 } 11945 11946 break; 11947 } 11948 11949 return { 11950 top: topVal, 11951 left: leftVal 11952 }; 11953} 11954 11955 11956 11957/***/ }), 11958
vendor: 7,363 bytes, lines 11959-12158
11959/***/ "./js/foundation.util.imageLoader.js": 11960/*!*******************************************!*\ 11961 !*** ./js/foundation.util.imageLoader.js ***! 11962 \*******************************************/ 11963/*! exports provided: onImagesLoaded */ 11964/***/ (function(module, __webpack_exports__, __webpack_require__) { 11965 11966"use strict"; 11967__webpack_require__.r(__webpack_exports__); 11968/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onImagesLoaded", function() { return onImagesLoaded; }); 11969/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 11970/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 11971 11972 11973 11974/** 11975 * Runs a callback function when images are fully loaded. 11976 * @param {Object} images - Image(s) to check if loaded. 11977 * @param {Func} callback - Function to execute when image is fully loaded. 11978 */ 11979 11980function onImagesLoaded(images, callback) { 11981 var self = this, 11982 unloaded = images.length; 11983 11984 if (unloaded === 0) { 11985 callback(); 11986 } 11987 11988 images.each(function () { 11989 // Check if image is loaded 11990 if (this.complete && typeof this.naturalWidth !== 'undefined') { 11991 singleImageLoaded(); 11992 } else { 11993 // If the above check failed, simulate loading on detached element. 11994 var image = new Image(); // Still count image as loaded if it finalizes with an error. 11995 11996 var events = "load.zf.images error.zf.images"; 11997 jquery__WEBPACK_IMPORTED_MODULE_0___default()(image).one(events, function me(event) { 11998 // Unbind the event listeners. We're using 'one' but only one of the two events will have fired. 11999 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).off(events, me); 12000 singleImageLoaded(); 12001 }); 12002 image.src = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('src'); 12003 } 12004 }); 12005 12006 function singleImageLoaded() { 12007 unloaded--; 12008 12009 if (unloaded === 0) { 12010 callback(); 12011 } 12012 } 12013} 12014 12015 12016 12017/***/ }), 12018 12019/***/ "./js/foundation.util.keyboard.js": 12020/*!****************************************!*\ 12021 !*** ./js/foundation.util.keyboard.js ***! 12022 \****************************************/ 12023/*! exports provided: Keyboard */ 12024/***/ (function(module, __webpack_exports__, __webpack_require__) { 12025 12026"use strict"; 12027__webpack_require__.r(__webpack_exports__); 12028/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Keyboard", function() { return Keyboard; }); 12029/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 12030/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 12031/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 12032/******************************************* 12033 * * 12034 * This util was created by Marius Olbertz * 12035 * Please thank Marius on GitHub /owlbertz * 12036 * or the web http://www.mariusolbertz.de/ * 12037 * * 12038 ******************************************/ 12039 12040 12041 12042 12043var keyCodes = { 12044 9: 'TAB', 12045 13: 'ENTER', 12046 27: 'ESCAPE', 12047 32: 'SPACE', 12048 35: 'END', 12049 36: 'HOME', 12050 37: 'ARROW_LEFT', 12051 38: 'ARROW_UP', 12052 39: 'ARROW_RIGHT', 12053 40: 'ARROW_DOWN' 12054}; 12055var commands = {}; // Functions pulled out to be referenceable from internals 12056 12057function findFocusable($element) { 12058 if (!$element) { 12059 return false; 12060 } 12061 12062 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 () { 12063 if (!jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is(':visible') || jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('tabindex') < 0) { 12064 return false; 12065 } //only have visible elements and those that have a tabindex greater or equal 0 12066 12067 12068 return true; 12069 }); 12070} 12071 12072function parseKey(event) { 12073 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 12074 12075 key = key.replace(/\W+/, ''); 12076 if (event.shiftKey) key = "SHIFT_".concat(key); 12077 if (event.ctrlKey) key = "CTRL_".concat(key); 12078 if (event.altKey) key = "ALT_".concat(key); // Remove trailing underscore, in case only modifiers were used (e.g. only `CTRL_ALT`) 12079 12080 key = key.replace(/_$/, ''); 12081 return key; 12082} 12083 12084var Keyboard = { 12085 keys: getKeyCodes(keyCodes), 12086 12087 /** 12088 * Parses the (keyboard) event and returns a String that represents its key 12089 * Can be used like Foundation.parseKey(event) === Foundation.keys.SPACE 12090 * @param {Event} event - the event generated by the event handler 12091 * @return String key - String that represents the key pressed 12092 */ 12093 parseKey: parseKey, 12094 12095 /** 12096 * Handles the given (keyboard) event 12097 * @param {Event} event - the event generated by the event handler 12098 * @param {String} component - Foundation component's name, e.g. Slider or Reveal 12099 * @param {Objects} functions - collection of functions that are to be executed 12100 */ 12101 handleKey: function handleKey(event, component, functions) { 12102 var commandList = commands[component], 12103 keyCode = this.parseKey(event), 12104 cmds, 12105 command, 12106 fn; 12107 if (!commandList) return console.warn('Component not defined!'); 12108 12109 if (typeof commandList.ltr === 'undefined') { 12110 // this component does not differentiate between ltr and rtl 12111 cmds = commandList; // use plain list 12112 } else { 12113 // merge ltr and rtl: if document is rtl, rtl overwrites ltr and vice versa 12114 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); 12115 } 12116 12117 command = cmds[keyCode]; 12118 fn = functions[command]; 12119 12120 if (fn && typeof fn === 'function') { 12121 // execute function if exists 12122 var returnValue = fn.apply(); 12123 12124 if (functions.handled || typeof functions.handled === 'function') { 12125 // execute function when event was handled 12126 functions.handled(returnValue); 12127 } 12128 } else { 12129 if (functions.unhandled || typeof functions.unhandled === 'function') { 12130 // execute function when event was not handled 12131 functions.unhandled(); 12132 } 12133 } 12134 }, 12135 12136 /** 12137 * Finds all focusable elements within the given `$element` 12138 * @param {jQuery} $element - jQuery object to search within 12139 * @return {jQuery} $focusable - all focusable elements within `$element` 12140 */ 12141 findFocusable: findFocusable, 12142 12143 /** 12144 * Returns the component name name 12145 * @param {Object} component - Foundation component, e.g. Slider or Reveal 12146 * @return String componentName 12147 */ 12148 register: function register(componentName, cmds) { 12149 commands[componentName] = cmds; 12150 }, 12151 // TODO9438: These references to Keyboard need to not require global. Will 'this' work in this context? 12152 // 12153 12154 /** 12155 * Traps the focus in the given element. 12156 * @param {jQuery} $element jQuery object to trap the foucs into. 12157 */ 12158 trapFocus: function trapFocus($element) {
12159 var $focusable = findFocusable($element), 12160 $firstFocusable = $focusable.eq(0), 12161 $lastFocusable = $focusable.eq(-1); 12162 $element.on('keydown.zf.trapfocus', function (event) { 12163 if (event.target === $lastFocusable[0] && parseKey(event) === 'TAB') { 12164 event.preventDefault(); 12165 $firstFocusable.focus(); 12166 } else if (event.target === $firstFocusable[0] && parseKey(event) === 'SHIFT_TAB') { 12167 event.preventDefault(); 12168 $lastFocusable.focus(); 12169 } 12170 }); 12171 }, 12172 12173 /** 12174 * Releases the trapped focus from the given element. 12175 * @param {jQuery} $element jQuery object to release the focus for. 12176 */ 12177 releaseFocus: function releaseFocus($element) { 12178 $element.off('keydown.zf.trapfocus'); 12179 } 12180}; 12181/* 12182 * Constants for easier comparing. 12183 * Can be used like Foundation.parseKey(event) === Foundation.keys.SPACE 12184 */ 12185 12186function getKeyCodes(kcs) { 12187 var k = {}; 12188 12189 for (var kc in kcs) { 12190 k[kcs[kc]] = kcs[kc]; 12191 } 12192 12193 return k; 12194} 12195 12196 12197 12198/***/ }), 12199
vendor: 16,263 bytes, lines 12200-12699
12200/***/ "./js/foundation.util.mediaQuery.js": 12201/*!******************************************!*\ 12202 !*** ./js/foundation.util.mediaQuery.js ***! 12203 \******************************************/ 12204/*! exports provided: MediaQuery */ 12205/***/ (function(module, __webpack_exports__, __webpack_require__) { 12206 12207"use strict"; 12208__webpack_require__.r(__webpack_exports__); 12209/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MediaQuery", function() { return MediaQuery; }); 12210/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 12211/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 12212 12213 12214function _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); } 12215 12216 // Default set of media queries 12217 12218var defaultQueries = { 12219 'default': 'only screen', 12220 landscape: 'only screen and (orientation: landscape)', 12221 portrait: 'only screen and (orientation: portrait)', 12222 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)' 12223}; // matchMedia() polyfill - Test a CSS media type/query in JS. 12224// Authors & copyright(c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. MIT license 12225 12226/* eslint-disable */ 12227 12228window.matchMedia || (window.matchMedia = function () { 12229 "use strict"; // For browsers that support matchMedium api such as IE 9 and webkit 12230 12231 var styleMedia = window.styleMedia || window.media; // For those that don't support matchMedium 12232 12233 if (!styleMedia) { 12234 var style = document.createElement('style'), 12235 script = document.getElementsByTagName('script')[0], 12236 info = null; 12237 style.type = 'text/css'; 12238 style.id = 'matchmediajs-test'; 12239 12240 if (!script) { 12241 document.head.appendChild(style); 12242 } else { 12243 script.parentNode.insertBefore(style, script); 12244 } // 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers 12245 12246 12247 info = 'getComputedStyle' in window && window.getComputedStyle(style, null) || style.currentStyle; 12248 styleMedia = { 12249 matchMedium: function matchMedium(media) { 12250 var text = '@media ' + media + '{ #matchmediajs-test { width: 1px; } }'; // 'style.styleSheet' is used by IE <= 8 and 'style.textContent' for all other browsers 12251 12252 if (style.styleSheet) { 12253 style.styleSheet.cssText = text; 12254 } else { 12255 style.textContent = text; 12256 } // Test if media query is true or false 12257 12258 12259 return info.width === '1px'; 12260 } 12261 }; 12262 } 12263 12264 return function (media) { 12265 return { 12266 matches: styleMedia.matchMedium(media || 'all'), 12267 media: media || 'all' 12268 }; 12269 }; 12270}()); 12271/* eslint-enable */ 12272 12273var MediaQuery = { 12274 queries: [], 12275 current: '', 12276 12277 /** 12278 * Initializes the media query helper, by extracting the breakpoint list from the CSS and activating the breakpoint watcher. 12279 * @function 12280 * @private 12281 */ 12282 _init: function _init() { 12283 var self = this; 12284 var $meta = jquery__WEBPACK_IMPORTED_MODULE_0___default()('meta.foundation-mq'); 12285 12286 if (!$meta.length) { 12287 jquery__WEBPACK_IMPORTED_MODULE_0___default()('<meta class="foundation-mq">').appendTo(document.head); 12288 } 12289 12290 var extractedStyles = jquery__WEBPACK_IMPORTED_MODULE_0___default()('.foundation-mq').css('font-family'); 12291 var namedQueries; 12292 namedQueries = parseStyleToObject(extractedStyles); 12293 12294 for (var key in namedQueries) { 12295 if (namedQueries.hasOwnProperty(key)) { 12296 self.queries.push({ 12297 name: key, 12298 value: "only screen and (min-width: ".concat(namedQueries[key], ")") 12299 }); 12300 } 12301 } 12302 12303 this.current = this._getCurrentSize(); 12304 12305 this._watcher(); 12306 }, 12307 12308 /** 12309 * Checks if the screen is at least as wide as a breakpoint. 12310 * @function 12311 * @param {String} size - Name of the breakpoint to check. 12312 * @returns {Boolean} `true` if the breakpoint matches, `false` if it's smaller. 12313 */ 12314 atLeast: function atLeast(size) { 12315 var query = this.get(size); 12316 12317 if (query) { 12318 return window.matchMedia(query).matches; 12319 } 12320 12321 return false; 12322 }, 12323 12324 /** 12325 * Checks if the screen matches to a breakpoint. 12326 * @function 12327 * @param {String} size - Name of the breakpoint to check, either 'small only' or 'small'. Omitting 'only' falls back to using atLeast() method. 12328 * @returns {Boolean} `true` if the breakpoint matches, `false` if it does not. 12329 */ 12330 is: function is(size) { 12331 size = size.trim().split(' '); 12332 12333 if (size.length > 1 && size[1] === 'only') { 12334 if (size[0] === this._getCurrentSize()) return true; 12335 } else { 12336 return this.atLeast(size[0]); 12337 } 12338 12339 return false; 12340 }, 12341 12342 /** 12343 * Gets the media query of a breakpoint. 12344 * @function 12345 * @param {String} size - Name of the breakpoint to get. 12346 * @returns {String|null} - The media query of the breakpoint, or `null` if the breakpoint doesn't exist. 12347 */ 12348 get: function get(size) { 12349 for (var i in this.queries) { 12350 if (this.queries.hasOwnProperty(i)) { 12351 var query = this.queries[i]; 12352 if (size === query.name) return query.value; 12353 } 12354 } 12355 12356 return null; 12357 }, 12358 12359 /** 12360 * Gets the current breakpoint name by testing every breakpoint and returning the last one to match (the biggest one). 12361 * @function 12362 * @private 12363 * @returns {String} Name of the current breakpoint. 12364 */ 12365 _getCurrentSize: function _getCurrentSize() { 12366 var matched; 12367 12368 for (var i = 0; i < this.queries.length; i++) { 12369 var query = this.queries[i]; 12370 12371 if (window.matchMedia(query.value).matches) { 12372 matched = query; 12373 } 12374 } 12375 12376 if (_typeof(matched) === 'object') { 12377 return matched.name; 12378 } else { 12379 return matched; 12380 } 12381 }, 12382 12383 /** 12384 * Activates the breakpoint watcher, which fires an event on the window whenever the breakpoint changes. 12385 * @function 12386 * @private 12387 */ 12388 _watcher: function _watcher() { 12389 var _this = this; 12390 12391 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('resize.zf.mediaquery').on('resize.zf.mediaquery', function () { 12392 var newSize = _this._getCurrentSize(), 12393 currentSize = _this.current; 12394 12395 if (newSize !== currentSize) { 12396 // Change the current media query 12397 _this.current = newSize; // Broadcast the media query change on the window 12398 12399 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).trigger('changed.zf.mediaquery', [newSize, currentSize]); 12400 } 12401 }); 12402 } 12403}; // Thank you: https://github.com/sindresorhus/query-string 12404 12405function parseStyleToObject(str) { 12406 var styleObject = {}; 12407 12408 if (typeof str !== 'string') { 12409 return styleObject; 12410 } 12411 12412 str = str.trim().slice(1, -1); // browsers re-quote string style values 12413 12414 if (!str) { 12415 return styleObject; 12416 } 12417 12418 styleObject = str.split('&').reduce(function (ret, param) { 12419 var parts = param.replace(/\+/g, ' ').split('='); 12420 var key = parts[0]; 12421 var val = parts[1]; 12422 key = decodeURIComponent(key); // missing `=` should be `null`: 12423 // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters 12424 12425 val = typeof val === 'undefined' ? null : decodeURIComponent(val); 12426 12427 if (!ret.hasOwnProperty(key)) { 12428 ret[key] = val; 12429 } else if (Array.isArray(ret[key])) { 12430 ret[key].push(val); 12431 } else { 12432 ret[key] = [ret[key], val]; 12433 } 12434 12435 return ret; 12436 }, {}); 12437 return styleObject; 12438} 12439 12440 12441 12442/***/ }), 12443 12444/***/ "./js/foundation.util.motion.js": 12445/*!**************************************!*\ 12446 !*** ./js/foundation.util.motion.js ***! 12447 \**************************************/ 12448/*! exports provided: Move, Motion */ 12449/***/ (function(module, __webpack_exports__, __webpack_require__) { 12450 12451"use strict"; 12452__webpack_require__.r(__webpack_exports__); 12453/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Move", function() { return Move; }); 12454/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Motion", function() { return Motion; }); 12455/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 12456/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 12457/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 12458 12459 12460 12461 12462/** 12463 * Motion module. 12464 * @module foundation.motion 12465 */ 12466 12467var initClasses = ['mui-enter', 'mui-leave']; 12468var activeClasses = ['mui-enter-active', 'mui-leave-active']; 12469var Motion = { 12470 animateIn: function animateIn(element, animation, cb) { 12471 animate(true, element, animation, cb); 12472 }, 12473 animateOut: function animateOut(element, animation, cb) { 12474 animate(false, element, animation, cb); 12475 } 12476}; 12477 12478function Move(duration, elem, fn) { 12479 var anim, 12480 prog, 12481 start = null; // console.log('called'); 12482 12483 if (duration === 0) { 12484 fn.apply(elem); 12485 elem.trigger('finished.zf.animate', [elem]).triggerHandler('finished.zf.animate', [elem]); 12486 return; 12487 } 12488 12489 function move(ts) { 12490 if (!start) start = ts; // console.log(start, ts); 12491 12492 prog = ts - start; 12493 fn.apply(elem); 12494 12495 if (prog < duration) { 12496 anim = window.requestAnimationFrame(move, elem); 12497 } else { 12498 window.cancelAnimationFrame(anim); 12499 elem.trigger('finished.zf.animate', [elem]).triggerHandler('finished.zf.animate', [elem]); 12500 } 12501 } 12502 12503 anim = window.requestAnimationFrame(move); 12504} 12505/** 12506 * Animates an element in or out using a CSS transition class. 12507 * @function 12508 * @private 12509 * @param {Boolean} isIn - Defines if the animation is in or out. 12510 * @param {Object} element - jQuery or HTML object to animate. 12511 * @param {String} animation - CSS class to use. 12512 * @param {Function} cb - Callback to run when animation is finished. 12513 */ 12514 12515 12516function animate(isIn, element, animation, cb) { 12517 element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(element).eq(0); 12518 if (!element.length) return; 12519 var initClass = isIn ? initClasses[0] : initClasses[1]; 12520 var activeClass = isIn ? activeClasses[0] : activeClasses[1]; // Set up the animation 12521 12522 reset(); 12523 element.addClass(animation).css('transition', 'none'); 12524 requestAnimationFrame(function () { 12525 element.addClass(initClass); 12526 if (isIn) element.show(); 12527 }); // Start the animation 12528 12529 requestAnimationFrame(function () { 12530 element[0].offsetWidth; 12531 element.css('transition', '').addClass(activeClass); 12532 }); // Clean up the animation when it finishes 12533 12534 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 12535 12536 function finish() { 12537 if (!isIn) element.hide(); 12538 reset(); 12539 if (cb) cb.apply(element); 12540 } // Resets transitions and removes motion-specific classes 12541 12542 12543 function reset() { 12544 element[0].style.transitionDuration = 0; 12545 element.removeClass("".concat(initClass, " ").concat(activeClass, " ").concat(animation)); 12546 } 12547} 12548 12549 12550 12551/***/ }), 12552 12553/***/ "./js/foundation.util.nest.js": 12554/*!************************************!*\ 12555 !*** ./js/foundation.util.nest.js ***! 12556 \************************************/ 12557/*! exports provided: Nest */ 12558/***/ (function(module, __webpack_exports__, __webpack_require__) { 12559 12560"use strict"; 12561__webpack_require__.r(__webpack_exports__); 12562/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Nest", function() { return Nest; }); 12563/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 12564/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 12565 12566 12567 12568var Nest = { 12569 Feather: function Feather(menu) { 12570 var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'zf'; 12571 menu.attr('role', 'menubar'); 12572 var items = menu.find('li').attr({ 12573 'role': 'menuitem' 12574 }), 12575 subMenuClass = "is-".concat(type, "-submenu"), 12576 subItemClass = "".concat(subMenuClass, "-item"), 12577 hasSubClass = "is-".concat(type, "-submenu-parent"), 12578 applyAria = type !== 'accordion'; // Accordions handle their own ARIA attriutes. 12579 12580 items.each(function () { 12581 var $item = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 12582 $sub = $item.children('ul'); 12583 12584 if ($sub.length) { 12585 $item.addClass(hasSubClass); 12586 12587 if (applyAria) { 12588 $item.attr({ 12589 'aria-haspopup': true, 12590 'aria-label': $item.children('a:first').text() 12591 }); // Note: Drilldowns behave differently in how they hide, and so need 12592 // additional attributes. We should look if this possibly over-generalized 12593 // utility (Nest) is appropriate when we rework menus in 6.4 12594 12595 if (type === 'drilldown') { 12596 $item.attr({ 12597 'aria-expanded': false 12598 }); 12599 } 12600 } 12601 12602 $sub.addClass("submenu ".concat(subMenuClass)).attr({ 12603 'data-submenu': '', 12604 'role': 'menubar' 12605 }); 12606 12607 if (type === 'drilldown') { 12608 $sub.attr({ 12609 'aria-hidden': true 12610 }); 12611 } 12612 } 12613 12614 if ($item.parent('[data-submenu]').length) { 12615 $item.addClass("is-submenu-item ".concat(subItemClass)); 12616 } 12617 }); 12618 return; 12619 }, 12620 Burn: function Burn(menu, type) { 12621 var //items = menu.find('li'), 12622 subMenuClass = "is-".concat(type, "-submenu"), 12623 subItemClass = "".concat(subMenuClass, "-item"), 12624 hasSubClass = "is-".concat(type, "-submenu-parent"); 12625 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', ''); 12626 } 12627}; 12628 12629 12630/***/ }), 12631 12632/***/ "./js/foundation.util.timer.js": 12633/*!*************************************!*\ 12634 !*** ./js/foundation.util.timer.js ***! 12635 \*************************************/ 12636/*! exports provided: Timer */ 12637/***/ (function(module, __webpack_exports__, __webpack_require__) { 12638 12639"use strict"; 12640__webpack_require__.r(__webpack_exports__); 12641/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Timer", function() { return Timer; }); 12642/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 12643/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 12644 12645 12646 12647 12648function Timer(elem, options, cb) { 12649 var _this = this, 12650 duration = options.duration, 12651 //options is an object for easily adding features later. 12652 nameSpace = Object.keys(elem.data())[0] || 'timer', 12653 remain = -1, 12654 start, 12655 timer; 12656 12657 this.isPaused = false; 12658 12659 this.restart = function () { 12660 remain = -1; 12661 clearTimeout(timer); 12662 this.start(); 12663 }; 12664 12665 this.start = function () { 12666 this.isPaused = false; // if(!elem.data('paused')){ return false; }//maybe implement this sanity check if used for other things. 12667 12668 clearTimeout(timer); 12669 remain = remain <= 0 ? duration : remain; 12670 elem.data('paused', false); 12671 start = Date.now(); 12672 timer = setTimeout(function () { 12673 if (options.infinite) { 12674 _this.restart(); //rerun the timer. 12675 12676 } 12677 12678 if (cb && typeof cb === 'function') { 12679 cb(); 12680 } 12681 }, remain); 12682 elem.trigger("timerstart.zf.".concat(nameSpace)); 12683 }; 12684 12685 this.pause = function () { 12686 this.isPaused = true; //if(elem.data('paused')){ return false; }//maybe implement this sanity check if used for other things. 12687 12688 clearTimeout(timer); 12689 elem.data('paused', true); 12690 var end = Date.now(); 12691 remain = remain - (end - start); 12692 elem.trigger("timerpaused.zf.".concat(nameSpace)); 12693 }; 12694} 12695 12696 12697 12698/***/ }), 12699
12700/***/ "./js/foundation.util.touch.js": 12701/*!*************************************!*\ 12702 !*** ./js/foundation.util.touch.js ***! 12703 \*************************************/ 12704/*! exports provided: Touch */ 12705/***/ (function(module, __webpack_exports__, __webpack_require__) { 12706 12707"use strict"; 12708__webpack_require__.r(__webpack_exports__); 12709/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Touch", function() { return Touch; }); 12710/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 12711/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 12712function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 12713 12714function _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); } } 12715 12716function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 12717 12718//************************************************** 12719//**Work inspired by multiple jquery swipe plugins** 12720//**Done by Yohai Ararat *************************** 12721//************************************************** 12722 12723var Touch = {}; 12724var startPosX, 12725 startPosY, 12726 startTime, 12727 elapsedTime, 12728 startEvent, 12729 isMoving = false, 12730 didMoved = false; 12731 12732function onTouchEnd(e) { 12733 this.removeEventListener('touchmove', onTouchMove); 12734 this.removeEventListener('touchend', onTouchEnd); // If the touch did not move, consider it as a "tap" 12735 12736 if (!didMoved) { 12737 var tapEvent = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.Event('tap', startEvent || e); 12738 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).trigger(tapEvent); 12739 } 12740 12741 startEvent = null; 12742 isMoving = false; 12743 didMoved = false; 12744} 12745 12746function onTouchMove(e) { 12747 if (jquery__WEBPACK_IMPORTED_MODULE_0___default.a.spotSwipe.preventDefault) { 12748 e.preventDefault(); 12749 } 12750 12751 if (isMoving) { 12752 var x = e.touches[0].pageX; 12753 var y = e.touches[0].pageY; 12754 var dx = startPosX - x; 12755 var dy = startPosY - y; 12756 var dir; 12757 didMoved = true; 12758 elapsedTime = new Date().getTime() - startTime; 12759 12760 if (Math.abs(dx) >= jquery__WEBPACK_IMPORTED_MODULE_0___default.a.spotSwipe.moveThreshold && elapsedTime <= jquery__WEBPACK_IMPORTED_MODULE_0___default.a.spotSwipe.timeThreshold) { 12761 dir = dx > 0 ? 'left' : 'right'; 12762 } // else if(Math.abs(dy) >= $.spotSwipe.moveThreshold && elapsedTime <= $.spotSwipe.timeThreshold) { 12763 // dir = dy > 0 ? 'down' : 'up'; 12764 // } 12765 12766 12767 if (dir) { 12768 e.preventDefault(); 12769 onTouchEnd.apply(this, arguments); 12770 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).trigger(jquery__WEBPACK_IMPORTED_MODULE_0___default.a.Event('swipe', e), dir).trigger(jquery__WEBPACK_IMPORTED_MODULE_0___default.a.Event("swipe".concat(dir), e)); 12771 } 12772 } 12773} 12774 12775function onTouchStart(e) { 12776 if (e.touches.length == 1) { 12777 startPosX = e.touches[0].pageX; 12778 startPosY = e.touches[0].pageY; 12779 startEvent = e; 12780 isMoving = true; 12781 didMoved = false; 12782 startTime = new Date().getTime(); 12783 this.addEventListener('touchmove', onTouchMove, false); 12784 this.addEventListener('touchend', onTouchEnd, false); 12785 } 12786} 12787 12788function init() { 12789 this.addEventListener && this.addEventListener('touchstart', onTouchStart, false); 12790} 12791 12792function teardown() { 12793 this.removeEventListener('touchstart', onTouchStart); 12794} 12795 12796var SpotSwipe = 12797/*#__PURE__*/ 12798function () { 12799 function SpotSwipe($) { 12800 _classCallCheck(this, SpotSwipe); 12801 12802 this.version = '1.0.0'; 12803 this.enabled = 'ontouchstart' in document.documentElement; 12804 this.preventDefault = false;
vendor: 2,686 bytes, lines 12805-12902
12805 this.moveThreshold = 75; 12806 this.timeThreshold = 200; 12807 this.$ = $; 12808 12809 this._init(); 12810 } 12811 12812 _createClass(SpotSwipe, [{ 12813 key: "_init", 12814 value: function _init() { 12815 var $ = this.$; 12816 $.event.special.swipe = { 12817 setup: init 12818 }; 12819 $.event.special.tap = { 12820 setup: init 12821 }; 12822 $.each(['left', 'up', 'down', 'right'], function () { 12823 $.event.special["swipe".concat(this)] = { 12824 setup: function setup() { 12825 $(this).on('swipe', $.noop); 12826 } 12827 }; 12828 }); 12829 } 12830 }]); 12831 12832 return SpotSwipe; 12833}(); 12834/**************************************************** 12835 * As far as I can tell, both setupSpotSwipe and * 12836 * setupTouchHandler should be idempotent, * 12837 * because they directly replace functions & * 12838 * values, and do not add event handlers directly. * 12839 ****************************************************/ 12840 12841 12842Touch.setupSpotSwipe = function ($) { 12843 $.spotSwipe = new SpotSwipe($); 12844}; 12845/**************************************************** 12846 * Method for adding pseudo drag events to elements * 12847 ***************************************************/ 12848 12849 12850Touch.setupTouchHandler = function ($) { 12851 $.fn.addTouch = function () { 12852 this.each(function (i, el) { 12853 $(el).bind('touchstart touchmove touchend touchcancel', function (event) { 12854 //we pass the original event object because the jQuery event 12855 //object is normalized to w3c specs and does not provide the TouchList 12856 handleTouch(event); 12857 }); 12858 }); 12859 12860 var handleTouch = function handleTouch(event) { 12861 var touches = event.changedTouches, 12862 first = touches[0], 12863 eventTypes = { 12864 touchstart: 'mousedown', 12865 touchmove: 'mousemove', 12866 touchend: 'mouseup' 12867 }, 12868 type = eventTypes[event.type], 12869 simulatedEvent; 12870 12871 if ('MouseEvent' in window && typeof window.MouseEvent === 'function') { 12872 simulatedEvent = new window.MouseEvent(type, { 12873 'bubbles': true, 12874 'cancelable': true, 12875 'screenX': first.screenX, 12876 'screenY': first.screenY, 12877 'clientX': first.clientX, 12878 'clientY': first.clientY 12879 }); 12880 } else { 12881 simulatedEvent = document.createEvent('MouseEvent'); 12882 simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 0 12883 /*left*/ 12884 , null); 12885 } 12886 12887 first.target.dispatchEvent(simulatedEvent); 12888 }; 12889 }; 12890}; 12891 12892Touch.init = function ($) { 12893 if (typeof $.spotSwipe === 'undefined') { 12894 Touch.setupSpotSwipe($); 12895 Touch.setupTouchHandler($); 12896 } 12897}; 12898 12899 12900 12901/***/ }), 12902
vendor: 8,491 bytes, lines 12903-13107
12903/***/ "./js/foundation.util.triggers.js": 12904/*!****************************************!*\ 12905 !*** ./js/foundation.util.triggers.js ***! 12906 \****************************************/ 12907/*! exports provided: Triggers */ 12908/***/ (function(module, __webpack_exports__, __webpack_require__) { 12909 12910"use strict"; 12911__webpack_require__.r(__webpack_exports__); 12912/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Triggers", function() { return Triggers; }); 12913/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 12914/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 12915/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 12916/* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.motion */ "./js/foundation.util.motion.js"); 12917 12918 12919function _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); } 12920 12921 12922 12923 12924 12925var MutationObserver = function () { 12926 var prefixes = ['WebKit', 'Moz', 'O', 'Ms', '']; 12927 12928 for (var i = 0; i < prefixes.length; i++) { 12929 if ("".concat(prefixes[i], "MutationObserver") in window) { 12930 return window["".concat(prefixes[i], "MutationObserver")]; 12931 } 12932 } 12933 12934 return false; 12935}(); 12936 12937var triggers = function triggers(el, type) { 12938 el.data(type).split(' ').forEach(function (id) { 12939 jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(id))[type === 'close' ? 'trigger' : 'triggerHandler']("".concat(type, ".zf.trigger"), [el]); 12940 }); 12941}; 12942 12943var Triggers = { 12944 Listeners: { 12945 Basic: {}, 12946 Global: {} 12947 }, 12948 Initializers: {} 12949}; 12950Triggers.Listeners.Basic = { 12951 openListener: function openListener() { 12952 triggers(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 'open'); 12953 }, 12954 closeListener: function closeListener() { 12955 var id = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('close'); 12956 12957 if (id) { 12958 triggers(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 'close'); 12959 } else { 12960 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).trigger('close.zf.trigger'); 12961 } 12962 }, 12963 toggleListener: function toggleListener() { 12964 var id = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('toggle'); 12965 12966 if (id) { 12967 triggers(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 'toggle'); 12968 } else { 12969 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).trigger('toggle.zf.trigger'); 12970 } 12971 }, 12972 closeableListener: function closeableListener(e) { 12973 e.stopPropagation(); 12974 var animation = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('closable'); 12975 12976 if (animation !== '') { 12977 _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Motion"].animateOut(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), animation, function () { 12978 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).trigger('closed.zf'); 12979 }); 12980 } else { 12981 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).fadeOut().trigger('closed.zf'); 12982 } 12983 }, 12984 toggleFocusListener: function toggleFocusListener() { 12985 var id = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('toggle-focus'); 12986 jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(id)).triggerHandler('toggle.zf.trigger', [jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)]); 12987 } 12988}; // Elements with [data-open] will reveal a plugin that supports it when clicked. 12989 12990Triggers.Initializers.addOpenListener = function ($elem) { 12991 $elem.off('click.zf.trigger', Triggers.Listeners.Basic.openListener); 12992 $elem.on('click.zf.trigger', '[data-open]', Triggers.Listeners.Basic.openListener); 12993}; // Elements with [data-close] will close a plugin that supports it when clicked. 12994// If used without a value on [data-close], the event will bubble, allowing it to close a parent component. 12995 12996 12997Triggers.Initializers.addCloseListener = function ($elem) { 12998 $elem.off('click.zf.trigger', Triggers.Listeners.Basic.closeListener); 12999 $elem.on('click.zf.trigger', '[data-close]', Triggers.Listeners.Basic.closeListener); 13000}; // Elements with [data-toggle] will toggle a plugin that supports it when clicked. 13001 13002 13003Triggers.Initializers.addToggleListener = function ($elem) { 13004 $elem.off('click.zf.trigger', Triggers.Listeners.Basic.toggleListener); 13005 $elem.on('click.zf.trigger', '[data-toggle]', Triggers.Listeners.Basic.toggleListener); 13006}; // Elements with [data-closable] will respond to close.zf.trigger events. 13007 13008 13009Triggers.Initializers.addCloseableListener = function ($elem) { 13010 $elem.off('close.zf.trigger', Triggers.Listeners.Basic.closeableListener); 13011 $elem.on('close.zf.trigger', '[data-closeable], [data-closable]', Triggers.Listeners.Basic.closeableListener); 13012}; // Elements with [data-toggle-focus] will respond to coming in and out of focus 13013 13014 13015Triggers.Initializers.addToggleFocusListener = function ($elem) { 13016 $elem.off('focus.zf.trigger blur.zf.trigger', Triggers.Listeners.Basic.toggleFocusListener); 13017 $elem.on('focus.zf.trigger blur.zf.trigger', '[data-toggle-focus]', Triggers.Listeners.Basic.toggleFocusListener); 13018}; // More Global/complex listeners and triggers 13019 13020 13021Triggers.Listeners.Global = { 13022 resizeListener: function resizeListener($nodes) { 13023 if (!MutationObserver) { 13024 //fallback for IE 9 13025 $nodes.each(function () { 13026 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).triggerHandler('resizeme.zf.trigger'); 13027 }); 13028 } //trigger all listening elements and signal a resize event 13029 13030 13031 $nodes.attr('data-events', "resize"); 13032 }, 13033 scrollListener: function scrollListener($nodes) { 13034 if (!MutationObserver) { 13035 //fallback for IE 9 13036 $nodes.each(function () { 13037 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).triggerHandler('scrollme.zf.trigger'); 13038 }); 13039 } //trigger all listening elements and signal a scroll event 13040 13041 13042 $nodes.attr('data-events', "scroll"); 13043 }, 13044 closeMeListener: function closeMeListener(e, pluginId) { 13045 var plugin = e.namespace.split('.')[0]; 13046 var plugins = jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-".concat(plugin, "]")).not("[data-yeti-box=\"".concat(pluginId, "\"]")); 13047 plugins.each(function () { 13048 var _this = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this); 13049 13050 _this.triggerHandler('close.zf.trigger', [_this]); 13051 }); 13052 } // Global, parses whole document. 13053 13054}; 13055 13056Triggers.Initializers.addClosemeListener = function (pluginName) { 13057 var yetiBoxes = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-yeti-box]'), 13058 plugNames = ['dropdown', 'tooltip', 'reveal']; 13059 13060 if (pluginName) { 13061 if (typeof pluginName === 'string') { 13062 plugNames.push(pluginName); 13063 } else if (_typeof(pluginName) === 'object' && typeof pluginName[0] === 'string') { 13064 plugNames = plugNames.concat(pluginName); 13065 } else { 13066 console.error('Plugin names must be strings'); 13067 } 13068 } 13069 13070 if (yetiBoxes.length) { 13071 var listeners = plugNames.map(function (name) { 13072 return "closeme.zf.".concat(name); 13073 }).join(' '); 13074 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(listeners).on(listeners, Triggers.Listeners.Global.closeMeListener); 13075 } 13076}; 13077 13078function debounceGlobalListener(debounce, trigger, listener) { 13079 var timer, 13080 args = Array.prototype.slice.call(arguments, 3); 13081 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(trigger).on(trigger, function (e) { 13082 if (timer) { 13083 clearTimeout(timer); 13084 } 13085 13086 timer = setTimeout(function () { 13087 listener.apply(null, args); 13088 }, debounce || 10); //default time to emit scroll event 13089 }); 13090} 13091 13092Triggers.Initializers.addResizeListener = function (debounce) { 13093 var $nodes = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-resize]'); 13094 13095 if ($nodes.length) { 13096 debounceGlobalListener(debounce, 'resize.zf.trigger', Triggers.Listeners.Global.resizeListener, $nodes); 13097 } 13098}; 13099 13100Triggers.Initializers.addScrollListener = function (debounce) { 13101 var $nodes = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-scroll]'); 13102 13103 if ($nodes.length) { 13104 debounceGlobalListener(debounce, 'scroll.zf.trigger', Triggers.Listeners.Global.scrollListener, $nodes); 13105 } 13106}; 13107
vendor: 3,263 bytes, lines 13108-13196
13108Triggers.Initializers.addMutationEventsListener = function ($elem) { 13109 if (!MutationObserver) { 13110 return false; 13111 } 13112 13113 var $nodes = $elem.find('[data-resize], [data-scroll], [data-mutate]'); //element callback 13114 13115 var listeningElementsMutation = function listeningElementsMutation(mutationRecordsList) { 13116 var $target = jquery__WEBPACK_IMPORTED_MODULE_0___default()(mutationRecordsList[0].target); //trigger the event handler for the element depending on type 13117 13118 switch (mutationRecordsList[0].type) { 13119 case "attributes": 13120 if ($target.attr("data-events") === "scroll" && mutationRecordsList[0].attributeName === "data-events") { 13121 $target.triggerHandler('scrollme.zf.trigger', [$target, window.pageYOffset]); 13122 } 13123 13124 if ($target.attr("data-events") === "resize" && mutationRecordsList[0].attributeName === "data-events") { 13125 $target.triggerHandler('resizeme.zf.trigger', [$target]); 13126 } 13127 13128 if (mutationRecordsList[0].attributeName === "style") { 13129 $target.closest("[data-mutate]").attr("data-events", "mutate"); 13130 $target.closest("[data-mutate]").triggerHandler('mutateme.zf.trigger', [$target.closest("[data-mutate]")]); 13131 } 13132 13133 break; 13134 13135 case "childList": 13136 $target.closest("[data-mutate]").attr("data-events", "mutate"); 13137 $target.closest("[data-mutate]").triggerHandler('mutateme.zf.trigger', [$target.closest("[data-mutate]")]); 13138 break; 13139 13140 default: 13141 return false; 13142 //nothing 13143 } 13144 }; 13145 13146 if ($nodes.length) { 13147 //for each element that needs to listen for resizing, scrolling, or mutation add a single observer 13148 for (var i = 0; i <= $nodes.length - 1; i++) { 13149 var elementObserver = new MutationObserver(listeningElementsMutation); 13150 elementObserver.observe($nodes[i], { 13151 attributes: true, 13152 childList: true, 13153 characterData: false, 13154 subtree: true, 13155 attributeFilter: ["data-events", "style"] 13156 }); 13157 } 13158 } 13159}; 13160 13161Triggers.Initializers.addSimpleListeners = function () { 13162 var $document = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document); 13163 Triggers.Initializers.addOpenListener($document); 13164 Triggers.Initializers.addCloseListener($document); 13165 Triggers.Initializers.addToggleListener($document); 13166 Triggers.Initializers.addCloseableListener($document); 13167 Triggers.Initializers.addToggleFocusListener($document); 13168}; 13169 13170Triggers.Initializers.addGlobalListeners = function () { 13171 var $document = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document); 13172 Triggers.Initializers.addMutationEventsListener($document); 13173 Triggers.Initializers.addResizeListener(); 13174 Triggers.Initializers.addScrollListener(); 13175 Triggers.Initializers.addClosemeListener(); 13176}; 13177 13178Triggers.init = function ($, Foundation) { 13179 Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["onLoad"])($(window), function () { 13180 if ($.triggersInitialized !== true) { 13181 Triggers.Initializers.addSimpleListeners(); 13182 Triggers.Initializers.addGlobalListeners(); 13183 $.triggersInitialized = true; 13184 } 13185 }); 13186 13187 if (Foundation) { 13188 Foundation.Triggers = Triggers; // Legacy included to be backwards compatible for now. 13189 13190 Foundation.IHearYou = Triggers.Initializers.addGlobalListeners; 13191 } 13192}; 13193 13194 13195 13196/***/ })
13196, 13197 13198/***/ 0: 13199/*!****************************************!*\ 13200 !*** multi ./js/entries/foundation.js ***! 13201 \****************************************/ 13202/*! no static exports found */ 13203/***/ (function(module, exports, __webpack_require__) { 13204 13205module.exports = __webpack_require__(/*! /Users/ncoden/Documents/Documents/Projects/Programmation/Web/2016/Foundation/foundation-sites/js/entries/foundation.js */"./js/entries/foundation.js"); 13206 13207 13208/***/ }), 13209 13210/***/ "jquery": 13211/*!********************************************************************************************!*\ 13212 !*** external {"root":["jQuery"],"amd":"jquery","commonjs":"jquery","commonjs2":"jquery"} ***! 13213 \********************************************************************************************/ 13214/*! no static exports found */ 13215/***/ (function(module, exports) { 13216 13217module.exports = __WEBPACK_EXTERNAL_MODULE_jquery__; 13218 13219/***/ }) 13220 13221/******/ }); 13222}); 13223//# 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.