{"version":3,"sources":["https:\/\/erste.elearning.co.hu\/theme\/boost\/amd\/src\/aria.js"],"names":["dropdownFix","focusEnd","setFocusEnd","getFocusEnd","result","document","addEventListener","e","target","matches","trigger","which","arrowUp","space","enter","preventDefault","click","shiftFocus","element","setTimeout","delayedFocus","pendingPromise","focus","resolve","Pending","on","menu","querySelector","menuItems","foundMenuItem","querySelectorAll","length","String","fromCharCode","toLowerCase","closest","i","item","itemText","text","trim","indexOf","next","arrowDown","home","end","autoFocus","window","alerts","Array","prototype","forEach","call","autofocusElement","innerHTML","removeAttribute","updateTabFocus","tabList","vertical","getAttribute","rtl","right_to_left","arrowNext","arrowLeft","arrowRight","arrowPrevious","tabs","filter","tab","getComputedStyle","display","index","keyCode","tabIndex","tabElementFix","includes","init"],"mappings":"8KAwBA,OACA,O,sDAKMA,CAAAA,CAAW,CAAG,UAAM,IAClBC,CAAAA,CAAQ,GADU,CAEhBC,CAAW,CAAG,UAAM,CACtBD,CAAQ,GACX,CAJqB,CAKhBE,CAAW,CAAG,UAAM,CACtB,GAAMC,CAAAA,CAAM,CAAGH,CAAf,CACAA,CAAQ,GAAR,CACA,MAAOG,CAAAA,CACV,CATqB,CAYtBC,QAAQ,CAACC,gBAAT,CAA0B,SAA1B,CAAqC,SAAAC,CAAC,CAAI,CACtC,GAAIA,CAAC,CAACC,MAAF,CAASC,OAAT,CAAiB,4BAAjB,CAAJ,CAAkD,CAC9C,GAAMC,CAAAA,CAAO,CAAGH,CAAC,CAACI,KAAlB,CAGA,GAAID,CAAO,EAAIE,SAAf,CAAwB,CAEpBV,CAAW,EACd,CAGD,GAAIQ,CAAO,EAAIG,OAAX,EAAoBH,CAAO,EAAII,OAAnC,CAA0C,CAEtCP,CAAC,CAACQ,cAAF,GAEAR,CAAC,CAACC,MAAF,CAASQ,KAAT,EACH,CACJ,CACJ,CAlBD,EAqBA,GAAMC,CAAAA,CAAU,CAAG,SAAAC,CAAO,CAAI,CAK1BC,UAAU,CAJW,QAAfC,CAAAA,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,OAAhF,CAAJ,CAA8F,CAC1F,GAAIjE,CAAC,CAACC,MAAF,CAASC,OAAT,CAAiB,mCAAjB,CAAJ,CAAuD,CACnD+C,CAAc,CAACjD,CAAD,CACjB,CACJ,CACJ,CAND,EAQAF,QAAQ,CAACC,gBAAT,CAA0B,OAA1B,CAAmC,SAAAC,CAAC,CAAI,CACpC,GAAIA,CAAC,CAACC,MAAF,CAASC,OAAT,CAAiB,mCAAjB,CAAJ,CAAuD,CACnD,GAAMyD,CAAAA,CAAI,CAAG3D,CAAC,CAACC,MAAF,CAAS2B,OAAT,CAAiB,oBAAjB,EAAqCL,gBAArC,CAAsD,gBAAtD,CAAb,CACAvB,CAAC,CAACQ,cAAF,GACA,cAAER,CAAC,CAACC,MAAJ,EAAY4D,GAAZ,CAAgB,MAAhB,EACAF,CAAI,CAACf,OAAL,CAAa,SAAAiB,CAAG,CAAI,CAChBA,CAAG,CAACK,QAAJ,CAAe,CAAC,CACnB,CAFD,EAGAlE,CAAC,CAACC,MAAF,CAASiE,QAAT,CAAoB,CACvB,CACJ,CAVD,CAWH,C,QAEmB,QAAPG,CAAAA,IAAO,EAAM,CACtB5E,CAAW,GACX8C,CAAS,GACT4B,CAAa,EAChB,C","sourcesContent":["\/\/ This file is part of Moodle - http:\/\/moodle.org\/\n\/\/\n\/\/ Moodle is free software: you can redistribute it and\/or modify\n\/\/ it under the terms of the GNU General Public License as published by\n\/\/ the Free Software Foundation, either version 3 of the License, or\n\/\/ (at your option) any later version.\n\/\/\n\/\/ Moodle is distributed in the hope that it will be useful,\n\/\/ but WITHOUT ANY WARRANTY; without even the implied warranty of\n\/\/ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\/\/ GNU General Public License for more details.\n\/\/\n\/\/ You should have received a copy of the GNU General Public License\n\/\/ along with Moodle. If not, see .\n\n\/**\n * Enhancements to Bootstrap components for accessibility.\n *\n * @module theme_boost\/aria\n * @copyright 2018 Damyon Wiese \n * @license http:\/\/www.gnu.org\/copyleft\/gpl.html GNU GPL v3 or later\n *\/\n\nimport {end, arrowUp, arrowDown, arrowLeft, arrowRight, home, enter, space} from 'core\/key_codes';\nimport $ from 'jquery';\nimport Pending from 'core\/pending';\n\n\/**\n * Drop downs from bootstrap don't support keyboard accessibility by default.\n *\/\nconst dropdownFix = () => {\n let focusEnd = false;\n const setFocusEnd = () => {\n focusEnd = true;\n };\n const getFocusEnd = () => {\n const result = focusEnd;\n focusEnd = false;\n return result;\n };\n\n \/\/ Special handling for \"up\" keyboard control.\n document.addEventListener('keydown', e => {\n if (e.target.matches('[data-toggle=\"dropdown\"]')) {\n const trigger = e.which;\n\n \/\/ Up key opens the menu at the end.\n if (trigger == arrowUp) {\n \/\/ Focus the end of the menu, not the beginning.\n setFocusEnd();\n }\n\n \/\/ Space key or Enter key opens the menu.\n if (trigger == space || trigger == enter) {\n \/\/ Cancel random scroll.\n e.preventDefault();\n \/\/ Open the menu instead.\n e.target.click();\n }\n }\n });\n\n \/\/ Special handling for navigation keys when menu is open.\n const shiftFocus = element => {\n const delayedFocus = pendingPromise => {\n element.focus();\n pendingPromise.resolve();\n };\n setTimeout(delayedFocus, 50, new Pending('core\/aria:delayed-focus'));\n };\n\n $('.dropdown').on('shown.bs.dropdown', e => {\n \/\/ We need to focus on the first menuitem.\n const menu = e.target.querySelector('[role=\"menu\"]');\n let menuItems = false;\n let foundMenuItem = false;\n\n if (menu) {\n menuItems = menu.querySelectorAll('[role=\"menuitem\"]');\n }\n if (menuItems && menuItems.length > 0) {\n if (getFocusEnd()) {\n foundMenuItem = menuItems[menuItems.length - 1];\n } else {\n \/\/ The first menu entry, pretty reasonable.\n foundMenuItem = menuItems[0];\n }\n }\n if (foundMenuItem) {\n shiftFocus(foundMenuItem);\n }\n });\n \/\/ Search for menu items by finding the first item that has\n \/\/ text starting with the typed character (case insensitive).\n document.addEventListener('keypress', e => {\n if (e.target.matches('.dropdown [role=\"menu\"] [role=\"menuitem\"]')) {\n const trigger = String.fromCharCode(e.which).toLowerCase();\n const menu = e.target.closest('[role=\"menu\"]');\n\n if (!menu) {\n return;\n }\n const menuItems = menu.querySelectorAll('[role=\"menuitem\"]');\n if (!menuItems) {\n return;\n }\n\n for (let i = 0; i < menuItems.length; i++) {\n const item = menuItems[i];\n const itemText = item.text.trim().toLowerCase();\n if (itemText.indexOf(trigger) == 0) {\n shiftFocus(item);\n break;\n }\n }\n }\n });\n\n \/\/ Keyboard navigation for arrow keys, home and end keys.\n document.addEventListener('keydown', e => {\n if (e.target.matches('.dropdown [role=\"menu\"] [role=\"menuitem\"]')) {\n const trigger = e.which;\n let next = false;\n const menu = e.target.closest('[role=\"menu\"]');\n\n if (!menu) {\n return;\n }\n const menuItems = menu.querySelectorAll('[role=\"menuitem\"]');\n if (!menuItems) {\n return;\n }\n \/\/ Down key.\n if (trigger == arrowDown) {\n for (let i = 0; i < menuItems.length - 1; i++) {\n if (menuItems[i] == e.target) {\n next = menuItems[i + 1];\n break;\n }\n }\n if (!next) {\n \/\/ Wrap to first item.\n next = menuItems[0];\n }\n\n } else if (trigger == arrowUp) {\n \/\/ Up key.\n for (let i = 1; i < menuItems.length; i++) {\n if (menuItems[i] == e.target) {\n next = menuItems[i - 1];\n break;\n }\n }\n if (!next) {\n \/\/ Wrap to last item.\n next = menuItems[menuItems.length - 1];\n }\n\n } else if (trigger == home) {\n \/\/ Home key.\n next = menuItems[0];\n\n } else if (trigger == end) {\n \/\/ End key.\n next = menuItems[menuItems.length - 1];\n }\n \/\/ Variable next is set if we do want to act on the keypress.\n if (next) {\n e.preventDefault();\n shiftFocus(next);\n }\n return;\n }\n });\n\n $('.dropdown').on('hidden.bs.dropdown', e => {\n \/\/ We need to focus on the menu trigger.\n const trigger = e.target.querySelector('[data-toggle=\"dropdown\"]');\n if (trigger) {\n shiftFocus(trigger);\n }\n });\n};\n\n\/**\n * After page load, focus on any element with special autofocus attribute.\n *\/\nconst autoFocus = () => {\n window.addEventListener(\"load\", () => {\n const alerts = document.querySelectorAll('[data-aria-autofocus=\"true\"][role=\"alert\"]');\n Array.prototype.forEach.call(alerts, autofocusElement => {\n \/\/ According to the specification an role=\"alert\" region is only read out on change to the content\n \/\/ of that region.\n autofocusElement.innerHTML += ' ';\n autofocusElement.removeAttribute('data-aria-autofocus');\n });\n });\n};\n\n\/**\n * Changes the focus to the correct tab based on the key that is pressed.\n * @param {KeyboardEvent} e\n *\/\nconst updateTabFocus = e => {\n const tabList = e.target.closest('[role=\"tablist\"]');\n const vertical = tabList.getAttribute('aria-orientation') == 'vertical';\n const rtl = window.right_to_left();\n const arrowNext = vertical ? arrowDown : (rtl ? arrowLeft : arrowRight);\n const arrowPrevious = vertical ? arrowUp : (rtl ? arrowRight : arrowLeft);\n const tabs = Array.prototype.filter.call(\n tabList.querySelectorAll('[role=\"tab\"]'),\n tab => getComputedStyle(tab).display !== 'none'); \/\/ We only work with the visible tabs.\n\n for (let i = 0; i < tabs.length; i++) {\n tabs[i].index = i;\n }\n\n switch (e.keyCode) {\n case arrowNext:\n e.preventDefault();\n if (e.target.index !== undefined && tabs[e.target.index + 1]) {\n tabs[e.target.index + 1].focus();\n } else {\n tabs[0].focus();\n }\n break;\n case arrowPrevious:\n e.preventDefault();\n if (e.target.index !== undefined && tabs[e.target.index - 1]) {\n tabs[e.target.index - 1].focus();\n } else {\n tabs[tabs.length - 1].focus();\n }\n break;\n case home:\n e.preventDefault();\n tabs[0].focus();\n break;\n case end:\n e.preventDefault();\n tabs[tabs.length - 1].focus();\n break;\n case enter:\n case space:\n e.preventDefault();\n $(e.target).tab('show');\n tabs.forEach(tab => {\n tab.tabIndex = -1;\n });\n e.target.tabIndex = 0;\n }\n};\n\n\/**\n * Fix accessibility issues regarding tab elements focus and their tab order in Bootstrap navs.\n *\/\nconst tabElementFix = () => {\n document.addEventListener('keydown', e => {\n if ([arrowUp, arrowDown, arrowLeft, arrowRight, home, end, enter, space].includes(e.keyCode)) {\n if (e.target.matches('[role=\"tablist\"] [role=\"tab\"]')) {\n updateTabFocus(e);\n }\n }\n });\n\n document.addEventListener('click', e => {\n if (e.target.matches('[role=\"tablist\"] [role=\"tab\"]')) {\n const tabs = e.target.closest('[role=\"tablist\"]').querySelectorAll('[role=\"tab\"]');\n e.preventDefault();\n $(e.target).tab('show');\n tabs.forEach(tab => {\n tab.tabIndex = -1;\n });\n e.target.tabIndex = 0;\n }\n });\n};\n\nexport const init = () => {\n dropdownFix();\n autoFocus();\n tabElementFix();\n};\n"],"file":"aria.min.js"}