foundation.responsiveMenu.js.map 15 KB

1
  1. {"version":3,"sources":["webpack://__FOUNDATION_EXTERNAL__.[name]/webpack/universalModuleDefinition","webpack://__FOUNDATION_EXTERNAL__.[name]/webpack/bootstrap","webpack://__FOUNDATION_EXTERNAL__.[name]/external {\"root\":[\"__FOUNDATION_EXTERNAL__\",\"foundation.accordionMenu\"],\"amd\":\"./foundation.accordionMenu\",\"commonjs\":\"./foundation.accordionMenu\",\"commonjs2\":\"./foundation.accordionMenu\"}","webpack://__FOUNDATION_EXTERNAL__.[name]/external {\"root\":[\"__FOUNDATION_EXTERNAL__\",\"foundation.core\"],\"amd\":\"./foundation.core\",\"commonjs\":\"./foundation.core\",\"commonjs2\":\"./foundation.core\"}","webpack://__FOUNDATION_EXTERNAL__.[name]/external {\"root\":[\"__FOUNDATION_EXTERNAL__\",\"foundation.drilldown\"],\"amd\":\"./foundation.drilldown\",\"commonjs\":\"./foundation.drilldown\",\"commonjs2\":\"./foundation.drilldown\"}","webpack://__FOUNDATION_EXTERNAL__.[name]/external {\"root\":[\"__FOUNDATION_EXTERNAL__\",\"foundation.dropdownMenu\"],\"amd\":\"./foundation.dropdownMenu\",\"commonjs\":\"./foundation.dropdownMenu\",\"commonjs2\":\"./foundation.dropdownMenu\"}","webpack://__FOUNDATION_EXTERNAL__.[name]/external {\"root\":[\"__FOUNDATION_EXTERNAL__\",\"foundation.util.mediaQuery\"],\"amd\":\"./foundation.util.mediaQuery\",\"commonjs\":\"./foundation.util.mediaQuery\",\"commonjs2\":\"./foundation.util.mediaQuery\"}","webpack://__FOUNDATION_EXTERNAL__.[name]/./js/entries/plugins/foundation.responsiveMenu.js","webpack://__FOUNDATION_EXTERNAL__.[name]/./js/foundation.responsiveMenu.js","webpack://__FOUNDATION_EXTERNAL__.[name]/external {\"root\":[\"jQuery\"],\"amd\":\"jquery\",\"commonjs\":\"jquery\",\"commonjs2\":\"jquery\"}"],"names":["Foundation","plugin","ResponsiveMenu","MenuPlugins","dropdown","cssClass","DropdownMenu","drilldown","Drilldown","accordion","AccordionMenu","element","options","$element","$","rules","data","currentMq","currentPlugin","className","_init","_events","MediaQuery","rulesTree","split","i","length","rule","ruleSize","rulePlugin","isEmptyObject","_checkMediaQueries","attr","GetYoDigits","_this","window","on","matchedMq","each","key","atLeast","value","removeClass","addClass","destroy","off","Plugin","defaults"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE;AACzE,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;AClFA,uE;;;;;;;;;;;ACAA,8D;;;;;;;;;;;ACAA,mE;;;;;;;;;;;ACAA,sE;;;;;;;;;;;ACAA,yE;;;;;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AACAA,2DAAU,CAACC,MAAX,CAAkBC,yEAAlB,EAAkC,gBAAlC;;;;;;;;;;;;;ACHA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAa;;;;;;;;;;;;;;;;;;;;AAEb;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA,IAAIC,WAAW,GA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aAAK,CAACrB,QAAN,CAAe6B,WAAf,CAA2BD,KAAK,CAACpC,QAAjC;AACD,OAFD,EAhBmB,CAoBnB;;AACA,WAAKQ,QAAL,CAAc8B,QAAd,CAAuB,KAAK5B,KAAL,CAAWsB,SAAX,EAAsBhC,QAA7C,EArBmB,CAuBnB;;AACA,UAAI,KAAKa,aAAT,EAAwB,KAAKA,aAAL,CAAmB0B,OAAnB;AACxB,WAAK1B,aAAL,GAAqB,IAAI,KAAKH,KAAL,CAAWsB,SAAX,EAAsBpC,MAA1B,CAAiC,KAAKY,QAAtC,EAAgD,EAAhD,CAArB;AACD;AAED;;;;;;;+BAIW;AACT,WAAKK,aAAL,CAAmB0B,OAAnB;AACA9B,mDAAC,CAACqB,MAAD,CAAD,CAAUU,GAAV,CAAc,oBAAd;AACD;;;;EAhH0BC,6D;;AAmH7B5C,cAAc,CAAC6C,QAAf,GAA0B,EAA1B;;;;;;;;;;;;;;;;;;;;;;;;ACxJA,oD","file":"foundation.responsiveMenu.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"./foundation.accordionMenu\"), require(\"./foundation.core\"), require(\"./foundation.drilldown\"), require(\"./foundation.dropdownMenu\"), require(\"./foundation.util.mediaQuery\"), require(\"jquery\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"./foundation.accordionMenu\", \"./foundation.core\", \"./foundation.drilldown\", \"./foundation.dropdownMenu\", \"./foundation.util.mediaQuery\", \"jquery\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"foundation.responsiveMenu\"] = factory(require(\"./foundation.accordionMenu\"), require(\"./foundation.core\"), require(\"./foundation.drilldown\"), require(\"./foundation.dropdownMenu\"), require(\"./foundation.util.mediaQuery\"), require(\"jquery\"));\n\telse\n\t\troot[\"__FOUNDATION_EXTERNAL__\"] = root[\"__FOUNDATION_EXTERNAL__\"] || {}, root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.responsiveMenu\"] = factory(root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.accordionMenu\"], root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.core\"], root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.drilldown\"], root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.dropdownMenu\"], root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.util.mediaQuery\"], root[\"jQuery\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_accordionMenu__, __WEBPACK_EXTERNAL_MODULE__foundation_core__, __WEBPACK_EXTERNAL_MODULE__foundation_drilldown__, __WEBPACK_EXTERNAL_MODULE__foundation_dropdownMenu__, __WEBPACK_EXTERNAL_MODULE__foundation_util_mediaQuery__, __WEBPACK_EXTERNAL_MODULE_jquery__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 12);\n","module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_accordionMenu__;","module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_core__;","module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_drilldown__;","module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_dropdownMenu__;","module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_util_mediaQuery__;","import { Foundation } from './foundation.core';\n\nimport { ResponsiveMenu } from '../../foundation.responsiveMenu';\nFoundation.plugin(ResponsiveMenu, 'ResponsiveMenu');\n\nexport { Foundation, ResponsiveMenu };\n","'use strict';\n\nimport $ from 'jquery';\n\nimport { MediaQuery } from './foundation.util.mediaQuery';\nimport { GetYoDigits } from './foundation.core.utils';\nimport { Plugin } from './foundation.core.plugin';\n\nimport { DropdownMenu } from './foundation.dropdownMenu';\nimport { Drilldown } from './foundation.drilldown';\nimport { AccordionMenu } from './foundation.accordionMenu';\n\nlet MenuPlugins = {\n dropdown: {\n cssClass: 'dropdown',\n plugin: DropdownMenu\n },\n drilldown: {\n cssClass: 'drilldown',\n plugin: Drilldown\n },\n accordion: {\n cssClass: 'accordion-menu',\n plugin: AccordionMenu\n }\n};\n\n // import \"foundation.util.triggers.js\";\n\n\n/**\n * ResponsiveMenu module.\n * @module foundation.responsiveMenu\n * @requires foundation.util.triggers\n * @requires foundation.util.mediaQuery\n */\n\nclass ResponsiveMenu extends Plugin {\n /**\n * Creates a new instance of a responsive menu.\n * @class\n * @name ResponsiveMenu\n * @fires ResponsiveMenu#init\n * @param {jQuery} element - jQuery object to make into a dropdown menu.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options) {\n this.$element = $(element);\n this.rules = this.$element.data('responsive-menu');\n this.currentMq = null;\n this.currentPlugin = null;\n this.className = 'ResponsiveMenu'; // ie9 back compat\n\n this._init();\n this._events();\n }\n\n /**\n * Initializes the Menu by parsing the classes from the 'data-ResponsiveMenu' attribute on the element.\n * @function\n * @private\n */\n _init() {\n\n MediaQuery._init();\n // The first time an Interchange plugin is initialized, this.rules is converted from a string of \"classes\" to an object of rules\n if (typeof this.rules === 'string') {\n let rulesTree = {};\n\n // Parse rules from \"classes\" pulled from data attribute\n let rules = this.rules.split(' ');\n\n // Iterate through every rule found\n for (let i = 0; i < rules.length; i++) {\n let rule = rules[i].split('-');\n let ruleSize = rule.length > 1 ? rule[0] : 'small';\n let rulePlugin = rule.length > 1 ? rule[1] : rule[0];\n\n if (MenuPlugins[rulePlugin] !== null) {\n rulesTree[ruleSize] = MenuPlugins[rulePlugin];\n }\n }\n\n this.rules = rulesTree;\n }\n\n if (!$.isEmptyObject(this.rules)) {\n this._checkMediaQueries();\n }\n // Add data-mutate since children may need it.\n this.$element.attr('data-mutate', (this.$element.attr('data-mutate') || GetYoDigits(6, 'responsive-menu')));\n }\n\n /**\n * Initializes events for the Menu.\n * @function\n * @private\n */\n _events() {\n var _this = this;\n\n $(window).on('changed.zf.mediaquery', function() {\n _this._checkMediaQueries();\n });\n // $(window).on('resize.zf.ResponsiveMenu', function() {\n // _this._checkMediaQueries();\n // });\n }\n\n /**\n * 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.\n * @function\n * @private\n */\n _checkMediaQueries() {\n var matchedMq, _this = this;\n // Iterate through each rule and find the last matching rule\n $.each(this.rules, function(key) {\n if (MediaQuery.atLeast(key)) {\n matchedMq = key;\n }\n });\n\n // No match? No dice\n if (!matchedMq) return;\n\n // Plugin already initialized? We good\n if (this.currentPlugin instanceof this.rules[matchedMq].plugin) return;\n\n // Remove existing plugin-specific CSS classes\n $.each(MenuPlugins, function(key, value) {\n _this.$element.removeClass(value.cssClass);\n });\n\n // Add the CSS class for the new plugin\n this.$element.addClass(this.rules[matchedMq].cssClass);\n\n // Create an instance of the new plugin\n if (this.currentPlugin) this.currentPlugin.destroy();\n this.currentPlugin = new this.rules[matchedMq].plugin(this.$element, {});\n }\n\n /**\n * Destroys the instance of the current plugin on this element, as well as the window resize handler that switches the plugins out.\n * @function\n */\n _destroy() {\n this.currentPlugin.destroy();\n $(window).off('.zf.ResponsiveMenu');\n }\n}\n\nResponsiveMenu.defaults = {};\n\nexport {ResponsiveMenu};\n","module.exports = __WEBPACK_EXTERNAL_MODULE_jquery__;"],"sourceRoot":""}