@firecms/core 3.0.0-alpha.33 → 3.0.0-alpha.34

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firecms/core",
3
- "version": "3.0.0-alpha.33",
3
+ "version": "3.0.0-alpha.34",
4
4
  "description": "Awesome Firebase/Firestore-based headless open-source CMS",
5
5
  "funding": {
6
6
  "url": "https://github.com/sponsors/firecmsco"
@@ -133,7 +133,7 @@
133
133
  "dist",
134
134
  "src"
135
135
  ],
136
- "gitHead": "6d5339ab786c9e239ff98da651fde4e4f4879f21",
136
+ "gitHead": "97fea385cfd4a0ab9301d45d50e1d145021c1df5",
137
137
  "publishConfig": {
138
138
  "access": "public"
139
139
  }
@@ -251,10 +251,14 @@ export const EntityCollectionTable = React.memo<EntityCollectionTableProps<any>>
251
251
  : entity;
252
252
 
253
253
  const Builder = additionalField.Builder;
254
- if (!Builder) {
255
- throw new Error("No builder provided for additional field");
254
+ if (!Builder && !additionalField.value) {
255
+ throw new Error("When using additional fields you need to provide a Builder or a value");
256
256
  }
257
257
 
258
+ const child = Builder
259
+ ? <Builder entity={entity} context={context}/>
260
+ : <>{additionalField.value?.({ entity, context })}</>;
261
+
258
262
  return (
259
263
  <EntityTableCell
260
264
  key={`additional_table_cell_${entity.id}_${column.key}`}
@@ -269,8 +273,7 @@ export const EntityCollectionTable = React.memo<EntityCollectionTableProps<any>>
269
273
  disabledTooltip={"This column can't be edited directly"}
270
274
  >
271
275
  <ErrorBoundary>
272
- <Builder entity={entity}
273
- context={context}/>
276
+ {child}
274
277
  </ErrorBoundary>
275
278
  </EntityTableCell>
276
279
  );