import { type DynamicRelationStrings } from './dynamic-relation'; import type { RelationMeta } from './types'; export interface DynamicRelationsProps { /** * The parent record. Its `id` (or `parentIdKey`) seeds every child list's * foreign-key filter. Null/undefined → renders nothing (loading guard). */ record: { id?: string | number; [k: string]: unknown; } | null | undefined; /** The relations to render — typically `metadata.relations`. */ relations: RelationMeta[] | null | undefined; /** * Which field of `record` holds the parent id. Default `'id'`. Lets a host * key relations off a non-`id` primary key. */ parentIdKey?: string; /** Wrapper className for the whole stack. */ className?: string; /** Per-panel wrapper className. */ panelClassName?: string; /** * Permisos propagados a cada panel. Default true. A host can lock the whole * detail page read-only by passing canCreate/canDelete/canEdit = false. */ canCreate?: boolean; canDelete?: boolean; canEdit?: boolean; /** Translatable strings forwarded to each DynamicRelation. */ strings?: Partial; /** * True cuando estos paneles se renderizan como sub-tablas de líneas dentro * del MODAL de vista de un registro. Propaga `lineSubtable` a cada * `` para ocultar por defecto las columnas de auditoría/ * sistema redundantes bajo el padre. Default false — una página de detalle * autónoma conserva todas las columnas. */ lineSubtable?: boolean; /** * Solo renderiza las relaciones de COMPOSICIÓN — las que el kernel marca * con `embed: true` (las líneas de un documento). Es lo que usan los MODALES * de registro: antes embebían TODAS las relaciones one_to_many del modelo, * así que abrir "Editar Almacén" arrastraba miles de existencias y traspasos * al formulario. Las relaciones no embebidas siguen accesibles desde su * propia página / la vista de detalle, que renderiza el listado completo. * * Default false: una página de detalle autónoma sigue mostrando todas. * Una relación sin `embed` (kernel viejo) NO se embebe — el gate falla del * lado seguro. */ embedOnly?: boolean; /** Bubble up when any panel's data changes (create/delete/attach/detach). */ onChange?: (relation: RelationMeta) => void; } /** * Normalizes the parent id off the record, tolerating a custom `parentIdKey`. * Returns `undefined` when unusable so callers can guard rendering. */ export declare function resolveParentId(record: { [k: string]: unknown; } | null | undefined, parentIdKey?: string): string | number | undefined; /** * Merges a relation's static `scope` with its foreign-key entry into the flat * `filters` map `` expects. The FK is included so a panel that * only consumes `filters` (rather than the dedicated `foreignKey` prop) stays * correctly scoped; `` already de-dups the FK so passing it in * both places is safe. */ export declare function buildRelationFilters(relation: Pick, parentId: string | number): Record; /** * ¿La relación es de COMPOSICIÓN (embebible en un modal)? Solo `embed: true` * califica: la ausencia del flag — un kernel viejo que todavía no lo sirve — * significa NO embeber, que es el lado seguro (el costo de un falso negativo * es un panel de menos en el modal; el de un falso positivo, miles de filas * dentro de un formulario). */ export declare function isEmbedded(rel: Pick): boolean; export declare function DynamicRelations({ record, relations, parentIdKey, className, panelClassName, canCreate, canDelete, canEdit, strings, lineSubtable, embedOnly, onChange, }: DynamicRelationsProps): import("react").JSX.Element | null; //# sourceMappingURL=dynamic-relations.d.ts.map