SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Interface FormulaInputParts

    What useFormulaInputParts hands a field chrome. Wire the three refs (the positioned container is the overlay's containing block; the input is what gets measured), spread FormulaInputParts.inputHandlers onto the <input> (merging with the chrome's own), make the input's glyphs transparent while FormulaInputParts.overlayActive, and render FormulaInputParts.overlayElement inside the container and FormulaInputParts.tipElement anywhere (it portals to document.body).

    interface FormulaInputParts {
        containerRef: RefObject<HTMLDivElement | null>;
        hintElement: ReactNode;
        inputElRef: RefObject<HTMLInputElement | null>;
        inputExpected: boolean;
        inputHandlers: {
            onDragStart: (e: DragEvent) => void;
            onMouseLeave: () => void;
            onMouseMove: (e: MouseEvent) => void;
            onPointerDown: (e: PointerEvent) => void;
            onScroll: (e: UIEvent<HTMLInputElement>) => void;
            onSelect: (e: SyntheticEvent) => void;
        };
        overlayActive: boolean;
        overlayElement: ReactNode;
        tipElement: ReactNode;
        handleKeyDown(e: KeyboardEvent): boolean;
    }
    Index
    containerRef: RefObject<HTMLDivElement | null>

    Attach to the position: relative container — the overlay's containing block.

    hintElement: ReactNode

    The hint float (function autocomplete + signature preview). Render anywhere in the chrome.

    inputElRef: RefObject<HTMLInputElement | null>

    Attach to the real <input> (alongside api.inputProps.ref).

    inputExpected: boolean

    'formula' grammar, while engaged: an operand is expected at the caret (the "input expected" marker is showing — trailing =A1+|, or a cleared argument =SUM(|,A1:C3)). The user is 99% mid-typing — chromes should NOT present api.error as "invalid" while this holds (the commit gate still blocks an incomplete accept). Only while the input has focus: text left that way is an error, even though a blur while pointing keeps the field engaged.

    inputHandlers: {
        onDragStart: (e: DragEvent) => void;
        onMouseLeave: () => void;
        onMouseMove: (e: MouseEvent) => void;
        onPointerDown: (e: PointerEvent) => void;
        onScroll: (e: UIEvent<HTMLInputElement>) => void;
        onSelect: (e: SyntheticEvent) => void;
    }

    Handlers for the <input> — scroll sync, hover eval hit-testing, caret tracking.

    Type Declaration

    • onDragStart: (e: DragEvent) => void

      A press on the field means "select", never "move the text" — see useTextSelectionDrag.

    • onMouseLeave: () => void
    • onMouseMove: (e: MouseEvent) => void
    • onPointerDown: (e: PointerEvent) => void

      Clicking back into the field re-summons a dismissed hint popup (Excel-style).

    • onScroll: (e: UIEvent<HTMLInputElement>) => void
    • onSelect: (e: SyntheticEvent) => void

      Chain AFTER api.inputProps.onSelect — tracks the caret for the paren-pair emphasis.

    overlayActive: boolean

    true while the coloring overlay paints the glyphs — the input's own text should go color: transparent (keep the caret via caretColor).

    overlayElement: ReactNode

    The measured coloring overlay (null while inactive/unmeasured). Render inside the container.

    tipElement: ReactNode

    The hover eval bubble, portaled to document.body (null when nothing is hovered).

    • The shared parts' keyboard: the hint popup's (autocomplete list nav; Escape dismisses an open popup without cancelling) plus F9 (evaluate in place). Chromes call this FIRST in their onKeyDown — true = consumed.

      Parameters

      • e: KeyboardEvent

      Returns boolean