import { type ResolvedOption } from './use-options-resolver'; import type { ActionFieldDef } from './types'; /** * Default hint shown when a cascading picker's depended-on field is still * empty. Domain-neutral on purpose; a caller may override it per field via * `dependsHint`. */ export declare const DEFAULT_DEPENDS_HINT = "Selecciona primero el campo del que depende"; /** * Small square thumbnail for an option's `image`. When the option has no image * it falls back to a deterministic initials avatar (shared `InitialsAvatar`) * derived from `name`, so an imageless reference reads as a colored badge rather * than an empty placeholder — and rows/triggers stay aligned. `size` is in * pixels (kept small — 20–24px — so the picker reads as a list, not a gallery). * Inline style for the box dimensions: arbitrary Tailwind classes from a * federated addon don't always survive the host's class scan. */ export declare function OptionThumb({ image, name, size, }: { image?: string | null; name?: string | null; size?: number; }): import("react").JSX.Element; /** * Leading visual for an option: a photo thumbnail (FK relations with an image), * else a declared icon, else a color dot (enum/status options with a color). * Returns null when the option carries none, so plain text options stay plain. */ export declare function OptionLead({ option, size, }: { option?: Pick | null; size?: number; }): import("react").JSX.Element | null; export interface DynamicSelectFieldProps { field: ActionFieldDef; value: any; onChange: (v: any) => void; /** * Pre-resolved option for the CURRENT value (label + image/color/icon) the * caller already has — e.g. the relation sibling the table served. Lets the * trigger show the name + thumbnail for an existing value without waiting for * a lookup (which only loads once the popover opens). Matched by id == value. */ seedOption?: ResolvedOption | null; /** * Cascade scope: the current value of the field this picker `dependsOn` * (the caller resolves it from the form context). Forwarded as * `filter_value`. When the field declares a `dependsOn` and this is empty, * the picker is disabled with `dependsHint` and the current selection is * cleared. Changing it re-fetches and clears the selection. */ dependsValue?: string; /** Overrides the disabled-state hint shown while `dependsValue` is empty. */ dependsHint?: string; /** * Renders the picker as a locked, non-interactive display of the current * value's resolved label (no popover, no inline-create). Used when the value * is fixed by context — e.g. the product of a receive-goods line is dictated * by the source document, not chosen. Options are fetched eagerly (not just * on open) so the label resolves to the NAME instead of showing the raw id. */ readonly?: boolean; /** * Caller-owned options (e.g. warehouses filtered by available stock for a * dispatch line). When set, skips `/options` and filters these client-side * by the search box. Federated process modals use this so they share the * same DynamicSelect chrome without reinventing a lighter picker. */ staticOptions?: readonly ResolvedOption[] | null; /** * Render `option.description` as a trailing Badge (stock, codes, …) instead * of the default muted subtitle under the label. */ descriptionAsBadge?: boolean; /** * Hide the inline "+" create affordance even when `field.ref` is set. * Useful for static / filtered lists where creating a new record is not * meaningful in context. */ hideCreate?: boolean; /** * Pre-filled values for the record the inline "+" creates, forwarded to * the host's create modal via the `metacore:create-record` event. * Generic: any model, any fields (e.g. a mechanic picker seeding * `{ role: 'mecanico' }` on a new team user). */ createDefaults?: Record; /** * Fields of the inline-created record the user must NOT change — the * host's create modal renders them locked. Pairs with `createDefaults`. */ createLockedFields?: string[]; /** Paint trigger with destructive border when validation failed. */ invalid?: boolean; } export declare function DynamicSelectField({ field, value, onChange, seedOption, dependsValue, dependsHint, readonly, staticOptions, descriptionAsBadge, hideCreate, createDefaults, createLockedFields, invalid, }: DynamicSelectFieldProps): import("react").JSX.Element; export default DynamicSelectField; //# sourceMappingURL=dynamic-select-field.d.ts.map