@rebasepro/admin 0.2.3 → 0.2.5
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/dist/{CollectionEditorDialog-CmGXXSY9.js → CollectionEditorDialog-Cn8-tGyL.js} +89 -79
- package/dist/CollectionEditorDialog-Cn8-tGyL.js.map +1 -0
- package/dist/{CollectionsStudioView-DcLHT5bU.js → CollectionsStudioView-C-Ts1rZt.js} +5 -4
- package/dist/{CollectionsStudioView-DcLHT5bU.js.map → CollectionsStudioView-C-Ts1rZt.js.map} +1 -1
- package/dist/{ExportCollectionAction-BfN34eWX.js → ExportCollectionAction-BRdKM3DF.js} +4 -3
- package/dist/ExportCollectionAction-BRdKM3DF.js.map +1 -0
- package/dist/{ImportCollectionAction-SZrInjhx.js → ImportCollectionAction-U-v7lGxO.js} +3 -2
- package/dist/{ImportCollectionAction-SZrInjhx.js.map → ImportCollectionAction-U-v7lGxO.js.map} +1 -1
- package/dist/{PropertyEditView-Cvryrb3B.js → PropertyEditView-BDNYkfNf.js} +128 -121
- package/dist/PropertyEditView-BDNYkfNf.js.map +1 -0
- package/dist/collection_editor/ConfigControllerProvider.d.ts +0 -5
- package/dist/collection_editor/index.d.ts +0 -1
- package/dist/collection_editor/types/collection_editor_controller.d.ts +0 -2
- package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.d.ts +3 -3
- package/dist/collection_editor_ui.js +3 -3
- package/dist/components/ArrayContainer.d.ts +2 -2
- package/dist/components/DefaultAppBar.d.ts +18 -1
- package/dist/components/DefaultDrawer.d.ts +51 -3
- package/dist/components/EntityCollectionTable/fields/TableStorageUpload.d.ts +2 -2
- package/dist/components/EntityCollectionTable/internal/EntityTableCell.d.ts +2 -2
- package/dist/components/EntityCollectionTable/table_bindings.d.ts +4 -3
- package/dist/components/EntityCollectionView/hooks/useKanbanDragAndDrop.d.ts +4 -3
- package/dist/components/EntityEditView.d.ts +2 -1
- package/dist/components/HomePage/HomePageDnD.d.ts +3 -3
- package/dist/components/PropertyCollectionView.d.ts +1 -1
- package/dist/components/PropertyIdCopyTooltip.d.ts +1 -1
- package/dist/components/RebaseRouteDefs.d.ts +1 -1
- package/dist/components/SelectableTable/SelectionStore.d.ts +4 -1
- package/dist/components/SelectableTable/filters/BooleanFilterField.d.ts +2 -2
- package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +2 -2
- package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +2 -2
- package/dist/components/SelectableTable/filters/StringNumberFilterField.d.ts +2 -2
- package/dist/components/admin/index.d.ts +1 -3
- package/dist/components/app/Drawer.d.ts +8 -1
- package/dist/data_export/export/export.d.ts +3 -3
- package/dist/editor/components/editor-bubble.d.ts +5 -1
- package/dist/editor/components/image-bubble.d.ts +5 -1
- package/dist/editor/components/index.d.ts +3 -3
- package/dist/editor/components/table-bubble.d.ts +5 -1
- package/dist/editor/nodeViews/ReactNodeView.d.ts +4 -1
- package/dist/editor/useProseMirror.d.ts +2 -2
- package/dist/editor/utils/remove_classes.d.ts +1 -1
- package/dist/editor.js +15 -14
- package/dist/editor.js.map +1 -1
- package/dist/form/EntityForm.d.ts +2 -2
- package/dist/form/components/StorageUploadProgress.d.ts +2 -2
- package/dist/form/field_bindings/MultiSelectFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/StorageUploadFieldBinding.d.ts +1 -1
- package/dist/form/validation.d.ts +3 -3
- package/dist/hooks/navigation/useBuildNavigationStateController.d.ts +1 -1
- package/dist/hooks/navigation/useResolvedCollections.d.ts +6 -0
- package/dist/hooks/navigation/useResolvedViews.d.ts +3 -7
- package/dist/{index-DjduZG1T.js → index-DHaOV-7A.js} +3 -3
- package/dist/index-DHaOV-7A.js.map +1 -0
- package/dist/{index-MKPc70-v.js → index-DJSL_SCr.js} +3 -3
- package/dist/index-DJSL_SCr.js.map +1 -0
- package/dist/{index-PLIQXpTt.js → index-XMII4H3d.js} +3 -2
- package/dist/{index-PLIQXpTt.js.map → index-XMII4H3d.js.map} +1 -1
- package/dist/index.d.ts +1 -3
- package/dist/index.js +2688 -452
- package/dist/index.js.map +1 -1
- package/dist/{markdown-z2Ir7Cgo.js → markdown-DD2JDU1X.js} +2 -2
- package/dist/markdown-DD2JDU1X.js.map +1 -0
- package/dist/preview/components/UrlComponentPreview.d.ts +1 -0
- package/dist/types/components/EntityFormActionsProps.d.ts +1 -1
- package/dist/types/components/EntityFormProps.d.ts +2 -2
- package/dist/types/fields.d.ts +1 -1
- package/dist/{util-DbWax_sV.js → util-0GYaJqL_.js} +1505 -2043
- package/dist/util-0GYaJqL_.js.map +1 -0
- package/package.json +8 -8
- package/src/collection_editor/ConfigControllerProvider.tsx +3 -13
- package/src/collection_editor/index.ts +1 -3
- package/src/collection_editor/pgColumnToProperty.ts +19 -2
- package/src/collection_editor/types/collection_editor_controller.tsx +0 -3
- package/src/collection_editor/ui/EditorCollectionAction.tsx +1 -6
- package/src/collection_editor/ui/EditorCollectionActionStart.tsx +1 -6
- package/src/collection_editor/ui/EditorEntityAction.tsx +1 -6
- package/src/collection_editor/ui/HomePageEditorCollectionAction.tsx +7 -14
- package/src/collection_editor/ui/NewCollectionCard.tsx +1 -5
- package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +3 -8
- package/src/collection_editor/ui/collection_editor/CollectionJsonImportDialog.tsx +8 -12
- package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +21 -21
- package/src/collection_editor/ui/collection_editor/CollectionRLSTab.tsx +4 -4
- package/src/collection_editor/ui/collection_editor/EnumForm.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/properties/BlockPropertyField.tsx +3 -3
- package/src/collection_editor/ui/collection_editor/properties/CommonPropertyFields.tsx +3 -3
- package/src/collection_editor/ui/collection_editor/properties/DateTimePropertyField.tsx +8 -8
- package/src/collection_editor/ui/collection_editor/properties/EnumPropertyField.tsx +5 -5
- package/src/collection_editor/ui/collection_editor/properties/MapPropertyField.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.tsx +5 -5
- package/src/collection_editor/ui/collection_editor/properties/NumberPropertyField.tsx +5 -5
- package/src/collection_editor/ui/collection_editor/properties/ReferencePropertyField.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/RepeatPropertyField.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/StoragePropertyField.tsx +8 -8
- package/src/collection_editor/ui/collection_editor/properties/StringPropertyField.tsx +5 -5
- package/src/collection_editor/ui/collection_editor/properties/UrlPropertyField.tsx +3 -2
- package/src/collection_editor/ui/collection_editor/properties/VectorPropertyField.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.tsx +4 -7
- package/src/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.tsx +4 -4
- package/src/components/ArrayContainer.tsx +3 -3
- package/src/components/DefaultAppBar.tsx +52 -31
- package/src/components/DefaultDrawer.tsx +280 -67
- package/src/components/DrawerNavigationItem.tsx +1 -1
- package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +6 -5
- package/src/components/EntityCollectionTable/PropertyTableCell.tsx +9 -7
- package/src/components/EntityCollectionTable/fields/TableStorageUpload.tsx +5 -5
- package/src/components/EntityCollectionTable/fields/VirtualTableNumberInput.tsx +12 -9
- package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +2 -2
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +1 -1
- package/src/components/EntityCollectionTable/table_bindings.tsx +5 -4
- package/src/components/EntityCollectionView/EntityCollectionCardView.tsx +4 -4
- package/src/components/EntityCollectionView/EntityCollectionListView.tsx +7 -0
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +10 -5
- package/src/components/EntityCollectionView/hooks/useCollectionInlineEditor.ts +1 -1
- package/src/components/EntityCollectionView/hooks/useKanbanDragAndDrop.ts +7 -6
- package/src/components/EntityDetailView.tsx +46 -24
- package/src/components/EntityEditView.tsx +51 -28
- package/src/components/EntityEditViewFormActions.tsx +4 -4
- package/src/components/EntityPreview.tsx +9 -4
- package/src/components/HomePage/HomePageDnD.tsx +3 -2
- package/src/components/PropertyCollectionView.tsx +1 -1
- package/src/components/PropertyIdCopyTooltip.tsx +1 -1
- package/src/components/RebaseLayout.tsx +5 -1
- package/src/components/RebaseNavigation.tsx +2 -2
- package/src/components/RebaseRouteDefs.tsx +6 -11
- package/src/components/RebaseShell.tsx +16 -13
- package/src/components/SearchIconsView.tsx +1 -8
- package/src/components/SelectableTable/SelectableTable.tsx +8 -11
- package/src/components/SelectableTable/SelectionStore.ts +1 -1
- package/src/components/SelectableTable/filters/BooleanFilterField.tsx +3 -3
- package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +3 -3
- package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +5 -5
- package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +3 -3
- package/src/components/SideEntityProvider.tsx +2 -1
- package/src/components/admin/index.ts +1 -3
- package/src/components/app/Drawer.tsx +9 -1
- package/src/components/app/Scaffold.tsx +5 -1
- package/src/components/index.ts +1 -3
- package/src/data_export/export/export.ts +17 -17
- package/src/data_import/components/DataNewPropertiesMapping.tsx +1 -1
- package/src/editor/components/editor-bubble.tsx +32 -9
- package/src/editor/components/image-bubble.tsx +27 -11
- package/src/editor/components/index.ts +3 -3
- package/src/editor/components/table-bubble.tsx +79 -17
- package/src/editor/extensions/HighlightDecorationExtension.ts +3 -2
- package/src/editor/nodeViews/ReactNodeView.tsx +1 -1
- package/src/editor/nodeViews/TaskItemComponent.tsx +9 -8
- package/src/editor/schema.ts +135 -59
- package/src/editor/selectors/link-selector.tsx +8 -5
- package/src/editor/useProseMirror.ts +2 -2
- package/src/editor/utils/remove_classes.ts +6 -5
- package/src/form/EntityForm.tsx +15 -15
- package/src/form/EntityFormActions.tsx +2 -2
- package/src/form/PropertyFieldBinding.tsx +64 -64
- package/src/form/components/FieldHelperText.tsx +4 -4
- package/src/form/components/StorageUploadProgress.tsx +2 -2
- package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +1 -1
- package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +1 -1
- package/src/form/field_bindings/BlockFieldBinding.tsx +54 -53
- package/src/form/field_bindings/KeyValueFieldBinding.tsx +290 -289
- package/src/form/field_bindings/MapFieldBinding.tsx +2 -2
- package/src/form/field_bindings/MultiSelectFieldBinding.tsx +2 -2
- package/src/form/field_bindings/MultipleRelationFieldBinding.tsx +1 -1
- package/src/form/field_bindings/ReferenceAsStringFieldBinding.tsx +1 -1
- package/src/form/field_bindings/ReferenceFieldBinding.tsx +8 -6
- package/src/form/field_bindings/RelationFieldBinding.tsx +4 -4
- package/src/form/field_bindings/RepeatFieldBinding.tsx +1 -1
- package/src/form/field_bindings/SelectFieldBinding.tsx +1 -1
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +84 -84
- package/src/form/field_bindings/SwitchFieldBinding.tsx +16 -16
- package/src/form/field_bindings/TextFieldBinding.tsx +77 -73
- package/src/form/field_bindings/UserSelectFieldBinding.tsx +17 -17
- package/src/form/validation.ts +43 -43
- package/src/hooks/navigation/useBuildNavigationStateController.tsx +4 -7
- package/src/hooks/navigation/useResolvedCollections.ts +27 -7
- package/src/hooks/navigation/useResolvedViews.tsx +8 -70
- package/src/index.ts +4 -3
- package/src/preview/PropertyPreview.tsx +2 -2
- package/src/preview/components/ImagePreview.tsx +2 -1
- package/src/preview/components/UrlComponentPreview.tsx +11 -2
- package/src/preview/components/UserPreview.tsx +1 -1
- package/src/preview/property_previews/ArrayOfMapsPreview.tsx +2 -2
- package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +4 -4
- package/src/preview/property_previews/ArrayOfRelationsPreview.tsx +3 -3
- package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +3 -3
- package/src/preview/property_previews/ArrayOfStringsPreview.tsx +3 -2
- package/src/preview/property_previews/ArrayOneOfPreview.tsx +6 -8
- package/src/preview/property_previews/ArrayPropertyEnumPreview.tsx +1 -1
- package/src/preview/property_previews/ArrayPropertyPreview.tsx +3 -3
- package/src/preview/property_previews/MapPropertyPreview.tsx +4 -3
- package/src/preview/property_previews/NumberPropertyPreview.tsx +5 -3
- package/src/preview/property_previews/StringPropertyPreview.tsx +10 -8
- package/src/types/components/EntityFormActionsProps.tsx +1 -1
- package/src/types/components/EntityFormProps.tsx +2 -2
- package/src/types/fields.tsx +2 -2
- package/src/util/previews.ts +9 -1
- package/dist/CollectionEditorDialog-CmGXXSY9.js.map +0 -1
- package/dist/ContentHomePage-C7vFqKSe.js +0 -1784
- package/dist/ContentHomePage-C7vFqKSe.js.map +0 -1
- package/dist/ExportCollectionAction-BfN34eWX.js.map +0 -1
- package/dist/PropertyEditView-Cvryrb3B.js.map +0 -1
- package/dist/RoleChip-QtUFXeTp.js +0 -67
- package/dist/RoleChip-QtUFXeTp.js.map +0 -1
- package/dist/RolesView-BCb7qwWs.js +0 -437
- package/dist/RolesView-BCb7qwWs.js.map +0 -1
- package/dist/UsersView-Cex24r8H.js +0 -408
- package/dist/UsersView-Cex24r8H.js.map +0 -1
- package/dist/collection_editor/types/config_permissions.d.ts +0 -19
- package/dist/components/admin/RoleChip.d.ts +0 -4
- package/dist/components/admin/RolesFilterSelect.d.ts +0 -2
- package/dist/components/admin/RolesView.d.ts +0 -4
- package/dist/components/admin/UserRolesSelectField.d.ts +0 -2
- package/dist/components/admin/UsersView.d.ts +0 -4
- package/dist/index-DjduZG1T.js.map +0 -1
- package/dist/index-MKPc70-v.js.map +0 -1
- package/dist/markdown-z2Ir7Cgo.js.map +0 -1
- package/dist/util-DbWax_sV.js.map +0 -1
- package/src/collection_editor/types/config_permissions.ts +0 -20
- package/src/components/admin/RoleChip.tsx +0 -23
- package/src/components/admin/RolesFilterSelect.tsx +0 -45
- package/src/components/admin/RolesView.tsx +0 -465
- package/src/components/admin/UserRolesSelectField.tsx +0 -50
- package/src/components/admin/UsersView.tsx +0 -687
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "react-compiler-runtime";
|
|
3
3
|
import { useAuthController, useCustomizationController, IconForView, useSnackbarController, useLargeLayout, AIIcon, useRebaseContext, ErrorView, ConfirmationDialog, useUnsavedChangesDialog, UnsavedChangesDialog } from "@rebasepro/core";
|
|
4
|
-
import {
|
|
4
|
+
import { bm as useCollectionsConfigController, N as FieldCaption, ag as SearchIconsView, aO as getFieldConfig, a4 as PropertyConfigBadge, aQ as getFullId, aY as idToPropertiesPath, b0 as namespaceToPropertiesOrderPath, by as validateCollectionJson, bl as useCollectionRegistryController, l as CollectionGenerationApiError, bk as useCollectionEditorController, S as ImportFileUpload, aU as getInferenceType, T as ImportNewPropertyFieldPreview, p as DataNewPropertiesMapping, aP as getFieldId, bt as useSelectionController, aB as convertDataToEntity, y as EntityCollectionTable, bq as useNavigationStateController, bo as useImportConfig, bx as useUrlController, U as ImportSaveInProgress, aR as getFullIdPath } from "./util-0GYaJqL_.js";
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import React__default, { useState, useRef, useMemo, useEffect } from "react";
|
|
7
7
|
import { Chip, Typography, cls, Tooltip, IconButton, TextField, DebouncedTextField, Dialog, Container, ColumnsIcon, SquareIcon, PanelLeftIcon, AppWindow, ToggleButtonGroup, ListIcon, TableIcon, LayoutGridIcon, KanbanIcon, Select, SelectItem, XIcon, iconSize, Button, BooleanSwitchWithLabel, DialogTitle, DialogContent, CopyIcon, DialogActions, CircularProgress, FileSearchIcon, PlusIcon, ErrorBoundary, defaultBorderMixin, CodeIcon, Alert, Menu, ShoppingCartIcon, UserIcon, FileTextIcon, FileIcon, Card, CircularProgressCenter, Paper, KeyIcon, Trash2Icon, MultiSelect, MultiSelectItem, coolIconKeys, Tabs, Tab, LoadingButton, ArrowLeftIcon, CheckIcon } from "@rebasepro/ui";
|
|
@@ -21,7 +21,8 @@ import "exceljs";
|
|
|
21
21
|
import { buildPropertyFromData, buildEntityPropertiesFromData } from "@rebasepro/schema-inference";
|
|
22
22
|
import "date-fns";
|
|
23
23
|
import "date-fns/locale";
|
|
24
|
-
import
|
|
24
|
+
import "fuse.js";
|
|
25
|
+
import { b as PropertyFormDialog, d as useAIModifiedPaths, c as PropertyTree, a as PropertyForm, s as supportedFields, u as updatePropertyFromWidget, A as AIModifiedPathsProvider } from "./PropertyEditView-BDNYkfNf.js";
|
|
25
26
|
import JSON5 from "json5";
|
|
26
27
|
import { Highlight, themes } from "prism-react-renderer";
|
|
27
28
|
const CollectionEditorSchema = z.object({
|
|
@@ -1192,8 +1193,8 @@ function CollectionPropertiesEditorForm({
|
|
|
1192
1193
|
const newProp = newProps[key];
|
|
1193
1194
|
if (!existingProp) {
|
|
1194
1195
|
keys.push(fullKey);
|
|
1195
|
-
} else if (typeof newProp === "object" && "type" in newProp && newProp.
|
|
1196
|
-
const existingMapProps = typeof existingProp === "object" && "type" in existingProp && existingProp.
|
|
1196
|
+
} else if (typeof newProp === "object" && "type" in newProp && newProp.type === "map" && newProp.properties) {
|
|
1197
|
+
const existingMapProps = typeof existingProp === "object" && "type" in existingProp && existingProp.type === "map" ? existingProp.properties : void 0;
|
|
1197
1198
|
keys.push(...findNewPropertyKeys(existingMapProps, newProp.properties, fullKey));
|
|
1198
1199
|
}
|
|
1199
1200
|
}
|
|
@@ -1210,7 +1211,7 @@ function CollectionPropertiesEditorForm({
|
|
|
1210
1211
|
const newProp_0 = newProps_0[key_0];
|
|
1211
1212
|
if (!existingProp_0) {
|
|
1212
1213
|
result[key_0] = newProp_0;
|
|
1213
|
-
} else if (typeof existingProp_0 === "object" && "type" in existingProp_0 && existingProp_0.
|
|
1214
|
+
} else if (typeof existingProp_0 === "object" && "type" in existingProp_0 && existingProp_0.type === "map" && typeof newProp_0 === "object" && "type" in newProp_0 && newProp_0.type === "map" && newProp_0.properties) {
|
|
1214
1215
|
const existingMapProps_0 = existingProp_0.properties;
|
|
1215
1216
|
if (existingMapProps_0) {
|
|
1216
1217
|
result[key_0] = {
|
|
@@ -1373,7 +1374,7 @@ function CollectionPropertiesEditorForm({
|
|
|
1373
1374
|
/* @__PURE__ */ jsx(Button, { className: "mt-4 xl:mt-8 w-full", variant: "filled", color: "neutral", disabled: configController?.readOnly, onClick: () => setNewPropertyDialogOpen(true), startIcon: /* @__PURE__ */ jsx(PlusIcon, {}), children: "Add new property" })
|
|
1374
1375
|
] }),
|
|
1375
1376
|
!asDialog && /* @__PURE__ */ jsx("div", { className: "col-span-12 lg:col-span-7 p-4 md:py-8 md:px-4 h-full overflow-auto", children: /* @__PURE__ */ jsxs("div", { className: "sticky top-8 min-h-full w-full flex flex-col justify-center", children: [
|
|
1376
|
-
selectedPropertyFullId && selectedProperty && !isPropertyBuilder(selectedProperty) && /* @__PURE__ */ jsx(PropertyForm, { inArray: false, existingProperty: !isNewCollection, autoUpdateId: false, allowDataInference: !isNewCollection, autoOpenTypeSelect: false, propertyKey: selectedPropertyKey, propertyNamespace: selectedPropertyNamespace, property: selectedProperty, onPropertyChanged, onDelete: deleteProperty, onError: onPropertyErrorInternal, forceShowErrors: showErrors, initialErrors, getData, propertyConfigs }, `edit_view_${selectedPropertyIndex}_${generationCounter}`),
|
|
1377
|
+
selectedPropertyFullId && !!selectedProperty && !isPropertyBuilder(selectedProperty) && /* @__PURE__ */ jsx(PropertyForm, { inArray: false, existingProperty: !isNewCollection, autoUpdateId: false, allowDataInference: !isNewCollection, autoOpenTypeSelect: false, propertyKey: selectedPropertyKey, propertyNamespace: selectedPropertyNamespace, property: selectedProperty, onPropertyChanged, onDelete: deleteProperty, onError: onPropertyErrorInternal, forceShowErrors: showErrors, initialErrors, getData, propertyConfigs }, `edit_view_${selectedPropertyIndex}_${generationCounter}`),
|
|
1377
1378
|
!selectedProperty && /* @__PURE__ */ jsxs("div", { className: "w-full flex flex-col items-center justify-center h-full gap-4", children: [
|
|
1378
1379
|
/* @__PURE__ */ jsx(Typography, { variant: "label", className: "", children: emptyCollection ? "Now you can add your first property" : "Select a property to edit it" }),
|
|
1379
1380
|
/* @__PURE__ */ jsxs(Button, { disabled: configController?.readOnly, onClick: () => setNewPropertyDialogOpen(true), children: [
|
|
@@ -1381,7 +1382,7 @@ function CollectionPropertiesEditorForm({
|
|
|
1381
1382
|
"Add new property"
|
|
1382
1383
|
] })
|
|
1383
1384
|
] }),
|
|
1384
|
-
selectedProperty && isPropertyBuilder(selectedProperty) && /* @__PURE__ */ jsx(Typography, { variant: "label", className: "flex items-center justify-center", children: "This property is defined as a property builder in code" })
|
|
1385
|
+
!!selectedProperty && isPropertyBuilder(selectedProperty) && /* @__PURE__ */ jsx(Typography, { variant: "label", className: "flex items-center justify-center", children: "This property is defined as a property builder in code" })
|
|
1385
1386
|
] }) }),
|
|
1386
1387
|
asDialog && /* @__PURE__ */ jsx(PropertyFormDialog, { inArray: false, open: selectedPropertyIndex !== void 0, autoUpdateId: !selectedProperty, allowDataInference: !isNewCollection, existingProperty: true, autoOpenTypeSelect: false, propertyKey: selectedPropertyKey, propertyNamespace: selectedPropertyNamespace, property: selectedProperty, onPropertyChanged, onDelete: deleteProperty, onError: onPropertyErrorInternal, forceShowErrors: showErrors, initialErrors, getData, propertyConfigs, onCancel: closePropertyDialog, onOkClicked: asDialog ? closePropertyDialog : void 0 }, `edit_view_${selectedPropertyIndex}_${generationCounter}`)
|
|
1387
1388
|
] });
|
|
@@ -1413,7 +1414,7 @@ const EXAMPLE_JSON = `{
|
|
|
1413
1414
|
}
|
|
1414
1415
|
}`;
|
|
1415
1416
|
function CollectionJsonImportDialog(t0) {
|
|
1416
|
-
const $ = c(
|
|
1417
|
+
const $ = c(44);
|
|
1417
1418
|
const {
|
|
1418
1419
|
open,
|
|
1419
1420
|
onClose,
|
|
@@ -1548,105 +1549,97 @@ function CollectionJsonImportDialog(t0) {
|
|
|
1548
1549
|
} else {
|
|
1549
1550
|
t11 = $[18];
|
|
1550
1551
|
}
|
|
1551
|
-
const t12 = errors.length > 0 && touched
|
|
1552
|
+
const t12 = errors.length > 0 && touched;
|
|
1552
1553
|
let t13;
|
|
1553
|
-
if ($[19] !== t12) {
|
|
1554
|
-
t13 =
|
|
1555
|
-
$[19] =
|
|
1556
|
-
$[20] =
|
|
1554
|
+
if ($[19] !== jsonValue || $[20] !== t12) {
|
|
1555
|
+
t13 = /* @__PURE__ */ jsx(TextField, { multiline: true, minRows: 12, value: jsonValue, onChange: handleJsonChange, placeholder: EXAMPLE_JSON, error: t12, className: "w-full", inputClassName: "font-mono text-sm resize-none overflow-y-auto h-[300px]" });
|
|
1556
|
+
$[19] = jsonValue;
|
|
1557
|
+
$[20] = t12;
|
|
1558
|
+
$[21] = t13;
|
|
1557
1559
|
} else {
|
|
1558
|
-
t13 = $[
|
|
1560
|
+
t13 = $[21];
|
|
1559
1561
|
}
|
|
1560
1562
|
let t14;
|
|
1561
|
-
if ($[
|
|
1562
|
-
t14 = /* @__PURE__ */
|
|
1563
|
-
$[21] = jsonValue;
|
|
1564
|
-
$[22] = t13;
|
|
1565
|
-
$[23] = t14;
|
|
1566
|
-
} else {
|
|
1567
|
-
t14 = $[23];
|
|
1568
|
-
}
|
|
1569
|
-
let t15;
|
|
1570
|
-
if ($[24] !== errors || $[25] !== touched) {
|
|
1571
|
-
t15 = errors.length > 0 && touched && /* @__PURE__ */ jsxs(Alert, { color: "error", children: [
|
|
1563
|
+
if ($[22] !== errors || $[23] !== touched) {
|
|
1564
|
+
t14 = errors.length > 0 && touched && /* @__PURE__ */ jsxs(Alert, { color: "error", children: [
|
|
1572
1565
|
/* @__PURE__ */ jsx(Typography, { variant: "body2", className: "font-medium mb-2", children: "Validation errors:" }),
|
|
1573
1566
|
/* @__PURE__ */ jsx("ul", { className: "list-disc list-inside space-y-1", children: errors.map(_temp$3) })
|
|
1574
1567
|
] });
|
|
1575
|
-
$[
|
|
1576
|
-
$[
|
|
1568
|
+
$[22] = errors;
|
|
1569
|
+
$[23] = touched;
|
|
1570
|
+
$[24] = t14;
|
|
1571
|
+
} else {
|
|
1572
|
+
t14 = $[24];
|
|
1573
|
+
}
|
|
1574
|
+
let t15;
|
|
1575
|
+
if ($[25] !== isValid) {
|
|
1576
|
+
t15 = isValid && /* @__PURE__ */ jsx(Alert, { color: "success", children: /* @__PURE__ */ jsx(Typography, { variant: "body2", children: "✓ JSON is valid and ready to import" }) });
|
|
1577
|
+
$[25] = isValid;
|
|
1577
1578
|
$[26] = t15;
|
|
1578
1579
|
} else {
|
|
1579
1580
|
t15 = $[26];
|
|
1580
1581
|
}
|
|
1581
1582
|
let t16;
|
|
1582
|
-
if ($[27] !==
|
|
1583
|
-
t16 =
|
|
1584
|
-
$[27] = isValid;
|
|
1585
|
-
$[28] = t16;
|
|
1586
|
-
} else {
|
|
1587
|
-
t16 = $[28];
|
|
1588
|
-
}
|
|
1589
|
-
let t17;
|
|
1590
|
-
if ($[29] !== t14 || $[30] !== t15 || $[31] !== t16) {
|
|
1591
|
-
t17 = /* @__PURE__ */ jsxs(DialogContent, { className: "flex flex-col gap-4", children: [
|
|
1583
|
+
if ($[27] !== t13 || $[28] !== t14 || $[29] !== t15) {
|
|
1584
|
+
t16 = /* @__PURE__ */ jsxs(DialogContent, { className: "flex flex-col gap-4", children: [
|
|
1592
1585
|
t11,
|
|
1586
|
+
t13,
|
|
1593
1587
|
t14,
|
|
1594
|
-
t15
|
|
1595
|
-
t16
|
|
1588
|
+
t15
|
|
1596
1589
|
] });
|
|
1597
|
-
$[
|
|
1598
|
-
$[
|
|
1599
|
-
$[
|
|
1590
|
+
$[27] = t13;
|
|
1591
|
+
$[28] = t14;
|
|
1592
|
+
$[29] = t15;
|
|
1593
|
+
$[30] = t16;
|
|
1594
|
+
} else {
|
|
1595
|
+
t16 = $[30];
|
|
1596
|
+
}
|
|
1597
|
+
let t17;
|
|
1598
|
+
if ($[31] !== handleClose) {
|
|
1599
|
+
t17 = /* @__PURE__ */ jsx(Button, { variant: "text", onClick: handleClose, children: "Cancel" });
|
|
1600
|
+
$[31] = handleClose;
|
|
1600
1601
|
$[32] = t17;
|
|
1601
1602
|
} else {
|
|
1602
1603
|
t17 = $[32];
|
|
1603
1604
|
}
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1605
|
+
const t18 = !isValid;
|
|
1606
|
+
let t19;
|
|
1607
|
+
if ($[33] !== handleImport || $[34] !== t18) {
|
|
1608
|
+
t19 = /* @__PURE__ */ jsx(Button, { variant: "filled", color: "primary", onClick: handleImport, disabled: t18, children: "Import Collection" });
|
|
1609
|
+
$[33] = handleImport;
|
|
1608
1610
|
$[34] = t18;
|
|
1611
|
+
$[35] = t19;
|
|
1609
1612
|
} else {
|
|
1610
|
-
|
|
1613
|
+
t19 = $[35];
|
|
1611
1614
|
}
|
|
1612
|
-
const t19 = !isValid;
|
|
1613
1615
|
let t20;
|
|
1614
|
-
if ($[
|
|
1615
|
-
t20 = /* @__PURE__ */
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
$[37] = t20;
|
|
1619
|
-
} else {
|
|
1620
|
-
t20 = $[37];
|
|
1621
|
-
}
|
|
1622
|
-
let t21;
|
|
1623
|
-
if ($[38] !== t18 || $[39] !== t20) {
|
|
1624
|
-
t21 = /* @__PURE__ */ jsxs(DialogActions, { children: [
|
|
1625
|
-
t18,
|
|
1626
|
-
t20
|
|
1616
|
+
if ($[36] !== t17 || $[37] !== t19) {
|
|
1617
|
+
t20 = /* @__PURE__ */ jsxs(DialogActions, { children: [
|
|
1618
|
+
t17,
|
|
1619
|
+
t19
|
|
1627
1620
|
] });
|
|
1628
|
-
$[
|
|
1629
|
-
$[
|
|
1630
|
-
$[
|
|
1621
|
+
$[36] = t17;
|
|
1622
|
+
$[37] = t19;
|
|
1623
|
+
$[38] = t20;
|
|
1631
1624
|
} else {
|
|
1632
|
-
|
|
1625
|
+
t20 = $[38];
|
|
1633
1626
|
}
|
|
1634
|
-
let
|
|
1635
|
-
if ($[
|
|
1636
|
-
|
|
1627
|
+
let t21;
|
|
1628
|
+
if ($[39] !== open || $[40] !== t16 || $[41] !== t20 || $[42] !== t6) {
|
|
1629
|
+
t21 = /* @__PURE__ */ jsxs(Dialog, { open, onOpenChange: t6, maxWidth: "2xl", children: [
|
|
1637
1630
|
t7,
|
|
1638
|
-
|
|
1639
|
-
|
|
1631
|
+
t16,
|
|
1632
|
+
t20
|
|
1640
1633
|
] });
|
|
1641
|
-
$[
|
|
1642
|
-
$[
|
|
1634
|
+
$[39] = open;
|
|
1635
|
+
$[40] = t16;
|
|
1636
|
+
$[41] = t20;
|
|
1637
|
+
$[42] = t6;
|
|
1643
1638
|
$[43] = t21;
|
|
1644
|
-
$[44] = t6;
|
|
1645
|
-
$[45] = t22;
|
|
1646
1639
|
} else {
|
|
1647
|
-
|
|
1640
|
+
t21 = $[43];
|
|
1648
1641
|
}
|
|
1649
|
-
return
|
|
1642
|
+
return t21;
|
|
1650
1643
|
}
|
|
1651
1644
|
function _temp$3(error, index) {
|
|
1652
1645
|
return /* @__PURE__ */ jsx("li", { className: "text-sm", children: error.path ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -3800,14 +3793,31 @@ function pgTypeToRebaseProperty(column) {
|
|
|
3800
3793
|
properties: {}
|
|
3801
3794
|
};
|
|
3802
3795
|
case "array":
|
|
3803
|
-
case "ARRAY":
|
|
3796
|
+
case "ARRAY": {
|
|
3797
|
+
let innerType = "string";
|
|
3798
|
+
let colType = void 0;
|
|
3799
|
+
if (udt_name === "_text" || udt_name === "_varchar") {
|
|
3800
|
+
innerType = "string";
|
|
3801
|
+
colType = "text[]";
|
|
3802
|
+
} else if (udt_name === "_int4" || udt_name === "_int2" || udt_name === "_int8") {
|
|
3803
|
+
innerType = "number";
|
|
3804
|
+
colType = "integer[]";
|
|
3805
|
+
} else if (udt_name === "_bool") {
|
|
3806
|
+
innerType = "boolean";
|
|
3807
|
+
colType = "boolean[]";
|
|
3808
|
+
} else if (udt_name === "_numeric") {
|
|
3809
|
+
innerType = "number";
|
|
3810
|
+
colType = "numeric[]";
|
|
3811
|
+
}
|
|
3804
3812
|
return {
|
|
3805
3813
|
type: "array",
|
|
3806
3814
|
name: prettifiedName,
|
|
3815
|
+
columnType: colType,
|
|
3807
3816
|
of: {
|
|
3808
|
-
type:
|
|
3817
|
+
type: innerType
|
|
3809
3818
|
}
|
|
3810
3819
|
};
|
|
3820
|
+
}
|
|
3811
3821
|
default:
|
|
3812
3822
|
return {
|
|
3813
3823
|
type: "string",
|
|
@@ -4561,4 +4571,4 @@ export {
|
|
|
4561
4571
|
CollectionEditor,
|
|
4562
4572
|
CollectionEditorDialog
|
|
4563
4573
|
};
|
|
4564
|
-
//# sourceMappingURL=CollectionEditorDialog-
|
|
4574
|
+
//# sourceMappingURL=CollectionEditorDialog-Cn8-tGyL.js.map
|