source: trip-planner-front/node_modules/primeng/fesm2015/primeng-rating.mjs.map@ 8d391a1

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

adding photos

  • Property mode set to 100644
File size: 6.1 KB
Line 
1{"version":3,"file":"primeng-rating.mjs","sources":["../../src/app/components/rating/rating.ts","../../src/app/components/rating/primeng-rating.ts"],"sourcesContent":["import {NgModule,Component,OnInit,Input,Output,EventEmitter,forwardRef,ChangeDetectorRef,ChangeDetectionStrategy, ViewEncapsulation} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {NG_VALUE_ACCESSOR, ControlValueAccessor} from '@angular/forms';\n\nexport const RATING_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => Rating),\n multi: true\n};\n\n@Component({\n selector: 'p-rating',\n template: `\n <div class=\"p-rating\" [ngClass]=\"{'p-readonly': readonly, 'p-disabled': disabled}\">\n <span [attr.tabindex]=\"(disabled || readonly) ? null : '0'\" *ngIf=\"cancel\" (click)=\"clear($event)\" (keydown.enter)=\"clear($event)\" class=\"p-rating-icon p-rating-cancel\" [ngClass]=\"iconCancelClass\" [ngStyle]=\"iconCancelStyle\"></span>\n <span *ngFor=\"let star of starsArray;let i=index\" class=\"p-rating-icon\" [attr.tabindex]=\"(disabled || readonly) ? null : '0'\" (click)=\"rate($event,i)\" (keydown.enter)=\"rate($event,i)\"\n [ngClass]=\"(!value || i >= value) ? iconOffClass : iconOnClass\"\n [ngStyle]=\"(!value || i >= value) ? iconOffStyle : iconOnStyle\"></span>\n </div>\n `,\n providers: [RATING_VALUE_ACCESSOR],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n styleUrls: ['./rating.css'],\n host: {\n 'class': 'p-element'\n }\n})\nexport class Rating implements OnInit,ControlValueAccessor {\n\n @Input() disabled: boolean;\n\n @Input() readonly: boolean;\n\n @Input() stars: number = 5;\n\n @Input() cancel: boolean = true;\n\n @Input() iconOnClass: string = 'pi pi-star-fill';\n\n @Input() iconOnStyle: any;\n\n @Input() iconOffClass: string = 'pi pi-star';\n\n @Input() iconOffStyle: any;\n\n @Input() iconCancelClass: string = 'pi pi-ban';\n\n @Input() iconCancelStyle: any;\n\n @Output() onRate: EventEmitter<any> = new EventEmitter();\n\n @Output() onCancel: EventEmitter<any> = new EventEmitter();\n\n constructor(private cd: ChangeDetectorRef) {}\n\n value: number;\n\n onModelChange: Function = () => {};\n\n onModelTouched: Function = () => {};\n\n public starsArray: number[];\n\n ngOnInit() {\n this.starsArray = [];\n for(let i = 0; i < this.stars; i++) {\n this.starsArray[i] = i;\n }\n }\n\n rate(event, i: number): void {\n if (!this.readonly&&!this.disabled) {\n this.value = (i + 1);\n this.onModelChange(this.value);\n this.onModelTouched();\n this.onRate.emit({\n originalEvent: event,\n value: (i+1)\n });\n }\n event.preventDefault();\n }\n\n clear(event): void {\n if (!this.readonly&&!this.disabled) {\n this.value = null;\n this.onModelChange(this.value);\n this.onModelTouched();\n this.onCancel.emit(event);\n }\n event.preventDefault();\n }\n\n writeValue(value: any) : void {\n this.value = value;\n this.cd.detectChanges();\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\n@NgModule({\n imports: [CommonModule],\n exports: [Rating],\n declarations: [Rating]\n})\nexport class RatingModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;MAIa,qBAAqB,GAAQ;IACxC,OAAO,EAAE,iBAAiB;IAC1B,WAAW,EAAE,UAAU,CAAC,MAAM,MAAM,CAAC;IACrC,KAAK,EAAE,IAAI;EACX;MAoBW,MAAM;IA0Bf,YAAoB,EAAqB;QAArB,OAAE,GAAF,EAAE,CAAmB;QApBhC,UAAK,GAAW,CAAC,CAAC;QAElB,WAAM,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