@finos/legend-application-studio 23.1.4 → 23.1.6
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/lib/components/editor/edit-panel/FunctionEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/FunctionEditor.js +6 -4
- package/lib/components/editor/edit-panel/FunctionEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/GenerationSpecificationEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/GenerationSpecificationEditor.js +4 -4
- package/lib/components/editor/edit-panel/GenerationSpecificationEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/ClassEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/ClassEditor.js +34 -26
- package/lib/components/editor/edit-panel/uml-editor/ClassEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/EnumerationEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/EnumerationEditor.js +5 -3
- package/lib/components/editor/edit-panel/uml-editor/EnumerationEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/ProfileEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/ProfileEditor.js +10 -6
- package/lib/components/editor/edit-panel/uml-editor/ProfileEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/StereotypeSelector.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/StereotypeSelector.js +5 -3
- package/lib/components/editor/edit-panel/uml-editor/StereotypeSelector.js.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/TaggedValueEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/TaggedValueEditor.js +6 -4
- package/lib/components/editor/edit-panel/uml-editor/TaggedValueEditor.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +2 -2
- package/package.json +11 -11
- package/src/components/editor/edit-panel/FunctionEditor.tsx +132 -125
- package/src/components/editor/edit-panel/GenerationSpecificationEditor.tsx +43 -44
- package/src/components/editor/edit-panel/uml-editor/ClassEditor.tsx +156 -116
- package/src/components/editor/edit-panel/uml-editor/EnumerationEditor.tsx +46 -36
- package/src/components/editor/edit-panel/uml-editor/ProfileEditor.tsx +80 -62
- package/src/components/editor/edit-panel/uml-editor/StereotypeSelector.tsx +62 -54
- package/src/components/editor/edit-panel/uml-editor/TaggedValueEditor.tsx +98 -92
|
@@ -41,9 +41,9 @@ import {
|
|
|
41
41
|
PanelDropZone,
|
|
42
42
|
DragPreviewLayer,
|
|
43
43
|
useDragPreviewLayer,
|
|
44
|
-
PanelEntryDropZonePlaceholder,
|
|
45
44
|
Panel,
|
|
46
45
|
PanelContent,
|
|
46
|
+
PanelDnDEntry,
|
|
47
47
|
} from '@finos/legend-art';
|
|
48
48
|
import {
|
|
49
49
|
CORE_DND_TYPE,
|
|
@@ -178,49 +178,48 @@ const ModelGenerationItem = observer(
|
|
|
178
178
|
useDragPreviewLayer(dragPreviewConnector);
|
|
179
179
|
|
|
180
180
|
return (
|
|
181
|
-
<
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
</div>
|
|
181
|
+
<PanelDnDEntry
|
|
182
|
+
ref={ref}
|
|
183
|
+
className="generation-spec-model-generation-editor__item"
|
|
184
|
+
showPlaceholder={isBeingDragged}
|
|
185
|
+
>
|
|
186
|
+
<div className="btn--sm generation-spec-model-generation-editor__item__label">
|
|
187
|
+
{getElementIcon(editorStore, modelGeneration)}
|
|
188
|
+
</div>
|
|
189
|
+
<input
|
|
190
|
+
className={clsx('generation-spec-model-generation-editor__item__id', {
|
|
191
|
+
'generation-spec-model-generation-editor__item__id--has-error':
|
|
192
|
+
!isUnique,
|
|
193
|
+
})}
|
|
194
|
+
spellCheck={false}
|
|
195
|
+
value={isDefault ? 'DEFAULT' : generationTreeNode.id}
|
|
196
|
+
onChange={changeNodeId}
|
|
197
|
+
disabled={isDefault}
|
|
198
|
+
/>
|
|
199
|
+
<CustomSelectorInput
|
|
200
|
+
className="generation-spec-model-generation-editor__item__dropdown"
|
|
201
|
+
options={options}
|
|
202
|
+
onChange={onChange}
|
|
203
|
+
value={value}
|
|
204
|
+
darkMode={true}
|
|
205
|
+
/>
|
|
206
|
+
<button
|
|
207
|
+
className="btn--dark btn--sm"
|
|
208
|
+
onClick={visitModelGeneration}
|
|
209
|
+
tabIndex={-1}
|
|
210
|
+
title="See mapping"
|
|
211
|
+
>
|
|
212
|
+
<LongArrowRightIcon />
|
|
213
|
+
</button>
|
|
214
|
+
<button
|
|
215
|
+
className="generation-spec-model-generation-editor__item__remove-btn"
|
|
216
|
+
onClick={deleteNode}
|
|
217
|
+
tabIndex={-1}
|
|
218
|
+
title="Remove"
|
|
219
|
+
>
|
|
220
|
+
<TimesIcon />
|
|
221
|
+
</button>
|
|
222
|
+
</PanelDnDEntry>
|
|
224
223
|
);
|
|
225
224
|
},
|
|
226
225
|
);
|
|
@@ -40,12 +40,12 @@ import {
|
|
|
40
40
|
ArrowCircleRightIcon,
|
|
41
41
|
FireIcon,
|
|
42
42
|
StickArrowCircleRightIcon,
|
|
43
|
-
|
|
44
|
-
PanelEntryDropZonePlaceholder,
|
|
43
|
+
PanelDnDEntryDragHandle,
|
|
45
44
|
DragPreviewLayer,
|
|
46
45
|
useDragPreviewLayer,
|
|
47
46
|
PanelDropZone,
|
|
48
47
|
Panel,
|
|
48
|
+
PanelDnDEntry,
|
|
49
49
|
} from '@finos/legend-art';
|
|
50
50
|
import { LEGEND_STUDIO_TEST_ID } from '../../../../application/LegendStudioTesting.js';
|
|
51
51
|
import { PropertyEditor } from './PropertyEditor.js';
|
|
@@ -149,6 +149,8 @@ const PropertyBasicEditor = observer(
|
|
|
149
149
|
isReadOnly: boolean;
|
|
150
150
|
}) => {
|
|
151
151
|
const ref = useRef<HTMLDivElement>(null);
|
|
152
|
+
const handleRef = useRef<HTMLDivElement>(null);
|
|
153
|
+
|
|
152
154
|
const { property, _class, editorState, deleteProperty, isReadOnly } = props;
|
|
153
155
|
|
|
154
156
|
const editorStore = useEditorStore();
|
|
@@ -266,7 +268,8 @@ const PropertyBasicEditor = observer(
|
|
|
266
268
|
}),
|
|
267
269
|
[property],
|
|
268
270
|
);
|
|
269
|
-
dragConnector(
|
|
271
|
+
dragConnector(handleRef);
|
|
272
|
+
dropConnector(ref);
|
|
270
273
|
useDragPreviewLayer(dragPreviewConnector);
|
|
271
274
|
|
|
272
275
|
// Other
|
|
@@ -283,10 +286,20 @@ const PropertyBasicEditor = observer(
|
|
|
283
286
|
editorStore.graphEditorMode.openElement(property._OWNER);
|
|
284
287
|
|
|
285
288
|
return (
|
|
286
|
-
|
|
287
|
-
<
|
|
289
|
+
<>
|
|
290
|
+
<PanelDnDEntry
|
|
291
|
+
ref={ref}
|
|
292
|
+
placeholder={<div className="dnd__placeholder--light"></div>}
|
|
293
|
+
showPlaceholder={isBeingDragged}
|
|
294
|
+
className="property-basic-editor__container"
|
|
295
|
+
>
|
|
296
|
+
{!isIndirectProperty && (
|
|
297
|
+
<PanelDnDEntryDragHandle
|
|
298
|
+
isBeingDragged={isBeingDragged}
|
|
299
|
+
dropTargetConnector={handleRef}
|
|
300
|
+
/>
|
|
301
|
+
)}
|
|
288
302
|
<div className="property-basic-editor">
|
|
289
|
-
{!isIndirectProperty && <PanelEntryDragHandle />}
|
|
290
303
|
{isIndirectProperty && (
|
|
291
304
|
<div className="property-basic-editor__name property-basic-editor__name--with-lock">
|
|
292
305
|
<div className="property-basic-editor__name--with-lock__icon">
|
|
@@ -458,8 +471,8 @@ const PropertyBasicEditor = observer(
|
|
|
458
471
|
</button>
|
|
459
472
|
)}
|
|
460
473
|
</div>
|
|
461
|
-
</
|
|
462
|
-
|
|
474
|
+
</PanelDnDEntry>
|
|
475
|
+
</>
|
|
463
476
|
);
|
|
464
477
|
},
|
|
465
478
|
);
|
|
@@ -479,6 +492,8 @@ const DerivedPropertyBasicEditor = observer(
|
|
|
479
492
|
isReadOnly: boolean;
|
|
480
493
|
}) => {
|
|
481
494
|
const ref = useRef<HTMLDivElement>(null);
|
|
495
|
+
const handleRef = useRef<HTMLDivElement>(null);
|
|
496
|
+
|
|
482
497
|
const {
|
|
483
498
|
derivedProperty,
|
|
484
499
|
_class,
|
|
@@ -617,7 +632,8 @@ const DerivedPropertyBasicEditor = observer(
|
|
|
617
632
|
}),
|
|
618
633
|
[derivedProperty],
|
|
619
634
|
);
|
|
620
|
-
dragConnector(
|
|
635
|
+
dragConnector(handleRef);
|
|
636
|
+
dropConnector(ref);
|
|
621
637
|
useDragPreviewLayer(dragPreviewConnector);
|
|
622
638
|
|
|
623
639
|
// Action
|
|
@@ -642,10 +658,12 @@ const DerivedPropertyBasicEditor = observer(
|
|
|
642
658
|
});
|
|
643
659
|
|
|
644
660
|
return (
|
|
645
|
-
|
|
646
|
-
<
|
|
661
|
+
<>
|
|
662
|
+
<PanelDnDEntry
|
|
663
|
+
ref={ref}
|
|
664
|
+
placeholder={<div className="uml-element-editor__dnd__placeholder" />}
|
|
665
|
+
className="derived-property-editor__container"
|
|
647
666
|
showPlaceholder={isBeingDragged}
|
|
648
|
-
className="derived-property-editor__dnd__placeholder"
|
|
649
667
|
>
|
|
650
668
|
<div
|
|
651
669
|
className={clsx('derived-property-editor', {
|
|
@@ -654,6 +672,12 @@ const DerivedPropertyBasicEditor = observer(
|
|
|
654
672
|
})}
|
|
655
673
|
>
|
|
656
674
|
<div className="property-basic-editor">
|
|
675
|
+
{!isInheritedProperty && (
|
|
676
|
+
<PanelDnDEntryDragHandle
|
|
677
|
+
dropTargetConnector={handleRef}
|
|
678
|
+
isBeingDragged={isBeingDragged}
|
|
679
|
+
/>
|
|
680
|
+
)}
|
|
657
681
|
{isInheritedProperty && (
|
|
658
682
|
<div className="property-basic-editor__name property-basic-editor__name--with-lock">
|
|
659
683
|
<div className="property-basic-editor__name--with-lock__icon">
|
|
@@ -664,7 +688,6 @@ const DerivedPropertyBasicEditor = observer(
|
|
|
664
688
|
</span>
|
|
665
689
|
</div>
|
|
666
690
|
)}
|
|
667
|
-
{!isInheritedProperty && <PanelEntryDragHandle />}
|
|
668
691
|
{!isInheritedProperty && (
|
|
669
692
|
<input
|
|
670
693
|
disabled={isReadOnly}
|
|
@@ -828,8 +851,8 @@ const DerivedPropertyBasicEditor = observer(
|
|
|
828
851
|
onEditorFocus={onLambdaEditorFocus}
|
|
829
852
|
/>
|
|
830
853
|
</div>
|
|
831
|
-
</
|
|
832
|
-
|
|
854
|
+
</PanelDnDEntry>
|
|
855
|
+
</>
|
|
833
856
|
);
|
|
834
857
|
},
|
|
835
858
|
);
|
|
@@ -849,6 +872,8 @@ const ConstraintEditor = observer(
|
|
|
849
872
|
isReadOnly: boolean;
|
|
850
873
|
}) => {
|
|
851
874
|
const ref = useRef<HTMLDivElement>(null);
|
|
875
|
+
const handleRef = useRef<HTMLDivElement>(null);
|
|
876
|
+
|
|
852
877
|
const { constraint, _class, deleteConstraint, editorState, isReadOnly } =
|
|
853
878
|
props;
|
|
854
879
|
const editorStore = useEditorStore();
|
|
@@ -902,7 +927,8 @@ const ConstraintEditor = observer(
|
|
|
902
927
|
}),
|
|
903
928
|
[constraint],
|
|
904
929
|
);
|
|
905
|
-
dragConnector(
|
|
930
|
+
dragConnector(handleRef);
|
|
931
|
+
dropConnector(ref);
|
|
906
932
|
useDragPreviewLayer(dragPreviewConnector);
|
|
907
933
|
|
|
908
934
|
// Actions
|
|
@@ -922,74 +948,79 @@ const ConstraintEditor = observer(
|
|
|
922
948
|
editorStore.graphEditorMode.openElement(constraint._OWNER);
|
|
923
949
|
|
|
924
950
|
return (
|
|
925
|
-
<
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
951
|
+
<PanelDnDEntry
|
|
952
|
+
ref={ref}
|
|
953
|
+
placeholder={<div className="uml-element-editor__dnd__placeholder" />}
|
|
954
|
+
className="constraint-editor__container"
|
|
955
|
+
showPlaceholder={isBeingDragged}
|
|
956
|
+
>
|
|
957
|
+
<div
|
|
958
|
+
className={clsx('constraint-editor', {
|
|
959
|
+
backdrop__element: constraintState.parserError,
|
|
960
|
+
})}
|
|
929
961
|
>
|
|
930
|
-
<div
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
</div>
|
|
942
|
-
<span className="constraint-editor__content__name--with-lock__name">
|
|
943
|
-
{constraint.name}
|
|
944
|
-
</span>
|
|
962
|
+
<div className="constraint-editor__content">
|
|
963
|
+
{!isInheritedConstraint && (
|
|
964
|
+
<PanelDnDEntryDragHandle
|
|
965
|
+
dropTargetConnector={handleRef}
|
|
966
|
+
isBeingDragged={isBeingDragged}
|
|
967
|
+
/>
|
|
968
|
+
)}
|
|
969
|
+
{isInheritedConstraint && (
|
|
970
|
+
<div className="constraint-editor__content__name--with-lock">
|
|
971
|
+
<div className="constraint-editor__content__name--with-lock__icon">
|
|
972
|
+
<LockIcon />
|
|
945
973
|
</div>
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
<
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
isReadOnly ||
|
|
983
|
-
isInheritedConstraint
|
|
984
|
-
}
|
|
985
|
-
lambdaEditorState={constraintState}
|
|
986
|
-
forceBackdrop={hasParserError}
|
|
987
|
-
expectedType={PrimitiveType.BOOLEAN}
|
|
988
|
-
onEditorFocus={onLambdaEditorFocus}
|
|
989
|
-
/>
|
|
974
|
+
<span className="constraint-editor__content__name--with-lock__name">
|
|
975
|
+
{constraint.name}
|
|
976
|
+
</span>
|
|
977
|
+
</div>
|
|
978
|
+
)}
|
|
979
|
+
{!isInheritedConstraint && (
|
|
980
|
+
<input
|
|
981
|
+
className="constraint-editor__content__name"
|
|
982
|
+
spellCheck={false}
|
|
983
|
+
disabled={isReadOnly || isInheritedConstraint}
|
|
984
|
+
value={constraint.name}
|
|
985
|
+
onChange={changeName}
|
|
986
|
+
placeholder="Constraint name"
|
|
987
|
+
/>
|
|
988
|
+
)}
|
|
989
|
+
{isInheritedConstraint && (
|
|
990
|
+
<button
|
|
991
|
+
className="uml-element-editor__visit-parent-element-btn"
|
|
992
|
+
onClick={visitOwner}
|
|
993
|
+
tabIndex={-1}
|
|
994
|
+
title={`Visit super type class ${constraint._OWNER.path}`}
|
|
995
|
+
>
|
|
996
|
+
<ArrowCircleRightIcon />
|
|
997
|
+
</button>
|
|
998
|
+
)}
|
|
999
|
+
{!isInheritedConstraint && !isReadOnly && (
|
|
1000
|
+
<button
|
|
1001
|
+
className="uml-element-editor__remove-btn"
|
|
1002
|
+
disabled={isInheritedConstraint}
|
|
1003
|
+
onClick={remove}
|
|
1004
|
+
tabIndex={-1}
|
|
1005
|
+
title="Remove"
|
|
1006
|
+
>
|
|
1007
|
+
<TimesIcon />
|
|
1008
|
+
</button>
|
|
1009
|
+
)}
|
|
990
1010
|
</div>
|
|
991
|
-
|
|
992
|
-
|
|
1011
|
+
<LambdaEditor
|
|
1012
|
+
disabled={
|
|
1013
|
+
editorState.classState.isConvertingConstraintLambdaObjects ||
|
|
1014
|
+
isReadOnly ||
|
|
1015
|
+
isInheritedConstraint
|
|
1016
|
+
}
|
|
1017
|
+
lambdaEditorState={constraintState}
|
|
1018
|
+
forceBackdrop={hasParserError}
|
|
1019
|
+
expectedType={PrimitiveType.BOOLEAN}
|
|
1020
|
+
onEditorFocus={onLambdaEditorFocus}
|
|
1021
|
+
/>
|
|
1022
|
+
</div>
|
|
1023
|
+
</PanelDnDEntry>
|
|
993
1024
|
);
|
|
994
1025
|
},
|
|
995
1026
|
);
|
|
@@ -1008,6 +1039,8 @@ const SuperTypeEditor = observer(
|
|
|
1008
1039
|
isReadOnly: boolean;
|
|
1009
1040
|
}) => {
|
|
1010
1041
|
const ref = useRef<HTMLDivElement>(null);
|
|
1042
|
+
const handleRef = useRef<HTMLDivElement>(null);
|
|
1043
|
+
|
|
1011
1044
|
const { superType, _class, deleteSuperType, isReadOnly } = props;
|
|
1012
1045
|
const editorStore = useEditorStore();
|
|
1013
1046
|
// Type
|
|
@@ -1061,7 +1094,8 @@ const SuperTypeEditor = observer(
|
|
|
1061
1094
|
}),
|
|
1062
1095
|
[superType],
|
|
1063
1096
|
);
|
|
1064
|
-
dragConnector(
|
|
1097
|
+
dragConnector(handleRef);
|
|
1098
|
+
dropConnector(ref);
|
|
1065
1099
|
useDragPreviewLayer(dragPreviewConnector);
|
|
1066
1100
|
|
|
1067
1101
|
const rawType = superType.value.rawType;
|
|
@@ -1078,44 +1112,50 @@ const SuperTypeEditor = observer(
|
|
|
1078
1112
|
editorStore.graphEditorMode.openElement(rawType);
|
|
1079
1113
|
|
|
1080
1114
|
return (
|
|
1081
|
-
<
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1115
|
+
<PanelDnDEntry
|
|
1116
|
+
ref={ref}
|
|
1117
|
+
placeholder={<div className="uml-element-editor__dnd__placeholder" />}
|
|
1118
|
+
className="super-type-editor__container"
|
|
1119
|
+
showPlaceholder={isBeingDragged}
|
|
1120
|
+
>
|
|
1121
|
+
<PanelDnDEntryDragHandle
|
|
1122
|
+
dropTargetConnector={handleRef}
|
|
1123
|
+
isBeingDragged={isBeingDragged}
|
|
1124
|
+
/>
|
|
1125
|
+
<div className="super-type-editor">
|
|
1126
|
+
<CustomSelectorInput
|
|
1127
|
+
className="super-type-editor__class"
|
|
1128
|
+
disabled={isReadOnly}
|
|
1129
|
+
options={superTypeOptions}
|
|
1130
|
+
onChange={changeType}
|
|
1131
|
+
value={selectedType}
|
|
1132
|
+
placeholder="Choose a class"
|
|
1133
|
+
filterOption={filterOption}
|
|
1134
|
+
formatOptionLabel={getPackageableElementOptionFormatter({
|
|
1135
|
+
graph: editorStore.graphManagerState.graph,
|
|
1136
|
+
})}
|
|
1137
|
+
/>
|
|
1138
|
+
<button
|
|
1139
|
+
className="uml-element-editor__basic__detail-btn"
|
|
1140
|
+
onClick={visitDerivationSource}
|
|
1141
|
+
tabIndex={-1}
|
|
1142
|
+
title="Visit super type"
|
|
1143
|
+
>
|
|
1144
|
+
<LongArrowRightIcon />
|
|
1145
|
+
</button>
|
|
1146
|
+
{!isReadOnly && (
|
|
1097
1147
|
<button
|
|
1098
|
-
className="uml-element-
|
|
1099
|
-
|
|
1148
|
+
className="uml-element-editor__remove-btn"
|
|
1149
|
+
disabled={isReadOnly}
|
|
1150
|
+
onClick={deleteSuperType}
|
|
1100
1151
|
tabIndex={-1}
|
|
1101
|
-
title="
|
|
1152
|
+
title="Remove"
|
|
1102
1153
|
>
|
|
1103
|
-
<
|
|
1154
|
+
<TimesIcon />
|
|
1104
1155
|
</button>
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
disabled={isReadOnly}
|
|
1109
|
-
onClick={deleteSuperType}
|
|
1110
|
-
tabIndex={-1}
|
|
1111
|
-
title="Remove"
|
|
1112
|
-
>
|
|
1113
|
-
<TimesIcon />
|
|
1114
|
-
</button>
|
|
1115
|
-
)}
|
|
1116
|
-
</div>
|
|
1117
|
-
</PanelEntryDropZonePlaceholder>
|
|
1118
|
-
</div>
|
|
1156
|
+
)}
|
|
1157
|
+
</div>
|
|
1158
|
+
</PanelDnDEntry>
|
|
1119
1159
|
);
|
|
1120
1160
|
},
|
|
1121
1161
|
);
|
|
@@ -42,13 +42,13 @@ import {
|
|
|
42
42
|
LockIcon,
|
|
43
43
|
FireIcon,
|
|
44
44
|
StickArrowCircleRightIcon,
|
|
45
|
-
|
|
46
|
-
PanelEntryDropZonePlaceholder,
|
|
45
|
+
PanelDnDEntryDragHandle,
|
|
47
46
|
DragPreviewLayer,
|
|
48
47
|
useDragPreviewLayer,
|
|
49
48
|
PanelDropZone,
|
|
50
49
|
Panel,
|
|
51
50
|
PanelContent,
|
|
51
|
+
PanelDnDEntry,
|
|
52
52
|
} from '@finos/legend-art';
|
|
53
53
|
import { LEGEND_STUDIO_TEST_ID } from '../../../../application/LegendStudioTesting.js';
|
|
54
54
|
import {
|
|
@@ -100,6 +100,8 @@ const EnumBasicEditor = observer(
|
|
|
100
100
|
isReadOnly: boolean;
|
|
101
101
|
}) => {
|
|
102
102
|
const ref = useRef<HTMLDivElement>(null);
|
|
103
|
+
const handleRef = useRef<HTMLDivElement>(null);
|
|
104
|
+
|
|
103
105
|
const { enumValue, selectValue, deleteValue, isReadOnly } = props;
|
|
104
106
|
const changeValue: React.ChangeEventHandler<HTMLInputElement> = (event) => {
|
|
105
107
|
enum_setName(enumValue, event.target.value);
|
|
@@ -148,47 +150,55 @@ const EnumBasicEditor = observer(
|
|
|
148
150
|
}),
|
|
149
151
|
[enumValue],
|
|
150
152
|
);
|
|
151
|
-
dragConnector(
|
|
153
|
+
dragConnector(handleRef);
|
|
154
|
+
dropConnector(ref);
|
|
152
155
|
useDragPreviewLayer(dragPreviewConnector);
|
|
153
156
|
|
|
154
157
|
return (
|
|
155
|
-
<
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
158
|
+
<PanelDnDEntry
|
|
159
|
+
ref={ref}
|
|
160
|
+
showPlaceholder={isBeingDragged}
|
|
161
|
+
placeholder={<div className="dnd__placeholder--light"></div>}
|
|
162
|
+
className="enum-basic-editor__container"
|
|
163
|
+
>
|
|
164
|
+
<PanelDnDEntryDragHandle
|
|
165
|
+
dropTargetConnector={handleRef}
|
|
166
|
+
isBeingDragged={isBeingDragged}
|
|
167
|
+
/>
|
|
168
|
+
|
|
169
|
+
<div className="enum-basic-editor">
|
|
170
|
+
<InputWithInlineValidation
|
|
171
|
+
className="enum-basic-editor__name input-group__input"
|
|
172
|
+
spellCheck={false}
|
|
173
|
+
disabled={isReadOnly}
|
|
174
|
+
value={enumValue.name}
|
|
175
|
+
onChange={changeValue}
|
|
176
|
+
placeholder="Enum name"
|
|
177
|
+
validationErrorMessage={
|
|
178
|
+
isEnumValueDuplicated(enumValue) ? 'Duplicated enum' : undefined
|
|
179
|
+
}
|
|
180
|
+
/>
|
|
181
|
+
<button
|
|
182
|
+
className="uml-element-editor__basic__detail-btn"
|
|
183
|
+
onClick={selectValue}
|
|
184
|
+
tabIndex={-1}
|
|
185
|
+
title="See detail"
|
|
186
|
+
>
|
|
187
|
+
<LongArrowRightIcon />
|
|
188
|
+
</button>
|
|
189
|
+
{!isReadOnly && (
|
|
170
190
|
<button
|
|
171
|
-
className="uml-element-
|
|
172
|
-
|
|
191
|
+
className="uml-element-editor__remove-btn"
|
|
192
|
+
disabled={isReadOnly}
|
|
193
|
+
onClick={deleteValue}
|
|
173
194
|
tabIndex={-1}
|
|
174
|
-
title="
|
|
195
|
+
title="Remove"
|
|
175
196
|
>
|
|
176
|
-
<
|
|
197
|
+
<TimesIcon />
|
|
177
198
|
</button>
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
disabled={isReadOnly}
|
|
182
|
-
onClick={deleteValue}
|
|
183
|
-
tabIndex={-1}
|
|
184
|
-
title="Remove"
|
|
185
|
-
>
|
|
186
|
-
<TimesIcon />
|
|
187
|
-
</button>
|
|
188
|
-
)}
|
|
189
|
-
</div>
|
|
190
|
-
</PanelEntryDropZonePlaceholder>
|
|
191
|
-
</div>
|
|
199
|
+
)}
|
|
200
|
+
</div>
|
|
201
|
+
</PanelDnDEntry>
|
|
192
202
|
);
|
|
193
203
|
},
|
|
194
204
|
);
|