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

1 line
11 KiB
Plaintext

{"version":3,"file":"primeng-inputswitch.mjs","sources":["../../src/app/components/inputswitch/inputswitch.ts","../../src/app/components/inputswitch/primeng-inputswitch.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, Input, NgModule, Output, ViewChild, ViewEncapsulation, booleanAttribute, forwardRef, numberAttribute } from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { AutoFocusModule } from 'primeng/autofocus';\nimport { InputSwitchChangeEvent } from './inputswitch.interface';\n\nexport const INPUTSWITCH_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => InputSwitch),\n multi: true\n};\n/**\n * InputSwitch is used to select a boolean value.\n * @group Components\n */\n@Component({\n selector: 'p-inputSwitch',\n template: `\n <div\n [ngClass]=\"{ 'p-inputswitch p-component': true, 'p-inputswitch-checked': checked(), 'p-disabled': disabled, 'p-focus': focused }\"\n [ngStyle]=\"style\"\n [class]=\"styleClass\"\n (click)=\"onClick($event)\"\n [attr.data-pc-name]=\"'inputswitch'\"\n [attr.data-pc-section]=\"'root'\"\n >\n <div class=\"p-hidden-accessible\" [attr.data-pc-section]=\"'hiddenInputWrapper'\" [attr.data-p-hidden-accessible]=\"true\">\n <input\n #input\n [attr.id]=\"inputId\"\n type=\"checkbox\"\n role=\"switch\"\n [checked]=\"checked()\"\n [disabled]=\"disabled\"\n [attr.aria-checked]=\"checked()\"\n [attr.aria-labelledby]=\"ariaLabelledBy\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.name]=\"name\"\n [attr.tabindex]=\"tabindex\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n [attr.data-pc-section]=\"'hiddenInput'\"\n pAutoFocus\n [autofocus]=\"autofocus\"\n />\n </div>\n <span class=\"p-inputswitch-slider\" [attr.data-pc-section]=\"'slider'\"></span>\n </div>\n `,\n providers: [INPUTSWITCH_VALUE_ACCESSOR],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n styleUrls: ['./inputswitch.css'],\n host: {\n class: 'p-element'\n }\n})\nexport class InputSwitch {\n /**\n * Inline style of the component.\n * @group Props\n */\n @Input() style: { [klass: string]: any } | null | undefined;\n /**\n * Style class of the component.\n * @group Props\n */\n @Input() styleClass: string | undefined;\n /**\n * Index of the element in tabbing order.\n * @group Props\n */\n @Input({ transform: numberAttribute }) tabindex: number | undefined;\n /**\n * Identifier of the input element.\n * @group Props\n */\n @Input() inputId: string | undefined;\n /**\n * Name of the input element.\n * @group Props\n */\n @Input() name: string | undefined;\n /**\n * When present, it specifies that the element should be disabled.\n * @group Props\n */\n @Input({ transform: booleanAttribute }) disabled: boolean | undefined;\n /**\n * When present, it specifies that the component cannot be edited.\n * @group Props\n */\n @Input({ transform: booleanAttribute }) readonly: boolean | undefined;\n /**\n * Value in checked state.\n * @group Props\n */\n @Input() trueValue: any = true;\n /**\n * Value in unchecked state.\n * @group Props\n */\n @Input() falseValue: any = false;\n /**\n * Used to define a string that autocomplete attribute the current element.\n * @group Props\n */\n @Input() ariaLabel: string | undefined;\n /**\n * Establishes relationships between the component and label(s) where its value should be one or more element IDs.\n * @group Props\n */\n @Input() ariaLabelledBy: string | undefined;\n /**\n * When present, it specifies that the component should automatically get focus on load.\n * @group Props\n */\n @Input({ transform: booleanAttribute }) autofocus: boolean | undefined;\n /**\n * Callback to invoke when the on value change.\n * @param {InputSwitchChangeEvent} event - Custom change event.\n * @group Emits\n */\n @Output() onChange: EventEmitter<InputSwitchChangeEvent> = new EventEmitter<InputSwitchChangeEvent>();\n\n @ViewChild('input') input!: ElementRef;\n\n modelValue: any = false;\n\n focused: boolean = false;\n\n onModelChange: Function = () => {};\n\n onModelTouched: Function = () => {};\n\n constructor(private cd: ChangeDetectorRef) {}\n\n onClick(event: Event) {\n if (!this.disabled && !this.readonly) {\n this.modelValue = this.checked() ? this.falseValue : this.trueValue;\n\n this.onModelChange(this.modelValue);\n this.onChange.emit({\n originalEvent: event,\n checked: this.modelValue\n });\n\n this.input.nativeElement.focus();\n }\n }\n\n onFocus() {\n this.focused = true;\n }\n\n onBlur() {\n this.focused = false;\n this.onModelTouched();\n }\n\n writeValue(value: any): void {\n this.modelValue = 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 checked() {\n return this.modelValue === this.trueValue;\n }\n}\n\n@NgModule({\n imports: [CommonModule, AutoFocusModule],\n exports: [InputSwitch],\n declarations: [InputSwitch]\n})\nexport class InputSwitchModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;AAMa,MAAA,0BAA0B,GAAQ;AAC3C,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,WAAW,EAAE,UAAU,CAAC,MAAM,WAAW,CAAC;AAC1C,IAAA,KAAK,EAAE,IAAI;EACb;AACF;;;AAGG;MA2CU,WAAW,CAAA;AA8EA,IAAA,EAAA,CAAA;AA7EpB;;;AAGG;AACM,IAAA,KAAK,CAA8C;AAC5D;;;AAGG;AACM,IAAA,UAAU,CAAqB;AACxC;;;AAGG;AACoC,IAAA,QAAQ,CAAqB;AACpE;;;AAGG;AACM,IAAA,OAAO,CAAqB;AACrC;;;AAGG;AACM,IAAA,IAAI,CAAqB;AAClC;;;AAGG;AACqC,IAAA,QAAQ,CAAsB;AACtE;;;AAGG;AACqC,IAAA,QAAQ,CAAsB;AACtE;;;AAGG;IACM,SAAS,GAAQ,IAAI,CAAC;AAC/B;;;AAGG;IACM,UAAU,GAAQ,KAAK,CAAC;AACjC;;;AAGG;AACM,IAAA,SAAS,CAAqB;AACv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