1 line
10 KiB
Plaintext
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() o
|