@meshmakers/octo-ui 3.3.780 → 3.3.790

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meshmakers/octo-ui",
3
- "version": "3.3.780",
3
+ "version": "3.3.790",
4
4
  "peerDependencies": {
5
5
  "@ngx-translate/core": "^17.0.0",
6
6
  "@angular/animations": "^21.0.6",
@@ -43,5 +43,6 @@
43
43
  "types": "./types/meshmakers-octo-ui.d.ts",
44
44
  "default": "./fesm2022/meshmakers-octo-ui.mjs"
45
45
  }
46
- }
46
+ },
47
+ "type": "module"
47
48
  }
@@ -1329,6 +1329,11 @@ interface CreateInput {
1329
1329
  * For child creation this is typically 'Basic/TreeNode'; for root-level it is 'Basic/Tree'.
1330
1330
  */
1331
1331
  derivedFromRtCkTypeId?: string;
1332
+ /**
1333
+ * Optional override for the parent association role name. Defaults to "parent" (Basic/TreeNode convention).
1334
+ * Set this when creating an entity whose CK Type defines the parent link under a different role name.
1335
+ */
1336
+ parentRoleName?: string;
1332
1337
  }
1333
1338
  interface CreateOutput {
1334
1339
  success: boolean;
@@ -1479,6 +1484,7 @@ declare class RuntimeBrowserDataSource extends OctoGraphQlHierarchyDataSource<Br
1479
1484
  private readonly getCkModelByIdDtoGQL;
1480
1485
  private readonly deleteEntitiesDtoGQL;
1481
1486
  private readonly getRuntimeEntityAssociationsByIdDtoGQL;
1487
+ private readonly updateRuntimeEntitiesDtoGQL;
1482
1488
  private readonly updateTreeNodesDtoGQL;
1483
1489
  private readonly typeHelperService;
1484
1490
  private isCkModelsRoot;
@@ -1510,6 +1516,23 @@ declare class RuntimeBrowserDataSource extends OctoGraphQlHierarchyDataSource<Br
1510
1516
  * @returns true if association was successfully swapped.
1511
1517
  */
1512
1518
  updateParentChildAssociation(srcObjRtId: string, oldParentCkTypeId: string, oldParentRtId: string, newParentCkTypeId: string, newParentRtId: string): Promise<boolean>;
1519
+ /**
1520
+ * Moves an entity to a new parent using the generic `runtimeEntities.update` mutation.
1521
+ * Works for any entity type (not just Basic/TreeNode).
1522
+ *
1523
+ * Uses the `associations` field on `RtEntityInputDto` with `roleName` set to
1524
+ * the navigation property name (e.g. "parent") and modOption CREATE/DELETE.
1525
+ *
1526
+ * @param srcObjRtId Runtime ID of the entity being moved.
1527
+ * @param srcObjCkTypeId CK type of the entity being moved.
1528
+ * @param navigationPropertyName Navigation property for the parent association (e.g. "parent").
1529
+ * @param oldParentCkTypeId CK type of the current parent.
1530
+ * @param oldParentRtId Runtime ID of the current parent.
1531
+ * @param newParentCkTypeId CK type of the new parent.
1532
+ * @param newParentRtId Runtime ID of the new parent.
1533
+ * @returns true if the move succeeded.
1534
+ */
1535
+ updateEntityAssociation(srcObjRtId: string, srcObjCkTypeId: string, navigationPropertyName: string, oldParentCkTypeId: string, oldParentRtId: string, newParentCkTypeId: string, newParentRtId: string): Promise<boolean>;
1513
1536
  /**
1514
1537
  * Returns ckTypeId and rtId of a parent of given runtime entity.
1515
1538
  *
@@ -1552,6 +1575,7 @@ declare class RuntimeBrowserComponent implements AfterViewInit {
1552
1575
  private readonly stateService;
1553
1576
  private readonly typeHelperService;
1554
1577
  private readonly notificationService;
1578
+ private readonly associationValidationService;
1555
1579
  private isSelectedItemAnRtEntity;
1556
1580
  private isLoading;
1557
1581
  private isEditing;
@@ -1709,6 +1733,58 @@ declare function createRuntimeBrowserRoutes(options: RuntimeBrowserRouteOptions)
1709
1733
  */
1710
1734
  declare const RUNTIME_BROWSER_MESSAGES: InjectionToken<RuntimeBrowserMessages>;
1711
1735
 
1736
+ /** Single CK association role extracted from the query result. */
1737
+ interface CkAssociationRole {
1738
+ roleId: string;
1739
+ rtRoleId: string;
1740
+ targetCkTypeId: string;
1741
+ rtTargetCkTypeId: string;
1742
+ multiplicity: string;
1743
+ navigationPropertyName: string;
1744
+ }
1745
+ /** Result of a move-validation check. */
1746
+ interface MoveValidationResult {
1747
+ allowed: boolean;
1748
+ /** The runtime role ID to use for the association mutation (e.g. "System/ParentChild"). */
1749
+ rtRoleId?: string;
1750
+ /** The versioned role ID (e.g. "System-2.0.8/ParentChild-1"). */
1751
+ roleId?: string;
1752
+ /** Navigation property name on the source entity (e.g. "Parent"). */
1753
+ navigationPropertyName?: string;
1754
+ /** Reason when move is not allowed. */
1755
+ reason?: string;
1756
+ }
1757
+ /**
1758
+ * Validates whether a drag-and-drop move (reparenting) is allowed by the CK model.
1759
+ *
1760
+ * Strategy: query the SOURCE type's OUTBOUND association roles and look for a
1761
+ * `System/ParentChild` role whose `rtTargetCkTypeId` matches the destination type.
1762
+ * This means "source entity can have a parent of destination type".
1763
+ */
1764
+ declare class AssociationValidationService {
1765
+ private readonly getCkTypeAssociationRolesGQL;
1766
+ /** Cache: sourceCkTypeId → outbound roles */
1767
+ private readonly outRolesCache;
1768
+ /**
1769
+ * Checks whether an entity of `sourceCkTypeId` can be moved (reparented)
1770
+ * to an entity of `destinationCkTypeId` via a ParentChild association.
1771
+ */
1772
+ canMove(sourceCkTypeId: string, destinationCkTypeId: string): Promise<MoveValidationResult>;
1773
+ /**
1774
+ * Fetches and caches the outbound association roles for a given CK type.
1775
+ */
1776
+ private getOutboundRoles;
1777
+ /**
1778
+ * Normalizes navigation property name to lowerCamelCase, matching the
1779
+ * backend convention used by typed input types (e.g. "Parent" → "parent").
1780
+ */
1781
+ private toLowerCamelCase;
1782
+ /** Clears the role cache (e.g. on tenant switch). */
1783
+ clearCache(): void;
1784
+ static ɵfac: i0.ɵɵFactoryDeclaration<AssociationValidationService, never>;
1785
+ static ɵprov: i0.ɵɵInjectableDeclaration<AssociationValidationService>;
1786
+ }
1787
+
1712
1788
  type BrowserItem = RtEntityDto | CkModelDto | CkTypeDto | {
1713
1789
  isCkModelsRoot?: boolean;
1714
1790
  ckModelId?: string;
@@ -1871,5 +1947,5 @@ declare class TenantSwitcherComponent {
1871
1947
  */
1872
1948
  declare function provideOctoUi(): EnvironmentProviders;
1873
1949
 
1874
- export { AttributeSelectorDialogComponent, AttributeSelectorDialogService, AttributeSortSelectorDialogComponent, AttributeSortSelectorDialogService, AttributeValueTypeDto, CkTypeSelectorDialogComponent, CkTypeSelectorDialogService, CkTypeSelectorInputComponent, DEFAULT_RUNTIME_BROWSER_MESSAGES, DefaultPropertyCategory, EntityDetailComponent, EntityIdInfoComponent, FieldFilterEditorComponent, OctoGraphQlDataSource, OctoGraphQlHierarchyDataSource, OctoLoaderComponent, PropertyConverterService, PropertyDisplayMode, PropertyGridComponent, PropertyValueDisplayComponent, RUNTIME_BROWSER_MESSAGES, RtEntityIdHelper, RuntimeBrowserComponent, RuntimeBrowserOutletComponent, RuntimeBrowserPageComponent, RuntimeBrowserStateService, RuntimeEntityVariableDialogComponent, RuntimeEntityVariableDialogService, TenantSwitcherComponent, account_tree, add, analytics, app_registration, article, botService, category, chat, checklist, code, component_exchange, computer, createRuntimeBrowserRoutes, customer, dashboard, event_list, graphic_eq, group, identityService, insert_link, manage_accounts, more_time, notifications, page_info, pages, person_search, playlist_add_check, pool, power, provideOctoUi, publicIcon, query_builder, schedule_send, settings, sort, storage, swagger, swagger_asset, swagger_bot, swagger_communication, swagger_identity, team_dashboard, tenancy, text_snippet, travel_explore, user_diagnostics, webhook, work };
1875
- export type { AttributeSelectorDialogData, AttributeSelectorDialogResult, AttributeSelectorResult, AttributeSortItem, AttributeSortSelectorDialogData, AttributeSortSelectorDialogResult, AttributeSortSelectorResult, BinaryDownloadEvent, BrowserState, CkTypeSelectorDialogData, CkTypeSelectorDialogResult, CkTypeSelectorResult, FieldFilterItem, FilterVariable, PropertyChangeEvent, PropertyGridConfig, PropertyGridItem, RtEntityId, RuntimeBrowserMessages, RuntimeBrowserRouteOptions, RuntimeEntityVariableDialogData, RuntimeEntityVariableDialogResult, RuntimeEntityVariableMapping, RuntimeEntityVariableResult, SortOption };
1950
+ export { AssociationValidationService, AttributeSelectorDialogComponent, AttributeSelectorDialogService, AttributeSortSelectorDialogComponent, AttributeSortSelectorDialogService, AttributeValueTypeDto, CkTypeSelectorDialogComponent, CkTypeSelectorDialogService, CkTypeSelectorInputComponent, DEFAULT_RUNTIME_BROWSER_MESSAGES, DefaultPropertyCategory, EntityDetailComponent, EntityIdInfoComponent, FieldFilterEditorComponent, OctoGraphQlDataSource, OctoGraphQlHierarchyDataSource, OctoLoaderComponent, PropertyConverterService, PropertyDisplayMode, PropertyGridComponent, PropertyValueDisplayComponent, RUNTIME_BROWSER_MESSAGES, RtEntityIdHelper, RuntimeBrowserComponent, RuntimeBrowserOutletComponent, RuntimeBrowserPageComponent, RuntimeBrowserStateService, RuntimeEntityVariableDialogComponent, RuntimeEntityVariableDialogService, TenantSwitcherComponent, account_tree, add, analytics, app_registration, article, botService, category, chat, checklist, code, component_exchange, computer, createRuntimeBrowserRoutes, customer, dashboard, event_list, graphic_eq, group, identityService, insert_link, manage_accounts, more_time, notifications, page_info, pages, person_search, playlist_add_check, pool, power, provideOctoUi, publicIcon, query_builder, schedule_send, settings, sort, storage, swagger, swagger_asset, swagger_bot, swagger_communication, swagger_identity, team_dashboard, tenancy, text_snippet, travel_explore, user_diagnostics, webhook, work };
1951
+ export type { AttributeSelectorDialogData, AttributeSelectorDialogResult, AttributeSelectorResult, AttributeSortItem, AttributeSortSelectorDialogData, AttributeSortSelectorDialogResult, AttributeSortSelectorResult, BinaryDownloadEvent, BrowserItem, BrowserState, CkAssociationRole, CkTypeSelectorDialogData, CkTypeSelectorDialogResult, CkTypeSelectorResult, FieldFilterItem, FilterVariable, MoveValidationResult, PropertyChangeEvent, PropertyGridConfig, PropertyGridItem, RtEntityId, RuntimeBrowserMessages, RuntimeBrowserRouteOptions, RuntimeEntityVariableDialogData, RuntimeEntityVariableDialogResult, RuntimeEntityVariableMapping, RuntimeEntityVariableResult, SortOption };