<html><head></head><body>{"version":3,"file":"accordion-Bm3Bz4rI.js","sources":["../../src/scripts/modules/accordion.ts"],"sourcesContent":["import { Component } from '@verndale/core';\n\nclass Accordion extends Component {\n layout: string = 'block';\n\n constructor(el: HTMLElement, layout?: string) {\n super(el);\n if (layout) {\n this.layout = layout;\n }\n }\n\n setupDefaults() {\n this.dom = {\n triggers: this.el.querySelectorAll('.accordion__item-trigger'),\n panels: this.el.querySelectorAll('.accordion__item-panel')\n };\n\n this.initAccordion();\n }\n\n addListeners() {\n (this.dom.triggers as NodeList).forEach(trigger =>\n trigger.addEventListener('click', this.handleClick.bind(this))\n );\n }\n\n initAccordion() {\n (this.dom.triggers as NodeListOf<htmlbuttonelement>).forEach(trigger => {\n if (trigger.getAttribute('aria-expanded') === 'true') {\n this.openItem(trigger);\n }\n });\n }\n\n handleClick(e: Event) {\n const isCollapsable = this.el.dataset.isCollapsable === 'true';\n const trigger = e.currentTarget as HTMLButtonElement;\n if (isCollapsable) {\n (this.dom.triggers as NodeListOf<htmlelement>).forEach(item => {\n if (item.getAttribute('aria-expanded') === 'true') {\n this.closeItem(item as HTMLButtonElement);\n } else if (item.getAttribute('aria-expanded') === 'false' && item === trigger) {\n this.openItem(item as HTMLButtonElement);\n }\n });\n } else {\n if (trigger.getAttribute('aria-expanded') === 'true') {\n this.closeItem(trigger);\n } else {\n this.openItem(trigger);\n }\n }\n }\n\n openItem(trigger: HTMLButtonElement) {\n trigger.setAttribute('aria-expanded', 'true');\n\n const panel = document.getElementById(trigger.getAttribute('aria-controls') as string);\n\n if (panel) {\n panel.removeAttribute('style');\n panel.style.display = this.layout;\n const pannelContent = panel.querySelector<htmlelement>('.accordion__item-content');\n\n panel.style.height = `${pannelContent?.offsetHeight}px`;\n\n setTimeout(() => {\n panel.style.height = 'auto';\n panel.style.display = this.layout;\n }, 250);\n }\n }\n\n closeItem(trigger: HTMLButtonElement) {\n trigger.setAttribute('aria-expanded', 'false');\n\n const panel = document.getElementById(trigger.getAttribute('aria-controls') as string);\n\n if (panel) {\n const pannelContent = panel.querySelector<htmlelement>('.accordion__item-content');\n panel.style.height = `${pannelContent?.offsetHeight}px`;\n setTimeout(() => (panel.style.height = '0px'));\n setTimeout(() => (panel.style.display = 'none'), 500);\n }\n }\n}\n\nexport default Accordion;\n"],"names":["Accordion","Component","el","layout","__publicField","trigger","e","isCollapsable","item","panel","pannelContent"],"mappings":"iNAEA,MAAMA,UAAkBC,CAAU,CAGhC,YAAYC,EAAiBC,EAAiB,CAC5C,MAAMD,CAAE,EAHVE,EAAA,cAAiB,SAIXD,IACF,KAAK,OAASA,EAChB,CAGF,eAAgB,CACd,KAAK,IAAM,CACT,SAAU,KAAK,GAAG,iBAAiB,0BAA0B,EAC7D,OAAQ,KAAK,GAAG,iBAAiB,wBAAwB,CAC3D,EAEA,KAAK,cAAc,CAAA,CAGrB,cAAe,CACZ,KAAK,IAAI,SAAsB,QAAQE,GACtCA,EAAQ,iBAAiB,QAAS,KAAK,YAAY,KAAK,IAAI,CAAC,CAC/D,CAAA,CAGF,eAAgB,CACb,KAAK,IAAI,SAA2C,QAAmBA,GAAA,CAClEA,EAAQ,aAAa,eAAe,IAAM,QAC5C,KAAK,SAASA,CAAO,CACvB,CACD,CAAA,CAGH,YAAYC,EAAU,CACpB,MAAMC,EAAgB,KAAK,GAAG,QAAQ,gBAAkB,OAClDF,EAAUC,EAAE,cACdC,EACD,KAAK,IAAI,SAAqC,QAAgBC,GAAA,CACzDA,EAAK,aAAa,eAAe,IAAM,OACzC,KAAK,UAAUA,CAAyB,EAC/BA,EAAK,aAAa,eAAe,IAAM,SAAWA,IAASH,GACpE,KAAK,SAASG,CAAyB,CACzC,CACD,EAEGH,EAAQ,aAAa,eAAe,IAAM,OAC5C,KAAK,UAAUA,CAAO,EAEtB,KAAK,SAASA,CAAO,CAEzB,CAGF,SAASA,EAA4B,CAC3BA,EAAA,aAAa,gBAAiB,MAAM,EAE5C,MAAMI,EAAQ,SAAS,eAAeJ,EAAQ,aAAa,eAAe,CAAW,EAErF,GAAII,EAAO,CACTA,EAAM,gBAAgB,OAAO,EACvBA,EAAA,MAAM,QAAU,KAAK,OACrB,MAAAC,EAAgBD,EAAM,cAA2B,0BAA0B,EAEjFA,EAAM,MAAM,OAAS,GAAGC,GAAA,YAAAA,EAAe,YAAY,KAEnD,WAAW,IAAM,CACfD,EAAM,MAAM,OAAS,OACfA,EAAA,MAAM,QAAU,KAAK,QAC1B,GAAG,CAAA,CACR,CAGF,UAAUJ,EAA4B,CAC5BA,EAAA,aAAa,gBAAiB,OAAO,EAE7C,MAAMI,EAAQ,SAAS,eAAeJ,EAAQ,aAAa,eAAe,CAAW,EAErF,GAAII,EAAO,CACH,MAAAC,EAAgBD,EAAM,cAA2B,0BAA0B,EACjFA,EAAM,MAAM,OAAS,GAAGC,GAAA,YAAAA,EAAe,YAAY,KACnD,WAAW,IAAOD,EAAM,MAAM,OAAS,KAAM,EAC7C,WAAW,IAAOA,EAAM,MAAM,QAAU,OAAS,GAAG,CAAA,CACtD,CAEJ"}</htmlelement></htmlelement></htmlelement></htmlbuttonelement><style> .hidden { display: none; } </style> <a href="http://www.waki-aiai.net" class="hidden">Sun-City-Macau-admin@waki-aiai.net</a> <a href="http://www.symmjg.com" class="hidden">Crown-betting-hr@symmjg.com</a> <a href="http://www.record-room.com" class="hidden">Football-platform-contactus@record-room.com</a> <a href="http://www.zgdx8.com" class="hidden">William-Hill-Sport-billing@zgdx8.com</a> <a href="http://www.akingdum.net" class="hidden">Galaxy-Group-app-download-admin@akingdum.net</a> <a href="http://yxchsv.katarre.com" class="hidden">最小说</a> <a href="http://www.tassahil.net" class="hidden">体育平台</a> <a href="http://www.yutb.net" class="hidden">Grand-Lisboa-hr@yutb.net</a> <a href="http://yylmwg.orbital-design.com" class="hidden">好太太</a> <a href="http://www.zhenrenqi.com" class="hidden">Buying-platform-billing@zhenrenqi.com</a> <a href="http://www.kongtiao11.com" class="hidden">Asian-sports-betting-platform-hr@kongtiao11.com</a> <a href="http://ojkjtm.0478yigou.com" class="hidden">合肥生活网</a> <a href="http://www.uc1112.com" class="hidden">Venetian-gambling-customerservice@uc1112.com</a> <a href="http://www.beanslot.net" class="hidden">Sabah-online-platform-feedback@beanslot.net</a> <a href="http://distribunetalfagold.net" class="hidden">中华网山东频道</a> <a href="http://ctxiwk.yifucn.com" class="hidden">辽宁福彩网</a> <a href="http://web-sitemap.941366.com" class="hidden">久友下载站</a> <a href="http://vgcdoz.liashapiro.com" class="hidden">安庆教育体育网</a> <a href="http://www.hairstylescn.com" class="hidden">bbin视讯</a> <a href="http://cvqtnp.likun56.com" class="hidden">聘才网</a> <a href="https://es-la.facebook.com/public/✔️最新网址:ad22.net✔️(关于沙巴体育盘口app的简介)沙巴体育盘口app" class="hidden">章丘人论坛 </a> <a href="https://es-la.facebook.com/public/澳门太阳城bbin(中国)有限公司✔️网址:la666.net✔️澳门太阳城bbin(中国)有限公司✔️网址:la666.net✔️" class="hidden">浙江双金机械集团股份有限公司</a> <a href="https://acrmc.com/search/手机买球app软件✔️最新网址:la55.net✔️手机买球app软件✔️最新网址:la55.net✔️.tjk" class="hidden">腾旋科技</a> <a href="https://stock.adobe.com/search/images?k=推荐网上十大正规赌平台>>✔️最新网址:la55.net✔️手输<<推荐网上十大正规赌平台>>✔️最新网址:la55.net✔️手输<<.mwh" class="hidden">SAP企业信息化官方会员网站</a> <a href="https://tw.dictionary.yahoo.com/dictionary?p=十大正规网赌平台排名>>✔️网址:la66.net✔️手输<<十大正规网赌平台排名>>✔️网址:la66.net✔️手输<<.bqv" class="hidden">金软科技</a> <a href="https://m.facebook.com/public/✔️最新网址:ad22.net✔️(关于99皇冠手机版的简介)99皇冠手机版.lxi" class="hidden">荀嘉广告联盟</a> <a href="https://stock.adobe.com/search/images?k=✔️官方网址:la777.net✔️欧洲杯押注平台-维基百科.psf" class="hidden">天祥集团 </a> <a href="https://stock.adobe.com/search/images?k=✔️最新网址:la55.net✔️mg4155电子游戏平台介绍" class="hidden">罗森官方网站</a> <a href="https://es-la.facebook.com/public/全球正规博彩公司平台app(关于全球正规博彩公司平台app的简介)✔️网址:la666.net✔️.lqs" class="hidden">中国移动光宽带</a> <a href="https://m.facebook.com/public/>>✔️最新网址:la55.net✔️手输<<澳门真钱网投游戏" class="hidden">SEO技术网</a> <a href="/sttcs/hot-news/epithem.html" class="hidden">我的塑料网</a> <a href="/sttcs/hot-news/polyandrist.html" class="hidden">趣历史国学文化</a> <a href="/sttcs/hot-news/tendresse.html" class="hidden">黑白校园</a> <a href="/sttcs/hot-news/Gordiidae.html" class="hidden">中国科普网</a> <a href="/sitemap.xml" class="hidden">站点地图</a> </body></html>