@firecms/core 3.0.0-beta.13 → 3.0.0-beta.15
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 +7 -12
- package/dist/components/EntityCollectionTable/EntityCollectionRowActions.d.ts +2 -1
- package/dist/components/EntityPreview.d.ts +4 -2
- package/dist/components/HomePage/DefaultHomePage.d.ts +2 -15
- package/dist/components/HomePage/HomePageDnD.d.ts +76 -0
- package/dist/components/HomePage/NavigationCard.d.ts +3 -1
- package/dist/components/HomePage/NavigationCardBinding.d.ts +3 -2
- package/dist/components/HomePage/NavigationGroup.d.ts +7 -1
- package/dist/components/HomePage/RenameGroupDialog.d.ts +9 -0
- package/dist/components/SelectableTable/SelectableTable.d.ts +1 -1
- package/dist/components/VirtualTable/VirtualTableProps.d.ts +0 -4
- package/dist/components/index.d.ts +1 -0
- package/dist/core/EntityEditView.d.ts +3 -0
- package/dist/core/EntityEditViewFormActions.d.ts +1 -1
- package/dist/core/field_configs.d.ts +1 -1
- package/dist/form/EntityForm.d.ts +2 -1
- package/dist/form/EntityFormActions.d.ts +6 -2
- package/dist/form/field_bindings/MapFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/ReferenceAsStringFieldBinding.d.ts +9 -0
- package/dist/form/field_bindings/StorageUploadFieldBinding.d.ts +3 -9
- package/dist/form/index.d.ts +1 -0
- package/dist/hooks/useBuildNavigationController.d.ts +50 -8
- package/dist/index.es.js +3259 -1649
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +3265 -1658
- package/dist/index.umd.js.map +1 -1
- package/dist/types/analytics.d.ts +1 -1
- package/dist/types/collections.d.ts +28 -4
- package/dist/types/customization_controller.d.ts +8 -0
- package/dist/types/entity_actions.d.ts +46 -6
- package/dist/types/firecms.d.ts +10 -1
- package/dist/types/navigation.d.ts +26 -5
- package/dist/types/plugins.d.ts +32 -1
- package/dist/types/properties.d.ts +7 -0
- package/dist/types/property_config.d.ts +1 -1
- package/dist/types/side_entity_controller.d.ts +8 -0
- package/dist/util/callbacks.d.ts +2 -0
- package/dist/util/icons.d.ts +2 -2
- package/dist/util/index.d.ts +1 -0
- package/dist/util/navigation_from_path.d.ts +4 -0
- package/dist/util/resolutions.d.ts +2 -1
- package/package.json +8 -6
- package/src/components/ArrayContainer.tsx +409 -294
- package/src/components/ClearFilterSortButton.tsx +1 -1
- package/src/components/ConfirmationDialog.tsx +10 -9
- package/src/components/EntityCollectionTable/EntityCollectionRowActions.tsx +6 -0
- package/src/components/EntityCollectionTable/PropertyTableCell.tsx +26 -4
- package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.tsx +3 -3
- package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +13 -2
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +53 -27
- package/src/components/EntityCollectionTable/internal/popup_field/useDraggable.tsx +9 -9
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +11 -4
- package/src/components/EntityCollectionView/EntityCollectionViewActions.tsx +3 -2
- package/src/components/EntityPreview.tsx +18 -14
- package/src/components/ErrorView.tsx +1 -1
- package/src/components/FireCMSLogo.tsx +7 -51
- package/src/components/HomePage/DefaultHomePage.tsx +491 -156
- package/src/components/HomePage/FavouritesView.tsx +3 -3
- package/src/components/HomePage/HomePageDnD.tsx +599 -0
- package/src/components/HomePage/NavigationCard.tsx +47 -38
- package/src/components/HomePage/NavigationCardBinding.tsx +13 -7
- package/src/components/HomePage/NavigationGroup.tsx +63 -29
- package/src/components/HomePage/RenameGroupDialog.tsx +117 -0
- package/src/components/SelectableTable/SelectableTable.tsx +140 -143
- package/src/components/UnsavedChangesDialog.tsx +6 -2
- package/src/components/VirtualTable/VirtualTable.tsx +8 -30
- package/src/components/VirtualTable/VirtualTableProps.tsx +0 -5
- package/src/components/VirtualTable/fields/VirtualTableInput.tsx +0 -1
- package/src/components/common/default_entity_actions.tsx +25 -9
- package/src/components/common/useDataSourceTableController.tsx +2 -2
- package/src/components/index.tsx +2 -0
- package/src/core/DefaultDrawer.tsx +8 -8
- package/src/core/DrawerNavigationItem.tsx +1 -1
- package/src/core/EntityEditView.tsx +65 -18
- package/src/core/EntityEditViewFormActions.tsx +154 -29
- package/src/core/EntitySidePanel.tsx +19 -21
- package/src/core/FireCMS.tsx +9 -1
- package/src/core/field_configs.tsx +15 -1
- package/src/form/EntityForm.tsx +37 -5
- package/src/form/EntityFormActions.tsx +51 -9
- package/src/form/PropertyFieldBinding.tsx +0 -1
- package/src/form/components/CustomIdField.tsx +3 -1
- package/src/form/components/LabelWithIcon.tsx +1 -1
- package/src/form/components/StorageItemPreview.tsx +1 -1
- package/src/form/components/StorageUploadProgress.tsx +3 -3
- package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +3 -2
- package/src/form/field_bindings/MapFieldBinding.tsx +5 -4
- package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +4 -2
- package/src/form/field_bindings/MultiSelectFieldBinding.tsx +1 -1
- package/src/form/field_bindings/ReferenceAsStringFieldBinding.tsx +135 -0
- package/src/form/field_bindings/SelectFieldBinding.tsx +2 -1
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +216 -153
- package/src/form/index.tsx +1 -0
- package/src/hooks/data/save.ts +0 -6
- package/src/hooks/useBuildNavigationController.tsx +299 -96
- package/src/internal/useBuildSideEntityController.tsx +8 -5
- package/src/preview/PropertyPreview.tsx +14 -0
- package/src/preview/components/ImagePreview.tsx +2 -2
- package/src/preview/components/ReferencePreview.tsx +1 -1
- package/src/preview/property_previews/ArrayOfMapsPreview.tsx +1 -1
- package/src/preview/property_previews/MapPropertyPreview.tsx +1 -1
- package/src/preview/property_previews/SkeletonPropertyComponent.tsx +1 -1
- package/src/preview/property_previews/StringPropertyPreview.tsx +1 -1
- package/src/routes/FireCMSRoute.tsx +3 -3
- package/src/types/analytics.ts +3 -0
- package/src/types/collections.ts +32 -4
- package/src/types/customization_controller.tsx +9 -0
- package/src/types/entity_actions.tsx +57 -6
- package/src/types/firecms.tsx +11 -2
- package/src/types/navigation.ts +34 -6
- package/src/types/plugins.tsx +40 -1
- package/src/types/properties.ts +8 -0
- package/src/types/property_config.tsx +1 -0
- package/src/types/side_entity_controller.tsx +10 -5
- package/src/util/callbacks.ts +119 -0
- package/src/util/icons.tsx +22 -7
- package/src/util/index.ts +1 -0
- package/src/util/join_collections.ts +3 -1
- package/src/util/navigation_from_path.ts +15 -5
- package/src/util/navigation_utils.ts +72 -57
- package/src/util/objects.ts +53 -20
- package/src/util/resolutions.ts +13 -1
- package/dist/components/EntityCollectionTable/internal/popup_field/ElementResizeListener.d.ts +0 -5
- package/src/components/EntityCollectionTable/internal/popup_field/ElementResizeListener.tsx +0 -59
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { DraggableProvided } from "@hello-pangea/dnd";
|
|
3
2
|
export type ArrayEntryParams = {
|
|
4
3
|
index: number;
|
|
5
4
|
internalId: number;
|
|
@@ -16,9 +15,6 @@ export interface ArrayContainerProps<T> {
|
|
|
16
15
|
disabled?: boolean;
|
|
17
16
|
size?: "small" | "medium";
|
|
18
17
|
onInternalIdAdded?: (id: number) => void;
|
|
19
|
-
/**
|
|
20
|
-
* @deprecated Use `canAddElements` instead
|
|
21
|
-
*/
|
|
22
18
|
includeAddButton?: boolean;
|
|
23
19
|
canAddElements?: boolean;
|
|
24
20
|
sortable?: boolean;
|
|
@@ -28,12 +24,10 @@ export interface ArrayContainerProps<T> {
|
|
|
28
24
|
min?: number;
|
|
29
25
|
max?: number;
|
|
30
26
|
}
|
|
31
|
-
/**
|
|
32
|
-
* @group Form custom fields
|
|
33
|
-
*/
|
|
34
|
-
export declare function ArrayContainer<T>({ droppableId, addLabel, value, disabled, buildEntry, size, onInternalIdAdded, includeAddButton: deprecatedIncludeAddButton, canAddElements: canAddElementsProp, sortable, newDefaultEntry, onValueChange, className, min, max }: ArrayContainerProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
35
27
|
type ArrayContainerItemProps = {
|
|
36
|
-
|
|
28
|
+
nodeRef: (node: HTMLElement | null) => void;
|
|
29
|
+
style: React.CSSProperties;
|
|
30
|
+
dragHandleProps: any;
|
|
37
31
|
index: number;
|
|
38
32
|
internalId: number;
|
|
39
33
|
size?: "small" | "medium";
|
|
@@ -48,17 +42,18 @@ type ArrayContainerItemProps = {
|
|
|
48
42
|
storedProps?: object;
|
|
49
43
|
updateItemCustomProps: (internalId: number, props: object) => void;
|
|
50
44
|
};
|
|
51
|
-
export declare function ArrayContainerItem({
|
|
52
|
-
export declare function ArrayItemOptions({ direction, disabled, remove, index,
|
|
45
|
+
export declare function ArrayContainerItem({ nodeRef, style, dragHandleProps, index, internalId, size, disabled, buildEntry, remove, copy, addInIndex, canAddElements, sortable, isDragging, storedProps, updateItemCustomProps }: ArrayContainerItemProps): import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
export declare function ArrayItemOptions({ dragHandleProps, direction, disabled, remove, index, copy, canAddElements, sortable, addInIndex, }: {
|
|
47
|
+
dragHandleProps: any;
|
|
53
48
|
direction?: "row" | "column";
|
|
54
49
|
disabled: boolean;
|
|
55
50
|
remove: (index: number) => void;
|
|
56
51
|
index: number;
|
|
57
|
-
provided: any;
|
|
58
52
|
copy: (index: number) => void;
|
|
59
53
|
sortable: boolean;
|
|
60
54
|
canAddElements?: boolean;
|
|
61
55
|
addInIndex?: (index: number) => void;
|
|
62
56
|
}): import("react/jsx-runtime").JSX.Element;
|
|
57
|
+
export declare function ArrayContainer<T>({ droppableId, addLabel, value, disabled, buildEntry, size, onInternalIdAdded, includeAddButton: deprecatedIncludeAddButton, canAddElements: canAddElementsProp, sortable, newDefaultEntry, onValueChange, className, min, max }: ArrayContainerProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
63
58
|
export declare function getRandomId(): number;
|
|
64
59
|
export {};
|
|
@@ -12,10 +12,11 @@ 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, openEntityMode }: {
|
|
15
|
+
export declare const EntityCollectionRowActions: ({ entity, collection, fullPath, fullIdPath, 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;
|
|
19
|
+
fullIdPath?: string;
|
|
19
20
|
width: number;
|
|
20
21
|
frozen?: boolean;
|
|
21
22
|
size: CollectionSize;
|
|
@@ -6,18 +6,20 @@ export type EntityPreviewProps = {
|
|
|
6
6
|
actions?: React.ReactNode;
|
|
7
7
|
collection?: EntityCollection;
|
|
8
8
|
hover?: boolean;
|
|
9
|
-
|
|
9
|
+
previewKeys?: string[];
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
entity: Entity<any>;
|
|
12
12
|
includeId?: boolean;
|
|
13
|
+
includeTitle?: boolean;
|
|
13
14
|
includeEntityLink?: boolean;
|
|
15
|
+
includeImage?: boolean;
|
|
14
16
|
onClick?: (e: React.SyntheticEvent) => void;
|
|
15
17
|
};
|
|
16
18
|
/**
|
|
17
19
|
* This view is used to display a preview of an entity.
|
|
18
20
|
* It is used by default in reference fields and whenever a reference is displayed.
|
|
19
21
|
*/
|
|
20
|
-
export declare function EntityPreview({ actions, disabled, hover, collection: collectionProp,
|
|
22
|
+
export declare function EntityPreview({ actions, disabled, hover, collection: collectionProp, previewKeys, onClick, size, includeId, includeTitle, includeEntityLink, includeImage, entity, }: EntityPreviewProps): import("react/jsx-runtime").JSX.Element;
|
|
21
23
|
export type EntityPreviewContainerProps = {
|
|
22
24
|
children: React.ReactNode;
|
|
23
25
|
hover?: boolean;
|
|
@@ -1,21 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* for each collection defined in the navigation.
|
|
5
|
-
|
|
6
|
-
* @group Components
|
|
7
|
-
*/
|
|
2
|
+
export declare const DEFAULT_GROUP_NAME = "Views";
|
|
3
|
+
export declare const ADMIN_GROUP_NAME = "Admin";
|
|
8
4
|
export declare function DefaultHomePage({ additionalActions, additionalChildrenStart, additionalChildrenEnd }: {
|
|
9
|
-
/**
|
|
10
|
-
* Additional actions to be rendered in the home page, close to the search bar.
|
|
11
|
-
*/
|
|
12
5
|
additionalActions?: React.ReactNode;
|
|
13
|
-
/**
|
|
14
|
-
* Additional children to be rendered in the beginning of the home page.
|
|
15
|
-
*/
|
|
16
6
|
additionalChildrenStart?: React.ReactNode;
|
|
17
|
-
/**
|
|
18
|
-
* Additional children to be rendered at the end of the home page.
|
|
19
|
-
*/
|
|
20
7
|
additionalChildrenEnd?: React.ReactNode;
|
|
21
8
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Active, CollisionDetection, DropAnimation, UniqueIdentifier } from "@dnd-kit/core";
|
|
3
|
+
import { NavigationEntry } from "../../types";
|
|
4
|
+
export declare function SortableNavigationCard({ entry, onClick }: {
|
|
5
|
+
entry: NavigationEntry;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function NavigationGroupDroppable({ id, itemIds, children, isPotentialCardDropTarget }: {
|
|
9
|
+
id: UniqueIdentifier;
|
|
10
|
+
itemIds: UniqueIdentifier[];
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
isPotentialCardDropTarget?: boolean;
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function SortableNavigationGroup({ groupName, children, disabled }: {
|
|
15
|
+
groupName: string;
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare function useHomePageDnd({ items: dndItems, setItems: setDndItems, disabled, onCardMovedBetweenGroups, onGroupMoved, onNewGroupDrop, onPersist }: {
|
|
20
|
+
items: {
|
|
21
|
+
name: string;
|
|
22
|
+
entries: NavigationEntry[];
|
|
23
|
+
}[];
|
|
24
|
+
setItems: (newItemsOrUpdater: {
|
|
25
|
+
name: string;
|
|
26
|
+
entries: NavigationEntry[];
|
|
27
|
+
}[] | ((currentItems: {
|
|
28
|
+
name: string;
|
|
29
|
+
entries: NavigationEntry[];
|
|
30
|
+
}[]) => {
|
|
31
|
+
name: string;
|
|
32
|
+
entries: NavigationEntry[];
|
|
33
|
+
}[])) => void;
|
|
34
|
+
disabled: boolean;
|
|
35
|
+
onCardMovedBetweenGroups?: (card: NavigationEntry) => void;
|
|
36
|
+
onGroupMoved?: (groupName: string, oldIndex: number, newIndex: number) => void;
|
|
37
|
+
onNewGroupDrop?: () => void;
|
|
38
|
+
onPersist?: (latest: {
|
|
39
|
+
name: string;
|
|
40
|
+
entries: NavigationEntry[];
|
|
41
|
+
}[]) => void;
|
|
42
|
+
}): {
|
|
43
|
+
sensors: import("@dnd-kit/core").SensorDescriptor<import("@dnd-kit/core").SensorOptions>[];
|
|
44
|
+
collisionDetection: CollisionDetection;
|
|
45
|
+
onDragStart: ({ active }: {
|
|
46
|
+
active: Active;
|
|
47
|
+
}) => void;
|
|
48
|
+
onDragOver: ({ active, over }: {
|
|
49
|
+
active: Active;
|
|
50
|
+
over: any;
|
|
51
|
+
}) => void;
|
|
52
|
+
onDragEnd: ({ active, over }: {
|
|
53
|
+
active: Active;
|
|
54
|
+
over: any;
|
|
55
|
+
}) => void;
|
|
56
|
+
onDragCancel: () => void;
|
|
57
|
+
dropAnimation: DropAnimation;
|
|
58
|
+
activeItemForOverlay: NavigationEntry | null;
|
|
59
|
+
activeGroupData: {
|
|
60
|
+
name: string;
|
|
61
|
+
entries: NavigationEntry[];
|
|
62
|
+
} | null;
|
|
63
|
+
draggingGroupId: UniqueIdentifier | null;
|
|
64
|
+
containers: string[];
|
|
65
|
+
dndKitActiveNode: Active | null;
|
|
66
|
+
isDraggingCardOnly: boolean;
|
|
67
|
+
dialogOpenForGroup: string | null;
|
|
68
|
+
setDialogOpenForGroup: React.Dispatch<React.SetStateAction<string | null>>;
|
|
69
|
+
handleRenameGroup: (oldName: string, newName: string) => void;
|
|
70
|
+
isHoveringNewGroupDropZone: boolean;
|
|
71
|
+
setIsHoveringNewGroupDropZone: React.Dispatch<React.SetStateAction<boolean>>;
|
|
72
|
+
};
|
|
73
|
+
export declare function NewGroupDropZone({ disabled, setIsHovering }: {
|
|
74
|
+
disabled: boolean;
|
|
75
|
+
setIsHovering: (v: boolean) => void;
|
|
76
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
export type NavigationCardProps = {
|
|
2
3
|
name: string;
|
|
3
4
|
description?: string;
|
|
4
5
|
actions: React.ReactNode;
|
|
5
6
|
icon: React.ReactNode;
|
|
6
7
|
onClick?: () => void;
|
|
8
|
+
shrink?: boolean;
|
|
7
9
|
};
|
|
8
|
-
export declare
|
|
10
|
+
export declare const NavigationCard: React.NamedExoticComponent<NavigationCardProps>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NavigationEntry } from "../../types";
|
|
2
2
|
/**
|
|
3
3
|
* This is the component used in the home page to render a card for each
|
|
4
4
|
* collection or view.
|
|
@@ -12,6 +12,7 @@ import { TopNavigationEntry } from "../../types";
|
|
|
12
12
|
* @param onClick
|
|
13
13
|
|
|
14
14
|
*/
|
|
15
|
-
export declare function NavigationCardBinding({ path, collection, view, url, name, description, onClick, type }:
|
|
15
|
+
export declare function NavigationCardBinding({ path, collection, view, url, name, description, onClick, type, shrink }: NavigationEntry & {
|
|
16
16
|
onClick?: () => void;
|
|
17
|
+
shrink?: boolean;
|
|
17
18
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { PropsWithChildren } from "react";
|
|
2
|
-
export declare function NavigationGroup({ children, group
|
|
2
|
+
export declare function NavigationGroup({ children, group, minimised, isPreview, isPotentialCardDropTarget, onEditGroup, // New prop to handle editing
|
|
3
|
+
dndDisabled }: PropsWithChildren<{
|
|
3
4
|
group: string | undefined;
|
|
5
|
+
minimised?: boolean;
|
|
6
|
+
isPreview?: boolean;
|
|
7
|
+
isPotentialCardDropTarget?: boolean;
|
|
8
|
+
onEditGroup?: (groupName: string) => void;
|
|
9
|
+
dndDisabled?: boolean;
|
|
4
10
|
}>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface RenameGroupDialogProps {
|
|
2
|
+
open: boolean;
|
|
3
|
+
initialName: string;
|
|
4
|
+
existingGroupNames: string[];
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
onRename: (newName: string) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function RenameGroupDialog({ open, initialName, existingGroupNames, onClose, onRename }: RenameGroupDialogProps): import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
export {};
|
|
@@ -82,4 +82,4 @@ export type SelectableTableProps<M extends Record<string, any>> = {
|
|
|
82
82
|
* @see VirtualTable
|
|
83
83
|
* @group Components
|
|
84
84
|
*/
|
|
85
|
-
export declare const SelectableTable:
|
|
85
|
+
export declare const SelectableTable: <M extends Record<string, any>>({ onValueChange, cellRenderer, onEntityClick, onColumnResize, hoverRow, size, inlineEditing, tableController: { data, dataLoading, noMoreToLoad, dataLoadingError, filterValues, setFilterValues, sortBy, setSortBy, itemCount, setItemCount, pageSize, paginationEnabled, checkFilterCombination, setPopupCell }, filterable, onScroll, initialScroll, emptyComponent, columns, forceFilter, highlightedRow, endAdornment, AddColumnComponent }: SelectableTableProps<M>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -132,10 +132,6 @@ export interface VirtualTableProps<T extends Record<string, any>> {
|
|
|
132
132
|
* Initial scroll position
|
|
133
133
|
*/
|
|
134
134
|
initialScroll?: number;
|
|
135
|
-
/**
|
|
136
|
-
* Debug mode
|
|
137
|
-
*/
|
|
138
|
-
debug?: boolean;
|
|
139
135
|
}
|
|
140
136
|
export type CellRendererParams<T = any> = {
|
|
141
137
|
column: VirtualTableColumn;
|
|
@@ -18,6 +18,9 @@ export type OnTabChangeParams<M extends Record<string, any>> = {
|
|
|
18
18
|
collection: EntityCollection<M>;
|
|
19
19
|
};
|
|
20
20
|
export interface EntityEditViewProps<M extends Record<string, any>> {
|
|
21
|
+
/**
|
|
22
|
+
* The database path of the entity, e.g. "users" or "products".
|
|
23
|
+
*/
|
|
21
24
|
path: string;
|
|
22
25
|
/**
|
|
23
26
|
* The navigation path to the entity.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
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;
|
|
2
|
+
export declare function EntityEditViewFormActions({ collection, path, entity, layout, savingError, formex, disabled, status, pluginActions, openEntityMode, showDefaultActions, navigateBack, formContext }: EntityFormActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,5 +3,5 @@ export declare function isDefaultFieldConfigId(id: string): boolean;
|
|
|
3
3
|
export declare const DEFAULT_FIELD_CONFIGS: Record<string, PropertyConfig<any>>;
|
|
4
4
|
export declare function getDefaultFieldConfig(property: Property | ResolvedProperty): PropertyConfig | undefined;
|
|
5
5
|
export declare function getFieldConfig(property: Property | ResolvedProperty, propertyConfigs: Record<string, PropertyConfig<any>>): PropertyConfig | undefined;
|
|
6
|
-
export declare function getDefaultFieldId(property: Property | ResolvedProperty): "reference" | "date_time" | "text_field" | "multiline" | "markdown" | "url" | "email" | "select" | "multi_select" | "number_input" | "number_select" | "multi_number_select" | "file_upload" | "multi_file_upload" | "group" | "key_value" | "multi_references" | "switch" | "repeat" | "custom_array" | "block" | undefined;
|
|
6
|
+
export declare function getDefaultFieldId(property: Property | ResolvedProperty): "reference" | "date_time" | "text_field" | "multiline" | "markdown" | "url" | "email" | "select" | "multi_select" | "number_input" | "number_select" | "multi_number_select" | "file_upload" | "multi_file_upload" | "group" | "key_value" | "reference_as_string" | "multi_references" | "switch" | "repeat" | "custom_array" | "block" | undefined;
|
|
7
7
|
export declare function getFieldId(property: Property | ResolvedProperty): string | undefined;
|
|
@@ -13,6 +13,7 @@ export type OnUpdateParams = {
|
|
|
13
13
|
};
|
|
14
14
|
export type EntityFormProps<M extends Record<string, any>> = {
|
|
15
15
|
path: string;
|
|
16
|
+
fullIdPath?: string;
|
|
16
17
|
collection: EntityCollection<M>;
|
|
17
18
|
entityId?: string;
|
|
18
19
|
entity?: Entity<M>;
|
|
@@ -45,5 +46,5 @@ export type EntityFormProps<M extends Record<string, any>> = {
|
|
|
45
46
|
Builder?: React.ComponentType<EntityCustomViewParams<M>>;
|
|
46
47
|
children?: React.ReactNode;
|
|
47
48
|
};
|
|
48
|
-
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, disabled: disabledProp, Builder, EntityFormActionsComponent, showDefaultActions, showEntityPath, children }: EntityFormProps<M>): import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
export declare function EntityForm<M extends Record<string, any>>({ path, fullIdPath, entityId: entityIdProp, collection, onValuesModified, onIdChange, onSaved, entity, initialDirtyValues, onFormContextReady, forceActionsAtTheBottom, initialStatus, className, onStatusChange, onEntityChange, openEntityMode, formex: formexProp, disabled: disabledProp, Builder, EntityFormActionsComponent, showDefaultActions, showEntityPath, children }: EntityFormProps<M>): import("react/jsx-runtime").JSX.Element;
|
|
49
50
|
export declare function yupToFormErrors(yupError: ValidationError): Record<string, any>;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Entity, ResolvedEntityCollection } from "../types";
|
|
2
|
+
import { Entity, FormContext, ResolvedEntityCollection } from "../types";
|
|
3
3
|
import { FormexController } from "@firecms/formex";
|
|
4
4
|
export interface EntityFormActionsProps {
|
|
5
|
+
fullPath: string;
|
|
6
|
+
fullIdPath?: string;
|
|
5
7
|
collection: ResolvedEntityCollection;
|
|
6
8
|
path: string;
|
|
7
9
|
entity?: Entity;
|
|
@@ -13,5 +15,7 @@ export interface EntityFormActionsProps {
|
|
|
13
15
|
pluginActions: React.ReactNode[];
|
|
14
16
|
openEntityMode: "side_panel" | "full_screen";
|
|
15
17
|
showDefaultActions?: boolean;
|
|
18
|
+
navigateBack: () => void;
|
|
19
|
+
formContext: FormContext;
|
|
16
20
|
}
|
|
17
|
-
export declare function EntityFormActions({ collection, entity, layout, savingError, formex, disabled, status, pluginActions, openEntityMode }: EntityFormActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function EntityFormActions({ fullPath, fullIdPath, collection, entity, layout, savingError, formex, disabled, status, pluginActions, openEntityMode, navigateBack, formContext }: EntityFormActionsProps): 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: minimalistViewProp, includeDescription, autoFocus, context, onPropertyChange }: FieldProps<Record<string, any>>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function MapFieldBinding({ propertyKey, value, showError, error, disabled, property, partOfArray, minimalistView: minimalistViewProp, includeDescription, autoFocus, context, onPropertyChange }: FieldProps<Record<string, any>>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FieldProps } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* Field that opens a reference selection dialog and stores the entity ID as a string.
|
|
4
|
+
*
|
|
5
|
+
* This is one of the internal components that get mapped natively inside forms
|
|
6
|
+
* and tables to the specified properties.
|
|
7
|
+
* @group Form fields
|
|
8
|
+
*/
|
|
9
|
+
export declare function ReferenceAsStringFieldBinding(props: FieldProps<string>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import { FieldProps, ResolvedArrayProperty, ResolvedStringProperty, StorageConfig } from "../../types";
|
|
2
2
|
import { StorageFieldItem } from "../../util/useStorageUploadController";
|
|
3
3
|
type StorageUploadFieldProps = FieldProps<string | string[]>;
|
|
4
|
-
/**
|
|
5
|
-
* Field that allows to upload files to Google Cloud Storage.
|
|
6
|
-
*
|
|
7
|
-
* This is one of the internal components that get mapped natively inside forms
|
|
8
|
-
* and tables to the specified properties.
|
|
9
|
-
* @group Form fields
|
|
10
|
-
*/
|
|
11
4
|
export declare function StorageUploadFieldBinding({ propertyKey, value, setValue, error, showError, autoFocus, minimalistView, property, includeDescription, context, isSubmitting, }: StorageUploadFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
12
5
|
export interface StorageUploadProps {
|
|
13
6
|
value: StorageFieldItem[];
|
|
@@ -19,9 +12,10 @@ export interface StorageUploadProps {
|
|
|
19
12
|
autoFocus: boolean;
|
|
20
13
|
disabled: boolean;
|
|
21
14
|
storage: StorageConfig;
|
|
22
|
-
onFilesAdded: (acceptedFiles: File[]) => void
|
|
15
|
+
onFilesAdded: (acceptedFiles: File[]) => Promise<void>;
|
|
23
16
|
storagePathBuilder: (file: File) => string;
|
|
24
17
|
onFileUploadComplete: (uploadedPath: string, entry: StorageFieldItem, fileMetadata?: any) => Promise<void>;
|
|
25
18
|
}
|
|
26
|
-
export declare function StorageUpload({ property, name, value,
|
|
19
|
+
export declare function StorageUpload({ property, name, value, // This is internalValue from useStorageUploadController
|
|
20
|
+
setInternalValue, onChange, multipleFilesSupported, onFileUploadComplete, disabled, onFilesAdded, autoFocus, storage, storagePathBuilder, }: StorageUploadProps): import("react/jsx-runtime").JSX.Element;
|
|
27
21
|
export {};
|
package/dist/form/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { TextFieldBinding } from "./field_bindings/TextFieldBinding";
|
|
|
7
7
|
export { SwitchFieldBinding } from "./field_bindings/SwitchFieldBinding";
|
|
8
8
|
export { DateTimeFieldBinding } from "./field_bindings/DateTimeFieldBinding";
|
|
9
9
|
export { ReferenceFieldBinding } from "./field_bindings/ReferenceFieldBinding";
|
|
10
|
+
export { ReferenceAsStringFieldBinding } from "./field_bindings/ReferenceAsStringFieldBinding";
|
|
10
11
|
export { MapFieldBinding } from "./field_bindings/MapFieldBinding";
|
|
11
12
|
export { KeyValueFieldBinding } from "./field_bindings/KeyValueFieldBinding";
|
|
12
13
|
export { RepeatFieldBinding } from "./field_bindings/RepeatFieldBinding";
|
|
@@ -1,26 +1,68 @@
|
|
|
1
|
-
import { AuthController, CMSView, CMSViewsBuilder, DataSourceDelegate, EntityCollection, EntityCollectionsBuilder, NavigationController, PermissionsBuilder, User, UserConfigurationPersistence } from "../types";
|
|
1
|
+
import { AuthController, CMSView, CMSViewsBuilder, DataSourceDelegate, EntityCollection, EntityCollectionsBuilder, FireCMSPlugin, NavigationController, NavigationGroupMapping, PermissionsBuilder, User, UserConfigurationPersistence } from "../types";
|
|
2
|
+
export declare const NAVIGATION_DEFAULT_GROUP_NAME = "Views";
|
|
3
|
+
export declare const NAVIGATION_ADMIN_GROUP_NAME = "Admin";
|
|
2
4
|
export type BuildNavigationContextProps<EC extends EntityCollection, USER extends User> = {
|
|
5
|
+
/**
|
|
6
|
+
* Base path for the CMS, used to build the all the URLs.
|
|
7
|
+
* Defaults to "/".
|
|
8
|
+
*/
|
|
3
9
|
basePath?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Base path for the collections, used to build the collection URLs.
|
|
12
|
+
* Defaults to "c" (e.g. "/c/products").
|
|
13
|
+
*/
|
|
4
14
|
baseCollectionPath?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The auth controller used to manage the user authentication and permissions.
|
|
17
|
+
*/
|
|
5
18
|
authController: AuthController<USER>;
|
|
19
|
+
/**
|
|
20
|
+
* The collections to be used in the CMS.
|
|
21
|
+
* This can be a static array of collections or a function that returns a promise
|
|
22
|
+
* resolving to an array of collections.
|
|
23
|
+
*/
|
|
6
24
|
collections?: EC[] | EntityCollectionsBuilder<EC>;
|
|
25
|
+
/**
|
|
26
|
+
* Optional permissions builder to be applied to the collections.
|
|
27
|
+
* If not provided, the permissions will be resolved from the collection configuration.
|
|
28
|
+
*/
|
|
7
29
|
collectionPermissions?: PermissionsBuilder;
|
|
30
|
+
/**
|
|
31
|
+
* Custom views to be added to the CMS, these will be available in the main navigation.
|
|
32
|
+
* This can be a static array of views or a function that returns a promise
|
|
33
|
+
* resolving to an array of views.
|
|
34
|
+
*/
|
|
8
35
|
views?: CMSView[] | CMSViewsBuilder;
|
|
36
|
+
/**
|
|
37
|
+
* Custom views to be added to the CMS admin navigation.
|
|
38
|
+
* This can be a static array of views or a function that returns a promise
|
|
39
|
+
* resolving to an array of views.
|
|
40
|
+
*/
|
|
9
41
|
adminViews?: CMSView[] | CMSViewsBuilder;
|
|
10
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Controller for storing user preferences.
|
|
44
|
+
*/
|
|
11
45
|
userConfigPersistence?: UserConfigurationPersistence;
|
|
46
|
+
/**
|
|
47
|
+
* Delegate for data source operations, used to resolve collections and views.
|
|
48
|
+
*/
|
|
12
49
|
dataSourceDelegate: DataSourceDelegate;
|
|
13
50
|
/**
|
|
14
|
-
*
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*
|
|
51
|
+
* Plugins to be used in the CMS.
|
|
52
|
+
*/
|
|
53
|
+
plugins?: FireCMSPlugin[];
|
|
54
|
+
/**
|
|
55
|
+
* Used to define the name of groups and order of the navigation entries.
|
|
19
56
|
*/
|
|
20
|
-
|
|
57
|
+
navigationGroupMappings?: NavigationGroupMapping[];
|
|
21
58
|
/**
|
|
22
59
|
* If true, the navigation logic will not be updated until this flag is false
|
|
23
60
|
*/
|
|
24
61
|
disabled?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* @deprecated
|
|
64
|
+
* Use `navigationGroupMappings` instead.
|
|
65
|
+
*/
|
|
66
|
+
viewsOrder?: string[];
|
|
25
67
|
};
|
|
26
68
|
export declare function useBuildNavigationController<EC extends EntityCollection, USER extends User>(props: BuildNavigationContextProps<EC, USER>): NavigationController;
|