@firecms/core 3.4.0-canary.63041d0 → 3.4.0-canary.d20cc85
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/internal/popup_field/PopupFormField.d.ts +3 -1
- package/dist/components/EntityCollectionView/EntityCollectionBoardView.d.ts +3 -1
- package/dist/components/EntityCollectionView/useBoardDataController.d.ts +3 -1
- package/dist/components/ReferenceTable/ReferenceSelectionTable.d.ts +10 -1
- package/dist/form/EntityForm.d.ts +6 -1
- package/dist/hooks/data/useCollectionFetch.d.ts +7 -1
- package/dist/index.es.js +177 -112
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +177 -112
- package/dist/index.umd.js.map +1 -1
- package/dist/types/datasource.d.ts +17 -4
- package/dist/types/entities.d.ts +21 -1
- package/dist/util/parent_references_from_path.d.ts +1 -0
- package/package.json +4 -4
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +5 -1
- package/src/components/EntityCollectionView/EntityCollectionBoardView.tsx +4 -0
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +10 -2
- package/src/components/EntityCollectionView/useBoardDataController.tsx +11 -0
- package/src/components/ReferenceTable/ReferenceSelectionTable.tsx +11 -0
- package/src/components/common/useDataSourceTableController.tsx +8 -2
- package/src/core/EntityEditView.tsx +5 -2
- package/src/form/EntityForm.tsx +8 -2
- package/src/hooks/data/delete.ts +2 -0
- package/src/hooks/data/save.ts +1 -1
- package/src/hooks/data/useCollectionFetch.tsx +13 -0
- package/src/hooks/data/useEntityFetch.tsx +10 -1
- package/src/hooks/useResolvedNavigationFrom.tsx +2 -0
- package/src/internal/useBuildDataSource.ts +14 -4
- package/src/types/datasource.ts +17 -4
- package/src/types/entities.ts +24 -1
- package/src/util/entities.ts +3 -1
- package/src/util/parent_references_from_path.ts +10 -2
|
@@ -5,6 +5,8 @@ import { OnCellValueChangeParams } from "../../../common";
|
|
|
5
5
|
interface PopupFormFieldProps<M extends Record<string, any>> {
|
|
6
6
|
customFieldValidator?: CustomFieldValidator;
|
|
7
7
|
path: string;
|
|
8
|
+
/** `path` split at its real segment boundaries; forwarded to the datasource. */
|
|
9
|
+
pathSegments?: string[];
|
|
8
10
|
entityId: string;
|
|
9
11
|
tableKey: string;
|
|
10
12
|
propertyKey?: Extract<keyof M, string>;
|
|
@@ -20,7 +22,7 @@ interface PopupFormFieldProps<M extends Record<string, any>> {
|
|
|
20
22
|
onCellValueChange?: (params: OnCellValueChangeParams<any, any>) => Promise<void> | void;
|
|
21
23
|
}
|
|
22
24
|
export declare function PopupFormField<M extends Record<string, any>>(props: PopupFormFieldProps<M>): React.JSX.Element | null;
|
|
23
|
-
export declare function PopupFormFieldLoading<M extends Record<string, any>>({ tableKey, entityId, customFieldValidator, propertyKey, collection: inputCollection, path, cellRect, open, onClose, onCellValueChange, container }: PopupFormFieldProps<M>): React.JSX.Element | null;
|
|
25
|
+
export declare function PopupFormFieldLoading<M extends Record<string, any>>({ tableKey, entityId, customFieldValidator, propertyKey, collection: inputCollection, path, pathSegments, cellRect, open, onClose, onCellValueChange, container }: PopupFormFieldProps<M>): React.JSX.Element | null;
|
|
24
26
|
export declare function PopupFormFieldInternal<M extends Record<string, any>>({ tableKey, entityId, customFieldValidator, propertyKey, collection: inputCollection, path, cellRect, open, onClose, onCellValueChange, container, entity }: PopupFormFieldProps<M> & {
|
|
25
27
|
entity?: Entity<M>;
|
|
26
28
|
}): React.JSX.Element;
|
|
@@ -4,6 +4,8 @@ export type EntityCollectionBoardViewProps<M extends Record<string, any> = any>
|
|
|
4
4
|
collection: EntityCollection<M>;
|
|
5
5
|
tableController: EntityTableController<M>;
|
|
6
6
|
fullPath: string;
|
|
7
|
+
/** `fullPath` split at its real segment boundaries; forwarded to the datasource. */
|
|
8
|
+
pathSegments?: string[];
|
|
7
9
|
parentCollectionIds?: string[];
|
|
8
10
|
columnProperty: string;
|
|
9
11
|
onEntityClick?: (entity: Entity<M>) => void;
|
|
@@ -17,4 +19,4 @@ export type EntityCollectionBoardViewProps<M extends Record<string, any> = any>
|
|
|
17
19
|
/**
|
|
18
20
|
* Kanban board view for displaying entities grouped by a string enum property.
|
|
19
21
|
*/
|
|
20
|
-
export declare function EntityCollectionBoardView<M extends Record<string, any> = any>({ collection, tableController, fullPath, parentCollectionIds, columnProperty, onEntityClick, selectionController, selectionEnabled, highlightedEntities, emptyComponent, deletedEntities }: EntityCollectionBoardViewProps<M>): React.JSX.Element;
|
|
22
|
+
export declare function EntityCollectionBoardView<M extends Record<string, any> = any>({ collection, tableController, fullPath, pathSegments, parentCollectionIds, columnProperty, onEntityClick, selectionController, selectionEnabled, highlightedEntities, emptyComponent, deletedEntities }: EntityCollectionBoardViewProps<M>): React.JSX.Element;
|
|
@@ -38,6 +38,8 @@ export interface BoardDataController<M extends Record<string, any> = any, COLUMN
|
|
|
38
38
|
export interface UseBoardDataControllerProps<M extends Record<string, any> = any> {
|
|
39
39
|
/** Full path to the collection */
|
|
40
40
|
fullPath: string;
|
|
41
|
+
/** `fullPath` split at its real segment boundaries; forwarded to the datasource. */
|
|
42
|
+
pathSegments?: string[];
|
|
41
43
|
/** The entity collection configuration */
|
|
42
44
|
collection: EntityCollection<M>;
|
|
43
45
|
/** Property key used for column assignment */
|
|
@@ -57,4 +59,4 @@ export interface UseBoardDataControllerProps<M extends Record<string, any> = any
|
|
|
57
59
|
* Hook that manages per-column data loading for the Kanban board.
|
|
58
60
|
* Each column gets its own independent query to the data source.
|
|
59
61
|
*/
|
|
60
|
-
export declare function useBoardDataController<M extends Record<string, any> = any, COLUMN extends string = string>({ fullPath, collection, columnProperty, columns, orderProperty, pageSize, searchString, filterValues }: UseBoardDataControllerProps<M>): BoardDataController<M, COLUMN>;
|
|
62
|
+
export declare function useBoardDataController<M extends Record<string, any> = any, COLUMN extends string = string>({ fullPath, pathSegments, collection, columnProperty, columns, orderProperty, pageSize, searchString, filterValues }: UseBoardDataControllerProps<M>): BoardDataController<M, COLUMN>;
|
|
@@ -18,6 +18,15 @@ export interface ReferenceSelectionInnerProps<M extends Record<string, any>> {
|
|
|
18
18
|
* dynamic. If not set, the dialog won't open.
|
|
19
19
|
*/
|
|
20
20
|
path: string;
|
|
21
|
+
/**
|
|
22
|
+
* `path` split at its real segment boundaries, when the caller knows them.
|
|
23
|
+
*
|
|
24
|
+
* Left undefined by default and deliberately NOT derived from `path`: a reference
|
|
25
|
+
* path comes from a property's configuration, so there is no entity chain to recover
|
|
26
|
+
* the boundaries from. Splitting it would silently produce the wrong segments for a
|
|
27
|
+
* subcollection under a slash-bearing parent id, which is worse than not answering.
|
|
28
|
+
*/
|
|
29
|
+
pathSegments?: string[];
|
|
21
30
|
/**
|
|
22
31
|
* If you are opening the dialog for the first time, you can select some
|
|
23
32
|
* entity ids to be displayed first.
|
|
@@ -55,4 +64,4 @@ export interface ReferenceSelectionInnerProps<M extends Record<string, any>> {
|
|
|
55
64
|
* You probably want to open this dialog as a side view using {@link useReferenceDialog}
|
|
56
65
|
* @group Components
|
|
57
66
|
*/
|
|
58
|
-
export declare function ReferenceSelectionTable<M extends Record<string, any>>({ onSingleEntitySelected, onMultipleEntitiesSelected, multiselect, collection, path: pathInput, selectedEntityIds: selectedEntityIdsProp, description, forceFilter, maxSelection, }: ReferenceSelectionInnerProps<M>): React.JSX.Element;
|
|
67
|
+
export declare function ReferenceSelectionTable<M extends Record<string, any>>({ onSingleEntitySelected, onMultipleEntitiesSelected, multiselect, collection, path: pathInput, pathSegments, selectedEntityIds: selectedEntityIdsProp, description, forceFilter, maxSelection, }: ReferenceSelectionInnerProps<M>): React.JSX.Element;
|
|
@@ -13,6 +13,11 @@ export type OnUpdateParams = {
|
|
|
13
13
|
};
|
|
14
14
|
export type EntityFormProps<M extends Record<string, any>> = {
|
|
15
15
|
path: string;
|
|
16
|
+
/**
|
|
17
|
+
* `path` split at its real segment boundaries; forwarded to the datasource for
|
|
18
|
+
* generateEntityId and checkUniqueField. Never derived from `path`.
|
|
19
|
+
*/
|
|
20
|
+
pathSegments?: string[];
|
|
16
21
|
fullIdPath?: string;
|
|
17
22
|
collection: EntityCollection<M>;
|
|
18
23
|
entityId?: string;
|
|
@@ -48,6 +53,6 @@ export type EntityFormProps<M extends Record<string, any>> = {
|
|
|
48
53
|
};
|
|
49
54
|
export declare function extractTouchedValues(values: any, touched: Record<string, boolean>): Record<string, any>;
|
|
50
55
|
export declare function getChanges<T extends object>(source: Partial<T>, comparison: Partial<T>): Partial<T>;
|
|
51
|
-
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>): React.JSX.Element;
|
|
56
|
+
export declare function EntityForm<M extends Record<string, any>>({ path, pathSegments, 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>): React.JSX.Element;
|
|
52
57
|
export declare function getInitialEntityValues<M extends object>(authController: AuthController, collection: EntityCollection, path: string, status: "new" | "existing" | "copy", entity: Entity<M> | undefined, propertyConfigs?: Record<string, PropertyConfig>): Partial<EntityValues<M>>;
|
|
53
58
|
export declare function yupToFormErrors(yupError: ValidationError): Record<string, any>;
|
|
@@ -7,6 +7,12 @@ export interface CollectionFetchProps<M extends Record<string, any>> {
|
|
|
7
7
|
* Absolute collection path
|
|
8
8
|
*/
|
|
9
9
|
path: string;
|
|
10
|
+
/**
|
|
11
|
+
* `path` split at its real segment boundaries. Forwarded to the datasource so a parent
|
|
12
|
+
* entity id containing "/" stays unambiguous. Never derived from `path` — see
|
|
13
|
+
* `pathSegments` on the datasource props.
|
|
14
|
+
*/
|
|
15
|
+
pathSegments?: string[];
|
|
10
16
|
/**
|
|
11
17
|
* collection of the entity displayed by this collection
|
|
12
18
|
*/
|
|
@@ -47,4 +53,4 @@ export interface CollectionFetchResult<M extends Record<string, any>> {
|
|
|
47
53
|
* @param searchString
|
|
48
54
|
* @group Hooks and utilities
|
|
49
55
|
*/
|
|
50
|
-
export declare function useCollectionFetch<M extends Record<string, any>, USER extends User>({ path: inputPath, collection, filterValues, sortBy, itemCount, searchString }: CollectionFetchProps<M>): CollectionFetchResult<M>;
|
|
56
|
+
export declare function useCollectionFetch<M extends Record<string, any>, USER extends User>({ path: inputPath, pathSegments, collection, filterValues, sortBy, itemCount, searchString }: CollectionFetchProps<M>): CollectionFetchResult<M>;
|