diff --git a/dist/js/boosted.js b/dist/js/boosted.js index 4514c24c71..83ca2788ba 100644 --- a/dist/js/boosted.js +++ b/dist/js/boosted.js @@ -392,7 +392,7 @@ $targetNav.find(Selector.NAV_LINK).attr({'tabindex':0,'aria-hidden':false});if(c $(Selector.MEGAMENU).css('height','auto');$rootNav.find('>.nav-item .nav-link').attr({'tabindex':0,'aria-hidden':false});}// translate menu $rootNav.css('transform','translateX('+(currentTranslatePercentage+100)+'%)');// focus on target nav first item $rootNav.one('transitionend',function(){$targetNavToggler.attr('aria-expanded',false);$targetNavToggler.trigger('focus');$thisNav.hide();$rootNav.removeClass(ClassName.TRANSITIONING);});};// static -MegaMenu._jQueryInterface=function _jQueryInterface(config){return this.each(function(){if(typeof config!=='string'||!/^[.#].*/.test(config)){throw new Error('Selector "'+config+'" is not a valid jQuery Selector');}var $element=$(this);var data=$element.data(DATA_KEY);if(!data){data=new MegaMenu(this,config);$element.data(DATA_KEY,data);}else{throw new Error('Component '+DATA_KEY+' was already initialized');}});};_createClass(MegaMenu,null,[{key:'VERSION',get:function get(){return VERSION;}}]);return MegaMenu;}();/** +MegaMenu._jQueryInterface=function _jQueryInterface(config){return this.each(function(){if(typeof config!=='undefined'){if(typeof config!=='string'||!/^[.#undefined].*/.test(config)){throw new Error('Selector "'+config+'" is not a valid jQuery Selector');}}var $element=$(this);var data=$element.data(DATA_KEY);if(!data){data=new MegaMenu(this,config);$element.data(DATA_KEY,data);}else{throw new Error('Component '+DATA_KEY+' was already initialized');}});};_createClass(MegaMenu,null,[{key:'VERSION',get:function get(){return VERSION;}}]);return MegaMenu;}();/** * ------------------------------------------------------------------------ * jQuery * ------------------------------------------------------------------------ diff --git a/dist/js/boosted.min.js b/dist/js/boosted.min.js index c6302c9690..fe2e019ff3 100644 --- a/dist/js/boosted.min.js +++ b/dist/js/boosted.min.js @@ -249,7 +249,7 @@ return!(!n.next(_.NAV_MENU).length||o.hasClass(f.TRANSITIONING))&&(o.addClass(f. // reset main collapse height // translate menu // focus on target nav first item -return 0!==c&&!o.hasClass(f.TRANSITIONING)&&(o.addClass(f.TRANSITIONING),r.find(_.NAV_LINK).attr({tabindex:0,"aria-hidden":!1}),c===-100&&(t(_.MEGAMENU).css("height","auto"),o.find(">.nav-item .nav-link").attr({tabindex:0,"aria-hidden":!1})),o.css("transform","translateX("+(c+100)+"%)"),void o.one("transitionend",function(){s.attr("aria-expanded",!1),s.trigger("focus"),i.hide(),o.removeClass(f.TRANSITIONING)}))},a._jQueryInterface=function(e){return this.each(function(){if("string"!=typeof e||!/^[.#].*/.test(e))throw new Error('Selector "'+e+'" is not a valid jQuery Selector');var n=t(this),i=n.data(s);if(i)throw new Error("Component "+s+" was already initialized");i=new a(this,e),n.data(s,i)})},r(a,null,[{key:"VERSION",get:function(){return i}}]),a}();/** +return 0!==c&&!o.hasClass(f.TRANSITIONING)&&(o.addClass(f.TRANSITIONING),r.find(_.NAV_LINK).attr({tabindex:0,"aria-hidden":!1}),c===-100&&(t(_.MEGAMENU).css("height","auto"),o.find(">.nav-item .nav-link").attr({tabindex:0,"aria-hidden":!1})),o.css("transform","translateX("+(c+100)+"%)"),void o.one("transitionend",function(){s.attr("aria-expanded",!1),s.trigger("focus"),i.hide(),o.removeClass(f.TRANSITIONING)}))},a._jQueryInterface=function(e){return this.each(function(){if("undefined"!=typeof e&&("string"!=typeof e||!/^[.#undefined].*/.test(e)))throw new Error('Selector "'+e+'" is not a valid jQuery Selector');var n=t(this),i=n.data(s);if(i)throw new Error("Component "+s+" was already initialized");i=new a(this,e),n.data(s,i)})},r(a,null,[{key:"VERSION",get:function(){return i}}]),a}();/** * ------------------------------------------------------------------------ * jQuery * ------------------------------------------------------------------------ diff --git a/js/dist/o-megamenu.js b/js/dist/o-megamenu.js index 2fca0f631e..a38d88ccab 100644 --- a/js/dist/o-megamenu.js +++ b/js/dist/o-megamenu.js @@ -283,8 +283,10 @@ var MegaMenu = function ($) { MegaMenu._jQueryInterface = function _jQueryInterface(config) { return this.each(function () { - if (typeof config !== 'string' || !/^[.#].*/.test(config)) { - throw new Error('Selector "' + config + '" is not a valid jQuery Selector'); + if (typeof config !== 'undefined') { + if (typeof config !== 'string' || !/^[.#undefined].*/.test(config)) { + throw new Error('Selector "' + config + '" is not a valid jQuery Selector'); + } } var $element = $(this); diff --git a/js/dist/o-megamenu.js.map b/js/dist/o-megamenu.js.map index 5eb739e7ae..e322d51798 100644 --- a/js/dist/o-megamenu.js.map +++ b/js/dist/o-megamenu.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/o-megamenu.js"],"names":["MegaMenu","$","NAME","VERSION","DATA_KEY","JQUERY_NO_CONFLICT","fn","ARROW_LEFT_KEYCODE","ARROW_RIGHT_KEYCODE","ARROW_UP_KEYCODE","ARROW_DOWN_KEYCODE","POS_MODULO","Event","ClassName","TRANSITIONING","Dimension","Selector","MEGAMENU","ROOT_NAV","MEGAMENU_PANEL","MEGAMENU_PANEL_NAV","MEGAMENU_NAV","NAV_MENU","NAV_ITEM","NAV_LINK","NAV_LINK_COLLAPSE","NAV_LINK_BACK","NAV_LINK_EXPANDED","element","config","_element","_config","_$navLinks","find","_$goForwardLinks","prev","_$goBackLinks","_$topCollapseMenus","_$navLinkCollapses","_addEventListeners","_addAriaAttributes","length","_initPosition","on","event","_goForward","_goBackward","_manageKeyDown","_collapseFocus","_handleCollapseToggle","$subNavs","attr","each","navId","Util","getUID","$thisNavToggler","$thisNav","$thisNavBackLink","$topMenu","closest","parent","goBackLabel","text","$target","position","parents","index","translatePercentage","$rootNav","addClass","collapse","show","not","css","one","trigger","removeClass","$thisTarget","target","test","tagName","which","next","first","e","$this","$thisCollapse","preventDefault","$targetNav","currentTranslatePos","parseInt","split","navWidth","width","currentTranslatePercentage","hasClass","hide","height","$targetNavToggler","_jQueryInterface","Error","$element","data","Constructor","noConflict","jQuery"],"mappings":";;;;AAEA;;AAEA;;;;;;;AAOA,IAAMA,WAAY,UAACC,CAAD,EAAO;;AAGvB;;;;;;AAMA,MAAIC,OAAO,U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A;AACnB,eAAOD,OAAP;AACD;AAxEoB;;AAAA;AAAA;;AA+RvB;;;;;;AAMAF,IAAEK,EAAF,CAAKJ,IAAL,IAAyBF,SAASoG,gBAAlC;AACAnG,IAAEK,EAAF,CAAKJ,IAAL,EAAWsG,WAAX,GAAyBxG,QAAzB;AACAC,IAAEK,EAAF,CAAKJ,IAAL,EAAWuG,UAAX,GAAyB,YAAY;AACnCxG,MAAEK,EAAF,CAAKJ,IAAL,IAAaG,kBAAb;AACA,WAAOL,SAASoG,gBAAhB;AACD,GAHD;;AAKA,SAAOpG,QAAP;AAED,CA9SgB,CA8Sd0G,MA9Sc,CAAjB","file":"o-megamenu.js","sourcesContent":["import Util from './util'\n\n/* eslint no-magic-numbers: [\"error\", { \"ignore\": [1,2] }] */\n\n/**\n * --------------------------------------------------------------------------\n * Boosted (v4.0.0-alpha.6): o-megamenu.js\n * Licensed under MIT (https://github.com/Orange-OpenSource/Orange-Boosted-Bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst MegaMenu = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n var NAME = 'megamenu';\n var VERSION = '4.0.0-alpha.6';\n var DATA_KEY = 'bs.megamenu';\n var JQUERY_NO_CONFLICT = $.fn[NAME];\n var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key\n var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key\n var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key\n var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key\n var POS_MODULO = 5;\n\n const Event = {\n }\n\n const ClassName = {\n TRANSITIONING: 'transitioning'\n }\n\n const Dimension = {\n }\n\n const Selector = {\n MEGAMENU : '.mega-menu',\n ROOT_NAV : '.mega-menu > .navbar-nav',\n MEGAMENU_PANEL : '.mega-menu-panel',\n MEGAMENU_PANEL_NAV : '.mega-menu-panel > .container > .navbar-nav',\n MEGAMENU_NAV : '.nav-link + .navbar-nav',\n NAV_MENU : '.navbar-nav',\n NAV_ITEM : '.nav-item',\n NAV_LINK : '.nav-link',\n NAV_LINK_COLLAPSE : '.nav-link[data-toggle=collapse]',\n NAV_LINK_BACK : '.nav-link.back',\n NAV_LINK_EXPANDED : '.nav-link[aria-expanded=true]'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class MegaMenu {\n\n constructor(element, config) {\n this._element = element\n\t this._config = config\n this._$navLinks = $(this._element).find(Selector.NAV_LINK)\n this._$goForwardLinks = $(this._element).find(Selector.MEGAMENU_NAV).prev(Selector.NAV_LINK)\n this._$goBackLinks = $(this._element).find(Selector.NAV_LINK_BACK)\n this._$topCollapseMenus = $(this._element).find(Selector.MEGAMENU_PANEL)\n this._$navLinkCollapses = $(this._element).find(Selector.NAV_LINK_COLLAPSE)\n this._addEventListeners()\n this._addAriaAttributes(this._element)\n\n if ($(this._config).length > 0) {\n this._initPosition($(this._config));\n }\n }\n\n // getters\n\n static get VERSION() {\n return VERSION\n }\n\n // public\n\n // private\n\n _addEventListeners() {\n this._$goForwardLinks.on('click', (event) => this._goForward(event))\n this._$goBackLinks.on('click', (event) => this._goBackward(event))\n this._$navLinks.on('keydown', (event) => this._manageKeyDown(event))\n this._$topCollapseMenus.on('shown.bs.collapse', this._collapseFocus)\n this._$navLinkCollapses.on('click', (event) => this._handleCollapseToggle(event))\n }\n\n _addAriaAttributes(element) {\n const $subNavs = $(element).find('.nav-link + .navbar-nav')\n\n $(element).attr('role', 'application')\n $(element).find('> .navbar-nav').attr('role', 'menu')\n $(element).find(Selector.MEGAMENU_PANEL).attr('role', 'menu')\n $(element).find('.nav-link[data-toggle=collapse]').attr('role', 'menuitem')\n $(element).find(Selector.NAV_LINK_BACK).attr({'aria-hidden': true})\n $(element).find(Selector.NAV_ITEM).attr('role', 'presentation')\n\n $subNavs.each(function() {\n const navId = Util.getUID(NAME)\n const $thisNavToggler = $(this).prev(Selector.NAV_LINK)\n const $thisNav = $(this)\n const $thisNavBackLink = $thisNav.find(Selector.NAV_LINK_BACK)\n const $topMenu = $(this).closest(Selector.NAV_MENU).parent().closest(Selector.NAV_MENU).prev(Selector.NAV_LINK)\n let goBackLabel = 'go back to ' + $topMenu.text() + ' menu'\n\n if(!$topMenu.length) {\n goBackLabel = 'go back to ' + $(this).closest(Selector.MEGAMENU_PANEL).prev(Selector.NAV_LINK).text() + ' menu'\n }\n\n $thisNav.attr({'id': navId, 'role': 'menu'})\n $thisNavToggler.attr({'role': 'menuitem', 'aria-controls': navId, 'aria-expanded': false, 'aria-haspopup': true})\n $thisNavBackLink.attr({'role': 'menuitem', 'aria-controls': navId, 'aria-label': goBackLabel})\n })\n }\n\n _initPosition($target) {\n const position = $target.parents().index(this._element)\n const translatePercentage = -(position % POS_MODULO) * 100 / 2\n const $thisNav = $target.closest(Selector.NAV_MENU)\n const $rootNav = $(Selector.ROOT_NAV)\n\n $rootNav.addClass(ClassName.TRANSITIONING)\n\n // open collapse\n $target.closest(Selector.MEGAMENU_PANEL).collapse('show')\n\n // show menu and hide other\n $target.parents(Selector.NAV_MENU).show()\n\n // set aria on parent links\n $target.parents(Selector.NAV_ITEM).find('> .nav-link').not($target).attr({'tabindex': -1, 'aria-hidden': true, 'aria-expanded': true})\n\n // translate to pos\n $rootNav.css('transform', 'translateX(' + translatePercentage + '%)')\n\n $rootNav.one('transitionend', function() {\n //set focus on target link\n $target.trigger('focus')\n\n $rootNav.removeClass(ClassName.TRANSITIONING)\n })\n\n };\n\n _manageKeyDown(event) {\n const $thisTarget = $(event.target)\n\n // test key code\n if (/input|textarea/i.test(event.target.tagName)) {\n return\n }\n\n // proceed according to key code\n switch(event.which){\n case ARROW_LEFT_KEYCODE:\n this._goBackward(event)\n break\n case ARROW_RIGHT_KEYCODE:\n this._goForward(event)\n break\n case ARROW_UP_KEYCODE:\n // focus prev nav link\n $thisTarget.parent().prev().find('>.nav-link').not(Selector.NAV_LINK_BACK).trigger('focus')\n break\n case ARROW_DOWN_KEYCODE:\n // focus next nav link\n $thisTarget.parent().next().find('>.nav-link').trigger('focus')\n break\n default:\n return\n }\n }\n\n _collapseFocus(){\n $(this).find(Selector.NAV_LINK).not(Selector.NAV_LINK_BACK).first().trigger('focus')\n }\n\n _handleCollapseToggle(e){\n const $this = $(e.target)\n const $thisCollapse = $($this.attr('href'))\n\n this._$topCollapseMenus.not($thisCollapse).collapse('hide')\n }\n\n _goForward(e) {\n e.preventDefault();\n const $this = $(e.target)\n const $thisNav = $this.closest(Selector.NAV_MENU)\n const $targetNav = $this.next(Selector.NAV_MENU)\n const $rootNav = $(Selector.ROOT_NAV)\n const $thisNavToggler = $this\n const currentTranslatePos = parseInt($rootNav.css('transform').split(',')[4], 10)\n const navWidth = $rootNav.width()\n const currentTranslatePercentage = 100 * currentTranslatePos / navWidth\n\n if(!$this.next(Selector.NAV_MENU).length || $rootNav.hasClass(ClassName.TRANSITIONING)) {\n return false\n }\n\n $rootNav.addClass(ClassName.TRANSITIONING)\n\n // hide all nav on same level\n $thisNav.find(Selector.NAV_MENU).hide()\n\n // show target navbar-nav\n $targetNav.show()\n\n // adapt main collapse height to target height\n $(Selector.MEGAMENU).height($targetNav.height())\n\n // make only visible elements focusable\n if(currentTranslatePercentage === 0) {\n $rootNav.find('>.nav-item .nav-link').attr({'tabindex': -1, 'aria-hidden': true})\n }\n $thisNav.find(Selector.NAV_LINK).attr({'tabindex': -1, 'aria-hidden': true})\n $targetNav.find(Selector.NAV_LINK).attr({'tabindex': 0, 'aria-hidden': false})\n\n // translate menu\n $rootNav.css('transform', 'translateX('+(currentTranslatePercentage - 100)+'%)')\n\n // focus on target nav first item\n $rootNav.one('transitionend', function() {\n $thisNavToggler.attr('aria-expanded', true)\n $targetNav.find(Selector.NAV_LINK).not(Selector.NAV_LINK_BACK).first().trigger('focus')\n $rootNav.removeClass(ClassName.TRANSITIONING)\n })\n }\n\n _goBackward(e) {\n e.preventDefault()\n\n const $this = $(e.target)\n const $thisNav = $this.closest(Selector.NAV_MENU)\n const $targetNav = $thisNav.parent().closest(Selector.NAV_MENU)\n const $rootNav = $(Selector.ROOT_NAV)\n const $targetNavToggler = $targetNav.find(Selector.NAV_LINK_EXPANDED)\n const $thisNavBackLink = $this\n const currentTranslatePos = parseInt($rootNav.css('transform').split(',')[4], 10)\n const navWidth = $rootNav.width()\n const currentTranslatePercentage = 100 * currentTranslatePos / navWidth\n\n if(currentTranslatePercentage === 0 || $rootNav.hasClass(ClassName.TRANSITIONING)) {\n return false\n }\n\n $rootNav.addClass(ClassName.TRANSITIONING)\n\n // make only visible elements focusable\n $targetNav.find(Selector.NAV_LINK).attr({'tabindex': 0, 'aria-hidden': false})\n if(currentTranslatePercentage === -100) {\n // reset main collapse height\n $(Selector.MEGAMENU).css('height', 'auto')\n $rootNav.find('>.nav-item .nav-link').attr({'tabindex': 0, 'aria-hidden': false})\n }\n\n // translate menu\n $rootNav.css('transform', 'translateX('+(currentTranslatePercentage + 100)+'%)')\n\n // focus on target nav first item\n $rootNav.one('transitionend', function() {\n $targetNavToggler.attr('aria-expanded', false)\n $targetNavToggler.trigger('focus')\n $thisNav.hide()\n $rootNav.removeClass(ClassName.TRANSITIONING)\n })\n }\n\n // static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n if (typeof config !== 'string' || !/^[.#].*/.test(config)) {\n throw new Error(`Selector \"${config}\" is not a valid jQuery Selector`)\n }\n\n const $element = $(this)\n let data = $element.data(DATA_KEY)\n\n if (!data) {\n data = new MegaMenu(this, config)\n $element.data(DATA_KEY, data)\n } else {\n throw new Error(`Component ${DATA_KEY} was already initialized`)\n }\n })\n }\n }\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = MegaMenu._jQueryInterface\n $.fn[NAME].Constructor = MegaMenu\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return MegaMenu._jQueryInterface\n }\n\n return MegaMenu\n\n})(jQuery)\n\nexport default MegaMenu\n"]} \ No newline at end of file +{"version":3,"sources":["../src/o-megamenu.js"],"names":["MegaMenu","$","NAME","VERSION","DATA_KEY","JQUERY_NO_CONFLICT","fn","ARROW_LEFT_KEYCODE","ARROW_RIGHT_KEYCODE","ARROW_UP_KEYCODE","ARROW_DOWN_KEYCODE","POS_MODULO","Event","ClassName","TRANSITIONING","Dimension","Selector","MEGAMENU","ROOT_NAV","MEGAMENU_PANEL","MEGAMENU_PANEL_NAV","MEGAMENU_NAV","NAV_MENU","NAV_ITEM","NAV_LINK","NAV_LINK_COLLAPSE","NAV_LINK_BACK","NAV_LINK_EXPANDED","element","config","_element","_config","_$navLinks","find","_$goForwardLinks","prev","_$goBackLinks","_$topCollapseMenus","_$navLinkCollapses","_addEventListeners","_addAriaAttributes","length","_initPosition","on","event","_goForward","_goBackward","_manageKeyDown","_collapseFocus","_handleCollapseToggle","$subNavs","attr","each","navId","Util","getUID","$thisNavToggler","$thisNav","$thisNavBackLink","$topMenu","closest","parent","goBackLabel","text","$target","position","parents","index","translatePercentage","$rootNav","addClass","collapse","show","not","css","one","trigger","removeClass","$thisTarget","target","test","tagName","which","next","first","e","$this","$thisCollapse","preventDefault","$targetNav","currentTranslatePos","parseInt","split","navWidth","width","currentTranslatePercentage","hasClass","hide","height","$targetNavToggler","_jQueryInterface","Error","$element","data","Constructor","noConflict","jQuery"],"mappings":";;;;AAEA;;AAEA;;;;;;;AAOA,IAAMA,WAAY,UAACC,CAAD,EAAO;;AAGvB;;;;;;AAMA,MAAIC,OAAO,UAAX;AACA,MAAIC,UAAU,eAAd;AACA,MAAIC,WAAW,aAAf;AACA,MAAIC,qBAAqBJ,EAAEK,EAAF,CAAKJ,IAAL,CAAzB;AACA,MAAIK,qBAAqB,EAAzB,CAbuB,CAaM;AAC7B,MAAIC,sBAAsB,EAA1B,CAduB,CAcO;AAC9B,MAAIC,mBAAmB,EAAvB,CAfuB,CAeI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yBxG,QAAzB;AACAC,IAAEK,EAAF,CAAKJ,IAAL,EAAWuG,UAAX,GAAyB,YAAY;AACnCxG,MAAEK,EAAF,CAAKJ,IAAL,IAAaG,kBAAb;AACA,WAAOL,SAASoG,gBAAhB;AACD,GAHD;;AAKA,SAAOpG,QAAP;AAED,CAhTgB,CAgTd0G,MAhTc,CAAjB","file":"o-megamenu.js","sourcesContent":["import Util from './util'\n\n/* eslint no-magic-numbers: [\"error\", { \"ignore\": [1,2] }] */\n\n/**\n * --------------------------------------------------------------------------\n * Boosted (v4.0.0-alpha.6): o-megamenu.js\n * Licensed under MIT (https://github.com/Orange-OpenSource/Orange-Boosted-Bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst MegaMenu = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n var NAME = 'megamenu';\n var VERSION = '4.0.0-alpha.6';\n var DATA_KEY = 'bs.megamenu';\n var JQUERY_NO_CONFLICT = $.fn[NAME];\n var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key\n var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key\n var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key\n var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key\n var POS_MODULO = 5;\n\n const Event = {\n }\n\n const ClassName = {\n TRANSITIONING: 'transitioning'\n }\n\n const Dimension = {\n }\n\n const Selector = {\n MEGAMENU : '.mega-menu',\n ROOT_NAV : '.mega-menu > .navbar-nav',\n MEGAMENU_PANEL : '.mega-menu-panel',\n MEGAMENU_PANEL_NAV : '.mega-menu-panel > .container > .navbar-nav',\n MEGAMENU_NAV : '.nav-link + .navbar-nav',\n NAV_MENU : '.navbar-nav',\n NAV_ITEM : '.nav-item',\n NAV_LINK : '.nav-link',\n NAV_LINK_COLLAPSE : '.nav-link[data-toggle=collapse]',\n NAV_LINK_BACK : '.nav-link.back',\n NAV_LINK_EXPANDED : '.nav-link[aria-expanded=true]'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class MegaMenu {\n\n constructor(element, config) {\n this._element = element\n\t this._config = config\n this._$navLinks = $(this._element).find(Selector.NAV_LINK)\n this._$goForwardLinks = $(this._element).find(Selector.MEGAMENU_NAV).prev(Selector.NAV_LINK)\n this._$goBackLinks = $(this._element).find(Selector.NAV_LINK_BACK)\n this._$topCollapseMenus = $(this._element).find(Selector.MEGAMENU_PANEL)\n this._$navLinkCollapses = $(this._element).find(Selector.NAV_LINK_COLLAPSE)\n this._addEventListeners()\n this._addAriaAttributes(this._element)\n\n if ($(this._config).length > 0) {\n this._initPosition($(this._config));\n }\n }\n\n // getters\n\n static get VERSION() {\n return VERSION\n }\n\n // public\n\n // private\n\n _addEventListeners() {\n this._$goForwardLinks.on('click', (event) => this._goForward(event))\n this._$goBackLinks.on('click', (event) => this._goBackward(event))\n this._$navLinks.on('keydown', (event) => this._manageKeyDown(event))\n this._$topCollapseMenus.on('shown.bs.collapse', this._collapseFocus)\n this._$navLinkCollapses.on('click', (event) => this._handleCollapseToggle(event))\n }\n\n _addAriaAttributes(element) {\n const $subNavs = $(element).find('.nav-link + .navbar-nav')\n\n $(element).attr('role', 'application')\n $(element).find('> .navbar-nav').attr('role', 'menu')\n $(element).find(Selector.MEGAMENU_PANEL).attr('role', 'menu')\n $(element).find('.nav-link[data-toggle=collapse]').attr('role', 'menuitem')\n $(element).find(Selector.NAV_LINK_BACK).attr({'aria-hidden': true})\n $(element).find(Selector.NAV_ITEM).attr('role', 'presentation')\n\n $subNavs.each(function() {\n const navId = Util.getUID(NAME)\n const $thisNavToggler = $(this).prev(Selector.NAV_LINK)\n const $thisNav = $(this)\n const $thisNavBackLink = $thisNav.find(Selector.NAV_LINK_BACK)\n const $topMenu = $(this).closest(Selector.NAV_MENU).parent().closest(Selector.NAV_MENU).prev(Selector.NAV_LINK)\n let goBackLabel = 'go back to ' + $topMenu.text() + ' menu'\n\n if(!$topMenu.length) {\n goBackLabel = 'go back to ' + $(this).closest(Selector.MEGAMENU_PANEL).prev(Selector.NAV_LINK).text() + ' menu'\n }\n\n $thisNav.attr({'id': navId, 'role': 'menu'})\n $thisNavToggler.attr({'role': 'menuitem', 'aria-controls': navId, 'aria-expanded': false, 'aria-haspopup': true})\n $thisNavBackLink.attr({'role': 'menuitem', 'aria-controls': navId, 'aria-label': goBackLabel})\n })\n }\n\n _initPosition($target) {\n const position = $target.parents().index(this._element)\n const translatePercentage = -(position % POS_MODULO) * 100 / 2\n const $thisNav = $target.closest(Selector.NAV_MENU)\n const $rootNav = $(Selector.ROOT_NAV)\n\n $rootNav.addClass(ClassName.TRANSITIONING)\n\n // open collapse\n $target.closest(Selector.MEGAMENU_PANEL).collapse('show')\n\n // show menu and hide other\n $target.parents(Selector.NAV_MENU).show()\n\n // set aria on parent links\n $target.parents(Selector.NAV_ITEM).find('> .nav-link').not($target).attr({'tabindex': -1, 'aria-hidden': true, 'aria-expanded': true})\n\n // translate to pos\n $rootNav.css('transform', 'translateX(' + translatePercentage + '%)')\n\n $rootNav.one('transitionend', function() {\n //set focus on target link\n $target.trigger('focus')\n\n $rootNav.removeClass(ClassName.TRANSITIONING)\n })\n\n };\n\n _manageKeyDown(event) {\n const $thisTarget = $(event.target)\n\n // test key code\n if (/input|textarea/i.test(event.target.tagName)) {\n return\n }\n\n // proceed according to key code\n switch(event.which){\n case ARROW_LEFT_KEYCODE:\n this._goBackward(event)\n break\n case ARROW_RIGHT_KEYCODE:\n this._goForward(event)\n break\n case ARROW_UP_KEYCODE:\n // focus prev nav link\n $thisTarget.parent().prev().find('>.nav-link').not(Selector.NAV_LINK_BACK).trigger('focus')\n break\n case ARROW_DOWN_KEYCODE:\n // focus next nav link\n $thisTarget.parent().next().find('>.nav-link').trigger('focus')\n break\n default:\n return\n }\n }\n\n _collapseFocus(){\n $(this).find(Selector.NAV_LINK).not(Selector.NAV_LINK_BACK).first().trigger('focus')\n }\n\n _handleCollapseToggle(e){\n const $this = $(e.target)\n const $thisCollapse = $($this.attr('href'))\n\n this._$topCollapseMenus.not($thisCollapse).collapse('hide')\n }\n\n _goForward(e) {\n e.preventDefault();\n const $this = $(e.target)\n const $thisNav = $this.closest(Selector.NAV_MENU)\n const $targetNav = $this.next(Selector.NAV_MENU)\n const $rootNav = $(Selector.ROOT_NAV)\n const $thisNavToggler = $this\n const currentTranslatePos = parseInt($rootNav.css('transform').split(',')[4], 10)\n const navWidth = $rootNav.width()\n const currentTranslatePercentage = 100 * currentTranslatePos / navWidth\n\n if(!$this.next(Selector.NAV_MENU).length || $rootNav.hasClass(ClassName.TRANSITIONING)) {\n return false\n }\n\n $rootNav.addClass(ClassName.TRANSITIONING)\n\n // hide all nav on same level\n $thisNav.find(Selector.NAV_MENU).hide()\n\n // show target navbar-nav\n $targetNav.show()\n\n // adapt main collapse height to target height\n $(Selector.MEGAMENU).height($targetNav.height())\n\n // make only visible elements focusable\n if(currentTranslatePercentage === 0) {\n $rootNav.find('>.nav-item .nav-link').attr({'tabindex': -1, 'aria-hidden': true})\n }\n $thisNav.find(Selector.NAV_LINK).attr({'tabindex': -1, 'aria-hidden': true})\n $targetNav.find(Selector.NAV_LINK).attr({'tabindex': 0, 'aria-hidden': false})\n\n // translate menu\n $rootNav.css('transform', 'translateX('+(currentTranslatePercentage - 100)+'%)')\n\n // focus on target nav first item\n $rootNav.one('transitionend', function() {\n $thisNavToggler.attr('aria-expanded', true)\n $targetNav.find(Selector.NAV_LINK).not(Selector.NAV_LINK_BACK).first().trigger('focus')\n $rootNav.removeClass(ClassName.TRANSITIONING)\n })\n }\n\n _goBackward(e) {\n e.preventDefault()\n\n const $this = $(e.target)\n const $thisNav = $this.closest(Selector.NAV_MENU)\n const $targetNav = $thisNav.parent().closest(Selector.NAV_MENU)\n const $rootNav = $(Selector.ROOT_NAV)\n const $targetNavToggler = $targetNav.find(Selector.NAV_LINK_EXPANDED)\n const $thisNavBackLink = $this\n const currentTranslatePos = parseInt($rootNav.css('transform').split(',')[4], 10)\n const navWidth = $rootNav.width()\n const currentTranslatePercentage = 100 * currentTranslatePos / navWidth\n\n if(currentTranslatePercentage === 0 || $rootNav.hasClass(ClassName.TRANSITIONING)) {\n return false\n }\n\n $rootNav.addClass(ClassName.TRANSITIONING)\n\n // make only visible elements focusable\n $targetNav.find(Selector.NAV_LINK).attr({'tabindex': 0, 'aria-hidden': false})\n if(currentTranslatePercentage === -100) {\n // reset main collapse height\n $(Selector.MEGAMENU).css('height', 'auto')\n $rootNav.find('>.nav-item .nav-link').attr({'tabindex': 0, 'aria-hidden': false})\n }\n\n // translate menu\n $rootNav.css('transform', 'translateX('+(currentTranslatePercentage + 100)+'%)')\n\n // focus on target nav first item\n $rootNav.one('transitionend', function() {\n $targetNavToggler.attr('aria-expanded', false)\n $targetNavToggler.trigger('focus')\n $thisNav.hide()\n $rootNav.removeClass(ClassName.TRANSITIONING)\n })\n }\n\n // static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n if(typeof config !== 'undefined') {\n if (typeof config !== 'string' || !/^[.#undefined].*/.test(config)) {\n throw new Error(`Selector \"${config}\" is not a valid jQuery Selector`)\n }\n }\n\n const $element = $(this)\n let data = $element.data(DATA_KEY)\n\n if (!data) {\n data = new MegaMenu(this, config)\n $element.data(DATA_KEY, data)\n } else {\n throw new Error(`Component ${DATA_KEY} was already initialized`)\n }\n })\n }\n }\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = MegaMenu._jQueryInterface\n $.fn[NAME].Constructor = MegaMenu\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return MegaMenu._jQueryInterface\n }\n\n return MegaMenu\n\n})(jQuery)\n\nexport default MegaMenu\n"]} \ No newline at end of file diff --git a/js/src/o-megamenu.js b/js/src/o-megamenu.js index f54e453734..2a3bd058cc 100644 --- a/js/src/o-megamenu.js +++ b/js/src/o-megamenu.js @@ -279,8 +279,10 @@ const MegaMenu = (($) => { static _jQueryInterface(config) { return this.each(function () { - if (typeof config !== 'string' || !/^[.#].*/.test(config)) { - throw new Error(`Selector "${config}" is not a valid jQuery Selector`) + if(typeof config !== 'undefined') { + if (typeof config !== 'string' || !/^[.#undefined].*/.test(config)) { + throw new Error(`Selector "${config}" is not a valid jQuery Selector`) + } } const $element = $(this)