@rebasepro/admin 0.7.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.
- package/LICENSE +21 -0
- package/README.md +20 -20
- package/dist/{CollectionEditorDialog-iGgS4rLX.js → CollectionEditorDialog-B-7uW3iJ.js} +15 -15
- package/dist/CollectionEditorDialog-B-7uW3iJ.js.map +1 -0
- package/dist/{PropertyEditView-C9yhLyja.js → PropertyEditView-7KMTcrqi.js} +140 -106
- package/dist/PropertyEditView-7KMTcrqi.js.map +1 -0
- package/dist/{RouterCollectionsStudioView-Dqx27GD8.js → RouterCollectionsStudioView-epqIbZrJ.js} +4 -4
- package/dist/{RouterCollectionsStudioView-Dqx27GD8.js.map → RouterCollectionsStudioView-epqIbZrJ.js.map} +1 -1
- package/dist/collection_editor/_cms_internals.d.ts +4 -4
- package/dist/collection_editor/api/generateCollectionApi.d.ts +7 -6
- package/dist/collection_editor/extensibility_types.d.ts +3 -3
- package/dist/collection_editor/index.d.ts +2 -2
- package/dist/collection_editor/pgColumnToProperty.d.ts +3 -3
- package/dist/collection_editor/serializable_types.d.ts +12 -16
- package/dist/collection_editor/serializable_utils.d.ts +8 -8
- package/dist/collection_editor/types/collection_editor_controller.d.ts +5 -5
- package/dist/collection_editor/types/collection_inference.d.ts +2 -2
- package/dist/collection_editor/types/config_controller.d.ts +7 -7
- package/dist/collection_editor/ui/AddKanbanColumnAction.d.ts +2 -2
- package/dist/collection_editor/ui/CollectionViewHeaderAction.d.ts +2 -2
- package/dist/collection_editor/ui/KanbanSetupAction.d.ts +2 -2
- package/dist/collection_editor/ui/PropertyAddColumnComponent.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.d.ts +3 -3
- package/dist/collection_editor/ui/collection_editor/CollectionDetailsForm.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/CollectionEditorDialog.d.ts +4 -5
- package/dist/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/CollectionJsonImportDialog.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.d.ts +4 -4
- package/dist/collection_editor/ui/collection_editor/CollectionStudioView.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/CollectionsStudioView.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/EntityActionsEditTab.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/GeneralSettingsForm.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/GetCodeDialog.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/PropertyEditView.d.ts +4 -4
- package/dist/collection_editor/ui/collection_editor/SubcollectionsEditTab.d.ts +3 -3
- package/dist/collection_editor/ui/collection_editor/templates/blog_template.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/templates/pages_template.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/templates/products_template.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/templates/users_template.d.ts +2 -2
- package/dist/collection_editor/useLocalCollectionsConfigController.d.ts +2 -2
- package/dist/collection_editor/validateCollectionJson.d.ts +2 -2
- package/dist/collection_editor_ui.js +4 -4
- package/dist/components/CollectionPanel.d.ts +4 -4
- package/dist/components/{EntityCollectionTable/EntityCollectionRowActions.d.ts → CollectionTableBinding/CollectionRowActions.d.ts} +3 -3
- package/dist/components/CollectionTableBinding/CollectionTableBinding.d.ts +28 -0
- package/dist/components/{EntityCollectionTable/EntityCollectionTableProps.d.ts → CollectionTableBinding/CollectionTableBindingProps.d.ts} +1 -1
- package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableMultipleRelationField.d.ts +2 -2
- package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableReferenceField.d.ts +2 -2
- package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableRelationField.d.ts +2 -2
- package/dist/components/CollectionTableBinding/index.d.ts +6 -0
- package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/common.d.ts +2 -2
- package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/PopupFormField.d.ts +2 -2
- package/dist/components/{EntityCollectionView/EntityBoardCard.d.ts → CollectionViewBinding/BoardCardBinding.d.ts} +8 -8
- package/dist/components/{EntityCollectionView/EntityCollectionBoardView.d.ts → CollectionViewBinding/CollectionBoardViewBinding.d.ts} +4 -4
- package/dist/components/{EntityCollectionView/EntityCollectionCardView.d.ts → CollectionViewBinding/CollectionCardViewBinding.d.ts} +5 -5
- package/dist/components/{EntityCollectionView/EntityCollectionListView.d.ts → CollectionViewBinding/CollectionListViewBinding.d.ts} +4 -4
- package/dist/components/{EntityCollectionView/EntityCollectionViewActions.d.ts → CollectionViewBinding/CollectionViewActions.d.ts} +4 -4
- package/dist/components/{EntityCollectionView/EntityCollectionView.d.ts → CollectionViewBinding/CollectionViewBinding.d.ts} +4 -4
- package/dist/components/{EntityCollectionView/EntityCollectionViewStartActions.d.ts → CollectionViewBinding/CollectionViewStartActions.d.ts} +4 -4
- package/dist/components/CollectionViewBinding/EntityCardBinding.d.ts +21 -0
- package/dist/components/{EntityCollectionView → CollectionViewBinding}/SplitListView.d.ts +3 -3
- package/dist/components/{EntityCollectionView → CollectionViewBinding}/hooks/useCollectionInlineEditor.d.ts +2 -2
- package/dist/components/{EntityCollectionView → CollectionViewBinding}/hooks/useKanbanDragAndDrop.d.ts +2 -2
- package/dist/components/{EntityCollectionView → CollectionViewBinding}/useBoardDataController.d.ts +2 -2
- package/dist/components/{EntityCollectionView/useEntityPreviewSlots.d.ts → CollectionViewBinding/usePreviewSlots.d.ts} +5 -5
- package/dist/components/DeleteEntityDialog.d.ts +4 -4
- package/dist/components/{EntityDetailView.d.ts → DetailViewBinding.d.ts} +5 -5
- package/dist/components/EditFormActions.d.ts +3 -0
- package/dist/components/{EntityEditView.d.ts → EditViewBinding.d.ts} +9 -9
- package/dist/components/{EntityPreview.d.ts → EntityPreviewBinding.d.ts} +13 -13
- package/dist/components/EntityViewBinding.d.ts +13 -0
- package/dist/components/{EntityJsonPreview.d.ts → JsonPreviewBinding.d.ts} +1 -1
- package/dist/components/RebaseCMS.d.ts +1 -1
- package/dist/components/RebaseNavigation.d.ts +1 -1
- package/dist/components/ReferenceTable/{EntitySelectionTable.d.ts → SelectionTableBinding.d.ts} +5 -5
- package/dist/components/SelectableTable/SelectableTable.d.ts +5 -5
- package/dist/components/SelectableTable/SelectableTableContext.d.ts +3 -3
- package/dist/components/SelectableTable/SelectionStore.d.ts +13 -22
- package/dist/components/SelectableTable/filters/BooleanFilterField.d.ts +6 -1
- package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +7 -1
- package/dist/components/SelectableTable/filters/FilterFieldBinding.d.ts +40 -0
- package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +7 -1
- package/dist/components/SelectableTable/filters/RelationFilterField.d.ts +7 -1
- package/dist/components/SelectableTable/filters/StringNumberFilterField.d.ts +7 -1
- package/dist/components/SideDialogs.d.ts +1 -1
- package/dist/components/SidePanelBinding.d.ts +11 -0
- package/dist/components/{SideEntityProvider.d.ts → SidePanelProvider.d.ts} +7 -7
- package/dist/components/field_configs.d.ts +1 -1
- package/dist/components/history/EntityHistoryEntry.d.ts +2 -2
- package/dist/components/history/LastEditedByIndicator.d.ts +2 -2
- package/dist/components/index.d.ts +14 -13
- package/dist/contexts/SidePanelControllerContext.d.ts +3 -0
- package/dist/data_export/export/ExportCollectionAction.d.ts +3 -3
- package/dist/data_import/components/ImportSaveInProgress.d.ts +2 -2
- package/dist/editor/editor.d.ts +0 -6
- package/dist/editor.js +1 -3
- package/dist/editor.js.map +1 -1
- package/dist/form/EntityForm.d.ts +1 -1
- package/dist/form/PropertyFieldBinding.d.ts +1 -1
- package/dist/form/components/StorageUploadProgress.d.ts +6 -1
- package/dist/form/form_utils.d.ts +2 -2
- package/dist/form/index.d.ts +0 -1
- package/dist/{history-ChHgyyvM.js → history-7X5bON_n.js} +4 -4
- package/dist/history-7X5bON_n.js.map +1 -0
- package/dist/hooks/index.d.ts +4 -4
- package/dist/hooks/navigation/contexts/CollectionRegistryContext.d.ts +2 -2
- package/dist/hooks/navigation/useBuildNavigationStateController.d.ts +5 -5
- package/dist/hooks/navigation/useNavigationResolution.d.ts +4 -4
- package/dist/hooks/navigation/useResolvedCollections.d.ts +7 -7
- package/dist/hooks/navigation/useTopLevelNavigation.d.ts +2 -2
- package/dist/hooks/navigation/utils.d.ts +5 -5
- package/dist/hooks/useBuildSidePanel.d.ts +6 -0
- package/dist/hooks/useCMSContext.d.ts +2 -2
- package/dist/hooks/{useEntityHistory.d.ts → useHistory.d.ts} +1 -1
- package/dist/hooks/useResolvedNavigationFrom.d.ts +3 -3
- package/dist/hooks/{useEntitySelectionDialog.d.ts → useSelectionDialog.d.ts} +2 -2
- package/dist/hooks/useSideDialogsController.d.ts +1 -1
- package/dist/hooks/useSidePanel.d.ts +11 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/preview/components/StorageThumbnail.d.ts +3 -1
- package/dist/{src-DOX2nOyh.js → src-sUZfe29F.js} +904 -1096
- package/dist/src-sUZfe29F.js.map +1 -0
- package/dist/types/components/EntityFormActionsProps.d.ts +2 -2
- package/dist/types/components/EntityFormProps.d.ts +3 -3
- package/dist/types/components/PropertyPreviewProps.d.ts +2 -1
- package/dist/types/fields.d.ts +6 -8
- package/dist/util/dataControllerAdapter.d.ts +2 -5
- package/dist/util/navigation_utils.d.ts +6 -6
- package/dist/util/previews.d.ts +3 -3
- package/dist/util/property_utils.d.ts +2 -2
- package/dist/util/{entity_view_constants.d.ts → view_constants.d.ts} +1 -1
- package/package.json +18 -18
- package/src/collection_editor/ConfigControllerProvider.tsx +10 -10
- package/src/collection_editor/_cms_internals.ts +4 -4
- package/src/collection_editor/api/generateCollectionApi.ts +7 -6
- package/src/collection_editor/extensibility_types.ts +3 -3
- package/src/collection_editor/index.ts +3 -3
- package/src/collection_editor/pgColumnToProperty.ts +4 -4
- package/src/collection_editor/serializable_types.ts +22 -35
- package/src/collection_editor/serializable_utils.ts +40 -52
- package/src/collection_editor/types/collection_editor_controller.tsx +5 -5
- package/src/collection_editor/types/collection_inference.ts +2 -2
- package/src/collection_editor/types/config_controller.tsx +7 -7
- package/src/collection_editor/ui/AddKanbanColumnAction.tsx +2 -2
- package/src/collection_editor/ui/CollectionViewHeaderAction.tsx +2 -2
- package/src/collection_editor/ui/EditorCollectionAction.tsx +2 -2
- package/src/collection_editor/ui/EditorCollectionActionStart.tsx +2 -2
- package/src/collection_editor/ui/EditorEntityAction.tsx +2 -2
- package/src/collection_editor/ui/KanbanSetupAction.tsx +2 -2
- package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.tsx +5 -5
- package/src/collection_editor/ui/collection_editor/CollectionDetailsForm.tsx +3 -3
- package/src/collection_editor/ui/collection_editor/CollectionEditorDialog.tsx +63 -46
- package/src/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.tsx +3 -3
- package/src/collection_editor/ui/collection_editor/CollectionJsonImportDialog.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +8 -8
- package/src/collection_editor/ui/collection_editor/CollectionRLSTab.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/CollectionRelationsTab.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/CollectionStudioView.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/CollectionsStudioView.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/DisplaySettingsForm.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/EntityActionsEditTab.tsx +3 -3
- package/src/collection_editor/ui/collection_editor/GeneralSettingsForm.tsx +5 -5
- package/src/collection_editor/ui/collection_editor/GetCodeDialog.tsx +4 -4
- package/src/collection_editor/ui/collection_editor/KanbanConfigSection.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/PropertyEditView.tsx +7 -16
- package/src/collection_editor/ui/collection_editor/PropertyFieldPreview.tsx +45 -36
- package/src/collection_editor/ui/collection_editor/PropertyTree.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/SubcollectionsEditTab.tsx +5 -5
- package/src/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.tsx +3 -3
- package/src/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/RelationPropertyField.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/StoragePropertyField.tsx +35 -1
- package/src/collection_editor/ui/collection_editor/templates/blog_template.ts +3 -3
- package/src/collection_editor/ui/collection_editor/templates/pages_template.ts +2 -2
- package/src/collection_editor/ui/collection_editor/templates/products_template.ts +2 -2
- package/src/collection_editor/ui/collection_editor/templates/users_template.ts +2 -2
- package/src/collection_editor/ui/collection_editor/utils/supported_fields.tsx +0 -1
- package/src/collection_editor/ui/collection_editor/utils/update_property_for_widget.ts +7 -29
- package/src/collection_editor/useJsonCollectionsConfigController.tsx +14 -14
- package/src/collection_editor/useLocalCollectionsConfigController.tsx +4 -4
- package/src/collection_editor/validateCollectionJson.ts +3 -3
- package/src/components/CollectionPanel.tsx +14 -17
- package/src/components/{EntityCollectionTable/EntityCollectionRowActions.tsx → CollectionTableBinding/CollectionRowActions.tsx} +6 -6
- package/src/components/{EntityCollectionTable/EntityCollectionTable.tsx → CollectionTableBinding/CollectionTableBinding.tsx} +19 -17
- package/src/components/{EntityCollectionTable/EntityCollectionTableProps.tsx → CollectionTableBinding/CollectionTableBindingProps.tsx} +1 -1
- package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableMultipleRelationField.tsx +7 -6
- package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableReferenceField.tsx +10 -10
- package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableRelationField.tsx +7 -6
- package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableStorageUpload.tsx +23 -20
- package/src/components/CollectionTableBinding/index.tsx +14 -0
- package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/common.tsx +2 -2
- package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/PopupFormField.tsx +2 -2
- package/src/components/{EntityCollectionTable → CollectionTableBinding}/table_bindings.tsx +24 -44
- package/src/components/{EntityCollectionView/EntityBoardCard.tsx → CollectionViewBinding/BoardCardBinding.tsx} +15 -15
- package/src/components/{EntityCollectionView/EntityCollectionBoardView.tsx → CollectionViewBinding/CollectionBoardViewBinding.tsx} +15 -14
- package/src/components/{EntityCollectionView/EntityCollectionCardView.tsx → CollectionViewBinding/CollectionCardViewBinding.tsx} +8 -8
- package/src/components/{EntityCollectionView/EntityCollectionListView.tsx → CollectionViewBinding/CollectionListViewBinding.tsx} +24 -13
- package/src/components/{EntityCollectionView/EntityCollectionViewActions.tsx → CollectionViewBinding/CollectionViewActions.tsx} +5 -5
- package/src/components/{EntityCollectionView/EntityCollectionView.tsx → CollectionViewBinding/CollectionViewBinding.tsx} +112 -114
- package/src/components/{EntityCollectionView/EntityCollectionViewStartActions.tsx → CollectionViewBinding/CollectionViewStartActions.tsx} +5 -5
- package/src/components/{EntityCollectionView/EntityCard.tsx → CollectionViewBinding/EntityCardBinding.tsx} +9 -9
- package/src/components/{EntityCollectionView → CollectionViewBinding}/FiltersDialog.tsx +31 -72
- package/src/components/{EntityCollectionView → CollectionViewBinding}/SplitListView.tsx +9 -9
- package/src/components/{EntityCollectionView → CollectionViewBinding}/hooks/useCollectionInlineEditor.ts +6 -6
- package/src/components/{EntityCollectionView → CollectionViewBinding}/hooks/useKanbanDragAndDrop.ts +4 -4
- package/src/components/{EntityCollectionView → CollectionViewBinding}/useBoardDataController.tsx +28 -50
- package/src/components/{EntityCollectionView/useEntityPreviewSlots.ts → CollectionViewBinding/usePreviewSlots.ts} +11 -11
- package/src/components/DefaultDrawer.tsx +1 -1
- package/src/components/DeleteEntityDialog.tsx +6 -6
- package/src/components/{EntityDetailView.tsx → DetailViewBinding.tsx} +28 -31
- package/src/components/{EntityEditViewFormActions.tsx → EditFormActions.tsx} +15 -15
- package/src/components/{EntityEditView.tsx → EditViewBinding.tsx} +31 -34
- package/src/components/{EntityPreview.tsx → EntityPreviewBinding.tsx} +27 -27
- package/src/components/{EntityView.tsx → EntityViewBinding.tsx} +5 -5
- package/src/components/HomePage/ContentHomePage.tsx +1 -1
- package/src/components/HomePage/NavigationCardBinding.tsx +1 -1
- package/src/components/{EntityJsonPreview.tsx → JsonPreviewBinding.tsx} +1 -1
- package/src/components/RebaseCMS.tsx +4 -4
- package/src/components/RebaseNavigation.tsx +20 -10
- package/src/components/ReferenceTable/{EntitySelectionTable.tsx → SelectionTableBinding.tsx} +22 -19
- package/src/components/ReferenceWidget.tsx +4 -4
- package/src/components/RelationSelector.tsx +16 -14
- package/src/components/SelectableTable/SelectableTable.tsx +44 -89
- package/src/components/SelectableTable/SelectableTableContext.tsx +3 -3
- package/src/components/SelectableTable/SelectionStore.ts +22 -52
- package/src/components/SelectableTable/filters/BooleanFilterField.tsx +9 -1
- package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +33 -12
- package/src/components/SelectableTable/filters/FilterFieldBinding.tsx +187 -0
- package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +21 -7
- package/src/components/SelectableTable/filters/RelationFilterField.tsx +17 -3
- package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +66 -12
- package/src/components/SideDialogs.tsx +3 -3
- package/src/components/{EntitySidePanel.tsx → SidePanelBinding.tsx} +19 -19
- package/src/components/{SideEntityProvider.tsx → SidePanelProvider.tsx} +16 -16
- package/src/components/common/default_entity_actions.tsx +24 -13
- package/src/components/field_configs.tsx +0 -14
- package/src/components/history/EntityHistoryEntry.tsx +2 -2
- package/src/components/history/EntityHistoryView.tsx +3 -3
- package/src/components/history/LastEditedByIndicator.tsx +2 -2
- package/src/components/index.ts +15 -14
- package/src/contexts/SidePanelControllerContext.tsx +5 -0
- package/src/data_export/export/ExportCollectionAction.tsx +4 -4
- package/src/data_import/components/ImportSaveInProgress.tsx +3 -3
- package/src/data_import/import/ImportCollectionAction.tsx +4 -4
- package/src/data_import/utils/data.ts +2 -2
- package/src/editor/editor.tsx +4 -7
- package/src/form/EntityForm.tsx +2 -2
- package/src/form/EntityFormActions.tsx +4 -4
- package/src/form/EntityFormBinding.tsx +7 -7
- package/src/form/PropertyFieldBinding.tsx +4 -4
- package/src/form/components/StorageUploadProgress.tsx +9 -2
- package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +4 -4
- package/src/form/field_bindings/KeyValueFieldBinding.tsx +19 -19
- package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +12 -1
- package/src/form/field_bindings/MultipleRelationFieldBinding.tsx +6 -6
- package/src/form/field_bindings/ReferenceFieldBinding.tsx +5 -5
- package/src/form/field_bindings/RelationFieldBinding.tsx +8 -10
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +19 -15
- package/src/form/form_utils.ts +2 -2
- package/src/form/index.tsx +0 -1
- package/src/hooks/index.ts +4 -4
- package/src/hooks/navigation/contexts/CollectionRegistryContext.tsx +2 -2
- package/src/hooks/navigation/useBuildCollectionRegistryController.tsx +11 -11
- package/src/hooks/navigation/useBuildNavigationStateController.tsx +5 -5
- package/src/hooks/navigation/useNavigationResolution.ts +10 -10
- package/src/hooks/navigation/useResolvedCollections.ts +8 -8
- package/src/hooks/navigation/useTopLevelNavigation.ts +2 -2
- package/src/hooks/navigation/utils.ts +5 -5
- package/src/hooks/{useBuildSideEntityController.tsx → useBuildSidePanel.tsx} +28 -28
- package/src/hooks/useCMSContext.tsx +6 -6
- package/src/hooks/{useEntityHistory.ts → useHistory.ts} +1 -1
- package/src/hooks/useResolvedNavigationFrom.tsx +8 -5
- package/src/hooks/{useEntitySelectionDialog.tsx → useSelectionDialog.tsx} +7 -7
- package/src/hooks/useSideDialogsController.tsx +1 -1
- package/src/hooks/useSidePanel.tsx +13 -0
- package/src/index.ts +13 -13
- package/src/preview/PropertyPreview.tsx +1 -16
- package/src/preview/components/ReferencePreview.tsx +10 -10
- package/src/preview/components/RelationPreview.tsx +13 -12
- package/src/preview/components/StorageThumbnail.tsx +24 -7
- package/src/routes/RebaseRoute.tsx +10 -10
- package/src/types/components/EntityFormActionsProps.tsx +2 -2
- package/src/types/components/EntityFormProps.tsx +3 -3
- package/src/types/components/PropertyPreviewProps.tsx +1 -1
- package/src/types/fields.tsx +4 -9
- package/src/util/dataControllerAdapter.ts +9 -15
- package/src/util/navigation_utils.ts +7 -7
- package/src/util/previews.ts +23 -3
- package/src/util/propertyConfigMapper.ts +3 -3
- package/src/util/property_utils.tsx +2 -3
- package/src/util/{entity_view_constants.ts → view_constants.ts} +1 -1
- package/dist/CollectionEditorDialog-iGgS4rLX.js.map +0 -1
- package/dist/PropertyEditView-C9yhLyja.js.map +0 -1
- package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +0 -28
- package/dist/components/EntityCollectionTable/fields/VirtualTableDateField.d.ts +0 -12
- package/dist/components/EntityCollectionTable/fields/VirtualTableInput.d.ts +0 -10
- package/dist/components/EntityCollectionTable/fields/VirtualTableNumberInput.d.ts +0 -9
- package/dist/components/EntityCollectionTable/fields/VirtualTableSwitch.d.ts +0 -8
- package/dist/components/EntityCollectionTable/index.d.ts +0 -6
- package/dist/components/EntityCollectionView/EntityCard.d.ts +0 -21
- package/dist/components/EntityEditViewFormActions.d.ts +0 -3
- package/dist/components/EntitySidePanel.d.ts +0 -11
- package/dist/components/EntityView.d.ts +0 -13
- package/dist/contexts/SideEntityControllerContext.d.ts +0 -3
- package/dist/form/field_bindings/ReferenceAsStringFieldBinding.d.ts +0 -11
- package/dist/history-ChHgyyvM.js.map +0 -1
- package/dist/hooks/useBuildSideEntityController.d.ts +0 -6
- package/dist/hooks/useSideEntityController.d.ts +0 -11
- package/dist/src-DOX2nOyh.js.map +0 -1
- package/src/components/EntityCollectionTable/fields/VirtualTableDateField.tsx +0 -39
- package/src/components/EntityCollectionTable/fields/VirtualTableInput.tsx +0 -90
- package/src/components/EntityCollectionTable/fields/VirtualTableNumberInput.tsx +0 -83
- package/src/components/EntityCollectionTable/fields/VirtualTableSwitch.tsx +0 -32
- package/src/components/EntityCollectionTable/index.tsx +0 -14
- package/src/contexts/SideEntityControllerContext.tsx +0 -5
- package/src/form/field_bindings/ReferenceAsStringFieldBinding.tsx +0 -141
- package/src/hooks/useSideEntityController.tsx +0 -13
- /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/PropertyTableCell.d.ts +0 -0
- /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/column_utils.d.ts +0 -0
- /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableRelationSelectorField.d.ts +0 -0
- /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableStorageUpload.d.ts +0 -0
- /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/VirtualTableSelect.d.ts +0 -0
- /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/VirtualTableUserSelect.d.ts +0 -0
- /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/CollectionTableToolbar.d.ts +0 -0
- /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/EntityTableCell.d.ts +0 -0
- /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/EntityTableCellActions.d.ts +0 -0
- /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/useDraggable.d.ts +0 -0
- /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/useWindowSize.d.ts +0 -0
- /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/table_bindings.d.ts +0 -0
- /package/dist/components/{EntityCollectionView → CollectionViewBinding}/FilterPresetsButton.d.ts +0 -0
- /package/dist/components/{EntityCollectionView → CollectionViewBinding}/FiltersDialog.d.ts +0 -0
- /package/dist/components/{EntityCollectionView → CollectionViewBinding}/ViewModeToggle.d.ts +0 -0
- /package/dist/components/{EntityCollectionView → CollectionViewBinding}/useSelectionController.d.ts +0 -0
- /package/dist/components/{EntityCollectionView → CollectionViewBinding}/utils.d.ts +0 -0
- /package/src/components/{EntityCollectionTable → CollectionTableBinding}/PropertyTableCell.tsx +0 -0
- /package/src/components/{EntityCollectionTable → CollectionTableBinding}/column_utils.tsx +0 -0
- /package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableRelationSelectorField.tsx +0 -0
- /package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/VirtualTableSelect.tsx +0 -0
- /package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/VirtualTableUserSelect.tsx +0 -0
- /package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/CollectionTableToolbar.tsx +0 -0
- /package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/EntityTableCell.tsx +0 -0
- /package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/EntityTableCellActions.tsx +0 -0
- /package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/useDraggable.tsx +0 -0
- /package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/useWindowSize.tsx +0 -0
- /package/src/components/{EntityCollectionView → CollectionViewBinding}/FilterPresetsButton.tsx +0 -0
- /package/src/components/{EntityCollectionView → CollectionViewBinding}/ViewModeToggle.tsx +0 -0
- /package/src/components/{EntityCollectionView → CollectionViewBinding}/useSelectionController.tsx +0 -0
- /package/src/components/{EntityCollectionView → CollectionViewBinding}/utils.ts +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { CollectionsConfigController, SaveCollectionParams, UpdateCollectionParams, DeleteCollectionParams, SavePropertyParams, DeletePropertyParams, UpdatePropertiesOrderParams } from "./types/config_controller";
|
|
2
|
-
import {
|
|
2
|
+
import { CollectionConfig, Properties } from "@rebasepro/types";
|
|
3
3
|
import { getSubcollections } from "@rebasepro/common";
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
import React, { useMemo, useRef } from "react";
|
|
7
7
|
export function useLocalCollectionsConfigController(
|
|
8
8
|
clientOrUrl: any,
|
|
9
|
-
baseCollections:
|
|
9
|
+
baseCollections: CollectionConfig[] = [],
|
|
10
10
|
options?: {
|
|
11
11
|
readOnly?: boolean;
|
|
12
12
|
getAuthToken?: () => Promise<string | null>;
|
|
@@ -73,7 +73,7 @@ export function useLocalCollectionsConfigController(
|
|
|
73
73
|
readOnlyReason: "Local collection editing is only available in development mode.",
|
|
74
74
|
collections: parsedCollections,
|
|
75
75
|
getCollection: (id: string) => {
|
|
76
|
-
const found = parsedCollections.find(c => (c as
|
|
76
|
+
const found = parsedCollections.find(c => (c as CollectionConfig & { id?: string }).id === id || c.slug === id);
|
|
77
77
|
if (found) return found;
|
|
78
78
|
throw Error(`Collection ${id} not found in local mode`);
|
|
79
79
|
},
|
|
@@ -109,7 +109,7 @@ collectionData: { propertiesOrder: newPropertiesOrder } });
|
|
|
109
109
|
},
|
|
110
110
|
|
|
111
111
|
updatePropertiesOrder: async ({ collection, fullPath, newPropertiesOrder }: UpdatePropertiesOrderParams) => {
|
|
112
|
-
const collectionId = (collection as
|
|
112
|
+
const collectionId = (collection as CollectionConfig & { id?: string }).id || fullPath.split("/").pop();
|
|
113
113
|
await request("/collection/save", { collectionId,
|
|
114
114
|
collectionData: { propertiesOrder: newPropertiesOrder } });
|
|
115
115
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DataType,
|
|
1
|
+
import { DataType, CollectionConfig } from "@rebasepro/types";
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -33,7 +33,7 @@ export interface CollectionValidationError {
|
|
|
33
33
|
export interface CollectionValidationResult {
|
|
34
34
|
valid: boolean;
|
|
35
35
|
errors: CollectionValidationError[];
|
|
36
|
-
collection?:
|
|
36
|
+
collection?: CollectionConfig;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
/**
|
|
@@ -461,6 +461,6 @@ export function validateCollectionJson(jsonString: string): CollectionValidation
|
|
|
461
461
|
return {
|
|
462
462
|
valid: errors.length === 0,
|
|
463
463
|
errors,
|
|
464
|
-
collection: errors.length === 0 ? parsed as unknown as
|
|
464
|
+
collection: errors.length === 0 ? parsed as unknown as CollectionConfig : undefined
|
|
465
465
|
};
|
|
466
466
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CollectionConfig, ViewMode } from "@rebasepro/types";
|
|
2
2
|
import React, { useMemo } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { CollectionViewBinding } from "./CollectionViewBinding/CollectionViewBinding";
|
|
4
4
|
import { useCollectionRegistryController } from "../hooks/navigation/contexts/CollectionRegistryContext";
|
|
5
5
|
import { Typography } from "@rebasepro/ui";
|
|
6
|
-
import { useComponentOverride,
|
|
6
|
+
import { useComponentOverride, CollectionScopeProvider } from "@rebasepro/core";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Props for the {@link CollectionPanel} component.
|
|
10
10
|
*
|
|
11
|
-
* This is a high-level, consumer-friendly wrapper around {@link
|
|
11
|
+
* This is a high-level, consumer-friendly wrapper around {@link CollectionViewBinding}
|
|
12
12
|
* designed for embedding collection views inside custom pages (home pages,
|
|
13
13
|
* dashboards, entity detail views, etc.).
|
|
14
14
|
*
|
|
@@ -53,7 +53,7 @@ export type CollectionPanelProps = {
|
|
|
53
53
|
updateUrl?: boolean;
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
|
-
* Override the entity open mode when clicking
|
|
56
|
+
* Override the entity open mode when clicking a entity.
|
|
57
57
|
*/
|
|
58
58
|
openEntityMode?: "side_panel" | "full_screen" | "split" | "dialog";
|
|
59
59
|
|
|
@@ -66,7 +66,7 @@ export type CollectionPanelProps = {
|
|
|
66
66
|
* Any additional collection-level overrides (e.g. `previewProperties`,
|
|
67
67
|
* `enabledViews`, `entityActions`, `defaultFilter`, etc.).
|
|
68
68
|
*/
|
|
69
|
-
collectionOverrides?: Partial<
|
|
69
|
+
collectionOverrides?: Partial<CollectionConfig>;
|
|
70
70
|
};
|
|
71
71
|
|
|
72
72
|
/**
|
|
@@ -101,8 +101,8 @@ function CollectionPanelInner({
|
|
|
101
101
|
title,
|
|
102
102
|
updateUrl,
|
|
103
103
|
className
|
|
104
|
-
}: CollectionPanelProps & { mergedCollection:
|
|
105
|
-
const ResolvedCollectionView = useComponentOverride("Collection.View",
|
|
104
|
+
}: CollectionPanelProps & { mergedCollection: CollectionConfig }) {
|
|
105
|
+
const ResolvedCollectionView = useComponentOverride("Collection.View", CollectionViewBinding);
|
|
106
106
|
|
|
107
107
|
return (
|
|
108
108
|
<div className={className}>
|
|
@@ -150,7 +150,7 @@ export function CollectionPanel(props: CollectionPanelProps) {
|
|
|
150
150
|
...registeredCollection,
|
|
151
151
|
...(collectionOverrides ?? {}),
|
|
152
152
|
...propOverrides
|
|
153
|
-
} as
|
|
153
|
+
} as CollectionConfig;
|
|
154
154
|
}, [registeredCollection, collectionOverrides, viewMode, sort, limit, openEntityMode]);
|
|
155
155
|
|
|
156
156
|
if (!mergedCollection) {
|
|
@@ -170,12 +170,9 @@ export function CollectionPanel(props: CollectionPanelProps) {
|
|
|
170
170
|
/>
|
|
171
171
|
);
|
|
172
172
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
);
|
|
179
|
-
}
|
|
180
|
-
return content;
|
|
173
|
+
return (
|
|
174
|
+
<CollectionScopeProvider collection={mergedCollection}>
|
|
175
|
+
{content}
|
|
176
|
+
</CollectionScopeProvider>
|
|
177
|
+
);
|
|
181
178
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CollectionConfig } from "@rebasepro/types";
|
|
2
2
|
import type { EntityAction } from "@rebasepro/types";
|
|
3
3
|
import React, { MouseEvent, useCallback } from "react";
|
|
4
4
|
|
|
@@ -32,7 +32,7 @@ import { useCMSContext } from "../../index";
|
|
|
32
32
|
*
|
|
33
33
|
* @group Collection components
|
|
34
34
|
*/
|
|
35
|
-
export const
|
|
35
|
+
export const CollectionRowActions = function CollectionRowActions({
|
|
36
36
|
entity,
|
|
37
37
|
collection,
|
|
38
38
|
path,
|
|
@@ -56,7 +56,7 @@ export const EntityCollectionRowActions = function EntityCollectionRowActions({
|
|
|
56
56
|
}:
|
|
57
57
|
{
|
|
58
58
|
entity: Entity<any>,
|
|
59
|
-
collection?:
|
|
59
|
+
collection?: CollectionConfig<any>,
|
|
60
60
|
path?: string,
|
|
61
61
|
width: number,
|
|
62
62
|
frozen?: boolean,
|
|
@@ -80,7 +80,7 @@ export const EntityCollectionRowActions = function EntityCollectionRowActions({
|
|
|
80
80
|
|
|
81
81
|
|
|
82
82
|
const context = useCMSContext();
|
|
83
|
-
const
|
|
83
|
+
const sidePanelCtrl = context.sidePanelController;
|
|
84
84
|
const { t } = useTranslation();
|
|
85
85
|
|
|
86
86
|
const onCheckedChange = useCallback((checked: boolean) => {
|
|
@@ -131,7 +131,7 @@ export const EntityCollectionRowActions = function EntityCollectionRowActions({
|
|
|
131
131
|
path,
|
|
132
132
|
collection,
|
|
133
133
|
context,
|
|
134
|
-
|
|
134
|
+
sidePanelController: sidePanelCtrl,
|
|
135
135
|
selectionController,
|
|
136
136
|
highlightEntity,
|
|
137
137
|
unhighlightEntity,
|
|
@@ -175,7 +175,7 @@ export const EntityCollectionRowActions = function EntityCollectionRowActions({
|
|
|
175
175
|
path,
|
|
176
176
|
collection,
|
|
177
177
|
context,
|
|
178
|
-
|
|
178
|
+
sidePanelController: sidePanelCtrl,
|
|
179
179
|
selectionController,
|
|
180
180
|
highlightEntity,
|
|
181
181
|
unhighlightEntity,
|
|
@@ -5,9 +5,9 @@ import { PropertyTableCell } from "./PropertyTableCell";
|
|
|
5
5
|
import { ErrorBoundary } from "@rebasepro/ui";
|
|
6
6
|
import { useRebaseContext, useLargeLayout } from "@rebasepro/core";
|
|
7
7
|
import { CellRendererParams, VirtualTableColumn } from "@rebasepro/ui";
|
|
8
|
-
import {
|
|
8
|
+
import { CollectionRowActions } from "./CollectionRowActions";
|
|
9
9
|
import { CollectionTableToolbar } from "./internal/CollectionTableToolbar";
|
|
10
|
-
import {
|
|
10
|
+
import { CollectionTableBindingProps } from "./CollectionTableBindingProps";
|
|
11
11
|
import { EntityTableCell } from "./internal/EntityTableCell";
|
|
12
12
|
import { CustomFieldValidator } from "../../form/validation";
|
|
13
13
|
import { renderSkeletonText } from "../../preview";
|
|
@@ -22,27 +22,27 @@ import { getValueInPath } from "@rebasepro/utils";
|
|
|
22
22
|
* This component is in charge of rendering a collection table with a high
|
|
23
23
|
* degree of customization.
|
|
24
24
|
*
|
|
25
|
-
* This component is used internally by {@link
|
|
25
|
+
* This component is used internally by {@link CollectionViewBinding} and
|
|
26
26
|
* {@link useReferenceDialog}
|
|
27
27
|
*
|
|
28
28
|
* Please note that you only need to use this component if you are building
|
|
29
29
|
* a custom view. If you just need to create a default view you can do it
|
|
30
30
|
* exclusively with config options.
|
|
31
31
|
*
|
|
32
|
-
* If you want to bind a {@link
|
|
32
|
+
* If you want to bind a {@link CollectionConfig} to a table with the default
|
|
33
33
|
* options you see in collections in the top level navigation, you can
|
|
34
|
-
* check {@link
|
|
34
|
+
* check {@link CollectionViewBinding}.
|
|
35
35
|
*
|
|
36
36
|
* The data displayed in the table is managed by a {@link EntityTableController}.
|
|
37
37
|
* You can build the default, bound to a path in the driver, by using the hook
|
|
38
38
|
* {@link useDataTableController}
|
|
39
39
|
*
|
|
40
|
-
* @see
|
|
41
|
-
* @see
|
|
40
|
+
* @see CollectionTableBindingProps
|
|
41
|
+
* @see CollectionViewBinding
|
|
42
42
|
* @see VirtualTable
|
|
43
43
|
* @group Components
|
|
44
44
|
*/
|
|
45
|
-
export const
|
|
45
|
+
export const CollectionTableBinding = function CollectionTableBinding<M extends Record<string, unknown> = Record<string, unknown>, USER extends User = User>
|
|
46
46
|
({
|
|
47
47
|
className,
|
|
48
48
|
style,
|
|
@@ -82,7 +82,7 @@ export const EntityCollectionTable = function EntityCollectionTable<M extends Re
|
|
|
82
82
|
openEntityMode = "side_panel",
|
|
83
83
|
onColumnsOrderChange,
|
|
84
84
|
hideToolbar = false
|
|
85
|
-
}:
|
|
85
|
+
}: CollectionTableBindingProps<M>) {
|
|
86
86
|
|
|
87
87
|
const ref = useRef<HTMLDivElement>(null);
|
|
88
88
|
|
|
@@ -113,7 +113,7 @@ export const EntityCollectionTable = function EntityCollectionTable<M extends Re
|
|
|
113
113
|
const additionalFieldsMap: Record<string, AdditionalFieldDelegate<M, USER>> = useMemo(() => {
|
|
114
114
|
return (additionalFields
|
|
115
115
|
? additionalFields
|
|
116
|
-
.map((aC) => ({ [aC.key]: aC as AdditionalFieldDelegate<M,
|
|
116
|
+
.map((aC) => ({ [aC.key]: aC as AdditionalFieldDelegate<M, USER> }))
|
|
117
117
|
.reduce((a, b) => ({ ...a,
|
|
118
118
|
...b }), {})
|
|
119
119
|
: {}) as Record<string, AdditionalFieldDelegate<M, USER>>;
|
|
@@ -132,9 +132,10 @@ export const EntityCollectionTable = function EntityCollectionTable<M extends Re
|
|
|
132
132
|
isDragging,
|
|
133
133
|
isDraggable,
|
|
134
134
|
frozen
|
|
135
|
-
}: CellRendererParams<
|
|
135
|
+
}: CellRendererParams<Entity<M>>) => {
|
|
136
136
|
|
|
137
|
-
const entity: Entity<M> = rowData;
|
|
137
|
+
const entity: Entity<M> | undefined = rowData;
|
|
138
|
+
if (!entity) return null;
|
|
138
139
|
|
|
139
140
|
const propertyKey = column.key;
|
|
140
141
|
|
|
@@ -192,9 +193,10 @@ export const EntityCollectionTable = function EntityCollectionTable<M extends Re
|
|
|
192
193
|
isDragging,
|
|
193
194
|
isDraggable,
|
|
194
195
|
frozen
|
|
195
|
-
}: CellRendererParams<
|
|
196
|
+
}: CellRendererParams<Entity<M>>) => {
|
|
196
197
|
|
|
197
|
-
const entity: Entity<M> = rowData;
|
|
198
|
+
const entity: Entity<M> | undefined = rowData;
|
|
199
|
+
if (!entity) return null;
|
|
198
200
|
|
|
199
201
|
const additionalField = additionalFieldsMap[column.key as string];
|
|
200
202
|
const value = additionalField.dependencies
|
|
@@ -293,7 +295,7 @@ export const EntityCollectionTable = function EntityCollectionTable<M extends Re
|
|
|
293
295
|
: collectionColumns) as VirtualTableColumn[]
|
|
294
296
|
], [idColumn, displayedColumnIds, collectionColumns]);
|
|
295
297
|
|
|
296
|
-
const cellRenderer = useCallback((props: CellRendererParams<
|
|
298
|
+
const cellRenderer = useCallback((props: CellRendererParams<Entity<M>>) => {
|
|
297
299
|
const column = props.column;
|
|
298
300
|
const columns = props.columns;
|
|
299
301
|
const columnKey = column.key;
|
|
@@ -302,13 +304,13 @@ export const EntityCollectionTable = function EntityCollectionTable<M extends Re
|
|
|
302
304
|
if (props.columnIndex === 0) {
|
|
303
305
|
if (tableRowActionsBuilder)
|
|
304
306
|
return tableRowActionsBuilder({
|
|
305
|
-
entity: props.rowData
|
|
307
|
+
entity: props.rowData!,
|
|
306
308
|
size,
|
|
307
309
|
width: column.width,
|
|
308
310
|
frozen: column.frozen
|
|
309
311
|
});
|
|
310
312
|
else
|
|
311
|
-
return <
|
|
313
|
+
return <CollectionRowActions entity={props.rowData!}
|
|
312
314
|
width={column.width}
|
|
313
315
|
frozen={column.frozen}
|
|
314
316
|
isSelected={false}
|
|
@@ -9,7 +9,7 @@ import { VirtualTableColumn } from "@rebasepro/ui";
|
|
|
9
9
|
/**
|
|
10
10
|
* @group Collection components
|
|
11
11
|
*/
|
|
12
|
-
export type
|
|
12
|
+
export type CollectionTableBindingProps<M extends Record<string, unknown>,
|
|
13
13
|
USER extends User = User> = {
|
|
14
14
|
|
|
15
15
|
className?: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
1
|
+
import { useSelectionDialog } from "../../../hooks/useSelectionDialog";
|
|
2
|
+
import type { CollectionConfig } from "@rebasepro/types";
|
|
3
|
+
import { getCollectionDataPath } from "@rebasepro/types";
|
|
3
4
|
import React, { useCallback } from "react";
|
|
4
5
|
import { deepEqual as equal } from "fast-equals";
|
|
5
6
|
|
|
@@ -10,7 +11,7 @@ import { RelationPreview } from "../../../preview";
|
|
|
10
11
|
import { CollectionSize, Entity, EntityRelation, FilterValues, Relation } from "@rebasepro/types";
|
|
11
12
|
import { } from "@rebasepro/core";
|
|
12
13
|
import { ErrorView } from "@rebasepro/core";
|
|
13
|
-
import { EntityPreviewContainer } from "../../
|
|
14
|
+
import { EntityPreviewContainer } from "../../EntityPreviewBinding";
|
|
14
15
|
|
|
15
16
|
type TableMultipleRelationFieldProps = {
|
|
16
17
|
name: string;
|
|
@@ -33,7 +34,7 @@ export function TableMultipleRelationField(props: TableMultipleRelationFieldProp
|
|
|
33
34
|
|
|
34
35
|
export const TableMultipleRelationFieldInternal = React.memo(
|
|
35
36
|
function TableMultipleRelationFieldInternal(props: TableMultipleRelationFieldProps & {
|
|
36
|
-
collection:
|
|
37
|
+
collection: CollectionConfig;
|
|
37
38
|
}) {
|
|
38
39
|
const {
|
|
39
40
|
name,
|
|
@@ -56,9 +57,9 @@ export const TableMultipleRelationFieldInternal = React.memo(
|
|
|
56
57
|
|
|
57
58
|
const selectedEntityIds = value.map((ref) => ref.id);
|
|
58
59
|
|
|
59
|
-
const relationDialogController =
|
|
60
|
+
const relationDialogController = useSelectionDialog({
|
|
60
61
|
multiselect: true,
|
|
61
|
-
path: collection
|
|
62
|
+
path: getCollectionDataPath(collection),
|
|
62
63
|
collection,
|
|
63
64
|
onMultipleEntitiesSelected,
|
|
64
65
|
selectedEntityIds,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
1
|
+
import { useSelectionDialog } from "../../../hooks/useSelectionDialog";
|
|
2
|
+
import type { CollectionConfig } from "@rebasepro/types";
|
|
3
3
|
import React, { useCallback } from "react";
|
|
4
4
|
import { deepEqual as equal } from "fast-equals"
|
|
5
5
|
|
|
@@ -7,9 +7,9 @@ import { ReferencePreview } from "../../../preview";
|
|
|
7
7
|
import { CollectionSize, Entity, EntityReference, FilterValues } from "@rebasepro/types";
|
|
8
8
|
|
|
9
9
|
import { getPreviewSizeFrom } from "../../../preview/util";
|
|
10
|
-
import { useComponentOverride, ErrorView,
|
|
10
|
+
import { useComponentOverride, ErrorView, CollectionScopeProvider } from "@rebasepro/core";
|
|
11
11
|
import { cls, PencilIcon } from "@rebasepro/ui";
|
|
12
|
-
import { EntityPreviewContainer } from "../../
|
|
12
|
+
import { EntityPreviewContainer } from "../../EntityPreviewBinding";
|
|
13
13
|
import { getReferenceFrom } from "@rebasepro/common";
|
|
14
14
|
import { useCollectionRegistryController } from "../../../index";
|
|
15
15
|
|
|
@@ -30,7 +30,7 @@ type TableReferenceFieldProps = {
|
|
|
30
30
|
|
|
31
31
|
const DefaultMissingReference: React.FC<{ path: string }> = () => null;
|
|
32
32
|
|
|
33
|
-
function TableReferenceFieldResolver(props: TableReferenceFieldProps & { collection:
|
|
33
|
+
function TableReferenceFieldResolver(props: TableReferenceFieldProps & { collection: CollectionConfig | undefined }) {
|
|
34
34
|
const ResolvedMissingReference = useComponentOverride("Entity.MissingReference", DefaultMissingReference);
|
|
35
35
|
const { path, collection } = props;
|
|
36
36
|
|
|
@@ -56,11 +56,11 @@ export function TableReferenceField(props: TableReferenceFieldProps) {
|
|
|
56
56
|
/>
|
|
57
57
|
);
|
|
58
58
|
|
|
59
|
-
if (collection
|
|
59
|
+
if (collection) {
|
|
60
60
|
return (
|
|
61
|
-
<
|
|
61
|
+
<CollectionScopeProvider collection={collection}>
|
|
62
62
|
{content}
|
|
63
|
-
</
|
|
63
|
+
</CollectionScopeProvider>
|
|
64
64
|
);
|
|
65
65
|
}
|
|
66
66
|
return content;
|
|
@@ -68,7 +68,7 @@ export function TableReferenceField(props: TableReferenceFieldProps) {
|
|
|
68
68
|
|
|
69
69
|
export const TableReferenceFieldInternal = React.memo(
|
|
70
70
|
function TableReferenceFieldInternal(props: TableReferenceFieldProps & {
|
|
71
|
-
collection:
|
|
71
|
+
collection: CollectionConfig;
|
|
72
72
|
}) {
|
|
73
73
|
const {
|
|
74
74
|
name,
|
|
@@ -100,7 +100,7 @@ export const TableReferenceFieldInternal = React.memo(
|
|
|
100
100
|
: internalValue.id ? [internalValue.id] : [])
|
|
101
101
|
: [];
|
|
102
102
|
|
|
103
|
-
const referenceDialogController =
|
|
103
|
+
const referenceDialogController = useSelectionDialog({
|
|
104
104
|
multiselect,
|
|
105
105
|
path,
|
|
106
106
|
collection,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
1
|
+
import { useSelectionDialog } from "../../../hooks/useSelectionDialog";
|
|
2
|
+
import type { CollectionConfig } from "@rebasepro/types";
|
|
3
|
+
import { getCollectionDataPath } from "@rebasepro/types";
|
|
3
4
|
import React, { useCallback } from "react";
|
|
4
5
|
import { deepEqual as equal } from "fast-equals"
|
|
5
6
|
|
|
@@ -10,7 +11,7 @@ import { getPreviewSizeFrom } from "../../../preview/util";
|
|
|
10
11
|
import { } from "@rebasepro/core";
|
|
11
12
|
import { ErrorView } from "@rebasepro/core";
|
|
12
13
|
import { cls, PencilIcon } from "@rebasepro/ui";
|
|
13
|
-
import { EntityPreviewContainer } from "../../
|
|
14
|
+
import { EntityPreviewContainer } from "../../EntityPreviewBinding";
|
|
14
15
|
import { getRelationFrom, normalizeToEntityRelation } from "@rebasepro/common";
|
|
15
16
|
import { TableMultipleRelationField } from "./TableMultipleRelationField";
|
|
16
17
|
|
|
@@ -56,7 +57,7 @@ export function TableRelationField(props: TableRelationFieldProps) {
|
|
|
56
57
|
|
|
57
58
|
export const TableRelationFieldInternal = React.memo(
|
|
58
59
|
function TableRelationFieldInternal(props: TableRelationFieldProps & {
|
|
59
|
-
collection:
|
|
60
|
+
collection: CollectionConfig;
|
|
60
61
|
}) {
|
|
61
62
|
const {
|
|
62
63
|
name,
|
|
@@ -88,9 +89,9 @@ export const TableRelationFieldInternal = React.memo(
|
|
|
88
89
|
: internalValue.id ? [internalValue.id] : [])
|
|
89
90
|
: [];
|
|
90
91
|
|
|
91
|
-
const relationDialogController =
|
|
92
|
+
const relationDialogController = useSelectionDialog({
|
|
92
93
|
multiselect,
|
|
93
|
-
path: collection
|
|
94
|
+
path: getCollectionDataPath(collection),
|
|
94
95
|
collection,
|
|
95
96
|
onMultipleEntitiesSelected,
|
|
96
97
|
onSingleEntitySelected,
|
|
@@ -8,7 +8,7 @@ import { useDropzone } from "react-dropzone";
|
|
|
8
8
|
import { PropertyPreview } from "../../../preview";
|
|
9
9
|
import { ErrorBoundary } from "@rebasepro/ui";
|
|
10
10
|
import { cls, IconButton, PencilIcon, Typography } from "@rebasepro/ui";
|
|
11
|
-
import { useSnackbarController, useStorageSource, useTranslation, StorageFieldItem, useStorageUploadController } from "@rebasepro/core";
|
|
11
|
+
import { useSnackbarController, useStorageSource, useTranslation, StorageFieldItem, useStorageUploadController, StorageSourceContext } from "@rebasepro/core";
|
|
12
12
|
import { getThumbnailMeasure } from "../../../preview/util";
|
|
13
13
|
import { StorageUploadProgress } from "../../../form/components/StorageUploadProgress";
|
|
14
14
|
import { EntityTableCellActions } from "../internal/EntityTableCellActions";
|
|
@@ -64,7 +64,8 @@ export function TableStorageUpload(props: {
|
|
|
64
64
|
storage,
|
|
65
65
|
onFileUploadComplete,
|
|
66
66
|
storagePathBuilder,
|
|
67
|
-
multipleFilesSupported
|
|
67
|
+
multipleFilesSupported,
|
|
68
|
+
resolvedStorageSource
|
|
68
69
|
} = useStorageUploadController({
|
|
69
70
|
entityValues: entity.values,
|
|
70
71
|
entityId: entity.id,
|
|
@@ -79,24 +80,26 @@ export function TableStorageUpload(props: {
|
|
|
79
80
|
|
|
80
81
|
return (
|
|
81
82
|
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
83
|
+
<StorageSourceContext.Provider value={resolvedStorageSource}>
|
|
84
|
+
<StorageUpload
|
|
85
|
+
internalValue={internalValue}
|
|
86
|
+
setInternalValue={setInternalValue}
|
|
87
|
+
name={propertyKey}
|
|
88
|
+
disabled={disabled}
|
|
89
|
+
autoFocus={false}
|
|
90
|
+
openPopup={openPopup}
|
|
91
|
+
error={error}
|
|
92
|
+
selected={selected}
|
|
93
|
+
property={property}
|
|
94
|
+
onChange={updateValue}
|
|
95
|
+
entity={entity}
|
|
96
|
+
storagePathBuilder={storagePathBuilder}
|
|
97
|
+
storage={storage}
|
|
98
|
+
multipleFilesSupported={multipleFilesSupported}
|
|
99
|
+
onFilesAdded={onFilesAdded}
|
|
100
|
+
onFileUploadComplete={onFileUploadComplete}
|
|
101
|
+
previewSize={previewSize}/>
|
|
102
|
+
</StorageSourceContext.Provider>
|
|
100
103
|
|
|
101
104
|
);
|
|
102
105
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export {
|
|
2
|
+
CollectionTableBinding
|
|
3
|
+
} from "./CollectionTableBinding";
|
|
4
|
+
|
|
5
|
+
export type {
|
|
6
|
+
CollectionTableBindingProps
|
|
7
|
+
} from "./CollectionTableBindingProps";
|
|
8
|
+
|
|
9
|
+
export * from "./PropertyTableCell";
|
|
10
|
+
export * from "./CollectionRowActions";
|
|
11
|
+
|
|
12
|
+
export * from "./column_utils";
|
|
13
|
+
|
|
14
|
+
export { VirtualTableInput } from "@rebasepro/ui";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CollectionConfig } from "@rebasepro/types";
|
|
2
2
|
import type { ArrayProperty, Property } from "@rebasepro/types";
|
|
3
3
|
|
|
4
4
|
export function getTableCellAlignment(property: Property): "right" | "left" | "center" {
|
|
@@ -68,6 +68,6 @@ export function getTablePropertyColumnWidth(property: Property): number {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
export function getSubcollectionColumnId(collection:
|
|
71
|
+
export function getSubcollectionColumnId(collection: CollectionConfig) {
|
|
72
72
|
return `subcollection:${collection.slug}`;
|
|
73
73
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Properties } from "@rebasepro/types";
|
|
2
|
-
import type {
|
|
2
|
+
import type { CollectionConfig } from "@rebasepro/types";
|
|
3
3
|
import type { FormContext, PropertyFieldBindingProps } from "../../../../types/fields";
|
|
4
4
|
import type { Property } from "@rebasepro/types";
|
|
5
5
|
import React, { useCallback, useEffect, useLayoutEffect, useMemo, useState } from "react";
|
|
@@ -24,7 +24,7 @@ interface PopupFormFieldProps<M extends Record<string, unknown>> {
|
|
|
24
24
|
entityId: string | number;
|
|
25
25
|
tableKey: string;
|
|
26
26
|
propertyKey?: Extract<keyof M, string>;
|
|
27
|
-
collection?:
|
|
27
|
+
collection?: CollectionConfig<any>;
|
|
28
28
|
cellRect?: DOMRect;
|
|
29
29
|
open: boolean;
|
|
30
30
|
onClose: () => void;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ArrayProperty, DateProperty, Entity, EntityReference, EntityRelation, NumberProperty, Property, ReferenceProperty, RelationProperty, StringProperty } from "@rebasepro/types";
|
|
3
|
-
import { TableSize } from "@rebasepro/core";
|
|
3
|
+
import { TableSize, useCustomizationController } from "@rebasepro/core";
|
|
4
|
+
import {
|
|
5
|
+
VirtualTableInput,
|
|
6
|
+
VirtualTableNumberInput,
|
|
7
|
+
VirtualTableSwitch,
|
|
8
|
+
VirtualTableDateField
|
|
9
|
+
} from "@rebasepro/ui";
|
|
4
10
|
|
|
5
|
-
import { VirtualTableInput } from "./fields/VirtualTableInput";
|
|
6
11
|
import { VirtualTableSelect } from "./fields/VirtualTableSelect";
|
|
7
|
-
import { VirtualTableNumberInput } from "./fields/VirtualTableNumberInput";
|
|
8
|
-
import { VirtualTableSwitch } from "./fields/VirtualTableSwitch";
|
|
9
|
-
import { VirtualTableDateField } from "./fields/VirtualTableDateField";
|
|
10
12
|
import { VirtualTableUserSelect } from "./fields/VirtualTableUserSelect";
|
|
11
13
|
import { TableStorageUpload } from "./fields/TableStorageUpload";
|
|
12
14
|
import { TableReferenceField } from "./fields/TableReferenceField";
|
|
@@ -63,33 +65,7 @@ export function getTableBindingForProperty(
|
|
|
63
65
|
): TableFieldConfig | undefined {
|
|
64
66
|
const isAStorageProperty = isStorageProperty(property);
|
|
65
67
|
|
|
66
|
-
if (
|
|
67
|
-
return {
|
|
68
|
-
Component: ({ propertyKey, property, internalValue, updateValue, disabled, size, path }: TableFieldBindingProps) => {
|
|
69
|
-
const referenceProperty = (property as StringProperty).reference;
|
|
70
|
-
if (!referenceProperty) return null;
|
|
71
|
-
const referenceValue = internalValue ? new EntityReference({ id: internalValue as string,
|
|
72
|
-
path: referenceProperty.path as string }) : undefined;
|
|
73
|
-
return (
|
|
74
|
-
<TableReferenceField
|
|
75
|
-
name={propertyKey}
|
|
76
|
-
internalValue={referenceValue}
|
|
77
|
-
updateValue={(v) => updateValue(v ? (v as EntityReference).id : null)}
|
|
78
|
-
disabled={disabled}
|
|
79
|
-
size={size}
|
|
80
|
-
path={referenceProperty.path as string}
|
|
81
|
-
multiselect={false}
|
|
82
|
-
previewProperties={referenceProperty.ui?.previewProperties}
|
|
83
|
-
includeId={referenceProperty.includeId}
|
|
84
|
-
includeEntityLink={referenceProperty.includeEntityLink}
|
|
85
|
-
title={property.name}
|
|
86
|
-
fixedFilter={referenceProperty.fixedFilter}
|
|
87
|
-
/>
|
|
88
|
-
);
|
|
89
|
-
},
|
|
90
|
-
allowScroll: false
|
|
91
|
-
};
|
|
92
|
-
} else if (isAStorageProperty) {
|
|
68
|
+
if (isAStorageProperty) {
|
|
93
69
|
return {
|
|
94
70
|
Component: ({ validationError, error, disabled, selected, openPopup, property, entity, path, internalValue, size, updateValue, propertyKey }: TableFieldBindingProps) => (
|
|
95
71
|
<TableStorageUpload
|
|
@@ -183,7 +159,7 @@ export function getTableBindingForProperty(
|
|
|
183
159
|
),
|
|
184
160
|
fullHeight: true
|
|
185
161
|
};
|
|
186
|
-
} else if (stringProperty.ui?.markdown || !stringProperty.storage
|
|
162
|
+
} else if (stringProperty.ui?.markdown || !stringProperty.storage) {
|
|
187
163
|
const multiline = Boolean(stringProperty.ui?.multiline) || Boolean(stringProperty.ui?.markdown);
|
|
188
164
|
return {
|
|
189
165
|
Component: ({ error, validationError, disabled, selected, internalValue, updateValue }: TableFieldBindingProps) => (
|
|
@@ -213,17 +189,21 @@ export function getTableBindingForProperty(
|
|
|
213
189
|
};
|
|
214
190
|
} else if (property.type === "date") {
|
|
215
191
|
return {
|
|
216
|
-
Component: ({ propertyKey, error, validationError, disabled, selected, property, internalValue, updateValue }: TableFieldBindingProps) =>
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
192
|
+
Component: ({ propertyKey, error, validationError, disabled, selected, property, internalValue, updateValue }: TableFieldBindingProps) => {
|
|
193
|
+
const { locale } = useCustomizationController();
|
|
194
|
+
return (
|
|
195
|
+
<VirtualTableDateField
|
|
196
|
+
name={propertyKey}
|
|
197
|
+
error={validationError ?? error}
|
|
198
|
+
disabled={disabled}
|
|
199
|
+
mode={(property as DateProperty).mode}
|
|
200
|
+
focused={selected}
|
|
201
|
+
internalValue={internalValue as Date}
|
|
202
|
+
updateValue={updateValue}
|
|
203
|
+
locale={locale}
|
|
204
|
+
/>
|
|
205
|
+
);
|
|
206
|
+
},
|
|
227
207
|
fullHeight: true,
|
|
228
208
|
hideOverflow: false,
|
|
229
209
|
allowScroll: false
|