@elyra/canvas 12.32.1 → 12.33.0

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.
Files changed (81) hide show
  1. package/dist/{_baseIteratee-eabd2a94.js → _baseIteratee-2a601011.js} +2 -2
  2. package/dist/{_baseIteratee-eabd2a94.js.map → _baseIteratee-2a601011.js.map} +1 -1
  3. package/dist/{_baseIteratee-e1311552.js → _baseIteratee-7fb1949c.js} +2 -2
  4. package/dist/{_baseIteratee-e1311552.js.map → _baseIteratee-7fb1949c.js.map} +1 -1
  5. package/dist/canvas-controller-2df80dc3.js +2 -0
  6. package/dist/canvas-controller-2df80dc3.js.map +1 -0
  7. package/dist/canvas-controller-c0b65951.js +2 -0
  8. package/dist/canvas-controller-c0b65951.js.map +1 -0
  9. package/dist/{common-canvas-159fb083.js → common-canvas-da94213a.js} +2 -2
  10. package/dist/{common-canvas-318d3486.js.map → common-canvas-da94213a.js.map} +1 -1
  11. package/dist/{common-canvas-318d3486.js → common-canvas-dcc564f1.js} +2 -2
  12. package/dist/{common-canvas-159fb083.js.map → common-canvas-dcc564f1.js.map} +1 -1
  13. package/dist/common-canvas.es.js +1 -1
  14. package/dist/common-canvas.js +1 -1
  15. package/dist/common-properties-c6bc9d53.js +2 -0
  16. package/dist/common-properties-c6bc9d53.js.map +1 -0
  17. package/dist/common-properties-e3da18c4.js +2 -0
  18. package/dist/common-properties-e3da18c4.js.map +1 -0
  19. package/dist/{flexible-table-4259d869.js → flexible-table-11488132.js} +2 -2
  20. package/dist/flexible-table-11488132.js.map +1 -0
  21. package/dist/{flexible-table-23d61157.js → flexible-table-a7325a4e.js} +2 -2
  22. package/dist/flexible-table-a7325a4e.js.map +1 -0
  23. package/dist/{icon-8cc7816d.js → icon-111df69c.js} +2 -2
  24. package/dist/{icon-8cc7816d.js.map → icon-111df69c.js.map} +1 -1
  25. package/dist/{icon-04f858ce.js → icon-cc184f86.js} +2 -2
  26. package/dist/{icon-04f858ce.js.map → icon-cc184f86.js.map} +1 -1
  27. package/dist/{index-101f9560.js → index-d75b9194.js} +2 -2
  28. package/dist/{index-101f9560.js.map → index-d75b9194.js.map} +1 -1
  29. package/dist/{index-2788d55d.js → index-e76525b3.js} +2 -2
  30. package/dist/{index-2788d55d.js.map → index-e76525b3.js.map} +1 -1
  31. package/dist/lib/canvas-controller.es.js +1 -1
  32. package/dist/lib/canvas-controller.js +1 -1
  33. package/dist/lib/canvas.es.js +1 -1
  34. package/dist/lib/canvas.js +1 -1
  35. package/dist/lib/properties/field-picker.es.js +1 -1
  36. package/dist/lib/properties/field-picker.js +1 -1
  37. package/dist/lib/properties/flexible-table.es.js +1 -1
  38. package/dist/lib/properties/flexible-table.js +1 -1
  39. package/dist/lib/properties.es.js +1 -1
  40. package/dist/lib/properties.js +1 -1
  41. package/dist/{toolbar-12f6def6.js → toolbar-556dad41.js} +2 -2
  42. package/dist/{toolbar-12f6def6.js.map → toolbar-556dad41.js.map} +1 -1
  43. package/dist/{toolbar-55e2020e.js → toolbar-df55ee97.js} +2 -2
  44. package/dist/{toolbar-55e2020e.js.map → toolbar-df55ee97.js.map} +1 -1
  45. package/locales/common-canvas/locales/de.json +1 -0
  46. package/locales/common-canvas/locales/es.json +1 -0
  47. package/locales/common-canvas/locales/fr.json +1 -0
  48. package/locales/common-canvas/locales/it.json +1 -0
  49. package/locales/common-canvas/locales/ja.json +1 -0
  50. package/locales/common-canvas/locales/ko.json +1 -0
  51. package/locales/common-canvas/locales/pt-br.json +1 -0
  52. package/locales/common-canvas/locales/sv.json +1 -0
  53. package/locales/common-canvas/locales/zh-CN.json +1 -0
  54. package/locales/common-canvas/locales/zh-TW.json +1 -0
  55. package/locales/common-properties/locales/de.json +2 -0
  56. package/locales/common-properties/locales/es.json +2 -0
  57. package/locales/common-properties/locales/fr.json +2 -0
  58. package/locales/common-properties/locales/it.json +2 -0
  59. package/locales/common-properties/locales/ja.json +2 -0
  60. package/locales/common-properties/locales/ko.json +2 -0
  61. package/locales/common-properties/locales/pt-br.json +2 -0
  62. package/locales/common-properties/locales/sv.json +2 -0
  63. package/locales/common-properties/locales/zh-CN.json +2 -0
  64. package/locales/common-properties/locales/zh-TW.json +2 -0
  65. package/package.json +1 -1
  66. package/src/common-canvas/svg-canvas-renderer.js +132 -16
  67. package/src/common-properties/components/flexible-table/flexible-table.jsx +5 -5
  68. package/src/common-properties/constants/constants.js +1 -1
  69. package/src/common-properties/controls/numberfield/numberfield.jsx +21 -2
  70. package/src/object-model/config-utils.js +1 -0
  71. package/stats.html +1 -1
  72. package/dist/canvas-controller-69928ea7.js +0 -2
  73. package/dist/canvas-controller-69928ea7.js.map +0 -1
  74. package/dist/canvas-controller-978f3e99.js +0 -2
  75. package/dist/canvas-controller-978f3e99.js.map +0 -1
  76. package/dist/common-properties-96c9c88a.js +0 -2
  77. package/dist/common-properties-96c9c88a.js.map +0 -1
  78. package/dist/common-properties-c5292c66.js +0 -2
  79. package/dist/common-properties-c5292c66.js.map +0 -1
  80. package/dist/flexible-table-23d61157.js.map +0 -1
  81. package/dist/flexible-table-4259d869.js.map +0 -1
