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

    Adapter for trimming and normalising whitespace.

    Trims leading/trailing whitespace and collapses multiple consecutive spaces into a single space. Shows an eraser prefix icon.

    readonly adapter = new TrimTextAdapter();
    // " hello world " → value "hello world"

    Implements

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    prefixIcon: "<path d=\"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21\" /><path d=\"m5.082 11.09 8.828 8.828\" />" = UIIcons.Lucide.Text.Eraser

    Optional SVG icon content to display before the input.

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

    Methods

    • 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

      Returns TextAdapterValidationResult

      Validation result with valid flag and error messages.