@firecms/core 3.0.0-beta.2-pre.2 → 3.0.0-beta.2-pre.3

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.
Files changed (55) hide show
  1. package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +0 -3
  2. package/dist/components/EntityCollectionTable/EntityCollectionTableProps.d.ts +1 -8
  3. package/dist/components/EntityCollectionTable/index.d.ts +2 -4
  4. package/dist/components/EntityCollectionTable/internal/popup_field/PopupFormField.d.ts +1 -1
  5. package/dist/components/{ReferenceSelectionInner.d.ts → ReferenceTable/ReferenceSelectionTable.d.ts} +2 -2
  6. package/dist/components/{EntityCollectionTable/SimpleTable.d.ts → SelectableTable/SelectableTable.d.ts} +3 -4
  7. package/dist/components/SelectableTable/SelectableTableContext.d.ts +4 -0
  8. package/dist/components/common/index.d.ts +5 -0
  9. package/dist/components/{EntityCollectionTable → common}/types.d.ts +7 -0
  10. package/dist/components/common/useTableSearchHelper.d.ts +12 -0
  11. package/dist/components/index.d.ts +5 -2
  12. package/dist/form/components/index.d.ts +0 -1
  13. package/dist/hooks/useSnackbarController.d.ts +1 -0
  14. package/dist/index.es.js +3705 -3683
  15. package/dist/index.es.js.map +1 -1
  16. package/dist/index.umd.js +5 -5
  17. package/dist/index.umd.js.map +1 -1
  18. package/package.json +3 -3
  19. package/src/components/ArrayContainer.tsx +10 -3
  20. package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +16 -22
  21. package/src/components/EntityCollectionTable/EntityCollectionTableProps.tsx +1 -5
  22. package/src/components/EntityCollectionTable/PropertyTableCell.tsx +2 -2
  23. package/src/components/EntityCollectionTable/column_utils.tsx +1 -1
  24. package/src/components/EntityCollectionTable/index.tsx +1 -9
  25. package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +2 -1
  26. package/src/components/EntityCollectionView/EntityCollectionView.tsx +19 -40
  27. package/src/components/{ReferenceSelectionInner.tsx → ReferenceTable/ReferenceSelectionTable.tsx} +31 -15
  28. package/src/components/{EntityCollectionTable/SimpleTable.tsx → SelectableTable/SelectableTable.tsx} +8 -9
  29. package/src/components/SelectableTable/SelectableTableContext.tsx +6 -0
  30. package/src/components/common/index.ts +5 -0
  31. package/src/components/{EntityCollectionTable → common}/types.tsx +5 -0
  32. package/src/components/common/useTableSearchHelper.ts +47 -0
  33. package/src/components/index.tsx +6 -2
  34. package/src/core/EntitySidePanel.tsx +7 -5
  35. package/src/form/EntityForm.tsx +1 -1
  36. package/src/form/components/index.tsx +0 -1
  37. package/src/hooks/useFireCMSContext.tsx +51 -3
  38. package/src/hooks/useReferenceDialog.tsx +2 -2
  39. package/src/hooks/useSnackbarController.tsx +1 -2
  40. package/dist/form/components/SwitchControl.d.ts +0 -8
  41. package/src/form/components/SwitchControl.tsx +0 -39
  42. /package/dist/components/{EntityCollectionTable → SelectableTable}/filters/BooleanFilterField.d.ts +0 -0
  43. /package/dist/components/{EntityCollectionTable → SelectableTable}/filters/DateTimeFilterField.d.ts +0 -0
  44. /package/dist/components/{EntityCollectionTable → SelectableTable}/filters/ReferenceFilterField.d.ts +0 -0
  45. /package/dist/components/{EntityCollectionTable → SelectableTable}/filters/StringNumberFilterField.d.ts +0 -0
  46. /package/dist/components/{EntityCollectionView → common}/useColumnsIds.d.ts +0 -0
  47. /package/dist/components/{EntityCollectionTable → common}/useDataSourceEntityCollectionTableController.d.ts +0 -0
  48. /package/dist/components/{EntityCollectionTable → common}/useDebouncedData.d.ts +0 -0
  49. /package/src/components/{EntityCollectionTable → SelectableTable}/filters/BooleanFilterField.tsx +0 -0
  50. /package/src/components/{EntityCollectionTable → SelectableTable}/filters/DateTimeFilterField.tsx +0 -0
  51. /package/src/components/{EntityCollectionTable → SelectableTable}/filters/ReferenceFilterField.tsx +0 -0
  52. /package/src/components/{EntityCollectionTable → SelectableTable}/filters/StringNumberFilterField.tsx +0 -0
  53. /package/src/components/{EntityCollectionView → common}/useColumnsIds.tsx +0 -0
  54. /package/src/components/{EntityCollectionTable → common}/useDataSourceEntityCollectionTableController.tsx +0 -0
  55. /package/src/components/{EntityCollectionTable → common}/useDebouncedData.ts +0 -0
