@sapui5/sap.suite.ui.commons 1.148.0 → 1.150.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 (116) hide show
  1. package/package.json +1 -1
  2. package/src/sap/suite/ui/commons/.library +1 -1
  3. package/src/sap/suite/ui/commons/AriaProperties.js +1 -1
  4. package/src/sap/suite/ui/commons/CalculationBuilder.js +1 -1
  5. package/src/sap/suite/ui/commons/CalculationBuilderExpression.js +1 -1
  6. package/src/sap/suite/ui/commons/CalculationBuilderFunction.js +1 -1
  7. package/src/sap/suite/ui/commons/CalculationBuilderGroup.js +1 -1
  8. package/src/sap/suite/ui/commons/CalculationBuilderItem.js +1 -1
  9. package/src/sap/suite/ui/commons/CalculationBuilderValidationResult.js +1 -1
  10. package/src/sap/suite/ui/commons/CalculationBuilderVariable.js +1 -1
  11. package/src/sap/suite/ui/commons/ChartContainer.js +35 -3
  12. package/src/sap/suite/ui/commons/CloudFilePicker.js +1 -1
  13. package/src/sap/suite/ui/commons/MicroProcessFlow.js +1 -1
  14. package/src/sap/suite/ui/commons/MicroProcessFlowItem.js +1 -1
  15. package/src/sap/suite/ui/commons/Timeline.js +6 -0
  16. package/src/sap/suite/ui/commons/TimelineItem.js +11 -2
  17. package/src/sap/suite/ui/commons/TimelineRenderManager.js +8 -4
  18. package/src/sap/suite/ui/commons/collaboration/ContactHelper.js +78 -1
  19. package/src/sap/suite/ui/commons/collaboration/ContactPopover.fragment.xml +4 -1
  20. package/src/sap/suite/ui/commons/collaboration/TeamsHelperService.js +69 -2
  21. package/src/sap/suite/ui/commons/collaboration/flpplugins/msplugin/Component-preload.js +2 -2
  22. package/src/sap/suite/ui/commons/flexibility/changeHandler/PropertyChangeMapper.js +1 -1
  23. package/src/sap/suite/ui/commons/imageeditor/CropCustomShapeHistoryItem.js +1 -1
  24. package/src/sap/suite/ui/commons/imageeditor/CropEllipseHistoryItem.js +1 -1
  25. package/src/sap/suite/ui/commons/imageeditor/CropRectangleHistoryItem.js +1 -1
  26. package/src/sap/suite/ui/commons/imageeditor/CustomSizeItem.js +1 -1
  27. package/src/sap/suite/ui/commons/imageeditor/FilterHistoryItem.js +1 -1
  28. package/src/sap/suite/ui/commons/imageeditor/FlipHistoryItem.js +1 -1
  29. package/src/sap/suite/ui/commons/imageeditor/HistoryItem.js +1 -1
  30. package/src/sap/suite/ui/commons/imageeditor/ImageEditor.js +1 -1
  31. package/src/sap/suite/ui/commons/imageeditor/ImageEditorContainer.js +1 -1
  32. package/src/sap/suite/ui/commons/imageeditor/ImageEditorResponsiveContainer.js +1 -1
  33. package/src/sap/suite/ui/commons/imageeditor/ResizeHistoryItem.js +1 -1
  34. package/src/sap/suite/ui/commons/imageeditor/RotateHistoryItem.js +1 -1
  35. package/src/sap/suite/ui/commons/library.js +1 -1
  36. package/src/sap/suite/ui/commons/messagebundle.properties +4 -0
  37. package/src/sap/suite/ui/commons/messagebundle_ar.properties +3 -1
  38. package/src/sap/suite/ui/commons/messagebundle_bg.properties +3 -1
  39. package/src/sap/suite/ui/commons/messagebundle_ca.properties +2 -0
  40. package/src/sap/suite/ui/commons/messagebundle_cnr.properties +2 -0
  41. package/src/sap/suite/ui/commons/messagebundle_cs.properties +2 -0
  42. package/src/sap/suite/ui/commons/messagebundle_cy.properties +2 -0
  43. package/src/sap/suite/ui/commons/messagebundle_da.properties +2 -0
  44. package/src/sap/suite/ui/commons/messagebundle_de.properties +8 -6
  45. package/src/sap/suite/ui/commons/messagebundle_el.properties +2 -0
  46. package/src/sap/suite/ui/commons/messagebundle_en.properties +2 -0
  47. package/src/sap/suite/ui/commons/messagebundle_en_GB.properties +2 -0
  48. package/src/sap/suite/ui/commons/messagebundle_en_US_sappsd.properties +117 -30
  49. package/src/sap/suite/ui/commons/messagebundle_en_US_saprigi.properties +2 -0
  50. package/src/sap/suite/ui/commons/messagebundle_es.properties +2 -0
  51. package/src/sap/suite/ui/commons/messagebundle_es_MX.properties +2 -0
  52. package/src/sap/suite/ui/commons/messagebundle_et.properties +2 -0
  53. package/src/sap/suite/ui/commons/messagebundle_fi.properties +2 -0
  54. package/src/sap/suite/ui/commons/messagebundle_fr.properties +2 -0
  55. package/src/sap/suite/ui/commons/messagebundle_fr_CA.properties +4 -2
  56. package/src/sap/suite/ui/commons/messagebundle_hi.properties +2 -0
  57. package/src/sap/suite/ui/commons/messagebundle_hr.properties +2 -0
  58. package/src/sap/suite/ui/commons/messagebundle_hu.properties +2 -0
  59. package/src/sap/suite/ui/commons/messagebundle_id.properties +3 -1
  60. package/src/sap/suite/ui/commons/messagebundle_it.properties +7 -5
  61. package/src/sap/suite/ui/commons/messagebundle_iw.properties +2 -0
  62. package/src/sap/suite/ui/commons/messagebundle_ja.properties +3 -1
  63. package/src/sap/suite/ui/commons/messagebundle_kk.properties +2 -0
  64. package/src/sap/suite/ui/commons/messagebundle_ko.properties +2 -0
  65. package/src/sap/suite/ui/commons/messagebundle_lt.properties +2 -0
  66. package/src/sap/suite/ui/commons/messagebundle_lv.properties +2 -0
  67. package/src/sap/suite/ui/commons/messagebundle_mk.properties +2 -0
  68. package/src/sap/suite/ui/commons/messagebundle_ms.properties +3 -1
  69. package/src/sap/suite/ui/commons/messagebundle_nl.properties +2 -0
  70. package/src/sap/suite/ui/commons/messagebundle_no.properties +3 -1
  71. package/src/sap/suite/ui/commons/messagebundle_pl.properties +2 -0
  72. package/src/sap/suite/ui/commons/messagebundle_pt.properties +3 -1
  73. package/src/sap/suite/ui/commons/messagebundle_pt_PT.properties +2 -0
  74. package/src/sap/suite/ui/commons/messagebundle_ro.properties +2 -0
  75. package/src/sap/suite/ui/commons/messagebundle_ru.properties +7 -5
  76. package/src/sap/suite/ui/commons/messagebundle_sh.properties +2 -0
  77. package/src/sap/suite/ui/commons/messagebundle_sk.properties +2 -0
  78. package/src/sap/suite/ui/commons/messagebundle_sl.properties +2 -0
  79. package/src/sap/suite/ui/commons/messagebundle_sr.properties +2 -0
  80. package/src/sap/suite/ui/commons/messagebundle_sv.properties +3 -1
  81. package/src/sap/suite/ui/commons/messagebundle_th.properties +3 -1
  82. package/src/sap/suite/ui/commons/messagebundle_tr.properties +2 -0
  83. package/src/sap/suite/ui/commons/messagebundle_uk.properties +2 -0
  84. package/src/sap/suite/ui/commons/messagebundle_vi.properties +2 -0
  85. package/src/sap/suite/ui/commons/messagebundle_zh_CN.properties +2 -0
  86. package/src/sap/suite/ui/commons/messagebundle_zh_TW.properties +2 -0
  87. package/src/sap/suite/ui/commons/networkgraph/ElementBase.js +1 -1
  88. package/src/sap/suite/ui/commons/networkgraph/Graph.js +31 -7
  89. package/src/sap/suite/ui/commons/networkgraph/Node.js +15 -3
  90. package/src/sap/suite/ui/commons/networkgraph/Tooltip.js +7 -0
  91. package/src/sap/suite/ui/commons/statusindicator/Circle.js +1 -1
  92. package/src/sap/suite/ui/commons/statusindicator/CustomShape.js +1 -1
  93. package/src/sap/suite/ui/commons/statusindicator/DiscreteThreshold.js +1 -1
  94. package/src/sap/suite/ui/commons/statusindicator/FillingOption.js +1 -1
  95. package/src/sap/suite/ui/commons/statusindicator/LibraryShape.js +1 -1
  96. package/src/sap/suite/ui/commons/statusindicator/Path.js +1 -1
  97. package/src/sap/suite/ui/commons/statusindicator/PropertyThreshold.js +1 -1
  98. package/src/sap/suite/ui/commons/statusindicator/Rectangle.js +1 -1
  99. package/src/sap/suite/ui/commons/statusindicator/Shape.js +1 -1
  100. package/src/sap/suite/ui/commons/statusindicator/ShapeGroup.js +1 -1
  101. package/src/sap/suite/ui/commons/statusindicator/SimpleShape.js +1 -1
  102. package/src/sap/suite/ui/commons/statusindicator/StatusIndicator.js +1 -1
  103. package/src/sap/suite/ui/commons/taccount/TAccount.js +1 -1
  104. package/src/sap/suite/ui/commons/taccount/TAccountGroup.js +1 -1
  105. package/src/sap/suite/ui/commons/taccount/TAccountItem.js +1 -1
  106. package/src/sap/suite/ui/commons/taccount/TAccountItemProperty.js +1 -1
  107. package/src/sap/suite/ui/commons/taccount/TAccountPanel.js +1 -1
  108. package/src/sap/suite/ui/commons/themes/base/MicroProcessFlow.less +4 -3
  109. package/src/sap/suite/ui/commons/themes/sap_fiori_3/MicroProcessFlow.less +4 -6
  110. package/src/sap/suite/ui/commons/themes/sap_fiori_3_dark/MicroProcessFlow.less +4 -6
  111. package/src/sap/suite/ui/commons/themes/sap_fiori_3_hcb/MicroProcessFlow.less +7 -0
  112. package/src/sap/suite/ui/commons/themes/sap_fiori_3_hcw/MicroProcessFlow.less +7 -0
  113. package/src/sap/suite/ui/commons/themes/sap_horizon/MicroProcessFlow.less +7 -0
  114. package/src/sap/suite/ui/commons/themes/sap_horizon_dark/MicroProcessFlow.less +7 -0
  115. package/src/sap/suite/ui/commons/themes/sap_horizon_hcb/MicroProcessFlow.less +7 -0
  116. package/src/sap/suite/ui/commons/themes/sap_horizon_hcw/MicroProcessFlow.less +7 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sapui5/sap.suite.ui.commons",