@@ -82,6 +82,8 @@
82
82
  "multi.selected.row.label": "Zeilen ausgewählt.",
83
83
  "multi.selected.row.action": "Durch die Änderung eines Werts in dieser Zeile wird der Wert in allen zulässigen ausgewählten Zeilen geändert.",
84
84
  "datetimefield.format.error.message": "Ungültiges Formatobjekt angegeben. Überprüfen Sie die Eingabedefinitionen.",
85
+ "datepickerRangeStart.default.label": "Starten",
86
+ "datepickerRangeEnd.default.label": "Ende",
85
87
  "editorform.group.type.error": "(Unbekannter Gruppentyp '{group.groupType()}')",
86
88
  "moveable.table.button.top": "An den Anfang",
87
89
  "moveable.table.button.up": "Nach oben",
@@ -82,6 +82,8 @@
82
82
  "multi.selected.row.label": "filas seleccionadas.",
83
83
  "multi.selected.row.action": "Si se cambia un valor en esta fila se cambiará el valor en todas las filas seleccionadas permitidas.",
84
84
  "datetimefield.format.error.message": "Se ha proporcionado un objeto con formato no válido. Compruebe las definiciones de entrada.",
85
+ "datepickerRangeStart.default.label": "Iniciar",
86
+ "datepickerRangeEnd.default.label": "Fin",
85
87
  "editorform.group.type.error": "(Tipo de grupo desconocido '{group.groupType()}')",
86
88
  "moveable.table.button.top": "Subir al principio",
87
89
  "moveable.table.button.up": "Subir",
@@ -82,6 +82,8 @@
82
82
  "multi.selected.row.label": "lignes sélectionnées.",
83
83
  "multi.selected.row.action": "La modification d'une valeur dans cette ligne modifiera la valeur dans toutes les lignes sélectionnées autorisées.",
84
84
  "datetimefield.format.error.message": "Objet de format non valide indiqué. Vérifiez les définitions d'entrée.",
85
+ "datepickerRangeStart.default.label": "Démarrer",
86
+ "datepickerRangeEnd.default.label": "Fin",
85
87
  "editorform.group.type.error": "(Type de groupe inconnu '{group.groupType()}')",
86
88
  "moveable.table.button.top": "Placer en haut",
87
89
  "moveable.table.button.up": "Déplacer vers le haut",
@@ -82,6 +82,8 @@
82
82
  "multi.selected.row.label": "righe selezionate.",