@@ -1,8 +1,5 @@
1
1
  import React from "react";
2
- import { EntityCollectionTableController } from "./types";
3
2
  import { EntityCollectionTableProps } from "./EntityCollectionTableProps";
4
- export declare const EntityCollectionTableContext: React.Context<EntityCollectionTableController<any>>;
5
- export declare const useEntityCollectionTableController: () => EntityCollectionTableController<any>;
6
3
  /**
7
4
  * This component is in charge of rendering a collection table with a high
8
5
  * degree of customization.
@@ -1,13 +1,6 @@
1
1
  import React from "react";
2
2
  import { AdditionalFieldDelegate, CollectionSize, Entity, EntityTableController, FilterValues, ResolvedProperties, ResolvedProperty, SelectionController, User } from "../../types";
3
- import { OnCellValueChange, UniqueFieldValidator } from "./types";
4
- /**
5
- * @group Collection components
6
- */
7
- export type OnColumnResizeParams = {
8
- width: number;
9
- key: string;
10
- };
3
+ import { OnCellValueChange, OnColumnResizeParams, UniqueFieldValidator } from "../common/types";
11
4
  /**
12
5
  * @group Collection components
13
6
  */
@@ -1,8 +1,6 @@
1
1
  export { EntityCollectionTable } from "./EntityCollectionTable";
2
- export type { EntityCollectionTableProps, OnColumnResizeParams } from "./EntityCollectionTableProps";
3
- export type { UniqueFieldValidator, OnCellValueChange, OnCellValueChangeParams } from "./types";
2
+ export type { EntityCollectionTableProps, } from "./EntityCollectionTableProps";
4
3
  export * from "./PropertyTableCell";
5
- export * from "./SimpleTable";
6
4
  export * from "./EntityCollectionRowActions";
7
- export * from "./useDataSourceEntityCollectionTableController";
5
+ export * from "../common/useDataSourceEntityCollectionTableController";
8
6
  export * from "./column_utils";
@@ -1,6 +1,6 @@
1
1
  import { Entity, EntityCollection } from "../../../../types";
2
2
  import { CustomFieldValidator } from "../../../../form/validation";