3
- "version": "1.148.0",
3
+ "version": "1.150.0",
4
4
  "description": "SAPUI5 Library sap.suite.ui.commons",
5
5
  "homepage": "https://sap.github.io/ui5-tooling/pages/SAPUI5/",
6
6
  "author": "SAP SE (https://www.sap.com)",
@@ -7,7 +7,7 @@
7
7
  SAP UI development toolkit for HTML5 (SAPUI5)
8
8
  (c) Copyright 2009-2015 SAP SE. All rights reserved
9
9
  </copyright>
10
- <version>1.148.0</version>
10
+ <version>1.150.0</version>
11
11
 
12
12
  <documentation>SAP UI library: sap.suite.ui.commons</documentation>
13
13
 
@@ -19,7 +19,7 @@ sap.ui.define([
19
19
  * @extends sap.ui.core.Element
20
20
  *
21
21
  * @author SAP SE
22
- * @version 1.148.0
22
+ * @version 1.150.0
23
23
  * @since 1.65.0
24
24
  *
25
25
  * @constructor
@@ -134,7 +134,7 @@ sap.ui.define([
134
134
  * @extends sap.ui.core.Control
135
135
  *
136
136
  * @author SAP SE
137
- * @version 1.148.0
137
+ * @version 1.150.0
138
138
  * @since 1.56.0
139
139
  *
140
140
  * @constructor
@@ -148,7 +148,7 @@ sap.ui.define([
148
148
  * @extends sap.ui.core.Control
149
149
  *
150
150
  * @author SAP SE
151
- * @version 1.148.0
151
+ * @version 1.150.0
152
152
  * @since 1.56.0
153
153
  *
154
154
  * @constructor
@@ -26,7 +26,7 @@ sap.ui.define([
26
26
  * @extends sap.ui.core.Control
27
27
  *
28
28
  * @author SAP SE
29
- * @version 1.148.0
29
+ * @version 1.150.0
30
30
  * @since 1.56.0
31
31
  *
32
32
  * @constructor
@@ -22,7 +22,7 @@ sap.ui.define([
22
22
  * @extends sap.ui.core.Control
23
23
  *
24
24
  * @author SAP SE
25
- * @version 1.148.0
25
+ * @version 1.150.0
26
26
  * @since 1.60.0
27
27
  *
28
28
  * @constructor
@@ -40,7 +40,7 @@ sap.ui.define([
40
40
  * @extends sap.ui.core.Control
41
41
  *
42
42
  * @author SAP SE
43
- * @version 1.148.0
43
+ * @version 1.150.0
44
44
  * @since 1.56.0
45
45
  *
46
46
  * @constructor
@@ -21,7 +21,7 @@ sap.ui.define([
21
21
  * @extends sap.ui.base.ManagedObject
22
22
  *
23
23
  * @author SAP SE
24
- * @version 1.148.0
24
+ * @version 1.150.0
25
25
  * @since 1.56.0
26
26
  *
27
27
  * @constructor
@@ -23,7 +23,7 @@ sap.ui.define([
23
23
  * @extends sap.ui.core.Control
24
24
  *
25
25
  * @author SAP SE
26
- * @version 1.148.0
26
+ * @version 1.150.0
27
27
  * @since 1.56.0
28
28
  *
29
29
  * @constructor
@@ -34,11 +34,12 @@ sap.ui.define([
34
34
  "sap/m/Popover",
35
35
  "sap/m/Dialog",
36
36
  "sap/m/ResponsivePopover",
37
- 'sap/m/SelectionDetails'
37
+ 'sap/m/SelectionDetails',
38
+ 'sap/ui/core/InvisibleText'
38
39
  ], function (jQuery, library, MobileLibrary, VizLibrary, ManagedObject, Button, OverflowToolbar, OverflowToolbarButton,
39
40
  SegmentedButton, SegmentedButtonItem, Title, ToolbarSpacer, Device, Control, CustomData, ResizeHandler, ScrollEnablement, ToggleButton,
40
41
  OverflowToolbarToggleButton, uid, Log, ChartContainerRenderer, FullScreenUtil, CoreLib, Element, Popover, Dialog,
41
- ResponsivePopover, SelectionDetails) {
42
+ ResponsivePopover, SelectionDetails, InvisibleText) {
42
43
  "use strict";
43
44
 
44
45
  // shortcut for sap.m.ButtonType
@@ -147,7 +148,14 @@ sap.ui.define([
147
148
  * </pre>
148
149
  * @since 1.129.0
149
150
  */
150
- enableBrowserFullScreen: {type: "boolean", group: "Misc", defaultValue: false}
151
+ enableBrowserFullScreen: {type: "boolean", group: "Misc", defaultValue: false},
152
+
153
+ /**
154
+ * Defines the heading level of the chart title.
155
+ * The value is forwarded to the internal <code>sap.m.Title</code> control using its <code>level</code> property.
156
+ * @since 1.150.0
157
+ */
158
+ titleLevel: {type: "sap.ui.core.TitleLevel", group: "Appearance", defaultValue: "Auto"}
151
159
  },
152
160
  defaultAggregation: "content",
153
161
  aggregations: {
@@ -304,6 +312,7 @@ sap.ui.define([
304
312
  //Left side...
305
313
  //display title if no dimension selectors
306
314
  this._oChartTitle = new Title();
315
+ this._oFullScreenButtonInvisibleText = new InvisibleText().toStatic();
307
316
  };
308
317
 
309
318
  ChartContainer.prototype.addDependent = function (oDependant) {
@@ -513,6 +522,10 @@ sap.ui.define([
513
522
  this._oZoomOutButton.destroy();
514
523
  this._oZoomOutButton = undefined;
515
524
  }
525
+ if (this._oFullScreenButtonInvisibleText) {
526
+ this._oFullScreenButtonInvisibleText.destroy();
527
+ this._oFullScreenButtonInvisibleText = undefined;
528
+ }
516
529
  };
517
530
 
518
531
  /* =========================================================== */
@@ -1211,6 +1224,25 @@ sap.ui.define([
1211
1224
  }
1212
1225
  this._oChartTitle.setText(title);
1213
1226
  this.setProperty("title", title, true);
1227
+ if (this._oFullScreenButtonInvisibleText) {
1228
+ if (title) {
1229
+ this._oFullScreenButtonInvisibleText.setText(title);
1230
+ if (this._oFullScreenButton.getAriaLabelledBy().indexOf(this._oFullScreenButtonInvisibleText.getId()) === -1) {
1231
+ this._oFullScreenButton.addAriaLabelledBy(this._oFullScreenButtonInvisibleText.getId());
1232
+ }
1233
+ } else {
1234
+ this._oFullScreenButton.removeAriaLabelledBy(this._oFullScreenButtonInvisibleText.getId());
1235
+ }
1236
+ }
1237
+ return this;
1238
+ };
1239
+
1240
+ ChartContainer.prototype.setTitleLevel = function (titleLevel) {
1241
+ if (this.getTitleLevel() === titleLevel) {
1242
+ return this;
1243
+ }
1244
+ this._oChartTitle.setLevel(titleLevel);
1245
+ this.setProperty("titleLevel", titleLevel, true);
1214
1246
  return this;
1215
1247
  };
1216
1248
 
@@ -118,7 +118,7 @@ sap.ui.define([
118
118
  * @class
119
119
  * @public
120
120
  * @internal
121
- * @version 1.148.0
121
+ * @version 1.150.0
122
122
  */
123
123
  var CloudFilePicker = Dialog.extend("sap.suite.ui.commons.CloudFilePicker", {
124
124
  metadata: {
@@ -50,7 +50,7 @@ sap.ui.define([
50
50
  * @extends sap.ui.core.Control
51
51
  *
52
52
  * @author SAP SE
53
- * @version 1.148.0
53
+ * @version 1.150.0
54
54
  *
55
55
  * @constructor
56
56
  * @public
@@ -38,7 +38,7 @@ sap.ui.define([
38
38
  * @extends sap.ui.core.Control
39
39
  *
40
40
  * @author SAP SE
41
- * @version 1.148.0
41
+ * @version 1.150.0
42
42
  *
43
43
  * @constructor
44
44
  * @public
@@ -1659,6 +1659,12 @@ sap.ui.define([
1659
1659
  // or nasty private variables manipulation.
1660
1660
  this._objects.destroyObject("FilterContent");
1661
1661
  this._setupFilterDialog();
1662
+
1663
+ // When enableModelFilter=false, recreateFilter() exits early (aPrevFilters is empty)
1664
+ // without calling invalidate(), so the filter bar never hides. Force re-render here.
1665
+ if (!this._useModelFilter()) {
1666
+ this.invalidate();
1667
+ }
1662
1668
  };
1663
1669
 
1664
1670
  /**
@@ -27,9 +27,12 @@ sap.ui.define([
27
27
  "sap/base/security/encodeXML",
28
28
  "./TimelineItemRenderer",
29
29
  "sap/ui/events/KeyCodes",
30
- "sap/ui/core/Lib"
30
+ "sap/ui/core/Lib",
31
+ "sap/ui/core/InvisibleMessage",
32
+ "sap/ui/core/library"
31
33
  ], function (jQuery, Control, Text, Toolbar, Link, TextArea, Popover, ToolbarSpacer, Avatar, Button, Device,
32
- ManagedObjectRegister, DateUtils, Icon, mLibrary, DateFormat, BaseObject, containsOrEquals, encodeXML, TimelineItemRenderer, KeyCodes, CoreLib) {
34
+ ManagedObjectRegister, DateUtils, Icon, mLibrary, DateFormat, BaseObject, containsOrEquals, encodeXML, TimelineItemRenderer, KeyCodes, CoreLib,
35
+ InvisibleMessage, coreLibrary) {
33
36
  "use strict";
34
37
 
35
38
  // shortcut for sap.m.PlacementType
@@ -42,6 +45,8 @@ sap.ui.define([
42
45
  var AvatarShape = mLibrary.AvatarShape;
43
46
  var AvatarSize = mLibrary.AvatarSize;
44
47
 
48
+ var InvisibleMessageMode = coreLibrary.InvisibleMessageMode;
49
+
45
50
  /**
46
51
  * Constructor for a new TimelineItem.
47
52
  *
@@ -809,6 +814,8 @@ sap.ui.define([
809
814
  var sShowLessText = resBundle.getText("TIMELINE_TEXT_SHOW_LESS");
810
815
  oLink.setText(sShowLessText);
811
816
  fnSetHeight("", $span.height(), "");
817
+ InvisibleMessage.getInstance().announce(sShowLessText + " " + resBundle.getText("TIMELINE_LINK_ACTIVATE_INSTRUCTION"), InvisibleMessageMode.Polite);
818
+
812
819
 
813
820
  } else {
814
821
  $parent.attr("expanded", false);
@@ -817,6 +824,8 @@ sap.ui.define([
817
824
  $span.html(this._textProperties.text);
818
825
 
819
826
  fnSetHeight(this._textProperties.height, this._textProperties.height, this._textProperties.clamp);
827
+ InvisibleMessage.getInstance().announce(this._sTextShowMore + " " + resBundle.getText("TIMELINE_LINK_ACTIVATE_INSTRUCTION"), InvisibleMessageMode.Polite);
828
+
820
829
  }
821
830
 
822
831
  that._expanded = !that._expanded;
@@ -217,7 +217,7 @@ sap.ui.define([
217
217
  return sName + "-" + (this._bRtlMode ? "right" : "left");
218
218
  }.bind(this),
219
219
  // icon in middle line for corresponding timeline item
220
- $icon = jQuery("#" + oItem.id + "-line"),
220
+ $icon = jQuery(document.getElementById(oItem.id + "-line")),
221
221
  // left (right for RTL) for timeline icon
222
222
  iDistance = this._bRtlMode ? fnRight($icon) : $icon.position().left,
223
223
  // distance between left icon pos and start of timeline item
@@ -230,9 +230,13 @@ sap.ui.define([
230
230
  iMargin = iDistance - OFFSET - iLineMargin;
231
231
  } else {
232
232
  $prev = $item.prevAll(".sapSuiteUiCommonsTimelineItemLiWrapperV:visible:first");
233
- // otherwise count margin as previsous item left + width minus from group header left position + OFFSET
234
- iPrevPos = this._bRtlMode ? fnRight($prev) : ($prev.position().left + _getConvertedAttribute($prev, fnCreateAttribute("margin")));
235
- iMargin = (iDistance - OFFSET) - (iPrevPos + $prev.outerWidth());
233
+ if ($prev.length > 0) {
234
+ // otherwise count margin as previsous item left + width minus from group header left position + OFFSET
235
+ iPrevPos = this._bRtlMode ? fnRight($prev) : ($prev.position().left + _getConvertedAttribute($prev, fnCreateAttribute("margin")));
236
+ iMargin = (iDistance - OFFSET) - (iPrevPos + $prev.outerWidth());
237
+ } else {
238
+ iMargin = iDistance - OFFSET - iLineMargin;
239
+ }
236
240
  }
237
241
  $item.css(fnCreateAttribute("margin"), iMargin + "px");
238
242
  }.bind(this));
@@ -29,6 +29,52 @@ sap.ui.define([
29
29
  return Controller.extend("sap.suite.ui.commons.collaboration.ContactHelper", {
30
30
  constructor: function() { },
31
31
 
32
+ _compressImage: function(base64Data) {
33
+ const maxWidth = 150;
34
+ const maxHeight = 150;
35
+ const quality = 0.7;
36
+
37
+ return new Promise(function(resolve, reject) {
38
+ var img = new Image();
39
+ img.onload = function() {
40
+ var canvas = document.createElement('canvas');
41
+ var ctx = canvas.getContext('2d');
42
+
43
+ var width = img.width;
44
+ var height = img.height;
45
+
46
+ if (width > height) {
47
+ if (width > maxWidth) {
48
+ height = height * (maxWidth / width);
49
+ width = maxWidth;
50
+ }
51
+ } else if (height > maxHeight) {
52
+ width = width * (maxHeight / height);
53
+ height = maxHeight;
54
+ }
55
+
56
+ canvas.width = width;
57
+ canvas.height = height;
58
+
59
+ ctx.drawImage(img, 0, 0, width, height);
60
+
61
+ try {
62
+ var compressedBase64 = canvas.toDataURL('image/jpeg', quality);
63
+ var base64Result = compressedBase64.split(',')[1];
64
+ resolve(base64Result);
65
+ } catch (e) {
66
+ reject(e);
67
+ }
68
+ };
69
+
70
+ img.onerror = function(error) {
71
+ reject(error);
72
+ };
73
+
74
+ img.src = "data:image/png;base64," + base64Data;
75
+ });
76
+ },
77
+
32
78
  /**
33
79
  * Fetch the Contact info, image and status from Teams via oData service.
34
80
  * @param {string} sEmail email of the contact
@@ -41,6 +87,13 @@ sap.ui.define([
41
87
  }
42
88
  if (oFullProfileData && oFullProfileData.data != "") {
43
89
  oFullProfileData.photo = "data:image/png;base64," + oFullProfileData.data;
90
+
91
+ try {
92
+ var compressedData = await this._compressImage(oFullProfileData.data);
93
+ oFullProfileData.photoCompressed = "data:image/jpeg;base64," + compressedData;
94
+ } catch (error) {
95
+ oFullProfileData.photoCompressed = oFullProfileData.photo;
96
+ }
44
97
  }
45
98
  oFullProfileData = this.determineContactStatus(oFullProfileData);
46
99
  return oFullProfileData;
@@ -134,7 +187,7 @@ sap.ui.define([
134
187
  }
135
188
  },
136
189
 
137
- loadContactPopover: function(sEmail, oParams, isDirectCommunicationEnabled) {
190
+ loadContactPopover: function(sEmail, oParams, isDirectCommunicationEnabled, providerConfig) {
138
191
  this.afterClose(); // Make sure, previously opened popup is closed if any
139
192
  return Fragment.load({
140
193
  name: "sap.suite.ui.commons.collaboration.ContactPopover",
@@ -155,6 +208,7 @@ sap.ui.define([
155
208
  "isUserExistsInTeams": true
156
209
  });
157
210
  this._oContactPopover.setModel(oJsonModel, "userData");
211
+ this._providerConfig = providerConfig ?? {};
158
212
  this.isDirectCommunicationEnabled = isDirectCommunicationEnabled;
159
213
  this._oContactPopover.setModel(new sap.ui.model.resource.ResourceModel({ bundle: I18_BUNDLE }), "i18n");
160
214
  return oPopover;
@@ -203,6 +257,8 @@ sap.ui.define([
203
257
  } else {
204
258
  data.isUserExistsInTeams = true;
205
259
  data.isDirectCommunicationEnabled = !!that.isDirectCommunicationEnabled;
260
+ data.isShareAsLinkEnabled = that._providerConfig.isShareAsLinkEnabled === "X";
261
+ data.isShareAsCardEnabled = that._providerConfig.isShareAsCardEnabled === "ENABLED" || that._providerConfig.isShareAsCardEnabled === "AUTHENABLE";
206
262
  that._oContactPopover.setInitialFocus(Element.getElementById("avatar"));
207
263
  }
208
264
  var oJsonModel = new JSONModel(data);
@@ -340,6 +396,27 @@ sap.ui.define([
340
396
  } else {
341
397
  MessageToast.show(I18_BUNDLE.getText("POPOVER_CONTACT_COPY_EMAIL_ERROR"));
342
398
  }
399
+ },
400
+
401
+ handleShareToMSTeamsPress: async function() {
402
+ const oContactData = this._oContactPopover.getModel("userData").getData();
403
+ const sCardId = "Contact-" + oContactData.id;
404
+
405
+ if (!this._oTeamsHelperService) {
406
+ const ServiceContainer = await new Promise((resolve) => {
407
+ sap.ui.require(["sap/suite/ui/commons/collaboration/ServiceContainer"], (SC) => resolve(SC));
408
+ });
409
+ this._oTeamsHelperService = await ServiceContainer.getServiceAsync();
410
+ }
411
+
412
+ // Use compressed photo for Teams sharing
413
+ const oCardManifest = { ...oContactData };
414
+ if (oContactData.photoCompressed) {
415
+ oCardManifest.photo = oContactData.photoCompressed;
416
+ delete oCardManifest.data;
417
+ }
418
+
419
+ this._oTeamsHelperService.shareContactCard(oContactData, { cardId: sCardId, cardManifest: oCardManifest });
343
420
  }
344
421
  });
345
422
  });
@@ -16,7 +16,10 @@
16
16
  displaySize="M" class="sapUiSmallMarginEnd" displayShape="Circle" macrodata:email="{userData>/mail}" fesr:press="MST:ContactAction"
17
17
  macrodata:type="chat" tooltip="{userData>/badgeTooltip}" badgeValueState="{userData>/badgeValueState}" badgeTooltip="{userData>/badgeTooltip}" badgeIcon="{userData>/badgeIcon}"/>
18
18
  <VBox>
19
- <Title text="{userData>/displayname}" level="H3" />
19
+ <HBox alignItems="Center">
20
+ <Title text="{userData>/displayname}" level="H3" />
21
+ <core:Icon src="sap-icon://action" press=".handleShareToMSTeamsPress" decorative="false" tooltip="{i18n>POPOVER_CONTACT_SHARE_TEAMS}" visible="{= ${userData>/isShareAsLinkEnabled} || ${userData>/isShareAsCardEnabled}}" class="sapThemeHighlight-asColor sapUiTinyMarginBegin"/>
22
+ </HBox>
20
23
  <Text text="{userData>/jobtitle}"/>
21
24
  </VBox>
22
25
  </HBox>
@@ -507,6 +507,73 @@ sap.ui.define([
507
507
  return sModifiedUrl;
508
508
  };
509
509
 
510
+ /**
511
+ * Shares ContactCard to Microsoft Teams
512
+ * @param {Object} oContactData - Contact information
513
+ * @param {Object} [oParams] - Optional parameters including cardId and cardManifest
514
+ * @returns {Promise<void>} Promise that resolves when sharing is complete
515
+ * @private
516
+ */
517
+ TeamsHelperService.prototype.shareContactCard = async function(oContactData, oParams) {
518
+ const sMessage = oContactData.displayname || oContactData.mail || "Contact";
519
+ const sCurrentUrl = window.location.href;
520
+
521
+ let oContactCard = {};
522
+
523
+ // If cardId and cardManifest are provided, save to backend first
524
+ if (oParams && oParams.cardId && oParams.cardManifest) {
525
+ try {
526
+ // Show busy dialog while saving
527
+ const oDialog = await Fragment.load({
528
+ name: "sap.suite.ui.commons.collaboration.CollaborationBusyDialog",
529
+ controller: this,
530
+ type: "XML"
531
+ });
532
+ oBusyDialog = oDialog;
533
+ oBusyDialog.open();
534
+
535
+ iBusyDialogTimeoutId = setTimeout(() => {
536
+ if (oBusyDialog) {
537
+ oBusyDialog.close();
538
+ oBusyDialog.destroy();
539
+ }
540
+ }, AUTO_CLOSE_BUSY_DIALOG_TIME);
541
+
542
+ // Save card to backend
543
+ oContactCard = await this._buildCardInfo(oParams);
544
+ } catch (err) {
545
+ oLogger.error("Failed to save contact card: " + err.message);
546
+ }
547
+ }
548
+
549
+ let sModifiedUrl = sCurrentUrl;
550
+ try {
551
+ const oUrlParams = {
552
+ url: sCurrentUrl,
553
+ minifyUrlForChat: true
554
+ };
555
+ sModifiedUrl = await this._getModifiedUrlForSharing(oUrlParams);
556
+ } catch (error) {
557
+ oLogger.error("Error while modifying URL for contact card sharing: " + error.message);
558
+ } finally {
559
+ this._closeBusyDialog();
560
+
561
+ const newWindow = window.open(
562
+ "",
563
+ "_blank",
564
+ windowWidthAndHeight
565
+ );
566
+ newWindow.opener = null;
567
+
568
+ if (oContactCard && Object.keys(oContactCard).length > 0) {
569
+ const sCardUrl = this._generateShareAsCardUrl(sModifiedUrl, sMessage, oContactCard);
570
+ newWindow.location = sCardUrl;
571
+ } else {
572
+ newWindow.location = this._providerConfig.shareAsLinkUrl + "?msgText=" + encodeURIComponent(sMessage) + "&preview=false";
573
+ }
574
+ }
575
+ };
576
+
510
577
  /**
511
578
  * Closes and destroys the busy dialog, and clears timeout.
512
579
  */
@@ -681,9 +748,9 @@ sap.ui.define([
681
748
  this.oContactHelper = new ContactHelper();
682
749
  }
683
750
  if (this._providerConfig.isDirectCommunicationEnabled === "ENABLED") {
684
- return this.oContactHelper.loadContactPopover(sEmail, oParams, true);
751
+ return this.oContactHelper.loadContactPopover(sEmail, oParams, true, this._providerConfig);
685
752
  } else {
686
- return this.oContactHelper.loadContactPopover(sEmail, oParams);
753
+ return this.oContactHelper.loadContactPopover(sEmail, oParams, false, this._providerConfig);
687
754
  }
688
755
 
689
756
  } else if (isTeamMode || !sEmail || this._providerConfig.isDirectCommunicationEnabled !== "ENABLED") {