83
83
  "multi.selected.row.action": "La modifica di un valore in questa riga modificherà il valore in tutte le righe selezionate consentite.",
84
84
  "datetimefield.format.error.message": "È stato fornito un oggetto con formato non valido. Controllare le definizioni di input.",
85
+ "datepickerRangeStart.default.label": "Avvio",
86
+ "datepickerRangeEnd.default.label": "Fine",
85
87
  "editorform.group.type.error": "(Tipo di gruppo '{group.groupType()}' sconosciuto)",
86
88
  "moveable.table.button.top": "Sposta in alto",
87
89
  "moveable.table.button.up": "Sposta su",
@@ -82,6 +82,8 @@
82
82
  "multi.selected.row.label": "選択された行。",
83
83
  "multi.selected.row.action": "この行の値を変更すると、許可され選択されたすべての行の値が変更されます。",
84
84
  "datetimefield.format.error.message": "無効なフォーマットのオブジェクトが指定されました。 入力定義を確認してください。",
85
+ "datepickerRangeStart.default.label": "開始",
86
+ "datepickerRangeEnd.default.label": "語末",
85
87
  "editorform.group.type.error": "(不明なグループ・タイプ「{group.groupType()}」)",
86
88
  "moveable.table.button.top": "一番上に移動",
87
89
  "moveable.table.button.up": "上へ移動",
@@ -82,6 +82,8 @@
82
82
  "multi.selected.row.label": "행이 선택되었습니다.",
83
83
  "multi.selected.row.action": "이 행의 값을 변경하면 허용되는 모든 선택된 행의 값이 변경됩니다.",
84
84
  "datetimefield.format.error.message": "제공된 형식 오브젝트가 올바르지 않습니다. 입력 정의를 확인하십시오.",
85
+ "datepickerRangeStart.default.label": "시작",
86
+ "datepickerRangeEnd.default.label": "종료",
85
87
  "editorform.group.type.error": "(알 수 없는 그룹 유형 '{group.groupType()}')",
86
88
  "moveable.table.button.top": "맨 위로 이동",
87
89
  "moveable.table.button.up": "위로 이동",
@@ -82,6 +82,8 @@
82
82
  "multi.selected.row.label": "linhas selecionadas.",
83
83
  "multi.selected.row.action": "A mudança de um valor nesta linha mudará o valor em todas as linhas selecionadas permitidas.",
84
84
  "datetimefield.format.error.message": "Objeto de formato inválido fornecido. Verifique as definições de entrada.",
85
+ "datepickerRangeStart.default.label": "Iniciar",
86
+ "datepickerRangeEnd.default.label": "Terminar",
85
87
  "editorform.group.type.error": "(Tipo de grupo desconhecido '{group.groupType()}')",
86
88
  "moveable.table.button.top": "Mover para o topo",
87
89
  "moveable.table.button.up": "Mover para cima",
@@ -82,6 +82,8 @@
82
82
  "multi.selected.row.label": "rader har valts.",
83
83
  "multi.selected.row.action": "Om du ändrar ett värde i den här raden ändras värdet i alla tillåtna valda rader.",
84
84
  "datetimefield.format.error.message": "Ett ogiltigt formatobjekt har angetts. Kontrollera indatadefinitioner.",
85
+ "datepickerRangeStart.default.label": "Start",
86
+ "datepickerRangeEnd.default.label": "Slut",
85
87
  "editorform.group.type.error": "(Okänd grupptyp \"{group.groupType()}\")",
86
88
  "moveable.table.button.top": "Flytta överst",
87
89
  "moveable.table.button.up": "Flytta upp",
@@ -82,6 +82,8 @@
82
82
  "multi.selected.row.label": "行已选定。",
83
83
  "multi.selected.row.action": "如果更改此行中的值,就会更改所有允许的选定行中的值。",
84
84
  "datetimefield.format.error.message": "提供的对象格式无效。 请检查输入定义。",
85
+ "datepickerRangeStart.default.label": "启动",
86
+ "datepickerRangeEnd.default.label": "结束",
85
87
  "editorform.group.type.error": "(未知组类型“{group.groupType()}”)",
86
88
  "moveable.table.button.top": "移至顶部",
87
89
  "moveable.table.button.up": "上移",
@@ -82,6 +82,8 @@
82
82
  "multi.selected.row.label": "列已選定。",
