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IAAES,MAAMK,KAAK,eACbd,IAAE,IAADe,OAAKf,IAAES,MAAMK,KAAK,gBAAiBE,MAE5C,IACAhB,IAAES,MAAMK,KAAK,eACbd,IAAE,IAADe,OAAKf,IAAES,MAAMK,KAAK,gBAAiBG,OAIxCjB,IAAES,MAAMS,SAAS,UACjBlB,IAAES,MAAMI,KAAK,WAAY,IAGzB,IAAMM,EAASnB,IAAES,MAAME,KAAK,uBACxBQ,GACAA,EAAOC,KAAK,WAAW,GAI3B,IAAMC,EAAerB,IAAES,MAClBC,QAAQT,GACRa,KAAK,kBAENO,IAEArB,IAAE,IAADe,OAAKM,EAAY,SAAQL,OAG1BhB,IAAE,IAADe,OACOM,EAAY,mBAAAN,OAAkBf,IAAES,MAAMJ,QAAU,EAAC,MACvDY,OAGEjB,IAAE,SAASG,OAAS,GACpBH,IAAE,SAASsB,WAKnBtB,IAAEuB,QAAQC,QACd,CACJ,GACJ,KAEAG,EAAAA,EAAAA,GAAmB3B,IAAEE,IA5IzB,G","sources":["webpack://fed-boilerplate/./src/3-components/tab/c-tabs.js"],"sourcesContent":["/* eslint-disable no-use-before-define */\n// Imports\nimport $ from 'jquery';\nimport attachEnterAsClick from 'utils/attachEnterAsClick';\n\n// The functions to call\n$(() => {\n initTabs();\n});\n\n// Functions\nfunction initTabs() {\n const tabGroupClass = '.js-tabs';\n const tabItemClass = '.js-tab-item';\n\n // early return if no component found\n if (!$(tabGroupClass).length) {\n return;\n }\n\n $(tabGroupClass).each((index, tabGroup) => {\n const $tabGroup = $(tabGroup);\n // const saveHistory = $tabGroup.data('history');\n\n // Handle tab item click\n $tabGroup.on('click', tabItemClass, function() {\n // Remove all active class from siblings\n $(this)\n .closest(tabGroupClass)\n .find(tabItemClass)\n .removeClass('active');\n $(this)\n .closest(tabGroupClass)\n .find(tabItemClass)\n .attr('tabindex', '0');\n\n // Check if we have a data-id-to-show on any of the tabs in the group\n // if so, hide the other ids on other tabs, and show the section specified in\n // this tab's data-id-to-show\n $(this)\n .closest(tabGroupClass)\n .find(tabItemClass)\n .each(function() {\n if ($(this).data('id-to-show')) {\n $(`#${$(this).data('id-to-show')}`).hide();\n }\n });\n if ($(this).data('id-to-show')) {\n $(`#${$(this).data('id-to-show')}`).show();\n }\n\n // Add active class it itself\n $(this).addClass('active');\n $(this).attr('tabindex', '');\n\n // Check this tab's radio input if it has one\n const $radio = $(this).find('input[type=\"radio\"]');\n if ($radio) {\n $radio.prop('checked', true);\n }\n\n // Find the tab content selector and show / hide the content\n const tabContentId = $(this)\n .closest(tabGroupClass)\n .data('tab-content-id');\n\n if (tabContentId) {\n // Hide all immidiate children of the tab content\n $(`#${tabContentId} > *`).hide();\n\n // Show the children of the tab content with the same index as the active tab item\n $(\n `#${tabContentId} > *:nth-child(${$(this).index() + 1})`\n ).show();\n\n // reload masonry if exist\n if ($('.grid').length > 0) {\n $('.grid').masonry();\n }\n }\n\n // Trigger a windows resize call to cause some plugins like float table header to kick off\n $(window).resize();\n });\n\n $tabGroup.on('keypress', tabItemClass, function(e) {\n if (e.keyCode === '13' || e.keyCode === '32') {\n // Remove all active class from siblings\n $(this)\n .closest(tabGroupClass)\n .find(tabItemClass)\n .removeClass('active');\n $(this)\n .closest(tabGroupClass)\n .find(tabItemClass)\n .attr('tabindex', '0');\n\n // Check if we have a data-id-to-show on any of the tabs in the group\n // if so, hide the other ids on other tabs, and show the section specified in\n // this tab's data-id-to-show\n $(this)\n .closest(tabGroupClass)\n .find(tabItemClass)\n .each(function() {\n if ($(this).data('id-to-show')) {\n $(`#${$(this).data('id-to-show')}`).hide();\n }\n });\n if ($(this).data('id-to-show')) {\n $(`#${$(this).data('id-to-show')}`).show();\n }\n\n // Add active class it itself\n $(this).addClass('active');\n $(this).attr('tabindex', '');\n\n // Check this tab's radio input if it has one\n const $radio = $(this).find('input[type=\"radio\"]');\n if ($radio) {\n $radio.prop('checked', true);\n }\n\n // Find the tab content selector and show / hide the content\n const tabContentId = $(this)\n .closest(tabGroupClass)\n .data('tab-content-id');\n\n if (tabContentId) {\n // Hide all immidiate children of the tab content\n $(`#${tabContentId} > *`).hide();\n\n // Show the children of the tab content with the same index as the active tab item\n $(\n `#${tabContentId} > *:nth-child(${$(this).index() + 1})`\n ).show();\n\n // reload masonry if exist\n if ($('.grid').length > 0) {\n $('.grid').masonry();\n }\n }\n\n // Trigger a windows resize call to cause some plugins like float table header to kick off\n $(window).resize();\n }\n });\n });\n\n attachEnterAsClick($(tabItemClass));\n}\n"],"names":["$","tabGroupClass","tabItemClass","length","each","index","tabGroup","$tabGroup","on","this","closest","find","removeClass","attr","data","concat","hide","show","addClass","$radio","prop","tabContentId","masonry","window","resize","e","keyCode","attachEnterAsClick"],"sourceRoot":""}