UNPKG

@funidata/ngx-fudis

Version:

Funidata Design System.

69 lines (68 loc) 2.76 kB
import { AfterViewInit, OnInit, EventEmitter } from '@angular/core'; import { FudisInternalErrorSummaryService } from '../../../services/form/error-summary/internal-error-summary.service'; import { FudisTranslationService } from '../../../services/translation/translation.service'; import * as i0 from "@angular/core"; type ErrorSummaryDOMListItem = { id: string; message: string; element: HTMLElement | null; }; export declare class ErrorSummaryComponent implements AfterViewInit, OnInit { private _errorSummaryService; protected _translationService: FudisTranslationService; constructor(_errorSummaryService: FudisInternalErrorSummaryService, _translationService: FudisTranslationService); private _focusTarget; /** * Form parent element of this ErrorSummaryComponent */ parentComponent: HTMLFormElement; /** * Title text displayed in Error Summary before listing individual errors. If not provided, Fudis * will display its default helper title text */ title: string; /** * Id of parent Form component */ formId: string; handleUpdatedErrorList: EventEmitter<{ id: string; message: string; }[] | null>; /** * Visible errors */ protected _visibleErrorList: import("@angular/core").WritableSignal<ErrorSummaryDOMListItem[]>; /** * Focus counter to hit the correct focus field */ private _numberOfFocusTries; /** * To enable clicking Error Summary links and then moving focus to corresponding form field. This * was needed, as not all Fudis applications use Angular Router, so alternative approach was * needed. * * @param event Original click event * @param clickedId Id of clicked link in Error Summary */ protected handleErrorClick(event: Event, clickedId: string): void; /** * Sort errors the same order they appear in the DOM */ private _sortErrorOrder; /** * Update Error Summary content with possible parent Fieldsets, Sections and Expandables * (Sections) */ private _updateSummaryContent; /** * Move focus to Error Summary if errors are visible */ private _focusToErrorSummary; private _injector; ngOnInit(): void; ngAfterViewInit(): void; static ɵfac: i0.ɵɵFactoryDeclaration<ErrorSummaryComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<ErrorSummaryComponent, "fudis-error-summary", never, { "parentComponent": { "alias": "parentComponent"; "required": true; }; "title": { "alias": "title"; "required": false; }; "formId": { "alias": "formId"; "required": true; }; }, { "handleUpdatedErrorList": "handleUpdatedErrorList"; }, never, never, false, never>; } export {};