@rebasepro/admin 0.8.0 → 0.9.0

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 (316) hide show
  1. package/README.md +20 -20
  2. package/dist/{CollectionEditorDialog-BO_aQ-Z4.js → CollectionEditorDialog-B-7uW3iJ.js} +11 -11
  3. package/dist/CollectionEditorDialog-B-7uW3iJ.js.map +1 -0
  4. package/dist/{PropertyEditView-DKzOpMjR.js → PropertyEditView-7KMTcrqi.js} +78 -70
  5. package/dist/PropertyEditView-7KMTcrqi.js.map +1 -0
  6. package/dist/{RouterCollectionsStudioView-BQTIExjA.js → RouterCollectionsStudioView-epqIbZrJ.js} +4 -4
  7. package/dist/{RouterCollectionsStudioView-BQTIExjA.js.map → RouterCollectionsStudioView-epqIbZrJ.js.map} +1 -1
  8. package/dist/collection_editor/_cms_internals.d.ts +3 -3
  9. package/dist/collection_editor/api/generateCollectionApi.d.ts +4 -4
  10. package/dist/collection_editor/extensibility_types.d.ts +3 -3
  11. package/dist/collection_editor/index.d.ts +2 -2
  12. package/dist/collection_editor/pgColumnToProperty.d.ts +3 -3
  13. package/dist/collection_editor/serializable_types.d.ts +7 -7
  14. package/dist/collection_editor/serializable_utils.d.ts +8 -8
  15. package/dist/collection_editor/types/collection_editor_controller.d.ts +5 -5
  16. package/dist/collection_editor/types/collection_inference.d.ts +2 -2
  17. package/dist/collection_editor/types/config_controller.d.ts +7 -7
  18. package/dist/collection_editor/ui/AddKanbanColumnAction.d.ts +2 -2
  19. package/dist/collection_editor/ui/CollectionViewHeaderAction.d.ts +2 -2
  20. package/dist/collection_editor/ui/KanbanSetupAction.d.ts +2 -2
  21. package/dist/collection_editor/ui/PropertyAddColumnComponent.d.ts +2 -2
  22. package/dist/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.d.ts +3 -3
  23. package/dist/collection_editor/ui/collection_editor/CollectionDetailsForm.d.ts +2 -2
  24. package/dist/collection_editor/ui/collection_editor/CollectionEditorDialog.d.ts +4 -4
  25. package/dist/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.d.ts +2 -2
  26. package/dist/collection_editor/ui/collection_editor/CollectionJsonImportDialog.d.ts +2 -2
  27. package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.d.ts +4 -4
  28. package/dist/collection_editor/ui/collection_editor/CollectionStudioView.d.ts +2 -2
  29. package/dist/collection_editor/ui/collection_editor/CollectionsStudioView.d.ts +2 -2
  30. package/dist/collection_editor/ui/collection_editor/EntityActionsEditTab.d.ts +2 -2
  31. package/dist/collection_editor/ui/collection_editor/GeneralSettingsForm.d.ts +2 -2
  32. package/dist/collection_editor/ui/collection_editor/GetCodeDialog.d.ts +2 -2
  33. package/dist/collection_editor/ui/collection_editor/PropertyEditView.d.ts +4 -4
  34. package/dist/collection_editor/ui/collection_editor/SubcollectionsEditTab.d.ts +3 -3
  35. package/dist/collection_editor/ui/collection_editor/templates/blog_template.d.ts +2 -2
  36. package/dist/collection_editor/ui/collection_editor/templates/pages_template.d.ts +2 -2
  37. package/dist/collection_editor/ui/collection_editor/templates/products_template.d.ts +2 -2
  38. package/dist/collection_editor/ui/collection_editor/templates/users_template.d.ts +2 -2
  39. package/dist/collection_editor/useLocalCollectionsConfigController.d.ts +2 -2
  40. package/dist/collection_editor/validateCollectionJson.d.ts +2 -2
  41. package/dist/collection_editor_ui.js +4 -4
  42. package/dist/components/CollectionPanel.d.ts +4 -4
  43. package/dist/components/{EntityCollectionTable/EntityCollectionRowActions.d.ts → CollectionTableBinding/CollectionRowActions.d.ts} +3 -3
  44. package/dist/components/CollectionTableBinding/CollectionTableBinding.d.ts +28 -0
  45. package/dist/components/{EntityCollectionTable/EntityCollectionTableProps.d.ts → CollectionTableBinding/CollectionTableBindingProps.d.ts} +1 -1
  46. package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableMultipleRelationField.d.ts +2 -2
  47. package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableReferenceField.d.ts +2 -2
  48. package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableRelationField.d.ts +2 -2
  49. package/dist/components/CollectionTableBinding/index.d.ts +6 -0
  50. package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/common.d.ts +2 -2
  51. package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/PopupFormField.d.ts +2 -2
  52. package/dist/components/{EntityCollectionView/EntityBoardCard.d.ts → CollectionViewBinding/BoardCardBinding.d.ts} +8 -8
  53. package/dist/components/{EntityCollectionView/EntityCollectionBoardView.d.ts → CollectionViewBinding/CollectionBoardViewBinding.d.ts} +4 -4
  54. package/dist/components/{EntityCollectionView/EntityCollectionCardView.d.ts → CollectionViewBinding/CollectionCardViewBinding.d.ts} +5 -5
  55. package/dist/components/{EntityCollectionView/EntityCollectionListView.d.ts → CollectionViewBinding/CollectionListViewBinding.d.ts} +4 -4
  56. package/dist/components/{EntityCollectionView/EntityCollectionViewActions.d.ts → CollectionViewBinding/CollectionViewActions.d.ts} +4 -4
  57. package/dist/components/{EntityCollectionView/EntityCollectionView.d.ts → CollectionViewBinding/CollectionViewBinding.d.ts} +4 -4
  58. package/dist/components/{EntityCollectionView/EntityCollectionViewStartActions.d.ts → CollectionViewBinding/CollectionViewStartActions.d.ts} +4 -4
  59. package/dist/components/CollectionViewBinding/EntityCardBinding.d.ts +21 -0
  60. package/dist/components/{EntityCollectionView → CollectionViewBinding}/SplitListView.d.ts +3 -3
  61. package/dist/components/{EntityCollectionView → CollectionViewBinding}/hooks/useCollectionInlineEditor.d.ts +2 -2
  62. package/dist/components/{EntityCollectionView → CollectionViewBinding}/hooks/useKanbanDragAndDrop.d.ts +2 -2
  63. package/dist/components/{EntityCollectionView → CollectionViewBinding}/useBoardDataController.d.ts +2 -2
  64. package/dist/components/{EntityCollectionView/useEntityPreviewSlots.d.ts → CollectionViewBinding/usePreviewSlots.d.ts} +5 -5
  65. package/dist/components/DeleteEntityDialog.d.ts +4 -4
  66. package/dist/components/{EntityDetailView.d.ts → DetailViewBinding.d.ts} +5 -5
  67. package/dist/components/EditFormActions.d.ts +3 -0
  68. package/dist/components/{EntityEditView.d.ts → EditViewBinding.d.ts} +9 -9
  69. package/dist/components/{EntityPreview.d.ts → EntityPreviewBinding.d.ts} +13 -13
  70. package/dist/components/EntityViewBinding.d.ts +13 -0
  71. package/dist/components/{EntityJsonPreview.d.ts → JsonPreviewBinding.d.ts} +1 -1
  72. package/dist/components/RebaseCMS.d.ts +1 -1
  73. package/dist/components/RebaseNavigation.d.ts +1 -1
  74. package/dist/components/ReferenceTable/{EntitySelectionTable.d.ts → SelectionTableBinding.d.ts} +5 -5
  75. package/dist/components/SelectableTable/SelectableTable.d.ts +5 -5
  76. package/dist/components/SelectableTable/SelectableTableContext.d.ts +3 -3
  77. package/dist/components/SelectableTable/SelectionStore.d.ts +2 -2
  78. package/dist/components/SelectableTable/filters/BooleanFilterField.d.ts +6 -1
  79. package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +7 -1
  80. package/dist/components/SelectableTable/filters/FilterFieldBinding.d.ts +40 -0
  81. package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +7 -1
  82. package/dist/components/SelectableTable/filters/RelationFilterField.d.ts +7 -1
  83. package/dist/components/SelectableTable/filters/StringNumberFilterField.d.ts +7 -1
  84. package/dist/components/SideDialogs.d.ts +1 -1
  85. package/dist/components/SidePanelBinding.d.ts +11 -0
  86. package/dist/components/{SideEntityProvider.d.ts → SidePanelProvider.d.ts} +7 -7
  87. package/dist/components/history/EntityHistoryEntry.d.ts +2 -2
  88. package/dist/components/history/LastEditedByIndicator.d.ts +2 -2
  89. package/dist/components/index.d.ts +14 -13
  90. package/dist/contexts/SidePanelControllerContext.d.ts +3 -0
  91. package/dist/data_export/export/ExportCollectionAction.d.ts +3 -3
  92. package/dist/data_import/components/ImportSaveInProgress.d.ts +2 -2
  93. package/dist/form/EntityForm.d.ts +1 -1
  94. package/dist/form/PropertyFieldBinding.d.ts +1 -1
  95. package/dist/form/form_utils.d.ts +2 -2
  96. package/dist/{history-B3cqBzEV.js → history-7X5bON_n.js} +4 -4
  97. package/dist/history-7X5bON_n.js.map +1 -0
  98. package/dist/hooks/index.d.ts +4 -4
  99. package/dist/hooks/navigation/contexts/CollectionRegistryContext.d.ts +2 -2
  100. package/dist/hooks/navigation/useBuildNavigationStateController.d.ts +5 -5
  101. package/dist/hooks/navigation/useNavigationResolution.d.ts +4 -4
  102. package/dist/hooks/navigation/useResolvedCollections.d.ts +7 -7
  103. package/dist/hooks/navigation/useTopLevelNavigation.d.ts +2 -2
  104. package/dist/hooks/navigation/utils.d.ts +5 -5
  105. package/dist/hooks/useBuildSidePanel.d.ts +6 -0
  106. package/dist/hooks/useCMSContext.d.ts +2 -2
  107. package/dist/hooks/{useEntityHistory.d.ts → useHistory.d.ts} +1 -1
  108. package/dist/hooks/useResolvedNavigationFrom.d.ts +3 -3
  109. package/dist/hooks/{useEntitySelectionDialog.d.ts → useSelectionDialog.d.ts} +2 -2
  110. package/dist/hooks/useSideDialogsController.d.ts +1 -1
  111. package/dist/hooks/useSidePanel.d.ts +11 -0
  112. package/dist/index.d.ts +2 -2
  113. package/dist/index.js +2 -2
  114. package/dist/{src-cxV1ODRG.js → src-sUZfe29F.js} +737 -647
  115. package/dist/src-sUZfe29F.js.map +1 -0
  116. package/dist/types/components/EntityFormActionsProps.d.ts +2 -2
  117. package/dist/types/components/EntityFormProps.d.ts +3 -3
  118. package/dist/types/fields.d.ts +2 -2
  119. package/dist/util/dataControllerAdapter.d.ts +2 -5
  120. package/dist/util/navigation_utils.d.ts +6 -6
  121. package/dist/util/previews.d.ts +3 -3
  122. package/dist/util/property_utils.d.ts +2 -2
  123. package/dist/util/{entity_view_constants.d.ts → view_constants.d.ts} +1 -1
  124. package/package.json +8 -8
  125. package/src/collection_editor/ConfigControllerProvider.tsx +10 -10
  126. package/src/collection_editor/_cms_internals.ts +3 -3
  127. package/src/collection_editor/api/generateCollectionApi.ts +4 -4
  128. package/src/collection_editor/extensibility_types.ts +3 -3
  129. package/src/collection_editor/index.ts +3 -3
  130. package/src/collection_editor/pgColumnToProperty.ts +3 -3
  131. package/src/collection_editor/serializable_types.ts +8 -8
  132. package/src/collection_editor/serializable_utils.ts +17 -17
  133. package/src/collection_editor/types/collection_editor_controller.tsx +5 -5
  134. package/src/collection_editor/types/collection_inference.ts +2 -2
  135. package/src/collection_editor/types/config_controller.tsx +7 -7
  136. package/src/collection_editor/ui/AddKanbanColumnAction.tsx +2 -2
  137. package/src/collection_editor/ui/CollectionViewHeaderAction.tsx +2 -2
  138. package/src/collection_editor/ui/EditorCollectionAction.tsx +2 -2
  139. package/src/collection_editor/ui/EditorCollectionActionStart.tsx +2 -2
  140. package/src/collection_editor/ui/EditorEntityAction.tsx +2 -2
  141. package/src/collection_editor/ui/KanbanSetupAction.tsx +2 -2
  142. package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +2 -2
  143. package/src/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.tsx +5 -5
  144. package/src/collection_editor/ui/collection_editor/CollectionDetailsForm.tsx +3 -3
  145. package/src/collection_editor/ui/collection_editor/CollectionEditorDialog.tsx +26 -26
  146. package/src/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.tsx +3 -3
  147. package/src/collection_editor/ui/collection_editor/CollectionJsonImportDialog.tsx +2 -2
  148. package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +8 -8
  149. package/src/collection_editor/ui/collection_editor/CollectionRLSTab.tsx +2 -2
  150. package/src/collection_editor/ui/collection_editor/CollectionRelationsTab.tsx +2 -2
  151. package/src/collection_editor/ui/collection_editor/CollectionStudioView.tsx +2 -2
  152. package/src/collection_editor/ui/collection_editor/CollectionsStudioView.tsx +2 -2
  153. package/src/collection_editor/ui/collection_editor/DisplaySettingsForm.tsx +2 -2
  154. package/src/collection_editor/ui/collection_editor/EntityActionsEditTab.tsx +3 -3
  155. package/src/collection_editor/ui/collection_editor/GeneralSettingsForm.tsx +5 -5
  156. package/src/collection_editor/ui/collection_editor/GetCodeDialog.tsx +4 -4
  157. package/src/collection_editor/ui/collection_editor/KanbanConfigSection.tsx +2 -2
  158. package/src/collection_editor/ui/collection_editor/PropertyEditView.tsx +7 -7
  159. package/src/collection_editor/ui/collection_editor/PropertyFieldPreview.tsx +45 -36
  160. package/src/collection_editor/ui/collection_editor/PropertyTree.tsx +1 -1
  161. package/src/collection_editor/ui/collection_editor/SubcollectionsEditTab.tsx +5 -5
  162. package/src/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.tsx +3 -3
  163. package/src/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.tsx +2 -2
  164. package/src/collection_editor/ui/collection_editor/properties/RelationPropertyField.tsx +2 -2
  165. package/src/collection_editor/ui/collection_editor/templates/blog_template.ts +2 -2
  166. package/src/collection_editor/ui/collection_editor/templates/pages_template.ts +2 -2
  167. package/src/collection_editor/ui/collection_editor/templates/products_template.ts +2 -2
  168. package/src/collection_editor/ui/collection_editor/templates/users_template.ts +2 -2
  169. package/src/collection_editor/useJsonCollectionsConfigController.tsx +13 -13
  170. package/src/collection_editor/useLocalCollectionsConfigController.tsx +4 -4
  171. package/src/collection_editor/validateCollectionJson.ts +3 -3
  172. package/src/components/CollectionPanel.tsx +14 -17
  173. package/src/components/{EntityCollectionTable/EntityCollectionRowActions.tsx → CollectionTableBinding/CollectionRowActions.tsx} +6 -6
  174. package/src/components/{EntityCollectionTable/EntityCollectionTable.tsx → CollectionTableBinding/CollectionTableBinding.tsx} +10 -10
  175. package/src/components/{EntityCollectionTable/EntityCollectionTableProps.tsx → CollectionTableBinding/CollectionTableBindingProps.tsx} +1 -1
  176. package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableMultipleRelationField.tsx +5 -5
  177. package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableReferenceField.tsx +10 -10
  178. package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableRelationField.tsx +5 -5
  179. package/src/components/CollectionTableBinding/index.tsx +14 -0
  180. package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/common.tsx +2 -2
  181. package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/PopupFormField.tsx +2 -2
  182. package/src/components/{EntityCollectionView/EntityBoardCard.tsx → CollectionViewBinding/BoardCardBinding.tsx} +15 -15
  183. package/src/components/{EntityCollectionView/EntityCollectionBoardView.tsx → CollectionViewBinding/CollectionBoardViewBinding.tsx} +14 -13
  184. package/src/components/{EntityCollectionView/EntityCollectionCardView.tsx → CollectionViewBinding/CollectionCardViewBinding.tsx} +8 -8
  185. package/src/components/{EntityCollectionView/EntityCollectionListView.tsx → CollectionViewBinding/CollectionListViewBinding.tsx} +12 -12
  186. package/src/components/{EntityCollectionView/EntityCollectionViewActions.tsx → CollectionViewBinding/CollectionViewActions.tsx} +5 -5
  187. package/src/components/{EntityCollectionView/EntityCollectionView.tsx → CollectionViewBinding/CollectionViewBinding.tsx} +106 -91
  188. package/src/components/{EntityCollectionView/EntityCollectionViewStartActions.tsx → CollectionViewBinding/CollectionViewStartActions.tsx} +5 -5
  189. package/src/components/{EntityCollectionView/EntityCard.tsx → CollectionViewBinding/EntityCardBinding.tsx} +9 -9
  190. package/src/components/{EntityCollectionView → CollectionViewBinding}/FiltersDialog.tsx +31 -72
  191. package/src/components/{EntityCollectionView → CollectionViewBinding}/SplitListView.tsx +9 -9
  192. package/src/components/{EntityCollectionView → CollectionViewBinding}/hooks/useCollectionInlineEditor.ts +5 -5
  193. package/src/components/{EntityCollectionView → CollectionViewBinding}/hooks/useKanbanDragAndDrop.ts +4 -4
  194. package/src/components/{EntityCollectionView → CollectionViewBinding}/useBoardDataController.tsx +16 -10
  195. package/src/components/{EntityCollectionView/useEntityPreviewSlots.ts → CollectionViewBinding/usePreviewSlots.ts} +8 -8
  196. package/src/components/DeleteEntityDialog.tsx +6 -6
  197. package/src/components/{EntityDetailView.tsx → DetailViewBinding.tsx} +26 -29
  198. package/src/components/{EntityEditViewFormActions.tsx → EditFormActions.tsx} +12 -12
  199. package/src/components/{EntityEditView.tsx → EditViewBinding.tsx} +29 -32
  200. package/src/components/{EntityPreview.tsx → EntityPreviewBinding.tsx} +27 -27
  201. package/src/components/{EntityView.tsx → EntityViewBinding.tsx} +5 -5
  202. package/src/components/HomePage/NavigationCardBinding.tsx +1 -1
  203. package/src/components/{EntityJsonPreview.tsx → JsonPreviewBinding.tsx} +1 -1
  204. package/src/components/RebaseCMS.tsx +4 -3
  205. package/src/components/RebaseNavigation.tsx +17 -8
  206. package/src/components/ReferenceTable/{EntitySelectionTable.tsx → SelectionTableBinding.tsx} +22 -19
  207. package/src/components/ReferenceWidget.tsx +4 -4
  208. package/src/components/RelationSelector.tsx +14 -12
  209. package/src/components/SelectableTable/SelectableTable.tsx +34 -87
  210. package/src/components/SelectableTable/SelectableTableContext.tsx +3 -3
  211. package/src/components/SelectableTable/SelectionStore.ts +4 -4
  212. package/src/components/SelectableTable/filters/BooleanFilterField.tsx +9 -1
  213. package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +33 -12
  214. package/src/components/SelectableTable/filters/FilterFieldBinding.tsx +187 -0
  215. package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +21 -7
  216. package/src/components/SelectableTable/filters/RelationFilterField.tsx +17 -3
  217. package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +66 -12
  218. package/src/components/SideDialogs.tsx +3 -3
  219. package/src/components/{EntitySidePanel.tsx → SidePanelBinding.tsx} +19 -19
  220. package/src/components/{SideEntityProvider.tsx → SidePanelProvider.tsx} +16 -16
  221. package/src/components/common/default_entity_actions.tsx +9 -9
  222. package/src/components/history/EntityHistoryEntry.tsx +2 -2
  223. package/src/components/history/EntityHistoryView.tsx +3 -3
  224. package/src/components/history/LastEditedByIndicator.tsx +2 -2
  225. package/src/components/index.ts +15 -14
  226. package/src/contexts/SidePanelControllerContext.tsx +5 -0
  227. package/src/data_export/export/ExportCollectionAction.tsx +4 -4
  228. package/src/data_import/components/ImportSaveInProgress.tsx +3 -3
  229. package/src/data_import/import/ImportCollectionAction.tsx +4 -4
  230. package/src/data_import/utils/data.ts +2 -2
  231. package/src/form/EntityForm.tsx +2 -2
  232. package/src/form/EntityFormActions.tsx +3 -3
  233. package/src/form/EntityFormBinding.tsx +6 -6
  234. package/src/form/PropertyFieldBinding.tsx +4 -4
  235. package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +4 -4
  236. package/src/form/field_bindings/KeyValueFieldBinding.tsx +19 -19
  237. package/src/form/field_bindings/MultipleRelationFieldBinding.tsx +2 -2
  238. package/src/form/field_bindings/ReferenceFieldBinding.tsx +5 -5
  239. package/src/form/field_bindings/RelationFieldBinding.tsx +3 -3
  240. package/src/form/form_utils.ts +2 -2
  241. package/src/hooks/index.ts +4 -4
  242. package/src/hooks/navigation/contexts/CollectionRegistryContext.tsx +2 -2
  243. package/src/hooks/navigation/useBuildCollectionRegistryController.tsx +11 -11
  244. package/src/hooks/navigation/useBuildNavigationStateController.tsx +5 -5
  245. package/src/hooks/navigation/useNavigationResolution.ts +10 -10
  246. package/src/hooks/navigation/useResolvedCollections.ts +8 -8
  247. package/src/hooks/navigation/useTopLevelNavigation.ts +2 -2
  248. package/src/hooks/navigation/utils.ts +5 -5
  249. package/src/hooks/{useBuildSideEntityController.tsx → useBuildSidePanel.tsx} +28 -28
  250. package/src/hooks/useCMSContext.tsx +6 -6
  251. package/src/hooks/{useEntityHistory.ts → useHistory.ts} +1 -1
  252. package/src/hooks/useResolvedNavigationFrom.tsx +8 -5
  253. package/src/hooks/{useEntitySelectionDialog.tsx → useSelectionDialog.tsx} +7 -7
  254. package/src/hooks/useSideDialogsController.tsx +1 -1
  255. package/src/hooks/useSidePanel.tsx +13 -0
  256. package/src/index.ts +12 -12
  257. package/src/preview/components/ReferencePreview.tsx +10 -10
  258. package/src/preview/components/RelationPreview.tsx +13 -12
  259. package/src/routes/RebaseRoute.tsx +10 -10
  260. package/src/types/components/EntityFormActionsProps.tsx +2 -2
  261. package/src/types/components/EntityFormProps.tsx +3 -3
  262. package/src/types/fields.tsx +2 -2
  263. package/src/util/dataControllerAdapter.ts +9 -15
  264. package/src/util/navigation_utils.ts +7 -7
  265. package/src/util/previews.ts +3 -3
  266. package/src/util/property_utils.tsx +2 -2
  267. package/src/util/{entity_view_constants.ts → view_constants.ts} +1 -1
  268. package/dist/CollectionEditorDialog-BO_aQ-Z4.js.map +0 -1
  269. package/dist/PropertyEditView-DKzOpMjR.js.map +0 -1
  270. package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +0 -28
  271. package/dist/components/EntityCollectionTable/index.d.ts +0 -6
  272. package/dist/components/EntityCollectionView/EntityCard.d.ts +0 -21
  273. package/dist/components/EntityEditViewFormActions.d.ts +0 -3
  274. package/dist/components/EntitySidePanel.d.ts +0 -11
  275. package/dist/components/EntityView.d.ts +0 -13
  276. package/dist/contexts/SideEntityControllerContext.d.ts +0 -3
  277. package/dist/history-B3cqBzEV.js.map +0 -1
  278. package/dist/hooks/useBuildSideEntityController.d.ts +0 -6
  279. package/dist/hooks/useSideEntityController.d.ts +0 -11
  280. package/dist/src-cxV1ODRG.js.map +0 -1
  281. package/src/components/EntityCollectionTable/index.tsx +0 -14
  282. package/src/contexts/SideEntityControllerContext.tsx +0 -5
  283. package/src/hooks/useSideEntityController.tsx +0 -13
  284. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/PropertyTableCell.d.ts +0 -0
  285. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/column_utils.d.ts +0 -0
  286. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableRelationSelectorField.d.ts +0 -0
  287. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableStorageUpload.d.ts +0 -0
  288. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/VirtualTableSelect.d.ts +0 -0
  289. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/VirtualTableUserSelect.d.ts +0 -0
  290. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/CollectionTableToolbar.d.ts +0 -0
  291. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/EntityTableCell.d.ts +0 -0
  292. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/EntityTableCellActions.d.ts +0 -0
  293. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/useDraggable.d.ts +0 -0
  294. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/useWindowSize.d.ts +0 -0
  295. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/table_bindings.d.ts +0 -0
  296. /package/dist/components/{EntityCollectionView → CollectionViewBinding}/FilterPresetsButton.d.ts +0 -0
  297. /package/dist/components/{EntityCollectionView → CollectionViewBinding}/FiltersDialog.d.ts +0 -0
  298. /package/dist/components/{EntityCollectionView → CollectionViewBinding}/ViewModeToggle.d.ts +0 -0
  299. /package/dist/components/{EntityCollectionView → CollectionViewBinding}/useSelectionController.d.ts +0 -0
  300. /package/dist/components/{EntityCollectionView → CollectionViewBinding}/utils.d.ts +0 -0
  301. /package/src/components/{EntityCollectionTable → CollectionTableBinding}/PropertyTableCell.tsx +0 -0
  302. /package/src/components/{EntityCollectionTable → CollectionTableBinding}/column_utils.tsx +0 -0
  303. /package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableRelationSelectorField.tsx +0 -0
  304. /package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableStorageUpload.tsx +0 -0
  305. /package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/VirtualTableSelect.tsx +0 -0
  306. /package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/VirtualTableUserSelect.tsx +0 -0
  307. /package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/CollectionTableToolbar.tsx +0 -0
  308. /package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/EntityTableCell.tsx +0 -0
  309. /package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/EntityTableCellActions.tsx +0 -0
  310. /package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/useDraggable.tsx +0 -0
  311. /package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/useWindowSize.tsx +0 -0
  312. /package/src/components/{EntityCollectionTable → CollectionTableBinding}/table_bindings.tsx +0 -0
  313. /package/src/components/{EntityCollectionView → CollectionViewBinding}/FilterPresetsButton.tsx +0 -0
  314. /package/src/components/{EntityCollectionView → CollectionViewBinding}/ViewModeToggle.tsx +0 -0
  315. /package/src/components/{EntityCollectionView → CollectionViewBinding}/useSelectionController.tsx +0 -0
  316. /package/src/components/{EntityCollectionView → CollectionViewBinding}/utils.ts +0 -0