3
- import { OnCellValueChangeParams } from "../../../../components";
3
+ import { OnCellValueChangeParams } from "../../../common";
4
4
  interface PopupFormFieldProps<M extends Record<string, any>> {
5
5
  entity?: Entity<M>;
6
6
  customFieldValidator?: CustomFieldValidator;
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { Entity, EntityCollection, FilterValues } from "../types";
2
+ import { Entity, EntityCollection, FilterValues } from "../../types";
3
3
  /**
4
4
  * @group Components
5
5
  */
@@ -55,4 +55,4 @@ export interface ReferenceSelectionInnerProps<M extends Record<string, any>> {
55
55
  * You probably want to open this dialog as a side view using {@link useReferenceDialog}
56
56
  * @group Components
57
57
  */
58
- export declare function ReferenceSelectionInner<M extends Record<string, any>>({ onSingleEntitySelected, onMultipleEntitiesSelected, multiselect, collection, path: pathInput, selectedEntityIds: selectedEntityIdsProp, description, forceFilter, maxSelection }: ReferenceSelectionInnerProps<M>): import("react/jsx-runtime").JSX.Element;
58
+ export declare function ReferenceSelectionTable<M extends Record<string, any>>({ onSingleEntitySelected, onMultipleEntitiesSelected, multiselect, collection, path: pathInput, selectedEntityIds: selectedEntityIdsProp, description, forceFilter, maxSelection, }: ReferenceSelectionInnerProps<M>): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,8 @@
1
1
  import React from "react";
2
2
  import { CollectionSize, Entity, EntityTableController, FilterValues } from "../../types";
3
3
  import { CellRendererParams, VirtualTableColumn } from "../VirtualTable";
4
- import { OnCellValueChange } from "./types";
5
- import { OnColumnResizeParams } from "./EntityCollectionTableProps";
6
- export type SimpleTableProps<M extends Record<string, any>> = {
4
+ import { OnCellValueChange, OnColumnResizeParams } from "../common/types";
5
+ export type SelectableTableProps<M extends Record<string, any>> = {
7
6
  /**
8
7
  * Callback when a cell value changes.
9
8
  */
@@ -73,4 +72,4 @@ export type SimpleTableProps<M extends Record<string, any>> = {
73
72
  * @see VirtualTable
74
73
  * @group Components
75
74
  */
76
- export declare const SimpleTable: React.NamedExoticComponent<SimpleTableProps<any>>;
75
+ export declare const SelectableTable: React.NamedExoticComponent<SelectableTableProps<any>>;
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { EntityCollectionTableController } from "../common/types";
3
+ export declare const SelectableTableContext: React.Context<EntityCollectionTableController<any>>;
4
+ export declare const useSelectableTableController: () => EntityCollectionTableController<any>;
@@ -0,0 +1,5 @@
1
+ export * from "./types";
2
+ export * from "./useDebouncedData";
3
+ export * from "./useColumnsIds";
4
+ export * from "./useDataSourceEntityCollectionTableController";
5
+ export * from "./useTableSearchHelper";
@@ -51,3 +51,10 @@ export type UniqueFieldValidator = (props: {
51
51
  * @group Collection components
52
52
  */
53
53
  export type OnCellValueChange<T, M extends Record<string, any>> = (params: OnCellValueChangeParams<T, M>) => Promise<void> | void;
54
+ /**
55
+ * @group Collection components
56
+ */
57
+ export type OnColumnResizeParams = {
58
+ width: number;
59
+ key: string;
60
+ };
@@ -0,0 +1,12 @@
1
+ import { EntityCollection } from "../../types";
2
+ export interface UseTableSearchHelperParams<M extends Record<string, any>> {
3
+ collection: EntityCollection<M>;
4
+ fullPath: string;
5
+ parentCollectionIds?: string[];
6
+ }
7
+ export declare function useTableSearchHelper<M extends Record<string, any>>({ collection, fullPath, parentCollectionIds }: UseTableSearchHelperParams<M>): {
8
+ textSearchLoading: boolean;
9
+ textSearchInitialised: boolean;
10
+ onTextSearchClick: (() => void) | undefined;
11
+ textSearchEnabled: boolean;
12
+ };
@@ -2,11 +2,14 @@ export type { ErrorViewProps } from "./ErrorView";
2
2
  export { ErrorView } from "./ErrorView";
3
3
  export type { EntityPreviewProps } from "./EntityPreview";
4
4
  export { EntityPreview } from "./EntityPreview";
5
- export type { ReferenceSelectionInnerProps } from "./ReferenceSelectionInner";
6
- export { ReferenceSelectionInner } from "./ReferenceSelectionInner";
5
+ export type { ReferenceSelectionInnerProps } from "./ReferenceTable/ReferenceSelectionTable";
6
+ export { ReferenceSelectionTable } from "./ReferenceTable/ReferenceSelectionTable";
7
7
  export { CircularProgressCenter } from "./CircularProgressCenter";
8
+ export * from "./common";
8
9
  export * from "./HomePage";
10
+ export * from "./SelectableTable/SelectableTable";
9
11
  export * from "./EntityCollectionView/EntityCollectionView";
12
+ export * from "./EntityCollectionView/EntityCollectionViewActions";
10
13
  export * from "./PropertyConfigBadge";
11
14
  export * from "./EntityCollectionTable";
12
15
  export * from "./NotFoundPage";
@@ -1,3 +1,2 @@
1
1
  export * from "./FormikArrayContainer";
2
- export * from "./SwitchControl";
3
2
  export * from "./FieldHelperText";
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  /**
2
3
  * Possible snackbar types
3
4
  * @group Hooks and utilities