goobs-frontend
Version:
A comprehensive React-based libary for building modern web applications
50 lines • 2.3 kB
TypeScript
import { default as React } from 'react';
import { FieldStyleOverrides } from '../../Shell';
export interface ExternalIncrementNumberFieldProps {
/** Seed for the uncontrolled display (default '0'). Ignored once `value` (or a form binding) drives the field. */
initialValue?: string;
/**
* Controlled numeric value. Optional and additive: when omitted (the
* historical default) the field is uncontrolled and seeds from
* `initialValue`. When supplied — or auto-bound via `name` inside a
* `<Form>` — it drives the displayed value.
*/
value?: number;
/**
* Fires whenever the value changes (typed input or +/- button).
*
* Bug fix: previously was `() => void` with no payload — callers
* couldn't actually read the new value, which made the component
* write-only. Now passes the resulting numeric value so the caller
* can wire it up to its own state.
*/
onChange?: (value: number) => void;
label?: React.ReactNode;
helperText?: string;
/** Error message rendered below the input; sets aria-invalid. */
error?: string | boolean;
/** Stable test selector — emitted as `data-field` on the wrapper. */
dataField?: string;
/** Stable test selector — emitted as `data-field-name` on the wrapper. */
dataFieldName?: string;
placeholder?: string;
id?: string;
/**
* Form-engine binding key. Forwarded to the input as `name` for native form
* submission and used by `useFieldBinding`/`FieldShell` to auto-bind value,
* error, and required to the surrounding `<Form>`.
*/
name?: string;
styles?: FieldStyleOverrides;
}
/**
* Integer stepper built on FieldShell with − and + buttons flanking a
* centered digits-only input (one step per click, floor 0, no upper bound —
* unlike InternalIncrement there is no press-and-hold auto-repeat).
* `onChange` emits the plain numeric value — not a DOM event. Auto-binds by
* `name` inside a goobs `<Form>` (the engine stores the number); otherwise
* controlled via the numeric `value` or seeded from `initialValue`.
*/
declare const ExternalIncrementNumberField: React.FC<ExternalIncrementNumberFieldProps>;
export default ExternalIncrementNumberField;
//# sourceMappingURL=index.d.ts.map