@openui5/sap.ui.mdc 1.100.0 → 1.101.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 (204) hide show
  1. package/THIRDPARTY.txt +5 -5
  2. package/package.json +4 -4
  3. package/src/sap/ui/mdc/.library +1 -1
  4. package/src/sap/ui/mdc/ActionToolbar.js +1 -1
  5. package/src/sap/ui/mdc/Chart.js +28 -46
  6. package/src/sap/ui/mdc/ChartDelegate.js +10 -0
  7. package/src/sap/ui/mdc/Control.js +1 -1
  8. package/src/sap/ui/mdc/Element.js +1 -1
  9. package/src/sap/ui/mdc/Field.js +2 -2
  10. package/src/sap/ui/mdc/FilterBar.js +1 -1
  11. package/src/sap/ui/mdc/FilterField.js +2 -2
  12. package/src/sap/ui/mdc/Link.js +1 -1
  13. package/src/sap/ui/mdc/LinkDelegate.js +7 -5
  14. package/src/sap/ui/mdc/MultiValueField.js +1 -1
  15. package/src/sap/ui/mdc/Table.js +255 -284
  16. package/src/sap/ui/mdc/TableDelegate.js +96 -23
  17. package/src/sap/ui/mdc/ValueHelp.js +131 -624
  18. package/src/sap/ui/mdc/ValueHelpDelegate.js +152 -6
  19. package/src/sap/ui/mdc/actiontoolbar/ActionToolbarAction.js +1 -1
  20. package/src/sap/ui/mdc/chart/ChartSelectionDetails.js +1 -1
  21. package/src/sap/ui/mdc/chart/ChartToolbar.js +5 -3
  22. package/src/sap/ui/mdc/chart/ChartTypeButton.js +11 -2
  23. package/src/sap/ui/mdc/chart/DrillBreadcrumbs.js +2 -0
  24. package/src/sap/ui/mdc/chart/PropertyHelper.js +1 -1
  25. package/src/sap/ui/mdc/condition/Condition.js +14 -9
  26. package/src/sap/ui/mdc/condition/ConditionConverter.js +58 -6
  27. package/src/sap/ui/mdc/condition/ConditionModel.js +1 -1
  28. package/src/sap/ui/mdc/condition/FilterConverter.js +1 -1
  29. package/src/sap/ui/mdc/condition/FilterOperatorUtil.js +6 -2
  30. package/src/sap/ui/mdc/condition/Operator.js +11 -1
  31. package/src/sap/ui/mdc/condition/OperatorDynamicDateOption.js +1 -1
  32. package/src/sap/ui/mdc/condition/RangeOperator.js +1 -1
  33. package/src/sap/ui/mdc/designtime/filterbar/FilterBar.designtime.js +3 -1
  34. package/src/sap/ui/mdc/designtime/table/Table.designtime.js +1 -1
  35. package/src/sap/ui/mdc/enum/PropagationReason.js +43 -0
  36. package/src/sap/ui/mdc/field/BoolFieldHelp.js +1 -1
  37. package/src/sap/ui/mdc/field/ConditionFieldHelp.js +1 -1
  38. package/src/sap/ui/mdc/field/ConditionType.js +28 -8
  39. package/src/sap/ui/mdc/field/ConditionsType.js +2 -1
  40. package/src/sap/ui/mdc/field/CustomFieldHelp.js +1 -1
  41. package/src/sap/ui/mdc/field/CustomFieldInfo.js +1 -1
  42. package/src/sap/ui/mdc/field/DefineConditionPanel.js +1 -1
  43. package/src/sap/ui/mdc/field/DynamicDateRangeConditionsType.js +1 -1
  44. package/src/sap/ui/mdc/field/FieldBase.js +12 -10
  45. package/src/sap/ui/mdc/field/FieldBaseDelegate.js +41 -19
  46. package/src/sap/ui/mdc/field/FieldHelpBase.js +1 -1
  47. package/src/sap/ui/mdc/field/FieldInfoBase.js +1 -1
  48. package/src/sap/ui/mdc/field/FieldInput.js +1 -1
  49. package/src/sap/ui/mdc/field/FieldInputRenderUtil.js +1 -1
  50. package/src/sap/ui/mdc/field/FieldMultiInput.js +1 -1
  51. package/src/sap/ui/mdc/field/FieldValueHelp.js +6 -4
  52. package/src/sap/ui/mdc/field/FieldValueHelpContentWrapperBase.js +1 -1
  53. package/src/sap/ui/mdc/field/FieldValueHelpMTableWrapper.js +1 -1
  54. package/src/sap/ui/mdc/field/FieldValueHelpMdcTableWrapper.js +1 -1
  55. package/src/sap/ui/mdc/field/FieldValueHelpTableWrapperBase.js +1 -1
  56. package/src/sap/ui/mdc/field/FieldValueHelpUITableWrapper.js +1 -1
  57. package/src/sap/ui/mdc/field/InParameter.js +1 -1
  58. package/src/sap/ui/mdc/field/ListFieldHelp.js +1 -1
  59. package/src/sap/ui/mdc/field/ListFieldHelpItem.js +1 -1
  60. package/src/sap/ui/mdc/field/MultiValueFieldItem.js +1 -1
  61. package/src/sap/ui/mdc/field/OutParameter.js +1 -1
  62. package/src/sap/ui/mdc/field/TokenDisplay.js +1 -1
  63. package/src/sap/ui/mdc/field/TokenizerDisplay.js +1 -1
  64. package/src/sap/ui/mdc/field/ValueHelpPanel.js +1 -1
  65. package/src/sap/ui/mdc/filterbar/FilterBarBase.js +90 -69
  66. package/src/sap/ui/mdc/filterbar/IFilterContainer.js +5 -0
  67. package/src/sap/ui/mdc/filterbar/PropertyHelper.js +1 -1
  68. package/src/sap/ui/mdc/filterbar/aligned/FilterContainer.js +1 -0
  69. package/src/sap/ui/mdc/filterbar/aligned/FilterItemLayout.js +1 -0
  70. package/src/sap/ui/mdc/filterbar/p13n/AdaptationFilterBar.js +21 -11
  71. package/src/sap/ui/mdc/filterbar/vh/FilterBar.js +37 -5
  72. package/src/sap/ui/mdc/flexibility/Chart.flexibility.js +4 -41
  73. package/src/sap/ui/mdc/flexibility/ChartTypeFlex.js +54 -0
  74. package/src/sap/ui/mdc/flexibility/ConditionFlex.js +2 -2
  75. package/src/sap/ui/mdc/flexibility/FilterBar.flexibility.js +1 -1
  76. package/src/sap/ui/mdc/flexibility/FilterItemFlex.js +1 -1
  77. package/src/sap/ui/mdc/library.js +19 -23
  78. package/src/sap/ui/mdc/link/ContactDetails.js +107 -23
  79. package/src/sap/ui/mdc/link/ContactDetailsAddressItem.js +1 -1
  80. package/src/sap/ui/mdc/link/ContactDetailsEmailItem.js +1 -1
  81. package/src/sap/ui/mdc/link/ContactDetailsItem.js +1 -1
  82. package/src/sap/ui/mdc/link/ContactDetailsPhoneItem.js +1 -1
  83. package/src/sap/ui/mdc/link/ContactDetailsRenderer.js +26 -0
  84. package/src/sap/ui/mdc/link/Factory.js +1 -1
  85. package/src/sap/ui/mdc/link/FakeFlpConnector.js +1 -1
  86. package/src/sap/ui/mdc/link/LinkItem.js +1 -1
  87. package/src/sap/ui/mdc/link/Panel.js +197 -22
  88. package/src/sap/ui/mdc/link/PanelItem.js +1 -1
  89. package/src/sap/ui/mdc/link/PanelRenderer.js +26 -0
  90. package/src/sap/ui/mdc/link/SemanticObjectMapping.js +1 -1
  91. package/src/sap/ui/mdc/link/SemanticObjectMappingItem.js +1 -1
  92. package/src/sap/ui/mdc/link/SemanticObjectUnavailableAction.js +1 -1
  93. package/src/sap/ui/mdc/messagebundle.properties +8 -4
  94. package/src/sap/ui/mdc/messagebundle_ar.properties +6 -4
  95. package/src/sap/ui/mdc/messagebundle_bg.properties +6 -4
  96. package/src/sap/ui/mdc/messagebundle_ca.properties +6 -4
  97. package/src/sap/ui/mdc/messagebundle_cs.properties +6 -4
  98. package/src/sap/ui/mdc/messagebundle_cy.properties +6 -4
  99. package/src/sap/ui/mdc/messagebundle_da.properties +6 -4
  100. package/src/sap/ui/mdc/messagebundle_de.properties +6 -4
  101. package/src/sap/ui/mdc/messagebundle_el.properties +5 -3
  102. package/src/sap/ui/mdc/messagebundle_en.properties +6 -4
  103. package/src/sap/ui/mdc/messagebundle_en_GB.properties +6 -4
  104. package/src/sap/ui/mdc/messagebundle_en_US_sappsd.properties +6 -4
  105. package/src/sap/ui/mdc/messagebundle_en_US_saprigi.properties +7 -5
  106. package/src/sap/ui/mdc/messagebundle_en_US_saptrc.properties +7 -5
  107. package/src/sap/ui/mdc/messagebundle_es.properties +6 -4
  108. package/src/sap/ui/mdc/messagebundle_es_MX.properties +6 -4
  109. package/src/sap/ui/mdc/messagebundle_et.properties +6 -4
  110. package/src/sap/ui/mdc/messagebundle_fi.properties +6 -4
  111. package/src/sap/ui/mdc/messagebundle_fr.properties +6 -4
  112. package/src/sap/ui/mdc/messagebundle_fr_CA.properties +6 -4
  113. package/src/sap/ui/mdc/messagebundle_hi.properties +6 -4
  114. package/src/sap/ui/mdc/messagebundle_hr.properties +6 -4
  115. package/src/sap/ui/mdc/messagebundle_hu.properties +6 -4
  116. package/src/sap/ui/mdc/messagebundle_id.properties +6 -4
  117. package/src/sap/ui/mdc/messagebundle_it.properties +6 -4
  118. package/src/sap/ui/mdc/messagebundle_iw.properties +5 -3
  119. package/src/sap/ui/mdc/messagebundle_ja.properties +7 -5
  120. package/src/sap/ui/mdc/messagebundle_kk.properties +6 -4
  121. package/src/sap/ui/mdc/messagebundle_ko.properties +5 -3
  122. package/src/sap/ui/mdc/messagebundle_lt.properties +6 -4
  123. package/src/sap/ui/mdc/messagebundle_lv.properties +6 -4
  124. package/src/sap/ui/mdc/messagebundle_ms.properties +6 -4
  125. package/src/sap/ui/mdc/messagebundle_nl.properties +6 -4
  126. package/src/sap/ui/mdc/messagebundle_no.properties +6 -4
  127. package/src/sap/ui/mdc/messagebundle_pl.properties +6 -4
  128. package/src/sap/ui/mdc/messagebundle_pt.properties +7 -5
  129. package/src/sap/ui/mdc/messagebundle_pt_PT.properties +6 -4
  130. package/src/sap/ui/mdc/messagebundle_ro.properties +6 -4
  131. package/src/sap/ui/mdc/messagebundle_ru.properties +6 -4
  132. package/src/sap/ui/mdc/messagebundle_sh.properties +9 -7
  133. package/src/sap/ui/mdc/messagebundle_sk.properties +6 -4
  134. package/src/sap/ui/mdc/messagebundle_sl.properties +7 -5
  135. package/src/sap/ui/mdc/messagebundle_sv.properties +7 -5
  136. package/src/sap/ui/mdc/messagebundle_th.properties +6 -4
  137. package/src/sap/ui/mdc/messagebundle_tr.properties +7 -5
  138. package/src/sap/ui/mdc/messagebundle_uk.properties +6 -4
  139. package/src/sap/ui/mdc/messagebundle_vi.properties +6 -4
  140. package/src/sap/ui/mdc/messagebundle_zh_CN.properties +6 -4
  141. package/src/sap/ui/mdc/messagebundle_zh_TW.properties +6 -4
  142. package/src/sap/ui/mdc/mixin/AdaptationMixin.js +4 -11
  143. package/src/sap/ui/mdc/mixin/DelegateMixin.js +1 -1
  144. package/src/sap/ui/mdc/mixin/FilterIntegrationMixin.js +1 -1
  145. package/src/sap/ui/mdc/mixin/PromiseMixin.js +1 -1
  146. package/src/sap/ui/mdc/mixin/PropertyHelperMixin.js +7 -1
  147. package/src/sap/ui/mdc/odata/v4/ChartPropertyHelper.js +1 -1
  148. package/src/sap/ui/mdc/odata/v4/FieldBaseDelegate.js +8 -6
  149. package/src/sap/ui/mdc/odata/v4/TableDelegate.js +18 -33
  150. package/src/sap/ui/mdc/odata/v4/ValueHelpDelegate.js +63 -3
  151. package/src/sap/ui/mdc/odata/v4/vizChart/ChartDelegate.js +57 -0
  152. package/src/sap/ui/mdc/p13n/Engine.js +147 -51
  153. package/src/sap/ui/mdc/p13n/FlexUtil.js +26 -14
  154. package/src/sap/ui/mdc/p13n/PropertyHelper.js +1 -1
  155. package/src/sap/ui/mdc/p13n/StateUtil.js +30 -51
  156. package/src/sap/ui/mdc/p13n/UIManager.js +6 -2
  157. package/src/sap/ui/mdc/p13n/modification/ModificationHandler.js +0 -178
  158. package/src/sap/ui/mdc/p13n/modules/DefaultProviderRegistry.js +2 -2
  159. package/src/sap/ui/mdc/p13n/modules/xConfigAPI.js +219 -0
  160. package/src/sap/ui/mdc/p13n/panels/ChartItemPanel.js +73 -14
  161. package/src/sap/ui/mdc/p13n/subcontroller/AggregateController.js +2 -2
  162. package/src/sap/ui/mdc/p13n/subcontroller/BaseController.js +30 -2
  163. package/src/sap/ui/mdc/p13n/subcontroller/ChartTypeController.js +46 -0
  164. package/src/sap/ui/mdc/p13n/subcontroller/ColumnWidthController.js +37 -6
  165. package/src/sap/ui/mdc/p13n/subcontroller/FilterController.js +24 -6
  166. package/src/sap/ui/mdc/p13n/subcontroller/GroupController.js +9 -2
  167. package/src/sap/ui/mdc/p13n/subcontroller/SortController.js +2 -2
  168. package/src/sap/ui/mdc/table/Column.js +271 -132
  169. package/src/sap/ui/mdc/table/CreationRow.js +1 -1
  170. package/src/sap/ui/mdc/table/PropertyHelper.js +59 -90
  171. package/src/sap/ui/mdc/table/ResponsiveTableType.js +35 -27
  172. package/src/sap/ui/mdc/table/RowActionItem.js +1 -1
  173. package/src/sap/ui/mdc/table/RowSettings.js +1 -1
  174. package/src/sap/ui/mdc/table/TableSettings.js +10 -22
  175. package/src/sap/ui/mdc/table/V4AnalyticsPropertyHelper.js +1 -1
  176. package/src/sap/ui/mdc/table/menu/Item.js +78 -0
  177. package/src/sap/ui/mdc/table/menu/ItemContainer.js +60 -0
  178. package/src/sap/ui/mdc/table/menu/QuickActionContainer.js +151 -0
  179. package/src/sap/ui/mdc/themes/base/Chart.less +4 -0
  180. package/src/sap/ui/mdc/ui/Container.js +0 -0
  181. package/src/sap/ui/mdc/util/FilterUtil.js +1 -1
  182. package/src/sap/ui/mdc/util/IdentifierUtil.js +3 -3
  183. package/src/sap/ui/mdc/util/PromiseCache.js +6 -2
  184. package/src/sap/ui/mdc/util/PropertyHelper.js +5 -1
  185. package/src/sap/ui/mdc/valuehelp/Dialog.js +234 -44
  186. package/src/sap/ui/mdc/valuehelp/Popover.js +3 -2
  187. package/src/sap/ui/mdc/valuehelp/base/Container.js +63 -48
  188. package/src/sap/ui/mdc/valuehelp/base/Content.js +35 -16
  189. package/src/sap/ui/mdc/valuehelp/base/DialogTab.js +1 -1
  190. package/src/sap/ui/mdc/valuehelp/base/FilterableListContent.js +158 -281
  191. package/src/sap/ui/mdc/valuehelp/base/ListContent.js +4 -4
  192. package/src/sap/ui/mdc/valuehelp/content/Bool.js +4 -4
  193. package/src/sap/ui/mdc/valuehelp/content/Conditions.js +4 -4
  194. package/src/sap/ui/mdc/valuehelp/content/FixedList.js +4 -4
  195. package/src/sap/ui/mdc/valuehelp/content/ListCollection.js +205 -0
  196. package/src/sap/ui/mdc/valuehelp/content/MDCTable.js +59 -57
  197. package/src/sap/ui/mdc/valuehelp/content/MTable.js +89 -182
  198. package/test/sap/ui/mdc/testutils/opa/chart/TestObjects.js +2 -3
  199. package/test/sap/ui/mdc/testutils/opa/chartNew/TestObjects.js +2 -3
  200. package/test/sap/ui/mdc/testutils/opa/p13n/Actions.js +17 -3
  201. package/src/sap/ui/mdc/link/ContactDetails.control.xml +0 -29
  202. package/src/sap/ui/mdc/link/Panel.control.xml +0 -36
  203. package/src/sap/ui/mdc/link/PanelListItem.control.xml +0 -24
  204. package/src/sap/ui/mdc/link/PanelListItem.js +0 -101
