{"version":3,"file":"tabs.mjs","sources":["../../../../src/govuk/components/tabs/tabs.mjs"],"sourcesContent":["/* eslint-disable es-x/no-function-prototype-bind -- Polyfill imported */\n\nimport { nodeListForEach } from '../../common/index.mjs'\nimport '../../vendor/polyfills/Element/prototype/classList.mjs'\nimport '../../vendor/polyfills/Element/prototype/nextElementSibling.mjs'\nimport '../../vendor/polyfills/Element/prototype/previousElementSibling.mjs'\nimport '../../vendor/polyfills/Event.mjs' // addEventListener, event.target normalization and DOMContentLoaded\nimport '../../vendor/polyfills/Function/prototype/bind.mjs'\n\n/**\n * Tabs component\n *\n * @class\n * @param {Element} $module - HTML element to use for tabs\n */\nfunction Tabs ($module) {\n if (!($module instanceof HTMLElement)) {\n return this\n }\n\n var $tabs = $module.querySelectorAll('a.govuk-tabs__tab')\n if (!$tabs.length) {\n return this\n }\n\n /** @deprecated Will be made private in v5.0 */\n this.$module = $module\n\n /** @deprecated Will be made private in v5.0 */\n this.$tabs = $tabs\n\n /** @deprecated Will be made private in v5.0 */\n this.keys = { left: 37, right: 39, up: 38, down: 40 }\n\n /** @deprecated Will be made private in v5.0 */\n this.jsHiddenClass = 'govuk-tabs__panel--hidden'\n\n // Save bounded functions to use when removing event listeners during teardown\n\n /** @deprecated Will be made private in v5.0 */\n this.boundTabClick = this.onTabClick.bind(this)\n\n /** @deprecated Will be made private in v5.0 */\n this.boundTabKeydown = this.onTabKeydown.bind(this)\n\n /** @deprecated Will be made private in v5.0 */\n this.boundOnHashChange = this.onHashChange.bind(this)\n\n /** @deprecated Will be made private in v5.0 */\n this.changingHash = false\n}\n\n/**\n * Initialise component\n */\nTabs.prototype.init = function () {\n // Check that required elements are present\n if (!this.$module || !this.$tabs) {\n return\n }\n\n if (typeof window.matchMedia === 'function') {\n this.setupResponsiveChecks()\n } else {\n this.setup()\n }\n}\n\n/**\n * Setup viewport resize check\n *\n * @deprecated Will be made private in v5.0\n */\nTabs.prototype.setupResponsiveChecks = function () {\n /** @deprecated Will be made private in v5.0 */\n this.mql = window.matchMedia('(min-width: 40.0625em)')\n this.mql.addListener(this.checkMode.bind(this))\n this.checkMode()\n}\n\n/**\n * Setup or teardown handler for viewport resize check\n *\n * @deprecated Will be made private in v5.0\n */\nTabs.prototype.checkMode = function () {\n if (this.mql.matches) {\n this.setup()\n } else {\n this.teardown()\n }\n}\n\n/**\n * Setup tab component\n *\n * @deprecated Will be made private in v5.0\n */\nTabs.prototype.setup = function () {\n var $component = this\n var $module = this.$module\n var $tabs = this.$tabs\n var $tabList = $module.querySelector('.govuk-tabs__list')\n var $tabListItems = $module.querySelectorAll('.govuk-tabs__list-item')\n\n if (!$tabs || !$tabList || !$tabListItems) {\n return\n }\n\n $tabList.setAttribute('role', 'tablist')\n\n nodeListForEach($tabListItems, function ($item) {\n $item.setAttribute('role', 'presentation')\n })\n\n nodeListForEach($tabs, function ($tab) {\n // Set HTML attributes\n $component.setAttributes($tab)\n\n // Handle events\n $tab.addEventListener('click', $component.boundTabClick, true)\n $tab.addEventListener('keydown', $component.boundTabKeydown, true)\n\n // Remove old active panels\n $component.hideTab($tab)\n })\n\n // Show either the active tab according to the URL's hash or the first tab\n var $activeTab = this.getTab(window.location.hash) || this.$tabs[0]\n if (!$activeTab) {\n return\n }\n\n this.showTab($activeTab)\n\n // Handle hashchange events\n window.addEventListener('hashchange', this.boundOnHashChange, true)\n}\n\n/**\n * Teardown tab component\n *\n * @deprecated Will be made private in v5.0\n */\nTabs.prototype.teardown = function () {\n var $component = this\n var $module = this.$module\n var $tabs = this.$tabs\n var $tabList = $module.querySelector('.govuk-tabs__list')\n var $tabListItems = $module.querySelectorAll('a.govuk-tabs__list-item')\n\n if (!$tabs || !$tabList || !$tabListItems) {\n return\n }\n\n $tabList.removeAttribute('role')\n\n nodeListForEach($tabListItems, function ($item) {\n $item.removeAttribute('role')\n })\n\n nodeListForEach($tabs, function ($tab) {\n // Remove events\n $tab.removeEventListener('click', $component.boundTabClick, true)\n $tab.removeEventListener('keydown', $component.boundTabKeydown, true)\n\n // Unset HTML attributes\n $component.unsetAttributes($tab)\n })\n\n // Remove hashchange event handler\n window.removeEventListener('hashchange', this.boundOnHashChange, true)\n}\n\n/**\n * Handle hashchange event\n *\n * @deprecated Will be made private in v5.0\n * @returns {void | undefined} Returns void, or undefined when prevented\n */\nTabs.prototype.onHashChange = function () {\n var hash = window.location.hash\n var $tabWithHash = this.getTab(hash)\n if (!$tabWithHash) {\n return\n }\n\n // Prevent changing the hash\n if (this.changingHash) {\n this.changingHash = false\n return\n }\n\n // Show either the active tab according to the URL's hash or the first tab\n var $previousTab = this.getCurrentTab()\n if (!$previousTab) {\n return\n }\n\n this.hideTab($previousTab)\n this.showTab($tabWithHash)\n $tabWithHash.focus()\n}\n\n/**\n * Hide panel for tab link\n *\n * @deprecated Will be made private in v5.0\n * @param {HTMLAnchorElement} $tab - Tab link\n */\nTabs.prototype.hideTab = function ($tab) {\n this.unhighlightTab($tab)\n this.hidePanel($tab)\n}\n\n/**\n * Show panel for tab link\n *\n * @deprecated Will be made private in v5.0\n * @param {HTMLAnchorElement} $tab - Tab link\n */\nTabs.prototype.showTab = function ($tab) {\n this.highlightTab($tab)\n this.showPanel($tab)\n}\n\n/**\n * Get tab link by hash\n *\n * @deprecated Will be made private in v5.0\n * @param {string} hash - Hash fragment including #\n * @returns {HTMLAnchorElement | null} Tab link\n */\nTabs.prototype.getTab = function (hash) {\n // @ts-expect-error `HTMLAnchorElement` type expected\n return this.$module.querySelector('a.govuk-tabs__tab[href=\"' + hash + '\"]')\n}\n\n/**\n * Set tab link and panel attributes\n *\n * @deprecated Will be made private in v5.0\n * @param {HTMLAnchorElement} $tab - Tab link\n */\nTabs.prototype.setAttributes = function ($tab) {\n // set tab attributes\n var panelId = this.getHref($tab).slice(1)\n $tab.setAttribute('id', 'tab_' + panelId)\n $tab.setAttribute('role', 'tab')\n $tab.setAttribute('aria-controls', panelId)\n $tab.setAttribute('aria-selected', 'false')\n $tab.setAttribute('tabindex', '-1')\n\n // set panel attributes\n var $panel = this.getPanel($tab)\n if (!$panel) {\n return\n }\n\n $panel.setAttribute('role', 'tabpanel')\n $panel.setAttribute('aria-labelledby', $tab.id)\n $panel.classList.add(this.jsHiddenClass)\n}\n\n/**\n * Unset tab link and panel attributes\n *\n * @deprecated Will be made private in v5.0\n * @param {HTMLAnchorElement} $tab - Tab link\n */\nTabs.prototype.unsetAttributes = function ($tab) {\n // unset tab attributes\n $tab.removeAttribute('id')\n $tab.removeAttribute('role')\n $tab.removeAttribute('aria-controls')\n $tab.removeAttribute('aria-selected')\n $tab.removeAttribute('tabindex')\n\n // unset panel attributes\n var $panel = this.getPanel($tab)\n if (!$panel) {\n return\n }\n\n $panel.removeAttribute('role')\n $panel.removeAttribute('aria-labelledby')\n $panel.classList.remove(this.jsHiddenClass)\n}\n\n/**\n * Handle tab link clicks\n *\n * @deprecated Will be made private in v5.0\n * @param {MouseEvent} event - Mouse click event\n * @returns {void} Returns void\n */\nTabs.prototype.onTabClick = function (event) {\n var $currentTab = this.getCurrentTab()\n var $nextTab = event.currentTarget\n\n if (!$currentTab || !($nextTab instanceof HTMLAnchorElement)) {\n return\n }\n\n event.preventDefault()\n\n this.hideTab($currentTab)\n this.showTab($nextTab)\n this.createHistoryEntry($nextTab)\n}\n\n/**\n * Update browser URL hash fragment for tab\n *\n * - Allows back/forward to navigate tabs\n * - Avoids page jump when hash changes\n *\n * @deprecated Will be made private in v5.0\n * @param {HTMLAnchorElement} $tab - Tab link\n */\nTabs.prototype.createHistoryEntry = function ($tab) {\n var $panel = this.getPanel($tab)\n if (!$panel) {\n return\n }\n\n // Save and restore the id\n // so the page doesn't jump when a user clicks a tab (which changes the hash)\n var panelId = $panel.id\n $panel.id = ''\n this.changingHash = true\n window.location.hash = this.getHref($tab).slice(1)\n $panel.id = panelId\n}\n\n/**\n * Handle tab keydown event\n *\n * - Press right/down arrow for next tab\n * - Press left/up arrow for previous tab\n *\n * @deprecated Will be made private in v5.0\n * @param {KeyboardEvent} event - Keydown event\n */\nTabs.prototype.onTabKeydown = function (event) {\n switch (event.keyCode) {\n case this.keys.left:\n case this.keys.up:\n this.activatePreviousTab()\n event.preventDefault()\n break\n case this.keys.right:\n case this.keys.down:\n this.activateNextTab()\n event.preventDefault()\n break\n }\n}\n\n/**\n * Activate next tab\n *\n * @deprecated Will be made private in v5.0\n */\nTabs.prototype.activateNextTab = function () {\n var $currentTab = this.getCurrentTab()\n if (!$currentTab || !$currentTab.parentElement) {\n return\n }\n\n var $nextTabListItem = $currentTab.parentElement.nextElementSibling\n if (!$nextTabListItem) {\n return\n }\n\n var $nextTab = $nextTabListItem.querySelector('a.govuk-tabs__tab')\n if (!$nextTab) {\n return\n }\n\n this.hideTab($currentTab)\n this.showTab($nextTab)\n $nextTab.focus()\n this.createHistoryEntry($nextTab)\n}\n\n/**\n * Activate previous tab\n *\n * @deprecated Will be made private in v5.0\n */\nTabs.prototype.activatePreviousTab = function () {\n var $currentTab = this.getCurrentTab()\n if (!$currentTab || !$currentTab.parentElement) {\n return\n }\n\n var $previousTabListItem = $currentTab.parentElement.previousElementSibling\n if (!$previousTabListItem) {\n return\n }\n\n var $previousTab = $previousTabListItem.querySelector('a.govuk-tabs__tab')\n if (!$previousTab) {\n return\n }\n\n this.hideTab($currentTab)\n this.showTab($previousTab)\n $previousTab.focus()\n this.createHistoryEntry($previousTab)\n}\n\n/**\n * Get tab panel for tab link\n *\n * @deprecated Will be made private in v5.0\n * @param {HTMLAnchorElement} $tab - Tab link\n * @returns {Element | null} Tab panel\n */\nTabs.prototype.getPanel = function ($tab) {\n return this.$module.querySelector(this.getHref($tab))\n}\n\n/**\n * Show tab panel for tab link\n *\n * @deprecated Will be made private in v5.0\n * @param {HTMLAnchorElement} $tab - Tab link\n */\nTabs.prototype.showPanel = function ($tab) {\n var $panel = this.getPanel($tab)\n if (!$panel) {\n return\n }\n\n $panel.classList.remove(this.jsHiddenClass)\n}\n\n/**\n * Hide tab panel for tab link\n *\n * @deprecated Will be made private in v5.0\n * @param {HTMLAnchorElement} $tab - Tab link\n */\nTabs.prototype.hidePanel = function ($tab) {\n var $panel = this.getPanel($tab)\n if (!$panel) {\n return\n }\n\n $panel.classList.add(this.jsHiddenClass)\n}\n\n/**\n * Unset 'selected' state for tab link\n *\n * @deprecated Will be made private in v5.0\n * @param {HTMLAnchorElement} $tab - Tab link\n */\nTabs.prototype.unhighlightTab = function ($tab) {\n if (!$tab.parentElement) {\n return\n }\n\n $tab.setAttribute('aria-selected', 'false')\n $tab.parentElement.classList.remove('govuk-tabs__list-item--selected')\n $tab.setAttribute('tabindex', '-1')\n}\n\n/**\n * Set 'selected' state for tab link\n *\n * @deprecated Will be made private in v5.0\n * @param {HTMLAnchorElement} $tab - Tab link\n */\nTabs.prototype.highlightTab = function ($tab) {\n if (!$tab.parentElement) {\n return\n }\n\n $tab.setAttribute('aria-selected', 'true')\n $tab.parentElement.classList.add('govuk-tabs__list-item--selected')\n $tab.setAttribute('tabindex', '0')\n}\n\n/**\n * Get current tab link\n *\n * @deprecated Will be made private in v5.0\n * @returns {HTMLAnchorElement | null} Tab link\n */\nTabs.prototype.getCurrentTab = function () {\n return this.$module.querySelector('.govuk-tabs__list-item--selected a.govuk-tabs__tab')\n}\n\n/**\n * Get link hash fragment for href attribute\n *\n * this is because IE doesn't always return the actual value but a relative full path\n * should be a utility function most prob\n * {@link http://labs.thesedays.com/blog/2010/01/08/getting-the-href-value-with-jquery-in-ie/}\n *\n * @deprecated Will be made private in v5.0\n * @param {HTMLAnchorElement} $tab - Tab link\n * @returns {string} Hash fragment including #\n */\nTabs.prototype.getHref = function ($tab) {\n var href = $tab.getAttribute('href')\n var hash = href.slice(href.indexOf('#'), href.length)\n return hash\n}\n\nexport default Tabs\n"],"names":[],"mappings":";;;;;;;AAAA;AACA,AAOA;;;;;;;AAOA,SAAS,IAAI,EAAE,OAAO,EAAE;EACtB,IAAI,EAAE,OAAO,YAAY,WAAW,CAAC,EAAE;IACrC,OAAO,IAAI;GACZ;;EAED,IAAI,KAAK,GAAG,OAAO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