@firecms/core 3.0.0-canary.140 → 3.0.0-canary.141

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.
Files changed (34) hide show
  1. package/dist/components/ArrayContainer.d.ts +13 -3
  2. package/dist/components/EntityCollectionTable/internal/popup_field/PopupFormField.d.ts +6 -3
  3. package/dist/form/PropertyFieldBinding.d.ts +1 -1
  4. package/dist/form/components/index.d.ts +0 -1
  5. package/dist/form/field_bindings/MapFieldBinding.d.ts +1 -1
  6. package/dist/form/field_bindings/ReferenceFieldBinding.d.ts +2 -2
  7. package/dist/index.es.js +9433 -9358
  8. package/dist/index.es.js.map +1 -1
  9. package/dist/index.umd.js +9432 -9357
  10. package/dist/index.umd.js.map +1 -1
  11. package/dist/types/collections.d.ts +2 -1
  12. package/dist/types/fields.d.ts +16 -0
  13. package/dist/util/objects.d.ts +1 -0
  14. package/dist/util/property_utils.d.ts +2 -2
  15. package/package.json +14 -14
  16. package/src/components/ArrayContainer.tsx +36 -13
  17. package/src/components/EntityCollectionTable/PropertyTableCell.tsx +6 -4
  18. package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +66 -58
  19. package/src/components/EntityCollectionView/EntityCollectionView.tsx +2 -3
  20. package/src/form/PropertyFieldBinding.tsx +22 -17
  21. package/src/form/components/index.tsx +0 -1
  22. package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +16 -10
  23. package/src/form/field_bindings/BlockFieldBinding.tsx +24 -8
  24. package/src/form/field_bindings/KeyValueFieldBinding.tsx +4 -1
  25. package/src/form/field_bindings/MapFieldBinding.tsx +55 -39
  26. package/src/form/field_bindings/ReferenceFieldBinding.tsx +1 -1
  27. package/src/form/field_bindings/RepeatFieldBinding.tsx +25 -20
  28. package/src/hooks/data/save.ts +0 -1
  29. package/src/types/collections.ts +2 -1
  30. package/src/types/fields.tsx +18 -0
  31. package/src/util/objects.ts +20 -0
  32. package/src/util/property_utils.tsx +9 -2
  33. package/dist/form/components/FormikArrayContainer.d.ts +0 -19
  34. package/src/form/components/FormikArrayContainer.tsx +0 -47
@@ -1,10 +1,18 @@
1
1
  import React from "react";
2
2
  import { DraggableProvided } from "@hello-pangea/dnd";
