@firecms/core 3.0.1 → 3.1.0-canary.7d91b7c

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 (185) 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/EntityCollectionTable/internal/popup_field/useDraggable.d.ts +2 -2
  10. package/dist/components/EntityCollectionView/Board.d.ts +2 -0
  11. package/dist/components/EntityCollectionView/BoardColumn.d.ts +42 -0
  12. package/dist/components/EntityCollectionView/BoardColumnTitle.d.ts +9 -0
  13. package/dist/components/EntityCollectionView/BoardSortableList.d.ts +14 -0
  14. package/dist/components/EntityCollectionView/EntityBoardCard.d.ts +26 -0
  15. package/dist/components/EntityCollectionView/EntityCard.d.ts +19 -0
  16. package/dist/components/EntityCollectionView/EntityCollectionBoardView.d.ts +20 -0
  17. package/dist/components/EntityCollectionView/EntityCollectionCardView.d.ts +31 -0
  18. package/dist/components/EntityCollectionView/EntityCollectionViewActions.d.ts +2 -2
  19. package/dist/components/EntityCollectionView/EntityCollectionViewStartActions.d.ts +7 -3
  20. package/dist/components/EntityCollectionView/FiltersDialog.d.ts +14 -0
  21. package/dist/components/EntityCollectionView/ViewModeToggle.d.ts +44 -0
  22. package/dist/components/EntityCollectionView/board_types.d.ts +105 -0
  23. package/dist/components/EntityCollectionView/useBoardDataController.d.ts +60 -0
  24. package/dist/components/ErrorBoundary.d.ts +1 -1
  25. package/dist/components/SelectableTable/SelectableTable.d.ts +5 -1
  26. package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +2 -1
  27. package/dist/components/VirtualTable/VirtualTableCell.d.ts +6 -0
  28. package/dist/components/VirtualTable/VirtualTableHeader.d.ts +3 -1
  29. package/dist/components/VirtualTable/VirtualTableHeaderRow.d.ts +1 -1
  30. package/dist/components/VirtualTable/VirtualTableProps.d.ts +11 -0
  31. package/dist/components/VirtualTable/fields/VirtualTableDateField.d.ts +1 -0
  32. package/dist/components/VirtualTable/types.d.ts +2 -0
  33. package/dist/components/index.d.ts +3 -0
  34. package/dist/contexts/index.d.ts +10 -0
  35. package/dist/core/DrawerNavigationGroup.d.ts +45 -0
  36. package/dist/core/index.d.ts +1 -0
  37. package/dist/form/components/ErrorFocus.d.ts +1 -1
  38. package/dist/form/validation.d.ts +3 -2
  39. package/dist/hooks/useBreadcrumbsController.d.ts +16 -0
  40. package/dist/hooks/useCollapsedGroups.d.ts +4 -1
  41. package/dist/index.es.js +5266 -1578
  42. package/dist/index.es.js.map +1 -1
  43. package/dist/index.umd.js +5260 -1573
  44. package/dist/index.umd.js.map +1 -1
  45. package/dist/internal/useRestoreScroll.d.ts +1 -1
  46. package/dist/preview/PropertyPreviewProps.d.ts +5 -0
  47. package/dist/preview/components/DatePreview.d.ts +13 -3
  48. package/dist/preview/components/ImagePreview.d.ts +5 -1
  49. package/dist/preview/components/StorageThumbnail.d.ts +2 -1
  50. package/dist/preview/components/UrlComponentPreview.d.ts +2 -1
  51. package/dist/preview/property_previews/ArrayOfStorageComponentsPreview.d.ts +1 -1
  52. package/dist/preview/property_previews/ArrayOfStringsPreview.d.ts +1 -1
  53. package/dist/preview/property_previews/SkeletonPropertyComponent.d.ts +1 -1
  54. package/dist/types/analytics.d.ts +1 -1
  55. package/dist/types/collections.d.ts +50 -2
  56. package/dist/types/datasource.d.ts +0 -1
  57. package/dist/types/plugins.d.ts +62 -1
  58. package/dist/types/properties.d.ts +259 -4
  59. package/dist/util/__tests__/conditions.test.d.ts +1 -0
  60. package/dist/util/__tests__/objects.test.d.ts +1 -0
  61. package/dist/util/conditions.d.ts +26 -0
  62. package/dist/util/entities.d.ts +2 -3
  63. package/dist/util/index.d.ts +2 -1
  64. package/dist/util/property_utils.d.ts +2 -1
  65. package/dist/util/resolutions.d.ts +3 -3
  66. package/package.json +14 -11
  67. package/src/app/Scaffold.tsx +14 -15
  68. package/src/components/AIIcon.tsx +39 -0
  69. package/src/components/ArrayContainer.tsx +1 -4
  70. package/src/components/ClearFilterSortButton.tsx +19 -16
  71. package/src/components/ConfirmationDialog.tsx +0 -2
  72. package/src/components/DeleteEntityDialog.tsx +2 -4
  73. package/src/components/EntityCollectionTable/EntityCollectionRowActions.tsx +74 -41
  74. package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +130 -79
  75. package/src/components/EntityCollectionTable/EntityCollectionTableProps.tsx +121 -104
  76. package/src/components/EntityCollectionTable/PropertyTableCell.tsx +132 -103
  77. package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.tsx +20 -42
  78. package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +90 -49
  79. package/src/components/EntityCollectionTable/internal/EntityTableCellActions.tsx +1 -1
  80. package/src/components/EntityCollectionTable/internal/popup_field/useDraggable.tsx +11 -11
  81. package/src/components/EntityCollectionView/Board.tsx +324 -0
  82. package/src/components/EntityCollectionView/BoardColumn.tsx +158 -0
  83. package/src/components/EntityCollectionView/BoardColumnTitle.tsx +45 -0
  84. package/src/components/EntityCollectionView/BoardSortableList.tsx +172 -0
  85. package/src/components/EntityCollectionView/EntityBoardCard.tsx +212 -0
  86. package/src/components/EntityCollectionView/EntityCard.tsx +235 -0
  87. package/src/components/EntityCollectionView/EntityCollectionBoardView.tsx +733 -0
  88. package/src/components/EntityCollectionView/EntityCollectionCardView.tsx +244 -0
  89. package/src/components/EntityCollectionView/EntityCollectionView.tsx +519 -203
  90. package/src/components/EntityCollectionView/EntityCollectionViewActions.tsx +31 -19
  91. package/src/components/EntityCollectionView/EntityCollectionViewStartActions.tsx +84 -15
  92. package/src/components/EntityCollectionView/FiltersDialog.tsx +249 -0
  93. package/src/components/EntityCollectionView/ViewModeToggle.tsx +199 -0
  94. package/src/components/EntityCollectionView/board_types.ts +113 -0
  95. package/src/components/EntityCollectionView/useBoardDataController.tsx +490 -0
  96. package/src/components/ErrorTooltip.tsx +2 -1
  97. package/src/components/HomePage/DefaultHomePage.tsx +47 -10
  98. package/src/components/HomePage/HomePageDnD.tsx +56 -41
  99. package/src/components/HomePage/NavigationCard.tsx +20 -18
  100. package/src/components/HomePage/NavigationGroup.tsx +17 -16
  101. package/src/components/HomePage/RenameGroupDialog.tsx +0 -2
  102. package/src/components/HomePage/SmallNavigationCard.tsx +10 -9
  103. package/src/components/ReferenceTable/ReferenceSelectionTable.tsx +3 -10
  104. package/src/components/ReferenceWidget.tsx +2 -4
  105. package/src/components/SelectableTable/SelectableTable.tsx +75 -67
  106. package/src/components/SelectableTable/filters/BooleanFilterField.tsx +7 -6
  107. package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +39 -40
  108. package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +38 -38
  109. package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +49 -58
  110. package/src/components/UnsavedChangesDialog.tsx +0 -2
  111. package/src/components/UserDisplay.tsx +4 -4
  112. package/src/components/VirtualTable/VirtualTable.tsx +272 -118
  113. package/src/components/VirtualTable/VirtualTableCell.tsx +18 -2
  114. package/src/components/VirtualTable/VirtualTableHeader.tsx +59 -50
  115. package/src/components/VirtualTable/VirtualTableHeaderRow.tsx +158 -42
  116. package/src/components/VirtualTable/VirtualTableProps.tsx +14 -1
  117. package/src/components/VirtualTable/VirtualTableRow.tsx +1 -1
  118. package/src/components/VirtualTable/fields/VirtualTableDateField.tsx +3 -0
  119. package/src/components/VirtualTable/fields/VirtualTableSelect.tsx +19 -6
  120. package/src/components/VirtualTable/types.tsx +2 -0
  121. package/src/components/common/useColumnsIds.tsx +95 -3
  122. package/src/components/index.tsx +4 -0
  123. package/src/contexts/BreacrumbsContext.tsx +15 -8
  124. package/src/contexts/index.ts +10 -0
  125. package/src/core/DefaultAppBar.tsx +40 -27
  126. package/src/core/DefaultDrawer.tsx +42 -56
  127. package/src/core/DrawerNavigationGroup.tsx +118 -0
  128. package/src/core/DrawerNavigationItem.tsx +4 -3
  129. package/src/core/EntityEditView.tsx +41 -43
  130. package/src/core/EntitySidePanel.tsx +28 -26
  131. package/src/core/SideDialogs.tsx +4 -2
  132. package/src/core/field_configs.tsx +14 -9
  133. package/src/core/index.tsx +1 -0
  134. package/src/form/EntityForm.tsx +69 -60
  135. package/src/form/PropertyFieldBinding.tsx +61 -46
  136. package/src/form/components/ErrorFocus.tsx +3 -3
  137. package/src/form/components/StorageItemPreview.tsx +2 -1
  138. package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +0 -1
  139. package/src/form/field_bindings/DateTimeFieldBinding.tsx +17 -16
  140. package/src/form/field_bindings/KeyValueFieldBinding.tsx +0 -1
  141. package/src/form/field_bindings/MapFieldBinding.tsx +69 -67
  142. package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +22 -18
  143. package/src/form/field_bindings/StorageUploadFieldBinding.tsx +83 -83
  144. package/src/form/field_bindings/TextFieldBinding.tsx +71 -35
  145. package/src/form/validation.ts +245 -160
  146. package/src/hooks/useBreadcrumbsController.tsx +18 -0
  147. package/src/hooks/useBuildNavigationController.tsx +46 -23
  148. package/src/hooks/useCollapsedGroups.ts +12 -4
  149. package/src/hooks/useValidateAuthenticator.tsx +1 -1
  150. package/src/internal/useBuildDataSource.ts +68 -34
  151. package/src/internal/useBuildSideDialogsController.tsx +11 -8
  152. package/src/internal/useBuildSideEntityController.tsx +2 -4
  153. package/src/internal/useRestoreScroll.tsx +26 -14
  154. package/src/preview/PropertyPreview.tsx +41 -32
  155. package/src/preview/PropertyPreviewProps.tsx +6 -0
  156. package/src/preview/components/DatePreview.tsx +72 -4
  157. package/src/preview/components/EmptyValue.tsx +1 -1
  158. package/src/preview/components/ImagePreview.tsx +37 -21
  159. package/src/preview/components/StorageThumbnail.tsx +16 -12
  160. package/src/preview/components/UrlComponentPreview.tsx +28 -25
  161. package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +9 -7
  162. package/src/preview/property_previews/ArrayOfStringsPreview.tsx +11 -9
  163. package/src/preview/property_previews/ArrayPropertyPreview.tsx +26 -24
  164. package/src/preview/property_previews/SkeletonPropertyComponent.tsx +61 -56
  165. package/src/routes/CustomCMSRoute.tsx +1 -0
  166. package/src/routes/FireCMSRoute.tsx +26 -13
  167. package/src/types/analytics.ts +10 -0
  168. package/src/types/collections.ts +57 -3
  169. package/src/types/datasource.ts +54 -56
  170. package/src/types/plugins.tsx +69 -1
  171. package/src/types/properties.ts +347 -27
  172. package/src/util/__tests__/conditions.test.ts +506 -0
  173. package/src/util/__tests__/objects.test.ts +196 -0
  174. package/src/util/callbacks.ts +6 -3
  175. package/src/util/collections.ts +51 -6
  176. package/src/util/conditions.ts +339 -0
  177. package/src/util/entities.ts +29 -30
  178. package/src/util/entity_cache.ts +2 -1
  179. package/src/util/index.ts +2 -1
  180. package/src/util/join_collections.ts +10 -8
  181. package/src/util/objects.ts +31 -13
  182. package/src/util/{references.ts → previews.ts} +16 -2
  183. package/src/util/property_utils.tsx +37 -11
  184. package/src/util/resolutions.ts +62 -58
  185. /package/dist/util/{references.d.ts → previews.d.ts} +0 -0
