@firecms/core 3.0.0-canary.104 → 3.0.0-canary.105
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 +19 -18
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +18 -17
- package/dist/index.umd.js.map +1 -1
- package/package.json +5 -5
- package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +10 -9
- package/src/components/ReferenceTable/ReferenceSelectionTable.tsx +1 -5
- package/src/form/field_bindings/ReferenceFieldBinding.tsx +15 -11
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.105",
|
|
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.105",
|
|
50
|
+
"@firecms/formex": "^3.0.0-canary.105",
|
|
51
|
+
"@firecms/ui": "^3.0.0-canary.105",
|
|
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": "e5b79b1a4af2fd750b9e8c8f73052322aa3e86ab",
|
|
104
104
|
"publishConfig": {
|
|
105
105
|
"access": "public"
|
|
106
106
|
},
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import React, { useCallback
|
|
1
|
+
import React, { useCallback } from "react";
|
|
2
2
|
import equal from "react-fast-compare"
|
|
3
3
|
|
|
4
|
-
import { ReferencePreview } from "../../../preview";
|
|
4
|
+
import { EmptyValue, ReferencePreview } from "../../../preview";
|
|
5
5
|
import { CollectionSize, Entity, EntityCollection, EntityReference, FilterValues } from "../../../types";
|
|
6
6
|
|
|
7
7
|
import { getPreviewSizeFrom } from "../../../preview/util";
|
|
8
8
|
import { getReferenceFrom } from "../../../util";
|
|
9
9
|
import { useCustomizationController, useNavigationController, useReferenceDialog } from "../../../hooks";
|
|
10
10
|
import { ErrorView } from "../../ErrorView";
|
|
11
|
-
import {
|
|
11
|
+
import { cls } from "@firecms/ui";
|
|
12
12
|
import { EntityPreviewContainer } from "../../EntityPreview";
|
|
13
13
|
|
|
14
14
|
type TableReferenceFieldProps = {
|
|
@@ -151,13 +151,14 @@ export const TableReferenceFieldSuccess = React.memo(
|
|
|
151
151
|
{internalValue && multiselect && buildMultipleReferenceField()}
|
|
152
152
|
|
|
153
153
|
{valueNotSet &&
|
|
154
|
-
<
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
154
|
+
<EntityPreviewContainer className={cls("p-4 text-sm font-medium flex items-center gap-4 uppercase",
|
|
155
|
+
disabled
|
|
156
|
+
? "text-slate-500"
|
|
157
|
+
: "cursor-pointer text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-gray-800 group-hover:bg-slate-50 dark:group-hover:bg-gray-800")}
|
|
158
|
+
onClick={handleOpen}
|
|
159
|
+
size={"medium"}>
|
|
159
160
|
Edit {title}
|
|
160
|
-
</
|
|
161
|
+
</EntityPreviewContainer>}
|
|
161
162
|
|
|
162
163
|
</div>
|
|
163
164
|
);
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
} from "../../hooks";
|
|
17
17
|
import { ErrorView } from "../ErrorView";
|
|
18
18
|
import { AddIcon, Button, DialogActions, Typography } from "@firecms/ui";
|
|
19
|
-
import { canCreateEntity,
|
|
19
|
+
import { canCreateEntity, resolveCollection } from "../../util";
|
|
20
20
|
import { useSelectionController } from "../EntityCollectionView/useSelectionController";
|
|
21
21
|
import { useColumnIds, useTableSearchHelper } from "../common";
|
|
22
22
|
import { useSideDialogContext } from "../../core";
|
|
@@ -247,7 +247,6 @@ export function ReferenceSelectionTable<M extends Record<string, any>>(
|
|
|
247
247
|
error={"Could not find collection with id " + collection}/>
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
251
250
|
const resolvedCollection = useMemo(() => resolveCollection({
|
|
252
251
|
collection: collection,
|
|
253
252
|
path: fullPath,
|
|
@@ -255,10 +254,8 @@ export function ReferenceSelectionTable<M extends Record<string, any>>(
|
|
|
255
254
|
fields: customizationController.propertyConfigs
|
|
256
255
|
}), [collection, customizationController.propertyConfigs, fullPath]);
|
|
257
256
|
|
|
258
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
259
257
|
const displayedColumnIds = useColumnIds(resolvedCollection, false);
|
|
260
258
|
|
|
261
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
262
259
|
const tableController = useDataSourceEntityCollectionTableController<M>({
|
|
263
260
|
fullPath,
|
|
264
261
|
collection,
|
|
@@ -272,7 +269,6 @@ export function ReferenceSelectionTable<M extends Record<string, any>>(
|
|
|
272
269
|
onTextSearchClick,
|
|
273
270
|
textSearchEnabled
|
|
274
271
|
} =
|
|
275
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
276
272
|
useTableSearchHelper({
|
|
277
273
|
collection,
|
|
278
274
|
fullPath,
|
|
@@ -5,10 +5,11 @@ import { useNavigationController, useReferenceDialog } from "../../hooks";
|
|
|
5
5
|
import { ReadOnlyFieldBinding } from "./ReadOnlyFieldBinding";
|
|
6
6
|
import { FieldHelperText, LabelWithIcon } from "../components";
|
|
7
7
|
import { ErrorView } from "../../components";
|
|
8
|
-
import { ReferencePreview } from "../../preview";
|
|
8
|
+
import { EmptyValue, ReferencePreview } from "../../preview";
|
|
9
9
|
import { getIconForProperty, getReferenceFrom } from "../../util";
|
|
10
|
-
import { Button } from "@firecms/ui";
|
|
11
10
|
import { useClearRestoreValue } from "../useClearRestoreValue";
|
|
11
|
+
import { EntityPreviewContainer } from "../../components/EntityPreview";
|
|
12
|
+
import { cls } from "@firecms/ui";
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Field that opens a reference selection dialog.
|
|
@@ -84,9 +85,9 @@ function ReferenceFieldBindingInternal({
|
|
|
84
85
|
return (
|
|
85
86
|
<>
|
|
86
87
|
{!minimalistView && <LabelWithIcon icon={getIconForProperty(property, "small")}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
required={property.validation?.required}
|
|
89
|
+
title={property.name}
|
|
90
|
+
className={"text-text-secondary dark:text-text-secondary-dark ml-3.5"}/>}
|
|
90
91
|
|
|
91
92
|
{!collection && <ErrorView
|
|
92
93
|
error={"The specified collection does not exist. Check console"}/>}
|
|
@@ -105,12 +106,15 @@ function ReferenceFieldBindingInternal({
|
|
|
105
106
|
/>}
|
|
106
107
|
|
|
107
108
|
{!value && <div className="justify-center text-left">
|
|
108
|
-
<
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
109
|
+
<EntityPreviewContainer className={cls("p-6 text-sm font-medium flex items-center gap-6",
|
|
110
|
+
disabled || isSubmitting
|
|
111
|
+
? "text-slate-500"
|
|
112
|
+
: "cursor-pointer text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-gray-800 group-hover:bg-slate-50 dark:group-hover:bg-gray-800")}
|
|
113
|
+
onClick={onEntryClick}
|
|
114
|
+
size={"medium"}>
|
|
115
|
+
<EmptyValue/>
|
|
116
|
+
{`Edit ${property.name}`.toUpperCase()}
|
|
117
|
+
</EntityPreviewContainer>
|
|
114
118
|
</div>}
|
|
115
119
|
</>}
|
|
116
120
|
|