@firecms/core 3.0.1 → 3.1.0-canary.9e89e98

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 (170) hide show
  1. package/README.md +1 -1
  2. package/dist/components/AIIcon.d.ts +16 -0
  3. package/dist/components/EntityCollectionTable/EntityCollectionRowActions.d.ts +7 -1
  4. package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +1 -1
  5. package/dist/components/EntityCollectionTable/EntityCollectionTableProps.d.ts +14 -0
  6. package/dist/components/EntityCollectionTable/PropertyTableCell.d.ts +6 -0
  7. package/dist/components/EntityCollectionTable/internal/CollectionTableToolbar.d.ts +5 -4
  8. package/dist/components/EntityCollectionTable/internal/EntityTableCell.d.ts +6 -0
  9. package/dist/components/EntityCollectionView/Board.d.ts +2 -0
  10. package/dist/components/EntityCollectionView/BoardColumn.d.ts +42 -0
  11. package/dist/components/EntityCollectionView/BoardColumnTitle.d.ts +9 -0
  12. package/dist/components/EntityCollectionView/BoardSortableList.d.ts +14 -0
  13. package/dist/components/EntityCollectionView/EntityBoardCard.d.ts +26 -0
  14. package/dist/components/EntityCollectionView/EntityCard.d.ts +19 -0
  15. package/dist/components/EntityCollectionView/EntityCollectionBoardView.d.ts +20 -0
  16. package/dist/components/EntityCollectionView/EntityCollectionCardView.d.ts +31 -0
  17. package/dist/components/EntityCollectionView/EntityCollectionViewActions.d.ts +2 -2
  18. package/dist/components/EntityCollectionView/EntityCollectionViewStartActions.d.ts +7 -3
  19. package/dist/components/EntityCollectionView/FiltersDialog.d.ts +14 -0
  20. package/dist/components/EntityCollectionView/ViewModeToggle.d.ts +44 -0
  21. package/dist/components/EntityCollectionView/board_types.d.ts +105 -0
  22. package/dist/components/EntityCollectionView/useBoardDataController.d.ts +60 -0
  23. package/dist/components/SelectableTable/SelectableTable.d.ts +5 -1
  24. package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +2 -1
  25. package/dist/components/VirtualTable/VirtualTableCell.d.ts +6 -0
  26. package/dist/components/VirtualTable/VirtualTableHeader.d.ts +2 -0
  27. package/dist/components/VirtualTable/VirtualTableHeaderRow.d.ts +1 -1
  28. package/dist/components/VirtualTable/VirtualTableProps.d.ts +11 -0
  29. package/dist/components/VirtualTable/fields/VirtualTableDateField.d.ts +1 -0
  30. package/dist/components/VirtualTable/types.d.ts +2 -0
  31. package/dist/components/index.d.ts +3 -0
  32. package/dist/contexts/index.d.ts +10 -0
  33. package/dist/core/DrawerNavigationGroup.d.ts +45 -0
  34. package/dist/core/index.d.ts +1 -0
  35. package/dist/form/validation.d.ts +3 -2
  36. package/dist/hooks/useBreadcrumbsController.d.ts +16 -0
  37. package/dist/hooks/useCollapsedGroups.d.ts +4 -1
  38. package/dist/index.es.js +5185 -1561
  39. package/dist/index.es.js.map +1 -1
  40. package/dist/index.umd.js +5179 -1556
  41. package/dist/index.umd.js.map +1 -1
  42. package/dist/preview/PropertyPreviewProps.d.ts +5 -0
  43. package/dist/preview/components/DatePreview.d.ts +13 -3
  44. package/dist/preview/components/ImagePreview.d.ts +5 -1
  45. package/dist/preview/components/StorageThumbnail.d.ts +2 -1
  46. package/dist/preview/components/UrlComponentPreview.d.ts +2 -1
  47. package/dist/preview/property_previews/ArrayOfStorageComponentsPreview.d.ts +1 -1
  48. package/dist/preview/property_previews/ArrayOfStringsPreview.d.ts +1 -1
  49. package/dist/preview/property_previews/SkeletonPropertyComponent.d.ts +1 -1
  50. package/dist/types/collections.d.ts +50 -2
  51. package/dist/types/datasource.d.ts +0 -1
  52. package/dist/types/plugins.d.ts +46 -1
  53. package/dist/types/properties.d.ts +259 -4
  54. package/dist/util/__tests__/conditions.test.d.ts +1 -0
  55. package/dist/util/__tests__/objects.test.d.ts +1 -0
  56. package/dist/util/conditions.d.ts +26 -0
  57. package/dist/util/entities.d.ts +1 -2
  58. package/dist/util/index.d.ts +2 -1
  59. package/dist/util/property_utils.d.ts +2 -1
  60. package/dist/util/resolutions.d.ts +1 -1
  61. package/package.json +10 -7
  62. package/src/app/Scaffold.tsx +14 -15
  63. package/src/components/AIIcon.tsx +39 -0
  64. package/src/components/ArrayContainer.tsx +1 -4
  65. package/src/components/ClearFilterSortButton.tsx +19 -16
  66. package/src/components/ConfirmationDialog.tsx +0 -2
  67. package/src/components/DeleteEntityDialog.tsx +2 -4
  68. package/src/components/EntityCollectionTable/EntityCollectionRowActions.tsx +74 -41
  69. package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +130 -79
  70. package/src/components/EntityCollectionTable/EntityCollectionTableProps.tsx +121 -104
  71. package/src/components/EntityCollectionTable/PropertyTableCell.tsx +132 -103
  72. package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.tsx +20 -42
  73. package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +90 -49
  74. package/src/components/EntityCollectionView/Board.tsx +324 -0
  75. package/src/components/EntityCollectionView/BoardColumn.tsx +158 -0
  76. package/src/components/EntityCollectionView/BoardColumnTitle.tsx +45 -0
  77. package/src/components/EntityCollectionView/BoardSortableList.tsx +172 -0
  78. package/src/components/EntityCollectionView/EntityBoardCard.tsx +212 -0
  79. package/src/components/EntityCollectionView/EntityCard.tsx +231 -0
  80. package/src/components/EntityCollectionView/EntityCollectionBoardView.tsx +713 -0
  81. package/src/components/EntityCollectionView/EntityCollectionCardView.tsx +244 -0
  82. package/src/components/EntityCollectionView/EntityCollectionView.tsx +490 -203
  83. package/src/components/EntityCollectionView/EntityCollectionViewActions.tsx +31 -19
  84. package/src/components/EntityCollectionView/EntityCollectionViewStartActions.tsx +84 -15
  85. package/src/components/EntityCollectionView/FiltersDialog.tsx +249 -0
  86. package/src/components/EntityCollectionView/ViewModeToggle.tsx +199 -0
  87. package/src/components/EntityCollectionView/board_types.ts +113 -0
  88. package/src/components/EntityCollectionView/useBoardDataController.tsx +490 -0
  89. package/src/components/ErrorTooltip.tsx +2 -1
  90. package/src/components/HomePage/DefaultHomePage.tsx +47 -10
  91. package/src/components/HomePage/HomePageDnD.tsx +56 -41
  92. package/src/components/HomePage/NavigationCard.tsx +20 -18
  93. package/src/components/HomePage/NavigationGroup.tsx +17 -16
  94. package/src/components/HomePage/RenameGroupDialog.tsx +0 -2
  95. package/src/components/HomePage/SmallNavigationCard.tsx +10 -9
  96. package/src/components/ReferenceTable/ReferenceSelectionTable.tsx +3 -10
  97. package/src/components/ReferenceWidget.tsx +2 -4
  98. package/src/components/SelectableTable/SelectableTable.tsx +75 -67
  99. package/src/components/SelectableTable/filters/BooleanFilterField.tsx +7 -6
  100. package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +39 -40
  101. package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +38 -38
  102. package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +49 -58
  103. package/src/components/UnsavedChangesDialog.tsx +0 -2
  104. package/src/components/UserDisplay.tsx +4 -4
  105. package/src/components/VirtualTable/VirtualTable.tsx +170 -19
  106. package/src/components/VirtualTable/VirtualTableCell.tsx +18 -2
  107. package/src/components/VirtualTable/VirtualTableHeader.tsx +20 -11
  108. package/src/components/VirtualTable/VirtualTableHeaderRow.tsx +158 -42
  109. package/src/components/VirtualTable/VirtualTableProps.tsx +14 -1
  110. package/src/components/VirtualTable/VirtualTableRow.tsx +1 -1
  111. package/src/components/VirtualTable/fields/VirtualTableDateField.tsx +3 -0
  112. package/src/components/VirtualTable/fields/VirtualTableSelect.tsx +17 -4
  113. package/src/components/VirtualTable/types.tsx +2 -0
  114. package/src/components/common/useColumnsIds.tsx +95 -3
  115. package/src/components/index.tsx +4 -0
  116. package/src/contexts/BreacrumbsContext.tsx +15 -8
  117. package/src/contexts/index.ts +10 -0
  118. package/src/core/DefaultAppBar.tsx +39 -26
  119. package/src/core/DefaultDrawer.tsx +42 -56
  120. package/src/core/DrawerNavigationGroup.tsx +118 -0
  121. package/src/core/DrawerNavigationItem.tsx +4 -3
  122. package/src/core/EntityEditView.tsx +41 -43
  123. package/src/core/SideDialogs.tsx +4 -2
  124. package/src/core/index.tsx +1 -0
  125. package/src/form/PropertyFieldBinding.tsx +58 -43
  126. package/src/form/components/StorageItemPreview.tsx +2 -1
  127. package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +0 -1
  128. package/src/form/field_bindings/DateTimeFieldBinding.tsx +17 -16
  129. package/src/form/field_bindings/KeyValueFieldBinding.tsx +0 -1
  130. package/src/form/field_bindings/MapFieldBinding.tsx +69 -67
  131. package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +21 -17
  132. package/src/form/field_bindings/TextFieldBinding.tsx +71 -35
  133. package/src/form/validation.ts +245 -160
  134. package/src/hooks/useBreadcrumbsController.tsx +18 -0
  135. package/src/hooks/useBuildNavigationController.tsx +42 -19
  136. package/src/hooks/useCollapsedGroups.ts +12 -4
  137. package/src/internal/useBuildDataSource.ts +69 -34
  138. package/src/internal/useBuildSideDialogsController.tsx +11 -8
  139. package/src/internal/useBuildSideEntityController.tsx +2 -4
  140. package/src/internal/useRestoreScroll.tsx +26 -14
  141. package/src/preview/PropertyPreview.tsx +40 -32
  142. package/src/preview/PropertyPreviewProps.tsx +6 -0
  143. package/src/preview/components/DatePreview.tsx +72 -4
  144. package/src/preview/components/EmptyValue.tsx +1 -1
  145. package/src/preview/components/ImagePreview.tsx +37 -21
  146. package/src/preview/components/StorageThumbnail.tsx +16 -12
  147. package/src/preview/components/UrlComponentPreview.tsx +28 -25
  148. package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +9 -7
  149. package/src/preview/property_previews/ArrayOfStringsPreview.tsx +11 -9
  150. package/src/preview/property_previews/ArrayPropertyPreview.tsx +26 -24
  151. package/src/preview/property_previews/SkeletonPropertyComponent.tsx +61 -56
  152. package/src/routes/CustomCMSRoute.tsx +1 -0
  153. package/src/routes/FireCMSRoute.tsx +26 -13
  154. package/src/types/collections.ts +57 -3
  155. package/src/types/datasource.ts +54 -56
  156. package/src/types/plugins.tsx +51 -1
  157. package/src/types/properties.ts +347 -27
  158. package/src/util/__tests__/conditions.test.ts +506 -0
  159. package/src/util/__tests__/objects.test.ts +196 -0
  160. package/src/util/callbacks.ts +6 -3
  161. package/src/util/collections.ts +51 -6
  162. package/src/util/conditions.ts +339 -0
  163. package/src/util/entities.ts +28 -29
  164. package/src/util/entity_cache.ts +2 -1
  165. package/src/util/index.ts +2 -1
  166. package/src/util/objects.ts +31 -13
  167. package/src/util/{references.ts → previews.ts} +14 -0
  168. package/src/util/property_utils.tsx +36 -10
  169. package/src/util/resolutions.ts +57 -55
  170. /package/dist/util/{references.d.ts → previews.d.ts} +0 -0
