{"version":3,"file":"responsive-tables.6ef7b2.js","mappings":"4gDAAqBA,EAAc,WAO9B,O,EAND,SAAAA,IAAc,IAAAC,EAAA,M,4FAAAC,CAAA,KAAAF,GACVG,EAAEC,UAAUC,OAAM,WACdJ,EAAKK,OAASF,SAASG,iBAAiB,mBAExCN,EAAKO,eACT,GACJ,G,EAAC,EAAAC,IAAA,gBAAAC,MAED,WACIC,KAAKL,OAAOM,SAAQ,SAACC,GACjB,IAAIC,EAAc,GAGdD,EAAME,UAAUC,SAAS,mBACzBF,EAAcD,EAAMN,iBAAiB,qBACxBM,EAAMN,iBAAiB,2BAEzBK,SAAQ,SAACK,GAChB,IAAMC,EAAcC,EAAIF,EAAKG,WAAWC,UAAUC,QAAQL,GACtCA,EAAZM,QACAC,MAAQV,EAAYI,GAAaO,YAAYC,MACzD,KACOb,EAAME,UAAUC,SAAS,uBAChCF,EAAcD,EAAMN,iBAAiB,kBACxBM,EAAMN,iBAAiB,wBACvBM,EAAMN,iBAAiB,MAE/BK,SAAQ,SAACe,GACV,IAAMC,EAAWT,EAAIQ,EAAIP,WAAWC,UAAUC,QAAQK,GAClCA,EAAZJ,QACAC,MAAQV,EAAYc,GAAUH,YAAYC,MACtD,KAGJZ,EAAYF,SAAQ,SAACiB,GACjBA,EAAQd,UAAUe,IAAI,cAC1B,GACJ,GACJ,M,6EAAC,CAvC8B,E","sources":["webpack://cloroxpro-ca/./js/src/components/breaking-tables.js"],"sourcesContent":["export default class BreakingTables {\n constructor() {\n $(document).ready(() => {\n this.tables = document.querySelectorAll('.breaking-table');\n\n this.prepareTables();\n });\n }\n\n prepareTables() {\n this.tables.forEach((table) => {\n let headerCells = [];\n let otherCells = [];\n\n if (table.classList.contains('has-header-row')) {\n headerCells = table.querySelectorAll('tr:first-child td');\n otherCells = table.querySelectorAll('tr:not(:first-child) td');\n\n otherCells.forEach((cell) => {\n const columnIndex = [...cell.parentNode.children].indexOf(cell);\n const { dataset } = cell;\n dataset.title = headerCells[columnIndex].textContent.trim();\n });\n } else if (table.classList.contains('has-header-column')) {\n headerCells = table.querySelectorAll('td:first-child');\n otherCells = table.querySelectorAll('td:not(:first-child)');\n const rows = table.querySelectorAll('tr');\n\n rows.forEach((row) => {\n const rowIndex = [...row.parentNode.children].indexOf(row);\n const { dataset } = row;\n dataset.title = headerCells[rowIndex].textContent.trim();\n });\n }\n\n headerCells.forEach((element) => {\n element.classList.add('only-mid-up');\n });\n });\n }\n}\n"],"names":["BreakingTables","_this","_classCallCheck","$","document","ready","tables","querySelectorAll","prepareTables","key","value","this","forEach","table","headerCells","classList","contains","cell","columnIndex","_toConsumableArray","parentNode","children","indexOf","dataset","title","textContent","trim","row","rowIndex","element","add"],"sourceRoot":""}