@@ -29,7 +29,7 @@ import { CSS } from "@dnd-kit/utilities";
29
29
 
30
30
  import { NavigationCardBinding } from "./NavigationCardBinding";
31
31
  import { NavigationEntry } from "../../types";
32
- import { cls } from "@firecms/ui";
32
+ import { cls, defaultBorderMixin } from "@firecms/ui";
33
33
 
34
34
  const animateLayoutChanges: AnimateLayoutChanges = (args) =>
35
35
  defaultAnimateLayoutChanges({
@@ -65,9 +65,9 @@ const cloneItemsForDnd = (items: { name: string; entries: NavigationEntry[] }[])
65
65
 
66
66
  /* ─────────────────────────────────────────────────────────── */
67
67
  export function SortableNavigationCard({
68
- entry,
69
- onClick
70
- }: {
68
+ entry,
69
+ onClick
70
+ }: {
71
71
  entry: NavigationEntry;
72
72
  onClick?: () => void;
73
73
  }) {
@@ -92,17 +92,17 @@ export function SortableNavigationCard({
92
92
 
93
93
  return (
94
94
  <div ref={setNodeRef} style={style} {...attributes} {...listeners}>
95
- <NavigationCardBinding {...entry} onClick={onClick}/>
95
+ <NavigationCardBinding {...entry} onClick={onClick} />
96
96
  </div>
97
97
  );
98
98
  }
99
99
 
100
100
  export function NavigationGroupDroppable({
101
- id,
102
- itemIds,
103
- children,
104
- isPotentialCardDropTarget = false
105
- }: {
101
+ id,
102
+ itemIds,
103
+ children,
104
+ isPotentialCardDropTarget = false
105
+ }: {
106
106
  id: UniqueIdentifier;
107
107
  itemIds: UniqueIdentifier[];
108
108
  children: React.ReactNode;
@@ -128,10 +128,10 @@ export function NavigationGroupDroppable({
128
128
  }
129
129
 
130
130
  export function SortableNavigationGroup({
131
- groupName,
132
- children,
133
- disabled
134
- }: {
131
+ groupName,
132
+ children,
133
+ disabled
134
+ }: {
135
135
  groupName: string;
136
136
  children: React.ReactNode;
137
137
  disabled?: boolean;
@@ -164,21 +164,21 @@ export function SortableNavigationGroup({
164
164
  }
165
165
 
166
166
  export function useHomePageDnd({
167
- items,
168
- setItems,
169
- disabled,
170
- onCardMovedBetweenGroups,
171
- onGroupMoved,
172
- onNewGroupDrop,
173
- onPersist
174
- }: {
167
+ items,
168
+ setItems,
169
+ disabled,
170
+ onCardMovedBetweenGroups,
171
+ onGroupMoved,
172
+ onNewGroupDrop,
173
+ onPersist
174
+ }: {
175
175
  items: { name: string; entries: NavigationEntry[] }[];
176
176
  setItems: (
177
177
  newItemsOrUpdater:
178
178
  | { name: string; entries: NavigationEntry[] }[]
179
179
  | ((
180
- currentItems: { name: string; entries: NavigationEntry[] }[]
181
- ) => { name: string; entries: NavigationEntry[] }[])
180
+ currentItems: { name: string; entries: NavigationEntry[] }[]
181
+ ) => { name: string; entries: NavigationEntry[] }[])
182
182
  ) => void;
183
183
  disabled: boolean;
184
184
  onCardMovedBetweenGroups?: (card: NavigationEntry) => void;
@@ -344,9 +344,9 @@ export function useHomePageDnd({
344
344
  };
345
345
 
346
346
  const handleDragOver = ({
347
- active,
348
- over
349
- }: { active: Active; over: any }) => {
347
+ active,
348
+ over
349
+ }: { active: Active; over: any }) => {
350
350
  if (disabled || !over) return;
351
351
 
352
352
  const activeIdNow = active.id;
@@ -395,9 +395,9 @@ export function useHomePageDnd({
395
395
  };
396
396
 
397
397
  const handleDragEnd = ({
398
- active,
399
- over
400
- }: { active: Active; over: any }) => {
398
+ active,
399
+ over
400
+ }: { active: Active; over: any }) => {
401
401
  if (disabled || !over) {
402
402
  resetDragState();
403
403
  return;
@@ -505,10 +505,10 @@ export function useHomePageDnd({
505
505
  }
506
506
  }
507
507
  } else if (overCont && activeCont !== overCont) {
508
- // Card moved between different groups - use CLEAN pre-drag state
508
+ // Card moved between different groups - use CLEAN pre-drag state for the MOVE
509
+ // but use current dndItems for the POSITION
509
510
  const finalState = cloneItemsForDnd(sourceState);
510
511
 
511
- // Find target container from clean state too
512
512
  const finalOverId = lastOverId.current || overIdNow;
513
513
  const cleanOverCont = findContainerInState(finalOverId as string, sourceState) || overCont;
514
514
 
@@ -524,17 +524,32 @@ export function useHomePageDnd({
524
524
  // Remove from source
525
525
  const [moved] = src.entries.splice(idxInSrc, 1);
526
526
 
527
- // Calculate insertion position in target
527
+ // Calculate insertion position using CURRENT dndItems (visual state after handleDragOver)
528
+ // because that's where the user visually dropped it
529
+ const currentTgt = dndItems.find((g) => g.name === cleanOverCont);
528
530
  const overIsContainer = finalOverId === cleanOverCont;
531
+
529
532
  if (overIsContainer) {
530
533
  tgt.entries.push(moved);
531
- } else {
532
- const overIdx = tgt.entries.findIndex((e) => e.url === finalOverId);
533
- if (overIdx !== -1) {
534
- tgt.entries.splice(overIdx, 0, moved);
534
+ } else if (currentTgt) {
535
+ // Find position in current visual state
536
+ const currentOverIdx = currentTgt.entries.findIndex((e) => e.url === finalOverId);
537
+ if (currentOverIdx !== -1) {
538
+ // Find the card at that position in currentTgt, get its URL
539
+ // Then find that same card in tgt (pre-drag state) and insert before it
540
+ const cardAtPosition = currentTgt.entries[currentOverIdx];
541
+ const tgtOverIdx = tgt.entries.findIndex((e) => e.url === cardAtPosition.url);
542
+ if (tgtOverIdx !== -1) {
543
+ tgt.entries.splice(tgtOverIdx, 0, moved);
544
+ } else {
545
+ // Card might have been the dragged one in current state, just push
546
+ tgt.entries.push(moved);
547
+ }
535
548
  } else {
536
549
  tgt.entries.push(moved);
537
550
  }
551
+ } else {
552
+ tgt.entries.push(moved);
538
553
  }
539
554
 
540
555
  // Remove empty source group if needed
@@ -648,9 +663,9 @@ export function useHomePageDnd({
648
663
  }
649
664
 
650
665
  export function NewGroupDropZone({
651
- disabled,
652
- setIsHovering
653
- }: {
666
+ disabled,
667
+ setIsHovering
668
+ }: {
654
669
  disabled: boolean;
655
670
  setIsHovering: (v: boolean) => void;
656
671
  }) {
@@ -690,7 +705,7 @@ export function NewGroupDropZone({
690
705
  "fixed right-8 top-1/2 -translate-y-1/2 w-[200px] h-[120px] border border-dashed rounded-lg flex items-center justify-center transition-all",
691
706
  isOver
692
707
  ? "bg-surface-accent-100 dark:bg-surface-accent-800 border-surface-300 dark:border-surface-600"
693
- : "bg-surface-50 dark:bg-surface-900 border-surface-200 dark:border-surface-700"
708
+ : "bg-surface-50 dark:bg-surface-900 " + defaultBorderMixin
694
709
  )}>
695
710
  <div className="text-center p-4">
696
711
  <span className="block font-medium text-sm">
@@ -12,18 +12,19 @@ export type NavigationCardProps = {
12
12
 
13
13
  // Wrap the component with React.memo
14
14
  export const NavigationCard = React.memo(function NavigationCard({
15
- name,
16
- description,
17
- icon,
18
- actions,
19
- onClick,
20
- shrink
21
- }: NavigationCardProps) {
15
+ name,
16
+ description,
17
+ icon,
18
+ actions,
19
+ onClick,
20
+ shrink
21
+ }: NavigationCardProps) {
22
22
 
23
23
  return (
24
24
  <Card
25
25
  className={cls(
26
- "h-full p-4 cursor-pointer min-h-[230px] transition-all duration-200 ease-in-out",
26
+ "h-full px-4 py-3 cursor-pointer min-h-[160px] transition-all duration-200 ease-in-out",
27
+ "hover:-translate-y-0.5 hover:shadow-md hover:shadow-primary/5",
27
28
  shrink && "w-full max-w-full min-h-0 scale-75"
28
29
  )}
29
30
  onClick={() => {
@@ -36,12 +37,12 @@ export const NavigationCard = React.memo(function NavigationCard({
36
37
  className="flex-grow w-full">
37
38
 
38
39
  <div
39
- className="h-10 flex items-center w-full justify-between text-surface-300 dark:text-surface-600">
40
+ className="h-8 flex items-center w-full justify-between text-surface-300 dark:text-surface-600">
40
41
 
41
42
  {icon}
42
43
 
43
44
  <div
44
- className="flex items-center gap-1"
45
+ className="flex items-center gap-0.5"
45
46
  onClick={(event: React.MouseEvent) => {
46
47
  event.preventDefault();
47
48
  event.stopPropagation();
@@ -53,22 +54,23 @@ export const NavigationCard = React.memo(function NavigationCard({
53
54
 
54
55
  </div>
55
56
 
56
- <Typography gutterBottom variant="h5"
57
- component="h2">
57
+ <Typography gutterBottom variant="subtitle1"
58
+ className="font-medium mt-1"
59
+ component="h2">
58
60
  {name}
59
61
  </Typography>
60
62
 
61
- {description && <Typography variant="body2"
62
- color="secondary"
63
- component="div">
64
- <Markdown source={description} size={"small"}/>
63
+ {description && <Typography variant="caption"
64
+ color="secondary"
65
+ component="div">
66
+ <Markdown source={description} size={"small"} />
65
67
  </Typography>}
66
68
  </div>
67
69
 
68
70
  <div style={{ alignSelf: "flex-end" }}>
69
71
 
70
- <div className={"p-4"}>
71
- <ArrowForwardIcon className="text-primary"/>
72
+ <div className={"p-2"}>
73
+ <ArrowForwardIcon className="text-primary" size={"small"} />
72
74
  </div>
73
75
  </div>
74
76
 
@@ -2,16 +2,16 @@ import React, { PropsWithChildren, useState } from "react";
2
2
  import { cls, EditIcon, IconButton, Typography, ExpandablePanel } from "@firecms/ui";
3
3
 
4
4
  export function NavigationGroup({
5
- children,
6
- group,
7
- minimised,
8
- isPreview,
9
- isPotentialCardDropTarget,
10
- onEditGroup,
11
- dndDisabled,
12
- collapsed,
13
- onToggleCollapsed
14
- }: PropsWithChildren<{
5
+ children,
6
+ group,
7
+ minimised,
8
+ isPreview,
9
+ isPotentialCardDropTarget,
10
+ onEditGroup,
11
+ dndDisabled,
12
+ collapsed,
13
+ onToggleCollapsed
14
+ }: PropsWithChildren<{
15
15
  group: string | undefined,
16
16
  minimised?: boolean,
17
17
  isPreview?: boolean,
@@ -52,7 +52,7 @@ export function NavigationGroup({
52
52
  }}
53
53
  className={cls("ml-2 ", isHovered ? "opacity-100" : "opacity-0", "transition-opacity duration-100")}
54
54
  >
55
- <EditIcon size="smallest"/>
55
+ <EditIcon size="smallest" />
56
56
  </IconButton>
57
57
  )}
58
58
  </div>
@@ -70,7 +70,7 @@ export function NavigationGroup({
70
70
  <div
71
71
  className={cls(
72
72
  "flex items-center justify-between w-full",
73
- "p-4 py-2"
73
+ "p-4 py-2"
74
74
  )}
75
75
  onMouseEnter={() => setIsHovered(true)}
76
76
  onMouseLeave={() => setIsHovered(false)}
@@ -94,9 +94,10 @@ export function NavigationGroup({
94
94
  className={cls("mt-6")}
95
95
  titleClassName={cls(
96
96
  "min-h-0 p-0 border-none",
97
- "rounded-t flex items-center justify-between w-full",
97
+ "rounded flex items-center justify-between w-full",
98
98
  "hover:bg-transparent",
99
- "cursor-pointer select-none"
99
+ "cursor-pointer select-none",
100
+ collapsed && "bg-surface-100 dark:bg-surface-800/50"
100
101
  )}
101
102
  innerClassName={cls("mt-4", !minimised ? "pt-0" : "")}
102
103
  title={
@@ -111,7 +112,7 @@ export function NavigationGroup({
111
112
  >
112
113
  {minimised ? (
113
114
  <div className={cls("mt-4 p-8 bg-surface-accent-200 dark:bg-surface-accent-800 rounded-lg")}
114
- style={{ minHeight: "50px" }}>
115
+ style={{ minHeight: "50px" }}>
115
116
  </div>
116
117
  ) : (
117
118
  <div className={cls("mt-4", !minimised ? "pt-0" : "")}>
@@ -138,7 +139,7 @@ export function NavigationGroup({
138
139
  {!collapsed && (
139
140
  minimised ? (
140
141
  <div className={cls("mt-4 p-8 bg-surface-accent-200 dark:bg-surface-accent-800 rounded-lg")}
141
- style={{ minHeight: "50px" }}>
142
+ style={{ minHeight: "50px" }}>
142
143
  </div>
143
144
  ) : (
144
145
  <div className={cls("mt-4", !minimised ? "pt-0" : "")}>
@@ -108,12 +108,10 @@ export function RenameGroupDialog({
108
108
  </DialogContent>
109
109
  <DialogActions>
110
110
  <Button onClick={onClose}
111
- color={"primary"}
112
111
  variant="text">
113
112
  Cancel
114
113
  </Button>
115
114
  <Button onClick={handleSave}
116
- color={"primary"}
117
115
  disabled={!!error || !name.trim()}>
118
116
  Save
119
117
  </Button>
@@ -9,10 +9,10 @@ export type SmallNavigationCardProps = {
9
9
  };
10
10
 
11
11
  export function SmallNavigationCard({
12
- name,
13
- url,
14
- icon,
15
- }: SmallNavigationCardProps) {
12
+ name,
13
+ url,
14
+ icon,
15
+ }: SmallNavigationCardProps) {
16
16
 
17
17
  return (
18
18
  <>
@@ -28,17 +28,18 @@ export function SmallNavigationCard({
28
28
  <div className="flex flex-row items-center flex-grow gap-2 ">
29
29
  {icon}
30
30
 
31
- <Typography gutterBottom variant="h5"
32
- component="h2"
33
- className="mb-0 ml-4">
31
+ <Typography gutterBottom variant="subtitle1"
32
+ component="h2"
33
+ className="mb-0 ml-3 font-medium">
34
34
  {name}
35
35
  </Typography>
36
36
  </div>
37
37
 
38
- <div className={"p-4"}>
39
- <ArrowForwardIcon color="primary"/>
38
+ <div className={"p-2"}>
39
+ <ArrowForwardIcon color="primary" size={"small"} />
40
40
  </div>
41
41
  </Link>
42
42
 
43
43
  </>);
44
44
  }
45
+
@@ -326,7 +326,6 @@ export function ReferenceSelectionTable<M extends Record<string, any>>(
326
326
  </Typography>}
327
327
  <Button
328
328
  onClick={onDone}
329
- color="primary"
330
329
  variant="filled">
331
330
  Done
332
331
  </Button>
@@ -363,24 +362,18 @@ function ReferenceDialogActions({
363
362
  onClick && (largeLayout
364
363
  ? <Button
365
364
  onClick={onClick}
366
- startIcon={<AddIcon/>}
367
- variant="outlined"
368
- color="primary">
365
+ startIcon={<AddIcon/>}>
369
366
  Add {collection.singularName ?? collection.name}
370
367
  </Button>
371
368
  : <Button
372
- onClick={onClick}
373
- variant="outlined"
374
- color="primary"
375
- >
369
+ onClick={onClick}>
376
370
  <AddIcon/>
377
371
  </Button>);
378
372
 
379
373
  return (
380
374
  <>
381
375
  <Button onClick={onClear}
382
- variant={"text"}
383
- color="primary">
376
+ variant={"text"}>
384
377
  Clear
385
378
  </Button>
386
379
  {addButton}
@@ -136,16 +136,14 @@ export function ReferenceWidget<M extends Record<string, any>>({
136
136
  "min-w-80 flex flex-col gap-4",
137
137
  "relative transition-colors duration-200 ease-in rounded font-medium",
138
138
  disabled ? "bg-opacity-50" : "hover:bg-opacity-75",
139
- "text-opacity-50 dark:text-white dark:text-opacity-50",
139
+ "text-opacity-50 text-text-primary/50 dark:text-white dark:text-opacity-50 dark:text-white/50",
140
140
  className
141
141
  )}
142
142
  >
143
143
 
144
144
  {child}
145
145
  {!value && <div className="justify-center text-left">
146
- <Button variant="outlined"
147
- color="primary"
148
- disabled={disabled}
146
+ <Button disabled={disabled}
149
147
  onClick={onEntryClick}>
150
148
  Edit {name}
151
149
  </Button>
@@ -93,6 +93,11 @@ export type SelectableTableProps<M extends Record<string, any>> = {
93
93
  endAdornment?: React.ReactNode;
94
94
 
95
95
  AddColumnComponent?: React.ComponentType;
96
+
97
+ /**
98
+ * Callback when columns are reordered via drag-and-drop
99
+ */
100
+ onColumnsOrderChange?: (columns: VirtualTableColumn[]) => void;
96
101
  }
97
102
 
98
103
  /**
@@ -120,41 +125,42 @@ export type SelectableTableProps<M extends Record<string, any>> = {
120
125
  * @group Components
121
126
  */
122
127
  export const SelectableTable = function SelectableTable<M extends Record<string, any>>
123
- ({
124
- onValueChange,
125
- cellRenderer,
126
- onEntityClick,
127
- onColumnResize,
128
- hoverRow = true,
129
- size = "m",
130
- inlineEditing = false,
131
- tableController:
132
- {
133
- data,
134
- dataLoading,
135
- noMoreToLoad,
136
- dataLoadingError,
137
- filterValues,
138
- setFilterValues,
139
- sortBy,
140
- setSortBy,
141
- itemCount,
142
- setItemCount,
143
- pageSize = 50,
144
- paginationEnabled,
145
- checkFilterCombination,
146
- setPopupCell
147
- },
148
- filterable = true,
149
- onScroll,
150
- initialScroll,
151
- emptyComponent,
152
- columns,
153
- forceFilter,
154
- highlightedRow,
155
- endAdornment,
156
- AddColumnComponent
157
- }: SelectableTableProps<M>) {
128
+ ({
129
+ onValueChange,
130
+ cellRenderer,
131
+ onEntityClick,
132
+ onColumnResize,
133
+ hoverRow = true,
134
+ size = "m",
135
+ inlineEditing = false,
136
+ tableController:
137
+ {
138
+ data,
139
+ dataLoading,
140
+ noMoreToLoad,
141
+ dataLoadingError,
142
+ filterValues,
143
+ setFilterValues,
144
+ sortBy,
145
+ setSortBy,
146
+ itemCount,
147
+ setItemCount,
148
+ pageSize = 50,
149
+ paginationEnabled,
150
+ checkFilterCombination,
151
+ setPopupCell
152
+ },
153
+ filterable = true,
154
+ onScroll,
155
+ initialScroll,
156
+ emptyComponent,
157
+ columns,
158
+ forceFilter,
159
+ highlightedRow,
160
+ endAdornment,
161
+ AddColumnComponent,
162
+ onColumnsOrderChange
163
+ }: SelectableTableProps<M>) {
158
164
 
159
165
  const ref = useRef<HTMLDivElement>(null);
160
166
 
@@ -224,7 +230,7 @@ export const SelectableTable = function SelectableTable<M extends Record<string,
224
230
  <SelectableTableContext.Provider
225
231
  value={contextValue}>
226
232
  <div className="h-full w-full flex flex-col bg-white dark:bg-surface-950"
227
- ref={ref}>
233
+ ref={ref}>
228
234
 
229
235
  <VirtualTable
230
236
  data={data}
@@ -247,12 +253,13 @@ export const SelectableTable = function SelectableTable<M extends Record<string,
247
253
  checkFilterCombination={checkFilterCombination}
248
254
  createFilterField={filterable ? createFilterField : undefined}
249
255
  rowClassName={useCallback((entity: Entity<M>) => {
250
- return highlightedRow?.(entity) ? "bg-surface-100 bg-opacity-75 dark:bg-surface-800 dark:bg-opacity-75" : "";
256
+ return highlightedRow?.(entity) ? "bg-surface-100 bg-opacity-75 bg-surface-100/75 dark:bg-surface-800 dark:bg-opacity-75 dark:bg-surface-800/75" : "";
251
257
  }, [highlightedRow])}
252
258
  className="flex-grow"
253
259
  emptyComponent={emptyComponent}
254
260
  endAdornment={endAdornment}
255
261
  AddColumnComponent={AddColumnComponent}
262
+ onColumnsOrderChange={onColumnsOrderChange}
256
263
  />
257
264
 
258
265
  </div>
@@ -262,13 +269,13 @@ export const SelectableTable = function SelectableTable<M extends Record<string,
262
269
  };
263
270
 
264
271
  function createFilterField({
265
- id,
266
- filterValue,
267
- setFilterValue,
268
- column,
269
- hidden,
270
- setHidden
271
- }: FilterFormFieldProps<{
272
+ id,
273
+ filterValue,
274
+ setFilterValue,
275
+ column,
276
+ hidden,
277
+ setHidden
278
+ }: FilterFormFieldProps<{
272
279
  resolvedProperty: ResolvedProperty,
273
280
  disabled: boolean,
274
281
  }>): React.ReactNode {
@@ -286,40 +293,41 @@ function createFilterField({
286
293
  }
287
294
  if (baseProperty.dataType === "reference") {
288
295
  return <ReferenceFilterField value={filterValue}
289
- setValue={setFilterValue}
290
- name={id as string}
291
- isArray={isArray}
292
- path={baseProperty.path}
293
- title={resolvedProperty?.name}
294
- includeId={baseProperty.includeId}
295
- previewProperties={baseProperty?.previewProperties}
296
- hidden={hidden}
297
- setHidden={setHidden}/>;
296
+ setValue={setFilterValue}
297
+ name={id as string}
298
+ isArray={isArray}
299
+ path={baseProperty.path}
300
+ title={resolvedProperty?.name}
301
+ includeId={baseProperty.includeId}
302
+ previewProperties={baseProperty?.previewProperties}
303
+ hidden={hidden}
304
+ setHidden={setHidden} />;
298
305
  } else if (baseProperty.dataType === "number" || baseProperty.dataType === "string") {
299
306
  const name = baseProperty.name;
300
307
  const enumValues = baseProperty.enumValues ? enumToObjectEntries(baseProperty.enumValues) : undefined;
301
308
  return <StringNumberFilterField value={filterValue}
302
- setValue={setFilterValue}
303
- name={id as string}
304
- dataType={baseProperty.dataType}
305
- isArray={isArray}
306
- enumValues={enumValues}
307
- title={name}/>;
309
+ setValue={setFilterValue}
310
+ name={id as string}
311
+ dataType={baseProperty.dataType}
312
+ isArray={isArray}
313
+ enumValues={enumValues}
314
+ title={name} />;
308
315
  } else if (baseProperty.dataType === "boolean") {
309
316
  const name = baseProperty.name;
310
317
  return <BooleanFilterField value={filterValue}
311
- setValue={setFilterValue}
312
- name={id as string}
313
- title={name}/>;
318
+ setValue={setFilterValue}
319
+ name={id as string}
320
+ title={name} />;
314
321
 
315
322
  } else if (baseProperty.dataType === "date") {
316
323
  const title = baseProperty.name;
317
324
  return <DateTimeFilterField value={filterValue}
318
- setValue={setFilterValue}
319
- name={id as string}
320
- mode={baseProperty.mode}
321
- isArray={isArray}
322
- title={title}/>;
325
+ setValue={setFilterValue}
326
+ name={id as string}
327
+ mode={baseProperty.mode}
328
+ isArray={isArray}
329
+ timezone={baseProperty.timezone}
330
+ title={title} />;
323
331
  }
324
332
 
325
333
  return (