source: trip-planner-front/node_modules/primeng/fesm2015/primeng-radiobutton.mjs.map@ 571e0df

Last change on this file since 571e0df was 59329aa, checked in by Ema <ema_spirova@…>, 3 years ago

adding photos

  • Property mode set to 100644
File size: 10.7 KB
Line 
1{"version":3,"file":"primeng-radiobutton.mjs","sources":["../../src/app/components/radiobutton/radiobutton.ts","../../src/app/components/radiobutton/primeng-radiobutton.ts"],"sourcesContent":["import {NgModule,Component,Input,Output,ElementRef,EventEmitter,forwardRef,ViewChild,ChangeDetectorRef,ChangeDetectionStrategy, Injectable, Injector, OnInit, OnDestroy} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {NG_VALUE_ACCESSOR, ControlValueAccessor, NgControl} from '@angular/forms';\n\nexport const RADIO_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => RadioButton),\n multi: true\n};\n\n@Injectable({\n providedIn: 'root',\n})\nexport class RadioControlRegistry {\n private accessors: any[] = [];\n\n add(control: NgControl, accessor: RadioButton) {\n this.accessors.push([control, accessor]);\n }\n\n remove(accessor: RadioButton) {\n this.accessors = this.accessors.filter((c) => {\n return c[1] !== accessor;\n })\n }\n\n select(accessor: RadioButton) {\n this.accessors.forEach((c) => {\n if (this.isSameGroup(c, accessor) && c[1] !== accessor) {\n c[1].writeValue(accessor.value);\n }\n });\n }\n\n private isSameGroup(controlPair: [NgControl, RadioButton], accessor: RadioButton): boolean {\n if (!controlPair[0].control) {\n return false;\n }\n\n return controlPair[0].control.root === accessor.control.control.root && controlPair[1].name === accessor.name;\n }\n}\n\n@Component({\n selector: 'p-radioButton',\n template: `\n <div [ngStyle]=\"style\" [ngClass]=\"{'p-radiobutton p-component':true,'p-radiobutton-checked': checked, 'p-radiobutton-disabled': disabled, 'p-radiobutton-focused': focused}\" [class]=\"styleClass\">\n <div class=\"p-hidden-accessible\">\n <input #rb type=\"radio\" [attr.id]=\"inputId\" [attr.name]=\"name\" [attr.value]=\"value\" [attr.tabindex]=\"tabindex\" [attr.aria-checked]=\"checked\" [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledBy\" [checked]=\"checked\" (change)=\"onChange($event)\" (focus)=\"onInputFocus($event)\" (blur)=\"onInputBlur($event)\" [disabled]=\"disabled\">\n </div>\n <div (click)=\"handleClick($event, rb, true)\" [ngClass]=\"{'p-radiobutton-box':true, 'p-highlight': checked, 'p-disabled': disabled, 'p-focus': focused}\">\n <span class=\"p-radiobutton-icon\"></span>\n </div>\n </div>\n <label (click)=\"select($event)\" [class]=\"labelStyleClass\"\n [ngClass]=\"{'p-radiobutton-label':true, 'p-radiobutton-label-active':rb.checked, 'p-disabled':disabled, 'p-radiobutton-label-focus':focused}\"\n *ngIf=\"label\" [attr.for]=\"inputId\">{{label}}</label>\n `,\n providers: [RADIO_VALUE_ACCESSOR],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n 'class': 'p-element'\n }\n})\nexport class RadioButton implements ControlValueAccessor, OnInit, OnDestroy {\n\n @Input() value: any;\n\n @Input() formControlName: string;\n\n @Input() name: string;\n\n @Input() disabled: boolean;\n\n @Input() label: string;\n\n @Input() tabindex: number;\n\n @Input() inputId: string;\n\n @Input() ariaLabelledBy: string;\n\n @Input() ariaLabel: string;\n\n @Input() style: any;\n\n @Input() styleClass: string;\n\n @Input() labelStyleClass: string;\n\n @Output() onClick: EventEmitter<any> = new EventEmitter();\n\n @Output() onFocus: EventEmitter<any> = new EventEmitter();\n\n @Output() onBlur: EventEmitter<any> = new EventEmitter();\n\n @ViewChild('rb') inputViewChild: ElementRef;\n\n public onModelChange: Function = () => {};\n\n public onModelTouched: Function = () => {};\n\n public checked: boolean;\n\n public focused: boolean;\n\n control: NgControl;\n\n constructor(public cd: ChangeDetectorRef, private injector: Injector, private registry: RadioControlRegistry) {}\n\n ngOnInit() {\n this.control = this.injector.get(NgControl);\n this.checkName();\n this.registry.add(this.control, this);\n }\n\n handleClick(event, radioButton, focus) {\n event.preventDefault();\n\n if (this.disabled) {\n return;\n }\n\n this.select(event);\n\n if (focus) {\n radioButton.focus();\n }\n }\n\n select(event) {\n if (!this.disabled) {\n this.inputViewChild.nativeElement.checked = true;\n this.checked = true;\n this.onModelChange(this.value);\n this.registry.select(this);\n this.onClick.emit(event);\n }\n }\n\n writeValue(value: any) : void {\n this.checked = (value == this.value);\n\n if (this.inputViewChild && this.inputViewChild.nativeElement) {\n this.inputViewChild.nativeElement.checked = this.checked;\n }\n\n this.cd.markForCheck();\n }\n\n registerOnChange(fn: Function): void {\n this.onModelChange = fn;\n }\n\n registerOnTouched(fn: Function): void {\n this.onModelTouched = fn;\n }\n\n setDisabledState(val: boolean): void {\n this.disabled = val;\n this.cd.markForCheck();\n }\n\n onInputFocus(event) {\n this.focused = true;\n this.onFocus.emit(event);\n }\n\n onInputBlur(event) {\n this.focused = false;\n this.onModelTouched();\n this.onBlur.emit(event);\n }\n\n onChange(event) {\n this.select(event);\n }\n\n focus() {\n this.inputViewChild.nativeElement.focus();\n }\n\n ngOnDestroy() {\n this.registry.remove(this);\n }\n\n private checkName() {\n if (this.name && this.formControlName && this.name !== this.formControlName) {\n this.throwNameError();\n }\n if (!this.name && this.formControlName) {\n this.name = this.formControlName;\n }\n }\n\n private throwNameError() {\n throw new Error(`\n If you define both a name and a formControlName attribute on your radio button, their values\n must match. Ex: <p-radioButton formControlName=\"food\" name=\"food\"></p-radioButton>\n `);\n }\n}\n\n@NgModule({\n imports: [CommonModule],\n exports: [RadioButton],\n declarations: [RadioButton]\n})\nexport class RadioButtonModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;MAIa,oBAAoB,GAAQ;IACrC,OAAO,EAAE,iBAAiB;IAC1B,WAAW,EAAE,UAAU,CAAC,MAAM,WAAW,CAAC;IAC1C,KAAK,EAAE,IAAI;EACb;MAKW,oBAAoB;IAHjC;QAIY,cAAS,GAAU,EAAE,CAAC;KA2BjC;IAzBG,GAAG,CAAC,O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