-
-
window.dispatchEvent(new CustomEvent('model-text-edit-start'))}
- onBlur={() => window.dispatchEvent(new CustomEvent('model-text-edit-end'))}
- onChange={event => onUpdateAssociationRole?.(edge.id, side, event.target.value)}
- />
+ {endpoints.map(({ side, name, isAssociation, multiplicity, role }) => {
+ const endpointLabel = isComposition ? (side === 'A' ? 'Part' : 'Whole (composite)') : `Endpoint ${side}`
+ return (
+
+
+
{isComposition ? endpointLabel : isAssociation ? 'Association' : edge.type === 'associativeAssociation' ? 'Class' : `Class ${side}`}
+
{name}
- )}
-
- ))}
+ {canEditMultiplicity && (
+
+
+ onUpdateAssociationMultiplicity?.(
+ edge.id, side, value === UNDEFINED_MULTIPLICITY_VALUE ? '' : value,
+ )}
+ />
+
+ )}
+ {canEditRole && (
+
+
+ window.dispatchEvent(new CustomEvent('model-text-edit-start'))}
+ onBlur={() => window.dispatchEvent(new CustomEvent('model-text-edit-end'))}
+ onChange={event => onUpdateAssociationRole?.(edge.id, side, event.target.value)}
+ />
+
+ )}
+
+ )
+ })}
{canToggleComposition ? (
@@ -353,6 +359,21 @@ export default function AssociationsPanelItem({
/>
Composite aggregation
+ {isComposition && (
+
+
+ onUpdateAssociationWhole?.(edge.id, nodeId)}
+ />
+
+ )}
) : null}
{canEditLineStyle ? (
diff --git a/src/components/panels/refs/EndpointConnector.jsx b/src/components/panels/refs/EndpointConnector.jsx
index 32595f7..e729189 100644
--- a/src/components/panels/refs/EndpointConnector.jsx
+++ b/src/components/panels/refs/EndpointConnector.jsx
@@ -1,8 +1,11 @@
-export default function EndpointConnector({ directional = false }) {
+export default function EndpointConnector({ directional = false, composition = false }) {
return (