UNPKG

@spartacus/storefront

Version:

Spartacus Storefront is a package that you can include in your application, which allows you to add default storefront features.

52 lines (51 loc) 1.94 kB
import { FormControl } from '@angular/forms'; import { Observable } from 'rxjs'; import * as i0 from "@angular/core"; /** * Renders translated form errors for a given form control, based on its `errors` property. * * The translation key consists of the optional input `prefix` * concatenated with the error key. * * And the translation params object consist of the error details * (if only it's an object) merged with the optional input object `translationParams`. */ export declare class FormErrorsComponent { _control: FormControl; /** * @deprecated since 4.1 - use `errorsDetails$` instead, which contains not only * the error key, but also the error details */ errors$: Observable<string[]>; /** * Emits an array of errors, each represented by a tuple: * the error key and error details. */ errorsDetails$: Observable<Array<[string, string]>>; /** * Prefix prepended to the translation key. */ prefix: string; /** * Translation params to enrich the error details object. */ translationParams: { [key: string]: string; }; set control(control: FormControl); get control(): FormControl; /** * Returns translation params composed of * the argument `errorDetails` (if only is an object) merged with * the component input object `translationParams`. * * In case of a conflicting object key, the value from * `translationParams` takes precedence. */ getTranslationParams(errorDetails?: any): object; get invalid(): boolean; get dirty(): boolean; get touched(): boolean; static ɵfac: i0.ɵɵFactoryDeclaration<FormErrorsComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<FormErrorsComponent, "cx-form-errors", never, { "prefix": "prefix"; "translationParams": "translationParams"; "control": "control"; }, {}, never, never>; }