@firecms/core 3.0.0-canary.65 → 3.0.0-canary.67
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/core/EntityEditView.d.ts +17 -3
- package/dist/form/PropertiesForm.d.ts +8 -0
- package/dist/form/components/FieldHelperText.d.ts +3 -3
- package/dist/form/components/StorageItemPreview.d.ts +2 -4
- package/dist/form/field_bindings/MapFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/StorageUploadFieldBinding.d.ts +2 -4
- package/dist/form/index.d.ts +0 -2
- package/dist/index.es.js +4269 -4322
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +5 -5
- package/dist/index.umd.js.map +1 -1
- package/dist/types/collections.d.ts +14 -0
- package/dist/types/fields.d.ts +31 -30
- package/dist/types/plugins.d.ts +2 -2
- package/dist/types/properties.d.ts +1 -1
- package/dist/util/storage.d.ts +23 -2
- package/dist/util/useStorageUploadController.d.ts +1 -1
- package/package.json +4 -4
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +2 -1
- package/src/core/EntityEditView.tsx +662 -120
- package/src/core/EntitySidePanel.tsx +0 -1
- package/src/form/PropertiesForm.tsx +81 -0
- package/src/form/PropertyFieldBinding.tsx +28 -5
- package/src/form/components/FieldHelperText.tsx +3 -3
- package/src/form/components/StorageItemPreview.tsx +0 -4
- package/src/form/field_bindings/MapFieldBinding.tsx +10 -3
- package/src/form/field_bindings/ReadOnlyFieldBinding.tsx +0 -7
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +3 -26
- package/src/form/index.tsx +4 -4
- package/src/form/validation.ts +1 -17
- package/src/types/collections.ts +14 -0
- package/src/types/customization_controller.tsx +0 -1
- package/src/types/fields.tsx +33 -33
- package/src/types/plugins.tsx +2 -2
- package/src/types/properties.ts +1 -1
- package/src/util/permissions.ts +1 -0
- package/src/util/storage.ts +75 -21
- package/src/util/useStorageUploadController.tsx +21 -3
- package/dist/form/EntityForm.d.ts +0 -77
- package/src/form/EntityForm.tsx +0 -735
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Entity, EntityCollection, User } from "../types";
|
|
1
|
+
import { Entity, EntityCollection, EntityValues, ResolvedEntityCollection, User } from "../types";
|
|
2
|
+
import { ValidationError } from "yup";
|
|
2
3
|
export interface EntityEditViewProps<M extends Record<string, any>> {
|
|
3
4
|
path: string;
|
|
4
5
|
collection: EntityCollection<M>;
|
|
@@ -6,7 +7,6 @@ export interface EntityEditViewProps<M extends Record<string, any>> {
|
|
|
6
7
|
copy?: boolean;
|
|
7
8
|
selectedSubPath?: string;
|
|
8
9
|
parentCollectionIds: string[];
|
|
9
|
-
formWidth?: number | string;
|
|
10
10
|
onValuesAreModified: (modified: boolean) => void;
|
|
11
11
|
onUpdate?: (params: {
|
|
12
12
|
entity: Entity<any>;
|
|
@@ -19,4 +19,18 @@ export interface EntityEditViewProps<M extends Record<string, any>> {
|
|
|
19
19
|
* You probably don't want to use this view directly since it is bound to the
|
|
20
20
|
* side panel. Instead, you might want to use {@link EntityForm} or {@link EntityCollectionView}
|
|
21
21
|
*/
|
|
22
|
-
export declare function EntityEditView<M extends Record<string, any>, UserType extends User>({
|
|
22
|
+
export declare function EntityEditView<M extends Record<string, any>, UserType extends User>({ entityId: entityIdProp, ...props }: EntityEditViewProps<M>): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare function EntityEditViewInner<M extends Record<string, any>>({ path, entityId: entityIdProp, selectedSubPath: selectedSubPathProp, copy, collection, parentCollectionIds, onValuesAreModified, onUpdate, onClose, entity, dataLoading, }: EntityEditViewProps<M> & {
|
|
24
|
+
entity?: Entity<M>;
|
|
25
|
+
dataLoading: boolean;
|
|
26
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export type EntityFormSaveParams<M extends Record<string, any>> = {
|
|
28
|
+
collection: ResolvedEntityCollection<M>;
|
|
29
|
+
path: string;
|
|
30
|
+
entityId: string | undefined;
|
|
31
|
+
values: EntityValues<M>;
|
|
32
|
+
previousValues?: EntityValues<M>;
|
|
33
|
+
closeAfterSave: boolean;
|
|
34
|
+
autoSave: boolean;
|
|
35
|
+
};
|
|
36
|
+
export declare function yupToFormErrors(yupError: ValidationError): Record<string, any>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PropertiesOrBuilders } from "../types";
|
|
2
|
+
import { FormexController } from "@firecms/formex";
|
|
3
|
+
export type PropertiesFormProps<M extends Record<string, any> = Record<string, any>> = {
|
|
4
|
+
properties: PropertiesOrBuilders<M>;
|
|
5
|
+
propertiesOrder?: string[];
|
|
6
|
+
formex: FormexController<M>;
|
|
7
|
+
};
|
|
8
|
+
export declare function PropertiesForm<M extends Record<string, any> = Record<string, any>>({ properties, propertiesOrder, formex }: PropertiesFormProps<M>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ResolvedProperty } from "../../types";
|
|
1
|
+
import { Property, ResolvedProperty } from "../../types";
|
|
2
2
|
/**
|
|
3
3
|
* Component in charge of rendering the description of a field
|
|
4
4
|
* as well as the error message if any.
|
|
5
5
|
*/
|
|
6
6
|
export declare function FieldHelperText({ error, showError, property, includeDescription, disabled }: {
|
|
7
7
|
error?: string;
|
|
8
|
-
showError
|
|
9
|
-
property: ResolvedProperty;
|
|
8
|
+
showError?: boolean;
|
|
9
|
+
property: ResolvedProperty | Property;
|
|
10
10
|
includeDescription?: boolean;
|
|
11
11
|
disabled?: boolean;
|
|
12
12
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ResolvedStringProperty } from "../../types";
|
|
2
2
|
import { PreviewSize } from "../../preview";
|
|
3
3
|
interface StorageItemPreviewProps {
|
|
4
4
|
name: string;
|
|
5
5
|
property: ResolvedStringProperty;
|
|
6
6
|
value: string;
|
|
7
|
-
entity: Entity<any>;
|
|
8
7
|
onRemove: (value: string) => void;
|
|
9
8
|
size: PreviewSize;
|
|
10
9
|
disabled: boolean;
|
|
11
|
-
collection: EntityCollection;
|
|
12
10
|
}
|
|
13
|
-
export declare function StorageItemPreview({ name, property, value,
|
|
11
|
+
export declare function StorageItemPreview({ name, property, value, onRemove, disabled, size, }: StorageItemPreviewProps): import("react/jsx-runtime").JSX.Element;
|
|
14
12
|
export {};
|
|
@@ -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,
|
|
9
|
+
export declare function MapFieldBinding({ propertyKey, value, showError, error, disabled, property, partOfBlock, tableMode, includeDescription, underlyingValueHasChanged, autoFocus, context }: FieldProps<Record<string, any>>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FieldProps, ResolvedArrayProperty, ResolvedStringProperty, StorageConfig } from "../../types";
|
|
2
2
|
import { StorageFieldItem } from "../../util/useStorageUploadController";
|
|
3
3
|
type StorageUploadFieldProps = FieldProps<string | string[]>;
|
|
4
4
|
/**
|
|
@@ -11,7 +11,6 @@ type StorageUploadFieldProps = FieldProps<string | string[]>;
|
|
|
11
11
|
export declare function StorageUploadFieldBinding({ propertyKey, value, setValue, error, showError, autoFocus, tableMode, property, includeDescription, context, isSubmitting, }: StorageUploadFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export interface StorageUploadProps {
|
|
13
13
|
value: StorageFieldItem[];
|
|
14
|
-
collection: EntityCollection;
|
|
15
14
|
setInternalValue: (v: StorageFieldItem[]) => void;
|
|
16
15
|
name: string;
|
|
17
16
|
property: ResolvedStringProperty | ResolvedArrayProperty<string[]>;
|
|
@@ -19,11 +18,10 @@ export interface StorageUploadProps {
|
|
|
19
18
|
multipleFilesSupported: boolean;
|
|
20
19
|
autoFocus: boolean;
|
|
21
20
|
disabled: boolean;
|
|
22
|
-
entity: Entity<any>;
|
|
23
21
|
storage: StorageConfig;
|
|
24
22
|
onFilesAdded: (acceptedFiles: File[]) => void;
|
|
25
23
|
storagePathBuilder: (file: File) => string;
|
|
26
24
|
onFileUploadComplete: (uploadedPath: string, entry: StorageFieldItem, fileMetadata?: any) => Promise<void>;
|
|
27
25
|
}
|
|
28
|
-
export declare function StorageUpload({
|
|
26
|
+
export declare function StorageUpload({ property, name, value, setInternalValue, onChange, multipleFilesSupported, onFileUploadComplete, disabled, onFilesAdded, autoFocus, storage, storagePathBuilder, }: StorageUploadProps): import("react/jsx-runtime").JSX.Element;
|
|
29
27
|
export {};
|
package/dist/form/index.d.ts
CHANGED
|
@@ -15,7 +15,5 @@ import { MarkdownFieldBinding } from "./field_bindings/MarkdownFieldBinding";
|
|
|
15
15
|
import { ArrayCustomShapedFieldBinding } from "./field_bindings/ArrayCustomShapedFieldBinding";
|
|
16
16
|
export { ArrayCustomShapedFieldBinding, RepeatFieldBinding, MultiSelectBinding, ArrayOfReferencesFieldBinding, BlockFieldBinding, DateTimeFieldBinding, ReadOnlyFieldBinding, MapFieldBinding, KeyValueFieldBinding, ReferenceFieldBinding, SelectFieldBinding, StorageUploadFieldBinding, SwitchFieldBinding, MarkdownFieldBinding, TextFieldBinding };
|
|
17
17
|
export * from "./components";
|
|
18
|
-
export type { EntityFormProps } from "./EntityForm";
|
|
19
|
-
export { EntityForm } from "./EntityForm";
|
|
20
18
|
export { PropertyFieldBinding } from "./PropertyFieldBinding";
|
|
21
19
|
export * from "./useClearRestoreValue";
|