source: trip-planner-front/node_modules/primeng/fesm2020/primeng-checkbox.mjs.map@ 6fe77af

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

adding photos

  • Property mode set to 100644
File size: 8.5 KB
RevLine 
[59329aa]1{"version":3,"file":"primeng-checkbox.mjs","sources":["../../src/app/components/checkbox/checkbox.ts","../../src/app/components/checkbox/primeng-checkbox.ts"],"sourcesContent":["import {NgModule,Component,Input,Output,EventEmitter,forwardRef,ChangeDetectorRef,ViewChild,ElementRef,ChangeDetectionStrategy, ViewEncapsulation} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {NG_VALUE_ACCESSOR, ControlValueAccessor, FormControl} from '@angular/forms';\nimport { ObjectUtils } from 'primeng/utils';\n\nexport const CHECKBOX_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => Checkbox),\n multi: true\n};\n\n@Component({\n selector: 'p-checkbox',\n template: `\n <div [ngStyle]=\"style\" [ngClass]=\"{'p-checkbox p-component': true, 'p-checkbox-checked': checked(), 'p-checkbox-disabled': disabled, 'p-checkbox-focused': focused}\" [class]=\"styleClass\">\n <div class=\"p-hidden-accessible\">\n <input #cb type=\"checkbox\" [attr.id]=\"inputId\" [attr.name]=\"name\" [readonly]=\"readonly\" [value]=\"value\" [checked]=\"checked()\" (focus)=\"onFocus()\" (blur)=\"onBlur()\"\n (change)=\"handleChange($event)\" [disabled]=\"disabled\" [attr.tabindex]=\"tabindex\" [attr.aria-labelledby]=\"ariaLabelledBy\" [attr.aria-label]=\"ariaLabel\" [attr.aria-checked]=\"checked()\" [attr.required]=\"required\">\n </div>\n <div class=\"p-checkbox-box\" (click)=\"onClick($event,cb,true)\"\n [ngClass]=\"{'p-highlight': checked(), 'p-disabled': disabled, 'p-focus': focused}\">\n <span class=\"p-checkbox-icon\" [ngClass]=\"checked() ? checkboxIcon : null\"></span>\n </div>\n </div>\n <label (click)=\"onClick($event,cb,true)\" [class]=\"labelStyleClass\"\n [ngClass]=\"{'p-checkbox-label': true, 'p-checkbox-label-active':checked(), 'p-disabled':disabled, 'p-checkbox-label-focus':focused}\"\n *ngIf=\"label\" [attr.for]=\"inputId\">{{label}}</label>\n `,\n providers: [CHECKBOX_VALUE_ACCESSOR],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n styleUrls: ['./checkbox.css'],\n host: {\n 'class': 'p-element'\n }\n})\nexport class Checkbox implements ControlValueAccessor {\n\n @Input() value: any;\n\n @Input() name: string;\n\n @Input() disabled: boolean;\n\n @Input() binary: boolean;\n\n @Input() label: string;\n\n @Input() ariaLabelledBy: string;\n\n @Input() ariaLabel: string;\n\n @Input() tabindex: number;\n\n @Input() inputId: string;\n\n @Input() style: any;\n\n @Input() styleClass: string;\n\n @Input() labelStyleClass: string;\n\n @Input() formControl: FormControl;\n\n @Input() checkboxIcon: string = 'pi pi-check';\n\n @Input() readonly: boolean;\n\n @Input() required: boolean;\n\n @Input() trueValue: any = true;\n\n @Input() falseValue: any = false;\n\n @ViewChild('cb') inputViewChild: ElementRef;\n\n @Output() onChange: EventEmitter<any> = new EventEmitter();\n\n model: any;\n\n onModelChange: Function = () => {};\n\n onModelTouched: Function = () => {};\n\n focused: boolean = false;\n\n constructor(private cd: ChangeDetectorRef) {}\n\n onClick(event,checkbox,focus:boolean) {\n event.preventDefault();\n\n if (this.disabled || this.readonly) {\n return;\n }\n\n this.updateModel(event);\n\n if (focus) {\n checkbox.focus();\n }\n }\n\n updateModel(event) {\n let newModelValue;\n\n if (!this.binary) {\n if (this.checked())\n newModelValue = this.model.filter(val => !ObjectUtils.equals(val, this.value));\n else\n newModelValue = this.model ? [...this.model, this.value] : [this.value];\n\n this.onModelChange(newModelValue);\n this.model = newModelValue;\n\n if (this.formControl) {\n this.formControl.setValue(newModelValue);\n }\n }\n else {\n newModelValue = this.checked() ? this.falseValue : this.trueValue;\n this.model = newModelValue;\n this.onModelChange(newModelValue);\n }\n\n this.onChange.emit({checked:newModelValue, originalEvent: event});\n }\n\n handleChange(event) {\n if (!this.readonly) {\n this.updateModel(event);\n }\n }\n\n onFocus() {\n this.focused = true;\n }\n\n onBlur() {\n this.focused = false;\n this.onModelTouched();\n }\n\n focus() {\n this.inputViewChild.nativeElement.focus();\n }\n\n writeValue(model: any) : void {\n this.model = model;\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 checked() {\n return this.binary ? this.model === this.trueValue : ObjectUtils.contains(this.value, this.model);\n }\n}\n\n@NgModule({\n imports: [CommonModule],\n exports: [Checkbox],\n declarations: [Checkbox]\n})\nexport class CheckboxModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;MAKa,uBAAuB,GAAQ;IAC1C,OAAO,EAAE,iBAAiB;IAC1B,WAAW,EAAE,UAAU,CAAC,MAAM,QAAQ,CAAC;IACvC,KAAK,EAAE,IAAI;EACX;MA2BW,QAAQ;IAkDjB,YAAoB,EAAqB;QAArB,OAAE,GAAF,EAAE,CAAmB;QAtBhC,iBAAY,GAAW,aAAa,CAAC;QAMrC,cAAS,GAAQ,IAAI,CAAC;QAEtB,eAAU,GAAQ,KAAK,CAAC;QAIvB,aAAQ,GAAsB,IAAI,YAAY,EAAE,CAAC;QAI3D,kBAAa,GAAa,SAAQ,CAAC;QAEnC,mBAAc,GAAa,SAAQ,CAAC;QAEpC,YAAO,GAAY,KAAK,CAAC;KAEoB;IAE7C,OAAO,CAAC,KAAK,EAAC,QAAQ,EAAC,KAAa;QAChC,KAAK,CAAC,cAAc,EAAE,CAAC;QAEvB,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,EAAE;YAChC,OAAO;SACV;QAED,IAAI,CAAC,WAAW,CAAC,KAA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