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

1 line
18 KiB
Plaintext
Raw Normal View History

2024-07-16 15:23:22 +00:00
{"version":3,"file":"primeng-radiobutton.mjs","sources":["../../src/app/components/radiobutton/radiobutton.ts","../../src/app/components/radiobutton/primeng-radiobutton.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, Injectable, Injector, Input, NgModule, OnDestroy, OnInit, Output, ViewChild, booleanAttribute, forwardRef, numberAttribute } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR, NgControl } from '@angular/forms';\nimport { Nullable } from 'primeng/ts-helpers';\nimport { AutoFocusModule } from 'primeng/autofocus';\n\nimport { RadioButtonClickEvent } from './radiobutton.interface';\nimport { PrimeNGConfig } from 'primeng/api';\n\nexport const RADIO_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => RadioButton),\n multi: true\n};\n\n@Injectable({\n providedIn: 'root'\n})\nexport class RadioControlRegistry {\n private accessors: any[] = [];\n\n add(control: NgControl, accessor: RadioButton) {\n this.accessors.push([control, accessor]);\n }\n\n remove(accessor: RadioButton) {\n this.accessors = this.accessors.filter((c) => {\n return c[1] !== accessor;\n });\n }\n\n select(accessor: RadioButton) {\n this.accessors.forEach((c) => {\n if (this.isSameGroup(c, accessor) && c[1] !== accessor) {\n c[1].writeValue(accessor.value);\n }\n });\n }\n\n private isSameGroup(controlPair: [NgControl, RadioButton], accessor: RadioButton): boolean {\n if (!controlPair[0].control) {\n return false;\n }\n\n return controlPair[0].control.root === (accessor as any).control.control.root && controlPair[1].name === accessor.name;\n }\n}\n/**\n * RadioButton is an extension to standard radio button element with theming.\n * @group Components\n */\n@Component({\n selector: 'p-radioButton',\n template: `\n <div\n [ngStyle]=\"style\"\n [ngClass]=\"{\n 'p-radiobutton p-component': true,\n 'p-radiobutton-checked': checked,\n 'p-radiobutton-disabled': disabled,\n 'p-radiobutton-focused': focused,\n 'p-variant-filled': variant === 'filled' || config.inputStyle() === 'filled'\n }\"\n [class]=\"styleClass\"\n [attr.data-pc-name]=\"'radiobutton'\"\n [attr.data-pc-section]=\"'root'\"\n (click)=\"handleClick($event, input, true)\"\n >\n <div class=\"p-hidden-accessible\" [attr.data-pc-section]=\"'hiddenInputWrapper'\">\n <input\n #input\n [attr.id]=\"inputId\"\n type=\"radio\"\n [attr.name]=\"name\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [value]=\"value\"\n [attr.aria-labelledby]=\"ariaLabelledBy\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.tabindex]=\"tabindex\"\n [attr.aria-checked]=\"checked\"\n (focus)=\"onInputFocus($event)\"\n (blur)=\"onInputBlur($event)\"\n [attr.data-pc-section]=\"'hiddenInput'\"\n pAutoFocus\n [autofocus]=\"autofocus\"\n />\n </div>\n <div [ngClass]=\"{ 'p-radiobutton-box': true, 'p-highlight': checked, 'p-disabled': disabled, 'p-focus': focused }\" [attr.data-pc-section]=\"'input'\">\n <span class=\"p-radiobutton-icon\" [attr.data-pc-section]=\"'icon'\"></span>\n </div>\n </div>\n <label\n (click)=\"select($event)\"\n [class]=\"labelStyleClass\"\n [ngClass]=\"{ 'p-radiobutton-label': true, 'p-radiobutton-label-active': input.checked, 'p-disabled': disabled, 'p-radiobutton-label-focus': focu