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

    Adapter for CSS hex colour values.

    Strips whitespace, prepends # when missing, and lowercases the result. Validates that the input is a valid hex colour (#RGB, #RRGGBB, or #RRGGBBAA).

    Clicking the palette prefix icon opens a full colour-picker popup (theme palette, grid, named colours, RGBA / HSLA sliders).

    readonly adapter = new ColorTextAdapter();
    // "FF6600" → value "#ff6600"

    Implements

    Index

    Constructors

    Properties

    popupPanel: Type<InputPopupPanel<any>> = UIColorPanel

    The Angular component type to render inside the popup.

    prefixIcon: "<path d=\"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z\" /><circle cx=\"13.5\" cy=\"6.5\" r=\".5\" fill=\"currentColor\" /><circle cx=\"17.5\" cy=\"10.5\" r=\".5\" fill=\"currentColor\" /><circle cx=\"6.5\" cy=\"12.5\" r=\".5\" fill=\"currentColor\" /><circle cx=\"8.5\" cy=\"7.5\" r=\".5\" fill=\"currentColor\" />" = UIIcons.Lucide.Design.Palette

    Optional SVG icon content to display before the input.

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

    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.

    • 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>

    • 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.