Icard/angular-clarity-master(work.../node_modules/primeng/fesm2022/primeng-chip.mjs.map

1 line
10 KiB
Plaintext

{"version":3,"file":"primeng-chip.mjs","sources":["../../src/app/components/chip/chip.ts","../../src/app/components/chip/primeng-chip.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { AfterContentInit, ChangeDetectionStrategy, Component, ContentChildren, EventEmitter, Input, NgModule, Output, QueryList, TemplateRef, ViewEncapsulation, inject, booleanAttribute } from '@angular/core';\nimport { PrimeNGConfig, PrimeTemplate, SharedModule, TranslationKeys } from 'primeng/api';\nimport { TimesCircleIcon } from 'primeng/icons/timescircle';\n/**\n * Chip represents people using icons, labels and images.\n * @group Components\n */\n@Component({\n selector: 'p-chip',\n template: `\n <div [ngClass]=\"containerClass()\" [class]=\"styleClass\" [ngStyle]=\"style\" *ngIf=\"visible\" [attr.data-pc-name]=\"'chip'\" [attr.aria-label]=\"label\" [attr.data-pc-section]=\"'root'\">\n <ng-content></ng-content>\n <img [src]=\"image\" *ngIf=\"image; else iconTemplate\" (error)=\"imageError($event)\" [alt]=\"alt\" />\n <ng-template #iconTemplate><span *ngIf=\"icon\" [class]=\"icon\" [ngClass]=\"'p-chip-icon'\" [attr.data-pc-section]=\"'icon'\"></span></ng-template>\n <div class=\"p-chip-text\" *ngIf=\"label\" [attr.data-pc-section]=\"'label'\">{{ label }}</div>\n <ng-container *ngIf=\"removable\">\n <ng-container *ngIf=\"!removeIconTemplate\">\n <span\n tabindex=\"0\"\n *ngIf=\"removeIcon\"\n [class]=\"removeIcon\"\n [ngClass]=\"'pi-chip-remove-icon'\"\n [attr.data-pc-section]=\"'removeicon'\"\n (click)=\"close($event)\"\n (keydown)=\"onKeydown($event)\"\n [attr.aria-label]=\"removeAriaLabel\"\n role=\"button\"\n ></span>\n <TimesCircleIcon tabindex=\"0\" *ngIf=\"!removeIcon\" [class]=\"'pi-chip-remove-icon'\" [attr.data-pc-section]=\"'removeicon'\" (click)=\"close($event)\" (keydown)=\"onKeydown($event)\" [attr.aria-label]=\"removeAriaLabel\" role=\"button\" />\n </ng-container>\n <span *ngIf=\"removeIconTemplate\" tabindex=\"0\" [attr.data-pc-section]=\"'removeicon'\" class=\"pi-chip-remove-icon\" (click)=\"close($event)\" (keydown)=\"onKeydown($event)\" [attr.aria-label]=\"removeAriaLabel\" role=\"button\">\n <ng-template *ngTemplateOutlet=\"removeIconTemplate\"></ng-template>\n </span>\n </ng-container>\n </div>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n styleUrls: ['./chip.css'],\n host: {\n class: 'p-element'\n }\n})\nexport class Chip implements AfterContentInit {\n /**\n * Defines the text to display.\n * @group Props\n */\n @Input() label: string | undefined;\n /**\n * Defines the icon to display.\n * @group Props\n */\n @Input() icon: string | undefined;\n /**\n * Defines the image to display.\n * @group Props\n */\n @Input() image: string | undefined;\n /**\n * Alt attribute of the image.\n * @group Props\n */\n @Input() alt: string | undefined;\n /**\n * Inline style of the element.\n * @group Props\n */\n @Input() style: { [klass: string]: any } | null | undefined;\n /**\n * Class of the element.\n * @group Props\n */\n @Input() styleClass: string | undefined;\n /**\n * Whether to display a remove icon.\n * @group Props\n */\n @Input({ transform: booleanAttribute }) removable: boolean | undefined = false;\n /**\n * Icon of the remove element.\n * @group Props\n */\n @Input() removeIcon: string | undefined;\n /**\n * Callback to invoke when a chip is removed.\n * @param {MouseEvent} event - Mouse event.\n * @group Emits\n */\n @Output() onRemove: EventEmitter<MouseEvent> = new EventEmitter<MouseEvent>();\n /**\n * This event is triggered if an error occurs while loading an image file.\n * @param {Event} event - Browser event.\n * @group Emits\n */\n @Output() onImageError: EventEmitter<Event> = new EventEmitter<Event>();\n\n config = inject(PrimeNGConfig);\n\n visible: boolean = true;\n\n removeIconTemplate: TemplateRef<any> | undefined;\n\n get removeAriaLabel() {\n return this.config.getTranslation(TranslationKeys.ARIA)['removeLabel'];\n }\n\n @ContentChildren(PrimeTemplate) templates: QueryList<PrimeTemplate> | undefined;\n\n ngAfterContentInit() {\n (this.templates as QueryList<PrimeTemplate>).forEach((item) => {\n switch (item.getType()) {\n case 'removeicon':\n this.removeIconTemplate = item.template;\n break;\n\n default:\n this.removeIconTemplate = item.template;\n break;\n }\n });\n }\n\n containerClass() {\n return {\n 'p-chip p-component': true,\n 'p-chip-image': this.image != null\n };\n }\n\n close(event: MouseEvent) {\n this.visible = false;\n this.onRemove.emit(event);\n }\n\n onKeydown(event) {\n if (event.key === 'Enter' || event.key === 'Backspace') {\n this.close(event);\n }\n }\n\n imageError(event: Event) {\n this.onImageError.emit(event);\n }\n}\n\n@NgModule({\n imports: [CommonModule, TimesCircleIcon, SharedModule],\n exports: [Chip, SharedModule],\n declarations: [Chip]\n})\nexport class ChipModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;AAIA;;;AAGG;MAqCU,IAAI,CAAA;AACb;;;AAGG;AACM,IAAA,KAAK,CAAqB;AACnC;;;AAGG;AACM,IAAA,IAAI,CAAqB;AAClC;;;AAGG;AACM,IAAA,KAAK,CAAqB;AACnC;;;AAGG;AACM,IAAA,GAAG,CAAqB;AACjC;;;AAGG;AACM,IAAA,KAAK,CAA8C;AAC5D;;;AAGG;AACM,IAAA,UAAU,CAAqB;AACxC;;;AAGG;IACqC,SAAS,GAAwB,KAAK,CAAC;AAC/E;;;AAGG;AACM,IAAA,UAAU,CAAqB;AACxC;;;;AAIG;AACO,IAAA,QAAQ,GAA6B,IAAI,YAAY,EAAc,CAAC;AAC9E;;;;AAIG;AACO,IAAA,YAAY,GAAwB,IAAI,YAAY,EAAS,CAAC;AAExE,IAAA,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;IAE/B,OAAO,GAAY,IAAI,CAAC;AAExB,IAAA,kBAAkB,CAA+B;AAEjD,IAAA,IAAI,eAAe,GAAA;AACf,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,eAAe,CAAC,IAAI,CAA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