@firecms/core 3.0.0-alpha.27 → 3.0.0-alpha.29
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/Popover.d.ts +3 -1
- package/dist/core/FireCMS.d.ts +2 -2
- package/dist/core/builders.d.ts +5 -5
- package/dist/core/components/EntityCollectionTable/EntityCollectionTableProps.d.ts +4 -2
- package/dist/core/components/EntityCollectionTable/filters/ReferenceFilterField.d.ts +3 -3
- package/dist/core/components/EntityCollectionTable/internal/EntityCollectionRowActions.d.ts +15 -11
- package/dist/core/components/EntityCollectionTable/internal/default_entity_actions.d.ts +5 -0
- package/dist/core/components/EntityCollectionTable/types.d.ts +1 -37
- package/dist/core/components/FieldConfigBadge.d.ts +3 -3
- package/dist/core/components/VirtualTable/VirtualTableHeader.d.ts +2 -2
- package/dist/core/components/VirtualTable/VirtualTableProps.d.ts +1 -1
- package/dist/core/contexts/DialogsProvider.d.ts +4 -0
- package/dist/core/form_field_configs.d.ts +3 -3
- package/dist/core/index.d.ts +1 -1
- package/dist/core/internal/useBuildNavigationContext.d.ts +3 -3
- package/dist/core/util/property_utils.d.ts +5 -5
- package/dist/core/util/references.d.ts +2 -2
- package/dist/core/util/resolutions.d.ts +6 -6
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useBuildDataSource.d.ts +23 -0
- package/dist/hooks/useDialogsController.d.ts +11 -0
- package/dist/index.es.js +8996 -8583
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +67 -67
- package/dist/index.umd.js.map +1 -1
- package/dist/styles.d.ts +1 -1
- package/dist/types/collections.d.ts +36 -13
- package/dist/types/datasource.d.ts +120 -11
- package/dist/types/dialogs_controller.d.ts +30 -0
- package/dist/types/entity_actions.d.ts +33 -0
- package/dist/types/fields.d.ts +1 -1
- package/dist/types/firecms.d.ts +8 -8
- package/dist/types/firecms_context.d.ts +10 -3
- package/dist/types/index.d.ts +2 -1
- package/dist/types/navigation.d.ts +3 -3
- package/dist/types/plugins.d.ts +11 -10
- package/dist/types/properties.d.ts +1 -1
- package/dist/types/{field_config.d.ts → property_config.d.ts} +3 -4
- package/package.json +3 -3
- package/src/components/Popover.tsx +10 -3
- package/src/components/Sheet.tsx +1 -0
- package/src/components/TextareaAutosize.tsx +2 -1
- package/src/core/FireCMS.tsx +9 -6
- package/src/core/builders.ts +11 -11
- package/src/core/components/ArrayContainer.tsx +1 -1
- package/src/core/components/EntityCollectionTable/EntityCollectionTable.tsx +20 -13
- package/src/core/components/EntityCollectionTable/EntityCollectionTableProps.tsx +5 -2
- package/src/core/components/EntityCollectionTable/filters/ReferenceFilterField.tsx +11 -6
- package/src/core/components/EntityCollectionTable/internal/EntityCollectionRowActions.tsx +96 -79
- package/src/core/components/EntityCollectionTable/internal/PropertyTableCell.tsx +2 -2
- package/src/core/components/EntityCollectionTable/internal/default_entity_actions.tsx +107 -0
- package/src/core/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +6 -2
- package/src/core/components/EntityCollectionTable/types.tsx +1 -56
- package/src/core/components/EntityCollectionView/EntityCollectionView.tsx +67 -43
- package/src/core/components/FieldConfigBadge.tsx +4 -4
- package/src/core/components/ReferenceSelectionInner.tsx +2 -2
- package/src/core/components/VirtualTable/VirtualTable.tsx +4 -6
- package/src/core/components/VirtualTable/VirtualTableHeader.tsx +21 -18
- package/src/core/components/VirtualTable/VirtualTableProps.tsx +1 -1
- package/src/core/contexts/DialogsProvider.tsx +50 -0
- package/src/core/form_field_configs.tsx +5 -5
- package/src/core/index.tsx +1 -1
- package/src/core/internal/useBuildNavigationContext.tsx +13 -13
- package/src/core/internal/useBuildSideEntityController.tsx +9 -1
- package/src/core/util/property_utils.tsx +5 -5
- package/src/core/util/references.ts +2 -2
- package/src/core/util/resolutions.ts +16 -11
- package/src/form/EntityForm.tsx +64 -7
- package/src/form/PropertyFieldBinding.tsx +4 -4
- package/src/form/field_bindings/KeyValueFieldBinding.tsx +1 -1
- package/src/form/field_bindings/ReadOnlyFieldBinding.tsx +4 -6
- package/src/hooks/index.tsx +1 -0
- package/src/hooks/useBuildDataSource.ts +351 -0
- package/src/hooks/useDialogsController.tsx +14 -0
- package/src/hooks/useFireCMSContext.tsx +5 -11
- package/src/preview/property_previews/StringPropertyPreview.tsx +4 -2
- package/src/styles.ts +1 -1
- package/src/types/collections.ts +36 -17
- package/src/types/datasource.ts +174 -10
- package/src/types/dialogs_controller.tsx +31 -0
- package/src/types/entity_actions.tsx +36 -0
- package/src/types/fields.tsx +1 -1
- package/src/types/firecms.tsx +8 -8
- package/src/types/firecms_context.tsx +11 -3
- package/src/types/index.ts +2 -1
- package/src/types/navigation.ts +3 -3
- package/src/types/plugins.tsx +11 -10
- package/src/types/properties.ts +1 -1
- package/src/types/{field_config.tsx → property_config.tsx} +3 -4
- /package/dist/core/contexts/{SnackbarContext.d.ts → SnackbarProvider.d.ts} +0 -0
- /package/src/core/contexts/{SnackbarContext.tsx → SnackbarProvider.tsx} +0 -0
|
@@ -15,5 +15,7 @@ export interface PopoverProps {
|
|
|
15
15
|
hideWhenDetached?: boolean;
|
|
16
16
|
avoidCollisions?: boolean;
|
|
17
17
|
enabled?: boolean;
|
|
18
|
+
modal?: boolean;
|
|
19
|
+
className?: string;
|
|
18
20
|
}
|
|
19
|
-
export declare function Popover({ trigger, children, open, onOpenChange, side, sideOffset, align, alignOffset, arrowPadding, sticky, hideWhenDetached, avoidCollisions, enabled }: PopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function Popover({ trigger, children, open, onOpenChange, side, sideOffset, align, alignOffset, arrowPadding, sticky, hideWhenDetached, avoidCollisions, enabled, modal, className }: PopoverProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/core/FireCMS.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FireCMSProps, User } from "../types";
|
|
1
|
+
import { EntityCollection, FireCMSProps, User } from "../types";
|
|
2
2
|
/**
|
|
3
3
|
* If you are using independent components of the CMS
|
|
4
4
|
* you need to wrap them with this main component, so the internal hooks work.
|
|
@@ -12,4 +12,4 @@ import { FireCMSProps, User } from "../types";
|
|
|
12
12
|
* @constructor
|
|
13
13
|
* @category Core
|
|
14
14
|
*/
|
|
15
|
-
export declare function FireCMS<UserType extends User>(props: FireCMSProps<UserType>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function FireCMS<UserType extends User, EC extends EntityCollection>(props: FireCMSProps<UserType, EC>): import("react/jsx-runtime").JSX.Element;
|
package/dist/core/builders.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { AdditionalFieldDelegate, ArrayProperty, BooleanProperty, CMSType, DateProperty, EntityCallbacks, EntityCollection, EnumValueConfig, EnumValues,
|
|
1
|
+
import { AdditionalFieldDelegate, ArrayProperty, BooleanProperty, CMSType, DateProperty, EntityCallbacks, EntityCollection, EnumValueConfig, EnumValues, PropertyConfig, GeopointProperty, MapProperty, NumberProperty, PropertiesOrBuilders, PropertyBuilder, PropertyOrBuilder, ReferenceProperty, StringProperty, User } from "../types";
|
|
2
2
|
/**
|
|
3
3
|
* Identity function we use to defeat the type system of Typescript and build
|
|
4
4
|
* collection views with all its properties
|
|
5
5
|
* @param collection
|
|
6
6
|
* @category Builder
|
|
7
7
|
*/
|
|
8
|
-
export declare function buildCollection<M extends Record<string, any> = any,
|
|
8
|
+
export declare function buildCollection<M extends Record<string, any> = any, UserType extends User = User>(collection: EntityCollection<M, UserType>): EntityCollection<M, UserType>;
|
|
9
9
|
/**
|
|
10
10
|
* Identity function we use to defeat the type system of Typescript and preserve
|
|
11
11
|
* the property keys.
|
|
@@ -54,11 +54,11 @@ export declare function buildEntityCallbacks<M extends Record<string, any> = any
|
|
|
54
54
|
* @param additionalFieldDelegate
|
|
55
55
|
* @category Builder
|
|
56
56
|
*/
|
|
57
|
-
export declare function buildAdditionalFieldDelegate<M extends Record<string, any>,
|
|
57
|
+
export declare function buildAdditionalFieldDelegate<M extends Record<string, any>, UserType extends User = User>(additionalFieldDelegate: AdditionalFieldDelegate<M, UserType>): AdditionalFieldDelegate<M, UserType>;
|
|
58
58
|
/**
|
|
59
59
|
* Identity function we use to defeat the type system of Typescript and build
|
|
60
60
|
* additional field delegates views with all its properties
|
|
61
|
-
* @param
|
|
61
|
+
* @param propertyConfig
|
|
62
62
|
* @category Builder
|
|
63
63
|
*/
|
|
64
|
-
export declare function buildFieldConfig<T extends CMSType = CMSType>(
|
|
64
|
+
export declare function buildFieldConfig<T extends CMSType = CMSType>(propertyConfig: PropertyConfig<T>): PropertyConfig<T>;
|
|
@@ -11,7 +11,7 @@ export type OnColumnResizeParams = {
|
|
|
11
11
|
/**
|
|
12
12
|
* @category Collection components
|
|
13
13
|
*/
|
|
14
|
-
export type EntityCollectionTableProps<M extends Record<string, any>,
|
|
14
|
+
export type EntityCollectionTableProps<M extends Record<string, any>, UserType extends User = User> = {
|
|
15
15
|
/**
|
|
16
16
|
* Display these entities as selected
|
|
17
17
|
*/
|
|
@@ -76,7 +76,7 @@ export type EntityCollectionTableProps<M extends Record<string, any>, Additional
|
|
|
76
76
|
forceFilter?: FilterValues<Extract<keyof M, string>>;
|
|
77
77
|
textSearchEnabled?: boolean;
|
|
78
78
|
inlineEditing?: boolean | ((entity: Entity<M>) => boolean);
|
|
79
|
-
additionalFields?: AdditionalFieldDelegate<M,
|
|
79
|
+
additionalFields?: AdditionalFieldDelegate<M, UserType>[];
|
|
80
80
|
defaultSize?: CollectionSize;
|
|
81
81
|
properties: ResolvedProperties<M>;
|
|
82
82
|
getPropertyFor?: (props: GetPropertyForProps<M>) => ResolvedProperties<M>[string];
|
|
@@ -90,6 +90,8 @@ export type EntityCollectionTableProps<M extends Record<string, any>, Additional
|
|
|
90
90
|
}) => React.ReactNode;
|
|
91
91
|
AddColumnComponent?: React.ComponentType;
|
|
92
92
|
additionalIDHeaderWidget?: React.ReactNode;
|
|
93
|
+
emptyComponent?: React.ReactNode;
|
|
94
|
+
getIdColumnWidth?: () => number;
|
|
93
95
|
};
|
|
94
96
|
export type GetPropertyForProps<M extends Record<string, any>> = {
|
|
95
97
|
propertyKey: string;
|
|
@@ -7,8 +7,8 @@ interface ReferenceFilterFieldProps {
|
|
|
7
7
|
path?: string;
|
|
8
8
|
title?: string;
|
|
9
9
|
previewProperties?: string[];
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
hidden: boolean;
|
|
11
|
+
setHidden: (hidden: boolean) => void;
|
|
12
12
|
}
|
|
13
|
-
export declare function ReferenceFilterField({ name, value, setValue, isArray, path, title, previewProperties,
|
|
13
|
+
export declare function ReferenceFilterField({ name, value, setValue, isArray, path, title, previewProperties, setHidden }: ReferenceFilterFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CollectionSize, Entity, EntityAction, EntityCollection, SelectionController } from "../../../../types";
|
|
2
3
|
/**
|
|
3
4
|
*
|
|
4
5
|
* @param entity
|
|
@@ -16,16 +17,19 @@ import { CollectionSize, Entity } from "../../../../types";
|
|
|
16
17
|
*
|
|
17
18
|
* @category Collection components
|
|
18
19
|
*/
|
|
19
|
-
export declare
|
|
20
|
-
entity: Entity<
|
|
20
|
+
export declare const EntityCollectionRowActions: React.NamedExoticComponent<{
|
|
21
|
+
entity: Entity<any>;
|
|
22
|
+
collection?: EntityCollection<any, import("../../../../types").User> | undefined;
|
|
23
|
+
fullPath?: string | undefined;
|
|
21
24
|
width: number;
|
|
22
|
-
frozen?: boolean;
|
|
25
|
+
frozen?: boolean | undefined;
|
|
23
26
|
size: CollectionSize;
|
|
24
27
|
isSelected: boolean;
|
|
25
|
-
selectionEnabled?: boolean;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
selectionEnabled?: boolean | undefined;
|
|
29
|
+
actions?: EntityAction[] | undefined;
|
|
30
|
+
hideId?: boolean | undefined;
|
|
31
|
+
onCollectionChange?: (() => void) | undefined;
|
|
32
|
+
selectionController?: SelectionController | undefined;
|
|
33
|
+
highlightEntity?: ((entity: Entity<any>) => void) | undefined;
|
|
34
|
+
unhighlightEntity?: ((entity: Entity<any>) => void) | undefined;
|
|
35
|
+
}>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { EntityAction } from "../../../../types";
|
|
2
|
+
export declare const editEntityAction: EntityAction;
|
|
3
|
+
export declare const copyEntityAction: EntityAction;
|
|
4
|
+
export declare const archiveEntityAction: EntityAction;
|
|
5
|
+
export declare const deleteEntityAction: EntityAction;
|
|
@@ -1,40 +1,4 @@
|
|
|
1
|
-
import { CollectionSize, Entity,
|
|
2
|
-
export type EntityCollectionTableProviderProps<M extends Record<string, any>, AdditionalKey extends string, UserType extends User> = {
|
|
3
|
-
/**
|
|
4
|
-
* Absolute collection path
|
|
5
|
-
*/
|
|
6
|
-
path: string;
|
|
7
|
-
/**
|
|
8
|
-
* Use to resolve the collection properties for specific path, entity id or values
|
|
9
|
-
*/
|
|
10
|
-
collection: EntityCollection<M>;
|
|
11
|
-
/**
|
|
12
|
-
* List of entities that will be displayed on top, no matter the ordering.
|
|
13
|
-
* This is used for reference fields selection
|
|
14
|
-
*/
|
|
15
|
-
entitiesDisplayedFirst?: Entity<M>[];
|
|
16
|
-
/**
|
|
17
|
-
* Callback when anywhere on the table is clicked
|
|
18
|
-
*/
|
|
19
|
-
onEntityClick?(entity: Entity<M>): void;
|
|
20
|
-
/**
|
|
21
|
-
* Callback when the selected size of the table is changed
|
|
22
|
-
*/
|
|
23
|
-
onSizeChanged?(size: CollectionSize): void;
|
|
24
|
-
/**
|
|
25
|
-
* Can the table be edited inline
|
|
26
|
-
*/
|
|
27
|
-
inlineEditing: ((entity: Entity<any>) => boolean) | boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Builder for creating the buttons in each row
|
|
30
|
-
* @param entity
|
|
31
|
-
* @param size
|
|
32
|
-
*/
|
|
33
|
-
tableRowActionsBuilder?: ({ entity, size }: {
|
|
34
|
-
entity: Entity<M>;
|
|
35
|
-
size: CollectionSize;
|
|
36
|
-
}) => React.ReactNode;
|
|
37
|
-
};
|
|
1
|
+
import { CollectionSize, Entity, FireCMSContext, ResolvedProperty, SelectedCellProps } from "../../../types";
|
|
38
2
|
export type EntityCollectionTableController<M extends Record<string, any>> = {
|
|
39
3
|
selectedCell?: SelectedCellProps<any>;
|
|
40
4
|
select: (cell?: SelectedCellProps<M>) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function FieldConfigBadge({
|
|
3
|
-
|
|
1
|
+
import { PropertyConfig } from "../../types";
|
|
2
|
+
export declare function FieldConfigBadge({ propertyConfig }: {
|
|
3
|
+
propertyConfig: PropertyConfig | undefined;
|
|
4
4
|
}): React.ReactNode;
|
|
@@ -5,8 +5,8 @@ export type FilterFormFieldProps<CustomProps> = {
|
|
|
5
5
|
filterValue: [VirtualTableWhereFilterOp, any] | undefined;
|
|
6
6
|
setFilterValue: (filterValue?: [VirtualTableWhereFilterOp, any]) => void;
|
|
7
7
|
column: VirtualTableColumn<CustomProps>;
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
hidden: boolean;
|
|
9
|
+
setHidden: (hidden: boolean) => void;
|
|
10
10
|
};
|
|
11
11
|
type VirtualTableHeaderProps<M extends Record<string, any>> = {
|
|
12
12
|
resizeHandleRef: RefObject<HTMLDivElement>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from "react";
|
|
2
|
+
import { DialogsController } from "../../types/dialogs_controller";
|
|
3
|
+
export declare const DialogsControllerContext: React.Context<DialogsController>;
|
|
4
|
+
export declare const DialogsProvider: React.FC<PropsWithChildren<{}>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PropertyConfig, Property, ResolvedProperty } from "../types";
|
|
2
2
|
export declare function isDefaultFieldConfigId(id: string): boolean;
|
|
3
|
-
export declare const DEFAULT_FIELD_CONFIGS: Record<string,
|
|
4
|
-
export declare function getFieldConfig(property: Property | ResolvedProperty, customFields: Record<string,
|
|
3
|
+
export declare const DEFAULT_FIELD_CONFIGS: Record<string, PropertyConfig<any>>;
|
|
4
|
+
export declare function getFieldConfig(property: Property | ResolvedProperty, customFields: Record<string, PropertyConfig<any>>): PropertyConfig | undefined;
|
|
5
5
|
export declare function getDefaultFieldId(property: Property | ResolvedProperty): "reference" | "date_time" | "email" | "url" | "group" | "switch" | "block" | "file_upload" | "repeat" | "select" | "text_field" | "multiline" | "markdown" | "multi_select" | "number_input" | "number_select" | "multi_number_select" | "multi_file_upload" | "multi_references" | "key_value" | "custom_array" | undefined;
|
|
6
6
|
export declare function getFieldId(property: Property | ResolvedProperty): string | undefined;
|
package/dist/core/index.d.ts
CHANGED
|
@@ -12,6 +12,6 @@ export * from "./form_field_configs";
|
|
|
12
12
|
export * from "./useBuildModeController";
|
|
13
13
|
export * from "../components/util/useOutsideAlerter";
|
|
14
14
|
export * from "./useBuildLocalConfigurationPersistence";
|
|
15
|
-
export { SnackbarProvider } from "./contexts/
|
|
15
|
+
export { SnackbarProvider } from "./contexts/SnackbarProvider";
|
|
16
16
|
export { ModeControllerProvider } from "./contexts/ModeController";
|
|
17
17
|
export * from "./contexts/AuthControllerContext";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { AuthController, CMSView, CMSViewsBuilder, DataSource, EntityCollection, EntityCollectionsBuilder, FireCMSPlugin, NavigationContext, User, UserConfigurationPersistence } from "../../types";
|
|
2
|
-
type BuildNavigationContextProps<UserType extends User> = {
|
|
2
|
+
type BuildNavigationContextProps<EC extends EntityCollection, UserType extends User> = {
|
|
3
3
|
basePath: string;
|
|
4
4
|
baseCollectionPath: string;
|
|
5
5
|
authController: AuthController<UserType>;
|
|
6
|
-
collections?:
|
|
6
|
+
collections?: EC[] | EntityCollectionsBuilder<EC>;
|
|
7
7
|
views?: CMSView[] | CMSViewsBuilder;
|
|
8
8
|
userConfigPersistence?: UserConfigurationPersistence;
|
|
9
9
|
plugins?: FireCMSPlugin[];
|
|
10
10
|
dataSource: DataSource;
|
|
11
11
|
};
|
|
12
|
-
export declare function useBuildNavigationContext<UserType extends User>({ basePath, baseCollectionPath, authController, collections: baseCollections, views: baseViews, userConfigPersistence, plugins, dataSource }: BuildNavigationContextProps<UserType>): NavigationContext;
|
|
12
|
+
export declare function useBuildNavigationContext<EC extends EntityCollection, UserType extends User>({ basePath, baseCollectionPath, authController, collections: baseCollections, views: baseViews, userConfigPersistence, plugins, dataSource }: BuildNavigationContextProps<EC, UserType>): NavigationContext;
|
|
13
13
|
export declare function getSidePanelKey(path: string, entityId?: string): string;
|
|
14
14
|
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { EntityCollection,
|
|
3
|
-
export declare function isReferenceProperty(propertyOrBuilder: PropertyOrBuilder, fields: Record<string,
|
|
2
|
+
import { EntityCollection, PropertyConfig, PropertiesOrBuilders, PropertyOrBuilder, ResolvedProperty } from "../../types";
|
|
3
|
+
export declare function isReferenceProperty(propertyOrBuilder: PropertyOrBuilder, fields: Record<string, PropertyConfig>): boolean | null;
|
|
4
4
|
export declare function getIdIcon(size: "small" | "medium" | "large"): React.ReactNode;
|
|
5
|
-
export declare function getIconForWidget(widget:
|
|
6
|
-
export declare function getIconForProperty(property: PropertyOrBuilder | ResolvedProperty, size?: "small" | "medium" | "large", fields?: Record<string,
|
|
7
|
-
export declare function getColorForProperty(property: PropertyOrBuilder, fields: Record<string,
|
|
5
|
+
export declare function getIconForWidget(widget: PropertyConfig | undefined, size: "small" | "medium" | "large"): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function getIconForProperty(property: PropertyOrBuilder | ResolvedProperty, size?: "small" | "medium" | "large", fields?: Record<string, PropertyConfig>): React.ReactNode;
|
|
7
|
+
export declare function getColorForProperty(property: PropertyOrBuilder, fields: Record<string, PropertyConfig>): string;
|
|
8
8
|
/**
|
|
9
9
|
* Get a property in a property tree from a path like
|
|
10
10
|
* `address.street`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { EntityCollection,
|
|
2
|
-
export declare function getReferencePreviewKeys(targetCollection: EntityCollection<any>, fields: Record<string,
|
|
1
|
+
import { EntityCollection, PropertyConfig } from "../../types";
|
|
2
|
+
export declare function getReferencePreviewKeys(targetCollection: EntityCollection<any>, fields: Record<string, PropertyConfig>, previewProperties?: string[], limit?: number): string[];
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ArrayProperty, CMSType, EntityCollection, EntityCustomView, EntityValues, EnumValueConfig, EnumValues,
|
|
1
|
+
import { ArrayProperty, CMSType, EntityCollection, EntityCustomView, EntityValues, EnumValueConfig, EnumValues, PropertyConfig, NumberProperty, PropertiesOrBuilders, PropertyOrBuilder, ResolvedArrayProperty, ResolvedEntityCollection, ResolvedNumberProperty, ResolvedProperties, ResolvedProperty, ResolvedStringProperty, StringProperty, UserConfigurationPersistence } from "../../types";
|
|
2
2
|
export declare const resolveCollection: <M extends Record<string, any>>({ collection, path, entityId, values, previousValues, userConfigPersistence, fields }: {
|
|
3
|
-
collection: EntityCollection<M,
|
|
3
|
+
collection: EntityCollection<M, import("../../types").User> | ResolvedEntityCollection<M>;
|
|
4
4
|
path: string;
|
|
5
5
|
entityId?: string | undefined;
|
|
6
6
|
values?: Partial<M> | undefined;
|
|
7
7
|
previousValues?: Partial<M> | undefined;
|
|
8
8
|
userConfigPersistence?: UserConfigurationPersistence | undefined;
|
|
9
|
-
fields?: Record<string,
|
|
9
|
+
fields?: Record<string, PropertyConfig> | undefined;
|
|
10
10
|
}) => ResolvedEntityCollection<M>;
|
|
11
11
|
/**
|
|
12
12
|
* Resolve property builders, enums and arrays.
|
|
@@ -24,7 +24,7 @@ export declare function resolveProperty<T extends CMSType = CMSType, M extends R
|
|
|
24
24
|
entityId?: string;
|
|
25
25
|
index?: number;
|
|
26
26
|
fromBuilder?: boolean;
|
|
27
|
-
fields?: Record<string,
|
|
27
|
+
fields?: Record<string, PropertyConfig<any>>;
|
|
28
28
|
}): ResolvedProperty<T> | null;
|
|
29
29
|
export declare function resolveArrayProperty<T extends any[], M>({ propertyKey, property, propertyValue, ...props }: {
|
|
30
30
|
propertyKey?: string;
|
|
@@ -36,7 +36,7 @@ export declare function resolveArrayProperty<T extends any[], M>({ propertyKey,
|
|
|
36
36
|
entityId?: string;
|
|
37
37
|
index?: number;
|
|
38
38
|
fromBuilder?: boolean;
|
|
39
|
-
fields?: Record<string,
|
|
39
|
+
fields?: Record<string, PropertyConfig>;
|
|
40
40
|
}): ResolvedArrayProperty;
|
|
41
41
|
/**
|
|
42
42
|
* Resolve enums and arrays for properties
|
|
@@ -52,7 +52,7 @@ export declare function resolveProperties<M extends Record<string, any>>({ prope
|
|
|
52
52
|
entityId?: string;
|
|
53
53
|
index?: number;
|
|
54
54
|
fromBuilder?: boolean;
|
|
55
|
-
fields?: Record<string,
|
|
55
|
+
fields?: Record<string, PropertyConfig>;
|
|
56
56
|
}): ResolvedProperties<M>;
|
|
57
57
|
/**
|
|
58
58
|
* Resolve enum aliases for a string or number property
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DataSource, DataSourceDelegate, EntityReference, GeoPoint, PropertyConfig } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Use this hook to build a {@link DataSource} based on Firestore
|
|
4
|
+
* @param firebaseApp
|
|
5
|
+
* @param textSearchController
|
|
6
|
+
* @param collectionRegistry
|
|
7
|
+
* @category Firebase
|
|
8
|
+
*/
|
|
9
|
+
export declare function useBuildDataSource({ delegate, customFields }: {
|
|
10
|
+
delegate: DataSourceDelegate;
|
|
11
|
+
customFields: Record<string, PropertyConfig>;
|
|
12
|
+
}): DataSource;
|
|
13
|
+
/**
|
|
14
|
+
* Recursive function that converts Firestore data types into CMS or plain
|
|
15
|
+
* JS types.
|
|
16
|
+
* FireCMS uses Javascript dates internally instead of Firestore timestamps.
|
|
17
|
+
* This makes it easier to interact with the rest of the libraries and
|
|
18
|
+
* bindings.
|
|
19
|
+
* Also, Firestore references are replaced with {@link EntityReference}
|
|
20
|
+
* @param data
|
|
21
|
+
* @category Firestore
|
|
22
|
+
*/
|
|
23
|
+
export declare function cmsToDelegateModel(data: any, buildReference: (reference: EntityReference) => any, buildGeoPoint: (geoPoint: GeoPoint) => any, buildDate: (date: Date) => any, buildDelete: () => any): any;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DialogsController } from "../types/dialogs_controller";
|
|
2
|
+
/**
|
|
3
|
+
* Use this hook to open a dialog imperatively.
|
|
4
|
+
* Alternatively, you can use dialogs declaratively using the `Dialog` component.
|
|
5
|
+
*
|
|
6
|
+
* Consider that in order to use this hook you need to have a parent
|
|
7
|
+
* `FireCMS`
|
|
8
|
+
*
|
|
9
|
+
* @category Hooks and utilities
|
|
10
|
+
*/
|
|
11
|
+
export declare const useDialogsController: () => DialogsController;
|