@@ -6,20 +6,18 @@
6
6
 
7
7
  sap.ui.define([
8
8
  "../util/PropertyHelper",
9
- "sap/ui/core/Core",
10
9
  "sap/m/table/Util"
11
10
  ], function(
12
11
  PropertyHelperBase,
13
- Core,
14
12
  TableUtil
15
13
  ) {
16
14
  "use strict";
17
15
 
18
16
  /**
19
- * @typedef {object} sap.ui.mdc.table.PropertyInfo
17
+ * @typedef {Object} sap.ui.mdc.table.PropertyInfo
20
18
  * @extends sap.ui.mdc.util.PropertyInfo
21
19
  *
22
- * @property {object} [exportSettings]
20
+ * @property {Object} [exportSettings]
23
21
  * Object that contains information about the export settings, see {@link sap.ui.export.Spreadsheet}.
24
22
  * @property {int} [maxConditions]
25
23
  * Defines the maximum number of filter conditions for the property. Possible values that can be used:
@@ -43,9 +41,9 @@ sap.ui.define([
43
41
  * Name of the text property that is related to this property in a 1:1 relation.
44
42
  * @property {boolean} [required]
45
43
  * Defines whether a filter condition for this property is required.
46
- * @property {object} [visualSettings]
44
+ * @property {Object} [visualSettings]
47
45
  * This object contains all relevant properties for visual adjustments.
48
- * @property {object} [visualSettings.widthCalculation]
46
+ * @property {Object} [visualSettings.widthCalculation]
49
47
  * This object contains all properties and their default values for the column width calculation
50
48
  * @property {integer} [visualSettings.widthCalculation.minWidth]
51
49
  * The minimum content width in rem
@@ -71,15 +69,15 @@ sap.ui.define([
71
69
  /**
72
70
  * Constructor for a new table property helper.
73
71
  *
74
- * @param {object[]} aProperties
72
+ * @param {Object[]} aProperties
75
73
  * The properties to process in this helper
76
- * @param {Object<string, object>} [mExtensions]
74
+ * @param {Object<string, Object>} [mExtensions]
77
75
  * Key-value map, where the key is the name of the property and the value is the extension containing mode-specific information.
78
76
  * The extension of a property is stored in a reserved <code>extension</code> attribute, and its attributes must be specified with
79
77
  * <code>mExtensionAttributeMetadata</code>.
80
78
  * @param {sap.ui.base.ManagedObject} [oParent]
81
79
  * A reference to an instance that will act as the parent of this helper
82
- * @param {object} [mExtensionAttributeMetadata]
80
+ * @param {Object} [mExtensionAttributeMetadata]
83
81
  * The attribute metadata for the model-specific property extension
84
82
  *
85
83
  * @class
@@ -90,7 +88,7 @@ sap.ui.define([
90
88
  * @extends sap.ui.mdc.util.PropertyHelper
91
89
  *
92
90
  * @author SAP SE
93
- * @version 1.100.0
91
+ * @version 1.101.0
94
92
  *
95
93
  * @private
96
94
  * @experimental
@@ -134,35 +132,42 @@ sap.ui.define([
134
132
  *
135
133
  * @param {sap.ui.mdc.table.Column} oColumn The column for which to get the export settings
136
134
  * @param {boolean} [bSplitCells=false] Whether the <code>splitCells</code> configuration is enabled
137
- * @returns {null|object} Export setting object for the provided column
135
+ * @returns {Object[]} Array of export setting objects for the provided column. Will return more than one object if it is complex property and if <code>splitCells=true</code>
138
136
  * @public
139
137
  */
140
138
  PropertyHelper.prototype.getColumnExportSettings = function(oColumn, bSplitCells) {
139
+ var aColumnExportSettings = [];
140
+
141
141
  if (!isMdcColumnInstance(oColumn)) {
142
- return null;
142
+ return aColumnExportSettings;
143
143
  }
144
144
 
145
145
  var oProperty = this.getProperty(oColumn.getDataProperty());
146
146
 
147
147
  if (!oProperty) {
148
- return null;
148
+ return aColumnExportSettings;
149
+ }
150
+
151
+ var oExportSettings = oProperty.exportSettings;
152
+
153
+ // exportSettings have been set explicitly to null by the application for this column to exclude it from the export
154
+ if (oExportSettings === null) {
155
+ return aColumnExportSettings;
149
156
  }
150
157
 
151
158
  bSplitCells = bSplitCells === true;
152
159
 
153
- var aColumnExportSettings = [];
154
- var aPropertiesFromComplexProperty;
155
- var oExportSettings = oProperty.exportSettings;
156
- var oColumnExportSettings;
157
160
  var aPaths = [];
158
161
  var sAdditionalPath;
159
162
  var oAdditionalProperty;
163
+ var oColumnExportSettings;
160
164
  var oAdditionExportSettings;
165
+ var aPropertiesFromComplexProperty;
161
166
  var oAdditionalColumnExportSettings;
162
167
 
163
168
  if (oProperty.isComplex()) {
164
169
  aPropertiesFromComplexProperty = oProperty.getReferencedProperties();
165
- if (!bSplitCells && oExportSettings) {
170
+ if (!bSplitCells && Object.keys(oExportSettings).length) {
166
171
  oColumnExportSettings = getColumnExportSettingsObject(oColumn, oProperty, oExportSettings, bSplitCells);
167
172
  aPropertiesFromComplexProperty.forEach(function(oProperty) {
168
173
  aPaths.push(oProperty.path);
@@ -183,20 +188,13 @@ sap.ui.define([
183
188
  }
184
189
  }, this);
185
190
  }
186
- } else if (!bSplitCells && oExportSettings) {
187
- // called for basic PropertyInfo having exportSettings
188
- oColumnExportSettings = getColumnExportSettingsObject(oColumn, oProperty, oExportSettings, bSplitCells);
189
- oColumnExportSettings.property = oProperty.path;
190
- aColumnExportSettings.push(oColumnExportSettings);
191
191
  } else {
192
192
  oColumnExportSettings = getColumnExportSettingsObject(oColumn, oProperty, oExportSettings, bSplitCells);
193
193
  oColumnExportSettings.property = oProperty.path;
194
- if (oColumnExportSettings.property) {
195
- aColumnExportSettings.push(oColumnExportSettings);
196
- }
194
+ aColumnExportSettings.push(oColumnExportSettings);
197
195
 
198
196
  // get Additional path in case of split cells
199
- sAdditionalPath = bSplitCells && oExportSettings && oExportSettings.unitProperty ? oExportSettings.unitProperty : null;
197
+ sAdditionalPath = bSplitCells && oExportSettings.unitProperty ? oExportSettings.unitProperty : null;
200
198
 
201
199
  if (sAdditionalPath) {
202
200
  oAdditionalProperty = getAdditionalProperty(this, sAdditionalPath);
@@ -218,7 +216,7 @@ sap.ui.define([
218
216
  *
219
217
  * @param {sap.ui.mdc.table.PropertyHelper} oPropertyHelper Property helper instance
220
218
  * @param {string} sPath The value of the <code>path</code> attribute of the property
221
- * @returns {object} The property
219
+ * @returns {Object} The property
222
220
  * @public
223
221
  */
224
222
  function getAdditionalProperty(oPropertyHelper, sPath) {
@@ -241,10 +239,10 @@ sap.ui.define([
241
239
  * Sets defaults to export settings and returns a new export settings object.
242
240
  *
243
241
  * @param {sap.ui.mdc.table.Column} oColumn The column from which to get default values
244
- * @param {object} oProperty The property from which to get default values
245
- * @param {object} oExportSettings The export settings for which to set defaults
242
+ * @param {Object} oProperty The property from which to get default values
243
+ * @param {Object} oExportSettings The export settings for which to set defaults
246
244
  * @param {boolean} bSplitCells Whether the <code>splitCells</code> configuration is enabled
247
- * @returns {object} The new export settings object
245
+ * @returns {Object} The new export settings object
248
246
  * @private
249
247
  */
250
248
  function getColumnExportSettingsObject(oColumn, oProperty, oExportSettings, bSplitCells) {
@@ -264,92 +262,63 @@ sap.ui.define([
264
262
  }
265
263
 
266
264
  /**
267
- * Sets the width of the provided column based on the <code>visualSettings</code> of the relevant <code>PropertyInfo</code>.
265
+ * Calculates the width of the provided column based on the <code>visualSettings</code> of the relevant <code>PropertyInfo</code>.
268
266
  *
269
267
  * @param {sap.ui.mdc.table.Column} oMDCColumn The <code>Column</code> instance for which to set the width
270
- * @public
271
- * @since 1.95
268
+ * @returns {sap.ui.core.CSSSize | null} The calculated width, or <code>null</code> if calculation wasn't possible
272
269
  */
273
- PropertyHelper.prototype.setColumnWidth = function(oMDCColumn) {
270
+ PropertyHelper.prototype.calculateColumnWidth = function(oMDCColumn) {
274
271
  var sPropertyName = oMDCColumn.getDataProperty();
275
272
  var oProperty = this.getProperty(sPropertyName);
273
+
276
274
  if (!oProperty) {
277
- return;
275
+ return null;
278
276
  }
279
277
 
280
278
  var mPropertyInfoVisualSettings = oProperty.visualSettings;
281
279
  if (mPropertyInfoVisualSettings && mPropertyInfoVisualSettings.widthCalculation === null) {
282
- return;
280
+ return null;
283
281
  }
284
282
 
285
- var fWidth = this._calcColumnWidth(oProperty) + 1; // add 1rem extra for padding and border
286
- oMDCColumn._updateColumnWidth(fWidth + "rem");
283
+ return this._calcColumnWidth(oProperty);
287
284
  };
288
285
 
289
286
  /**
290
287
  * Calculates the column width based on the provided <code>PropertyInfo</code>.
291
288
  *
292
- * @param {object} oProperty The properties of <code>PropertyInfo</code> of <code>Column</code> instance for which to set the width
293
- * @param {object} [mWidthCalculation] The configuration object for the width calculation
294
- * @param {int} [mWidthCalculation.minWidth=2] The minimum content width in rem
295
- * @param {int} [mWidthCalculation.maxWidth=19] The maximum content width in rem
296
- * @param {int} [mWidthCalculation.defaultWidth=8] The default column content width when type check fails
297
- * @param {boolean} [mWidthCalculation.includeLabel=true] Whether the label should be taken into account
298
- * @param {float} [mWidthCalculation.gap=0] The additional content width in rem
299
- * @param {boolean} [mWidthCalculation.verticalArrangement=false] Whether the referenced properties are arranged vertically
300
- * @param {string|array[]} [mWidthCalculation.excludeProperties=[]] A list of invisible referenced property names
301
- * @return {float} [fWidth] Calculated width
289
+ * @param {Object} oProperty The properties of <code>PropertyInfo</code> of <code>Column</code> instance for which to set the width
290
+ * @return {string} The calculated column width
302
291
  * @since 1.95
303
292
  * @private
304
293
  */
305
- PropertyHelper.prototype._calcColumnWidth = function (oProperty, mWidthCalculation) {
306
- var fWidth = 0;
307
- var fLabelWidth = 0;
308
- var mPropertyInfoWidthCalculation = oProperty.visualSettings.widthCalculation;
309
- mWidthCalculation = Object.assign({}, mPropertyInfoWidthCalculation, mWidthCalculation || {});
310
-
311
- var iMinWidth = Math.max(1, mWidthCalculation.minWidth);
312
- var iMaxWidth = Math.max(iMinWidth, mWidthCalculation.maxWidth);
313
-
294
+ PropertyHelper.prototype._calcColumnWidth = function (oProperty) {
295
+ var mWidthCalculation = Object.assign({
296
+ gap: 0,
297
+ includeLabel: true,
298
+ excludeProperties: []
299
+ }, oProperty.visualSettings && oProperty.visualSettings.widthCalculation);
300
+
301
+ var aTypes = [];
314
302
  if (oProperty.isComplex()) {
315
- var aRelevantReferencedProperties = oProperty.getReferencedProperties().filter(function(oProp) {
316
- return ![].concat(mWidthCalculation.excludeProperties).includes(oProp.name);
303
+ // for complex properties generate [<TypeInstance>, <TypeSettings>][] structure
304
+ aTypes = oProperty.getReferencedProperties().flatMap(function(oProp) {
305
+ var mPropWidthCalculation = oProp.visualSettings ? oProp.visualSettings.widthCalculation : undefined;
306
+ return mPropWidthCalculation === null || mWidthCalculation.excludeProperties.includes(oProp.name) ? [] : [
307
+ [oProp.typeConfig.typeInstance, mPropWidthCalculation]
308
+ ];
317
309
  });
318
-
319
- aRelevantReferencedProperties.forEach(function(oReferencedProperty) {
320
- var fReferencedPropertyWidth = this._calcColumnWidth(oReferencedProperty, {
321
- includeLabel: false
322
- });
323
-
324
- if (mWidthCalculation.verticalArrangement || aRelevantReferencedProperties.length == 1) {
325
- fWidth = Math.max(fReferencedPropertyWidth, fWidth);
326
- } else {
327
- fWidth = fWidth + fReferencedPropertyWidth + 0.5; // add 0.5rem for some extra spacing in h-alignment
328
- }
329
- }, this);
330
310
  } else {
331
- var oTypeConfig = oProperty.typeConfig;
332
- var oType = oTypeConfig.typeInstance;
333
-
334
- if (oType) {
335
- fWidth = TableUtil.calcTypeWidth(oType, mWidthCalculation);
336
- }
337
- if (oProperty.unit) {
338
- fWidth += 2.5;
339
- }
311
+ // for simple properties generate <TypeInstance>[] structure
312
+ aTypes.push(oProperty.typeConfig.typeInstance);
340
313
  }
341
314
 
342
- fWidth += mWidthCalculation.gap;
343
-
344
- if (mWidthCalculation.includeLabel) {
345
- fLabelWidth = TableUtil.calcHeaderWidth(oProperty.label, fWidth, iMaxWidth, iMinWidth);
315
+ if (oProperty.unit) {
316
+ // @TODO: follow the unit property, like a complex property, instead of adding a fix gap
317
+ mWidthCalculation.gap += 2.5;
346
318
  }
347
319
 
348
- fWidth = Math.max(iMinWidth, fWidth, fLabelWidth);
349
- fWidth = Math.min(fWidth, iMaxWidth);
350
- fWidth = Math.round(fWidth * 100) / 100;
351
-
352
- return fWidth;
320
+ var sHeader = (mWidthCalculation.includeLabel) ? oProperty.label : "";
321
+ return TableUtil.calcColumnWidth(aTypes, sHeader, mWidthCalculation);
353
322
  };
354
323
 
355
324
  return PropertyHelper;
@@ -5,8 +5,8 @@
5
5
  */
6
6
 
7
7
  sap.ui.define([
8
- "sap/ui/core/Core", "./TableTypeBase", "../library", "sap/m/Button", "sap/ui/Device", "sap/m/plugins/ColumnResizer"
9
- ], function(Core, TableTypeBase, library, Button, Device, ColumnResizer) {
8
+ "sap/ui/core/Core", "./TableTypeBase", "../library", "sap/m/Button", "sap/ui/Device", "sap/m/plugins/ColumnResizer", "sap/m/SegmentedButton", "sap/m/SegmentedButtonItem"
9
+ ], function(Core, TableTypeBase, library, Button, Device, ColumnResizer, SegmentedButton, SegmentedButtonItem) {
10
10
  "use strict";
11
11
 
12
12
  var InnerTable, InnerColumn, InnerRow;
@@ -114,7 +114,6 @@ sap.ui.define([
114
114
  // avoid execution of the if and else if block if bValue has not changed
115
115
  if (bValue && !this._oShowDetailsButton) {
116
116
  oTable.getHeaderToolbar().insertEnd(this._getShowDetailsButton(), 0);
117
- this._renderShowDetailsButton();
118
117
  oTable.attachEvent("popinChanged", this._onPopinChanged, this);
119
118
  oTable.setHiddenInPopin(this._getImportanceToHide());
120
119
  } else if (!bValue && this._oShowDetailsButton) {
@@ -252,26 +251,18 @@ sap.ui.define([
252
251
  }
253
252
  };
254
253
 
255
- ResponsiveTableType.startColumnResize = function(oInnerTable, oColumn) {
254
+ ResponsiveTableType.startColumnResize = function(oInnerTable, oColumn, oColumnMenu) {
256
255
  var oColumnResizer = ColumnResizer.getPlugin(oInnerTable);
257
256
 
258
257
  if (!oColumnResizer) {
259
258
  return;
260
259
  }
261
260
 
262
- return oColumnResizer.getColumnResizeButton(oColumn);
263
- };
264
-
265
- /**
266
- * Renders the look and feel of the Show / Hide Details button
267
- *
268
- * @private
269
- */
270
- ResponsiveTableType.prototype._renderShowDetailsButton = function() {
271
- var oRb = Core.getLibraryResourceBundle("sap.ui.mdc"), sText;
272
-
273
- sText = this.bHideDetails ? oRb.getText("table.SHOWDETAILS_TEXT") : oRb.getText("table.HIDEDETAILS_TEXT");
274
- this._oShowDetailsButton.setText(sText);
261
+ if (oColumnMenu && oColumnMenu.isA("sap.m.table.columnmenu.Menu")) {
262
+ return oColumnResizer.getColumnResizeQuickAction(oColumn, oColumnMenu);
263
+ } else {
264
+ return oColumnResizer.getColumnResizeButton(oColumn);
265
+ }
275
266
  };
276
267
 
277
268
  /**
@@ -296,17 +287,37 @@ sap.ui.define([
296
287
  } else {
297
288
  oTable.setHiddenInPopin([]);
298
289
  }
299
- this._renderShowDetailsButton();
300
290
  };
301
291
 
302
292
  ResponsiveTableType.prototype._getShowDetailsButton = function() {
303
293
  if (!this._oShowDetailsButton) {
294
+ var oRb = Core.getLibraryResourceBundle("sap.ui.mdc");
304
295
  this.bHideDetails = true;
305
- this._oShowDetailsButton = new Button(this.getId() + "-showHideDetails", {
296
+ this._oShowDetailsButton = new SegmentedButton(this.getId() + "-showHideDetails", {
306
297
  visible: false,
307
- press: [function() {
308
- this._toggleShowDetails(!this.bHideDetails);
309
- }, this]
298
+ selectedKey: "hideDetails",
299
+ items: [
300
+ new SegmentedButtonItem({
301
+ icon: "sap-icon://detail-more",
302
+ key: "showDetails",
303
+ tooltip: oRb.getText("table.SHOWDETAILS_TEXT"),
304
+ press: [
305
+ function() {
306
+ this._toggleShowDetails(false);
307
+ }, this
308
+ ]
309
+ }),
310
+ new SegmentedButtonItem({
311
+ icon: "sap-icon://detail-less",
312
+ key: "hideDetails",
313
+ tooltip: oRb.getText("table.HIDEDETAILS_TEXT"),
314
+ press: [
315
+ function() {
316
+ this._toggleShowDetails(true);
317
+ }, this
318
+ ]
319
+ })
320
+ ]
310
321
  });
311
322
  }
312
323
  return this._oShowDetailsButton;
@@ -320,15 +331,12 @@ sap.ui.define([
320
331
  */
321
332
  ResponsiveTableType.prototype._getImportanceToHide = function() {
322
333
  var aDetailsButtonSetting = this.getDetailsButtonSetting() || [];
323
- var aImportanceToHide = [];
324
334
 
325
335
  if (aDetailsButtonSetting.length) {
326
- aImportanceToHide = aDetailsButtonSetting;
336
+ return aDetailsButtonSetting;
327
337
  } else {
328
- aImportanceToHide = Device.system.phone ? ["Low", "Medium"] : ["Low"];
338
+ return Device.system.phone ? ["Low", "Medium"] : ["Low"];
329
339
  }
330
-
331
- return aImportanceToHide;
332
340
  };
333
341
 
334
342
  /**
@@ -24,7 +24,7 @@ sap.ui.define([
24
24
  * The <code>RowActionItem</code> control represents a action for a row.
25
25
  * This control can only be used in the context of <code>sap.ui.mdc.Table</code> control to define row actions.
26
26
  * @extends sap.ui.core.Element
27
- * @version 1.100.0
27
+ * @version 1.101.0
28
28
  *
29
29
  * @constructor
30
30
  * @experimental
@@ -21,7 +21,7 @@ sap.ui.define([
21
21
  * The <code>RowSettings</code> control is used to configure a row.
22
22
  * This control can only be used in the context of the <code>sap.ui.mdc.Table</code> control to define row settings.
23
23
  * @extends sap.ui.core.Element
24
- * @version 1.100.0
24
+ * @version 1.101.0
25
25
  *
26
26
  * @constructor
27
27
  * @experimental
@@ -118,7 +118,7 @@ sap.ui.define([
118
118
  },
119
119
 
120
120
  showUIColumns: function(oControl, oSource) {
121
- oControl.getEngine().uimanager.show(oControl, oControl.getP13nMode(), oSource);
121
+ oControl.getEngine().uimanager.show(oControl, oControl.getActiveP13nModes(), oSource);
122
122
  },
123
123
 
124
124
  showUIFilter: function(oControl, oSource) {
@@ -130,31 +130,19 @@ sap.ui.define([
130
130
  *
131
131
  * @param {object} oControl The control for which the sorting is used
132
132
  * @param {string} sProperty The property for which the sorting is used
133
- * @param {boolean} bDescending Whether to sort in descending or ascending order
133
+ * @param {sap.ui.core.SortOrder} sSortOrder Whether to sort in descending or ascending order
134
134
  * @param {boolean} [bRemoveAllExisting=true] Set to remove the previous sorters
135
135
  */
136
- createSort: function(oControl, sProperty, bDescending, bRemoveAllExisting) {
137
-
138
- var oSorter = {
139
- selected: true,
140
- name: sProperty,
141
- descending: bDescending,
142
- sorted: true
143
- };
144
-
145
- //check to revert sorting in case the sorter and its type already exists
146
- oControl.getCurrentState().sorters.forEach(function(oProp) {
147
- if (oProp.name == sProperty && oProp.descending === bDescending) {
148
- oSorter.sorted = false;
149
- }
150
- });
151
-
152
- var aItems = [oSorter];
153
-
136
+ createSort: function(oControl, sProperty, sSortOrder, bRemoveAllExisting) {
154
137
  oControl.getEngine().createChanges({
155
138
  control: oControl,
156
139
  key: "Sort",
157
- state: aItems,
140
+ state: [{
141
+ selected: true,
142
+ name: sProperty,
143
+ descending: sSortOrder === CoreLibrary.SortOrder.Descending,
144
+ sorted: sSortOrder !== CoreLibrary.SortOrder.None
145
+ }],
158
146
  applyAbsolute: bRemoveAllExisting
159
147
  });
160
148
 
@@ -176,7 +164,7 @@ sap.ui.define([
176
164
  control: oControl,
177
165
  key: "Group",
178
166
  state: aGroup,
179
- applyAbsolute: false
167
+ applyAbsolute: oControl._bMobileTable
180
168
  });
181
169
  },
182
170
 
@@ -27,7 +27,7 @@ sap.ui.define([
27
27
  * @extends sap.ui.mdc.table.PropertyHelper
28
28
  *
29
29
  * @author SAP SE
30
- * @version 1.100.0
30
+ * @version 1.101.0
31
31
  *
32
32
  * @private
33
33
  * @experimental
@@ -0,0 +1,78 @@
1
+ /*!
2
+ * OpenUI5
3
+ * (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
4
+ * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
+ */
6
+ sap.ui.define([
7
+ "sap/ui/core/Core",
8
+ "sap/m/table/columnmenu/Item"
9
+ ], function(
10
+ Core,
11
+ ItemBase
12
+ ) {
13
+ "use strict";
14
+
15
+ var Item = ItemBase.extend("sap.ui.mdc.table.menu.Item", {
16
+ metadata: {
17
+ library: "sap.ui.mdc",
18
+ properties: {
19
+ key: {type: "string"}
20
+ }
21
+ }
22
+ });
23
+
24
+ Item.prototype.initializeContent = function() {
25
+ var oTable = this.getTable();
26
+ var oEngine = oTable.getEngine();
27
+ var sKey = this.getKey();
28
+ var oController = oEngine.getController(oTable, sKey);
29
+
30
+ return oTable.getEngine().uimanager.create(oTable, [sKey]).then(function(oDialog) {
31
+ var oContent = oDialog.removeContent(0);
32
+ oDialog.destroy();
33
+
34
+ this.setContent(oContent);
35
+ this.setLabel(oController.getUISettings().title);
36
+
37
+ oController.update(oTable.getPropertyHelper());
38
+ oEngine.validateP13n(oTable, sKey, this.getContent());
39
+
40
+ this.changeButtonSettings({
41
+ reset: {visible: oController.getResetEnabled()}
42
+ });
43
+ }.bind(this));
44
+ };
45
+
46
+ Item.prototype.onPress = function() {
47
+ var oTable = this.getTable();
48
+ oTable.getEngine().getController(oTable, this.getKey()).update(oTable.getPropertyHelper());
49
+ };
50
+
51
+ Item.prototype.onConfirm = function() {
52
+ var oTable = this.getTable();
53
+ oTable.getEngine().handleP13n(oTable, [this.getKey()]);
54
+ };
55
+
56
+ Item.prototype.onReset = function() {
57
+ var oTable = this.getTable();
58
+
59
+ oTable.getEngine().reset(oTable, [this.getKey()]).then(function() {
60
+ oTable._oQuickActionContainer.initializeQuickActions();
61
+ oTable._oColumnHeaderMenu._oPopover.invalidate();
62
+ });
63
+ };
64
+
65
+ Item.prototype.destroyContent = function() {
66
+ // The AdaptationFilterBar must not be destroyed! A new one cannot be created.
67
+ if (this.getKey() !== "Filter") {
68
+ return this;
69
+ }
70
+ return this.destroyAggregation("content");
71
+ };
72
+
73
+ Item.prototype.getTable = function() {
74
+ return this.getParent().getTable();
75
+ };
76
+
77
+ return Item;
78
+ });
@@ -0,0 +1,60 @@
1
+ /*!
2
+ * OpenUI5
3
+ * (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
4
+ * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
+ */
6
+ sap.ui.define([
7
+ "sap/m/table/columnmenu/ItemContainer",
8
+ "sap/ui/mdc/table/menu/Item",
9
+ "sap/ui/core/Core"
10
+ ], function(
11
+ ItemContainerBase,
12
+ Item,
13
+ Core
14
+ ) {
15
+ "use strict";
16
+
17
+ var ItemContainer = ItemContainerBase.extend("sap.ui.mdc.table.menu.ItemContainer", {
18
+ metadata: {
19
+ library: "sap.ui.mdc",
20
+ associations: {
21
+ table: {type: "sap.ui.mdc.Table"}
22
+ }
23
+ }
24
+ });
25
+
26
+ ItemContainer.prototype.initializeItems = function() {
27
+ var oTable = this.getTable();
28
+ this.removeAllItems();
29
+
30
+ if (oTable.isSortingEnabled()) {
31
+ this.addItem(new Item({key: "Sort", icon: "sap-icon://sort"}));
32
+ }
33
+
34
+ if (oTable.isFilteringEnabled()) {
35
+ this.addItem(new Item({key: "Filter", icon: "sap-icon://filter"}));
36
+ }
37
+
38
+ if (oTable.isGroupingEnabled()) {
39
+ this.addItem(new Item({key: "Group", icon: "sap-icon://group-2"}));
40
+ }
41
+
42
+ if (oTable.getActiveP13nModes().includes("Column")) {
43
+ this.addItem(new Item({key: "Column", icon: "sap-icon://table-column"}));
44
+ }
45
+
46
+ return Promise.all(this.getItems().map(function(oItem) {
47
+ return oItem.initializeContent();
48
+ }));
49
+ };
50
+
51
+ ItemContainer.prototype.hasItems = function() {
52
+ return this.getEffectiveItems().length > 0;
53
+ };
54
+
55
+ ItemContainer.prototype.getTable = function() {
56
+ return Core.byId(this.getAssociation("table"));
57
+ };
58
+
59
+ return ItemContainer;
60
+ });