{"version":3,"file":"windows-plus-form-fields-custom-radio.mjs","sources":["../../../projects/windows-plus-form-fields/custom-radio/components/custom-radio-group/custom-radio-group.component.ts","../../../projects/windows-plus-form-fields/custom-radio/components/custom-radio-group/custom-radio-group.component.html","../../../projects/windows-plus-form-fields/custom-radio/custom-radio.module.ts","../../../projects/windows-plus-form-fields/custom-radio/public-api.ts","../../../projects/windows-plus-form-fields/custom-radio/windows-plus-form-fields-custom-radio.ts"],"sourcesContent":["import { Component, EventEmitter, Input, Output } from '@angular/core';\r\nimport { CustomRadioGroupConfig } from '../../public-api'\r\n\r\n@Component({\r\n  selector: 'wp-custom-radio-group',\r\n  templateUrl: './custom-radio-group.component.html',\r\n  styleUrls: ['./custom-radio-group.component.sass']\r\n})\r\nexport class CustomRadioGroupComponent {\r\n\t/**\r\n\t * @description the configuration for the custom radio options\r\n\t */\r\n\t@Input() radioConfigurations: CustomRadioGroupConfig\r\n\t/**\r\n\t * @description the callback method to be ran when a radio button is interacted with\r\n\t */\r\n\t@Output() handleChange: EventEmitter<Array<boolean|number>> = new EventEmitter<Array<boolean|number>>()\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description class constructor specifying the required services and properties for the component\r\n\t */\r\n  constructor() { }\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description the method to be run when the component is rendered\r\n\t */\r\n  ngOnInit(): void {\r\n  }\r\n\r\n\thandleRadioChange(isSelected: boolean, idx: number): void {\r\n\t\tthis.radioConfigurations.forEach((element, index) => element.isChecked = index === idx ? isSelected : false)\r\n\t\tthis.handleChange.emit([isSelected, idx])\r\n\t}\r\n}\r\n","<div class=\"row\">\r\n\t<div class=\"col-12 col-sm-6\" *ngFor=\"let option of radioConfigurations; let idx = index\">\r\n\t\t<div class=\"form-check\">\r\n\t\t\t<input \r\n\t\t\t\tclass=\"form-check-input\" \r\n\t\t\t\ttype=\"radio\" \r\n\t\t\t\t[name]=\"option.name\" \r\n\t\t\t\t[id]=\"option.id\" \r\n\t\t\t\t[value]=\"option.value\"\r\n\t\t\t\t(click)=\"handleRadioChange($event, idx)\"\r\n\t\t\t\t[checked]=\"option.isChecked\"\r\n\t\t\t\t>\r\n\t\t\t<label class=\"form-check-label\" [for]=\"option.id\">\r\n\t\t\t\t<span class=\"text-grey\">{{option.label}}</span>\r\n\t\t\t</label>\r\n\t\t</div>\r\n\t</div>\r\n</div>","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { CustomRadioGroupComponent } from './components/custom-radio-group/custom-radio-group.component';\r\n\r\n\r\n\r\n@NgModule({\r\n  declarations: [\r\n    CustomRadioGroupComponent\r\n  ],\r\n  imports: [\r\n    CommonModule\r\n  ],\r\n  exports: [\r\n    CustomRadioGroupComponent\r\n  ]\r\n})\r\nexport class CustomRadioModule { }\r\n","/*\r\n * Public API Surface of windows-plus-form-fields\r\n */\r\n\r\nexport * from './custom-radio.module'\r\nexport * from './components/custom-radio-group/custom-radio-group.component'\r\nexport * from './util/interface/custom-radio.interface'","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAQa,yBAAyB,CAAA;AASrC;;;AAGG;AACF,IAAA,WAAA,GAAA;AARD;;AAEG;AACO,QAAA,IAAA,CAAA,YAAY,GAAwC,IAAI,YAAY,EAAyB,CAAA;KAKrF;AAClB;;;AAGG;IACF,QAAQ,GAAA;KACP;IAEF,iBAAiB,CAAC,UAAmB,EAAE,GAAW,EAAA;AACjD,QAAA,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,KAAK,KAAK,OAAO,CAAC,SAAS,GAAG,KAAK,KAAK,GAAG,GAAG,UAAU,GAAG,KAAK,CAAC,CAAA;QAC5G,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,CAAA;KACzC;8GAxBW,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAA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