import { type ResolvedOption } from './use-options-resolver'; import type { ActionFieldDef } from './types'; export { OptionLead, OptionThumb } from './record-picker-option'; /** * 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"; /** Label of a held value whose record no longer exists (or is not visible). */ export declare const DELETED_RECORD_LABEL = "(registro eliminado)"; export interface DynamicSelectFieldProps { field: ActionFieldDef; value: any; onChange: (v: any) => void; /** Opción completa recién elegida (incluye `meta` para autollenar columnas hermanas). */ onPick?: (opt: ResolvedOption) => 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/edit affordances (joined "+" / pencil and the * "Crear …" list footer) 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; /** * Picker context for the declarative option display's contributed * metrics (`?ctx.=`), e.g. `{ warehouse_id }` of the document being * edited so the product stock is the one of that warehouse. */ optionsContext?: Record; } /** * Declarative `dynamic_select` (manifest `ref` / `optionsConfig.source`) on top * of the shared {@link RecordPicker}: options from the canonical options * endpoint (`useOptionsResolver`: option_filter, options[].when keep-value, * cascade `filter_value`), inline create/edit through the host modal events. */ export declare function DynamicSelectField({ field, value, onChange, onPick, seedOption, dependsValue, dependsHint, readonly, staticOptions, descriptionAsBadge, hideCreate, createDefaults, createLockedFields, invalid, optionsContext, }: DynamicSelectFieldProps): import("react").JSX.Element; export default DynamicSelectField; //# sourceMappingURL=dynamic-select-field.d.ts.map