import * as i0 from '@angular/core'; import { AfterContentInit, AfterContentChecked, AfterViewInit, ElementRef, ChangeDetectorRef } from '@angular/core'; import * as i3 from '@daffodil/design'; import { DaffPrefixDirective, DaffSuffixDirective, DaffFormLabelDirective } from '@daffodil/design'; import * as i2 from '@daffodil/design/form'; import { DaffFormFieldLabelDirective, DaffHintComponent, DaffErrorMessageComponent } 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`. */ declare class DaffFormFieldActionDirective { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } interface DaffFormFieldState { focused: boolean; filled: boolean; disabled: boolean; error: boolean; valid: boolean; } /** * 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. */ declare abstract class DaffFormFieldControl { ngControl: NgControl | null; /** * The type of the control (e.g., 'input', 'select', 'textarea'). * Used to apply control-specific styling or behavior. */ abstract readonly controlType?: any; /** * 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; /** * 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 DaffFormFieldApperanace = 'fluid' | 'fixed'; /** * DaffFormFieldComponent is a wrapping component that provides consistent styling and behavior for form control elements. */ declare class DaffFormFieldComponent implements AfterContentInit, AfterContentChecked, AfterViewInit { private cd; elementRef: ElementRef; /** @docs-private */ get isNativeSelect(): boolean; constructor(cd: ChangeDetectorRef, elementRef: ElementRef); /** @docs-private */ _prefix: DaffPrefixDirective; /** @docs-private */ _suffix: DaffSuffixDirective; /** * @docs-private * * The child form control that the form field manages. */ _control: DaffFormFieldControl; /** * @docs-private * @deprecated Deprecated in version 0.86.0. Will be removed in version 1.0.0. */ _formLabelDirective: DaffFormLabelDirective; /** * @docs-private */ _formFieldLabelDirective: DaffFormFieldLabelDirective; /** * @docs-private */ _action: DaffFormFieldActionDirective; /** * @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: boolean; /** * @docs-private * * Tracking property to keep a record of whether or not the * form field contains any user input. */ isFilled: boolean; /** * @docs-private * * Tracking property to keep a record of whether or not the * form field should be marked as disabled. */ isDisabled: boolean; /** * @docs-private * * Tracking property to keep a record of whether or not the * form field should be marked as valid. */ isValid: boolean; /** * @docs-private * * Determines whether or not the form field should display its focused state. */ get isFocused(): boolean; /** * @docs-private */ get isRaised(): boolean; private _appearance; /** * The appearance of the form field. Defaults to `fluid`. */ get appearance(): DaffFormFieldApperanace; set appearance(value: DaffFormFieldApperanace); /** * @docs-private */ get isFixed(): boolean; /** * 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 `