import * as i0 from "@angular/core"; import { AfterContentChecked, AfterContentInit, AfterViewInit, ChangeDetectorRef, ElementRef } from "@angular/core"; import * as i1 from "@daffodil/design"; import { DaffPrefixDirective, DaffSuffixDirective } from "@daffodil/design"; import * as i2 from "@daffodil/design/form"; import { DaffErrorMessageComponent, DaffFormFieldLabelDirective, DaffHintComponent } from "@daffodil/design/form"; import { NgControl } from "@angular/forms"; import { BehaviorSubject, Observable } from "rxjs"; /** * DaffFormFieldActionDirective marks an element, typically a button, as an action attached to a form control inside `DaffFormFieldComponent`. */ export declare class DaffFormFieldActionDirective { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } interface DaffFormFieldState { focused: boolean; filled: boolean; disabled: boolean; error: boolean; valid: boolean; } /** * The types of controls that can be used inside a form field. * - 'input': A control that the user types into, like an input or a textarea. * - 'dropdown': A control that opens a list of options, like a select. */ export declare enum DaffFormFieldControlTypesEnum { Input = "input", Dropdown = "dropdown" } /** * Form controls must extend this class to be used inside `DaffFormFieldComponent`. * * > **Note** * > The control is defined as an abstract class instead of an interface to support Angular's dependency injection. Interfaces are erased during TypeScript compilation and cannot be used as DI tokens. * > * > By using an abstract class, the Angular DI container can match the class token for injection. */ export declare abstract class DaffFormFieldControl { ngControl: NgControl | null; /** * The type of the control. Used to apply control-specific styling or behavior. */ abstract readonly controlType?: DaffFormFieldControlTypesEnum; /** * Whether the control supports automatic label behavior. * When `true`, the form field will associate the label with the control using `for` and `id` attributes. * * Defaults to `true`. */ readonly supportsAutoLabelling?: boolean; /** * Whether the control currently has focus. */ abstract readonly focused: boolean; /** * Whether the control is required for form validation. */ abstract readonly required: boolean; /** * Whether the control is disabled. */ abstract readonly disabled: boolean; /** * The unique identifier for the control element. */ readonly id?: string; /** * Whether the label should be in the raised position. * By default, matches the focused state. */ get raised(): boolean; /** * Whether the control is currently open. Only relevant for controls * that expand, like dropdowns. * * Defaults to `false`. */ get opened(): boolean; /** * Sets focus on the control. * * @param event - Optional event that triggers the focus. */ abstract focus(event?: Event): void; /** * The current value of the control. */ abstract readonly value: T; constructor(ngControl: NgControl | null); /** * Computes the current state of the form field control. * Combines control properties and form validation state. */ get state(): DaffFormFieldState; _stateChanges: BehaviorSubject<{ focused: boolean; filled: boolean; disabled: boolean; error: boolean; valid: boolean; }>; /** * Observable stream of state changes for the form field control. */ stateChanges: Observable; /** * Emits the current state. */ emitState(deferred?: boolean): void; } type DaffFormFieldAppearance = 'fluid' | 'fixed'; declare enum DaffFormFieldAppearanceEnum { Fluid = "fluid", Fixed = "fixed" } /** * DaffFormFieldComponent is a wrapping component that provides consistent styling and behavior for form control elements. */ export declare class DaffFormFieldComponent implements AfterContentInit, AfterContentChecked, AfterViewInit { private cd; elementRef: ElementRef; /** @docs-private */ isDropdown: import("@angular/core").Signal; constructor(cd: ChangeDetectorRef, elementRef: ElementRef); /** * @docs-private * * The element that wraps the form field's control. Useful as an anchor for * controls that need to position content relative to the control itself, * rather than the entire form field. */ _wrapper: import("@angular/core").Signal>; /** @docs-private */ _prefix: import("@angular/core").Signal; /** @docs-private */ _suffix: import("@angular/core").Signal; /** * @docs-private * * The child form control that the form field manages. */ _control: import("@angular/core").Signal>; /** * @docs-private */ _formFieldLabelDirective: import("@angular/core").Signal; /** * @docs-private */ _action: import("@angular/core").Signal; /** * @docs-private */ private _hint; /** * @docs-private */ private _error; /** * @docs-private * * Tracking property to keep a record of whether or not the * form field should be marked as error. */ isError: import("@angular/core").WritableSignal; /** * @docs-private * * Tracking property to keep a record of whether or not the * form field contains any user input. */ isFilled: import("@angular/core").WritableSignal; /** * @docs-private * * Tracking property to keep a record of whether or not the * form field should be marked as disabled. */ isDisabled: import("@angular/core").WritableSignal; /** * @docs-private * * Tracking property to keep a record of whether or not the * form field should be marked as valid. */ isValid: import("@angular/core").WritableSignal; /** * @docs-private * * Determines whether or not the form field should display its focused state. */ get isFocused(): boolean; /** * @docs-private */ get isRaised(): boolean; /** * @docs-private * * Determines whether or not the form field should display its open state. */ get isOpen(): boolean; /** * The appearance of the form field. Defaults to `fluid`. */ appearance: import("@angular/core").InputSignalWithTransform; /** * @docs-private */ isFixed: import("@angular/core").Signal; /** * The unique id of the form field. Defaults to an autogenerated value. When using this, * it's your responsibility to ensure that the id for each form field is unique. * * It gets assigned to the `for` attribute on the `