UNPKG

@funidata/ngx-fudis

Version:

Funidata Design System.

65 lines (64 loc) 2.9 kB
import { AfterViewInit, EventEmitter, OnInit } from '@angular/core'; import { FormGroup } from '@angular/forms'; import { FudisCheckboxGroupChangeEvent, FudisCheckboxGroupFormGroup, FudisSelectionGroupInputSize } from '../../../types/forms'; import { FudisIdService } from '../../../services/id/id.service'; import { GroupComponentBaseDirective } from '../../../directives/form/group-component-base/group-component-base.directive'; import { FudisFocusService } from '../../../services/focus/focus.service'; import * as i0 from "@angular/core"; export declare class CheckboxGroupComponent<T extends FudisCheckboxGroupFormGroup<T>> extends GroupComponentBaseDirective implements OnInit, AfterViewInit { private _document; constructor(_document: Document, _idService: FudisIdService, _focusService: FudisFocusService); private _guidance; /** * FormGroup for Checkbox group. If provided, provide also `controlName` for each Checkbox * children. */ formGroup: FormGroup<T>; /** * Width size of the group. */ size: FudisSelectionGroupInputSize; /** * Emit changed control's name and whole FormGroup when one Checkbox is clicked. */ handleChange: EventEmitter<FudisCheckboxGroupChangeEvent>; /** * To determine if focus has been moved out from the whole checkbox group, so possible errors will * not show before that. */ private _groupBlurredOut; /** * Boolean to sync parent Checkbox Group and child Checkboxes if component uses internally created * FormGroup or one provided from the App. */ protected _internalFormGroup: boolean; private _applyGroupMarkAsTouched; /** * Getter for _groupBlurredOut boolean. */ get groupBlurredOut(): boolean; /** * Getter for _internalFormGroup boolean */ get internalFormGroup(): boolean; ngOnInit(): void; ngAfterViewInit(): void; /** * Return first checkbox child input when it is not disabled */ private _getFirstEnabledCheckbox; /** * Used to display possible error messages only when focus has moved out from all the group's * checkboxes. */ setGroupBlurredOut(value: boolean): void; /** * When child Checkbox component is clicked, it calls this parent's function, which will then * trigger Output emit. * * @param changedControlName Name of the clicked control */ triggerEmit(changedControlName: string): void; static ɵfac: i0.ɵɵFactoryDeclaration<CheckboxGroupComponent<any>, never>; static ɵcmp: i0.ɵɵComponentDeclaration<CheckboxGroupComponent<any>, "fudis-checkbox-group", never, { "formGroup": { "alias": "formGroup"; "required": false; }; "size": { "alias": "size"; "required": false; }; }, { "handleChange": "handleChange"; }, never, ["fudis-checkbox-group-option", "fudis-error-message"], false, never>; }