@firecms/core 3.0.0-canary.190 → 3.0.0-canary.192
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/EntityEditView.d.ts +1 -2
- package/dist/core/EntityEditViewFormActions.d.ts +2 -0
- package/dist/core/SideDialogs.d.ts +4 -2
- package/dist/{core → form}/EntityForm.d.ts +6 -4
- package/dist/form/EntityFormActions.d.ts +16 -0
- package/dist/form/index.d.ts +16 -16
- package/dist/index.es.js +2391 -2292
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2783 -2684
- package/dist/index.umd.js.map +1 -1
- package/dist/types/fields.d.ts +0 -6
- package/package.json +5 -5
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +2 -10
- package/src/core/EntityEditView.tsx +14 -85
- package/src/core/EntityEditViewFormActions.tsx +198 -0
- package/src/core/EntitySidePanel.tsx +8 -1
- package/src/core/SideDialogs.tsx +16 -12
- package/src/{core → form}/EntityForm.tsx +37 -243
- package/src/form/EntityFormActions.tsx +168 -0
- package/src/form/index.tsx +16 -32
- package/src/internal/useBuildSideEntityController.tsx +0 -52
- package/src/types/fields.tsx +0 -7
|
@@ -24,7 +24,6 @@ export interface EntityEditViewProps<M extends Record<string, any>> {
|
|
|
24
24
|
parentCollectionIds: string[];
|
|
25
25
|
onValuesModified?: (modified: boolean) => void;
|
|
26
26
|
onSaved?: (params: OnUpdateParams) => void;
|
|
27
|
-
onClose?: () => void;
|
|
28
27
|
onTabChange?: (props: OnTabChangeParams<M>) => void;
|
|
29
28
|
layout?: "side_panel" | "full_screen";
|
|
30
29
|
barActions?: React.ReactNode;
|
|
@@ -34,7 +33,7 @@ export interface EntityEditViewProps<M extends Record<string, any>> {
|
|
|
34
33
|
* an entity is opened.
|
|
35
34
|
*/
|
|
36
35
|
export declare function EntityEditView<M extends Record<string, any>, USER extends User>({ entityId, ...props }: EntityEditViewProps<M>): import("react/jsx-runtime").JSX.Element;
|
|
37
|
-
export declare function EntityEditViewInner<M extends Record<string, any>>({ path, entityId, selectedTab: selectedTabProp,
|
|
36
|
+
export declare function EntityEditViewInner<M extends Record<string, any>>({ path, entityId, selectedTab: selectedTabProp, collection, parentCollectionIds, onValuesModified, onSaved, onTabChange, entity, cachedDirtyValues, dataLoading, layout, barActions, status, setStatus, }: EntityEditViewProps<M> & {
|
|
38
37
|
entity?: Entity<M>;
|
|
39
38
|
cachedDirtyValues?: Partial<M>;
|
|
40
39
|
dataLoading: boolean;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { EntityFormActionsProps } from "../form/EntityFormActions";
|
|
2
|
+
export declare function EntityEditViewFormActions({ collection, path, entity, layout, savingError, formex, disabled, status, pluginActions, openEntityMode }: EntityFormActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export type
|
|
2
|
+
export type SideDialogController = {
|
|
3
3
|
blocked: boolean;
|
|
4
4
|
setBlocked: (blocked: boolean) => void;
|
|
5
5
|
setBlockedNavigationMessage: (message?: React.ReactNode) => void;
|
|
6
6
|
width?: string;
|
|
7
7
|
close: (force?: boolean) => void;
|
|
8
|
+
pendingClose: boolean;
|
|
9
|
+
setPendingClose: (pendingClose: boolean) => void;
|
|
8
10
|
};
|
|
9
11
|
/**
|
|
10
12
|
* This hook is used to access the properties of a particular side dialog,
|
|
11
13
|
* in contrast with {@link useSideDialogsController} which handles the
|
|
12
14
|
* state of all the dialogs.
|
|
13
15
|
*/
|
|
14
|
-
export declare const useSideDialogContext: () =>
|
|
16
|
+
export declare const useSideDialogContext: () => SideDialogController;
|
|
15
17
|
/**
|
|
16
18
|
* This is the component in charge of rendering the side dialogs used
|
|
17
19
|
* for editing entities. Use the {@link useSideEntityController} to open
|
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { Entity, EntityCollection, EntityStatus, FormContext } from "../types";
|
|
3
3
|
import { FormexController } from "@firecms/formex";
|
|
4
4
|
import { ValidationError } from "yup";
|
|
5
|
+
import { EntityFormActionsProps } from "./EntityFormActions";
|
|
5
6
|
export type OnUpdateParams = {
|
|
6
7
|
entity: Entity<any>;
|
|
7
8
|
status: EntityStatus;
|
|
@@ -19,25 +20,26 @@ type EntityFormProps<M extends Record<string, any>> = {
|
|
|
19
20
|
onIdChange?: (id: string) => void;
|
|
20
21
|
onValuesModified?: (modified: boolean) => void;
|
|
21
22
|
onSaved?: (params: OnUpdateParams) => void;
|
|
22
|
-
onClose?: () => void;
|
|
23
23
|
cachedDirtyValues?: Partial<M>;
|
|
24
24
|
onFormContextReady?: (formContext: FormContext) => void;
|
|
25
25
|
forceActionsAtTheBottom?: boolean;
|
|
26
|
-
initialStatus: EntityStatus;
|
|
27
26
|
className?: string;
|
|
27
|
+
initialStatus: EntityStatus;
|
|
28
28
|
onStatusChange?: (status: EntityStatus) => void;
|
|
29
29
|
onEntityChange?: (entity: Entity<M>) => void;
|
|
30
30
|
formex?: FormexController<M>;
|
|
31
31
|
openEntityMode?: "side_panel" | "full_screen";
|
|
32
|
+
EntityFormActionsComponent?: React.FC<EntityFormActionsProps>;
|
|
32
33
|
};
|
|
33
|
-
export declare function EntityForm<M extends Record<string, any>>({ path, entityId: entityIdProp, collection, onValuesModified, onIdChange, onSaved,
|
|
34
|
+
export declare function EntityForm<M extends Record<string, any>>({ path, entityId: entityIdProp, collection, onValuesModified, onIdChange, onSaved, entity, cachedDirtyValues, onFormContextReady, forceActionsAtTheBottom, initialStatus, className, onStatusChange, onEntityChange, openEntityMode, formex: formexProp, EntityFormActionsComponent }: EntityFormProps<M>): import("react/jsx-runtime").JSX.Element;
|
|
34
35
|
export declare function yupToFormErrors(yupError: ValidationError): Record<string, any>;
|
|
35
|
-
export declare function FormLayoutInner
|
|
36
|
+
export declare function FormLayoutInner({ id, formContext, children, className, forceActionsAtTheBottom, pluginActions, EntityFormActionsComponent }: {
|
|
36
37
|
id?: string;
|
|
37
38
|
formContext: FormContext;
|
|
38
39
|
children: React.ReactNode;
|
|
39
40
|
className?: string;
|
|
40
41
|
forceActionsAtTheBottom?: boolean;
|
|
41
42
|
pluginActions?: React.ReactNode[];
|
|
43
|
+
EntityFormActionsComponent: React.FC<EntityFormActionsProps>;
|
|
42
44
|
}): import("react/jsx-runtime").JSX.Element;
|
|
43
45
|
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Entity, ResolvedEntityCollection } from "../types";
|
|
3
|
+
import { FormexController } from "@firecms/formex";
|
|
4
|
+
export interface EntityFormActionsProps {
|
|
5
|
+
collection: ResolvedEntityCollection;
|
|
6
|
+
path: string;
|
|
7
|
+
entity?: Entity;
|
|
8
|
+
layout: "bottom" | "side";
|
|
9
|
+
savingError?: Error;
|
|
10
|
+
formex: FormexController<any>;
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
status: "new" | "existing" | "copy";
|
|
13
|
+
pluginActions: React.ReactNode[];
|
|
14
|
+
openEntityMode: "side_panel" | "full_screen";
|
|
15
|
+
}
|
|
16
|
+
export declare function EntityFormActions({ collection, entity, layout, savingError, formex, disabled, status, pluginActions, openEntityMode }: EntityFormActionsProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/form/index.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export { ArrayCustomShapedFieldBinding
|
|
1
|
+
export * from "./EntityForm";
|
|
2
|
+
export { SelectFieldBinding } from "./field_bindings/SelectFieldBinding";
|
|
3
|
+
export { MultiSelectFieldBinding } from "./field_bindings/MultiSelectFieldBinding";
|
|
4
|
+
export { ArrayOfReferencesFieldBinding } from "./field_bindings/ArrayOfReferencesFieldBinding";
|
|
5
|
+
export { StorageUploadFieldBinding } from "./field_bindings/StorageUploadFieldBinding";
|
|
6
|
+
export { TextFieldBinding } from "./field_bindings/TextFieldBinding";
|
|
7
|
+
export { SwitchFieldBinding } from "./field_bindings/SwitchFieldBinding";
|
|
8
|
+
export { DateTimeFieldBinding } from "./field_bindings/DateTimeFieldBinding";
|
|
9
|
+
export { ReferenceFieldBinding } from "./field_bindings/ReferenceFieldBinding";
|
|
10
|
+
export { MapFieldBinding } from "./field_bindings/MapFieldBinding";
|
|
11
|
+
export { KeyValueFieldBinding } from "./field_bindings/KeyValueFieldBinding";
|
|
12
|
+
export { RepeatFieldBinding } from "./field_bindings/RepeatFieldBinding";
|
|
13
|
+
export { BlockFieldBinding } from "./field_bindings/BlockFieldBinding";
|
|
14
|
+
export { ReadOnlyFieldBinding } from "./field_bindings/ReadOnlyFieldBinding";
|
|
15
|
+
export { MarkdownEditorFieldBinding } from "./field_bindings/MarkdownEditorFieldBinding";
|
|
16
|
+
export { ArrayCustomShapedFieldBinding } from "./field_bindings/ArrayCustomShapedFieldBinding";
|
|
17
17
|
export * from "./components";
|
|
18
18
|
export { PropertyFieldBinding } from "./PropertyFieldBinding";
|
|
19
19
|
export * from "./useClearRestoreValue";
|