source: trip-planner-front/node_modules/primeng/fesm2015/primeng-selectbutton.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: 9.5 KB
Line 
1{"version":3,"file":"primeng-selectbutton.mjs","sources":["../../src/app/components/selectbutton/selectbutton.ts","../../src/app/components/selectbutton/primeng-selectbutton.ts"],"sourcesContent":["import {NgModule,Component,Input,Output,EventEmitter,forwardRef,ChangeDetectorRef,ContentChild,TemplateRef,ChangeDetectionStrategy, ViewEncapsulation} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {ObjectUtils} from 'primeng/utils';\nimport {RippleModule} from 'primeng/ripple';\nimport {NG_VALUE_ACCESSOR, ControlValueAccessor} from '@angular/forms';\n\nexport const SELECTBUTTON_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SelectButton),\n multi: true\n};\n\n@Component({\n selector: 'p-selectButton',\n template: `\n <div [ngClass]=\"'p-selectbutton p-buttonset p-component'\" [ngStyle]=\"style\" [class]=\"styleClass\" role=\"group\">\n <div *ngFor=\"let option of options; let i = index\" #btn class=\"p-button p-component\" [class]=\"option.styleClass\" role=\"button\" [attr.aria-pressed]=\"isSelected(option)\"\n [ngClass]=\"{'p-highlight':isSelected(option),\n 'p-disabled': disabled || isOptionDisabled(option),\n 'p-button-icon-only': (option.icon && !getOptionLabel(option))}\"\n (click)=\"onItemClick($event,option,i)\" (keydown.enter)=\"onItemClick($event,option,i)\"\n [attr.title]=\"option.title\" [attr.aria-label]=\"option.label\" (blur)=\"onBlur()\" [attr.tabindex]=\"disabled ? null : tabindex\" [attr.aria-labelledby]=\"this.getOptionLabel(option)\" pRipple>\n <ng-container *ngIf=\"!itemTemplate else customcontent\">\n <span [ngClass]=\"'p-button-icon p-button-icon-left'\" [class]=\"option.icon\" *ngIf=\"option.icon\"></span>\n <span class=\"p-button-label\">{{getOptionLabel(option)}}</span>\n </ng-container>\n <ng-template #customcontent>\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: {$implicit: option, index: i}\"></ng-container>\n </ng-template>\n </div>\n </div>\n `,\n providers: [SELECTBUTTON_VALUE_ACCESSOR],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n styleUrls: ['../button/button.css'],\n host: {\n 'class': 'p-element'\n }\n})\nexport class SelectButton implements ControlValueAccessor {\n\n @Input() options: any[];\n\n @Input() optionLabel: string;\n\n @Input() optionValue: string;\n\n @Input() optionDisabled: string;\n\n @Input() tabindex: number = 0;\n\n @Input() multiple: boolean;\n\n @Input() style: any;\n\n @Input() styleClass: string;\n\n @Input() ariaLabelledBy: string;\n\n @Input() disabled: boolean;\n\n @Input() dataKey: string\n\n @Output() onOptionClick: EventEmitter<any> = new EventEmitter();\n\n @Output() onChange: EventEmitter<any> = new EventEmitter();\n\n @ContentChild(TemplateRef) itemTemplate;\n\n value: any;\n\n onModelChange: Function = () => {};\n\n onModelTouched: Function = () => {};\n\n constructor(public cd: ChangeDetectorRef) {}\n\n getOptionLabel(option: any) {\n return this.optionLabel ? ObjectUtils.resolveFieldData(option, this.optionLabel) : (option.label != undefined ? option.label : option);\n }\n\n getOptionValue(option: any) {\n return this.optionValue ? ObjectUtils.resolveFieldData(option, this.optionValue) : (this.optionLabel || option.value === undefined ? option : option.value);\n }\n\n isOptionDisabled(option: any) {\n return this.optionDisabled ? ObjectUtils.resolveFieldData(option, this.optionDisabled) : (option.disabled !== undefined ? option.disabled : false);\n }\n\n writeValue(value: any) : void {\n this.value = value;\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 onItemClick(event, option: any, index: number) {\n if (this.disabled || this.isOptionDisabled(option)) {\n return;\n }\n\n if (this.multiple) {\n if (this.isSelected(option))\n this.removeOption(option);\n else\n this.value = [...(this.value||[]), this.getOptionValue(option)];\n }\n else {\n this.value = this.getOptionValue(option);\n }\n\n this.onOptionClick.emit({\n originalEvent: event,\n option: option,\n index: index\n });\n\n this.onModelChange(this.value);\n\n this.onChange.emit({\n originalEvent: event,\n value: this.value\n });\n }\n\n onBlur() {\n this.onModelTouched();\n }\n\n removeOption(option: any): void {\n this.value = this.value.filter(val => !ObjectUtils.equals(val, this.getOptionValue(option), this.dataKey));\n }\n\n isSelected(option: any) {\n let selected = false;\n let optionValue = this.getOptionValue(option);\n\n if (this.multiple) {\n if (this.value) {\n for (let val of this.value) {\n if (ObjectUtils.equals(val, optionValue, this.dataKey)) {\n selected = true;\n break;\n }\n }\n }\n }\n else {\n selected = ObjectUtils.equals(this.getOptionValue(option), this.value, this.dataKey);\n }\n\n return selected;\n }\n}\n\n@NgModule({\n imports: [CommonModule,RippleModule],\n exports: [SelectButton],\n declarations: [SelectButton]\n})\nexport class SelectButtonModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;MAMa,2BAA2B,GAAQ;IAC9C,OAAO,EAAE,iBAAiB;IAC1B,WAAW,EAAE,UAAU,CAAC,MAAM,YAAY,CAAC;IAC3C,KAAK,EAAE,IAAI;EACX;MA8BW,YAAY;IAoCrB,YAAmB,EAAqB;QAArB,OAAE,GAAF,EAAE,CAAmB;QA1B/B,aAAQ,GAAW,CAAC,CAAC;QAcpB,kBAAa,GAAsB,IAAI,YAAY,EAAE,CAAC;QAEtD,aAAQ,GAAsB,IAAI,YAAY,EAAE,CAAC;QAM3D,kBAAa,GAAa,SAAQ,CAAC;QAEnC,mBAAc,GAAa,SAAQ,CAAC;KAEQ;IAE5C,cAAc,CAAC,MAAW;QACtB,OAAO,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,MAAM,CAAC,KAAK,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