@rebasepro/admin 0.12.0 → 0.12.1-canary.gdfba2a1

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.
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
2
- import { A as getFieldId, E as DEFAULT_FIELD_CONFIGS, Ft as FieldCaption, In as useCollectionRegistryController, Mt as ArrayContainer, Nt as PropertyConfigBadge, a as namespaceToPropertiesPath, g as toSerializableProperty, i as namespaceToPropertiesOrderPath, k as getFieldConfig, m as toSerializableCollectionConfig, n as getFullIdPath, r as idToPropertiesPath, t as getFullId } from "./util-B5fJm1FA.js";
2
+ import { A as getFieldId, E as DEFAULT_FIELD_CONFIGS, Ft as FieldCaption, In as useCollectionRegistryController, Mt as ArrayContainer, Nt as PropertyConfigBadge, a as namespaceToPropertiesPath, g as toSerializableProperty, i as namespaceToPropertiesOrderPath, k as getFieldConfig, m as toSerializableCollectionConfig, n as getFullIdPath, r as idToPropertiesPath, t as getFullId } from "./util-BwZuV81o.js";
3
3
  import React, { createContext, useCallback, useContext, useDeferredValue, useEffect, useMemo, useRef, useState } from "react";
4
4
  import { deepEqual } from "fast-equals";
5
5
  import { AlertTriangleIcon, ArrowDownToLineIcon, ArrowUpToLineIcon, Badge, BooleanSwitchWithLabel, Button, Card, CheckSquareIcon, CircularProgress, DebouncedTextField, Dialog, DialogActions, DialogContent, DialogTitle, ErrorBoundary, ExpandablePanel, FileSearchIcon, FunctionSquareIcon, IconButton, InfoLabel, ListIcon, Menu, MenuItem, MinusCircleIcon, MoreVerticalIcon, MultiSelect, MultiSelectItem, Paper, PlusIcon, RefreshCcwIcon, Select, SelectItem, SettingsIcon, TextField, Tooltip, Trash2Icon, Typography, UploadCloudIcon, cls, defaultBorderMixin, iconSize } from "@rebasepro/ui";
@@ -1297,7 +1297,8 @@ function MapPropertyField({ disabled, getData, allowDataInference, propertyConfi
1297
1297
  [id]: property
1298
1298
  }, false);
1299
1299
  const currentPropertiesOrder = values.propertiesOrder ?? Object.keys(values.properties ?? {});
1300
- setFieldValue("propertiesOrder", currentPropertiesOrder.includes(id) ? currentPropertiesOrder : [...currentPropertiesOrder, id], false);
1300
+ const newPropertiesOrder = currentPropertiesOrder.includes(id) ? currentPropertiesOrder : [...currentPropertiesOrder, id];
1301
+ setFieldValue("propertiesOrder", newPropertiesOrder, false);
1301
1302
  setPropertyDialogOpen(false);
1302
1303
  };
1303
1304
  const deleteProperty = (propertyKey, namespace) => {
@@ -1722,7 +1723,8 @@ function BlockPropertyField({ disabled, getData, allowDataInference, propertyCon
1722
1723
  if (!fullId) throw Error("collection editor miss config");
1723
1724
  setFieldValue(`oneOf.${idToPropertiesPath(fullId)}`, void 0, false);
1724
1725
  const propertiesOrderPath = `oneOf.${namespaceToPropertiesOrderPath(namespace)}`;
1725
- setFieldValue(propertiesOrderPath, (getIn(values, propertiesOrderPath) ?? Object.keys(getIn(values, namespaceToPropertiesPath(namespace)) ?? {})).filter((p) => p !== propertyKey), false);
1726
+ const currentPropertiesOrder = getIn(values, propertiesOrderPath) ?? Object.keys(getIn(values, namespaceToPropertiesPath(namespace)) ?? {});
1727
+ setFieldValue(propertiesOrderPath, currentPropertiesOrder.filter((p) => p !== propertyKey), false);
1726
1728
  setPropertyDialogOpen(false);
1727
1729
  setSelectedPropertyKey(void 0);
1728
1730
  setSelectedPropertyNamespace(void 0);
@@ -2595,12 +2597,13 @@ function RelationPropertyField({ disabled, showErrors }) {
2595
2597
  const showForeignKey = kindUsesForeignKeyOnTarget(kind);
2596
2598
  const showJoinPath = kindUsesJoinPath(kind);
2597
2599
  const updateThrough = useCallback((patch) => {
2600
+ const currentThrough = link.through ?? {
2601
+ table: "",
2602
+ sourceColumn: "",
2603
+ targetColumn: ""
2604
+ };
2598
2605
  setFieldValue("relation.through", {
2599
- ...link.through ?? {
2600
- table: "",
2601
- sourceColumn: "",
2602
- targetColumn: ""
2603
- },
2606
+ ...currentThrough,
2604
2607
  ...patch
2605
2608
  });
2606
2609
  }, [link.through, setFieldValue]);
@@ -3846,4 +3849,4 @@ function WidgetSelectViewItem({ onClick, initialProperty, propertyConfig, existi
3846
3849
  //#endregion
3847
3850
  export { updatePropertyFromWidget as a, useAIModifiedPaths as c, supportedFields as i, useSafeSnackbarController as l, PropertyForm as n, PropertyTree as o, PropertyFormDialog as r, AIModifiedPathsProvider as s, PropertyEditView_exports as t };
3848
3851
 
3849
- //# sourceMappingURL=PropertyEditView-DH3XZC2x.js.map
3852
+ //# sourceMappingURL=PropertyEditView-D2b9_nbC.js.map