@@ -1,12 +1,13 @@
1
- import type { EntityCollection } from "@rebasepro/types";
1
+ import type { CollectionConfig } from "@rebasepro/types";
2
2
  import React, { MouseEventHandler, useCallback, useEffect, useMemo, useRef, useState } from "react";
3
3
  import { CollectionSize, Entity, FilterValues } from "@rebasepro/types";
4
4
 
5
5
  import {
6
- EntityCollectionRowActions,
7
- EntityCollectionTable
8
- } from "../EntityCollectionTable";
6
+ CollectionRowActions,
7
+ CollectionTableBinding
8
+ } from "../CollectionTableBinding";
9
9
  import {
10
+ CollectionScopeProvider,
10
11
  useAuthController,
11
12
  useCustomizationController,
12
13
  useData,
@@ -17,17 +18,17 @@ import {
17
18
  import { ErrorView } from "@rebasepro/core";
18
19
  import { Button, DialogActions, PlusIcon, Typography } from "@rebasepro/ui";
19
20
  import { IconForView } from "@rebasepro/core";
20
- import { useSelectionController } from "../EntityCollectionView/useSelectionController";
21
+ import { useSelectionController } from "../CollectionViewBinding/useSelectionController";
21
22
 
22
23
  import { useColumnIds } from "@rebasepro/core";
23
24
  import { useSideDialogContext } from "../SideDialogs";
24
25
  import { useAnalyticsController } from "@rebasepro/core";
25
- import { useUrlController, useSideEntityController } from "../../index";
26
+ import { useUrlController, useSidePanel } from "../../index";
26
27
 
27
28
  /**
28
29
  * @group Components
29
30
  */
30
- export interface EntitySelectionProps<M extends Record<string, unknown>> {
31
+ export interface SelectionProps<M extends Record<string, unknown>> {
31
32
 
32
33
  /**
33
34
  * Allow multiple selection of values
@@ -37,7 +38,7 @@ export interface EntitySelectionProps<M extends Record<string, unknown>> {
37
38
  /**
38
39
  * Entity collection config
39
40
  */
40
- collection?: EntityCollection<M>;
41
+ collection?: CollectionConfig<M>;
41
42
 
42
43
  /**
43
44
  * Absolute path of the collection.
@@ -87,20 +88,20 @@ export interface EntitySelectionProps<M extends Record<string, unknown>> {
87
88
 
88
89
  /**
89
90
  * This component allows to select entities from a given collection.
90
- * You probably want to open this dialog as a side view using {@link useEntitySelectionTable}
91
+ * You probably want to open this dialog as a side view using {@link useSelectionTableBinding}
91
92
  * @group Components
92
93
  */
93
- export function EntitySelectionTable<M extends Record<string, unknown>>(
94
- props: EntitySelectionProps<M>
94
+ export function SelectionTableBinding<M extends Record<string, unknown>>(
95
+ props: SelectionProps<M>
95
96
  ) {
96
97
  if (!props.collection) {
97
98
  return <ErrorView
98
99
  error={"Could not find collection"}/>
99
100
  }
100
- return <EntitySelectionTableInternal {...props} collection={props.collection} />;
101
+ return <SelectionTableBindingInternal {...props} collection={props.collection} />;
101
102
  }
102
103
 
103
- function EntitySelectionTableInternal<M extends Record<string, unknown>>(
104
+ function SelectionTableBindingInternal<M extends Record<string, unknown>>(
104
105
  {
105
106
  onSingleEntitySelected,
106
107
  onMultipleEntitiesSelected,
@@ -111,10 +112,10 @@ function EntitySelectionTableInternal<M extends Record<string, unknown>>(
111
112
  description,
112
113
  fixedFilter,
113
114
  maxSelection
114
- }: EntitySelectionProps<M> & { collection: EntityCollection<M> }) {
115
+ }: SelectionProps<M> & { collection: CollectionConfig<M> }) {
115
116
 
116
117
  const sideDialogContext = useSideDialogContext();
117
- const sideEntityController = useSideEntityController();
118
+ const sidePanelController = useSidePanel();
118
119
  const urlController = useUrlController();
119
120
  const analyticsController = useAnalyticsController();
120
121
 
@@ -212,7 +213,7 @@ function EntitySelectionTableInternal<M extends Record<string, unknown>>(
212
213
  analyticsController.onAnalyticsEvent?.("reference_selection_new_entity", {
213
214
  path
214
215
  });
215
- sideEntityController.open({
216
+ sidePanelController.open({
216
217
  path: path,
217
218
  collection,
218
219
  updateUrl: true,
@@ -237,7 +238,7 @@ function EntitySelectionTableInternal<M extends Record<string, unknown>>(
237
238
  }) => {
238
239
  const selectedEntities = selectionController.selectedEntities;
239
240
  const isSelected = selectedEntities && selectedEntities.map(e => e.id).indexOf(entity.id) > -1;
240
- return <EntityCollectionRowActions
241
+ return <CollectionRowActions
241
242
  width={width}
242
243
  frozen={frozen}
243
244
  entity={entity}
@@ -269,11 +270,12 @@ function EntitySelectionTableInternal<M extends Record<string, unknown>>(
269
270
 
270
271
  return (
271
272
 
273
+ <CollectionScopeProvider collection={collection}>
272
274
  <div className="flex flex-col h-full">
273
275
 
274
276
  <div className="grow">
275
277
  {entitiesDisplayedFirst &&
276
- <EntityCollectionTable
278
+ <CollectionTableBinding
277
279
  additionalFields={collection.additionalFields}
278
280
  displayedColumnIds={displayedColumnIds}
279
281
  onEntityClick={onEntityClick}
@@ -316,6 +318,7 @@ function EntitySelectionTableInternal<M extends Record<string, unknown>>(
316
318
  </Button>
317
319
  </DialogActions>
318
320
  </div>
321
+ </CollectionScopeProvider>
319
322
 
320
323
  );
321
324
 
@@ -327,7 +330,7 @@ function EntitySelectionDialogActions({
327
330
  onClear,
328
331
  onNewClick
329
332
  }: {
330
- collection: EntityCollection<any>,
333
+ collection: CollectionConfig<any>,
331
334
  path: string,
332
335
  onClear: () => void,
333
336
  onNewClick: () => void
@@ -1,5 +1,5 @@
1
- import { useEntitySelectionDialog } from "../hooks/useEntitySelectionDialog";
2
- import type { EntityCollection } from "@rebasepro/types";
1
+ import { useSelectionDialog } from "../hooks/useSelectionDialog";
2
+ import type { CollectionConfig } from "@rebasepro/types";
3
3
  import React, { useCallback, useMemo } from "react";
4
4
 
5
5
  import { Entity, EntityReference, FilterValues } from "@rebasepro/types";
@@ -55,7 +55,7 @@ export function ReferenceWidget<M extends Record<string, unknown>>({
55
55
 
56
56
  const collectionRegistryController = useCollectionRegistryController();
57
57
 
58
- const collection: EntityCollection | undefined = useMemo(() => {
58
+ const collection: CollectionConfig | undefined = useMemo(() => {
59
59
  return collectionRegistryController.getCollection(path);
60
60
  }, [path, collectionRegistryController.getCollection]);
61
61
 
@@ -83,7 +83,7 @@ export function ReferenceWidget<M extends Record<string, unknown>>({
83
83
  }
84
84
  }, [disabled, onReferenceSelected]);
85
85
 
86
- const referenceDialogController = useEntitySelectionDialog({
86
+ const referenceDialogController = useSelectionDialog({
87
87
  multiselect,
88
88
  path,
89
89
  collection,
@@ -25,9 +25,9 @@ import * as React from "react";
25
25
  import { useCallback, useEffect, useRef, useState } from "react";
26
26
  import { Command as CommandPrimitive } from "cmdk";
27
27
  import { Entity, EntityRelation, FilterValues, Relation, getCollectionDataPath } from "@rebasepro/types";
28
- import { EntityPreviewData } from "./EntityPreview";
28
+ import { EntityPreviewBindingData } from "./EntityPreviewBinding";
29
29
  import { useData, useRelationSelector } from "@rebasepro/core";
30
- import { useSideEntityController } from "../hooks/useSideEntityController";
30
+ import { useSidePanel } from "../hooks/useSidePanel";
31
31
  import { normalizeToEntityRelation } from "@rebasepro/common";
32
32
  import { EmptyValue } from "../preview";
33
33
 
@@ -91,7 +91,7 @@ export const RelationSelector = React.forwardRef<
91
91
 
92
92
  const collection = relation.target();
93
93
  const dataClient = useData();
94
- const sideEntityController = useSideEntityController();
94
+ const sidePanelController = useSidePanel();
95
95
  const multiple = relation.cardinality === "many";
96
96
 
97
97
  const [isPopoverOpen, setIsPopoverOpen] = useState(false);
@@ -102,7 +102,7 @@ export const RelationSelector = React.forwardRef<
102
102
  // Track IDs that were set via local user interaction (onItemClick / handleClear / handleRemoveItem).
103
103
  // When an incoming value change matches these IDs exactly, we skip async re-resolution.
104
104
  const localSelectionIdsRef = useRef<string | null>(null);
105
- // Snapshot of selected IDs captured when the popover opens.
105
+ // Entity of selected IDs captured when the popover opens.
106
106
  // Used to sort the dropdown list so selected items appear at the top.
107
107
  // Stays stable for the entire popover session so items don't jump around.
108
108
  const pinnedIdsRef = useRef<Set<string> | null>(null);
@@ -213,7 +213,8 @@ export const RelationSelector = React.forwardRef<
213
213
 
214
214
  if (hasEmbeddedData) {
215
215
  const r = rel as EntityRelation;
216
- newResolvedItems.push(toRelationItem(r.data!, r));
216
+ // CMS wire format embeds relation data as { id, path, values }
217
+ newResolvedItems.push(toRelationItem(r.data as unknown as Entity, r));
217
218
  } else if (currentSelectedMap.has(relId)) {
218
219
  // We already have it in currentSelected
219
220
  const existingItem = currentSelectedMap.get(relId)!;
@@ -248,7 +249,8 @@ export const RelationSelector = React.forwardRef<
248
249
  const relation = isPrimitive ? new EntityRelation(relId, path) : rel as EntityRelation;
249
250
 
250
251
  if (!isPrimitive && (rel as EntityRelation).data) {
251
- return toRelationItem((rel as EntityRelation).data!, relation);
252
+ // CMS wire format embeds relation data as { id, path, values }
253
+ return toRelationItem((rel as EntityRelation).data as unknown as Entity, relation);
252
254
  }
253
255
  if (currentSelectedMap.has(String(relId))) {
254
256
  return currentSelectedMap.get(String(relId))!;
@@ -485,11 +487,11 @@ relation } as RelationItem;
485
487
  <div key={String(item.id)}
486
488
  className="flex flex-row items-center gap-1 truncate">
487
489
  {item.data ? (
488
- <EntityPreviewData size={"medium"}
490
+ <EntityPreviewBindingData size={"medium"}
489
491
  entity={item.data}
490
492
  includeEntityLink={false}
491
493
  includeId={false}
492
- onSideEntityClick={closePopover}
494
+ onSidePanelClick={closePopover}
493
495
  />
494
496
  ) : (
495
497
  <span className="text-sm truncate">{item.label}</span>
@@ -504,7 +506,7 @@ relation } as RelationItem;
504
506
  className={cls("flex flex-row items-center gap-1 truncate")}
505
507
  >
506
508
  {item.data ? (
507
- <EntityPreviewData size={"smallest"} entity={item.data}
509
+ <EntityPreviewBindingData size={"smallest"} entity={item.data}
508
510
  includeEntityLink={false}
509
511
  includeId={false}/>
510
512
  ) : (
@@ -541,7 +543,7 @@ relation } as RelationItem;
541
543
  e.preventDefault();
542
544
  const entity = selectedItems[0].data!;
543
545
  setIsPopoverOpen(false);
544
- sideEntityController.open({
546
+ sidePanelController.open({
545
547
  entityId: entity.id,
546
548
  path: entity.path,
547
549
  collection,
@@ -634,7 +636,7 @@ relation } as RelationItem;
634
636
  <CommandPrimitive.Group>
635
637
  {(() => {
636
638
  // Sort items so that initially-selected (pinned) items appear first.
637
- // We use the snapshot taken when the popover opened so items don't
639
+ // We use the entity taken when the popover opened so items don't
638
640
  // jump around as the user checks/unchecks.
639
641
  const pinned = pinnedIdsRef.current;
640
642
  const sortedItems = pinned && pinned.size > 0
@@ -666,7 +668,7 @@ relation } as RelationItem;
666
668
  {item.data ? (
667
669
  <div
668
670
  className="flex flex-row items-center gap-2 min-w-0 w-full">
669
- <EntityPreviewData
671
+ <EntityPreviewBindingData
670
672
  size={multiple ? "smallest" : "medium"}
671
673
  entity={item.data}
672
674
  includeId={false}
@@ -1,19 +1,14 @@
1
1
  import { createSelectionStore, AdminSelectedCell } from "./SelectionStore";
2
- import type { Property } from "@rebasepro/types";
2
+ import type { Property, WhereFilterOp } from "@rebasepro/types";
3
3
  import React, { useCallback, useEffect, useMemo, useRef } from "react";
4
- import { CollectionSize, Entity, EntityRelation, EntityTableController, FilterValues, SelectedCellProps } from "@rebasepro/types";
5
- import { CellRendererParams, TableView, VirtualTableColumn, VirtualTableFilterValues, OnRowClickParams, VirtualTableWhereFilterOp } from "@rebasepro/ui";
6
- import { enumToObjectEntries } from "@rebasepro/common";
7
- import { DEFAULT_PAGE_SIZE, EntityCollectionTableController, OnCellValueChange, OnColumnResizeParams } from "@rebasepro/core";
4
+ import { CollectionSize, Entity, EntityTableController, FilterValues, SelectedCellProps } from "@rebasepro/types";
5
+ import { CellRendererParams, TableView, VirtualTableColumn, VirtualTableFilterValues, OnRowClickParams } from "@rebasepro/ui";
6
+ import { DEFAULT_PAGE_SIZE, DataCollectionTableController, OnCellValueChange, OnColumnResizeParams } from "@rebasepro/core";
8
7
  import { FilterFormFieldProps } from "@rebasepro/ui";
9
- import { ReferenceFilterField } from "./filters/ReferenceFilterField";
10
- import { StringNumberFilterField } from "./filters/StringNumberFilterField";
11
- import { BooleanFilterField } from "./filters/BooleanFilterField";
12
- import { DateTimeFilterField } from "./filters/DateTimeFilterField";
13
8
  import { useOutsideAlerter } from "@rebasepro/ui";
14
9
  import { SelectableTableContext } from "./SelectableTableContext";
15
10
  import { getRowHeight } from "@rebasepro/core";
16
- import { RelationFilterField } from "./filters/RelationFilterField";
11
+ import { FilterFieldBinding } from "./filters/FilterFieldBinding";
17
12
 
18
13
  export type SelectableTableProps<M extends Record<string, unknown>> = {
19
14
 
@@ -107,23 +102,23 @@ export type SelectableTableProps<M extends Record<string, unknown>> = {
107
102
  * This component is in charge of rendering a collection table with a high
108
103
  * degree of customization.
109
104
  *
110
- * This component is used internally by {@link EntityCollectionView} and
105
+ * This component is used internally by {@link CollectionViewBinding} and
111
106
  * {@link useReferenceDialog}
112
107
  *
113
108
  * Please note that you only need to use this component if you are building
114
109
  * a custom view. If you just need to create a default view you can do it
115
110
  * exclusively with config options.
116
111
  *
117
- * If you want to bind a {@link EntityCollection} to a table with the default
112
+ * If you want to bind a {@link CollectionConfig} to a table with the default
118
113
  * options you see in collections in the top level navigation, you can
119
- * check {@link EntityCollectionView}.
114
+ * check {@link CollectionViewBinding}.
120
115
  *
121
116
  * The data displayed in the table is managed by a {@link EntityTableController}.
122
117
  * You can build the default, bound to a path in the driver, by using the hook
123
118
  * {@link useDataTableController}
124
119
  *
125
- * @see EntityCollectionTableProps
126
- * @see EntityCollectionView
120
+ * @see CollectionTableBindingProps
121
+ * @see CollectionViewBinding
127
122
  * @see VirtualTable
128
123
  * @group Components
129
124
  */
@@ -196,7 +191,7 @@ export const SelectableTable = function SelectableTable<M extends Record<string,
196
191
  selectionStore.select({
197
192
  ...cell,
198
193
  columnKey: cell.propertyKey,
199
- rowId: cell.entityId
194
+ id: cell.entityId
200
195
  } as AdminSelectedCell);
201
196
  } else {
202
197
  selectionStore.select(undefined);
@@ -244,7 +239,29 @@ export const SelectableTable = function SelectableTable<M extends Record<string,
244
239
  size: size ?? "m",
245
240
  selectionStore,
246
241
  setPopupCell
247
- } as unknown as EntityCollectionTableController<Record<string, unknown>>), [setPopupCell, select, onValueChange, size, selectionStore]);
242
+ } as unknown as DataCollectionTableController<Record<string, unknown>>), [setPopupCell, select, onValueChange, size, selectionStore]);
243
+
244
+ const createFilterField = useCallback(({
245
+ id,
246
+ filterValue,
247
+ setFilterValue,
248
+ column,
249
+ hidden,
250
+ setHidden
251
+ }: FilterFormFieldProps<unknown>): React.ReactNode => {
252
+ if (!column.custom) return null;
253
+ const { resolvedProperty } = column.custom as { resolvedProperty?: Property };
254
+ if (!resolvedProperty) return null;
255
+ // Engine-aware operator resolution happens inside FilterFieldBinding,
256
+ // which reads the collection from the surrounding CollectionScopeProvider.
257
+ return <FilterFieldBinding
258
+ propertyKey={id as string}
259
+ property={resolvedProperty}
260
+ value={filterValue as [WhereFilterOp, unknown] | undefined}
261
+ setValue={setFilterValue as (value?: [WhereFilterOp, unknown]) => void}
262
+ hidden={hidden}
263
+ setHidden={setHidden}/>;
264
+ }, []);
248
265
 
249
266
  return (
250
267
  <SelectableTableContext.Provider
@@ -289,74 +306,4 @@ export const SelectableTable = function SelectableTable<M extends Record<string,
289
306
 
290
307
  };
291
308
 
292
- function createFilterField({
293
- id,
294
- filterValue,
295
- setFilterValue,
296
- column,
297
- hidden,
298
- setHidden
299
- }: FilterFormFieldProps<unknown>): React.ReactNode {
300
-
301
- if (!column.custom) {
302
- return null;
303
- }
304
-
305
- const { resolvedProperty } = column.custom as { resolvedProperty?: Property };
306
-
307
- const isArray = resolvedProperty?.type === "array";
308
- const ofVal = isArray && resolvedProperty ? resolvedProperty.of : undefined;
309
- const baseProperty: Property | undefined = isArray ? (Array.isArray(ofVal) ? ofVal[0] : ofVal) : resolvedProperty;
310
- if (!baseProperty) {
311
- return null;
312
- }
313
- if (baseProperty.type === "reference") {
314
- return <ReferenceFilterField value={filterValue}
315
- setValue={setFilterValue}
316
- name={id as string}
317
- isArray={isArray}
318
- path={baseProperty.path}
319
- title={resolvedProperty?.name}
320
- includeId={baseProperty.includeId}
321
- previewProperties={baseProperty?.ui?.previewProperties}
322
- hidden={hidden}
323
- setHidden={setHidden}/>;
324
- } else if (baseProperty.type === "relation" && baseProperty.relation) {
325
- return <RelationFilterField value={filterValue as [VirtualTableWhereFilterOp, EntityRelation | EntityRelation[] | null]}
326
- setValue={setFilterValue}
327
- name={id as string}
328
- relation={baseProperty.relation}
329
- hidden={hidden}
330
- setHidden={setHidden}/>;
331
- } else if (baseProperty.type === "number" || baseProperty.type === "string") {
332
- const name = baseProperty.name;
333
- const enumValues = baseProperty.enum ? enumToObjectEntries(baseProperty.enum) : undefined;
334
- return <StringNumberFilterField value={filterValue}
335
- setValue={setFilterValue}
336
- name={id as string}
337
- type={baseProperty.type}
338
- isArray={isArray}
339
- enumValues={enumValues}
340
- title={name}/>;
341
- } else if (baseProperty.type === "boolean") {
342
- const name = baseProperty.name;
343
- return <BooleanFilterField value={filterValue}
344
- setValue={setFilterValue}
345
- name={id as string}
346
- title={name}/>;
347
-
348
- } else if (baseProperty.type === "date") {
349
- const title = baseProperty.name;
350
- return <DateTimeFilterField value={filterValue}
351
- setValue={setFilterValue}
352
- name={id as string}
353
- mode={baseProperty.mode}
354
- isArray={isArray}
355
- title={title}/>;
356
- }
357
-
358
- return (
359
- <div>{`Currently the filter field ${resolvedProperty?.type} is not supported`}</div>
360
- );
361
- }
362
309
 
@@ -1,7 +1,7 @@
1
1
  import React, { useContext } from "react";
2
- import { EntityCollectionTableController } from "@rebasepro/core";
2
+ import { DataCollectionTableController } from "@rebasepro/core";
3
3
 
4
- export const SelectableTableContext = React.createContext<EntityCollectionTableController<Record<string, unknown>>>(null! as EntityCollectionTableController<Record<string, unknown>>);
4
+ export const SelectableTableContext = React.createContext<DataCollectionTableController<Record<string, unknown>>>(null! as DataCollectionTableController<Record<string, unknown>>);
5
5
 
6
6
  export const useSelectableTableController = <M extends Record<string, unknown> = Record<string, unknown>>() =>
7
- useContext(SelectableTableContext) as unknown as EntityCollectionTableController<M>;
7
+ useContext(SelectableTableContext) as unknown as DataCollectionTableController<M>;
@@ -22,7 +22,7 @@ export function createSelectionStore() {
22
22
  export type SelectionStore = VirtualTableSelectionStore<AdminSelectedCell>;
23
23
 
24
24
  export function useCellSelected(
25
- store: { getSnapshot: () => SelectedCellProps | undefined; subscribe: (listener: () => void) => () => void },
25
+ store: { getEntity: () => SelectedCellProps | undefined; subscribe: (listener: () => void) => () => void },
26
26
  propertyKey: string,
27
27
  entityPath: string,
28
28
  entityId: string | number
@@ -30,8 +30,8 @@ export function useCellSelected(
30
30
  const selectorRef = useRef({ propertyKey, entityPath, entityId });
31
31
  selectorRef.current = { propertyKey, entityPath, entityId };
32
32
 
33
- const getSnapshot = useCallback(() => {
34
- const cell = store.getSnapshot();
33
+ const getEntity = useCallback(() => {
34
+ const cell = store.getEntity();
35
35
  if (!cell) return false;
36
36
  const s = selectorRef.current;
37
37
  return cell.propertyKey === s.propertyKey &&
@@ -39,5 +39,5 @@ export function useCellSelected(
39
39
  cell.entityId === s.entityId;
40
40
  }, [store]);
41
41
 
42
- return useSyncExternalStore(store.subscribe, getSnapshot, getSnapshot);
42
+ return useSyncExternalStore(store.subscribe, getEntity, getEntity);
43
43
  }
@@ -8,16 +8,24 @@ interface BooleanFieldProps {
8
8
  value?: [op: VirtualTableWhereFilterOp, fieldValue: unknown];
9
9
  setValue: (value?: [op: VirtualTableWhereFilterOp, newValue: unknown]) => void;
10
10
  title?: string;
11
+ /**
12
+ * Restrict the offered operators. This field only ever emits `["==", …]`,
13
+ * so it renders nothing when `==` is not allowed.
14
+ */
15
+ operators?: readonly VirtualTableWhereFilterOp[];
11
16
  }
12
17
 
13
18
  export function BooleanFilterField({
14
19
  name,
15
20
  title,
16
21
  value,
17
- setValue
22
+ setValue,
23
+ operators
18
24
  }: BooleanFieldProps) {
19
25
  const { t } = useTranslation();
20
26
 
27
+ if (operators && !operators.includes("==")) return null;
28
+
21
29
  function updateFilter(val?: boolean) {
22
30
  if (val !== undefined) {
23
31
  setValue(
@@ -11,9 +11,15 @@ interface DateTimeFilterFieldProps {
11
11
  isArray?: boolean;
12
12
  title?: string;
13
13
  timezone?: string;
14
+ /**
15
+ * Restrict the offered operators (already resolved against engine
16
+ * capabilities and property config). When omitted, all operators this
17
+ * field can render are offered.
18
+ */
19
+ operators?: readonly VirtualTableWhereFilterOp[];
14
20
  }
15
21
 
16
- const operationLabels: Record<VirtualTableWhereFilterOp | "is-null", string> = {
22
+ const operationLabels: Partial<Record<VirtualTableWhereFilterOp, string>> = {
17
23
  "==": "==",
18
24
  "!=": "!=",
19
25
  ">": ">",
@@ -24,7 +30,8 @@ const operationLabels: Record<VirtualTableWhereFilterOp | "is-null", string> = {
24
30
  in: "in",
25
31
  "array-contains": "Contains",
26
32
  "array-contains-any": "Any",
27
- "is-null": "Is null"
33
+ "is-null": "Is null",
34
+ "is-not-null": "Is not null"
28
35
  };
29
36
 
30
37
  const multipleSelectOperations = ["array-contains-any", "in"];
@@ -36,26 +43,40 @@ export function DateTimeFilterField({
36
43
  value,
37
44
  setValue,
38
45
  title,
39
- timezone
46
+ timezone,
47
+ operators
40
48
  }: DateTimeFilterFieldProps) {
41
49
 
42
50
  const { locale } = useCustomizationController();
43
- const possibleOperations: (keyof typeof operationLabels)[] = isArray
51
+ let possibleOperations: (keyof typeof operationLabels)[] = isArray
44
52
  ? ["array-contains"]
45
- : ["==", "!=", ">", "<", ">=", "<=", "is-null"];
53
+ : ["==", "!=", ">", "<", ">=", "<=", "is-null", "is-not-null"];
54
+
55
+ if (operators) {
56
+ possibleOperations = possibleOperations.filter(op => (operators as readonly string[]).includes(op));
57
+ }
46
58
 
47
59
  const [fieldOperation, fieldValue] = value || [possibleOperations[0], undefined];
48
- const [operation, setOperation] = useState<VirtualTableWhereFilterOp | "is-null">(fieldOperation === "==" && fieldValue === null ? "is-null" : fieldOperation);
60
+ // Read back both the canonical null operators and the legacy `["==", null]` /
61
+ // `["!=", null]` form saved by older filter presets.
62
+ const [operation, setOperation] = useState<VirtualTableWhereFilterOp>(
63
+ fieldOperation === "==" && fieldValue === null ? "is-null"
64
+ : fieldOperation === "!=" && fieldValue === null ? "is-not-null"
65
+ : fieldOperation
66
+ );
49
67
  const [internalValue, setInternalValue] = useState<Date | null | undefined>(fieldValue as Date | null | undefined);
50
68
 
51
- const isNullOperation = operation === "is-null";
69
+ const isNullOperation = operation === "is-null" || operation === "is-not-null";
70
+
71
+ // All renderable operators were filtered out (engine/property narrowing).
72
+ if (possibleOperations.length === 0) return null;
52
73
 
53
- function updateFilter(op: VirtualTableWhereFilterOp | "is-null", val: Date | undefined | null) {
54
- // Handle "is null" operation
55
- if (op === "is-null") {
74
+ function updateFilter(op: VirtualTableWhereFilterOp, val: Date | undefined | null) {
75
+ // Null-testing operators ignore their value.
76
+ if (op === "is-null" || op === "is-not-null") {
56
77
  setOperation(op);
57
78
  setInternalValue(null);
58
- setValue(["==", null]);
79
+ setValue([op, null]);
59
80
  return;
60
81
  }
61
82
 
@@ -91,7 +112,7 @@ export function DateTimeFilterField({
91
112
  size={"medium"}
92
113
  fullWidth={true}
93
114
  onValueChange={(value) => {
94
- updateFilter(value as VirtualTableWhereFilterOp | "is-null", internalValue);
115
+ updateFilter(value as VirtualTableWhereFilterOp, internalValue);
95
116
  }}
96
117
  renderValue={(op) => operationLabels[op as keyof typeof operationLabels]}>
97
118
  {possibleOperations.map((op) => (