import { type LucideIcon } from 'lucide-react'; /** One searchable option: `value` is the id, `label` the display text. */ export interface EntitySelectOption { value: string; label: string; description?: string; } export interface EntitySelectProps { /** Kernel model key (e.g. "Supplier", "Warehouse", "Category"). */ model: string; /** Currently selected id (or null). */ value: string | null; /** Label of the selected record (rendered without a re-fetch). */ label: string | null; /** Called with (id, label) on select/create/clear. */ onSelect: (id: string | null, label: string | null) => void; /** Async search over the model. Callers pass their `/api/options/` fetcher. */ fetcher: (q: string, signal: AbortSignal) => Promise; icon?: LucideIcon; placeholder?: string; searchPlaceholder?: string; emptyText?: string; /** Preload first results on open and drop the 2-char gate. */ preload?: boolean; /** * Permission overrides. By default create/edit are gated by the kernel * permissions `.create` / `.update` (useCan). Pass explicit * booleans to force them (e.g. a read-only surface). */ canCreate?: boolean; canEdit?: boolean; /** * CRUD endpoint base for the create/edit dialog. Defaults to the standard * org-scoped `/data//me`, with edit at `/data//me/`. */ endpoint?: string; /** Record field used as the label after create/edit (default "name"). */ labelField?: string; /** Disable the whole control. */ disabled?: boolean; /** * Values seeded into the create dialog's form (e.g. a parent id the caller * already knows — a POS sale's selected customer, when creating a vehicle * from the vehicle picker). Passed through to `CreateRecordDialog.defaults`. */ createDefaults?: Record; /** * Field keys from `createDefaults` that must also render locked (visible, * disabled) on create instead of editable — e.g. don't let the user swap * the customer while creating their vehicle from this picker. Passed * through to `CreateRecordDialog.lockedFields`. */ lockedCreateFields?: string[]; } export declare function EntitySelect({ model, value, label, onSelect, fetcher, icon: Icon, placeholder, searchPlaceholder, emptyText, preload, canCreate, canEdit, endpoint, labelField, disabled, createDefaults, lockedCreateFields, }: EntitySelectProps): import("react").JSX.Element; //# sourceMappingURL=entity-select.d.ts.map