UNPKG

@abgov/angular-components

Version:

Government of Alberta - UI components for Angular

59 lines (58 loc) 2.69 kB
import { Spacing } from "@abgov/ui-components-common"; import { ControlValueAccessor } from "@angular/forms"; import * as i0 from "@angular/core"; export declare abstract class GoabBaseComponent { mt?: Spacing; mb?: Spacing; ml?: Spacing; mr?: Spacing; testId?: string; static ɵfac: i0.ɵɵFactoryDeclaration<GoabBaseComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<GoabBaseComponent, "ng-component", never, { "mt": { "alias": "mt"; "required": false; }; "mb": { "alias": "mb"; "required": false; }; "ml": { "alias": "ml"; "required": false; }; "mr": { "alias": "mr"; "required": false; }; "testId": { "alias": "testId"; "required": false; }; }, {}, never, never, true, never>; } export declare abstract class GoabControlValueAccessor extends GoabBaseComponent implements ControlValueAccessor { id?: string; disabled?: boolean; error?: boolean; value?: unknown | null | undefined; /** * Function to handle changes in the form control value. * @param {unknown} value - The new value. */ fcChange?: (value: unknown) => void; /** * Function to handle touch events on the form control. */ fcTouched?: () => unknown; private touched; /** * Marks the component as touched. If the component is not already marked as touched, * it triggers the `fcTouched` callback (if defined) and sets the `touched` property to `true`. */ markAsTouched(): void; /** * Writes a new value to the form control. * @param {unknown} value - The value to write. */ writeValue(value: unknown): void; /** * Registers a function to call when the form control value changes. * @param {function} fn - The function to call. */ registerOnChange(fn: any): void; /** * Registers a function to call when the form control is touched. * @param {function} fn - The function to call. */ registerOnTouched(fn: any): void; /** * Sets the disabled state of the component. * * @param isDisabled - A boolean indicating whether the component should be disabled. */ setDisabledState?(isDisabled: boolean): void; static ɵfac: i0.ɵɵFactoryDeclaration<GoabControlValueAccessor, never>; static ɵcmp: i0.ɵɵComponentDeclaration<GoabControlValueAccessor, "ng-component", never, { "id": { "alias": "id"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "error": { "alias": "error"; "required": false; }; "value": { "alias": "value"; "required": false; }; }, {}, never, never, true, never>; static ngAcceptInputType_disabled: unknown; static ngAcceptInputType_error: unknown; }