@rebasepro/admin 0.1.0 → 0.2.1
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 -6
- package/dist/{CollectionEditorDialog-MbvXGzEq.js → CollectionEditorDialog-BXIh2AXg.js} +40 -31
- package/dist/CollectionEditorDialog-BXIh2AXg.js.map +1 -0
- package/dist/{CollectionsStudioView-D9X6aiAr.js → CollectionsStudioView-jR8iz_ja.js} +6 -8
- package/dist/CollectionsStudioView-jR8iz_ja.js.map +1 -0
- package/dist/{ContentHomePage-CfVB1eUo.js → ContentHomePage-BQZWuOFb.js} +5 -7
- package/dist/ContentHomePage-BQZWuOFb.js.map +1 -0
- package/dist/{ExportCollectionAction-CUwJg4F9.js → ExportCollectionAction-CMdiiv1L.js} +36 -38
- package/dist/ExportCollectionAction-CMdiiv1L.js.map +1 -0
- package/dist/{ImportCollectionAction-DGa_SF_8.js → ImportCollectionAction-C05lE0IW.js} +5 -7
- package/dist/ImportCollectionAction-C05lE0IW.js.map +1 -0
- package/dist/{PropertyEditView-C4nlYmAc.js → PropertyEditView-BB5xjnhZ.js} +261 -165
- package/dist/PropertyEditView-BB5xjnhZ.js.map +1 -0
- package/dist/{RolesView-CNWxnR8e.js → RolesView-CULIHWZ9.js} +22 -11
- package/dist/RolesView-CULIHWZ9.js.map +1 -0
- package/dist/{UsersView-YiTIcXkA.js → UsersView-D7_AtJ44.js} +7 -71
- package/dist/UsersView-D7_AtJ44.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/LayoutModeSwitch.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/properties/VectorPropertyField.d.ts +3 -0
- package/dist/collection_editor_ui.js +5 -5
- package/dist/components/EntityCollectionTable/EntityCollectionRowActions.d.ts +1 -1
- package/dist/components/EntityCollectionTable/EntityCollectionTableProps.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityCollectionListView.d.ts +18 -2
- package/dist/components/EntityCollectionView/FilterPresetsButton.d.ts +21 -0
- package/dist/components/EntityDetailView.d.ts +31 -0
- package/dist/components/EntityEditView.d.ts +3 -2
- package/dist/components/ReferenceTable/EntitySelectionTable.d.ts +1 -1
- package/dist/components/admin/CreationResultDialog.d.ts +5 -0
- package/dist/components/admin/RolesFilterSelect.d.ts +2 -0
- package/dist/components/admin/UserRolesSelectField.d.ts +2 -0
- package/dist/components/common/default_entity_actions.d.ts +7 -1
- package/dist/components/field_configs.d.ts +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/data_import/utils/data.d.ts +1 -1
- package/dist/data_import/utils/file_headers.d.ts +6 -1
- package/dist/data_import/utils/file_to_json.d.ts +1 -11
- package/dist/data_import/utils/transforms.d.ts +11 -0
- package/dist/editor.js +2 -4
- package/dist/editor.js.map +1 -1
- package/dist/form/EntityForm.d.ts +1 -1
- package/dist/form/field_bindings/RelationFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/VectorFieldBinding.d.ts +11 -0
- package/dist/form/index.d.ts +1 -0
- package/dist/hooks/navigation/useResolvedViews.d.ts +2 -1
- package/dist/{index-CtzpHzMQ.js → index-BAM9KCmM.js} +4 -6
- package/dist/index-BAM9KCmM.js.map +1 -0
- package/dist/{index-DKlrVD1m.js → index-CoSNm3e3.js} +3 -3
- package/dist/index-CoSNm3e3.js.map +1 -0
- package/dist/{index-kHJXfLNI.js → index-D5OQhv-T.js} +3 -3
- package/dist/index-D5OQhv-T.js.map +1 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +352 -148
- package/dist/index.js.map +1 -1
- package/dist/types/components/EntityFormActionsProps.d.ts +1 -1
- package/dist/types/components/EntityFormProps.d.ts +2 -1
- package/dist/types/fields.d.ts +3 -3
- package/dist/util/navigation_utils.d.ts +1 -1
- package/dist/{util-CwLmSpGp.js → util-DtbWD7LF.js} +5312 -2580
- package/dist/util-DtbWD7LF.js.map +1 -0
- package/package.json +45 -39
- package/src/collection_editor/ConfigControllerProvider.tsx +1 -1
- package/src/collection_editor/ui/AddKanbanColumnAction.tsx +12 -2
- package/src/collection_editor/ui/CollectionViewHeaderAction.tsx +1 -2
- package/src/collection_editor/ui/EditorCollectionAction.tsx +1 -2
- package/src/collection_editor/ui/EditorCollectionActionStart.tsx +1 -2
- package/src/collection_editor/ui/EditorEntityAction.tsx +1 -2
- package/src/collection_editor/ui/HomePageEditorCollectionAction.tsx +1 -2
- package/src/collection_editor/ui/NewCollectionButton.tsx +1 -2
- package/src/collection_editor/ui/NewCollectionCard.tsx +4 -6
- package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +1 -2
- package/src/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.tsx +10 -2
- package/src/collection_editor/ui/collection_editor/CollectionDetailsForm.tsx +18 -2
- package/src/collection_editor/ui/collection_editor/CollectionEditorDialog.tsx +22 -7
- package/src/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.tsx +16 -2
- package/src/collection_editor/ui/collection_editor/CollectionJsonImportDialog.tsx +19 -9
- package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +13 -2
- package/src/collection_editor/ui/collection_editor/CollectionRLSTab.tsx +24 -2
- package/src/collection_editor/ui/collection_editor/CollectionRelationsTab.tsx +22 -3
- package/src/collection_editor/ui/collection_editor/CollectionStudioView.tsx +1 -2
- package/src/collection_editor/ui/collection_editor/CollectionsStudioView.tsx +11 -2
- package/src/collection_editor/ui/collection_editor/DisplaySettingsForm.tsx +12 -2
- package/src/collection_editor/ui/collection_editor/EntityActionsEditTab.tsx +16 -3
- package/src/collection_editor/ui/collection_editor/EnumForm.tsx +17 -2
- package/src/collection_editor/ui/collection_editor/GeneralSettingsForm.tsx +18 -2
- package/src/collection_editor/ui/collection_editor/GetCodeDialog.tsx +1 -2
- package/src/collection_editor/ui/collection_editor/KanbanConfigSection.tsx +1 -2
- package/src/collection_editor/ui/collection_editor/LayoutModeSwitch.tsx +17 -5
- package/src/collection_editor/ui/collection_editor/PropertyEditView.tsx +32 -6
- package/src/collection_editor/ui/collection_editor/PropertyFieldPreview.tsx +7 -7
- package/src/collection_editor/ui/collection_editor/PropertyTree.tsx +14 -2
- package/src/collection_editor/ui/collection_editor/SubcollectionsEditTab.tsx +16 -2
- package/src/collection_editor/ui/collection_editor/ViewModeSwitch.tsx +9 -2
- package/src/collection_editor/ui/collection_editor/properties/BlockPropertyField.tsx +1 -2
- package/src/collection_editor/ui/collection_editor/properties/MapPropertyField.tsx +1 -2
- package/src/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.tsx +9 -2
- package/src/collection_editor/ui/collection_editor/properties/StoragePropertyField.tsx +11 -2
- package/src/collection_editor/ui/collection_editor/properties/VectorPropertyField.tsx +34 -0
- package/src/collection_editor/ui/collection_editor/properties/conditions/ConditionsEditor.tsx +15 -7
- package/src/collection_editor/ui/collection_editor/properties/conditions/ConditionsPanel.tsx +1 -2
- package/src/collection_editor/ui/collection_editor/properties/conditions/EnumConditionsEditor.tsx +15 -3
- package/src/collection_editor/ui/collection_editor/properties/conditions/property_paths.ts +1 -1
- package/src/collection_editor/ui/collection_editor/properties/validation/ValidationPanel.tsx +1 -2
- package/src/collection_editor/useLocalCollectionsConfigController.tsx +0 -2
- package/src/collection_editor/validateCollectionJson.ts +9 -9
- package/src/components/AdminModeSyncer.tsx +1 -1
- package/src/components/ArrayContainer.tsx +19 -15
- package/src/components/ClearFilterSortButton.tsx +1 -2
- package/src/components/CollectionEditorDialogs.tsx +1 -1
- package/src/components/DefaultAppBar.tsx +15 -3
- package/src/components/DefaultDrawer.tsx +3 -3
- package/src/components/DrawerNavigationGroup.tsx +1 -2
- package/src/components/EntityCollectionTable/EntityCollectionRowActions.tsx +19 -9
- package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +2 -2
- package/src/components/EntityCollectionTable/EntityCollectionTableProps.tsx +1 -1
- package/src/components/EntityCollectionTable/fields/TableMultipleRelationField.tsx +1 -2
- package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +1 -2
- package/src/components/EntityCollectionTable/fields/TableRelationField.tsx +1 -2
- package/src/components/EntityCollectionTable/fields/TableStorageUpload.tsx +1 -2
- package/src/components/EntityCollectionTable/fields/VirtualTableSelect.tsx +0 -1
- package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.tsx +15 -27
- package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +3 -4
- package/src/components/EntityCollectionTable/internal/EntityTableCellActions.tsx +1 -2
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +3 -5
- package/src/components/EntityCollectionTable/table_bindings.tsx +51 -45
- package/src/components/EntityCollectionView/Board.tsx +1 -2
- package/src/components/EntityCollectionView/BoardColumn.tsx +9 -2
- package/src/components/EntityCollectionView/BoardColumnTitle.tsx +5 -4
- package/src/components/EntityCollectionView/EntityCard.tsx +2 -2
- package/src/components/EntityCollectionView/EntityCollectionBoardView.tsx +18 -16
- package/src/components/EntityCollectionView/EntityCollectionCardView.tsx +16 -17
- package/src/components/EntityCollectionView/EntityCollectionListView.tsx +90 -21
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +20 -11
- package/src/components/EntityCollectionView/EntityCollectionViewActions.tsx +6 -7
- package/src/components/EntityCollectionView/EntityCollectionViewStartActions.tsx +14 -5
- package/src/components/EntityCollectionView/FilterPresetsButton.tsx +292 -0
- package/src/components/EntityCollectionView/FiltersDialog.tsx +1 -2
- package/src/components/EntityCollectionView/SplitListView.tsx +76 -25
- package/src/components/EntityCollectionView/ViewModeToggle.tsx +20 -7
- package/src/components/EntityCollectionView/hooks/useKanbanDragAndDrop.ts +1 -1
- package/src/components/EntityCollectionView/useBoardDataController.tsx +74 -6
- package/src/components/EntityCollectionView/useEntityPreviewSlots.ts +1 -1
- package/src/components/EntityDetailView.tsx +619 -0
- package/src/components/EntityEditView.tsx +29 -10
- package/src/components/EntityEditViewFormActions.tsx +20 -7
- package/src/components/EntityPreview.tsx +14 -5
- package/src/components/EntitySidePanel.tsx +116 -62
- package/src/components/EntityView.tsx +1 -2
- package/src/components/HomePage/ContentHomePage.tsx +1 -1
- package/src/components/HomePage/FavouritesView.tsx +1 -2
- package/src/components/HomePage/NavigationCard.tsx +1 -2
- package/src/components/HomePage/NavigationCardBinding.tsx +1 -2
- package/src/components/HomePage/NavigationGroup.tsx +1 -2
- package/src/components/HomePage/SmallNavigationCard.tsx +1 -2
- package/src/components/PropertyIdCopyTooltip.tsx +1 -2
- package/src/components/RebaseAuthGate.tsx +2 -2
- package/src/components/RebaseNavigation.tsx +9 -7
- package/src/components/ReferenceTable/EntitySelectionTable.tsx +12 -8
- package/src/components/RelationSelector.tsx +34 -6
- package/src/components/SearchIconsView.tsx +10 -2
- package/src/components/SelectableTable/SelectableTable.tsx +4 -4
- package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +1 -2
- package/src/components/SideDialogs.tsx +63 -38
- package/src/components/UserSelector.tsx +30 -6
- package/src/components/admin/CreationResultDialog.tsx +135 -0
- package/src/components/admin/RolesFilterSelect.tsx +45 -0
- package/src/components/admin/RolesView.tsx +53 -14
- package/src/components/admin/UserRolesSelectField.tsx +50 -0
- package/src/components/admin/UsersView.tsx +41 -124
- package/src/components/app/Scaffold.tsx +1 -2
- package/src/components/common/default_entity_actions.tsx +119 -12
- package/src/components/field_configs.tsx +39 -3
- package/src/components/history/EntityHistoryEntry.tsx +1 -2
- package/src/components/history/EntityHistoryView.tsx +1 -2
- package/src/components/index.ts +2 -0
- package/src/data_export/export/BasicExportAction.tsx +35 -38
- package/src/data_export/export/ExportCollectionAction.tsx +39 -40
- package/src/data_import/components/DataNewPropertiesMapping.tsx +15 -2
- package/src/data_import/components/ImportFileUpload.tsx +1 -2
- package/src/data_import/components/ImportNewPropertyFieldPreview.tsx +1 -2
- package/src/data_import/import/ImportCollectionAction.tsx +21 -8
- package/src/data_import/utils/data.ts +23 -5
- package/src/data_import/utils/file_headers.ts +13 -89
- package/src/data_import/utils/file_to_json.ts +43 -68
- package/src/data_import/utils/transforms.ts +47 -0
- package/src/editor/components/SlashCommandMenu.tsx +17 -2
- package/src/editor/components/editor-bubble-item.tsx +1 -1
- package/src/editor/extensions/Image/index.ts +1 -1
- package/src/editor/extensions/Image.ts +1 -1
- package/src/editor/selectors/color-selector.tsx +1 -2
- package/src/editor/selectors/link-selector.tsx +1 -2
- package/src/editor/selectors/node-selector.tsx +16 -2
- package/src/editor/selectors/text-buttons.tsx +1 -2
- package/src/editor/utils/prosemirror-utils.ts +1 -1
- package/src/form/EntityForm.tsx +16 -6
- package/src/form/EntityFormActions.tsx +11 -3
- package/src/form/PropertyFieldBinding.tsx +5 -12
- package/src/form/components/FieldHelperText.tsx +1 -2
- package/src/form/components/LocalChangesMenu.tsx +17 -2
- package/src/form/components/StorageItemPreview.tsx +1 -2
- package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +1 -2
- package/src/form/field_bindings/KeyValueFieldBinding.tsx +17 -2
- package/src/form/field_bindings/MapFieldBinding.tsx +1 -1
- package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +10 -3
- package/src/form/field_bindings/MultiSelectFieldBinding.tsx +1 -2
- package/src/form/field_bindings/MultipleRelationFieldBinding.tsx +1 -2
- package/src/form/field_bindings/ReferenceAsStringFieldBinding.tsx +7 -7
- package/src/form/field_bindings/RelationFieldBinding.tsx +150 -147
- package/src/form/field_bindings/RepeatFieldBinding.tsx +1 -1
- package/src/form/field_bindings/SelectFieldBinding.tsx +1 -2
- package/src/form/field_bindings/TextFieldBinding.tsx +10 -2
- package/src/form/field_bindings/VectorFieldBinding.tsx +202 -0
- package/src/form/index.tsx +1 -0
- package/src/form/validation.ts +54 -2
- package/src/hooks/navigation/useBuildNavigationStateController.tsx +2 -1
- package/src/hooks/navigation/useResolvedViews.tsx +30 -15
- package/src/hooks/navigation/useTopLevelNavigation.ts +1 -1
- package/src/index.ts +6 -0
- package/src/preview/PropertyPreview.tsx +1 -1
- package/src/preview/components/ImagePreview.tsx +1 -1
- package/src/preview/components/UrlComponentPreview.tsx +1 -2
- package/src/preview/property_previews/ArrayOfMapsPreview.tsx +2 -2
- package/src/preview/property_previews/SkeletonPropertyComponent.tsx +23 -24
- package/src/routes/RebaseRoute.tsx +64 -35
- package/src/types/components/EntityFormActionsProps.tsx +1 -1
- package/src/types/components/EntityFormProps.tsx +3 -1
- package/src/types/fields.tsx +4 -3
- package/src/util/navigation_utils.ts +4 -3
- package/src/util/previews.ts +1 -1
- package/src/util/property_utils.tsx +22 -6
- package/src/util/resolutions.ts +2 -2
- package/dist/CollectionEditorDialog-MbvXGzEq.js.map +0 -1
- package/dist/CollectionsStudioView-D9X6aiAr.js.map +0 -1
- package/dist/ContentHomePage-CfVB1eUo.js.map +0 -1
- package/dist/ExportCollectionAction-CUwJg4F9.js.map +0 -1
- package/dist/ImportCollectionAction-DGa_SF_8.js.map +0 -1
- package/dist/PropertyEditView-C4nlYmAc.js.map +0 -1
- package/dist/RolesView-CNWxnR8e.js.map +0 -1
- package/dist/UsersView-YiTIcXkA.js.map +0 -1
- package/dist/index-CtzpHzMQ.js.map +0 -1
- package/dist/index-DKlrVD1m.js.map +0 -1
- package/dist/index-kHJXfLNI.js.map +0 -1
- package/dist/util-CwLmSpGp.js.map +0 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Button,
|
|
2
|
-
import { FilterXIcon } from "lucide-react";
|
|
1
|
+
import { Button, FilterXIcon, iconSize, Tooltip } from "@rebasepro/ui";
|
|
3
2
|
import { EntityTableController } from "@rebasepro/types";
|
|
4
3
|
import { useTranslation } from "@rebasepro/core";
|
|
5
4
|
|
|
@@ -4,10 +4,22 @@ import React from "react";
|
|
|
4
4
|
import { Link, useNavigate } from "react-router-dom";
|
|
5
5
|
import { RebaseLogo, LanguageToggle } from "@rebasepro/core";
|
|
6
6
|
import { ErrorBoundary , iconSize } from "@rebasepro/ui";
|
|
7
|
-
import {
|
|
8
|
-
|
|
7
|
+
import {
|
|
8
|
+
Avatar,
|
|
9
|
+
cls,
|
|
10
|
+
IconButton,
|
|
11
|
+
LogOutIcon,
|
|
12
|
+
Menu,
|
|
13
|
+
MenuItem,
|
|
14
|
+
MoonIcon,
|
|
15
|
+
SettingsIcon,
|
|
16
|
+
Skeleton,
|
|
17
|
+
SunIcon,
|
|
18
|
+
SunMoonIcon,
|
|
19
|
+
Typography
|
|
20
|
+
} from "@rebasepro/ui";
|
|
9
21
|
import { useAuthController, useLargeLayout, useModeController, useAdminModeController, useTranslation } from "@rebasepro/core";
|
|
10
|
-
import { useUrlController } from "../hooks";
|
|
22
|
+
import { useUrlController } from "../hooks/navigation/contexts/UrlContext";
|
|
11
23
|
import { User } from "@rebasepro/types";
|
|
12
24
|
import { useApp } from "./app/useApp";
|
|
13
25
|
import { useBreadcrumbsController } from "../hooks/useBreadcrumbsController";
|
|
@@ -2,13 +2,13 @@ import type { NavigationEntry, NavigationResult } from "@rebasepro/types";
|
|
|
2
2
|
import React, { useMemo } from "react";
|
|
3
3
|
|
|
4
4
|
import { useCollapsedGroups, buildCollapsedDefaults, useLargeLayout, useAdminModeController, useTranslation, useSlot, useRebaseContext, useAnalyticsController, useRebaseRegistry } from "@rebasepro/core";
|
|
5
|
-
import {
|
|
5
|
+
import { useUrlController } from "../hooks/navigation/contexts/UrlContext";
|
|
6
|
+
import { useNavigationStateController } from "../hooks/navigation/contexts/NavigationStateContext";
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
import { Link, useNavigate } from "react-router-dom";
|
|
9
10
|
import { AnalyticsEvent } from "@rebasepro/types";
|
|
10
|
-
import { cls, Tooltip, Typography
|
|
11
|
-
import { ChevronsLeftIcon, ChevronsRightIcon } from "lucide-react";
|
|
11
|
+
import { ChevronsLeftIcon, ChevronsRightIcon, cls, iconSize, Tooltip, Typography } from "@rebasepro/ui";
|
|
12
12
|
import { DrawerNavigationGroup } from "./DrawerNavigationGroup";
|
|
13
13
|
import { RebaseLogo } from "@rebasepro/core";
|
|
14
14
|
import { useApp } from "./app/useApp";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { NavigationEntry } from "@rebasepro/types";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { cls, iconSize, Typography } from "@rebasepro/ui";
|
|
4
|
-
import { ChevronDownIcon } from "lucide-react";
|
|
3
|
+
import { ChevronDownIcon, cls, iconSize, Typography } from "@rebasepro/ui";
|
|
5
4
|
;
|
|
6
5
|
import { IconForView } from "@rebasepro/core";
|
|
7
6
|
import { DrawerNavigationItem } from "./DrawerNavigationItem";
|
|
@@ -3,12 +3,21 @@ import type { EntityAction } from "@rebasepro/types";
|
|
|
3
3
|
import React, { MouseEvent, useCallback } from "react";
|
|
4
4
|
|
|
5
5
|
import { CollectionSize, Entity, SelectionController } from "@rebasepro/types";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import {
|
|
7
|
+
Badge,
|
|
8
|
+
Checkbox,
|
|
9
|
+
cls,
|
|
10
|
+
IconButton,
|
|
11
|
+
Menu,
|
|
12
|
+
MenuItem,
|
|
13
|
+
MoreVerticalIcon,
|
|
14
|
+
Skeleton,
|
|
15
|
+
Tooltip
|
|
16
|
+
} from "@rebasepro/ui";
|
|
17
|
+
import { useTranslation } from "@rebasepro/core";
|
|
9
18
|
import { getEntityFromCache } from "@rebasepro/core";
|
|
10
19
|
import { getLocalChangesBackup } from "@rebasepro/common";
|
|
11
|
-
import {
|
|
20
|
+
import { useCMSContext } from "../../index";
|
|
12
21
|
|
|
13
22
|
/**
|
|
14
23
|
*
|
|
@@ -60,7 +69,7 @@ export const EntityCollectionRowActions = function EntityCollectionRowActions({
|
|
|
60
69
|
selectionController?: SelectionController;
|
|
61
70
|
highlightEntity?: (entity: Entity<any>) => void;
|
|
62
71
|
unhighlightEntity?: (entity: Entity<any>) => void;
|
|
63
|
-
openEntityMode: "side_panel" | "full_screen" | "split";
|
|
72
|
+
openEntityMode: "side_panel" | "full_screen" | "split" | "dialog";
|
|
64
73
|
// Sortable props for dnd-kit integration
|
|
65
74
|
sortableNodeRef?: (node: HTMLElement | null) => void;
|
|
66
75
|
sortableStyle?: React.CSSProperties;
|
|
@@ -69,7 +78,6 @@ export const EntityCollectionRowActions = function EntityCollectionRowActions({
|
|
|
69
78
|
isDraggable?: boolean;
|
|
70
79
|
}) {
|
|
71
80
|
|
|
72
|
-
const largeLayout = useLargeLayout();
|
|
73
81
|
|
|
74
82
|
const context = useCMSContext();
|
|
75
83
|
const sideEntityCtrl = context.sideEntityController;
|
|
@@ -91,8 +99,10 @@ export const EntityCollectionRowActions = function EntityCollectionRowActions({
|
|
|
91
99
|
const content = (
|
|
92
100
|
<div
|
|
93
101
|
className={cls(
|
|
94
|
-
"h-full flex items-center justify-center flex-col
|
|
95
|
-
|
|
102
|
+
"h-full flex items-center justify-center flex-col z-10",
|
|
103
|
+
isSelected
|
|
104
|
+
? "bg-surface-accent-50 dark:bg-surface-accent-900"
|
|
105
|
+
: "bg-surface-50/90 dark:bg-surface-900/90",
|
|
96
106
|
frozen ? "sticky left-0" : ""
|
|
97
107
|
)}
|
|
98
108
|
onClick={useCallback((event: React.MouseEvent) => {
|
|
@@ -219,7 +229,7 @@ export const EntityCollectionRowActions = function EntityCollectionRowActions({
|
|
|
219
229
|
style={sortableStyle}
|
|
220
230
|
className={cls(
|
|
221
231
|
"flex-shrink-0",
|
|
222
|
-
frozen && "sticky left-0 z-10 bg-white dark:bg-surface-
|
|
232
|
+
frozen && "sticky left-0 z-10 bg-white dark:bg-surface-900"
|
|
223
233
|
)}
|
|
224
234
|
{...sortableAttrsWithoutTabIndex}
|
|
225
235
|
>
|
|
@@ -213,7 +213,7 @@ export const EntityCollectionTable = function EntityCollectionTable<M extends Re
|
|
|
213
213
|
: <>
|
|
214
214
|
{additionalField.value?.({
|
|
215
215
|
entity,
|
|
216
|
-
context: context as
|
|
216
|
+
context: context as RebaseContext
|
|
217
217
|
})?.toString()}
|
|
218
218
|
</>;
|
|
219
219
|
|
|
@@ -350,7 +350,7 @@ export const EntityCollectionTable = function EntityCollectionTable<M extends Re
|
|
|
350
350
|
|
|
351
351
|
<div ref={ref}
|
|
352
352
|
style={style}
|
|
353
|
-
className={cls("h-full w-full flex flex-col bg-white dark:bg-surface-
|
|
353
|
+
className={cls("h-full w-full flex flex-col bg-white dark:bg-surface-900", className)}>
|
|
354
354
|
|
|
355
355
|
{!hideToolbar && <CollectionTableToolbar
|
|
356
356
|
onTextSearch={onTextSearch}
|
|
@@ -146,7 +146,7 @@ export type EntityCollectionTableProps<M extends Record<string, unknown>,
|
|
|
146
146
|
|
|
147
147
|
enablePopupIcon: boolean;
|
|
148
148
|
|
|
149
|
-
openEntityMode?: "side_panel" | "full_screen" | "split";
|
|
149
|
+
openEntityMode?: "side_panel" | "full_screen" | "split" | "dialog";
|
|
150
150
|
|
|
151
151
|
/**
|
|
152
152
|
* Callback when columns are reordered via drag-and-drop
|
|
@@ -3,8 +3,7 @@ import type { EntityCollection } from "@rebasepro/types";
|
|
|
3
3
|
import React, { useCallback } from "react";
|
|
4
4
|
import { deepEqual as equal } from "fast-equals";
|
|
5
5
|
|
|
6
|
-
import { cls } from "@rebasepro/ui";
|
|
7
|
-
import { PencilIcon } from "lucide-react";
|
|
6
|
+
import { cls, PencilIcon } from "@rebasepro/ui";
|
|
8
7
|
import { getRelationFrom, normalizeToEntityRelation } from "@rebasepro/common";
|
|
9
8
|
|
|
10
9
|
import { RelationPreview } from "../../../preview";
|
|
@@ -9,8 +9,7 @@ import { CollectionSize, Entity, EntityReference, FilterValues } from "@rebasepr
|
|
|
9
9
|
import { getPreviewSizeFrom } from "../../../preview/util";
|
|
10
10
|
import { useCustomizationController } from "@rebasepro/core";
|
|
11
11
|
import { ErrorView } from "@rebasepro/core";
|
|
12
|
-
import { cls } from "@rebasepro/ui";
|
|
13
|
-
import { PencilIcon } from "lucide-react";
|
|
12
|
+
import { cls, PencilIcon } from "@rebasepro/ui";
|
|
14
13
|
import { EntityPreviewContainer } from "../../EntityPreview";
|
|
15
14
|
import { getReferenceFrom } from "@rebasepro/common";
|
|
16
15
|
import { useCollectionRegistryController } from "../../../index";
|
|
@@ -9,8 +9,7 @@ import { CollectionSize, Entity, EntityRelation, FilterValues, Relation } from "
|
|
|
9
9
|
import { getPreviewSizeFrom } from "../../../preview/util";
|
|
10
10
|
import { } from "@rebasepro/core";
|
|
11
11
|
import { ErrorView } from "@rebasepro/core";
|
|
12
|
-
import { cls } from "@rebasepro/ui";
|
|
13
|
-
import { PencilIcon } from "lucide-react";
|
|
12
|
+
import { cls, PencilIcon } from "@rebasepro/ui";
|
|
14
13
|
import { EntityPreviewContainer } from "../../EntityPreview";
|
|
15
14
|
import { getRelationFrom, normalizeToEntityRelation } from "@rebasepro/common";
|
|
16
15
|
import { TableMultipleRelationField } from "./TableMultipleRelationField";
|
|
@@ -7,11 +7,10 @@ import { PreviewSize } from "../../../types";
|
|
|
7
7
|
import { useDropzone } from "react-dropzone";
|
|
8
8
|
import { PropertyPreview } from "../../../preview";
|
|
9
9
|
import { ErrorBoundary } from "@rebasepro/ui";
|
|
10
|
-
import { PencilIcon } from "
|
|
10
|
+
import { cls, IconButton, PencilIcon, Typography } from "@rebasepro/ui";
|
|
11
11
|
import { useSnackbarController, useStorageSource, useTranslation, StorageFieldItem, useStorageUploadController } from "@rebasepro/core";
|
|
12
12
|
import { getThumbnailMeasure } from "../../../preview/util";
|
|
13
13
|
import { StorageUploadProgress } from "../../../form/components/StorageUploadProgress";
|
|
14
|
-
import { cls, IconButton, Typography } from "@rebasepro/ui";
|
|
15
14
|
import { EntityTableCellActions } from "../internal/EntityTableCellActions";
|
|
16
15
|
|
|
17
16
|
const dropZoneClasses = "max-w-full box-border relative pt-[2px] items-center border border-transparent outline-hidden rounded-md duration-200 ease-[cubic-bezier(0.4,0,0.2,1)] focus:border-primary-solid";
|
|
@@ -40,7 +40,6 @@ export function VirtualTableSelect(props: {
|
|
|
40
40
|
}, [focused, ref]);
|
|
41
41
|
|
|
42
42
|
const onChange = useCallback((updatedValue: string | string[]) => {
|
|
43
|
-
console.trace("onChange");
|
|
44
43
|
if (valueType === "number") {
|
|
45
44
|
if (multiple) {
|
|
46
45
|
const newValue = (updatedValue as string[]).map((v) => parseFloat(v));
|
|
@@ -49,15 +49,10 @@ export function CollectionTableToolbar({
|
|
|
49
49
|
<div
|
|
50
50
|
className={cls(defaultBorderMixin, "no-scrollbar min-h-[52px] overflow-x-auto px-2 md:px-4 bg-surface-50 dark:bg-surface-900 border-b flex flex-row justify-between items-center w-full")}>
|
|
51
51
|
|
|
52
|
-
<div className="flex items-center gap-1 md:mr-4 mr-2">
|
|
52
|
+
<div className="flex items-center gap-1 md:mr-4 mr-2 min-w-0">
|
|
53
53
|
|
|
54
54
|
{/* View toggle — hidden in compact */}
|
|
55
|
-
|
|
56
|
-
"transition-all duration-300 ease-out overflow-hidden",
|
|
57
|
-
compact ? "max-w-0 opacity-0" : "max-w-[200px] opacity-100"
|
|
58
|
-
)}>
|
|
59
|
-
{viewModeToggle}
|
|
60
|
-
</div>
|
|
55
|
+
{!compact && viewModeToggle}
|
|
61
56
|
|
|
62
57
|
{title && <div className={"flex items-center"}>
|
|
63
58
|
{title}
|
|
@@ -70,28 +65,21 @@ export function CollectionTableToolbar({
|
|
|
70
65
|
<div className="flex items-center gap-1">
|
|
71
66
|
|
|
72
67
|
{/* Loading spinner — hidden in compact */}
|
|
73
|
-
{largeLayout &&
|
|
74
|
-
"mr-4
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
<CircularProgress size={"smallest"}/>}
|
|
79
|
-
</div>}
|
|
68
|
+
{largeLayout && !compact && loading && (
|
|
69
|
+
<div className="mr-4">
|
|
70
|
+
<CircularProgress size={"smallest"}/>
|
|
71
|
+
</div>
|
|
72
|
+
)}
|
|
80
73
|
|
|
81
74
|
{/* Search bar — hidden in compact */}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
placeholder={t("search")}
|
|
91
|
-
onTextSearch={onTextSearch}
|
|
92
|
-
expandable={true}
|
|
93
|
-
initialValue={initialSearchText}/>}
|
|
94
|
-
</div>
|
|
75
|
+
{!compact && onTextSearch &&
|
|
76
|
+
<SearchBar
|
|
77
|
+
key={"search-bar"}
|
|
78
|
+
size={"small"}
|
|
79
|
+
placeholder={t("search")}
|
|
80
|
+
onTextSearch={onTextSearch}
|
|
81
|
+
expandable={true}
|
|
82
|
+
initialValue={initialSearchText}/>}
|
|
95
83
|
|
|
96
84
|
{/* Secondary actions — always inline */}
|
|
97
85
|
<div className="flex items-center gap-1">
|
|
@@ -3,8 +3,7 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from "react"
|
|
|
3
3
|
import useMeasure from "react-use-measure";
|
|
4
4
|
|
|
5
5
|
import { cls, Tooltip , iconSize } from "@rebasepro/ui";
|
|
6
|
-
import { MinusCircleIcon } from "
|
|
7
|
-
import { ErrorBoundary } from "@rebasepro/ui";
|
|
6
|
+
import { ErrorBoundary, MinusCircleIcon } from "@rebasepro/ui";
|
|
8
7
|
import { getRowHeight, TableSize } from "@rebasepro/core";
|
|
9
8
|
import { ErrorTooltip } from "@rebasepro/core";
|
|
10
9
|
|
|
@@ -204,7 +203,7 @@ export const EntityTableCell = React.memo<EntityTableCellProps>(
|
|
|
204
203
|
`flex relative h-full rounded-md p-${p} border-4`,
|
|
205
204
|
showSaved ? "bg-primary/20 dark:bg-primary/20" : (onHover && !disabled ? "bg-surface-50 dark:bg-surface-900" : ""),
|
|
206
205
|
hideOverflow ? "overflow-hidden" : "",
|
|
207
|
-
isSelected && !showSaved ? "bg-surface-accent-50 dark:bg-surface-accent-
|
|
206
|
+
isSelected && !showSaved ? "bg-surface-accent-50 dark:bg-surface-accent-900" : "",
|
|
208
207
|
borderClass
|
|
209
208
|
)}
|
|
210
209
|
ref={ref}
|
|
@@ -265,7 +264,7 @@ export const EntityTableCell = React.memo<EntityTableCellProps>(
|
|
|
265
264
|
style={sortableStyle}
|
|
266
265
|
className={cls(
|
|
267
266
|
"flex-shrink-0",
|
|
268
|
-
frozen && "sticky left-0 z-10 bg-white dark:bg-surface-
|
|
267
|
+
frozen && "sticky left-0 z-10 bg-white dark:bg-surface-900"
|
|
269
268
|
)}
|
|
270
269
|
{...sortableAttrsWithoutTabIndex}
|
|
271
270
|
>
|
|
@@ -4,7 +4,7 @@ import type { FormContext, PropertyFieldBindingProps } from "../../../../types/f
|
|
|
4
4
|
import type { Property } from "@rebasepro/types";
|
|
5
5
|
import React, { useCallback, useEffect, useLayoutEffect, useMemo, useState } from "react";
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import { Button, DialogActions, IconButton, Portal, Typography, XIcon } from "@rebasepro/ui";
|
|
8
8
|
|
|
9
9
|
import { Entity, EntityValues } from "@rebasepro/types";
|
|
10
10
|
import { PluginProviderStack } from "@rebasepro/core";
|
|
@@ -13,8 +13,6 @@ import { useDraggable } from "./useDraggable";
|
|
|
13
13
|
import { CustomFieldValidator, getEntitySchema } from "../../../../form/validation";
|
|
14
14
|
import { useWindowSize } from "./useWindowSize";
|
|
15
15
|
import { getPropertyInPath } from "../../../../util/property_utils";
|
|
16
|
-
import { Button, DialogActions, IconButton, Typography } from "@rebasepro/ui";
|
|
17
|
-
import { XIcon } from "lucide-react";
|
|
18
16
|
import { PropertyFieldBinding, zodToFormErrors } from "../../../../form";
|
|
19
17
|
import { useAuthController, useCustomizationController, useData, useRebaseContext } from "@rebasepro/core";
|
|
20
18
|
import type { OnCellValueChangeParams } from "@rebasepro/core";
|
|
@@ -61,7 +59,7 @@ export function PopupFormFieldLoading<M extends Record<string, unknown>>({
|
|
|
61
59
|
const [entity, setEntity] = useState<Entity<M> | undefined>(undefined);
|
|
62
60
|
useEffect(() => {
|
|
63
61
|
if (entityId && inputCollection) {
|
|
64
|
-
dataClient.collection(path).findById(entityId).then(setEntity as
|
|
62
|
+
dataClient.collection(path).findById(entityId).then((result) => setEntity(result as Entity<M> | undefined));
|
|
65
63
|
}
|
|
66
64
|
}, [entityId, inputCollection, dataClient, path]);
|
|
67
65
|
|
|
@@ -409,7 +407,7 @@ export function PopupFormFieldInternal<M extends Record<string, unknown>>({
|
|
|
409
407
|
return (
|
|
410
408
|
<Portal.Root asChild
|
|
411
409
|
container={container}>
|
|
412
|
-
<Formex value={formex as
|
|
410
|
+
<Formex value={formex as FormexController<Record<string, unknown>>}>
|
|
413
411
|
{draggable}
|
|
414
412
|
</Formex>
|
|
415
413
|
</Portal.Root>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { ArrayProperty, Entity, EntityReference, EntityRelation, NumberProperty, Property, StringProperty } from "@rebasepro/types";
|
|
2
|
+
import { ArrayProperty, DateProperty, Entity, EntityReference, EntityRelation, NumberProperty, Property, ReferenceProperty, RelationProperty, StringProperty } from "@rebasepro/types";
|
|
3
3
|
|
|
4
4
|
import { VirtualTableInput } from "./fields/VirtualTableInput";
|
|
5
5
|
import { VirtualTableSelect } from "./fields/VirtualTableSelect";
|
|
@@ -64,10 +64,11 @@ export function getTableBindingForProperty(
|
|
|
64
64
|
|
|
65
65
|
if (property.type === "string" && (property as StringProperty).reference?.path) {
|
|
66
66
|
return {
|
|
67
|
-
Component: ({ propertyKey, property, internalValue, updateValue, disabled, size, path }) => {
|
|
68
|
-
const referenceProperty = (property as StringProperty).reference
|
|
67
|
+
Component: ({ propertyKey, property, internalValue, updateValue, disabled, size, path }: TableFieldBindingProps) => {
|
|
68
|
+
const referenceProperty = (property as StringProperty).reference;
|
|
69
|
+
if (!referenceProperty) return null;
|
|
69
70
|
const referenceValue = internalValue ? new EntityReference({ id: internalValue as string,
|
|
70
|
-
path: referenceProperty.path as string }) : undefined;
|
|
71
|
+
path: referenceProperty.path as string }) : undefined;
|
|
71
72
|
return (
|
|
72
73
|
<TableReferenceField
|
|
73
74
|
name={propertyKey}
|
|
@@ -77,7 +78,7 @@ path: referenceProperty.path as string }) : undefined;
|
|
|
77
78
|
size={size}
|
|
78
79
|
path={referenceProperty.path as string}
|
|
79
80
|
multiselect={false}
|
|
80
|
-
previewProperties={referenceProperty.previewProperties}
|
|
81
|
+
previewProperties={referenceProperty.ui?.previewProperties}
|
|
81
82
|
includeId={referenceProperty.includeId}
|
|
82
83
|
includeEntityLink={referenceProperty.includeEntityLink}
|
|
83
84
|
title={property.name}
|
|
@@ -89,14 +90,14 @@ path: referenceProperty.path as string }) : undefined;
|
|
|
89
90
|
};
|
|
90
91
|
} else if (isAStorageProperty) {
|
|
91
92
|
return {
|
|
92
|
-
Component: ({ validationError, error, disabled, selected, openPopup, property, entity, path, internalValue, size, updateValue, propertyKey }:
|
|
93
|
+
Component: ({ validationError, error, disabled, selected, openPopup, property, entity, path, internalValue, size, updateValue, propertyKey }: TableFieldBindingProps) => (
|
|
93
94
|
<TableStorageUpload
|
|
94
95
|
error={validationError ?? error}
|
|
95
96
|
disabled={disabled}
|
|
96
97
|
focused={selected}
|
|
97
98
|
selected={selected}
|
|
98
99
|
openPopup={openPopup}
|
|
99
|
-
property={property as
|
|
100
|
+
property={property as StringProperty | ArrayProperty}
|
|
100
101
|
entity={entity}
|
|
101
102
|
path={path}
|
|
102
103
|
value={internalValue}
|
|
@@ -114,7 +115,7 @@ path: referenceProperty.path as string }) : undefined;
|
|
|
114
115
|
const numberProperty = property as NumberProperty;
|
|
115
116
|
if (numberProperty.enum) {
|
|
116
117
|
return {
|
|
117
|
-
Component: ({ propertyKey, disabled, selected, size, error, validationError, internalValue, updateValue }:
|
|
118
|
+
Component: ({ propertyKey, disabled, selected, size, error, validationError, internalValue, updateValue }: TableFieldBindingProps) => (
|
|
118
119
|
<VirtualTableSelect
|
|
119
120
|
name={propertyKey}
|
|
120
121
|
multiple={false}
|
|
@@ -132,7 +133,7 @@ path: referenceProperty.path as string }) : undefined;
|
|
|
132
133
|
};
|
|
133
134
|
} else {
|
|
134
135
|
return {
|
|
135
|
-
Component: ({ align, error, validationError, selected, disabled, internalValue, updateValue }:
|
|
136
|
+
Component: ({ align, error, validationError, selected, disabled, internalValue, updateValue }: TableFieldBindingProps) => (
|
|
136
137
|
<VirtualTableNumberInput
|
|
137
138
|
align={align}
|
|
138
139
|
error={validationError ?? error}
|
|
@@ -149,7 +150,7 @@ path: referenceProperty.path as string }) : undefined;
|
|
|
149
150
|
const stringProperty = property as StringProperty;
|
|
150
151
|
if (stringProperty.enum) {
|
|
151
152
|
return {
|
|
152
|
-
Component: ({ propertyKey, disabled, selected, size, error, validationError, internalValue, updateValue }:
|
|
153
|
+
Component: ({ propertyKey, disabled, selected, size, error, validationError, internalValue, updateValue }: TableFieldBindingProps) => (
|
|
153
154
|
<VirtualTableSelect
|
|
154
155
|
name={propertyKey}
|
|
155
156
|
multiple={false}
|
|
@@ -167,7 +168,7 @@ path: referenceProperty.path as string }) : undefined;
|
|
|
167
168
|
};
|
|
168
169
|
} else if (stringProperty.userSelect) {
|
|
169
170
|
return {
|
|
170
|
-
Component: ({ propertyKey, disabled, selected, size, error, validationError, internalValue, updateValue }:
|
|
171
|
+
Component: ({ propertyKey, disabled, selected, size, error, validationError, internalValue, updateValue }: TableFieldBindingProps) => (
|
|
171
172
|
<VirtualTableUserSelect
|
|
172
173
|
name={propertyKey}
|
|
173
174
|
multiple={false}
|
|
@@ -184,7 +185,7 @@ path: referenceProperty.path as string }) : undefined;
|
|
|
184
185
|
} else if (stringProperty.ui?.markdown || !stringProperty.storage || !stringProperty.reference) {
|
|
185
186
|
const multiline = Boolean(stringProperty.ui?.multiline) || Boolean(stringProperty.ui?.markdown);
|
|
186
187
|
return {
|
|
187
|
-
Component: ({ error, validationError, disabled, selected, internalValue, updateValue }:
|
|
188
|
+
Component: ({ error, validationError, disabled, selected, internalValue, updateValue }: TableFieldBindingProps) => (
|
|
188
189
|
<VirtualTableInput
|
|
189
190
|
error={validationError ?? error}
|
|
190
191
|
disabled={disabled}
|
|
@@ -199,7 +200,7 @@ path: referenceProperty.path as string }) : undefined;
|
|
|
199
200
|
}
|
|
200
201
|
} else if (property.type === "boolean") {
|
|
201
202
|
return {
|
|
202
|
-
Component: ({ error, validationError, disabled, selected, internalValue, updateValue }:
|
|
203
|
+
Component: ({ error, validationError, disabled, selected, internalValue, updateValue }: TableFieldBindingProps) => (
|
|
203
204
|
<VirtualTableSwitch
|
|
204
205
|
error={validationError ?? error}
|
|
205
206
|
disabled={disabled}
|
|
@@ -211,12 +212,12 @@ path: referenceProperty.path as string }) : undefined;
|
|
|
211
212
|
};
|
|
212
213
|
} else if (property.type === "date") {
|
|
213
214
|
return {
|
|
214
|
-
Component: ({ propertyKey, error, validationError, disabled, selected, property, internalValue, updateValue }:
|
|
215
|
+
Component: ({ propertyKey, error, validationError, disabled, selected, property, internalValue, updateValue }: TableFieldBindingProps) => (
|
|
215
216
|
<VirtualTableDateField
|
|
216
217
|
name={propertyKey}
|
|
217
218
|
error={validationError ?? error}
|
|
218
219
|
disabled={disabled}
|
|
219
|
-
mode={property.mode}
|
|
220
|
+
mode={(property as DateProperty).mode}
|
|
220
221
|
focused={selected}
|
|
221
222
|
internalValue={internalValue as Date}
|
|
222
223
|
updateValue={updateValue}
|
|
@@ -227,30 +228,32 @@ path: referenceProperty.path as string }) : undefined;
|
|
|
227
228
|
allowScroll: false
|
|
228
229
|
};
|
|
229
230
|
} else if (property.type === "reference") {
|
|
230
|
-
if (
|
|
231
|
+
if ((property as ReferenceProperty).path) {
|
|
231
232
|
return {
|
|
232
|
-
Component: ({ propertyKey, internalValue, updateValue, disabled, size, property }:
|
|
233
|
+
Component: ({ propertyKey, internalValue, updateValue, disabled, size, property }: TableFieldBindingProps) => {
|
|
234
|
+
return (
|
|
233
235
|
<TableReferenceField
|
|
234
236
|
name={propertyKey}
|
|
235
237
|
internalValue={internalValue as EntityReference}
|
|
236
238
|
updateValue={updateValue}
|
|
237
239
|
disabled={disabled}
|
|
238
240
|
size={size}
|
|
239
|
-
path={property.path}
|
|
241
|
+
path={(property as ReferenceProperty).path!}
|
|
240
242
|
multiselect={false}
|
|
241
|
-
previewProperties={property.ui?.previewProperties}
|
|
242
|
-
includeId={property.includeId}
|
|
243
|
-
includeEntityLink={property.includeEntityLink}
|
|
243
|
+
previewProperties={(property as ReferenceProperty).ui?.previewProperties}
|
|
244
|
+
includeId={(property as ReferenceProperty).includeId}
|
|
245
|
+
includeEntityLink={(property as ReferenceProperty).includeEntityLink}
|
|
244
246
|
title={property.name ?? propertyKey}
|
|
245
|
-
fixedFilter={property.fixedFilter}
|
|
247
|
+
fixedFilter={(property as ReferenceProperty).fixedFilter}
|
|
246
248
|
/>
|
|
247
|
-
|
|
249
|
+
);
|
|
250
|
+
},
|
|
248
251
|
allowScroll: false
|
|
249
252
|
};
|
|
250
253
|
}
|
|
251
254
|
} else if (property.type === "relation") {
|
|
252
|
-
if (property.relation) {
|
|
253
|
-
if (property.ui?.widget === "dialog") {
|
|
255
|
+
if ((property as RelationProperty).relation) {
|
|
256
|
+
if ((property as RelationProperty).ui?.widget === "dialog") {
|
|
254
257
|
return {
|
|
255
258
|
Component: RelationDialogBindingComponent,
|
|
256
259
|
allowScroll: false
|
|
@@ -268,11 +271,11 @@ path: referenceProperty.path as string }) : undefined;
|
|
|
268
271
|
if (!arrayProperty.of && !arrayProperty.oneOf) {
|
|
269
272
|
throw Error("You need to specify an 'of' or 'oneOf' prop (or specify a custom field) in your array property");
|
|
270
273
|
} else if (arrayProperty.of && !Array.isArray(arrayProperty.of)) {
|
|
271
|
-
const ofProp = arrayProperty.of as
|
|
274
|
+
const ofProp = arrayProperty.of as Property;
|
|
272
275
|
if (ofProp.type === "string" || ofProp.type === "number") {
|
|
273
276
|
if (selected && ofProp.enum) {
|
|
274
277
|
return {
|
|
275
|
-
Component: ({ propertyKey, disabled, selected, size, error, validationError, internalValue, updateValue }:
|
|
278
|
+
Component: ({ propertyKey, disabled, selected, size, error, validationError, internalValue, updateValue }: TableFieldBindingProps) => (
|
|
276
279
|
<VirtualTableSelect
|
|
277
280
|
name={propertyKey}
|
|
278
281
|
multiple={true}
|
|
@@ -280,7 +283,7 @@ path: referenceProperty.path as string }) : undefined;
|
|
|
280
283
|
focused={selected}
|
|
281
284
|
small={getPreviewSizeFrom(size) !== "medium"}
|
|
282
285
|
valueType={ofProp.type}
|
|
283
|
-
enumValues={ofProp.enum}
|
|
286
|
+
enumValues={ofProp.enum!}
|
|
284
287
|
error={validationError ?? error}
|
|
285
288
|
internalValue={internalValue as string | number}
|
|
286
289
|
updateValue={updateValue}
|
|
@@ -292,9 +295,10 @@ path: referenceProperty.path as string }) : undefined;
|
|
|
292
295
|
};
|
|
293
296
|
}
|
|
294
297
|
} else if (ofProp.type === "reference") {
|
|
295
|
-
|
|
298
|
+
const refOfProp = ofProp as ReferenceProperty;
|
|
299
|
+
if (refOfProp.path) {
|
|
296
300
|
return {
|
|
297
|
-
Component: ({ propertyKey, disabled, internalValue, updateValue, size }:
|
|
301
|
+
Component: ({ propertyKey, disabled, internalValue, updateValue, size }: TableFieldBindingProps) => (
|
|
298
302
|
<TableReferenceField
|
|
299
303
|
name={propertyKey}
|
|
300
304
|
disabled={disabled}
|
|
@@ -302,12 +306,12 @@ path: referenceProperty.path as string }) : undefined;
|
|
|
302
306
|
updateValue={updateValue}
|
|
303
307
|
size={size}
|
|
304
308
|
multiselect={true}
|
|
305
|
-
path={
|
|
306
|
-
previewProperties={
|
|
309
|
+
path={refOfProp.path!}
|
|
310
|
+
previewProperties={refOfProp.ui?.previewProperties}
|
|
307
311
|
title={arrayProperty.name}
|
|
308
|
-
fixedFilter={
|
|
309
|
-
includeId={
|
|
310
|
-
includeEntityLink={
|
|
312
|
+
fixedFilter={refOfProp.fixedFilter}
|
|
313
|
+
includeId={refOfProp.includeId}
|
|
314
|
+
includeEntityLink={refOfProp.includeEntityLink}
|
|
311
315
|
/>
|
|
312
316
|
),
|
|
313
317
|
allowScroll: false
|
|
@@ -321,7 +325,8 @@ path: referenceProperty.path as string }) : undefined;
|
|
|
321
325
|
}
|
|
322
326
|
|
|
323
327
|
/** Stable component for relation fields rendered with the dialog widget */
|
|
324
|
-
function RelationDialogBindingComponent({ propertyKey, internalValue, updateValue, disabled, size, property }:
|
|
328
|
+
function RelationDialogBindingComponent({ propertyKey, internalValue, updateValue, disabled, size, property }: TableFieldBindingProps) {
|
|
329
|
+
const relProp = property as RelationProperty;
|
|
325
330
|
return (
|
|
326
331
|
<TableRelationField
|
|
327
332
|
name={propertyKey}
|
|
@@ -330,18 +335,19 @@ function RelationDialogBindingComponent({ propertyKey, internalValue, updateValu
|
|
|
330
335
|
disabled={disabled}
|
|
331
336
|
size={size}
|
|
332
337
|
multiselect={false}
|
|
333
|
-
relation={
|
|
334
|
-
previewProperties={
|
|
335
|
-
includeId={
|
|
336
|
-
includeEntityLink={
|
|
337
|
-
title={
|
|
338
|
-
fixedFilter={
|
|
338
|
+
relation={relProp.relation!}
|
|
339
|
+
previewProperties={relProp.ui?.previewProperties}
|
|
340
|
+
includeId={relProp.includeId}
|
|
341
|
+
includeEntityLink={relProp.includeEntityLink}
|
|
342
|
+
title={relProp.name ?? propertyKey}
|
|
343
|
+
fixedFilter={relProp.fixedFilter}
|
|
339
344
|
/>
|
|
340
345
|
);
|
|
341
346
|
}
|
|
342
347
|
|
|
343
348
|
/** Stable component for relation fields rendered with the inline selector */
|
|
344
|
-
function RelationSelectorBindingComponent({ propertyKey, internalValue, updateValue, disabled, property }:
|
|
349
|
+
function RelationSelectorBindingComponent({ propertyKey, internalValue, updateValue, disabled, property }: TableFieldBindingProps) {
|
|
350
|
+
const relProp = property as RelationProperty;
|
|
345
351
|
return (
|
|
346
352
|
<TableRelationSelectorField
|
|
347
353
|
name={propertyKey}
|
|
@@ -349,8 +355,8 @@ function RelationSelectorBindingComponent({ propertyKey, internalValue, updateVa
|
|
|
349
355
|
updateValue={updateValue}
|
|
350
356
|
disabled={disabled}
|
|
351
357
|
size={"small"}
|
|
352
|
-
relation={
|
|
353
|
-
fixedFilter={
|
|
358
|
+
relation={relProp.relation!}
|
|
359
|
+
fixedFilter={relProp.fixedFilter}
|
|
354
360
|
/>
|
|
355
361
|
);
|
|
356
362
|
}
|
|
@@ -148,7 +148,6 @@ export function Board<M extends Record<string, unknown>, COLUMN extends string>(
|
|
|
148
148
|
}
|
|
149
149
|
return updated;
|
|
150
150
|
});
|
|
151
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
152
151
|
}, [data, columnsProp, assignColumn]);
|
|
153
152
|
|
|
154
153
|
const findColumnByItemId = (id: string): string | undefined => {
|
|
@@ -328,7 +327,7 @@ export function Board<M extends Record<string, unknown>, COLUMN extends string>(
|
|
|
328
327
|
const overColumn = findColumnByItemId(overId) || currentColumn;
|
|
329
328
|
|
|
330
329
|
|
|
331
|
-
|
|
330
|
+
const finalItemMapState = { ...itemMapState };
|
|
332
331
|
|
|
333
332
|
if (currentColumn && currentColumn === overColumn) {
|
|
334
333
|
// Use dnd-kit's sortable indexes if available to avoid race conditions with mutating handleDragOver
|