@firecms/core 3.0.0-canary.166 → 3.0.0-canary.167
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/index.es.js +3 -2
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +3 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/types/dialogs_controller.d.ts +6 -2
- package/dist/types/entity_actions.d.ts +6 -0
- package/package.json +5 -5
- package/src/contexts/DialogsProvider.tsx +1 -0
- package/src/core/EntityEditView.tsx +4 -1
- package/src/types/dialogs_controller.tsx +6 -2
- package/src/types/entity_actions.tsx +8 -0
|
@@ -20,7 +20,7 @@ export interface DialogsController {
|
|
|
20
20
|
* Props used to open a side dialog
|
|
21
21
|
* @group Hooks and utilities
|
|
22
22
|
*/
|
|
23
|
-
export interface DialogControllerEntryProps {
|
|
23
|
+
export interface DialogControllerEntryProps<T extends object = {}> {
|
|
24
24
|
key: string;
|
|
25
25
|
/**
|
|
26
26
|
* The component type that will be rendered
|
|
@@ -28,5 +28,9 @@ export interface DialogControllerEntryProps {
|
|
|
28
28
|
Component: React.ComponentType<{
|
|
29
29
|
open: boolean;
|
|
30
30
|
closeDialog: () => void;
|
|
31
|
-
}>;
|
|
31
|
+
} & T>;
|
|
32
|
+
/**
|
|
33
|
+
* Props to pass to the dialog component
|
|
34
|
+
*/
|
|
35
|
+
props?: T;
|
|
32
36
|
}
|
|
@@ -4,6 +4,7 @@ import { Entity } from "./entities";
|
|
|
4
4
|
import { EntityCollection, SelectionController } from "./collections";
|
|
5
5
|
import { User } from "./user";
|
|
6
6
|
import { SideEntityController } from "./side_entity_controller";
|
|
7
|
+
import { FormContext } from "./fields";
|
|
7
8
|
/**
|
|
8
9
|
* An entity action is a custom action that can be performed on an entity.
|
|
9
10
|
* They are displayed in the entity view and in the collection view.
|
|
@@ -55,4 +56,9 @@ export type EntityActionClickProps<M extends object, USER extends User = User> =
|
|
|
55
56
|
* If this actions is being called from a side dialog
|
|
56
57
|
*/
|
|
57
58
|
sideEntityController?: SideEntityController;
|
|
59
|
+
/**
|
|
60
|
+
* You can use the form context to manage the state of the form.
|
|
61
|
+
* This is only available if this action in being triggered from a form context.
|
|
62
|
+
*/
|
|
63
|
+
formContext?: FormContext<M>;
|
|
58
64
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firecms/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.0-canary.
|
|
4
|
+
"version": "3.0.0-canary.167",
|
|
5
5
|
"description": "Awesome Firebase/Firestore-based headless open-source CMS",
|
|
6
6
|
"funding": {
|
|
7
7
|
"url": "https://github.com/sponsors/firecmsco"
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
"./package.json": "./package.json"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@firecms/editor": "^3.0.0-canary.
|
|
54
|
-
"@firecms/formex": "^3.0.0-canary.
|
|
55
|
-
"@firecms/ui": "^3.0.0-canary.
|
|
53
|
+
"@firecms/editor": "^3.0.0-canary.167",
|
|
54
|
+
"@firecms/formex": "^3.0.0-canary.167",
|
|
55
|
+
"@firecms/ui": "^3.0.0-canary.167",
|
|
56
56
|
"@hello-pangea/dnd": "^17.0.0",
|
|
57
57
|
"@radix-ui/react-portal": "^1.1.2",
|
|
58
58
|
"clsx": "^2.1.1",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"dist",
|
|
107
107
|
"src"
|
|
108
108
|
],
|
|
109
|
-
"gitHead": "
|
|
109
|
+
"gitHead": "86c9b7ff34991bf0424764845936b002e1071560",
|
|
110
110
|
"publishConfig": {
|
|
111
111
|
"access": "public"
|
|
112
112
|
},
|
|
@@ -842,14 +842,17 @@ export function EntityEditViewInner<M extends Record<string, any>>({
|
|
|
842
842
|
fullPath: resolvedCollection.path,
|
|
843
843
|
collection: resolvedCollection,
|
|
844
844
|
context,
|
|
845
|
-
sideEntityController
|
|
845
|
+
sideEntityController,
|
|
846
|
+
formContext
|
|
846
847
|
});
|
|
847
848
|
}}>
|
|
848
849
|
{action.icon}
|
|
849
850
|
</IconButton>
|
|
850
851
|
))}
|
|
851
852
|
</div>}
|
|
853
|
+
|
|
852
854
|
{formex.isSubmitting && <CircularProgress size={"small"}/>}
|
|
855
|
+
|
|
853
856
|
<Button
|
|
854
857
|
variant="text"
|
|
855
858
|
disabled={disabled || formex.isSubmitting}
|
|
@@ -22,12 +22,16 @@ export interface DialogsController {
|
|
|
22
22
|
* Props used to open a side dialog
|
|
23
23
|
* @group Hooks and utilities
|
|
24
24
|
*/
|
|
25
|
-
export interface DialogControllerEntryProps {
|
|
25
|
+
export interface DialogControllerEntryProps<T extends object = {}> {
|
|
26
26
|
|
|
27
27
|
key: string;
|
|
28
28
|
/**
|
|
29
29
|
* The component type that will be rendered
|
|
30
30
|
*/
|
|
31
|
-
Component: React.ComponentType<{ open: boolean, closeDialog: () => void }>;
|
|
31
|
+
Component: React.ComponentType<{ open: boolean, closeDialog: () => void } & T>;
|
|
32
|
+
/**
|
|
33
|
+
* Props to pass to the dialog component
|
|
34
|
+
*/
|
|
35
|
+
props?: T;
|
|
32
36
|
|
|
33
37
|
}
|
|
@@ -4,6 +4,8 @@ import { Entity } from "./entities";
|
|
|
4
4
|
import { EntityCollection, SelectionController } from "./collections";
|
|
5
5
|
import { User } from "./user";
|
|
6
6
|
import { SideEntityController } from "./side_entity_controller";
|
|
7
|
+
import { FormexController } from "@firecms/formex";
|
|
8
|
+
import { FormContext } from "./fields";
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
11
|
* An entity action is a custom action that can be performed on an entity.
|
|
@@ -63,4 +65,10 @@ export type EntityActionClickProps<M extends object, USER extends User = User> =
|
|
|
63
65
|
* If this actions is being called from a side dialog
|
|
64
66
|
*/
|
|
65
67
|
sideEntityController?: SideEntityController;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* You can use the form context to manage the state of the form.
|
|
71
|
+
* This is only available if this action in being triggered from a form context.
|
|
72
|
+
*/
|
|
73
|
+
formContext?: FormContext<M>;
|
|
66
74
|
};
|