83
83
  "multi.selected.row.action": "變更此列中的值將會變更所有容許的所選列中的值。",
84
84
  "datetimefield.format.error.message": "所提供的格式物件無效。 請檢查輸入定義。",
85
+ "datepickerRangeStart.default.label": "開始",
86
+ "datepickerRangeEnd.default.label": "結束",
85
87
  "editorform.group.type.error": "(群組類型 '{group.groupType()}' 不明)",
86
88
  "moveable.table.button.top": "移至頂端",
87
89
  "moveable.table.button.up": "上移",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elyra/canvas",
3
- "version": "12.32.1",
3
+ "version": "12.33.0",
4
4
  "description": "Elyra common-canvas",
5
5
  "main": "dist/common-canvas.js",
6
6
  "module": "dist/common-canvas.es.js",
@@ -237,6 +237,7 @@ export default class SVGCanvasRenderer {
237
237
  this.initializeGhostDiv();
238
238
 
239
239
  this.canvasSVG = this.createCanvasSVG();
240
+ this.canvasDefs = this.canvasSVG.selectChildren("defs");
240
241
  this.canvasGrp = this.createCanvasGroup(this.canvasSVG, "d3-canvas-group"); // Group to contain all canvas objects
241
242
  this.canvasUnderlay = this.createCanvasUnderlay(this.canvasGrp, "d3-canvas-underlay"); // Put underlay rectangle under comments, nodes and links
242
243
  this.commentsGrp = this.createCanvasGroup(this.canvasGrp, "d3-comments-group"); // Group to always position comments under nodes and links
@@ -3727,16 +3728,53 @@ export default class SVGCanvasRenderer {
3727
3728
  // Save image field in DOM object to avoid unnecessary image refreshes.
3728
3729
  imageSel.attr("data-image", image);
3729
3730
  if (nodeImageType === "svg") {
3730
- imageSel.selectChild("svg").remove();
3731
- d3.svg(image, { cache: "force-cache" }).then((data) => {
3732
- imageSel.node().append(data.documentElement);
3733
- });
3731
+ if (this.config.enableImageDisplay === "LoadSVGToDefs") {
3732
+ this.loadSVGToDefs(imageSel, image);
3733
+
3734
+ } else {
3735
+ imageSel.selectChild("svg").remove();
3736
+ d3.svg(image, { cache: "force-cache" }).then((data) => {
3737
+ imageSel.node().append(data.documentElement);
3738
+ });
3739
+ }
3734
3740
  } else {
3735
3741
  imageSel.attr("xlink:href", image);
3736
3742
  }
3737
3743
  }
3738
3744
  }
3739
3745
 
3746
+ // The default behavior for SVG files is to load them in-line regardless
3747
+ // of how many times a unique image is used for a particular flow. This
3748
+ // can be unnecessarily slow if an image is referenced many times. This
3749
+ // method provides a performance enhancement for displaying SVG images.
3750
+ // It stores each unique SVG file encountered in the <defs> element for the
3751
+ // canvas as a <symbol> element. It then adds <use> elements to each place
3752
+ // where that image is referenced. So, if the same image is referenced many
3753
+ // times there is just one symbol for the SVG file stored in the <defs>
3754
+ // element. This is faster but can restrict customization capabilities of
3755
+ // the canvas images.
3756
+ loadSVGToDefs(imageSel, image) {
3757
+ const symbolId = "img" + image.replaceAll(/[/.]/g, "-"); // Replace all / and . characters with -
3758
+ const symbolSelector = "#" + symbolId;
3759
+ const symbol = this.canvasDefs.selectChildren(symbolSelector);
3760
+ // If no symbol exists in <defs> for this image, add a place holder
3761
+ // <symbol> for it.
3762
+ if (symbol.empty()) {
3763
+ this.canvasDefs.append("symbol").attr("id", symbolId);
3764
+
3765
+ d3.svg(image, { cache: "force-cache" }).then((data) => {
3766
+ // Asynchronously, populate placeholder <symbol> with SVG file contents.
3767
+ this.canvasDefs.selectChildren(symbolSelector)
3768
+ .node()
3769
+ .append(data.documentElement);
3770
+ });
3771
+ }
3772
+
3773
+ // Use <symbol> containing our SVG image from <defs>
3774
+ imageSel.selectChild("use").remove();
3775
+ imageSel.append("use").attr("href", symbolSelector);
3776
+ }
3777
+
3740
3778
  // Returns the appropriate image from the object (either node or decoration)
