UNPKG

24.9 kBSource Map (JSON)View Raw
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.core\"],\"amd\":\"./foundation.core\",\"commonjs\":\"./foundation.core\",\"commonjs2\":\"./foundation.core\"}","webpack:/__FOUNDATION_EXTERNAL__.[name]/external {\"root\":[\"__FOUNDATION_EXTERNAL__\",\"foundation.util.keyboard\"],\"amd\":\"./foundation.util.keyboard\",\"commonjs\":\"./foundation.util.keyboard\",\"commonjs2\":\"./foundation.util.keyboard\"}","webpack://__FOUNDATION_EXTERNAL__.[name]/js/entries/plugins/foundation.accordion.js","webpack://__FOUNDATION_EXTERNAL__.[name]/js/foundation.accordion.js","webpack:/__FOUNDATION_EXTERNAL__.[name]/external {\"root\":[\"jQuery\"],\"amd\":\"jquery\",\"commonjs\":\"jquery\",\"commonjs2\":\"jquery\"}"],"names":["root","factory","exports","module","require","define","amd","window","__WEBPACK_EXTERNAL_MODULE__foundation_core__","__WEBPACK_EXTERNAL_MODULE__foundation_util_keyboard__","__WEBPACK_EXTERNAL_MODULE_jquery__","installedModules","__webpack_require__","m","r","__webpack_exports__","_foundation_core__WEBPACK_IMPORTED_MODULE_0__","d","_foundation_accordion__WEBPACK_IMPORTED_MODULE_1__","Foundation","plugin","Accordion","jquery__WEBPACK_IMPORTED_MODULE_0__","jquery__WEBPACK_IMPORTED_MODULE_0___default","n","_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__","_foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__","Plugin","element","options","this","$element","$","extend","defaults","data","className","_init","Keyboard","register","ENTER","SPACE","ARROW_DOWN","ARROW_UP","_this2","_isInitializing","attr","$tabs","children","role","each","idx","el","$el","$content","id","GetYoDigits","linkId","concat","find","aria-controls","aria-expanded","aria-selected","aria-labelledby","aria-hidden","$initActive","length","_initialAnchor","prev","_openSingleTab","_checkDeepLink","anchor","location","hash","$anchor","$link","parent","hasClass","_closeAllTabs","deepLinkSmudge","onLoad","offset","animate","scrollTop","top","deepLinkSmudgeOffset","deepLinkSmudgeDelay","trigger","deepLink","_events","_this","$elem","$tabContent","off","on","e","preventDefault","toggle","handleKey","next","$a","focus","multiExpand","previous","handled","$target","closest","is","console","info","up","down","updateHistory","history","pushState","replaceState","_openTab","$targetItem","$othersItems","siblings","allowAllClosed","_closeTab","$activeContents","not","_this3","targetContentId","addClass","stop","slideDown","slideSpeed","_this4","removeClass","slideUp","$activeTabs","css","c","name","getter","o","Object","defineProperty","enumerable","get","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","object","property","prototype","hasOwnProperty","call","p","s","moduleId","i","l","modules"],"mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,EAAAG,QAAA,qBAAAA,QAAA,8BAAAA,QAAA,WACA,mBAAAC,QAAAA,OAAAC,IACAD,OAAA,CAAA,oBAAA,6BAAA,UAAAJ,GACA,iBAAAC,QACAA,QAAA,wBAAAD,EAAAG,QAAA,qBAAAA,QAAA,8BAAAA,QAAA,YAEAJ,EAAA,wBAAAA,EAAA,yBAAA,GAAyEA,EAAA,wBAAA,wBAAAC,EAAAD,EAAA,wBAAA,mBAAAA,EAAA,wBAAA,4BAAAA,EAAA,SARzE,CASCO,OAAA,SAAAC,EAAAC,EAAAC,GACD,OCTAC,EAAA,GA4BAC,EAAAC,uCC7BAV,EAAAD,QAAAM,8CCAAL,EAAAD,QAAAO,+ECAAG,EAAAE,EAAAC,GAAA,IAAAC,EAAAJ,EAAA,qBAAAA,EAAAK,EAAAF,EAAA,aAAA,WAAA,OAAAC,EAAA,aAAA,IAAAE,EAAAN,EAAA,gCAAAA,EAAAK,EAAAF,EAAA,YAAA,WAAA,OAAAG,EAAA,YAGAC,EAAAA,WAAWC,OAA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typeof module === 'object')\n\t\tmodule.exports = factory(require(\"./foundation.core\"), require(\"./foundation.util.keyboard\"), require(\"jquery\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"./foundation.core\", \"./foundation.util.keyboard\", \"jquery\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"foundation.accordion\"] = factory(require(\"./foundation.core\"), require(\"./foundation.util.keyboard\"), require(\"jquery\"));\n\telse\n\t\troot[\"__FOUNDATION_EXTERNAL__\"] = root[\"__FOUNDATION_EXTERNAL__\"] || {}, root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.accordion\"] = factory(root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.core\"], root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.util.keyboard\"], root[\"jQuery\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __WEBPACK_EXTERNAL_MODULE__foundation_util_keyboard__, __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 = 1);\n","module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_core__;","module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_util_keyboard__;","import { Foundation } from './foundation.core';\n\nimport { Accordion } from '../../foundation.accordion';\nFoundation.plugin(Accordion, 'Accordion');\n\nexport { Foundation, Accordion };\n","'use strict';\n\nimport $ from 'jquery';\nimport { Plugin } from './foundation.core.plugin';\nimport { onLoad, GetYoDigits } from './foundation.core.utils';\nimport { Keyboard } from './foundation.util.keyboard';\n\n/**\n * Accordion module.\n * @module foundation.accordion\n * @requires foundation.util.keyboard\n */\n\nclass Accordion extends Plugin {\n /**\n * Creates a new instance of an accordion.\n * @class\n * @name Accordion\n * @fires Accordion#init\n * @param {jQuery} element - jQuery object to make into an accordion.\n * @param {Object} options - a plain object with settings to override the default options.\n */\n _setup(element, options) {\n this.$element = element;\n this.options = $.extend({}, Accordion.defaults, this.$element.data(), options);\n\n this.className = 'Accordion'; // ie9 back compat\n this._init();\n\n Keyboard.register('Accordion', {\n 'ENTER': 'toggle',\n 'SPACE': 'toggle',\n 'ARROW_DOWN': 'next',\n 'ARROW_UP': 'previous'\n });\n }\n\n /**\n * Initializes the accordion by animating the preset active pane(s).\n * @private\n */\n _init() {\n this._isInitializing = true;\n\n this.$element.attr('role', 'tablist');\n this.$tabs = this.$element.children('[data-accordion-item]');\n\n this.$tabs.attr({'role': 'presentation'});\n\n this.$tabs.each(function(idx, el) {\n var $el = $(el),\n $content = $el.children('[data-tab-content]'),\n id = $content[0].id || GetYoDigits(6, 'accordion'),\n linkId = (el.id) ? `${el.id}-label` : `${id}-label`;\n\n $el.find('a:first').attr({\n 'aria-controls': id,\n 'role': 'tab',\n 'id': linkId,\n 'aria-expanded': false,\n 'aria-selected': false\n });\n\n $content.attr({'role': 'tabpanel', 'aria-labelledby': linkId, 'aria-hidden': true, 'id': id});\n });\n\n var $initActive = this.$element.find('.is-active').children('[data-tab-content]');\n if ($initActive.length) {\n // Save up the initial hash to return to it later when going back in history\n this._initialAnchor = $initActive.prev('a').attr('href');\n this._openSingleTab($initActive);\n }\n\n this._checkDeepLink = () => {\n var anchor = window.location.hash;\n\n if (!anchor.length) {\n // If we are still initializing and there is no anchor, then there is nothing to do\n if (this._isInitializing) return;\n // Otherwise, move to the initial anchor\n if (this._initialAnchor) anchor = this._initialAnchor;\n }\n\n var $anchor = anchor && $(anchor);\n var $link = anchor && this.$element.find(`[href$=\"${anchor}\"]`);\n // Whether the anchor element that has been found is part of this element\n var isOwnAnchor = !!($anchor.length && $link.length);\n\n if (isOwnAnchor) {\n // If there is an anchor for the hash, open it (if not already active)\n if ($anchor && $link && $link.length) {\n if (!$link.parent('[data-accordion-item]').hasClass('is-active')) {\n this._openSingleTab($anchor);\n }\n }\n // Otherwise, close everything\n else {\n this._closeAllTabs();\n }\n\n // Roll up a little to show the titles\n if (this.options.deepLinkSmudge) {\n onLoad($(window), () => {\n var offset = this.$element.offset();\n $('html, body').animate({ scrollTop: offset.top - this.options.deepLinkSmudgeOffset }, this.options.deepLinkSmudgeDelay);\n });\n }\n\n /**\n * Fires when the plugin has deeplinked at pageload\n * @event Accordion#deeplink\n */\n this.$element.trigger('deeplink.zf.accordion', [$link, $anchor]);\n }\n }\n\n //use browser to open a tab, if it exists in this tabset\n if (this.options.deepLink) {\n this._checkDeepLink();\n }\n\n this._events();\n\n this._isInitializing = false;\n }\n\n /**\n * Adds event handlers for items within the accordion.\n * @private\n */\n _events() {\n var _this = this;\n\n this.$tabs.each(function() {\n var $elem = $(this);\n var $tabContent = $elem.children('[data-tab-content]');\n if ($tabContent.length) {\n $elem.children('a').off('click.zf.accordion keydown.zf.accordion')\n .on('click.zf.accordion', function(e) {\n e.preventDefault();\n _this.toggle($tabContent);\n }).on('keydown.zf.accordion', function(e) {\n Keyboard.handleKey(e, 'Accordion', {\n toggle: function() {\n _this.toggle($tabContent);\n },\n next: function() {\n var $a = $elem.next().find('a').focus();\n if (!_this.options.multiExpand) {\n $a.trigger('click.zf.accordion')\n }\n },\n previous: function() {\n var $a = $elem.prev().find('a').focus();\n if (!_this.options.multiExpand) {\n $a.trigger('click.zf.accordion')\n }\n },\n handled: function() {\n e.preventDefault();\n }\n });\n });\n }\n });\n if (this.options.deepLink) {\n $(window).on('hashchange', this._checkDeepLink);\n }\n }\n\n /**\n * Toggles the selected content pane's open/close state.\n * @param {jQuery} $target - jQuery object of the pane to toggle (`.accordion-content`).\n * @function\n */\n toggle($target) {\n if ($target.closest('[data-accordion]').is('[disabled]')) {\n console.info('Cannot toggle an accordion that is disabled.');\n return;\n }\n if ($target.parent().hasClass('is-active')) {\n this.up($target);\n } else {\n this.down($target);\n }\n //either replace or update browser history\n if (this.options.deepLink) {\n var anchor = $target.prev('a').attr('href');\n\n if (this.options.updateHistory) {\n history.pushState({}, '', anchor);\n } else {\n history.replaceState({}, '', anchor);\n }\n }\n }\n\n /**\n * Opens the accordion tab defined by `$target`.\n * @param {jQuery} $target - Accordion pane to open (`.accordion-content`).\n * @fires Accordion#down\n * @function\n */\n down($target) {\n if ($target.closest('[data-accordion]').is('[disabled]')) {\n console.info('Cannot call down on an accordion that is disabled.');\n return;\n }\n\n if (this.options.multiExpand)\n this._openTab($target);\n else\n this._openSingleTab($target);\n }\n\n /**\n * Closes the tab defined by `$target`.\n * It may be ignored if the Accordion options don't allow it.\n *\n * @param {jQuery} $target - Accordion tab to close (`.accordion-content`).\n * @fires Accordion#up\n * @function\n */\n up($target) {\n if (this.$element.is('[disabled]')) {\n console.info('Cannot call up on an accordion that is disabled.');\n return;\n }\n\n // Don't close the item if it is already closed\n const $targetItem = $target.parent();\n if (!$targetItem.hasClass('is-active')) return;\n\n // Don't close the item if there is no other active item (unless with `allowAllClosed`)\n const $othersItems = $targetItem.siblings();\n if (!this.options.allowAllClosed && !$othersItems.hasClass('is-active')) return;\n\n this._closeTab($target);\n }\n\n /**\n * Make the tab defined by `$target` the only opened tab, closing all others tabs.\n * @param {jQuery} $target - Accordion tab to open (`.accordion-content`).\n * @function\n * @private\n */\n _openSingleTab($target) {\n // Close all the others active tabs.\n const $activeContents = this.$element.children('.is-active').children('[data-tab-content]');\n if ($activeContents.length) {\n this._closeTab($activeContents.not($target));\n }\n\n // Then open the target.\n this._openTab($target);\n }\n\n /**\n * Opens the tab defined by `$target`.\n * @param {jQuery} $target - Accordion tab to open (`.accordion-content`).\n * @fires Accordion#down\n * @function\n * @private\n */\n _openTab($target) {\n const $targetItem = $target.parent();\n const targetContentId = $target.attr('aria-labelledby');\n\n $target.attr('aria-hidden', false);\n $targetItem.addClass('is-active');\n\n $(`#${targetContentId}`).attr({\n 'aria-expanded': true,\n 'aria-selected': true\n });\n\n $target.stop().slideDown(this.options.slideSpeed, () => {\n /**\n * Fires when the tab is done opening.\n * @event Accordion#down\n */\n this.$element.trigger('down.zf.accordion', [$target]);\n });\n }\n\n /**\n * Closes the tab defined by `$target`.\n * @param {jQuery} $target - Accordion tab to close (`.accordion-content`).\n * @fires Accordion#up\n * @function\n * @private\n */\n _closeTab($target) {\n const $targetItem = $target.parent();\n const targetContentId = $target.attr('aria-labelledby');\n\n $target.attr('aria-hidden', true)\n $targetItem.removeClass('is-active');\n\n $(`#${targetContentId}`).attr({\n 'aria-expanded': false,\n 'aria-selected': false\n });\n\n $target.stop().slideUp(this.options.slideSpeed, () => {\n /**\n * Fires when the tab is done collapsing up.\n * @event Accordion#up\n */\n this.$element.trigger('up.zf.accordion', [$target]);\n });\n }\n\n /**\n * Closes all active tabs\n * @fires Accordion#up\n * @function\n * @private\n */\n _closeAllTabs() {\n var $activeTabs = this.$element.children('.is-active').children('[data-tab-content]');\n if ($activeTabs.length) {\n this._closeTab($activeTabs);\n }\n }\n\n /**\n * Destroys an instance of an accordion.\n * @fires Accordion#destroyed\n * @function\n */\n _destroy() {\n this.$element.find('[data-tab-content]').stop(true).slideUp(0).css('display', '');\n this.$element.find('a').off('.zf.accordion');\n if (this.options.deepLink) {\n $(window).off('hashchange', this._checkDeepLink);\n }\n\n }\n}\n\nAccordion.defaults = {\n /**\n * Amount of time to animate the opening of an accordion pane.\n * @option\n * @type {number}\n * @default 250\n */\n slideSpeed: 250,\n /**\n * Allow the accordion to have multiple open panes.\n * @option\n * @type {boolean}\n * @default false\n */\n multiExpand: false,\n /**\n * Allow the accordion to close all panes.\n * @option\n * @type {boolean}\n * @default false\n */\n allowAllClosed: false,\n /**\n * Link the location hash to the open pane.\n * Set the location hash when the opened pane changes, and open and scroll to the corresponding pane when the location changes.\n * @option\n * @type {boolean}\n * @default false\n */\n deepLink: false,\n /**\n * If `deepLink` is enabled, adjust the deep link scroll to make sure the top of the accordion panel is visible\n * @option\n * @type {boolean}\n * @default false\n */\n deepLinkSmudge: false,\n /**\n * If `deepLinkSmudge` is enabled, animation time (ms) for the deep link adjustment\n * @option\n * @type {number}\n * @default 300\n */\n deepLinkSmudgeDelay: 300,\n /**\n * If `deepLinkSmudge` is enabled, the offset for scrollToTtop to prevent overlap by a sticky element at the top of the page\n * @option\n * @type {number}\n * @default 0\n */\n deepLinkSmudgeOffset: 0,\n /**\n * If `deepLink` is enabled, update the browser history with the open accordion\n * @option\n * @type {boolean}\n * @default false\n */\n updateHistory: false\n};\n\nexport { Accordion };\n","module.exports = __WEBPACK_EXTERNAL_MODULE_jquery__;"]}
\No newline at end of file