@firecms/core 3.0.0-canary.103 → 3.0.0-canary.104
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 +5 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +5 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/types/collections.d.ts +6 -1
- package/dist/types/navigation.d.ts +1 -0
- package/package.json +5 -5
- package/src/form/field_bindings/ReferenceFieldBinding.tsx +5 -4
- package/src/types/collections.ts +7 -1
- package/src/types/navigation.ts +1 -0
- package/src/util/references.ts +3 -0
|
@@ -58,7 +58,8 @@ export interface EntityCollection<M extends Record<string, any> = any, UserType
|
|
|
58
58
|
* Icon key to use in this collection.
|
|
59
59
|
* You can use any of the icons in the Material specs:
|
|
60
60
|
* https://fonts.google.com/icons
|
|
61
|
-
* e.g. 'account_tree' or 'person'
|
|
61
|
+
* e.g. 'account_tree' or 'person'.
|
|
62
|
+
* Find all the icons in https://firecms.co/docs/icons
|
|
62
63
|
*/
|
|
63
64
|
icon?: string;
|
|
64
65
|
/**
|
|
@@ -270,6 +271,10 @@ export interface EntityCollection<M extends Record<string, any> = any, UserType
|
|
|
270
271
|
* Width of the side dialog (in pixels) when opening an entity in this collection.
|
|
271
272
|
*/
|
|
272
273
|
sideDialogWidth?: number | string;
|
|
274
|
+
/**
|
|
275
|
+
* Default preview properties displayed when this collection is referenced to.
|
|
276
|
+
*/
|
|
277
|
+
previewProperties?: string[];
|
|
273
278
|
}
|
|
274
279
|
/**
|
|
275
280
|
* Parameter passed to the `Actions` prop in the collection configuration.
|
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.104",
|
|
5
5
|
"description": "Awesome Firebase/Firestore-based headless open-source CMS",
|
|
6
6
|
"funding": {
|
|
7
7
|
"url": "https://github.com/sponsors/firecmsco"
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"./package.json": "./package.json"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@firecms/editor": "^3.0.0-canary.
|
|
50
|
-
"@firecms/formex": "^3.0.0-canary.
|
|
51
|
-
"@firecms/ui": "^3.0.0-canary.
|
|
49
|
+
"@firecms/editor": "^3.0.0-canary.104",
|
|
50
|
+
"@firecms/formex": "^3.0.0-canary.104",
|
|
51
|
+
"@firecms/ui": "^3.0.0-canary.104",
|
|
52
52
|
"@hello-pangea/dnd": "^16.6.0",
|
|
53
53
|
"@radix-ui/react-portal": "^1.1.1",
|
|
54
54
|
"clsx": "^2.1.1",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"dist",
|
|
101
101
|
"src"
|
|
102
102
|
],
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "df5ac9be9439d01c0acf3666fad83bc87d236eb6",
|
|
104
104
|
"publishConfig": {
|
|
105
105
|
"access": "public"
|
|
106
106
|
},
|
|
@@ -34,6 +34,7 @@ function ReferenceFieldBindingInternal({
|
|
|
34
34
|
showError,
|
|
35
35
|
isSubmitting,
|
|
36
36
|
disabled,
|
|
37
|
+
minimalistView,
|
|
37
38
|
touched,
|
|
38
39
|
autoFocus,
|
|
39
40
|
property,
|
|
@@ -82,10 +83,10 @@ function ReferenceFieldBindingInternal({
|
|
|
82
83
|
|
|
83
84
|
return (
|
|
84
85
|
<>
|
|
85
|
-
<LabelWithIcon icon={getIconForProperty(property, "small")}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
{!minimalistView && <LabelWithIcon icon={getIconForProperty(property, "small")}
|
|
87
|
+
required={property.validation?.required}
|
|
88
|
+
title={property.name}
|
|
89
|
+
className={"text-text-secondary dark:text-text-secondary-dark ml-3.5"}/>}
|
|
89
90
|
|
|
90
91
|
{!collection && <ErrorView
|
|
91
92
|
error={"The specified collection does not exist. Check console"}/>}
|
package/src/types/collections.ts
CHANGED
|
@@ -67,7 +67,8 @@ export interface EntityCollection<M extends Record<string, any> = any, UserType
|
|
|
67
67
|
* Icon key to use in this collection.
|
|
68
68
|
* You can use any of the icons in the Material specs:
|
|
69
69
|
* https://fonts.google.com/icons
|
|
70
|
-
* e.g. 'account_tree' or 'person'
|
|
70
|
+
* e.g. 'account_tree' or 'person'.
|
|
71
|
+
* Find all the icons in https://firecms.co/docs/icons
|
|
71
72
|
*/
|
|
72
73
|
icon?: string;
|
|
73
74
|
|
|
@@ -310,6 +311,11 @@ export interface EntityCollection<M extends Record<string, any> = any, UserType
|
|
|
310
311
|
* Width of the side dialog (in pixels) when opening an entity in this collection.
|
|
311
312
|
*/
|
|
312
313
|
sideDialogWidth?: number | string;
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Default preview properties displayed when this collection is referenced to.
|
|
317
|
+
*/
|
|
318
|
+
previewProperties?: string[];
|
|
313
319
|
}
|
|
314
320
|
|
|
315
321
|
/**
|
package/src/types/navigation.ts
CHANGED
package/src/util/references.ts
CHANGED
|
@@ -9,6 +9,9 @@ export function getEntityPreviewKeys(targetCollection: EntityCollection<any>,
|
|
|
9
9
|
limit = 3) {
|
|
10
10
|
const allProperties = Object.keys(targetCollection.properties);
|
|
11
11
|
let listProperties = previewProperties?.filter(p => allProperties.includes(p as string));
|
|
12
|
+
if (!listProperties && targetCollection.previewProperties) {
|
|
13
|
+
listProperties = targetCollection.previewProperties?.filter(p => allProperties.includes(p as string));
|
|
14
|
+
}
|
|
12
15
|
if (listProperties && listProperties.length > 0) {
|
|
13
16
|
return listProperties;
|
|
14
17
|
} else {
|