@theredhead — Frontend Library - v1.0.0
    Preparing search index...

    Interface PopupTextAdapter

    Extension of TextAdapter that provides a popup panel component.

    When a PopupTextAdapter is attached to UIInput, the input renders a suffix icon that toggles an absolutely-positioned popup containing the adapter's popupPanel component.

    readonly dateAdapter = new DateInputAdapter({ format: 'dd/MM/yyyy' });
    
    <ui-input [adapter]="dateAdapter" [(text)]="dateText" placeholder="dd/MM/yyyy" />
    
    interface PopupTextAdapter {
        inputType?: string;
        popupPanel: Type<InputPopupPanel<any>>;
        prefixIcon?: string;
        suffixIcon?: string;
        fromPopupValue(value: unknown): string;
        onPrefixClick?(text: string): void;
        onSuffixClick?(text: string): void;
        popupInputs?(currentText: string): Record<string, unknown>;
        toDisplayValue?(value: string): string;
        toValue(text: string): string;
        validate?(text: string): TextAdapterValidationResult;
    }

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    inputType?: string

    Optional HTML input type attribute value.

    When set, this overrides the type input on UIInput so the adapter can request the semantically correct native input type (e.g. "email", "tel", "url").

    popupPanel: Type<InputPopupPanel<any>>

    The Angular component type to render inside the popup.

    prefixIcon?: string

    Optional SVG icon content to display before the input.

    Should be a Lucide SVG inner-content string (e.g. UIIcons.Lucide.Text.AtSign).

    suffixIcon?: string

    Optional SVG icon content to display after the input.

    Methods

    • Convert a value emitted by the popup panel's valueSelected output into the raw text string for the input.

      Parameters

      • value: unknown

        The value emitted by the panel.

      Returns string

      Formatted text string.

    • Called when the user clicks the prefix icon.

      Parameters

      • text: string

        Current raw text value.

      Returns void

    • Called when the user clicks the suffix icon.

      Parameters

      • text: string

        Current raw text value.

      Returns void

    • Returns a map of inputs to set on the popup panel component.

      Called each time the popup opens. The currentText parameter carries the current raw text from the input so the adapter can forward it to the panel (e.g. as currentValue).

      Parameters

      • currentText: string

        Raw text currently in the input.

      Returns Record<string, unknown>

    • Optional display formatter.

      When present, the native input element shows the string returned by this method instead of the raw toValue result. Use this to add locale-specific formatting (e.g. thousands separators) while keeping value() as the clean programmatic output.

      Parameters

      • value: string

        The adapted value produced by toValue.

      Returns string

      Formatted string to display in the input element.

    • Transform the raw text into the adapted value.

      Called on every input event. The result is stored in the value model and written back to the native input element, so the user sees the adapted text. The original keystrokes are preserved in the text model.

      Parameters

      • text: string

        Raw text from the input element.

      Returns string

      Adapted value string (displayed in the field and emitted via value).

    • Validate the raw text and return a result indicating whether the current input is valid.

      When present, UIInput exposes a valid signal and applies the invalid host class when validation fails.

      Parameters

      • text: string

        Raw text from the input element.

      Returns TextAdapterValidationResult

      Validation result with valid flag and error messages.