import * as _angular_core from '@angular/core'; import { Signal, AfterContentInit, OnDestroy, ChangeDetectorRef, OnInit, ElementRef, Renderer2, ViewContainerRef } from '@angular/core'; import { BooleanInput } from '@angular/cdk/coercion'; import { NxErrorComponent } from '@aposin/ng-aquila/base'; import { Subject, Observable } from 'rxjs'; import * as i1 from '@angular/common'; import * as i2 from '@aposin/ng-aquila/input'; import * as i3 from '@aposin/ng-aquila/popover'; import { NxPopoverComponent } from '@aposin/ng-aquila/popover'; import { Overlay, OverlayPositionBuilder } from '@angular/cdk/overlay'; import { NxDropdownComponent } from '@aposin/ng-aquila/dropdown'; import { NxFormfieldControl } from '@aposin/ng-aquila/formfield'; declare abstract class NaturalLanguageFormErrorWrapper { abstract readonly _errorId: Signal; } /** Size of the NLF. */ type NxNaturalLanguageFormSize = 'small' | 'large'; declare class NxNaturalLanguageFormComponent implements AfterContentInit, OnDestroy, NaturalLanguageFormErrorWrapper { private readonly _cdr; /** Whether the negative set of stylings should be used. */ set negative(value: BooleanInput); get negative(): BooleanInput; private _negative; private _injector; /** * Sets the size of the NLF. Default value: large. */ set size(value: NxNaturalLanguageFormSize); get size(): NxNaturalLanguageFormSize; /** @docs-private */ private _size; /** @docs-private */ readonly resizeEvent$: Subject; /** @docs-private */ resizeObservable: Observable; protected readonly _errorComponent: _angular_core.Signal; /** * @docs-private * The id of the error component. This is referenced by the word components in case of an error and no provided describedBy value */ readonly _errorId: _angular_core.Signal; /** * All nx-word content children. */ private readonly _wordsComponents; /** * Readable Signal of collective nx-word error states * @returns `true` if at least one word has an error. `false` if no word as an error. */ protected readonly wordsErrorStates: _angular_core.Signal; private readonly _destroyed; constructor(_cdr: ChangeDetectorRef); /** @docs-private */ onResize(event: Event): void; ngAfterContentInit(): void; /** @docs-private */ resizeWords(): void; ngOnDestroy(): void; /** @docs-private */ updatePositionPopovers(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } /** Type to determine the minimal width of a word. */ type SIZES = 'regular' | 'short' | 'long'; declare class NxWordComponent implements AfterContentInit, OnDestroy, OnInit { /** @docs-private */ readonly elementRef: ElementRef; private readonly _cdr; private readonly _renderer; private readonly _overlay; private readonly _viewContainerRef; private readonly _overlayPositionBuilder; private readonly _nlfErrorWrapper; private static _labelKey; protected labelId: string; private measureCanvas; /** @docs-private */ readonly inputChanges: Subject; /** @docs-private */ readonly _hasErrors: _angular_core.WritableSignal; private _overlayRef?; private _embeddedViewRef?; private _overlayState; /** * @docs-private * Used by the autocomplete and should be moved to signals entirely */ _control: NxFormfieldControl; protected readonly control: _angular_core.Signal>; /** * @docs-private * We should not set `for` and also use `aria-labelledby` at the same time. * For some components that automatically render label and connect it to the input, this will cause issues otherwise. * This is a workaround for the issue that we cannot set `aria-labelledby` on the input directly and to not introduce breaking changes. */ private readonly _setAriaLabelledBy; private readonly _errorChildren; _popover: NxPopoverComponent; _dropdown: NxDropdownComponent; /** @docs-private */ currentTextWidth: number; /** Provide a hint for a minimal width. The actual size will be determined for inputs for each change. */ size: SIZES; /** * A word doesn't have a set place to show labels. * In order to be accessible, you have to provide a label with this property. * It will be attached to the given input through `aria-label`. */ label: string; /** * Sets the `aria-describedby` for the formfield. * Should be used to refer to the individual error message. * * If not set it will be set to the id of the entire error message or the error message inside the nx-word (deprecated) * * Should be space seperated list of `id`s. */ describedByInput: _angular_core.InputSignal; describedBy: _angular_core.Signal; describedByEffect: _angular_core.EffectRef; private readonly _destroyed; constructor( /** @docs-private */ elementRef: ElementRef, _cdr: ChangeDetectorRef, _renderer: Renderer2, _overlay: Overlay, _viewContainerRef: ViewContainerRef, _overlayPositionBuilder: OverlayPositionBuilder, _nlfErrorWrapper: NaturalLanguageFormErrorWrapper); ngOnInit(): void; ngAfterContentInit(): void; private readonly _updatePopoverStateEffect; ngOnDestroy(): void; /** * Calculate the width of the full text given by the input, that value is bound to this component so it can grow. * * The involved input is known to have a width of 100% an will fit the additional space given which completes the auto growing behavior. * @docs-private */ updateCurrentTextWidth(): void; /** @docs-private */ repositionError(): void; /** @docs-private */ getConnectedOverlayOrigin(): ElementRef; /** @docs-private */ get isFocused(): boolean; /** @docs-private */ get isFilled(): boolean; /** @docs-private */ get hasDropdown(): boolean; updateErrorPopoverState(): void; setupErrorPopover(): void; private positionArrow; showPopover(): void; hidePopover(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class NxNaturalLanguageFormModule { static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵmod: _angular_core.ɵɵNgModuleDeclaration; static ɵinj: _angular_core.ɵɵInjectorDeclaration; } export { NxNaturalLanguageFormComponent, NxNaturalLanguageFormModule, NxWordComponent }; export type { NxNaturalLanguageFormSize, SIZES };