{"version":3,"file":"9451.268212b172a83f63b9b8.js","mappings":"iIAAA,MAAMA,EAEFC,WAAAA,CAAYC,GACRC,KAAKD,GAAKA,EACVC,KAAKC,OAASF,EAAGG,cAAc,oBAC/BF,KAAKG,OAASJ,EAAGK,iBAAiB,YAClCJ,KAAKK,OAASN,EAAGK,iBAAiB,uBAClCJ,KAAKM,WAAa,EACA,MAAfN,KAAKK,QACJL,KAAKK,OAAOE,SAAQ,CAACC,EAAEC,KAChBD,EAAEE,SAASV,KAAKW,OAAOF,EAAED,GAC5BA,EAAEI,iBAAiB,SAAS,KACxBZ,KAAKW,OAAOF,EAAED,EAAE,GAClB,GAGd,CAEAG,MAAAA,CAAOF,EAAED,GACLR,KAAKC,OAAOY,UAAYb,KAAKG,OAAOM,GAAGI,UACvCL,EAAEM,aAAa,UAAU,WACtBd,KAAKM,WAAa,GAAKN,KAAKM,WAAaG,IACxCT,KAAKK,OAAOL,KAAKM,WAAWS,gBAAgB,WAC5Cf,KAAKM,UAAYG,EAEzB,EAKG,SAASO,EAAWC,GACvBA,EAASV,SAASW,IAEQ,IAAlBA,EAAKC,UACL,IAAItB,EAAkBqB,EAC1B,GAER,C","sources":["webpack://UKCISA/./wwwroot/app/src/js/dropdown-radio-list.js"],"sourcesContent":["class DropdownRadioList {\r\n\r\n constructor(el) {\r\n this.el = el;\r\n this.toggle = el.querySelector('.dropdown-toggle');\r\n this.labels = el.querySelectorAll('li label');\r\n this.radios = el.querySelectorAll('input[type=\"radio\"]');\r\n this.prevIndex = -1;\r\n if(this.radios != null) {\r\n this.radios.forEach((r,i) => {\r\n if(r.checked) this.update(i,r);\r\n r.addEventListener('click', () => {\r\n this.update(i,r);\r\n });\r\n });\r\n }\r\n }\r\n\r\n update(i,r) {\r\n this.toggle.innerHTML = this.labels[i].innerHTML;\r\n r.setAttribute('checked','checked');\r\n if(this.prevIndex >= 0 && this.prevIndex != i) {\r\n this.radios[this.prevIndex].removeAttribute('checked');\r\n this.prevIndex = i;\r\n }\r\n }\r\n\r\n}\r\n\r\n// export the default function to create\r\nexport function createFrom(wrappers) {\r\n wrappers.forEach((node) => {\r\n // if node is an element\r\n if (node.nodeType === 1) {\r\n new DropdownRadioList(node);\r\n }\r\n });\r\n}"],"names":["DropdownRadioList","constructor","el","this","toggle","querySelector","labels","querySelectorAll","radios","prevIndex","forEach","r","i","checked","update","addEventListener","innerHTML","setAttribute","removeAttribute","createFrom","wrappers","node","nodeType"],"sourceRoot":""}