package/README.md CHANGED
@@ -167,7 +167,7 @@ in `example/src`.
167
167
  That file needs to export a valid Firebase config, that you can get
168
168
  from your Firebase console when creating a webapp for your project.
169
169
 
170
- Then simply run `yarn` and `yarn dev`
170
+ Then simply run `npm install` and `npm run dev` (or `yarn` and `yarn dev`)
171
171
 
172
172
  ## License
173
173
 
@@ -0,0 +1,16 @@
1
+ export interface AIIconProps {
2
+ size?: "smallest" | "small" | "medium" | "large";
3
+ className?: string;
4
+ }
5
+ /**
6
+ * AI-styled AutoAwesome icon with gradient coloring.
7
+ * Used consistently across AI features for visual identification.
8
+ */
9
+ export declare function AIIcon({ size, className }: AIIconProps): import("react/jsx-runtime").JSX.Element;
10
+ /**
11
+ * Small animated dot indicator for AI-modified elements.
12
+ * Shows a pulsing gradient dot.
13
+ */
14
+ export declare function AIModifiedIndicator({ className }: {
15
+ className?: string;
16
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { CollectionSize, Entity, EntityAction, EntityCollection, SelectionController } from "../../types";
2
3
  /**
3
4
  *
@@ -12,7 +13,7 @@ import { CollectionSize, Entity, EntityAction, EntityCollection, SelectionContro
12
13
  *
13
14
  * @group Collection components
14
15
  */
15
- export declare const EntityCollectionRowActions: ({ entity, collection, fullPath, fullIdPath, width, frozen, isSelected, selectionEnabled, size, highlightEntity, onCollectionChange, unhighlightEntity, actions, hideId, selectionController, openEntityMode }: {
16
+ export declare const EntityCollectionRowActions: ({ entity, collection, fullPath, fullIdPath, width, frozen, isSelected, selectionEnabled, size, highlightEntity, onCollectionChange, unhighlightEntity, actions, hideId, selectionController, openEntityMode, sortableNodeRef, sortableStyle, sortableAttributes, isDragging, isDraggable }: {
16
17
  entity: Entity<any>;
17
18
  collection?: EntityCollection<any>;
18
19
  fullPath?: string;
@@ -29,4 +30,9 @@ export declare const EntityCollectionRowActions: ({ entity, collection, fullPath
29
30
  highlightEntity?: (entity: Entity<any>) => void;
30
31
  unhighlightEntity?: (entity: Entity<any>) => void;
31
32
  openEntityMode: "side_panel" | "full_screen";
33
+ sortableNodeRef?: (node: HTMLElement | null) => void;
34
+ sortableStyle?: React.CSSProperties;
35
+ sortableAttributes?: Record<string, any>;
36
+ isDragging?: boolean;
37
+ isDraggable?: boolean;
32
38
  }) => import("react/jsx-runtime").JSX.Element;
@@ -24,4 +24,4 @@ import { EntityCollectionTableProps } from "./EntityCollectionTableProps";
24
24
  * @see VirtualTable
25
25
  * @group Components
26
26
  */
27
- export declare const EntityCollectionTable: <M extends Record<string, any> = any, USER extends User = any>({ className, style, forceFilter, actionsStart, actions, title, tableRowActionsBuilder, uniqueFieldValidator, getPropertyFor, onValueChange, selectionController, highlightedEntities, onEntityClick, onColumnResize, initialScroll, onScroll, onSizeChanged, textSearchEnabled, hoverRow, inlineEditing, additionalFields, displayedColumnIds, defaultSize, properties, tableController, filterable, sortable, endAdornment, AddColumnComponent, AdditionalHeaderWidget, additionalIDHeaderWidget, emptyComponent, getIdColumnWidth, onTextSearchClick, textSearchLoading, enablePopupIcon, openEntityMode }: EntityCollectionTableProps<M>) => import("react/jsx-runtime").JSX.Element;
27
+ export declare const EntityCollectionTable: <M extends Record<string, any> = any, USER extends User = any>({ className, style, forceFilter, actionsStart, actions, viewModeToggle, title, tableRowActionsBuilder, uniqueFieldValidator, getPropertyFor, onValueChange, selectionController, highlightedEntities, onEntityClick, onColumnResize, initialScroll, onScroll, onSizeChanged, textSearchEnabled, hoverRow, inlineEditing, additionalFields, displayedColumnIds, defaultSize, properties, tableController, filterable, sortable, endAdornment, AddColumnComponent, AdditionalHeaderWidget, additionalIDHeaderWidget, emptyComponent, getIdColumnWidth, onTextSearchClick, textSearchLoading, enablePopupIcon, openEntityMode, onColumnsOrderChange, hideToolbar }: EntityCollectionTableProps<M>) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import { AdditionalFieldDelegate, CollectionSize, Entity, EntityTableController, FilterValues, ResolvedProperties, ResolvedProperty, SelectionController, User } from "../../types";
3
3
  import { OnCellValueChange, OnColumnResizeParams, UniqueFieldValidator } from "../common/types";
4
+ import { VirtualTableColumn } from "../VirtualTable";
4
5
  /**
5
6
  * @group Collection components
6
7
  */
@@ -74,6 +75,10 @@ export type EntityCollectionTableProps<M extends Record<string, any>, USER exten
74
75
  * collection toolbar, displayed on the right side
75
76
  */
76
77
  actions?: React.ReactNode;
78
+ /**
79
+ * View mode toggle button, positioned left of the search bar.
80
+ */
81
+ viewModeToggle?: React.ReactNode;
77
82
  /**
78
83
  * Controller holding the logic for the table
79
84
  * {@link useDataSourceTableController}
@@ -104,6 +109,15 @@ export type EntityCollectionTableProps<M extends Record<string, any>, USER exten
104
109
  textSearchLoading?: boolean;
105
110
  enablePopupIcon: boolean;
106
111
  openEntityMode?: "side_panel" | "full_screen";
112
+ /**
113
+ * Callback when columns are reordered via drag-and-drop
114
+ */
115
+ onColumnsOrderChange?: (columns: VirtualTableColumn[]) => void;
116
+ /**
117
+ * If true, the internal toolbar will not be rendered.
118
+ * Used when the parent component renders its own toolbar.
119
+ */
120
+ hideToolbar?: boolean;
107
121
  };
108
122
  export type GetPropertyForProps<M extends Record<string, any>> = {
109
123
  propertyKey: string;
@@ -15,5 +15,11 @@ export interface PropertyTableCellProps<T extends CMSType> {
15
15
  path: string;
16
16
  disabled: boolean;
17
17
  enablePopupIcon?: boolean;
18
+ sortableNodeRef?: (node: HTMLElement | null) => void;
19
+ sortableStyle?: React.CSSProperties;
20
+ sortableAttributes?: Record<string, any>;
21
+ isDragging?: boolean;
22
+ isDraggable?: boolean;
23
+ frozen?: boolean;
18
24
  }
19
25
  export declare const PropertyTableCell: React.FunctionComponent<PropertyTableCellProps<any>>;
@@ -1,15 +1,16 @@
1
1
  import React from "react";
2
- import { CollectionSize } from "../../../types";
3
2
  interface CollectionTableToolbarProps {
4
- size: CollectionSize;
5
3
  loading: boolean;
6
4
  actionsStart?: React.ReactNode;
7
5
  actions?: React.ReactNode;
6
+ /**
7
+ * View mode toggle button, positioned left of the search bar.
8
+ */
9
+ viewModeToggle?: React.ReactNode;
8
10
  title?: React.ReactNode;
9
11
  onTextSearchClick?: () => void;
10
12
  onTextSearch?: (searchString?: string) => void;
11
- onSizeChanged: (size: CollectionSize) => void;
12
13
  textSearchLoading?: boolean;
13
14
  }
14
- export declare function CollectionTableToolbar({ actions, actionsStart, loading, onSizeChanged, onTextSearch, onTextSearchClick, size, textSearchLoading, title }: CollectionTableToolbarProps): import("react/jsx-runtime").JSX.Element;
15
+ export declare function CollectionTableToolbar({ actions, actionsStart, loading, onTextSearch, onTextSearchClick, textSearchLoading, title, viewModeToggle }: CollectionTableToolbarProps): import("react/jsx-runtime").JSX.Element;
15
16
  export {};
@@ -21,6 +21,12 @@ interface EntityTableCellProps {
21
21
  selected?: boolean;
22
22
  hideOverflow?: boolean;
23
23
  onSelect?: (cellRect: DOMRect | undefined) => void;
24
+ sortableNodeRef?: (node: HTMLElement | null) => void;
25
+ sortableStyle?: React.CSSProperties;
26
+ sortableAttributes?: Record<string, any>;
27
+ isDragging?: boolean;
28
+ isDraggable?: boolean;
29
+ frozen?: boolean;
24
30
  }
25
31
  export declare const EntityTableCell: React.FunctionComponent<EntityTableCellProps>;
26
32
  export {};
@@ -0,0 +1,2 @@
1
+ import { BoardProps } from "./board_types";
2
+ export declare function Board<M extends Record<string, any>, COLUMN extends string>({ data, columns: columnsProp, columnLabels, columnColors, className, assignColumn, allowColumnReorder, onColumnReorder, onItemsReorder, ItemComponent, columnLoadingState, onLoadMoreColumn, onAddItemToColumn, AddColumnComponent, }: BoardProps<M, COLUMN>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,42 @@
1
+ import React from "react";
2
+ import { BoardItem, BoardItemViewProps } from "./board_types";
3
+ import { ChipColorKey, ChipColorScheme } from "@firecms/ui";
4
+ export interface BoardColumnProps<M extends Record<string, any>> {
5
+ id: string;
6
+ title: string;
7
+ items: BoardItem<M>[];
8
+ index: number;
9
+ ItemComponent: React.ComponentType<BoardItemViewProps<M>>;
10
+ isDragging: boolean;
11
+ isDragOverColumn: boolean;
12
+ /**
13
+ * Whether column reordering is allowed (shows drag handle)
14
+ */
15
+ allowReorder?: boolean;
16
+ /**
17
+ * Whether items are loading for this column
18
+ */
19
+ loading?: boolean;
20
+ /**
21
+ * Whether there are more items to load
22
+ */
23
+ hasMore?: boolean;
24
+ /**
25
+ * Callback to load more items
26
+ */
27
+ onLoadMore?: () => void;
28
+ /**
29
+ * Callback to add a new item to this column
30
+ */
31
+ onAddItem?: () => void;
32
+ /**
33
+ * Total count of entities in this column
34
+ */
35
+ totalCount?: number;
36
+ /**
37
+ * Color of the column header indicator
38
+ */
39
+ color?: ChipColorKey | ChipColorScheme;
40
+ style?: React.CSSProperties;
41
+ }
42
+ export declare const BoardColumn: <M extends Record<string, any>>(props: BoardColumnProps<M>) => React.ReactElement;
@@ -0,0 +1,9 @@
1
+ import { ChipColorKey, ChipColorScheme } from "@firecms/ui";
2
+ import React from "react";
3
+ export interface BoardColumnTitleProps {
4
+ children: React.ReactNode;
5
+ className?: string;
6
+ "aria-label"?: string;
7
+ color?: ChipColorKey | ChipColorScheme;
8
+ }
9
+ export declare function BoardColumnTitle({ children, className, color, ...props }: BoardColumnTitleProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import { BoardItem, BoardItemViewProps } from "./board_types";
3
+ interface BoardSortableListProps<M extends Record<string, any>> {
4
+ columnId: string;
5
+ items: BoardItem<M>[];
6
+ ItemComponent: React.ComponentType<BoardItemViewProps<M>>;
7
+ isDragging: boolean;
8
+ isDragOverColumn: boolean;
9
+ loading?: boolean;
10
+ hasMore?: boolean;
11
+ onLoadMore?: () => void;
12
+ }
13
+ export declare function BoardSortableList<M extends Record<string, any>>({ columnId, items, ItemComponent, isDragging, isDragOverColumn, loading, hasMore, onLoadMore, }: BoardSortableListProps<M>): import("react/jsx-runtime").JSX.Element;
14
+ export {};
@@ -0,0 +1,26 @@
1
+ import React from "react";
2
+ import { Entity, EntityCollection } from "../../types";
3
+ import { BoardItemViewProps } from "./board_types";
4
+ export type EntityBoardCardProps<M extends Record<string, any> = any> = BoardItemViewProps<M> & {
5
+ collection: EntityCollection<M>;
6
+ onClick?: (entity: Entity<M>) => void;
7
+ selected?: boolean;
8
+ onSelectionChange?: (entity: Entity<M>, selected: boolean) => void;
9
+ selectionEnabled?: boolean;
10
+ };
11
+ /**
12
+ * Compact card component for displaying an entity in a Kanban board.
13
+ * Shows thumbnail, title, and optional selection checkbox.
14
+ */
15
+ declare function EntityBoardCardInner<M extends Record<string, any> = any>({ item, isDragging, isGroupedOver, style, collection, onClick, selected, onSelectionChange, selectionEnabled }: EntityBoardCardProps<M>): import("react/jsx-runtime").JSX.Element;
16
+ export declare const EntityBoardCard: typeof EntityBoardCardInner;
17
+ /**
18
+ * Wrapper component that adapts EntityBoardCard to BoardItemViewProps interface
19
+ */
20
+ export declare function createEntityBoardCardComponent<M extends Record<string, any>>(collection: EntityCollection<M>, options: {
21
+ onClick?: (entity: Entity<M>) => void;
22
+ isEntitySelected?: (entity: Entity<M>) => boolean;
23
+ onSelectionChange?: (entity: Entity<M>, selected: boolean) => void;
24
+ selectionEnabled?: boolean;
25
+ }): React.ComponentType<BoardItemViewProps<M>>;
26
+ export {};
@@ -0,0 +1,19 @@
1
+ import { CollectionSize, Entity, EntityCollection } from "../../types";
2
+ export type EntityCardProps<M extends Record<string, any> = any> = {
3
+ entity: Entity<M>;
4
+ collection: EntityCollection<M>;
5
+ onClick?: (entity: Entity<M>) => void;
6
+ selected?: boolean;
7
+ highlighted?: boolean;
8
+ onSelectionChange?: (entity: Entity<M>, selected: boolean) => void;
9
+ selectionEnabled?: boolean;
10
+ /**
11
+ * Size of the card - affects checkbox styling
12
+ */
13
+ size?: CollectionSize;
14
+ };
15
+ /**
16
+ * Card component for displaying an entity in a grid view.
17
+ * Shows thumbnail, title, and preview properties.
18
+ */
19
+ export declare function EntityCard<M extends Record<string, any> = any>({ entity, collection, onClick, selected, highlighted, onSelectionChange, selectionEnabled, size }: EntityCardProps<M>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import React from "react";
2
+ import { Entity, EntityCollection, EntityTableController, SelectionController } from "../../types";
3
+ export type EntityCollectionBoardViewProps<M extends Record<string, any> = any> = {
4
+ collection: EntityCollection<M>;
5
+ tableController: EntityTableController<M>;
6
+ fullPath: string;
7
+ parentCollectionIds?: string[];
8
+ columnProperty: string;
9
+ onEntityClick?: (entity: Entity<M>) => void;
10
+ selectionController?: SelectionController<M>;
11
+ selectionEnabled?: boolean;
12
+ highlightedEntities?: Entity<M>[];
13
+ emptyComponent?: React.ReactNode;
14
+ /** Called when entities are deleted - used for optimistic count updates */
15
+ deletedEntities?: Entity<M>[];
16
+ };
17
+ /**
18
+ * Kanban board view for displaying entities grouped by a string enum property.
19
+ */
20
+ export declare function EntityCollectionBoardView<M extends Record<string, any> = any>({ collection, tableController, fullPath, parentCollectionIds, columnProperty, onEntityClick, selectionController, selectionEnabled, highlightedEntities, emptyComponent, deletedEntities }: EntityCollectionBoardViewProps<M>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,31 @@
1
+ import React from "react";
2
+ import { CollectionSize, Entity, EntityCollection, EntityTableController, SelectionController } from "../../types";
3
+ export type EntityCollectionCardViewProps<M extends Record<string, any> = any> = {
4
+ collection: EntityCollection<M>;
5
+ tableController: EntityTableController<M>;
6
+ onEntityClick?: (entity: Entity<M>) => void;
7
+ selectionController?: SelectionController<M>;
8
+ selectionEnabled?: boolean;
9
+ highlightedEntities?: Entity<M>[];
10
+ emptyComponent?: React.ReactNode;
11
+ onScroll?: (props: {
12
+ scrollDirection: "forward" | "backward";
13
+ scrollOffset: number;
14
+ scrollUpdateWasRequested: boolean;
15
+ }) => void;
16
+ initialScroll?: number;
17
+ /**
18
+ * Size of the cards in the grid view.
19
+ * - "xs": Extra small cards, most cards per row
20
+ * - "s": Small cards
21
+ * - "m": Medium cards (default)
22
+ * - "l": Large cards
23
+ * - "xl": Extra large cards, fewest cards per row
24
+ */
25
+ size?: CollectionSize;
26
+ };
27
+ /**
28
+ * Card grid view for displaying entities with infinite scroll.
29
+ * Alternative to the EntityCollectionTable for visual browsing.
30
+ */
31
+ export declare function EntityCollectionCardView<M extends Record<string, any> = any>({ collection, tableController, onEntityClick, selectionController, selectionEnabled, highlightedEntities, emptyComponent, onScroll, initialScroll, size }: EntityCollectionCardViewProps<M>): import("react/jsx-runtime").JSX.Element;
@@ -9,6 +9,6 @@ export type EntityCollectionViewActionsProps<M extends Record<string, any>> = {
9
9
  onMultipleDeleteClick: () => void;
10
10
  selectionController: SelectionController<M>;
11
11
  tableController: EntityTableController<M>;
12
- collectionEntitiesCount: number;
12
+ collectionEntitiesCount?: number;
13
13
  };
14
- export declare function EntityCollectionViewActions<M extends Record<string, any>>({ collection, relativePath, parentCollectionIds, onNewClick, onMultipleDeleteClick, selectionEnabled, path, selectionController, tableController, collectionEntitiesCount }: EntityCollectionViewActionsProps<M>): import("react/jsx-runtime").JSX.Element;
14
+ export declare function EntityCollectionViewActions<M extends Record<string, any>>({ collection, relativePath, parentCollectionIds, onNewClick, onMultipleDeleteClick, selectionEnabled, path, selectionController, tableController, collectionEntitiesCount, }: EntityCollectionViewActionsProps<M>): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import { EntityCollection, EntityTableController, SelectionController } from "../../types";
1
+ import { EntityCollection, EntityTableController, ResolvedProperty, SelectionController } from "../../types";
2
2
  export type EntityCollectionViewStartActionsProps<M extends Record<string, any>> = {
3
3
  collection: EntityCollection<M>;
4
4
  path: string;
@@ -6,6 +6,10 @@ export type EntityCollectionViewStartActionsProps<M extends Record<string, any>>
6
6
  parentCollectionIds: string[];
7
7
  selectionController: SelectionController<M>;
8
8
  tableController: EntityTableController<M>;
9
- collectionEntitiesCount: number;
9
+ collectionEntitiesCount?: number;
10
+ /**
11
+ * Resolved properties from the collection for the filters dialog
12
+ */
13
+ resolvedProperties?: Record<string, ResolvedProperty>;
10
14
  };
11
- export declare function EntityCollectionViewStartActions<M extends Record<string, any>>({ collection, relativePath, parentCollectionIds, path, selectionController, tableController, collectionEntitiesCount }: EntityCollectionViewStartActionsProps<M>): import("react/jsx-runtime").JSX.Element;
15
+ export declare function EntityCollectionViewStartActions<M extends Record<string, any>>({ collection, relativePath, parentCollectionIds, path, selectionController, tableController, collectionEntitiesCount, resolvedProperties }: EntityCollectionViewStartActionsProps<M>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { FilterValues, ResolvedProperty } from "../../types";
2
+ export interface FiltersDialogProps {
3
+ open: boolean;
4
+ onOpenChange: (open: boolean) => void;
5
+ properties: Record<string, ResolvedProperty>;
6
+ filterValues: FilterValues<any> | undefined;
7
+ setFilterValues: (filterValues?: FilterValues<any>) => void;
8
+ forceFilter?: FilterValues<any>;
9
+ }
10
+ /**
11
+ * Dialog that displays all filterable properties from a collection
12
+ * and allows setting filter values for each.
13
+ */
14
+ export declare function FiltersDialog({ open, onOpenChange, properties, filterValues, setFilterValues, forceFilter }: FiltersDialogProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,44 @@
1
+ import { CollectionSize, ViewMode } from "../../types";
2
+ export type KanbanPropertyOption = {
3
+ key: string;
4
+ label: string;
5
+ };
6
+ export type ViewModeToggleProps = {
7
+ viewMode?: ViewMode;
8
+ onViewModeChange?: (mode: ViewMode) => void;
9
+ /**
10
+ * Which view modes are enabled for this collection.
11
+ * Only these modes will appear in the toggle.
12
+ * Defaults to all three: ["table", "cards", "kanban"].
13
+ */
14
+ enabledViews?: ViewMode[];
15
+ /**
16
+ * Current size for card/table views
17
+ */
18
+ size?: CollectionSize;
19
+ /**
20
+ * Callback when size changes
21
+ */
22
+ onSizeChanged?: (size: CollectionSize) => void;
23
+ /**
24
+ * Controlled open state for the popover
25
+ */
26
+ open?: boolean;
27
+ /**
28
+ * Callback when popover open state changes
29
+ */
30
+ onOpenChange?: (open: boolean) => void;
31
+ /**
32
+ * Available properties that can be used for kanban columns (enum properties)
33
+ */
34
+ kanbanPropertyOptions?: KanbanPropertyOption[];
35
+ /**
36
+ * Currently selected property for kanban columns
37
+ */
38
+ selectedKanbanProperty?: string;
39
+ /**
40
+ * Callback when the kanban column property changes
41
+ */
42
+ onKanbanPropertyChange?: (property: string) => void;
43
+ };
44
+ export declare function ViewModeToggle({ viewMode, onViewModeChange, enabledViews, size, onSizeChanged, open, onOpenChange, kanbanPropertyOptions, selectedKanbanProperty, onKanbanPropertyChange }: ViewModeToggleProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,105 @@
1
+ import { CSSProperties } from "react";
2
+ import { ChipColorKey, ChipColorScheme } from "@firecms/ui";
3
+ import { Entity } from "../../types";
4
+ /**
5
+ * Item wrapper for entities in the Board component
6
+ */
7
+ export interface BoardItem<M extends Record<string, any> = any> {
8
+ id: string;
9
+ entity: Entity<M>;
10
+ }
11
+ /**
12
+ * Map of column keys to arrays of board items
13
+ */
14
+ export interface BoardItemMap<M extends Record<string, any> = any> {
15
+ [columnKey: string]: BoardItem<M>[];
16
+ }
17
+ /**
18
+ * Props passed to custom item render components
19
+ */
20
+ export interface BoardItemViewProps<M extends Record<string, any> = any> {
21
+ item: BoardItem<M>;
22
+ isDragging: boolean;
23
+ isClone?: boolean;
24
+ isGroupedOver?: boolean;
25
+ style?: CSSProperties;
26
+ index?: number;
27
+ }
28
+ /**
29
+ * Per-column loading state
30
+ */
31
+ export interface ColumnLoadingState {
32
+ [columnKey: string]: {
33
+ loading: boolean;
34
+ hasMore: boolean;
35
+ itemCount: number;
36
+ /** Total count of entities in column (may differ from itemCount if some lack orderProperty) */
37
+ totalCount?: number;
38
+ };
39
+ }
40
+ /**
41
+ * Props for the Board component
42
+ */
43
+ export interface BoardProps<M extends Record<string, any>, COLUMN extends string> {
44
+ /**
45
+ * Array of board items (entities wrapped with id)
46
+ */
47
+ data: BoardItem<M>[];
48
+ /**
49
+ * Array of column keys/identifiers
50
+ */
51
+ columns: COLUMN[];
52
+ /**
53
+ * Labels for each column (optional, uses column key if not provided)
54
+ */
55
+ columnLabels?: Record<COLUMN, string>;
56
+ /**
57
+ * Colors for each column from enum values (optional)
58
+ */
59
+ columnColors?: Record<COLUMN, ChipColorKey | ChipColorScheme | undefined>;
60
+ /**
61
+ * CSS class name for the board container
62
+ */
63
+ className?: string;
64
+ /**
65
+ * Function to determine which column an item belongs to
66
+ */
67
+ assignColumn: (item: BoardItem<M>) => COLUMN;
68
+ /**
69
+ * Whether column reordering is allowed.
70
+ * Set to true only when a plugin provides persistence for column order.
71
+ */
72
+ allowColumnReorder?: boolean;
73
+ /**
74
+ * Callback when columns are reordered
75
+ */
76
+ onColumnReorder?: (columns: COLUMN[]) => void;
77
+ /**
78
+ * Callback when items are reordered or moved between columns
79
+ */
80
+ onItemsReorder?: (items: BoardItem<M>[], moveInfo?: {
81
+ itemId: string;
82
+ sourceColumn: COLUMN;
83
+ targetColumn: COLUMN;
84
+ }) => void;
85
+ /**
86
+ * Component to render individual items
87
+ */
88
+ ItemComponent: React.ComponentType<BoardItemViewProps<M>>;
89
+ /**
90
+ * Per-column loading state for pagination
91
+ */
92
+ columnLoadingState?: ColumnLoadingState;
93
+ /**
94
+ * Callback to load more items for a column
95
+ */
96
+ onLoadMoreColumn?: (column: COLUMN) => void;
97
+ /**
98
+ * Callback to add a new item to a specific column
99
+ */
100
+ onAddItemToColumn?: (column: COLUMN) => void;
101
+ /**
102
+ * Optional component to render at the end of the board for adding new columns
103
+ */
104
+ AddColumnComponent?: React.ReactNode;
105
+ }
@@ -0,0 +1,60 @@
1
+ import { Entity, EntityCollection, FilterValues } from "../../types";
2
+ /**
3
+ * Data state for a single board column
4
+ */
5
+ export interface BoardColumnData<M extends Record<string, any> = any> {
6
+ /** Entities loaded for this column */
7
+ entities: Entity<M>[];
8
+ /** Whether the column is currently loading data */
9
+ loading: boolean;
10
+ /** Whether there are more items to load */
11
+ hasMore: boolean;
12
+ /** Error if loading failed */
13
+ error?: Error;
14
+ /** Total count of entities in this column */
15
+ totalCount?: number;
16
+ }
17
+ /**
18
+ * Controller for managing per-column data in a Kanban board
19
+ */
20
+ export interface BoardDataController<M extends Record<string, any> = any, COLUMN extends string = string> {
21
+ /** Data state for each column */
22
+ columnData: Record<COLUMN, BoardColumnData<M>>;
23
+ /** Load more items for a specific column */
24
+ loadMoreColumn: (column: COLUMN) => void;
25
+ /** Refresh data for a specific column */
26
+ refreshColumn: (column: COLUMN) => void;
27
+ /** Refresh all columns */
28
+ refreshAll: () => void;
29
+ /** Update counts for columns (for optimistic updates when moving items) */
30
+ updateColumnCounts: (sourceColumn: COLUMN, targetColumn: COLUMN) => void;
31
+ /** Decrement column counts (for optimistic updates when deleting items) */
32
+ decrementColumnCounts: (columnDeltas: Record<COLUMN, number>) => void;
33
+ /** Whether any column is loading */
34
+ loading: boolean;
35
+ /** Any error from any column */
36
+ error?: Error;
37
+ }
38
+ export interface UseBoardDataControllerProps<M extends Record<string, any> = any> {
39
+ /** Full path to the collection */
40
+ fullPath: string;
41
+ /** The entity collection configuration */
42
+ collection: EntityCollection<M>;
43
+ /** Property key used for column assignment */
44
+ columnProperty: string;
45
+ /** Array of column values (enum values from columnProperty) */
46
+ columns: string[];
47
+ /** Property key used for ordering within columns */
48
+ orderProperty?: string;
49
+ /** Number of items to load per page per column */
50
+ pageSize?: number;
51
+ /** Text search string to filter entities */
52
+ searchString?: string;
53
+ /** Additional filter values */
54
+ filterValues?: FilterValues<string>;
55
+ }
56
+ /**
57
+ * Hook that manages per-column data loading for the Kanban board.
58
+ * Each column gets its own independent query to the data source.
59
+ */
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>;
@@ -57,6 +57,10 @@ export type SelectableTableProps<M extends Record<string, any>> = {
57
57
  emptyComponent?: React.ReactNode;
58
58
  endAdornment?: React.ReactNode;
59
59
  AddColumnComponent?: React.ComponentType;
60
+ /**
61
+ * Callback when columns are reordered via drag-and-drop
62
+ */
63
+ onColumnsOrderChange?: (columns: VirtualTableColumn[]) => void;
60
64
  };
61
65
  /**
62
66
  * This component is in charge of rendering a collection table with a high
@@ -82,4 +86,4 @@ export type SelectableTableProps<M extends Record<string, any>> = {
82
86
  * @see VirtualTable
83
87
  * @group Components
84
88
  */
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;
89
+ 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, onColumnsOrderChange }: SelectableTableProps<M>) => import("react/jsx-runtime").JSX.Element;
@@ -6,6 +6,7 @@ interface DateTimeFilterFieldProps {
6
6
  setValue: (value?: [op: VirtualTableWhereFilterOp, newValue: any]) => void;
7
7
  isArray?: boolean;
8
8
  title?: string;
9
+ timezone?: string;
9
10
  }
10
- export declare function DateTimeFilterField({ name, isArray, mode, value, setValue, title }: DateTimeFilterFieldProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare function DateTimeFilterField({ name, isArray, mode, value, setValue, title, timezone }: DateTimeFilterFieldProps): import("react/jsx-runtime").JSX.Element;
11
12
  export {};
@@ -9,6 +9,12 @@ type VirtualTableCellProps<T extends any> = {
9
9
  rowIndex: any;
10
10
  columnIndex: number;
11
11
  cellRenderer: React.ComponentType<CellRendererParams<T>>;
12
+ sortableNodeRef?: (node: HTMLElement | null) => void;
13
+ sortableStyle?: React.CSSProperties;
14
+ sortableAttributes?: Record<string, any>;
15
+ isDragging?: boolean;
16
+ isDraggable?: boolean;
17
+ frozen?: boolean;
12
18
  };
13
19
  export declare const VirtualTableCell: React.NamedExoticComponent<VirtualTableCellProps<any>>;
14
20
  export {};
@@ -22,6 +22,8 @@ type VirtualTableHeaderProps<M extends Record<string, any>> = {
22
22
  AdditionalHeaderWidget?: (props: {
23
23
  onHover: boolean;
24
24
  }) => React.ReactNode;
25
+ isDragging?: boolean;
26
+ isDraggable?: boolean;
25
27
  };
26
28
  export declare const VirtualTableHeader: React.FunctionComponent<VirtualTableHeaderProps<any>>;
27
29
  export {};
@@ -1,2 +1,2 @@
1
1
  import { VirtualTableContextProps } from "./types";
2
- export declare const VirtualTableHeaderRow: ({ columns, currentSort, onColumnSort, onFilterUpdate, sortByProperty, filter, onColumnResize, onColumnResizeEnd, createFilterField, AddColumnComponent }: VirtualTableContextProps<any>) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const VirtualTableHeaderRow: ({ columns, currentSort, onColumnSort, onFilterUpdate, sortByProperty, filter, onColumnResize, onColumnResizeEnd, createFilterField, AddColumnComponent, onColumnsOrderChange, data, cellRenderer: CellRenderer, rowHeight, draggingColumnId }: VirtualTableContextProps<any>) => import("react/jsx-runtime").JSX.Element;