3
+ export type ArrayEntryParams = {
4
+ index: number;
5
+ internalId: number;
6
+ isDragging: boolean;
7
+ storedProps?: object;
8
+ storeProps: (props: object) => void;
9
+ };
10
+ export type ArrayEntryBuilder = (params: ArrayEntryParams) => React.ReactNode;
3
11
  export interface ArrayContainerProps<T> {
4
12
  droppableId: string;
5
13
  value: T[];
6
14
  addLabel: string;
7
- buildEntry: (index: number, internalId: number, isDragging: boolean) => React.ReactNode;
15
+ buildEntry: ArrayEntryBuilder;
8
16
  disabled?: boolean;
9
17
  size?: "small" | "medium";
10
18
  onInternalIdAdded?: (id: number) => void;
@@ -23,12 +31,14 @@ type ArrayContainerItemProps = {
23
31
  internalId: number;
24
32
  size?: "small" | "medium";
25
33
  disabled: boolean;
26
- buildEntry: (index: number, internalId: number, isDragging: boolean) => React.ReactNode;
34
+ buildEntry: ArrayEntryBuilder;
27
35
  remove: (index: number) => void;
28
36
  copy: (index: number) => void;
29
37
  isDragging: boolean;
38
+ storedProps?: object;
39
+ updateItemCustomProps: (internalId: number, props: object) => void;
30
40
  };
31
- export declare function ArrayContainerItem({ provided, index, internalId, size, disabled, buildEntry, remove, copy, isDragging }: ArrayContainerItemProps): import("react/jsx-runtime").JSX.Element;
41
+ export declare function ArrayContainerItem({ provided, index, internalId, size, disabled, buildEntry, remove, copy, isDragging, storedProps, updateItemCustomProps }: ArrayContainerItemProps): import("react/jsx-runtime").JSX.Element;
32
42
  export declare function ArrayItemOptions({ direction, disabled, remove, index, provided, copy, }: {
33
43
  direction?: "row" | "column";
34
44
  disabled: boolean;
@@ -2,12 +2,12 @@ import { Entity, EntityCollection } from "../../../../types";
2
2
  import { CustomFieldValidator } from "../../../../form/validation";
3
3
  import { OnCellValueChangeParams } from "../../../common";
4
4
  interface PopupFormFieldProps<M extends Record<string, any>> {
5
- entity: Entity<M>;
6
5
  customFieldValidator?: CustomFieldValidator;
7
6
  path: string;
7
+ entityId: string;
8
8
  tableKey: string;
9
9
  propertyKey?: Extract<keyof M, string>;
10
- collection?: EntityCollection<M>;
10
+ collection?: EntityCollection<any>;
11
11
  cellRect?: DOMRect;
12
12
  open: boolean;
13
13
  onClose: () => void;
@@ -19,5 +19,8 @@ interface PopupFormFieldProps<M extends Record<string, any>> {
19
19
  onCellValueChange?: (params: OnCellValueChangeParams<any, any>) => Promise<void> | void;
20
20
  }
21
21
  export declare function PopupFormField<M extends Record<string, any>>(props: PopupFormFieldProps<M>): import("react/jsx-runtime").JSX.Element | null;
22
- export declare function PopupFormFieldInternal<M extends Record<string, any>>({ tableKey, entity: entityProp, customFieldValidator, propertyKey, collection: inputCollection, path, cellRect, open, onClose, onCellValueChange, container }: PopupFormFieldProps<M>): import("react/jsx-runtime").JSX.Element;
22
+ export declare function PopupFormFieldLoading<M extends Record<string, any>>({ tableKey, entityId, customFieldValidator, propertyKey, collection: inputCollection, path, cellRect, open, onClose, onCellValueChange, container }: PopupFormFieldProps<M>): import("react/jsx-runtime").JSX.Element | null;
23
+ export declare function PopupFormFieldInternal<M extends Record<string, any>>({ tableKey, entityId, customFieldValidator, propertyKey, collection: inputCollection, path, cellRect, open, onClose, onCellValueChange, container, entity }: PopupFormFieldProps<M> & {
24
+ entity?: Entity<M>;
25
+ }): import("react/jsx-runtime").JSX.Element;
23
26
  export {};
@@ -26,5 +26,5 @@ import { CMSType, PropertyFieldBindingProps } from "../types";
26
26
  * @group Form custom fields
27
27
  */
28
28
  export declare const PropertyFieldBinding: typeof PropertyFieldBindingInternal;
29
- declare function PropertyFieldBindingInternal<T extends CMSType = CMSType, M extends Record<string, any> = Record<string, any>>({ propertyKey, property, context, includeDescription, underlyingValueHasChanged, disabled: disabledProp, partOfArray, minimalistView, autoFocus, index, size }: PropertyFieldBindingProps<T, M>): ReactElement<PropertyFieldBindingProps<T, M>>;
29
+ declare function PropertyFieldBindingInternal<T extends CMSType = CMSType, M extends Record<string, any> = Record<string, any>>({ propertyKey, property, context, includeDescription, underlyingValueHasChanged, disabled: disabledProp, partOfArray, minimalistView, autoFocus, index, size, onPropertyChange }: PropertyFieldBindingProps<T, M>): ReactElement<PropertyFieldBindingProps<T, M>>;
30
30
  export {};
@@ -1,4 +1,3 @@
1
- export * from "./FormikArrayContainer";
2
1
  export * from "./FieldHelperText";
3
2
  export * from "./LabelWithIcon";
4
3
  export * from "./LabelWithIconAndTooltip";
@@ -6,4 +6,4 @@ import { FieldProps } from "../../types";
6
6
  * and tables to the specified properties.
7
7
  * @group Form fields
8
8
  */
9
- export declare function MapFieldBinding({ propertyKey, value, showError, error, disabled, property, minimalistView, includeDescription, underlyingValueHasChanged, autoFocus, context }: FieldProps<Record<string, any>>): import("react/jsx-runtime").JSX.Element;
9
+ export declare function MapFieldBinding({ propertyKey, value, showError, error, disabled, property, minimalistView, includeDescription, underlyingValueHasChanged, autoFocus, context, onPropertyChange }: FieldProps<Record<string, any>>): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import { EntityReference, FieldProps } from "../../types";
1
+ import { FieldProps } from "../../types";
2
2
  /**
3
3
  * Field that opens a reference selection dialog.
4
4
  *
@@ -6,4 +6,4 @@ import { EntityReference, FieldProps } from "../../types";
6
6
  * and tables to the specified properties.
7
7
  * @group Form fields
8
8
  */
9
- export declare function ReferenceFieldBinding<M extends Record<string, any>>(props: FieldProps<EntityReference>): import("react/jsx-runtime").JSX.Element;
9
+ export declare function ReferenceFieldBinding(props: FieldProps): import("react/jsx-runtime").JSX.Element;