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

1 line
21 KiB
Plaintext
Raw Permalink Normal View History

2024-07-16 15:23:22 +00:00
{"version":3,"file":"primeng-selectbutton.mjs","sources":["../../src/app/components/selectbutton/selectbutton.ts","../../src/app/components/selectbutton/primeng-selectbutton.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChild, ElementRef, EventEmitter, Input, NgModule, Output, TemplateRef, ViewChild, ViewEncapsulation, booleanAttribute, forwardRef, numberAttribute } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { PrimeTemplate, SharedModule } from 'primeng/api';\nimport { RippleModule } from 'primeng/ripple';\nimport { Nullable } from 'primeng/ts-helpers';\nimport { ObjectUtils } from 'primeng/utils';\nimport { AutoFocusModule } from 'primeng/autofocus';\nimport { SelectButtonChangeEvent, SelectButtonOptionClickEvent } from './selectbutton.interface';\n\nexport const SELECTBUTTON_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SelectButton),\n multi: true\n};\n/**\n * SelectButton is used to choose single or multiple items from a list using buttons.\n * @group Components\n */\n@Component({\n selector: 'p-selectButton',\n template: `\n <div #container [ngClass]=\"'p-selectbutton p-buttonset p-component'\" [ngStyle]=\"style\" [class]=\"styleClass\" role=\"group\" [attr.aria-labelledby]=\"ariaLabelledBy\" [attr.data-pc-name]=\"'selectbutton'\" [attr.data-pc-section]=\"'root'\">\n <div\n *ngFor=\"let option of options; let i = index\"\n pRipple\n [attr.tabindex]=\"i === focusedIndex ? '0' : '-1'\"\n [attr.aria-label]=\"option.label\"\n [role]=\"multiple ? 'checkbox' : 'radio'\"\n [attr.aria-checked]=\"isSelected(option)\"\n [attr.aria-disabled]=\"optionDisabled\"\n class=\"p-button p-component\"\n [class]=\"option.styleClass\"\n [ngClass]=\"{ 'p-highlight': isSelected(option), 'p-disabled': disabled || isOptionDisabled(option), 'p-button-icon-only': option.icon && !getOptionLabel(option) }\"\n [attr.aria-pressed]=\"isSelected(option)\"\n (click)=\"onOptionSelect($event, option, i)\"\n (keydown)=\"onKeyDown($event, option, i)\"\n [attr.title]=\"option.title\"\n (focus)=\"onFocus($event, i)\"\n (blur)=\"onBlur()\"\n [attr.aria-labelledby]=\"this.getOptionLabel(option)\"\n [attr.data-pc-section]=\"'button'\"\n pAutoFocus\n [autofocus]=\"autofocus\"\n >\n <ng-container *ngIf=\"!itemTemplate; else customcontent\">\n <span [ngClass]=\"'p-button-icon p-button-icon-left'\" [class]=\"option.icon\" *ngIf=\"option.icon\" [attr.data-pc-section]=\"'icon'\"></span>\n <span class=\"p-button-label\" [attr.data-pc-section]=\"'label'\">{{ getOptionLabel(option) }}</span>\n </ng-container>\n <ng-template #customcontent>\n <ng-container *ngTemplateOutlet=\"selectButtonTemplate; 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 * An array of selectitems to display as the available options.\n * @group Props\n */\n @Input() options: any[] | undefined;\n /**\n * Name of the label field of an option.\n * @group Props\n */\n @Input() optionLabel: string | undefined;\n /**\n * Name of the value field of an option.\n * @group Props\n */\n @Input() optionValue: string | undefined;\n