3741
3779
  // passed in.
3742
3780
  getNodeImage(d) {
@@ -3757,7 +3795,7 @@ export default class SVGCanvasRenderer {
3757
3795
  // Returns the type of image passed in, either "svg" or "image". This will
3758
3796
  // be used to append an svg or image element to the DOM.
3759
3797
  getImageType(nodeImage) {
3760
- return nodeImage && nodeImage.endsWith(".svg") ? "svg" : "image";
3798
+ return nodeImage && nodeImage.endsWith(".svg") && this.config.enableImageDisplay !== "SVGAsImage" ? "svg" : "image";
3761
3799
  }
3762
3800
 
3763
3801
  setNodeStyles(d, type, nodeGrp) {
@@ -4601,14 +4639,26 @@ export default class SVGCanvasRenderer {
4601
4639
  const newLink = this.getNewLinkOnDrag(d3Event);
4602
4640
 
4603
4641
  if (newLink) {
4604
- this.canvasController.editActionHandler({
4605
- editType: "updateLink",
4606
- editSource: "canvas",
4607
- newLink: newLink,
4608
- pipelineId: this.pipelineId });
4642
+ const editSubType = this.getLinkEditSubType(newLink);
4643
+ // If editSubType is set the user did a gesture that requires a change
4644
+ // to the object model.
4645
+ if (editSubType) {
4646
+ this.canvasController.editActionHandler({
4647
+ editType: "updateLink",
4648
+ editSubType: editSubType,
4649
+ editSource: "canvas",
4650
+ newLink: newLink,
4651
+ pipelineId: this.pipelineId });
4652
+ // If editSubType is null, the user performed a gesture which should
4653
+ // not be executed as an action so draw the link back in its old position.
4654
+ } else {
4655
+ this.snapBackOldLink();
4656
+ }
4657
+ // newLink might be null when we are dragging a link handle with
4658
+ // enableLinkSelection not set to detachable. If that's the case the
4659
+ // link needs to snap back (redrawn) to its original position.
4609
4660
  } else {
4610
- this.activePipeline.replaceLink(this.draggingLinkData.oldLink);
4611
- this.displayLinks();
4661
+ this.snapBackOldLink();
4612
4662
  }
4613
4663
 
4614
4664
  // Switch 'new link over node' highlighting off
@@ -4620,6 +4670,70 @@ export default class SVGCanvasRenderer {
4620
4670
  this.stopDraggingLink();
4621
4671
  }
4622
4672
 
4673
+ // Resets and redraws the link being dragged back to its original position.
4674
+ // This is necessary when the user performs a link drag gesture which should
4675
+ // NOT be executed as an action -- therefore the link need to be drawn back
4676
+ // in its original position.
4677
+ snapBackOldLink() {
4678
+ this.activePipeline.replaceLink(this.draggingLinkData.oldLink);
4679
+ this.displayLinks();
4680
+ }
4681
+
4682
+ // Returns the edit sub-type for the link action being performed to further
4683
+ // explain the updateLink action.
4684
+ getLinkEditSubType(newLink) {
4685
+ const oldLink = this.draggingLinkData.oldLink;
4686
+
4687
+ if (oldLink.srcNodeId && !newLink.srcNodeId) {
4688
+ return "detachFromSrcNode";
4689
+
4690
+ } else if (oldLink.trgNodeId && !newLink.trgNodeId) {
4691
+ return "detachFromTrgNode";
4692
+
4693
+ } else if (!oldLink.srcNodeId && newLink.srcNodeId) {
4694
+ return "attachToSrcNode";
4695
+
4696
+ } else if (!oldLink.trgNodeId && newLink.trgNodeId) {
4697
+ return "attachToTrgNode";
4698
+
4699
+ } else if (!oldLink.srcNodeId && !newLink.srcNodeId &&
4700
+ (oldLink.srcPos.x_pos !== newLink.srcPos.x_pos ||
4701
+ oldLink.srcPos.y_pos !== newLink.srcPos.y_pos)) {
4702
+ return "moveSrcPosition";
4703
+
4704
+ } else if (!oldLink.trgNodeId && !newLink.trgNodeId &&
4705
+ (oldLink.trgPos.x_pos !== newLink.trgPos.x_pos ||
4706
+ oldLink.trgPos.y_pos !== newLink.trgPos.y_pos)) {
4707
+ return "moveTrgPosition";
4708
+
4709
+ } else if (oldLink.srcNodeId && newLink.srcNodeId &&
4710
+ oldLink.srcNodeId !== newLink.srcNodeId) {
4711
+ return "switchSrcNode";
4712
+
4713
+ } else if (oldLink.trgNodeId && newLink.trgNodeId &&
4714
+ oldLink.trgNodeId !== newLink.trgNodeId) {
4715
+ return "switchTrgNode";
4716
+
4717
+ } else if (oldLink.srcNodeId && newLink.srcNodeId &&
4718
+ oldLink.srcNodeId === newLink.srcNodeId &&
4719
+ oldLink.srcNodePortId !== newLink.srcNodePortId) {
4720
+ return "switchSrcNodePort";
4721
+
4722
+ } else if (oldLink.trgNodeId && newLink.trgNodeId &&
4723
+ oldLink.trgNodeId === newLink.trgNodeId &&
4724
+ oldLink.trgNodePortId !== newLink.trgNodePortId) {
4725
+ return "switchTrgNodePort";
4726
+ }
4727
+ // We arrive here, in two ways:
4728
+ // 1. if the user dragged a link handle from a node/port and dropped it
4729
+ // back on the same node/port.
4730
+ // 2. If the user clicked on the unattached end of a detached link but did
4731
+ // not move it anywhere
4732
+ // In these cases, the updateLink action should NOT be performed and
4733
+ // consequently NO command should be added to the command stack.
4734
+ return null;
4735
+ }
4736
+
4623
4737
  // Returns a new link if one can be created given the current data in the
4624
4738
  // this.draggingLinkData object. Returns null if a link cannot be created.
4625
4739
  getNewLinkOnDrag(d3Event, nodeProximity) {
@@ -4627,6 +4741,7 @@ export default class SVGCanvasRenderer {
4627
4741
  const newLink = cloneDeep(oldLink);
4628
4742
 
4629
4743
  if (this.draggingLinkData.endBeingDragged === "start") {
4744
+ delete newLink.srcObj;
4630
4745
  delete newLink.srcNodeId;
4631
4746
  delete newLink.srcNodePortId;
4632
4747
  delete newLink.srcPos;
@@ -4637,6 +4752,7 @@ export default class SVGCanvasRenderer {
4637
4752
 
4638
4753
  if (srcNode) {
4639
4754
  newLink.srcNodeId = srcNode.id;
4755
+ newLink.srcObj = this.activePipeline.getNode(srcNode.id);
4640
4756
  newLink.srcNodePortId = nodeProximity
4641
4757
  ? this.getNodePortIdNearMousePos(d3Event, OUTPUT_TYPE, srcNode)
4642
4758
  : this.getOutputNodePortId(d3Event, srcNode);
@@ -4645,6 +4761,7 @@ export default class SVGCanvasRenderer {
4645
4761
  }
4646
4762
 
4647
4763
  } else {
4764
+ delete newLink.trgNode;
4648
4765
  delete newLink.trgNodeId;
4649
4766
  delete newLink.trgNodePortId;
4650
4767
  delete newLink.trgPos;
@@ -4655,6 +4772,7 @@ export default class SVGCanvasRenderer {
4655
4772
 
4656
4773
  if (trgNode) {
4657
4774
  newLink.trgNodeId = trgNode.id;
4775
+ newLink.trgNode = this.activePipeline.getNode(trgNode.id);
4658
4776
  newLink.trgNodePortId = nodeProximity
4659
4777
  ? this.getNodePortIdNearMousePos(d3Event, INPUT_TYPE, trgNode)
4660
4778
  : this.getInputNodePortId(d3Event, trgNode);
@@ -6511,6 +6629,7 @@ export default class SVGCanvasRenderer {
6511
6629
  : null;
6512
6630
  const coords = this.linkUtils.getLinkCoords(link, srcObj, srcPortId, trgNode, trgPortId, assocLinkVariation);
6513
6631
 
6632
+ // Set additional calculated fields on link object.
6514
6633
  link.coordsUpdated =
6515
6634
  link.x1 !== coords.x1 ||
6516
6635
  link.y1 !== coords.y1 ||
@@ -6518,8 +6637,6 @@ export default class SVGCanvasRenderer {
6518
6637
  link.y2 !== coords.y2;
6519
6638
 
6520
6639
  link.assocLinkVariation = assocLinkVariation;
6521
- link.srcPortId = srcPortId;
6522
- link.trgPortId = trgPortId;
6523
6640
  link.x1 = coords.x1;
6524
6641
  link.y1 = coords.y1;
6525
6642
  link.x2 = coords.x2;
@@ -6587,14 +6704,13 @@ export default class SVGCanvasRenderer {
6587
6704
  }
6588
6705
  }
6589
6706
 
6707
+ // Set additional calculated fields on link object.
6590
6708
  link.coordsUpdated =
6591
6709
  link.x1 !== coords.x1 ||
6592
6710
  link.y1 !== coords.y1 ||
6593
6711
  link.x2 !== coords.x2 ||
6594
6712
  link.y2 !== coords.y2;
6595
6713
 
6596
- link.srcPortId = srcPortId;
6597
- link.trgPortId = trgPortId;
6598
6714
  link.x1 = coords.x1;
6599
6715
  link.y1 = coords.y1;
6600
6716
  link.x2 = coords.x2;
@@ -251,11 +251,11 @@ class FlexibleTable extends React.Component {
251
251
  let dynamicH = this.state.dynamicHeight;
252
252
  const multiSelectTableHeight = REM_ROW_HEIGHT + REM_HEADER_HEIGHT;
253
253
  if (Array.isArray(this.props.data) && this.props.data.length < this.state.rows) {
254
- newHeight = (REM_ROW_HEIGHT * this.props.data.length + REM_HEADER_HEIGHT + (this.props.selectedEditRow ? multiSelectTableHeight : 0)) + "rem";
254
+ newHeight = (REM_ROW_HEIGHT * this.props.data.length + REM_HEADER_HEIGHT + (this.props.selectedEditRow ? multiSelectTableHeight : 0)) * ONE_REM_HEIGHT;
255
255
  } else if (this.state.rows > 0) {
256
- newHeight = (REM_ROW_HEIGHT * this.state.rows + REM_HEADER_HEIGHT + (this.props.selectedEditRow ? multiSelectTableHeight : 0)) + "rem";
256
+ newHeight = (REM_ROW_HEIGHT * this.state.rows + REM_HEADER_HEIGHT + (this.props.selectedEditRow ? multiSelectTableHeight : 0)) * ONE_REM_HEIGHT;
257
257
  } else if (this.state.rows === 0) { // only display header
258
- newHeight = REM_HEADER_HEIGHT + "rem";
258
+ newHeight = REM_HEADER_HEIGHT * ONE_REM_HEIGHT;
259
259
  } else if (this.state.rows === -1) {
260
260
  if (this.flexibleTable) {
261
261
  const labelAndDescriptionHeight = 50; // possible dynamically set this in the future
@@ -267,7 +267,7 @@ class FlexibleTable extends React.Component {
267
267
  dynamicH = -1;
268
268
  } else {
269
269
  const totalHeight = flyoutHeight !== 0 ? flyoutHeight : tearsheetHeight;
270
- newHeight = `calc(${totalHeight - ftHeaderHeight - labelAndDescriptionHeight}px - 3.5rem)`; // 3.5rem to adjust padding
270
+ newHeight = `calc(${totalHeight - ftHeaderHeight - labelAndDescriptionHeight}px - ${(3.5 * ONE_REM_HEIGHT)}px)`; // 3.5rem to adjust padding
271
271
  dynamicH = (totalHeight - ftHeaderHeight - labelAndDescriptionHeight) - (3.5 * 16);
272
272
  }
273
273
  }
@@ -528,7 +528,7 @@ class FlexibleTable extends React.Component {
528
528
  const multiSelectEditRowsPixels = multiSelectEditRowsRem * ONE_REM_HEIGHT;
529
529
  if (this.state.rows !== -1 && this.state.tableHeight) {
530
530
  const remHeight = parseInt(this.state.tableHeight, 10);
531
- tableHeight = (remHeight - (this.props.selectedEditRow ? multiSelectEditRowsRem : 0)) * ONE_REM_HEIGHT;
531
+ tableHeight = (remHeight - (this.props.selectedEditRow ? multiSelectEditRowsRem : 0));
532
532
  } else if (this.state.rows === -1 && this.state.dynamicHeight && this.state.dynamicHeight !== -1) {
533
533
  tableHeight = this.state.dynamicHeight - (this.props.selectedEditRow ? multiSelectEditRowsPixels : 0);
534
534
  }
@@ -162,7 +162,7 @@ export const DATEPICKER_TYPE = {
162
162
 
163
163
  export const DEFAULT_DATEPICKER_FORMAT = "Y-m-d"; // ISO format
164
164
 
165
- export const DEFAULT_DATE_FORMAT = "yyyy-mm-dd";
165
+ export const DEFAULT_DATE_FORMAT = "yyyy-MM-dd";
166
166
 
167
167
  export const DEFAULT_TIME_FORMAT = "H:m:s";
168
168
 
@@ -30,6 +30,10 @@ import { has } from "lodash";
30
30
  class NumberfieldControl extends React.Component {
31
31
  constructor(props) {
32
32
  super(props);
33
+
34
+ this.state = {
35
+ invalidNumber: false
36
+ };
33
37
  this.onDirection = this.onDirection.bind(this);
34
38
  this.generateNumber = this.generateNumber.bind(this);
35
39
  this.id = ControlUtils.getControlId(this.props.propertyId);
@@ -56,6 +60,15 @@ class NumberfieldControl extends React.Component {
56
60
  }
57
61
  }
58
62
 
63
+ onInput(evt) {
64
+ // There's a specific case when manually deleting negative number (eg. -1), 1 is deleted first and then - becomes an invalid number
65
+ // After user deletes - sign , onInput is called however onChange event isn't triggered.
66
+ // At this time, invalidNumber state variable is true but the evt.target.value will be a valid "empty" number because - sign was deleted.
67
+ if (this.state.invalidNumber && evt.target.validity && !evt.target.validity.badInput) {
68
+ this.handleChange(evt);
69
+ }
70
+ }
71
+
59
72
  handleChange(evt, direction) {
60
73
  if (typeof direction === "string") {
61
74
  this.onDirection(direction);
@@ -79,11 +92,16 @@ class NumberfieldControl extends React.Component {
79
92
  };
80
93
  this.props.controller.updateErrorMessage(this.props.propertyId, errorMessage);
81
94
  }
95
+ this.setState({ invalidNumber: true });
82
96
  // Return without updating property value
83
97
  return;
84
98
  }
85
99
  // Number is valid, clear invalid number error if it exists
86
- const invalidNumberError = this.props.controller.getErrorMessage(this.props.propertyId) !== null &&
100
+ if (this.state.invalidNumber) {
101
+ this.setState({ invalidNumber: false });
102
+ }
103
+
104
+ const invalidNumberError = this.props.controller.getErrorMessage(this.props.propertyId) &&
87
105
  this.props.controller.getErrorMessage(this.props.propertyId).validation_id === "invalid_number";
88
106
  if (invalidNumberError) {
89
107
  this.props.controller.updateErrorMessage(this.props.propertyId, null);
@@ -151,6 +169,7 @@ class NumberfieldControl extends React.Component {
151
169
  allowEmpty
152
170
  light={this.props.controller.getLight() && this.props.control.light}
153
171
  hideSteppers={this.props.tableControl || (this.props.control.controlType === ControlType.NUMBERFIELD)}
172
+ onInput={this.onInput.bind(this)}
154
173
  />
155
174
  {numberGenerator}
156
175
  <ValidationMessage inTable={this.props.tableControl} tableOnly state={this.props.state} messageInfo={this.props.messageInfo} />
@@ -176,7 +195,7 @@ NumberfieldControl.propTypes = {
176
195
  const mapStateToProps = (state, ownProps) => ({
177
196
  value: ownProps.controller.getPropertyValue(ownProps.propertyId),
178
197
  state: ownProps.controller.getControlState(ownProps.propertyId),
179
- messageInfo: ownProps.controller.getErrorMessage(ownProps.propertyId)
198
+ messageInfo: ownProps.controller.getErrorMessage(ownProps.propertyId, true) // Filter error messages for hidden/disabled controls
180
199
  });
181
200
 
182
201
  export default connect(mapStateToProps, null)(NumberfieldControl);
@@ -62,6 +62,7 @@ export default class CanvasUtils {
62
62
  enableInternalObjectModel: true,
63
63
  enablePaletteLayout: "Flyout",
64
64
  enableToolbarLayout: "Top",
65
+ enableImageDisplay: "SVGInline",
65
66
  enableResizableNodes: false,
66
67
  enableInsertNodeDroppedOnLink: false,
67
68
  enableHighlightNodeOnNewLinkDrag: false,