UNPKG

@firecms/core

Version:

Awesome Firebase/Firestore-based headless open-source CMS

52 lines (51 loc) 2.08 kB
import React from "react"; import { Entity, EntityCollection, EntityStatus, User } from "../types"; import { EntityFormProps } from "../form"; export declare const MAIN_TAB_VALUE = "__main_##Q$SC^#S6"; export declare const JSON_TAB_VALUE = "__json"; export type OnUpdateParams = { entity: Entity<any>; status: EntityStatus; path: string; entityId?: string; selectedTab?: string; collection: EntityCollection<any>; }; export type OnTabChangeParams<M extends Record<string, any>> = { path: string; entityId?: string; selectedTab?: string; collection: EntityCollection<M>; }; export interface EntityEditViewProps<M extends Record<string, any>> { path: string; /** * The navigation path to the entity. */ fullIdPath?: string; collection: EntityCollection<M>; entityId?: string; databaseId?: string; copy?: boolean; selectedTab?: string; parentCollectionIds: string[]; onValuesModified?: (modified: boolean) => void; onSaved?: (params: OnUpdateParams) => void; onTabChange?: (props: OnTabChangeParams<M>) => void; layout?: "side_panel" | "full_screen"; barActions?: React.ReactNode; formProps?: Partial<EntityFormProps<M>>; } /** * This is the default view that is used as the content of a side panel when * an entity is opened. */ export declare function EntityEditView<M extends Record<string, any>, USER extends User>({ entityId, ...props }: EntityEditViewProps<M>): import("react/jsx-runtime").JSX.Element; export declare function EntityEditViewInner<M extends Record<string, any>>({ path, fullIdPath, entityId, selectedTab: selectedTabProp, collection, parentCollectionIds, onValuesModified, onSaved, onTabChange, entity, cachedDirtyValues, dataLoading, layout, barActions, status, setStatus, formProps, canEdit }: EntityEditViewProps<M> & { entity?: Entity<M>; cachedDirtyValues?: Partial<M>; dataLoading: boolean; status: EntityStatus; setStatus: (status: EntityStatus) => void; canEdit?: boolean; }): import("react/jsx-runtime").JSX.Element;