@firecms/core 3.0.0-alpha.81 → 3.0.0-alpha.83
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/EntityCollectionTable/EntityCollectionTableProps.d.ts +4 -3
- package/dist/components/EntityCollectionTable/column_utils.d.ts +2 -2
- package/dist/components/EntityCollectionTable/fields/TableReferenceField.d.ts +5 -1
- package/dist/components/EntityCollectionView/EntityCollectionView.d.ts +2 -2
- package/dist/components/EntityCollectionView/EntityCollectionViewActions.d.ts +1 -1
- package/dist/components/VirtualTable/VirtualTableProps.d.ts +1 -1
- package/dist/contexts/AnalyticsContext.d.ts +3 -0
- package/dist/contexts/CustomizationControllerContext.d.ts +3 -0
- package/dist/core/field_configs.d.ts +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useAnalyticsController.d.ts +5 -0
- package/dist/hooks/useCustomizationController.d.ts +11 -0
- package/dist/hooks/useFireCMSContext.d.ts +0 -1
- package/dist/index.es.js +4878 -4856
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +5 -5
- package/dist/index.umd.js.map +1 -1
- package/dist/internal/useBuildCustomizationController.d.ts +2 -0
- package/dist/types/analytics_controller.d.ts +7 -0
- package/dist/types/collections.d.ts +3 -0
- package/dist/types/customization_controller.d.ts +47 -0
- package/dist/types/entity_callbacks.d.ts +17 -3
- package/dist/types/firecms_context.d.ts +6 -46
- package/dist/types/index.d.ts +2 -0
- package/dist/util/icons.d.ts +4 -1
- package/dist/util/useTraceUpdate.d.ts +1 -1
- package/package.json +3 -3
- package/src/components/DeleteEntityDialog.tsx +9 -3
- package/src/components/EntityCollectionTable/EntityCollectionRowActions.tsx +1 -1
- package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +33 -8
- package/src/components/EntityCollectionTable/EntityCollectionTableProps.tsx +5 -5
- package/src/components/EntityCollectionTable/PropertyTableCell.tsx +1 -1
- package/src/components/EntityCollectionTable/SimpleEntityCollectionTable.tsx +0 -2
- package/src/components/EntityCollectionTable/column_utils.tsx +3 -3
- package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +125 -122
- package/src/components/EntityCollectionTable/filters/DateTimeFilterField.tsx +2 -2
- package/src/components/EntityCollectionTable/internal/default_entity_actions.tsx +3 -3
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +4 -3
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +77 -48
- package/src/components/EntityCollectionView/EntityCollectionViewActions.tsx +5 -3
- package/src/components/EntityPreview.tsx +11 -9
- package/src/components/HomePage/DefaultHomePage.tsx +9 -8
- package/src/components/HomePage/NavigationCollectionCard.tsx +6 -5
- package/src/components/ReferenceSelectionInner.tsx +38 -36
- package/src/components/VirtualTable/VirtualTable.tsx +23 -20
- package/src/components/VirtualTable/VirtualTableCell.tsx +27 -9
- package/src/components/VirtualTable/VirtualTableHeader.tsx +1 -1
- package/src/components/VirtualTable/VirtualTableProps.tsx +2 -2
- package/src/components/VirtualTable/fields/VirtualTableDateField.tsx +2 -2
- package/src/contexts/AnalyticsContext.tsx +4 -0
- package/src/contexts/CustomizationControllerContext.tsx +4 -0
- package/src/core/Drawer.tsx +7 -6
- package/src/core/FireCMS.tsx +39 -29
- package/src/form/EntityForm.tsx +16 -5
- package/src/form/PropertyFieldBinding.tsx +8 -10
- package/src/form/components/CustomIdField.tsx +7 -5
- package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +1 -2
- package/src/form/field_bindings/DateTimeFieldBinding.tsx +2 -2
- package/src/form/field_bindings/KeyValueFieldBinding.tsx +4 -6
- package/src/hooks/data/save.ts +8 -3
- package/src/hooks/index.tsx +1 -0
- package/src/hooks/useAnalyticsController.tsx +8 -0
- package/src/hooks/useCustomizationController.tsx +14 -0
- package/src/hooks/useFireCMSContext.tsx +8 -7
- package/src/internal/EntityView.tsx +4 -2
- package/src/internal/useBuildCustomizationController.tsx +5 -0
- package/src/internal/useBuildSideDialogsController.tsx +0 -1
- package/src/preview/PropertyPreview.tsx +7 -4
- package/src/preview/components/DatePreview.tsx +4 -5
- package/src/preview/components/ReferencePreview.tsx +17 -8
- package/src/preview/property_previews/ArrayOfMapsPreview.tsx +3 -3
- package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +3 -3
- package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +3 -3
- package/src/preview/property_previews/ArrayOfStringsPreview.tsx +4 -4
- package/src/preview/property_previews/ArrayOneOfPreview.tsx +3 -3
- package/src/preview/property_previews/ArrayPropertyPreview.tsx +3 -3
- package/src/types/analytics_controller.tsx +10 -0
- package/src/types/collections.ts +3 -0
- package/src/types/customization_controller.tsx +58 -0
- package/src/types/entity_callbacks.ts +22 -3
- package/src/types/firecms_context.tsx +6 -51
- package/src/types/index.ts +2 -0
- package/src/util/icons.tsx +22 -19
- package/src/util/useTraceUpdate.tsx +5 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { AdditionalFieldDelegate, CollectionSize, Entity, FilterValues, ResolvedProperties, ResolvedProperty, SelectionController,
|
|
2
|
+
import { AdditionalFieldDelegate, CollectionSize, Entity, EntityTableController, FilterValues, ResolvedProperties, ResolvedProperty, SelectionController, User } from "../../types";
|
|
3
3
|
import { OnCellValueChange, UniqueFieldValidator } from "./types";
|
|
4
4
|
/**
|
|
5
5
|
* @group Collection components
|
|
@@ -12,6 +12,7 @@ export type OnColumnResizeParams = {
|
|
|
12
12
|
* @group Collection components
|
|
13
13
|
*/
|
|
14
14
|
export type EntityCollectionTableProps<M extends Record<string, any>, UserType extends User = User> = {
|
|
15
|
+
debugKey?: string;
|
|
15
16
|
/**
|
|
16
17
|
* Display these entities as selected
|
|
17
18
|
*/
|
|
@@ -83,11 +84,11 @@ export type EntityCollectionTableProps<M extends Record<string, any>, UserType e
|
|
|
83
84
|
filterable?: boolean;
|
|
84
85
|
sortable?: boolean;
|
|
85
86
|
endAdornment?: React.ReactNode;
|
|
86
|
-
AdditionalHeaderWidget?:
|
|
87
|
+
AdditionalHeaderWidget?: React.ComponentType<{
|
|
87
88
|
property: ResolvedProperty;
|
|
88
89
|
propertyKey: string;
|
|
89
90
|
onHover: boolean;
|
|
90
|
-
}
|
|
91
|
+
}>;
|
|
91
92
|
AddColumnComponent?: React.ComponentType;
|
|
92
93
|
additionalIDHeaderWidget?: React.ReactNode;
|
|
93
94
|
emptyComponent?: React.ReactNode;
|
|
@@ -7,10 +7,10 @@ export interface PropertiesToColumnsParams<M extends Record<string, any>> {
|
|
|
7
7
|
sortable?: boolean;
|
|
8
8
|
forceFilter?: FilterValues<keyof M extends string ? keyof M : never>;
|
|
9
9
|
disabledFilter?: boolean;
|
|
10
|
-
AdditionalHeaderWidget?:
|
|
10
|
+
AdditionalHeaderWidget?: React.ComponentType<{
|
|
11
11
|
property: ResolvedProperty;
|
|
12
12
|
propertyKey: string;
|
|
13
13
|
onHover: boolean;
|
|
14
|
-
}
|
|
14
|
+
}>;
|
|
15
15
|
}
|
|
16
16
|
export declare function propertiesToColumns<M extends Record<string, any>>({ properties, sortable, forceFilter, disabledFilter, AdditionalHeaderWidget }: PropertiesToColumnsParams<M>): VirtualTableColumn[];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CollectionSize, EntityCollection, EntityReference, FilterValues } from "../../../types";
|
|
2
3
|
type TableReferenceFieldProps = {
|
|
3
4
|
name: string;
|
|
4
5
|
disabled: boolean;
|
|
@@ -12,4 +13,7 @@ type TableReferenceFieldProps = {
|
|
|
12
13
|
forceFilter?: FilterValues<string>;
|
|
13
14
|
};
|
|
14
15
|
export declare function TableReferenceField(props: TableReferenceFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const TableReferenceFieldSuccess: React.NamedExoticComponent<TableReferenceFieldProps & {
|
|
17
|
+
collection: EntityCollection;
|
|
18
|
+
}>;
|
|
15
19
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { EntityCollection, SelectionController } from "../../types";
|
|
2
|
+
import { Entity, EntityCollection, SelectionController } from "../../types";
|
|
3
3
|
/**
|
|
4
4
|
* @group Components
|
|
5
5
|
*/
|
|
@@ -34,4 +34,4 @@ export type EntityCollectionViewProps<M extends Record<string, any>> = {
|
|
|
34
34
|
* @group Components
|
|
35
35
|
*/
|
|
36
36
|
export declare const EntityCollectionView: React.FunctionComponent<EntityCollectionViewProps<any>>;
|
|
37
|
-
export declare function useSelectionController<M extends Record<string, any
|
|
37
|
+
export declare function useSelectionController<M extends Record<string, any> = any>(onSelectionChange?: (entity: Entity<M>, selected: boolean) => void): SelectionController<M>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EntityCollection,
|
|
1
|
+
import { EntityCollection, EntityTableController, SelectionController } from "../../types";
|
|
2
2
|
export type EntityCollectionViewActionsProps<M extends Record<string, any>> = {
|
|
3
3
|
collection: EntityCollection<M>;
|
|
4
4
|
path: string;
|
|
@@ -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" | "
|
|
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;
|
|
7
7
|
export declare function getFieldId(property: Property | ResolvedProperty): string | undefined;
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CustomizationController } from "../types/customization_controller";
|
|
2
|
+
/**
|
|
3
|
+
* Use this hook to retrieve the customization controller.
|
|
4
|
+
* This hook includes all the customization options that can be used
|
|
5
|
+
* to customize the CMS.
|
|
6
|
+
*
|
|
7
|
+
* You will likely not need to use this hook directly.
|
|
8
|
+
*
|
|
9
|
+
* @group Hooks and utilities
|
|
10
|
+
*/
|
|
11
|
+
export declare const useCustomizationController: () => CustomizationController;
|