UNPKG

@funidata/ngx-fudis

Version:

Funidata Design System.

73 lines (72 loc) 2.71 kB
import { EventEmitter, OnInit, OnChanges, DestroyRef } from '@angular/core'; import { FudisIdService } from '../../../services/id/id.service'; import { FudisTranslationService } from '../../../services/translation/translation.service'; import { FudisCheckboxChangeEvent, FudisComponentChanges } from '../../../types/types'; import { BehaviorSubject, Subject } from 'rxjs'; import { FormControl } from '@angular/forms'; import * as i0 from "@angular/core"; export declare class CheckboxComponent implements OnInit, OnChanges { private _idService; protected _translationService: FudisTranslationService; constructor(_idService: FudisIdService, _translationService: FudisTranslationService); /** * FormControl for the input */ control: FormControl; /** * Checkbox id. By default generated */ id: string; /** * Label for the Checkbox */ label: string; /** * AriaLabelledBy attribute to be used when visible label is not provided */ ariaLabelledBy: string; /** * AriaDescribedBy attribute for linking custom error messages to Checkbox input */ ariaDescribedBy: string; /** * Emits Checkbox change */ handleChange: EventEmitter<FudisCheckboxChangeEvent>; /** * Trigger update when control validator is changed */ protected _updateValueAndValidityTrigger: Subject<void>; /** * Set requiredText based on this boolean value */ protected _required: BehaviorSubject<boolean>; protected _destroyRef: DestroyRef; /** * Subscription for handling the valueChanges observable */ private _subscription; /** * If Checkbox has focus */ protected _focused: boolean; /** * When Checkbox is focused */ protected _onFocus(): void; /** * When Checkbox is blurred */ protected _onBlur(): void; /** * Manual toggle for checkbox checked state */ protected _onChange(event: Event): void; ngOnInit(): void; /** * Add value and validity check when control value changes */ ngOnChanges(changes: FudisComponentChanges<CheckboxComponent>): void; static ɵfac: i0.ɵɵFactoryDeclaration<CheckboxComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<CheckboxComponent, "fudis-checkbox", never, { "control": { "alias": "control"; "required": true; }; "id": { "alias": "id"; "required": false; }; "label": { "alias": "label"; "required": false; }; "ariaLabelledBy": { "alias": "ariaLabelledBy"; "required": false; }; "ariaDescribedBy": { "alias": "ariaDescribedBy"; "required": false; }; }, { "handleChange": "handleChange"; }, never, ["*"], false, never>; }