@firecms/core 3.0.0-beta.10 → 3.0.0-beta.12
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/components/ArrayContainer.d.ts +22 -6
- package/dist/components/EntityCollectionTable/EntityCollectionRowActions.d.ts +2 -1
- package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +2 -2
- package/dist/components/EntityCollectionTable/EntityCollectionTableProps.d.ts +17 -3
- package/dist/components/EntityCollectionTable/index.d.ts +1 -1
- package/dist/components/EntityCollectionTable/internal/popup_field/PopupFormField.d.ts +6 -3
- package/dist/components/EntityCollectionView/EntityCollectionView.d.ts +4 -0
- package/dist/components/PropertyIdCopyTooltip.d.ts +1 -1
- package/dist/components/SelectableTable/SelectableTable.d.ts +12 -2
- package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +1 -1
- package/dist/components/UnsavedChangesDialog.d.ts +8 -0
- package/dist/components/VirtualTable/VirtualTableProps.d.ts +13 -0
- package/dist/components/common/default_entity_actions.d.ts +0 -2
- package/dist/components/common/index.d.ts +1 -1
- package/dist/components/common/useColumnsIds.d.ts +1 -0
- package/dist/components/common/{useDataSourceEntityCollectionTableController.d.ts → useDataSourceTableController.d.ts} +10 -2
- package/dist/components/common/useDebouncedCallback.d.ts +1 -0
- package/dist/components/common/useScrollRestoration.d.ts +14 -0
- package/dist/contexts/BreacrumbsContext.d.ts +8 -0
- package/dist/core/EntityEditView.d.ts +30 -22
- package/dist/core/EntityEditViewFormActions.d.ts +2 -0
- package/dist/core/FireCMS.d.ts +1 -1
- package/dist/core/FireCMSRouter.d.ts +4 -0
- package/dist/core/NavigationRoutes.d.ts +0 -1
- package/dist/core/SideDialogs.d.ts +4 -2
- package/dist/core/index.d.ts +2 -1
- package/dist/form/EntityForm.d.ts +45 -0
- package/dist/form/EntityFormActions.d.ts +17 -0
- package/dist/form/PropertyFieldBinding.d.ts +1 -1
- package/dist/form/components/FormEntry.d.ts +6 -0
- package/dist/form/components/FormLayout.d.ts +5 -0
- package/dist/form/components/index.d.ts +2 -1
- package/dist/form/field_bindings/ArrayCustomShapedFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/BlockFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/MapFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/MarkdownEditorFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/ReferenceFieldBinding.d.ts +2 -2
- package/dist/form/field_bindings/RepeatFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/SwitchFieldBinding.d.ts +1 -2
- package/dist/form/index.d.ts +16 -16
- package/dist/hooks/data/delete.d.ts +4 -4
- package/dist/hooks/data/save.d.ts +3 -3
- package/dist/hooks/data/useCollectionFetch.d.ts +1 -1
- package/dist/hooks/data/useEntityFetch.d.ts +4 -3
- package/dist/hooks/useAuthController.d.ts +1 -1
- package/dist/hooks/useBreadcrumbsController.d.ts +26 -0
- package/dist/hooks/useBuildNavigationController.d.ts +7 -4
- package/dist/hooks/useFireCMSContext.d.ts +1 -1
- package/dist/hooks/useModeController.d.ts +1 -2
- package/dist/hooks/useResolvedNavigationFrom.d.ts +3 -3
- package/dist/hooks/useValidateAuthenticator.d.ts +3 -3
- package/dist/index.es.js +17032 -12909
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +17019 -12898
- package/dist/index.umd.js.map +1 -1
- package/dist/internal/useBuildSideEntityController.d.ts +2 -2
- package/dist/internal/useUnsavedChangesDialog.d.ts +7 -9
- package/dist/preview/PropertyPreviewProps.d.ts +1 -1
- package/dist/preview/components/EnumValuesChip.d.ts +1 -1
- package/dist/preview/util.d.ts +3 -3
- package/dist/routes/CustomCMSRoute.d.ts +4 -0
- package/dist/routes/FireCMSRoute.d.ts +1 -0
- package/dist/routes/HomePageRoute.d.ts +3 -0
- package/dist/types/auth.d.ts +7 -9
- package/dist/types/collections.d.ts +44 -23
- package/dist/types/datasource.d.ts +2 -6
- package/dist/types/dialogs_controller.d.ts +7 -3
- package/dist/types/entities.d.ts +1 -1
- package/dist/types/entity_actions.d.ts +14 -4
- package/dist/types/entity_callbacks.d.ts +16 -16
- package/dist/types/export_import.d.ts +4 -4
- package/dist/types/fields.d.ts +27 -4
- package/dist/types/firecms.d.ts +2 -2
- package/dist/types/firecms_context.d.ts +1 -1
- package/dist/types/navigation.d.ts +29 -12
- package/dist/types/permissions.d.ts +4 -4
- package/dist/types/plugins.d.ts +9 -8
- package/dist/types/properties.d.ts +18 -3
- package/dist/types/property_config.d.ts +0 -2
- package/dist/types/side_entity_controller.d.ts +6 -1
- package/dist/types/user.d.ts +1 -0
- package/dist/util/builders.d.ts +3 -3
- package/dist/util/entities.d.ts +1 -1
- package/dist/util/entity_actions.d.ts +2 -0
- package/dist/util/entity_cache.d.ts +23 -0
- package/dist/util/icon_synonyms.d.ts +0 -1
- package/dist/util/icons.d.ts +3 -1
- package/dist/util/index.d.ts +1 -0
- package/dist/util/navigation_from_path.d.ts +6 -1
- package/dist/util/navigation_utils.d.ts +12 -1
- package/dist/util/objects.d.ts +1 -0
- package/dist/util/permissions.d.ts +4 -4
- package/dist/util/property_utils.d.ts +2 -2
- package/dist/util/resolutions.d.ts +12 -7
- package/package.json +129 -125
- package/src/app/Scaffold.tsx +4 -4
- package/src/components/ArrayContainer.tsx +115 -34
- package/src/components/CircularProgressCenter.tsx +1 -1
- package/src/components/ConfirmationDialog.tsx +2 -2
- package/src/components/DeleteEntityDialog.tsx +10 -19
- package/src/components/EntityCollectionTable/EntityCollectionRowActions.tsx +44 -20
- package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +23 -17
- package/src/components/EntityCollectionTable/EntityCollectionTableProps.tsx +20 -3
- package/src/components/EntityCollectionTable/PropertyTableCell.tsx +6 -4
- package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +8 -9
- package/src/components/EntityCollectionTable/fields/TableStorageUpload.tsx +5 -11
- package/src/components/EntityCollectionTable/index.tsx +1 -1
- package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.tsx +3 -3
- package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +5 -5
- package/src/components/EntityCollectionTable/internal/EntityTableCellActions.tsx +2 -2
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +77 -73
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +90 -49
- package/src/components/EntityCollectionView/EntityCollectionViewActions.tsx +4 -2
- package/src/components/EntityCollectionView/useSelectionController.tsx +5 -4
- package/src/components/EntityPreview.tsx +39 -30
- package/src/components/EntityView.tsx +5 -5
- package/src/components/ErrorView.tsx +3 -3
- package/src/components/HomePage/DefaultHomePage.tsx +1 -0
- package/src/components/HomePage/FavouritesView.tsx +6 -11
- package/src/components/HomePage/NavigationCard.tsx +1 -1
- package/src/components/HomePage/NavigationCardBinding.tsx +4 -9
- package/src/components/HomePage/NavigationGroup.tsx +1 -1
- package/src/components/NotFoundPage.tsx +2 -2
- package/src/components/PropertyConfigBadge.tsx +1 -1
- package/src/components/PropertyIdCopyTooltip.tsx +3 -4
- package/src/components/ReferenceTable/ReferenceSelectionTable.tsx +13 -8
- package/src/components/SelectableTable/SelectableTable.tsx +20 -5
- package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +4 -2
- package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +10 -8
- package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +7 -5
- package/src/components/UnsavedChangesDialog.tsx +42 -0
- package/src/components/VirtualTable/VirtualTable.tsx +19 -2
- package/src/components/VirtualTable/VirtualTableHeader.tsx +8 -8
- package/src/components/VirtualTable/VirtualTableHeaderRow.tsx +1 -1
- package/src/components/VirtualTable/VirtualTableProps.tsx +15 -0
- package/src/components/VirtualTable/VirtualTableRow.tsx +1 -1
- package/src/components/VirtualTable/fields/VirtualTableDateField.tsx +1 -1
- package/src/components/VirtualTable/fields/VirtualTableInput.tsx +1 -1
- package/src/components/VirtualTable/fields/VirtualTableSelect.tsx +2 -0
- package/src/components/common/default_entity_actions.tsx +26 -37
- package/src/components/common/index.ts +1 -1
- package/src/components/common/useColumnsIds.tsx +1 -1
- package/src/components/common/useDataSourceTableController.tsx +420 -0
- package/src/components/common/useDebouncedCallback.tsx +20 -0
- package/src/components/common/useScrollRestoration.tsx +68 -0
- package/src/contexts/BreacrumbsContext.tsx +38 -0
- package/src/contexts/DialogsProvider.tsx +3 -2
- package/src/contexts/ModeController.tsx +1 -3
- package/src/contexts/SnackbarProvider.tsx +2 -0
- package/src/core/DefaultAppBar.tsx +56 -25
- package/src/core/DefaultDrawer.tsx +11 -9
- package/src/core/DrawerNavigationItem.tsx +4 -4
- package/src/core/EntityEditView.tsx +282 -1006
- package/src/core/EntityEditViewFormActions.tsx +199 -0
- package/src/core/EntitySidePanel.tsx +85 -15
- package/src/core/FireCMS.tsx +12 -9
- package/src/core/FireCMSRouter.tsx +17 -0
- package/src/core/NavigationRoutes.tsx +23 -32
- package/src/core/SideDialogs.tsx +21 -12
- package/src/core/field_configs.tsx +4 -4
- package/src/core/index.tsx +4 -2
- package/src/form/EntityForm.tsx +774 -0
- package/src/form/EntityFormActions.tsx +169 -0
- package/src/form/PropertyFieldBinding.tsx +39 -30
- package/src/form/components/CustomIdField.tsx +2 -0
- package/src/form/components/FormEntry.tsx +22 -0
- package/src/form/components/FormLayout.tsx +16 -0
- package/src/form/components/LabelWithIcon.tsx +6 -3
- package/src/form/components/StorageItemPreview.tsx +3 -3
- package/src/form/components/StorageUploadProgress.tsx +1 -1
- package/src/form/components/index.tsx +2 -1
- package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +7 -6
- package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +20 -12
- package/src/form/field_bindings/BlockFieldBinding.tsx +45 -25
- package/src/form/field_bindings/DateTimeFieldBinding.tsx +2 -1
- package/src/form/field_bindings/KeyValueFieldBinding.tsx +10 -7
- package/src/form/field_bindings/MapFieldBinding.tsx +69 -52
- package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +9 -6
- package/src/form/field_bindings/MultiSelectFieldBinding.tsx +1 -1
- package/src/form/field_bindings/ReadOnlyFieldBinding.tsx +2 -2
- package/src/form/field_bindings/ReferenceFieldBinding.tsx +5 -5
- package/src/form/field_bindings/RepeatFieldBinding.tsx +30 -22
- package/src/form/field_bindings/SelectFieldBinding.tsx +6 -5
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +7 -5
- package/src/form/field_bindings/SwitchFieldBinding.tsx +26 -25
- package/src/form/field_bindings/TextFieldBinding.tsx +4 -3
- package/src/form/index.tsx +16 -32
- package/src/form/validation.ts +12 -6
- package/src/hooks/data/delete.ts +4 -4
- package/src/hooks/data/save.ts +8 -9
- package/src/hooks/data/useCollectionFetch.tsx +3 -3
- package/src/hooks/data/useEntityFetch.tsx +10 -6
- package/src/hooks/useAuthController.tsx +1 -1
- package/src/hooks/useBreadcrumbsController.tsx +31 -0
- package/src/hooks/useBuildModeController.tsx +15 -28
- package/src/hooks/useBuildNavigationController.tsx +74 -29
- package/src/hooks/useFireCMSContext.tsx +5 -5
- package/src/hooks/useLargeLayout.tsx +0 -35
- package/src/hooks/useModeController.tsx +1 -2
- package/src/hooks/useResolvedNavigationFrom.tsx +9 -11
- package/src/hooks/useValidateAuthenticator.tsx +3 -3
- package/src/internal/useBuildDataSource.ts +1 -1
- package/src/internal/useBuildSideDialogsController.tsx +3 -2
- package/src/internal/useBuildSideEntityController.tsx +124 -83
- package/src/internal/useUnsavedChangesDialog.tsx +127 -93
- package/src/preview/PropertyPreview.tsx +11 -11
- package/src/preview/PropertyPreviewProps.tsx +1 -1
- package/src/preview/components/BooleanPreview.tsx +1 -1
- package/src/preview/components/EmptyValue.tsx +1 -1
- package/src/preview/components/EnumValuesChip.tsx +1 -1
- package/src/preview/components/ImagePreview.tsx +5 -6
- package/src/preview/components/UrlComponentPreview.tsx +20 -21
- package/src/preview/property_previews/ArrayOfMapsPreview.tsx +1 -1
- package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +2 -2
- package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +2 -2
- package/src/preview/property_previews/ArrayOfStringsPreview.tsx +1 -1
- package/src/preview/property_previews/ArrayOneOfPreview.tsx +2 -2
- package/src/preview/property_previews/ArrayPropertyPreview.tsx +2 -2
- package/src/preview/property_previews/MapPropertyPreview.tsx +7 -6
- package/src/preview/property_previews/SkeletonPropertyComponent.tsx +12 -12
- package/src/preview/property_previews/StringPropertyPreview.tsx +2 -2
- package/src/preview/util.ts +10 -10
- package/src/routes/CustomCMSRoute.tsx +21 -0
- package/src/routes/FireCMSRoute.tsx +235 -0
- package/src/routes/HomePageRoute.tsx +17 -0
- package/src/types/auth.tsx +8 -12
- package/src/types/collections.ts +52 -26
- package/src/types/datasource.ts +2 -6
- package/src/types/dialogs_controller.tsx +7 -3
- package/src/types/entities.ts +1 -1
- package/src/types/entity_actions.tsx +16 -4
- package/src/types/entity_callbacks.ts +18 -18
- package/src/types/export_import.ts +4 -4
- package/src/types/fields.tsx +33 -4
- package/src/types/firecms.tsx +2 -2
- package/src/types/firecms_context.tsx +1 -1
- package/src/types/navigation.ts +36 -16
- package/src/types/permissions.ts +5 -5
- package/src/types/plugins.tsx +9 -8
- package/src/types/properties.ts +21 -3
- package/src/types/property_config.tsx +0 -2
- package/src/types/side_dialogs_controller.tsx +2 -0
- package/src/types/side_entity_controller.tsx +6 -1
- package/src/types/user.ts +2 -0
- package/src/util/builders.ts +10 -8
- package/src/util/entities.ts +3 -1
- package/src/util/entity_actions.ts +28 -0
- package/src/util/entity_cache.ts +204 -0
- package/src/util/icon_list.ts +1 -0
- package/src/util/icon_synonyms.ts +0 -1
- package/src/util/icons.tsx +12 -8
- package/src/util/index.ts +1 -0
- package/src/util/join_collections.ts +3 -0
- package/src/util/navigation_from_path.ts +13 -6
- package/src/util/navigation_utils.ts +53 -1
- package/src/util/objects.ts +24 -1
- package/src/util/parent_references_from_path.ts +3 -3
- package/src/util/permissions.ts +8 -8
- package/src/util/property_utils.tsx +10 -3
- package/src/util/references.ts +8 -2
- package/src/util/resolutions.ts +34 -13
- package/src/util/useStorageUploadController.tsx +40 -22
- package/dist/form/components/FormikArrayContainer.d.ts +0 -19
- package/src/components/common/useDataSourceEntityCollectionTableController.tsx +0 -236
- package/src/form/components/FormikArrayContainer.tsx +0 -47
- /package/src/util/{common.tsx → common.ts} +0 -0
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { DraggableProvided } from "@hello-pangea/dnd";
|
|
3
|
-
|
|
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;
|
|
11
|
+
export interface ArrayContainerProps<T> {
|
|
4
12
|
droppableId: string;
|
|
5
13
|
value: T[];
|
|
6
14
|
addLabel: string;
|
|
7
|
-
buildEntry:
|
|
15
|
+
buildEntry: ArrayEntryBuilder;
|
|
8
16
|
disabled?: boolean;
|
|
9
17
|
size?: "small" | "medium";
|
|
10
18
|
onInternalIdAdded?: (id: number) => void;
|
|
@@ -12,30 +20,38 @@ interface ArrayContainerProps<T> {
|
|
|
12
20
|
newDefaultEntry: T;
|
|
13
21
|
onValueChange: (value: T[]) => void;
|
|
14
22
|
className?: string;
|
|
23
|
+
min?: number;
|
|
24
|
+
max?: number;
|
|
15
25
|
}
|
|
16
26
|
/**
|
|
17
27
|
* @group Form custom fields
|
|
18
28
|
*/
|
|
19
|
-
export declare function ArrayContainer<T>({ droppableId, addLabel, value, disabled, buildEntry, size, onInternalIdAdded, includeAddButton, newDefaultEntry, onValueChange, className }: ArrayContainerProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare function ArrayContainer<T>({ droppableId, addLabel, value, disabled, buildEntry, size, onInternalIdAdded, includeAddButton, newDefaultEntry, onValueChange, className, min, max }: ArrayContainerProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
20
30
|
type ArrayContainerItemProps = {
|
|
21
31
|
provided: DraggableProvided;
|
|
22
32
|
index: number;
|
|
23
33
|
internalId: number;
|
|
24
34
|
size?: "small" | "medium";
|
|
25
35
|
disabled: boolean;
|
|
26
|
-
buildEntry:
|
|
36
|
+
buildEntry: ArrayEntryBuilder;
|
|
27
37
|
remove: (index: number) => void;
|
|
28
38
|
copy: (index: number) => void;
|
|
39
|
+
addInIndex?: (index: number) => void;
|
|
40
|
+
includeAddButton?: boolean;
|
|
29
41
|
isDragging: boolean;
|
|
42
|
+
storedProps?: object;
|
|
43
|
+
updateItemCustomProps: (internalId: number, props: object) => void;
|
|
30
44
|
};
|
|
31
|
-
export declare function ArrayContainerItem({ provided, index, internalId, size, disabled, buildEntry, remove, copy, isDragging }: ArrayContainerItemProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
-
export declare function ArrayItemOptions({ direction, disabled, remove, index, provided, copy, }: {
|
|
45
|
+
export declare function ArrayContainerItem({ provided, index, internalId, size, disabled, buildEntry, remove, addInIndex, includeAddButton, copy, isDragging, storedProps, updateItemCustomProps }: ArrayContainerItemProps): import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
export declare function ArrayItemOptions({ direction, disabled, remove, index, provided, copy, includeAddButton, addInIndex }: {
|
|
33
47
|
direction?: "row" | "column";
|
|
34
48
|
disabled: boolean;
|
|
35
49
|
remove: (index: number) => void;
|
|
36
50
|
index: number;
|
|
37
51
|
provided: any;
|
|
38
52
|
copy: (index: number) => void;
|
|
53
|
+
includeAddButton?: boolean;
|
|
54
|
+
addInIndex?: (index: number) => void;
|
|
39
55
|
}): import("react/jsx-runtime").JSX.Element;
|
|
40
56
|
export declare function getRandomId(): number;
|
|
41
57
|
export {};
|
|
@@ -12,7 +12,7 @@ import { CollectionSize, Entity, EntityAction, EntityCollection, SelectionContro
|
|
|
12
12
|
*
|
|
13
13
|
* @group Collection components
|
|
14
14
|
*/
|
|
15
|
-
export declare const EntityCollectionRowActions: ({ entity, collection, fullPath, width, frozen, isSelected, selectionEnabled, size, highlightEntity, onCollectionChange, unhighlightEntity, actions, hideId, selectionController, }: {
|
|
15
|
+
export declare const EntityCollectionRowActions: ({ entity, collection, fullPath, width, frozen, isSelected, selectionEnabled, size, highlightEntity, onCollectionChange, unhighlightEntity, actions, hideId, selectionController, openEntityMode }: {
|
|
16
16
|
entity: Entity<any>;
|
|
17
17
|
collection?: EntityCollection<any>;
|
|
18
18
|
fullPath?: string;
|
|
@@ -27,4 +27,5 @@ export declare const EntityCollectionRowActions: ({ entity, collection, fullPath
|
|
|
27
27
|
selectionController?: SelectionController;
|
|
28
28
|
highlightEntity?: (entity: Entity<any>) => void;
|
|
29
29
|
unhighlightEntity?: (entity: Entity<any>) => void;
|
|
30
|
+
openEntityMode: "side_panel" | "full_screen";
|
|
30
31
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -17,11 +17,11 @@ import { EntityCollectionTableProps } from "./EntityCollectionTableProps";
|
|
|
17
17
|
*
|
|
18
18
|
* The data displayed in the table is managed by a {@link EntityTableController}.
|
|
19
19
|
* You can build the default, bound to a path in the datasource, by using the hook
|
|
20
|
-
* {@link
|
|
20
|
+
* {@link useDataSourceTableController}
|
|
21
21
|
*
|
|
22
22
|
* @see EntityCollectionTableProps
|
|
23
23
|
* @see EntityCollectionView
|
|
24
24
|
* @see VirtualTable
|
|
25
25
|
* @group Components
|
|
26
26
|
*/
|
|
27
|
-
export declare const EntityCollectionTable: <M extends Record<string, any
|
|
27
|
+
export declare const EntityCollectionTable: <M extends Record<string, any> = any, USER extends User = any>({ className, style, forceFilter, actionsStart, actions, title, tableRowActionsBuilder, uniqueFieldValidator, getPropertyFor, onValueChange, selectionController, highlightedEntities, onEntityClick, onColumnResize, initialScroll, onScroll, onSizeChanged, textSearchEnabled, hoverRow, inlineEditing, additionalFields, displayedColumnIds, defaultSize, properties, tableController, filterable, sortable, endAdornment, AddColumnComponent, AdditionalHeaderWidget, additionalIDHeaderWidget, emptyComponent, getIdColumnWidth, onTextSearchClick, textSearchLoading, enablePopupIcon, openEntityMode }: EntityCollectionTableProps<M>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,7 +4,7 @@ import { OnCellValueChange, OnColumnResizeParams, UniqueFieldValidator } from ".
|
|
|
4
4
|
/**
|
|
5
5
|
* @group Collection components
|
|
6
6
|
*/
|
|
7
|
-
export type EntityCollectionTableProps<M extends Record<string, any>,
|
|
7
|
+
export type EntityCollectionTableProps<M extends Record<string, any>, USER extends User = User> = {
|
|
8
8
|
className?: string;
|
|
9
9
|
style?: React.CSSProperties;
|
|
10
10
|
/**
|
|
@@ -48,6 +48,19 @@ export type EntityCollectionTableProps<M extends Record<string, any>, UserType e
|
|
|
48
48
|
* Callback when a column is resized
|
|
49
49
|
*/
|
|
50
50
|
onColumnResize?(params: OnColumnResizeParams): void;
|
|
51
|
+
/**
|
|
52
|
+
* Initial scroll position
|
|
53
|
+
*/
|
|
54
|
+
initialScroll?: number;
|
|
55
|
+
/**
|
|
56
|
+
* Callback when the table is scrolled
|
|
57
|
+
* @param props
|
|
58
|
+
*/
|
|
59
|
+
onScroll?: (props: {
|
|
60
|
+
scrollDirection: "forward" | "backward";
|
|
61
|
+
scrollOffset: number;
|
|
62
|
+
scrollUpdateWasRequested: boolean;
|
|
63
|
+
}) => void;
|
|
51
64
|
/**
|
|
52
65
|
* Callback when the selected size of the table is changed
|
|
53
66
|
*/
|
|
@@ -63,7 +76,7 @@ export type EntityCollectionTableProps<M extends Record<string, any>, UserType e
|
|
|
63
76
|
actions?: React.ReactNode;
|
|
64
77
|
/**
|
|
65
78
|
* Controller holding the logic for the table
|
|
66
|
-
* {@link
|
|
79
|
+
* {@link useDataSourceTableController}
|
|
67
80
|
* {@link EntityTableController}
|
|
68
81
|
*/
|
|
69
82
|
tableController: EntityTableController<M>;
|
|
@@ -71,7 +84,7 @@ export type EntityCollectionTableProps<M extends Record<string, any>, UserType e
|
|
|
71
84
|
forceFilter?: FilterValues<Extract<keyof M, string>>;
|
|
72
85
|
textSearchEnabled?: boolean;
|
|
73
86
|
inlineEditing?: boolean;
|
|
74
|
-
additionalFields?: AdditionalFieldDelegate<M,
|
|
87
|
+
additionalFields?: AdditionalFieldDelegate<M, USER>[];
|
|
75
88
|
defaultSize?: CollectionSize;
|
|
76
89
|
properties: ResolvedProperties<M>;
|
|
77
90
|
getPropertyFor?: (props: GetPropertyForProps<M>) => ResolvedProperties<M>[string];
|
|
@@ -90,6 +103,7 @@ export type EntityCollectionTableProps<M extends Record<string, any>, UserType e
|
|
|
90
103
|
onTextSearchClick?: () => void;
|
|
91
104
|
textSearchLoading?: boolean;
|
|
92
105
|
enablePopupIcon: boolean;
|
|
106
|
+
openEntityMode?: "side_panel" | "full_screen";
|
|
93
107
|
};
|
|
94
108
|
export type GetPropertyForProps<M extends Record<string, any>> = {
|
|
95
109
|
propertyKey: string;
|
|
@@ -2,5 +2,5 @@ export { EntityCollectionTable } from "./EntityCollectionTable";
|
|
|
2
2
|
export type { EntityCollectionTableProps, } from "./EntityCollectionTableProps";
|
|
3
3
|
export * from "./PropertyTableCell";
|
|
4
4
|
export * from "./EntityCollectionRowActions";
|
|
5
|
-
export * from "../common/
|
|
5
|
+
export * from "../common/useDataSourceTableController";
|
|
6
6
|
export * from "./column_utils";
|
|
@@ -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<
|
|
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
|
|
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 {};
|
|
@@ -18,6 +18,10 @@ export type EntityCollectionViewProps<M extends Record<string, any>> = {
|
|
|
18
18
|
*/
|
|
19
19
|
isSubCollection?: boolean;
|
|
20
20
|
className?: string;
|
|
21
|
+
/**
|
|
22
|
+
* If true, this view will store its filter and sorting status in the url params
|
|
23
|
+
*/
|
|
24
|
+
updateUrl?: boolean;
|
|
21
25
|
} & EntityCollection<M>;
|
|
22
26
|
/**
|
|
23
27
|
* This component is in charge of binding a datasource path with an {@link EntityCollection}
|
|
@@ -34,7 +34,7 @@ export type SelectableTableProps<M extends Record<string, any>> = {
|
|
|
34
34
|
hoverRow?: boolean;
|
|
35
35
|
/**
|
|
36
36
|
* Controller holding the logic for the table
|
|
37
|
-
* {@link
|
|
37
|
+
* {@link useDataSourceTableController}
|
|
38
38
|
* {@link EntityTableController}
|
|
39
39
|
*/
|
|
40
40
|
tableController: EntityTableController<M>;
|
|
@@ -44,6 +44,16 @@ export type SelectableTableProps<M extends Record<string, any>> = {
|
|
|
44
44
|
forceFilter?: FilterValues<keyof M extends string ? keyof M : never>;
|
|
45
45
|
highlightedRow?: (data: Entity<M>) => boolean;
|
|
46
46
|
size?: CollectionSize;
|
|
47
|
+
initialScroll?: number;
|
|
48
|
+
/**
|
|
49
|
+
* Callback when the table is scrolled
|
|
50
|
+
* @param props
|
|
51
|
+
*/
|
|
52
|
+
onScroll?: (props: {
|
|
53
|
+
scrollDirection: "forward" | "backward";
|
|
54
|
+
scrollOffset: number;
|
|
55
|
+
scrollUpdateWasRequested: boolean;
|
|
56
|
+
}) => void;
|
|
47
57
|
emptyComponent?: React.ReactNode;
|
|
48
58
|
endAdornment?: React.ReactNode;
|
|
49
59
|
AddColumnComponent?: React.ComponentType;
|
|
@@ -65,7 +75,7 @@ export type SelectableTableProps<M extends Record<string, any>> = {
|
|
|
65
75
|
*
|
|
66
76
|
* The data displayed in the table is managed by a {@link EntityTableController}.
|
|
67
77
|
* You can build the default, bound to a path in the datasource, by using the hook
|
|
68
|
-
* {@link
|
|
78
|
+
* {@link useDataSourceTableController}
|
|
69
79
|
*
|
|
70
80
|
* @see EntityCollectionTableProps
|
|
71
81
|
* @see EntityCollectionView
|
|
@@ -11,5 +11,5 @@ interface ReferenceFilterFieldProps {
|
|
|
11
11
|
hidden: boolean;
|
|
12
12
|
setHidden: (hidden: boolean) => void;
|
|
13
13
|
}
|
|
14
|
-
export declare function ReferenceFilterField({
|
|
14
|
+
export declare function ReferenceFilterField({ value, setValue, isArray, path, includeId, previewProperties, setHidden }: ReferenceFilterFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface UnsavedChangesDialogProps {
|
|
2
|
+
open: boolean;
|
|
3
|
+
body?: React.ReactNode;
|
|
4
|
+
title?: string;
|
|
5
|
+
handleOk: () => void;
|
|
6
|
+
handleCancel: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function UnsavedChangesDialog({ open, handleOk, handleCancel, body, title }: UnsavedChangesDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -66,6 +66,15 @@ export interface VirtualTableProps<T extends Record<string, any>> {
|
|
|
66
66
|
* @param filter
|
|
67
67
|
*/
|
|
68
68
|
onFilterUpdate?: (filter?: VirtualTableFilterValues<any> | undefined) => void;
|
|
69
|
+
/**
|
|
70
|
+
* Callback when the table is scrolled
|
|
71
|
+
* @param props
|
|
72
|
+
*/
|
|
73
|
+
onScroll?: (props: {
|
|
74
|
+
scrollDirection: "forward" | "backward";
|
|
75
|
+
scrollOffset: number;
|
|
76
|
+
scrollUpdateWasRequested: boolean;
|
|
77
|
+
}) => void;
|
|
69
78
|
/**
|
|
70
79
|
* Default sort applied to this collection
|
|
71
80
|
*/
|
|
@@ -119,6 +128,10 @@ export interface VirtualTableProps<T extends Record<string, any>> {
|
|
|
119
128
|
* @param column
|
|
120
129
|
*/
|
|
121
130
|
AddColumnComponent?: React.ComponentType;
|
|
131
|
+
/**
|
|
132
|
+
* Initial scroll position
|
|
133
|
+
*/
|
|
134
|
+
initialScroll?: number;
|
|
122
135
|
/**
|
|
123
136
|
* Debug mode
|
|
124
137
|
*/
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { EntityAction } from "../../types";
|
|
2
2
|
export declare const editEntityAction: EntityAction;
|
|
3
3
|
export declare const copyEntityAction: EntityAction;
|
|
4
|
-
export declare const archiveEntityAction: EntityAction;
|
|
5
|
-
export declare const openWebsiteAction: EntityAction;
|
|
6
4
|
export declare const deleteEntityAction: EntityAction;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from "./types";
|
|
2
2
|
export * from "./useDebouncedData";
|
|
3
3
|
export * from "./useColumnsIds";
|
|
4
|
-
export * from "./
|
|
4
|
+
export * from "./useDataSourceTableController";
|
|
5
5
|
export * from "./useTableSearchHelper";
|
|
6
6
|
export * from "./default_entity_actions";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EntityCollection, ResolvedEntityCollection, ResolvedProperty } from "../../types";
|
|
2
2
|
import { PropertyColumnConfig } from "../EntityCollectionTable/EntityCollectionTableProps";
|
|
3
|
+
export declare const COLLECTION_GROUP_PARENT_ID = "collectionGroupParent";
|
|
3
4
|
export declare function useColumnIds<M extends Record<string, any>>(collection: ResolvedEntityCollection<M>, includeSubcollections: boolean): PropertyColumnConfig[];
|
|
4
5
|
export declare function getColumnKeysForProperty(property: ResolvedProperty, key: string, disabled?: boolean): PropertyColumnConfig[];
|
|
5
6
|
export declare function getFormFieldKeys(collection: EntityCollection): string[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Entity, EntityCollection, EntityTableController, FilterValues, User } from "../../types";
|
|
2
|
-
|
|
2
|
+
import { ScrollRestorationController } from "./useScrollRestoration";
|
|
3
|
+
export type DataSourceTableControllerProps<M extends Record<string, any> = any> = {
|
|
3
4
|
/**
|
|
4
5
|
* Full path where the data of this table is located
|
|
5
6
|
*/
|
|
@@ -18,6 +19,11 @@ export type DataSourceEntityCollectionTableControllerProps<M extends Record<stri
|
|
|
18
19
|
* Force filter to be applied to the table.
|
|
19
20
|
*/
|
|
20
21
|
forceFilter?: FilterValues<string>;
|
|
22
|
+
scrollRestoration?: ScrollRestorationController;
|
|
23
|
+
/**
|
|
24
|
+
* When set to true the filters and sort will be updated in the URL
|
|
25
|
+
*/
|
|
26
|
+
updateUrl?: boolean;
|
|
21
27
|
};
|
|
22
28
|
/**
|
|
23
29
|
* Use this hook to build a controller for the {@link EntityCollectionTable}.
|
|
@@ -28,8 +34,10 @@ export type DataSourceEntityCollectionTableControllerProps<M extends Record<stri
|
|
|
28
34
|
*
|
|
29
35
|
* @param fullPath
|
|
30
36
|
* @param collection
|
|
37
|
+
* @param scrollRestoration
|
|
31
38
|
* @param entitiesDisplayedFirst
|
|
32
39
|
* @param lastDeleteTimestamp
|
|
33
40
|
* @param forceFilterFromProps
|
|
41
|
+
* @param updateUrl
|
|
34
42
|
*/
|
|
35
|
-
export declare function
|
|
43
|
+
export declare function useDataSourceTableController<M extends Record<string, any> = any, USER extends User = User>({ fullPath, collection, scrollRestoration, entitiesDisplayedFirst, lastDeleteTimestamp, forceFilter: forceFilterFromProps, updateUrl }: DataSourceTableControllerProps<M>): EntityTableController<M>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useDebounceCallback<T extends (...args: any[]) => any>(callback?: T, delay?: number): T;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Entity, FilterValues } from "../../types";
|
|
2
|
+
export type ScrollRestorationController = {
|
|
3
|
+
getCollectionScroll: (fullPath: string, filters?: FilterValues<any>) => {
|
|
4
|
+
scrollOffset: number;
|
|
5
|
+
data: Entity<any>[];
|
|
6
|
+
} | undefined;
|
|
7
|
+
updateCollectionScroll: (props: {
|
|
8
|
+
fullPath: string;
|
|
9
|
+
scrollOffset: number;
|
|
10
|
+
filters?: FilterValues<any>;
|
|
11
|
+
data: Entity<any>[];
|
|
12
|
+
}) => void;
|
|
13
|
+
};
|
|
14
|
+
export declare function useScrollRestoration(): ScrollRestorationController;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { BreadcrumbsController } from "../hooks/useBreadcrumbsController";
|
|
3
|
+
export declare const BreadcrumbContext: React.Context<BreadcrumbsController>;
|
|
4
|
+
interface BreadcrumbsProviderProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const BreadcrumbsProvider: React.FC<BreadcrumbsProviderProps>;
|
|
8
|
+
export {};
|
|
@@ -1,36 +1,44 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Entity, EntityCollection, EntityStatus, User } from "../types";
|
|
3
|
+
import { EntityFormProps } from "../form";
|
|
4
|
+
export type OnUpdateParams = {
|
|
5
|
+
entity: Entity<any>;
|
|
6
|
+
status: EntityStatus;
|
|
7
|
+
path: string;
|
|
8
|
+
entityId?: string;
|
|
9
|
+
selectedTab?: string;
|
|
10
|
+
collection: EntityCollection<any>;
|
|
11
|
+
};
|
|
12
|
+
export type OnTabChangeParams<M extends Record<string, any>> = {
|
|
13
|
+
path: string;
|
|
14
|
+
entityId?: string;
|
|
15
|
+
selectedTab?: string;
|
|
16
|
+
collection: EntityCollection<M>;
|
|
17
|
+
};
|
|
3
18
|
export interface EntityEditViewProps<M extends Record<string, any>> {
|
|
4
19
|
path: string;
|
|
5
20
|
collection: EntityCollection<M>;
|
|
6
21
|
entityId?: string;
|
|
22
|
+
databaseId?: string;
|
|
7
23
|
copy?: boolean;
|
|
8
|
-
|
|
24
|
+
selectedTab?: string;
|
|
9
25
|
parentCollectionIds: string[];
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
26
|
+
onValuesModified?: (modified: boolean) => void;
|
|
27
|
+
onSaved?: (params: OnUpdateParams) => void;
|
|
28
|
+
onTabChange?: (props: OnTabChangeParams<M>) => void;
|
|
29
|
+
layout?: "side_panel" | "full_screen";
|
|
30
|
+
barActions?: React.ReactNode;
|
|
31
|
+
formProps?: Partial<EntityFormProps<M>>;
|
|
15
32
|
}
|
|
16
33
|
/**
|
|
17
34
|
* This is the default view that is used as the content of a side panel when
|
|
18
35
|
* an entity is opened.
|
|
19
|
-
* You probably don't want to use this view directly since it is bound to the
|
|
20
|
-
* side panel.
|
|
21
36
|
*/
|
|
22
|
-
export declare function EntityEditView<M extends Record<string, any>,
|
|
23
|
-
export declare function EntityEditViewInner<M extends Record<string, any>>({ path, entityId
|
|
37
|
+
export declare function EntityEditView<M extends Record<string, any>, USER extends User>({ entityId, ...props }: EntityEditViewProps<M>): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export declare function EntityEditViewInner<M extends Record<string, any>>({ path, entityId, selectedTab: selectedTabProp, collection, parentCollectionIds, onValuesModified, onSaved, onTabChange, entity, cachedDirtyValues, dataLoading, layout, barActions, status, setStatus, formProps, }: EntityEditViewProps<M> & {
|
|
24
39
|
entity?: Entity<M>;
|
|
40
|
+
cachedDirtyValues?: Partial<M>;
|
|
25
41
|
dataLoading: boolean;
|
|
42
|
+
status: EntityStatus;
|
|
43
|
+
setStatus: (status: EntityStatus) => void;
|
|
26
44
|
}): 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,2 @@
|
|
|
1
|
+
import { EntityFormActionsProps } from "../form/EntityFormActions";
|
|
2
|
+
export declare function EntityEditViewFormActions({ collection, path, entity, layout, savingError, formex, disabled, status, pluginActions, openEntityMode, showDefaultActions }: EntityFormActionsProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/core/FireCMS.d.ts
CHANGED
|
@@ -11,4 +11,4 @@ import { EntityCollection, FireCMSProps, User } from "../types";
|
|
|
11
11
|
|
|
12
12
|
* @group Core
|
|
13
13
|
*/
|
|
14
|
-
export declare function FireCMS<
|
|
14
|
+
export declare function FireCMS<USER extends User, EC extends EntityCollection>(props: FireCMSProps<USER, EC>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -15,7 +15,6 @@ export type NavigationRoutesProps = {
|
|
|
15
15
|
* or the home route) related to a {@link NavigationController}.
|
|
16
16
|
* This component needs a parent {@link FireCMS}
|
|
17
17
|
*
|
|
18
|
-
|
|
19
18
|
* @group Components
|
|
20
19
|
*/
|
|
21
20
|
export declare const NavigationRoutes: React.NamedExoticComponent<NavigationRoutesProps>;
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export type
|
|
2
|
+
export type SideDialogController = {
|
|
3
3
|
blocked: boolean;
|
|
4
4
|
setBlocked: (blocked: boolean) => void;
|
|
5
5
|
setBlockedNavigationMessage: (message?: React.ReactNode) => void;
|
|
6
6
|
width?: string;
|
|
7
7
|
close: (force?: boolean) => void;
|
|
8
|
+
pendingClose: boolean;
|
|
9
|
+
setPendingClose: (pendingClose: boolean) => void;
|
|
8
10
|
};
|
|
9
11
|
/**
|
|
10
12
|
* This hook is used to access the properties of a particular side dialog,
|
|
11
13
|
* in contrast with {@link useSideDialogsController} which handles the
|
|
12
14
|
* state of all the dialogs.
|
|
13
15
|
*/
|
|
14
|
-
export declare const useSideDialogContext: () =>
|
|
16
|
+
export declare const useSideDialogContext: () => SideDialogController;
|
|
15
17
|
/**
|
|
16
18
|
* This is the component in charge of rendering the side dialogs used
|
|
17
19
|
* for editing entities. Use the {@link useSideEntityController} to open
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export * from "./FireCMS";
|
|
2
|
-
export * from "../app/Scaffold";
|
|
3
2
|
export * from "./DefaultDrawer";
|
|
4
3
|
export * from "./DrawerNavigationItem";
|
|
5
4
|
export * from "./field_configs";
|
|
6
5
|
export * from "./SideDialogs";
|
|
7
6
|
export * from "./NavigationRoutes";
|
|
7
|
+
export * from "./FireCMSRouter";
|
|
8
|
+
export * from "../app";
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Entity, EntityCollection, EntityCustomViewParams, EntityStatus, FormContext } from "../types";
|
|
3
|
+
import { FormexController } from "@firecms/formex";
|
|
4
|
+
import { ValidationError } from "yup";
|
|
5
|
+
import { EntityFormActionsProps } from "./EntityFormActions";
|
|
6
|
+
export type OnUpdateParams = {
|
|
7
|
+
entity: Entity<any>;
|
|
8
|
+
status: EntityStatus;
|
|
9
|
+
path: string;
|
|
10
|
+
entityId?: string;
|
|
11
|
+
selectedTab?: string;
|
|
12
|
+
collection: EntityCollection<any>;
|
|
13
|
+
};
|
|
14
|
+
export type EntityFormProps<M extends Record<string, any>> = {
|
|
15
|
+
path: string;
|
|
16
|
+
collection: EntityCollection<M>;
|
|
17
|
+
entityId?: string;
|
|
18
|
+
entity?: Entity<M>;
|
|
19
|
+
databaseId?: string;
|
|
20
|
+
onIdChange?: (id: string) => void;
|
|
21
|
+
onValuesModified?: (modified: boolean) => void;
|
|
22
|
+
onSaved?: (params: OnUpdateParams) => void;
|
|
23
|
+
initialDirtyValues?: Partial<M>;
|
|
24
|
+
onFormContextReady?: (formContext: FormContext) => void;
|
|
25
|
+
forceActionsAtTheBottom?: boolean;
|
|
26
|
+
className?: string;
|
|
27
|
+
initialStatus: EntityStatus;
|
|
28
|
+
onStatusChange?: (status: EntityStatus) => void;
|
|
29
|
+
onEntityChange?: (entity: Entity<M>) => void;
|
|
30
|
+
formex?: FormexController<M>;
|
|
31
|
+
openEntityMode?: "side_panel" | "full_screen";
|
|
32
|
+
/**
|
|
33
|
+
* Include the copy and delete actions in the form
|
|
34
|
+
*/
|
|
35
|
+
showDefaultActions?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Display the entity path in the form
|
|
38
|
+
*/
|
|
39
|
+
showEntityPath?: boolean;
|
|
40
|
+
EntityFormActionsComponent?: React.FC<EntityFormActionsProps>;
|
|
41
|
+
Builder?: React.ComponentType<EntityCustomViewParams<M>>;
|
|
42
|
+
children?: React.ReactNode;
|
|
43
|
+
};
|
|
44
|
+
export declare function EntityForm<M extends Record<string, any>>({ path, entityId: entityIdProp, collection, onValuesModified, onIdChange, onSaved, entity, initialDirtyValues, onFormContextReady, forceActionsAtTheBottom, initialStatus, className, onStatusChange, onEntityChange, openEntityMode, formex: formexProp, Builder, EntityFormActionsComponent, showDefaultActions, showEntityPath, children }: EntityFormProps<M>): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
export declare function yupToFormErrors(yupError: ValidationError): Record<string, any>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Entity, ResolvedEntityCollection } from "../types";
|
|
3
|
+
import { FormexController } from "@firecms/formex";
|
|
4
|
+
export interface EntityFormActionsProps {
|
|
5
|
+
collection: ResolvedEntityCollection;
|
|
6
|
+
path: string;
|
|
7
|
+
entity?: Entity;
|
|
8
|
+
layout: "bottom" | "side";
|
|
9
|
+
savingError?: Error;
|
|
10
|
+
formex: FormexController<any>;
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
status: "new" | "existing" | "copy";
|
|
13
|
+
pluginActions: React.ReactNode[];
|
|
14
|
+
openEntityMode: "side_panel" | "full_screen";
|
|
15
|
+
showDefaultActions?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare function EntityFormActions({ collection, entity, layout, savingError, formex, disabled, status, pluginActions, openEntityMode }: EntityFormActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -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> =
|
|
29
|
+
declare function PropertyFieldBindingInternal<T extends CMSType = CMSType, M extends Record<string, any> = any>({ propertyKey, property, context, includeDescription, underlyingValueHasChanged, disabled: disabledProp, partOfArray, minimalistView, autoFocus, index, size, onPropertyChange }: PropertyFieldBindingProps<T, M>): ReactElement<PropertyFieldBindingProps<T, M>>;
|
|
30
30
|
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 ArrayCustomShapedFieldBinding<T extends Array<any>>({ propertyKey, value, error, showError, isSubmitting, setValue, minimalistView, property, includeDescription,
|
|
9
|
+
export declare function ArrayCustomShapedFieldBinding<T extends Array<any>>({ propertyKey, value, error, showError, isSubmitting, setValue, minimalistView: minimalistViewProp, property, includeDescription, context, disabled }: FieldProps<T, any, any>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,5 +7,5 @@ type ArrayOfReferencesFieldProps = FieldProps<EntityReference[]>;
|
|
|
7
7
|
* and tables to the specified properties.
|
|
8
8
|
* @group Form fields
|
|
9
9
|
*/
|
|
10
|
-
export declare function ArrayOfReferencesFieldBinding({ propertyKey, value, error, showError, disabled, isSubmitting, minimalistView, property, includeDescription, setValue, setFieldValue }: ArrayOfReferencesFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function ArrayOfReferencesFieldBinding({ propertyKey, value, error, showError, disabled, isSubmitting, minimalistView: minimalistViewProp, property, includeDescription, setValue, setFieldValue }: ArrayOfReferencesFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -7,4 +7,4 @@ import { FieldProps } from "../../types";
|
|
|
7
7
|
* and tables to the specified properties.
|
|
8
8
|
* @group Form fields
|
|
9
9
|
*/
|
|
10
|
-
export declare function BlockFieldBinding<T extends Array<any>>({ propertyKey, value, error, showError, isSubmitting, setValue, setFieldValue, minimalistView, property, includeDescription, underlyingValueHasChanged, context, disabled }: FieldProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function BlockFieldBinding<T extends Array<any>>({ propertyKey, value, error, showError, isSubmitting, setValue, setFieldValue, minimalistView: minimalistViewProp, property, includeDescription, underlyingValueHasChanged, context, disabled }: FieldProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -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,
|
|
9
|
+
export declare function MapFieldBinding({ propertyKey, value, showError, error, disabled, property, minimalistView: minimalistViewProp, includeDescription, autoFocus, context, onPropertyChange }: FieldProps<Record<string, any>>): import("react/jsx-runtime").JSX.Element;
|