@openui5/sap.ui.mdc 1.93.3 → 1.96.2

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 (237) hide show
  1. package/.reuse/dep5 +6 -11
  2. package/THIRDPARTY.txt +10 -16
  3. package/package.json +4 -4
  4. package/src/sap/ui/mdc/.library +1 -1
  5. package/src/sap/ui/mdc/ActionToolbar.js +236 -334
  6. package/src/sap/ui/mdc/AggregationBaseDelegate.js +2 -1
  7. package/src/sap/ui/mdc/Chart.js +150 -22
  8. package/src/sap/ui/mdc/ChartDelegateNew.js +15 -0
  9. package/src/sap/ui/mdc/ChartNew.js +107 -66
  10. package/src/sap/ui/mdc/Control.js +4 -3
  11. package/src/sap/ui/mdc/Element.js +5 -4
  12. package/src/sap/ui/mdc/Field.js +2 -2
  13. package/src/sap/ui/mdc/FilterBar.js +1 -10
  14. package/src/sap/ui/mdc/FilterField.js +28 -4
  15. package/src/sap/ui/mdc/Link.js +2 -2
  16. package/src/sap/ui/mdc/MultiValueField.js +1 -1
  17. package/src/sap/ui/mdc/Table.js +172 -79
  18. package/src/sap/ui/mdc/TableDelegate.js +20 -3
  19. package/src/sap/ui/mdc/ValueHelp.js +1474 -0
  20. package/src/sap/ui/mdc/ValueHelpDelegate.js +147 -0
  21. package/src/sap/ui/mdc/actiontoolbar/ActionToolbarAction.js +49 -104
  22. package/src/sap/ui/mdc/chart/DimensionItem.js +3 -3
  23. package/src/sap/ui/mdc/chart/Item.js +2 -3
  24. package/src/sap/ui/mdc/chart/MeasureItem.js +2 -2
  25. package/src/sap/ui/mdc/chart/SelectionDetailsActions.js +21 -2
  26. package/src/sap/ui/mdc/chart/ToolbarHandler.js +237 -225
  27. package/src/sap/ui/mdc/chartNew/ChartSelectionDetailsNew.js +1 -1
  28. package/src/sap/ui/mdc/chartNew/ChartToolbarNew.js +14 -10
  29. package/src/sap/ui/mdc/chartNew/ChartTypeButtonNew.js +1 -1
  30. package/src/sap/ui/mdc/chartNew/DrillStackHandlerNew.js +12 -10
  31. package/src/sap/ui/mdc/chartNew/ItemNew.js +0 -1
  32. package/src/sap/ui/mdc/chartNew/PropertyHelperNew.js +1 -1
  33. package/src/sap/ui/mdc/condition/Condition.js +2 -2
  34. package/src/sap/ui/mdc/condition/ConditionConverter.js +1 -1
  35. package/src/sap/ui/mdc/condition/ConditionModel.js +1 -1
  36. package/src/sap/ui/mdc/condition/FilterConverter.js +1 -1
  37. package/src/sap/ui/mdc/condition/FilterOperatorUtil.js +13 -7
  38. package/src/sap/ui/mdc/condition/Operator.js +4 -4
  39. package/src/sap/ui/mdc/condition/RangeOperator.js +1 -1
  40. package/src/sap/ui/mdc/designtime/actiontoolbar/ActionToolbar.designtime.js +43 -0
  41. package/src/sap/ui/mdc/designtime/chart/ChartNew.designtime.js +91 -0
  42. package/src/sap/ui/mdc/designtime/filterbar/FilterBar.designtime.js +20 -0
  43. package/src/sap/ui/mdc/designtime/filterbar/FilterBarBase.designtime.js +31 -0
  44. package/src/sap/ui/mdc/designtime/table/Table.designtime.js +5 -0
  45. package/src/sap/ui/mdc/enum/ContentMode.js +25 -4
  46. package/src/sap/ui/mdc/enum/SelectType.js +43 -0
  47. package/src/sap/ui/mdc/field/BoolFieldHelp.js +1 -1
  48. package/src/sap/ui/mdc/field/ConditionFieldHelp.js +1 -1
  49. package/src/sap/ui/mdc/field/ConditionType.js +19 -4
  50. package/src/sap/ui/mdc/field/ConditionsType.js +5 -4
  51. package/src/sap/ui/mdc/field/CustomFieldHelp.js +1 -1
  52. package/src/sap/ui/mdc/field/CustomFieldInfo.js +1 -1
  53. package/src/sap/ui/mdc/field/DefineConditionPanel.js +38 -14
  54. package/src/sap/ui/mdc/field/FieldBase.js +92 -41
  55. package/src/sap/ui/mdc/field/FieldBaseDelegate.js +9 -2
  56. package/src/sap/ui/mdc/field/FieldHelpBase.js +64 -4
  57. package/src/sap/ui/mdc/field/FieldInfoBase.js +9 -1
  58. package/src/sap/ui/mdc/field/FieldInput.js +1 -1
  59. package/src/sap/ui/mdc/field/FieldInputRenderUtil.js +1 -1
  60. package/src/sap/ui/mdc/field/FieldMultiInput.js +1 -1
  61. package/src/sap/ui/mdc/field/FieldValueHelp.js +7 -1
  62. package/src/sap/ui/mdc/field/FieldValueHelpContentWrapperBase.js +1 -1
  63. package/src/sap/ui/mdc/field/FieldValueHelpMTableWrapper.js +1 -1
  64. package/src/sap/ui/mdc/field/FieldValueHelpMdcTableWrapper.js +1 -1
  65. package/src/sap/ui/mdc/field/FieldValueHelpTableWrapperBase.js +2 -2
  66. package/src/sap/ui/mdc/field/FieldValueHelpUITableWrapper.js +1 -1
  67. package/src/sap/ui/mdc/field/InParameter.js +1 -1
  68. package/src/sap/ui/mdc/field/ListFieldHelp.js +3 -3
  69. package/src/sap/ui/mdc/field/ListFieldHelpItem.js +1 -1
  70. package/src/sap/ui/mdc/field/MultiValueFieldItem.js +1 -1
  71. package/src/sap/ui/mdc/field/OutParameter.js +1 -1
  72. package/src/sap/ui/mdc/field/ValueHelpPanel.js +1 -1
  73. package/src/sap/ui/mdc/field/content/BooleanContent.js +15 -3
  74. package/src/sap/ui/mdc/field/content/ContentFactory.js +16 -8
  75. package/src/sap/ui/mdc/field/content/DefaultContent.js +64 -23
  76. package/src/sap/ui/mdc/field/content/LinkContent.js +6 -0
  77. package/src/sap/ui/mdc/field/content/SearchContent.js +21 -3
  78. package/src/sap/ui/mdc/field/content/UnitContent.js +2 -2
  79. package/src/sap/ui/mdc/filterbar/FilterBarBase.js +105 -44
  80. package/src/sap/ui/mdc/filterbar/PropertyHelper.js +52 -0
  81. package/src/sap/ui/mdc/filterbar/p13n/AdaptationFilterBar.js +10 -51
  82. package/src/sap/ui/mdc/filterbar/vh/FilterBar.js +1 -1
  83. package/src/sap/ui/mdc/flexibility/ActionToolbar.flexibility.js +22 -0
  84. package/src/sap/ui/mdc/flexibility/ActionToolbarAction.flexibility.js +19 -0
  85. package/src/sap/ui/mdc/flexibility/Chart.flexibility.js +1 -1
  86. package/src/sap/ui/mdc/flexibility/ConditionFlex.js +57 -46
  87. package/src/sap/ui/mdc/flexibility/FilterBar.flexibility.js +1 -1
  88. package/src/sap/ui/mdc/flexibility/FilterItemFlex.js +1 -1
  89. package/src/sap/ui/mdc/flexibility/ItemBaseFlex.js +203 -197
  90. package/src/sap/ui/mdc/library.js +588 -8
  91. package/src/sap/ui/mdc/link/ContactDetails.js +1 -1
  92. package/src/sap/ui/mdc/link/ContactDetailsAddressItem.js +1 -1
  93. package/src/sap/ui/mdc/link/ContactDetailsEmailItem.js +1 -1
  94. package/src/sap/ui/mdc/link/ContactDetailsItem.js +1 -1
  95. package/src/sap/ui/mdc/link/ContactDetailsPhoneItem.js +1 -1
  96. package/src/sap/ui/mdc/link/Factory.js +1 -1
  97. package/src/sap/ui/mdc/link/FakeFlpConnector.js +1 -1
  98. package/src/sap/ui/mdc/link/LinkItem.js +1 -1
  99. package/src/sap/ui/mdc/link/Panel.js +1 -1
  100. package/src/sap/ui/mdc/link/PanelItem.js +1 -1
  101. package/src/sap/ui/mdc/link/PanelListItem.js +1 -1
  102. package/src/sap/ui/mdc/link/SelectionDialog.js +2 -2
  103. package/src/sap/ui/mdc/link/SelectionDialogItem.js +1 -1
  104. package/src/sap/ui/mdc/link/SemanticObjectMapping.js +1 -1
  105. package/src/sap/ui/mdc/link/SemanticObjectMappingItem.js +1 -1
  106. package/src/sap/ui/mdc/link/SemanticObjectUnavailableAction.js +1 -1
  107. package/src/sap/ui/mdc/messagebundle.properties +31 -5
  108. package/src/sap/ui/mdc/messagebundle_ar.properties +19 -4
  109. package/src/sap/ui/mdc/messagebundle_bg.properties +18 -3
  110. package/src/sap/ui/mdc/messagebundle_ca.properties +18 -3
  111. package/src/sap/ui/mdc/messagebundle_cs.properties +31 -16
  112. package/src/sap/ui/mdc/messagebundle_cy.properties +18 -3
  113. package/src/sap/ui/mdc/messagebundle_da.properties +18 -3
  114. package/src/sap/ui/mdc/messagebundle_de.properties +20 -5
  115. package/src/sap/ui/mdc/messagebundle_el.properties +19 -4
  116. package/src/sap/ui/mdc/messagebundle_en.properties +17 -2
  117. package/src/sap/ui/mdc/messagebundle_en_GB.properties +18 -3
  118. package/src/sap/ui/mdc/messagebundle_en_US_sappsd.properties +11 -3
  119. package/src/sap/ui/mdc/messagebundle_en_US_saprigi.properties +19 -3
  120. package/src/sap/ui/mdc/messagebundle_en_US_saptrc.properties +11 -2
  121. package/src/sap/ui/mdc/messagebundle_es.properties +43 -28
  122. package/src/sap/ui/mdc/messagebundle_es_MX.properties +18 -3
  123. package/src/sap/ui/mdc/messagebundle_et.properties +18 -3
  124. package/src/sap/ui/mdc/messagebundle_fi.properties +19 -4
  125. package/src/sap/ui/mdc/messagebundle_fr.properties +32 -17
  126. package/src/sap/ui/mdc/messagebundle_fr_CA.properties +18 -3
  127. package/src/sap/ui/mdc/messagebundle_hi.properties +18 -3
  128. package/src/sap/ui/mdc/messagebundle_hr.properties +18 -3
  129. package/src/sap/ui/mdc/messagebundle_hu.properties +19 -4
  130. package/src/sap/ui/mdc/messagebundle_id.properties +19 -4
  131. package/src/sap/ui/mdc/messagebundle_it.properties +41 -26
  132. package/src/sap/ui/mdc/messagebundle_iw.properties +18 -3
  133. package/src/sap/ui/mdc/messagebundle_ja.properties +28 -13
  134. package/src/sap/ui/mdc/messagebundle_kk.properties +18 -3
  135. package/src/sap/ui/mdc/messagebundle_ko.properties +18 -3
  136. package/src/sap/ui/mdc/messagebundle_lt.properties +18 -3
  137. package/src/sap/ui/mdc/messagebundle_lv.properties +18 -3
  138. package/src/sap/ui/mdc/messagebundle_ms.properties +18 -3
  139. package/src/sap/ui/mdc/messagebundle_nl.properties +19 -4
  140. package/src/sap/ui/mdc/messagebundle_no.properties +25 -10
  141. package/src/sap/ui/mdc/messagebundle_pl.properties +22 -7
  142. package/src/sap/ui/mdc/messagebundle_pt.properties +19 -4
  143. package/src/sap/ui/mdc/messagebundle_pt_PT.properties +18 -3
  144. package/src/sap/ui/mdc/messagebundle_ro.properties +21 -6
  145. package/src/sap/ui/mdc/messagebundle_ru.properties +18 -3
  146. package/src/sap/ui/mdc/messagebundle_sh.properties +18 -3
  147. package/src/sap/ui/mdc/messagebundle_sk.properties +19 -4
  148. package/src/sap/ui/mdc/messagebundle_sl.properties +18 -3
  149. package/src/sap/ui/mdc/messagebundle_sv.properties +19 -4
  150. package/src/sap/ui/mdc/messagebundle_th.properties +24 -9
  151. package/src/sap/ui/mdc/messagebundle_tr.properties +18 -3
  152. package/src/sap/ui/mdc/messagebundle_uk.properties +18 -3
  153. package/src/sap/ui/mdc/messagebundle_vi.properties +18 -3
  154. package/src/sap/ui/mdc/messagebundle_zh_CN.properties +18 -3
  155. package/src/sap/ui/mdc/messagebundle_zh_TW.properties +18 -3
  156. package/src/sap/ui/mdc/mixin/AdaptationMixin.js +1 -1
  157. package/src/sap/ui/mdc/mixin/DelegateMixin.js +2 -2
  158. package/src/sap/ui/mdc/mixin/FilterIntegrationMixin.js +3 -3
  159. package/src/sap/ui/mdc/mixin/PromiseMixin.js +94 -0
  160. package/src/sap/ui/mdc/odata/v4/ChartPropertyHelperNew.js +1 -1
  161. package/src/sap/ui/mdc/odata/v4/FilterBarDelegate.js +6 -6
  162. package/src/sap/ui/mdc/odata/v4/TableDelegate.js +37 -10
  163. package/src/sap/ui/mdc/odata/v4/ValueHelpDelegate.js +94 -0
  164. package/src/sap/ui/mdc/odata/v4/vizChart/ChartDelegateNew.js +492 -203
  165. package/src/sap/ui/mdc/p13n/DefaultProviderRegistry.js +1 -1
  166. package/src/sap/ui/mdc/p13n/Engine.js +3 -2
  167. package/src/sap/ui/mdc/p13n/P13nBuilder.js +6 -60
  168. package/src/sap/ui/mdc/p13n/PropertyHelper.js +1 -1
  169. package/src/sap/ui/mdc/p13n/UIManager.js +1 -1
  170. package/src/sap/ui/mdc/p13n/modification/ModificationHandler.js +22 -24
  171. package/src/sap/ui/mdc/p13n/panels/ActionToolbarPanel.js +59 -0
  172. package/src/sap/ui/mdc/p13n/panels/AdaptFiltersPanel.js +1 -2
  173. package/src/sap/ui/mdc/p13n/panels/BasePanel.js +17 -8
  174. package/src/sap/ui/mdc/p13n/panels/ChartItemPanel.js +1 -2
  175. package/src/sap/ui/mdc/p13n/panels/ChartItemPanelNew.js +1171 -0
  176. package/src/sap/ui/mdc/p13n/panels/GroupPanel.js +1 -1
  177. package/src/sap/ui/mdc/p13n/panels/GroupView.js +7 -11
  178. package/src/sap/ui/mdc/p13n/panels/ListView.js +5 -3
  179. package/src/sap/ui/mdc/p13n/panels/QueryPanel.js +16 -9
  180. package/src/sap/ui/mdc/p13n/panels/SelectionPanel.js +0 -1
  181. package/src/sap/ui/mdc/p13n/panels/SortPanel.js +0 -1
  182. package/src/sap/ui/mdc/p13n/panels/SortQueryPanel.js +1 -1
  183. package/src/sap/ui/mdc/p13n/panels/Wrapper.js +1 -1
  184. package/src/sap/ui/mdc/p13n/subcontroller/ActionToolbarController.js +89 -0
  185. package/src/sap/ui/mdc/p13n/subcontroller/BaseController.js +9 -6
  186. package/src/sap/ui/mdc/p13n/subcontroller/ChartItemController.js +33 -4
  187. package/src/sap/ui/mdc/p13n/subcontroller/ColumnController.js +9 -15
  188. package/src/sap/ui/mdc/p13n/subcontroller/FilterController.js +12 -0
  189. package/src/sap/ui/mdc/p13n/subcontroller/GroupController.js +5 -12
  190. package/src/sap/ui/mdc/p13n/subcontroller/SortController.js +19 -21
  191. package/src/sap/ui/mdc/table/Column.js +35 -9
  192. package/src/sap/ui/mdc/table/CreationRow.js +1 -1
  193. package/src/sap/ui/mdc/table/GridTableType.js +0 -1
  194. package/src/sap/ui/mdc/table/PropertyHelper.js +108 -5
  195. package/src/sap/ui/mdc/table/ResponsiveTableType.js +19 -3
  196. package/src/sap/ui/mdc/table/RowSettings.js +1 -1
  197. package/src/sap/ui/mdc/table/TableTypeBase.js +0 -1
  198. package/src/sap/ui/mdc/table/V4AnalyticsPropertyHelper.js +1 -1
  199. package/src/sap/ui/mdc/themes/base/FilterBar.less +2 -2
  200. package/src/sap/ui/mdc/themes/base/GroupView.less +2 -2
  201. package/src/sap/ui/mdc/themes/base/ListView.less +2 -2
  202. package/src/sap/ui/mdc/themes/base/ValueHelpDialog.less +56 -21
  203. package/src/sap/ui/mdc/ui/Container.js +2 -2
  204. package/src/sap/ui/mdc/ui/ContainerItem.js +2 -2
  205. package/src/sap/ui/mdc/util/Common.js +26 -0
  206. package/src/sap/ui/mdc/util/FilterUtil.js +12 -1
  207. package/src/sap/ui/mdc/util/IdentifierUtil.js +4 -0
  208. package/src/sap/ui/mdc/util/PromiseCache.js +266 -0
  209. package/src/sap/ui/mdc/util/PropertyHelper.js +22 -1
  210. package/src/sap/ui/mdc/valuehelp/Dialog.js +498 -0
  211. package/src/sap/ui/mdc/valuehelp/Popover.js +362 -0
  212. package/src/sap/ui/mdc/valuehelp/base/Container.js +642 -0
  213. package/src/sap/ui/mdc/valuehelp/base/Content.js +628 -0
  214. package/src/sap/ui/mdc/valuehelp/base/DialogTab.js +139 -0
  215. package/src/sap/ui/mdc/valuehelp/base/FilterableListContent.js +557 -0
  216. package/src/sap/ui/mdc/valuehelp/base/ListContent.js +133 -0
  217. package/src/sap/ui/mdc/valuehelp/content/Bool.js +318 -0
  218. package/src/sap/ui/mdc/valuehelp/content/Conditions.js +276 -0
  219. package/src/sap/ui/mdc/valuehelp/content/FixedList.js +532 -0
  220. package/src/sap/ui/mdc/valuehelp/content/MDCTable.js +638 -0
  221. package/src/sap/ui/mdc/valuehelp/content/MTable.js +916 -0
  222. package/test/sap/ui/mdc/testutils/opa/TestLibrary.js +3 -2
  223. package/test/sap/ui/mdc/testutils/opa/actions/OpenContextMenu.js +48 -0
  224. package/test/sap/ui/mdc/testutils/opa/chartNew/ActionsBase.js +310 -0
  225. package/test/sap/ui/mdc/testutils/opa/chartNew/ActionsViz.js +39 -0
  226. package/test/sap/ui/mdc/testutils/opa/chartNew/AssertionsBase.js +118 -0
  227. package/test/sap/ui/mdc/testutils/opa/chartNew/AssertionsViz.js +137 -0
  228. package/test/sap/ui/mdc/testutils/opa/chartNew/ChartNew.js +24 -0
  229. package/test/sap/ui/mdc/testutils/opa/chartNew/TestObjects.js +289 -0
  230. package/test/sap/ui/mdc/testutils/opa/filterbar/Actions.js +250 -0
  231. package/test/sap/ui/mdc/testutils/opa/filterbar/Assertions.js +91 -0
  232. package/test/sap/ui/mdc/testutils/opa/filterbar/TestObjects.js +137 -0
  233. package/test/sap/ui/mdc/testutils/opa/filterbar/Util.js +25 -0
  234. package/test/sap/ui/mdc/testutils/opa/p13n/Actions.js +401 -93
  235. package/test/sap/ui/mdc/testutils/opa/p13n/Util.js +4 -1
  236. package/test/sap/ui/mdc/testutils/opa/p13n/{waitForP13nButtonWithParentAndIcon.js → waitForP13nButtonWithMatchers.js} +5 -18
  237. package/test/sap/ui/mdc/testutils/opa/table/TestObjects.js +0 -1
@@ -0,0 +1,362 @@
1
+ /*
2
+ * ! OpenUI5
3
+ * (c) Copyright 2009-2021 SAP SE or an SAP affiliate company.
4
+ * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
+ */
6
+
7
+ sap.ui.define([
8
+ 'sap/ui/mdc/valuehelp/base/Container',
9
+ 'sap/ui/mdc/util/loadModules',
10
+ "sap/ui/dom/units/Rem"
11
+ ], function(
12
+ Container,
13
+ loadModules,
14
+ Rem
15
+ ) {
16
+ "use strict";
17
+
18
+ var MPopover, MLibrary, Toolbar, ToolbarSpacer;
19
+
20
+ /**
21
+ * Constructor for a new <code>Popover</code> container.
22
+ *
23
+ * @param {string} [sId] ID for the new control, generated automatically if no ID is given
24
+ * @param {object} [mSettings] Initial settings for the new control
25
+ * @class Container for the <code>sap.ui.mdc.ValueHelp</code> element showing a popover.
26
+ * @extends sap.ui.mdc.valuehelp.base.Container
27
+ * @version 1.96.2
28
+ * @constructor
29
+ * @abstract
30
+ * @private
31
+ * @ui5-restricted sap.ui.mdc
32
+ * @since 1.95.0
33
+ * @alias sap.ui.mdc.valuehelp.Popover
34
+ * @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel
35
+ */
36
+ var Popover = Container.extend("sap.ui.mdc.valuehelp.Popover", /** @lends sap.ui.mdc.valuehelp.Popover.prototype */
37
+ {
38
+ metadata: {
39
+ library: "sap.ui.mdc",
40
+ interfaces: [
41
+ "sap.ui.mdc.valuehelp.ITypeaheadContainer",
42
+ "sap.ui.mdc.valuehelp.IDialogContainer"
43
+ ],
44
+ properties: {
45
+ },
46
+ defaultAggregation: "content"
47
+ }
48
+ });
49
+
50
+ Popover.prototype.invalidate = function(oOrigin) {
51
+
52
+ if (oOrigin) {
53
+ var oPopover = this.getAggregation("_container");
54
+ var oContent = this._oCurrentContent;
55
+ if (oPopover && oContent && oOrigin === oContent && !this._bIsBeingDestroyed) {
56
+ // Content invalidated -> invalidate Popover to rerender content
57
+ oPopover.invalidate(oOrigin);
58
+ } else { // standard logic
59
+ Container.prototype.invalidate.apply(this, arguments);
60
+ }
61
+ }
62
+
63
+ };
64
+
65
+ Popover.prototype._getUIAreaForContent = function() {
66
+ // if List or Table needs to be rerendered because of a change the corresponding UIArea is the static-UIArea used in the Popover.
67
+ var oPopover = this.getAggregation("_container");
68
+ if (oPopover) {
69
+ return oPopover.getUIArea();
70
+ }
71
+
72
+ return Container.prototype._getUIAreaForContent.apply(this, arguments);
73
+
74
+ };
75
+
76
+ Popover.prototype._getContent = function () {
77
+ var oContent = this.getContent();
78
+ return oContent && oContent[0];
79
+ };
80
+
81
+ Popover.prototype._getContainer = function () {
82
+ var oPopover = this.getAggregation("_container");
83
+
84
+ if (!oPopover) {
85
+ return loadModules([
86
+ "sap/m/Popover",
87
+ "sap/m/library",
88
+ "sap/m/Toolbar",
89
+ "sap/m/ToolbarSpacer"
90
+ ]).then(function (aLoaded) {
91
+ MPopover = aLoaded[0];
92
+ MLibrary = aLoaded[1];
93
+ Toolbar = aLoaded[2];
94
+ ToolbarSpacer = aLoaded[3];
95
+
96
+ oPopover = new MPopover(this.getId() + "-pop", {
97
+ contentHeight: "auto",
98
+ placement: MLibrary.PlacementType.VerticalPreferredBottom,
99
+ showHeader: false,
100
+ showArrow: false,
101
+ title: this.getTitle(),
102
+ titleAlignment: MLibrary.TitleAlignment.Center,
103
+ afterOpen: this._handleOpened.bind(this),
104
+ afterClose: this._handleClosed.bind(this)
105
+ }).addStyleClass("sapMdcValueHelpPopover").addStyleClass("sapMComboBoxBasePicker").addStyleClass("sapMComboBoxBasePicker-CTX"); // to have a ComboBox popup
106
+
107
+ oPopover.addStyleClass(this._isSingleSelect() ? "sapMdcValueHelpSingleSelect" : "sapMdcValueHelpMultiSelect");
108
+
109
+ oPopover.addDelegate({onsapshow: this._handleRequestSwitchToDialog.bind(this)});
110
+
111
+ oPopover._getAllContent = function() {
112
+ var oParent = this.getParent();
113
+ var aContent = [];
114
+ if (oParent) {
115
+ if (this._oCurrentContent) {
116
+ aContent.push(this._oCurrentContent);
117
+ }
118
+ }
119
+ return aContent;
120
+ }.bind(this);
121
+
122
+ var oContent = this._getContent();
123
+ var oContainerConfig = this._getContainerConfig(oContent);
124
+
125
+ if (oContainerConfig) {
126
+ oPopover.setShowArrow(!!oContainerConfig.showArrow);
127
+ oPopover.setShowHeader(!!oContainerConfig.showHeader);
128
+ oPopover.setResizable(!!oContainerConfig.resizable);
129
+
130
+ if (oContainerConfig.getContentWidth) {
131
+ oPopover.setContentWidth(oContainerConfig.getContentWidth());
132
+ }
133
+ }
134
+
135
+ this.setAggregation("_container", oPopover, true);
136
+ return oPopover;
137
+ }.bind(this));
138
+ }
139
+
140
+ return oPopover;
141
+ };
142
+
143
+ var _setContainerHeight = function () {
144
+ var oContainer = this.getAggregation("_container");
145
+ var oContent = this._getContent();
146
+ var oContainerConfig = oContent && this._getContainerConfig(oContent);
147
+ if (oContainer && oContainerConfig && oContainerConfig.getContentHeight) {
148
+ var iHeight = oContainerConfig.getContentHeight();
149
+ var iContainerHeight = oContainer.$().find(".sapMPopoverCont").height();
150
+ var bContainerHeightBelowLimit = iContainerHeight < Rem.toPx("30rem");
151
+ oContainer.setContentHeight(!iHeight || bContainerHeightBelowLimit || iContainerHeight >= iHeight ? "auto" : "30rem");
152
+ oContainer.invalidate(); // TODO: Better way? Popover does not always update correctly
153
+ }
154
+ };
155
+
156
+ Popover.prototype._observeChanges = function (oChanges) {
157
+ if (oChanges.name === "content") {
158
+ var oContent = oChanges.child;
159
+ if (oChanges.mutation === "remove") {
160
+ oContent.detachEvent("contentUpdated", _setContainerHeight, this);
161
+ oContent.detachNavigated(this._handleNavigated, this);
162
+ } else {
163
+ oContent.attachEvent("contentUpdated", _setContainerHeight, this); // TODO: put event in content interface ot check existance?
164
+ }
165
+ }
166
+ Container.prototype._observeChanges.apply(this, arguments);
167
+ };
168
+
169
+ Popover.prototype._placeContent = function (oPopover) {
170
+
171
+ var oContent = this._getContent();
172
+ var oContentPromise = oContent && oContent.getContent();
173
+ var oContainerConfig = this._getContainerConfig(oContent);
174
+ var oFooterContentPromise = oContainerConfig && oContainerConfig.getFooter && oContainerConfig.getFooter();
175
+
176
+ return Promise.all([oContentPromise, oFooterContentPromise]).then(function (aContents) {
177
+ this._oCurrentContent = aContents[0];
178
+ var oFooterContent = aContents[1];
179
+
180
+ if (oFooterContent && oPopover.getFooter() != oFooterContent && oFooterContent.isA && oFooterContent.isA("sap.m.Toolbar")) {
181
+ oPopover.setFooter(oFooterContent);
182
+ return oPopover;
183
+ }
184
+
185
+ if (oFooterContent) {
186
+ if (!oPopover.getFooter()) {
187
+ var aToolbarContent = [new ToolbarSpacer(this.getId() + "-Spacer")].concat(oFooterContent);
188
+ var oToolbar = new Toolbar(this.getId() + "-TB", {
189
+ content: aToolbarContent
190
+ }).setModel(this._oManagedObjectModel, "$help"); // TODO: ManagedObjectModel never created!!!
191
+ oPopover.setFooter(oToolbar);
192
+ } else {
193
+ // TODO: update Toolbar?
194
+ }
195
+ } else if (oPopover.getFooter()) {
196
+ oPopover.setFooter();
197
+ }
198
+ return oPopover;
199
+ }.bind(this));
200
+ };
201
+
202
+ Popover.prototype._open = function (oPopover) {
203
+ if (oPopover.isOpen()) {
204
+ return;
205
+ }
206
+
207
+ var oControl = this._getControl();
208
+ var oTarget = oControl && oControl.getFocusElementForValueHelp && oControl.getFocusElementForValueHelp(this.isTypeahead());
209
+
210
+ if (oTarget && oTarget.getDomRef()) {
211
+ oPopover.setContentMinWidth(jQuery(oTarget.getDomRef()).outerWidth() + "px");
212
+ if (!this.isFocusInHelp()) {
213
+ oPopover.setInitialFocus(oTarget);
214
+ }
215
+ oPopover.openBy(oTarget);
216
+ }
217
+ };
218
+
219
+ Popover.prototype._close = function () {
220
+
221
+ var oPopover = this.getAggregation("_container");
222
+ if (oPopover) {
223
+ oPopover.close();
224
+ }
225
+
226
+ };
227
+
228
+ Popover.prototype._handleOpened = function () {
229
+ _setContainerHeight.call(this);
230
+
231
+ Container.prototype._handleOpened.apply(this, arguments);
232
+
233
+ var oContent = this._getContent();
234
+
235
+ if (oContent) {
236
+ oContent.onShow();
237
+ }
238
+
239
+ };
240
+
241
+ Popover.prototype._handleConfirmed = function (oEvent) {
242
+ this.fireConfirm({close: oEvent.getParameter("close") || this._isSingleSelect()});
243
+ };
244
+
245
+ Popover.prototype._handleClosed = function (oEvent) {
246
+
247
+ var oContent = this._getContent();
248
+
249
+ if (oContent) {
250
+ oContent.onHide();
251
+ }
252
+
253
+ var oPopover = this.getAggregation("_container");
254
+ if (oPopover) {
255
+ oPopover._oPreviousFocus = null; // TODO - find real solution
256
+ }
257
+
258
+ Container.prototype._handleClosed.apply(this, arguments);
259
+ };
260
+
261
+ Popover.prototype.removeFocus = function() {
262
+ var oContent = this._getContent();
263
+ if (oContent) {
264
+ oContent.removeFocus();
265
+ }
266
+ };
267
+
268
+ Popover.prototype._navigate = function (iStep) {
269
+ var oContent = this._getContent();
270
+ if (oContent) {
271
+ return oContent.navigate(iStep);
272
+ }
273
+ };
274
+
275
+
276
+ Popover.prototype.getItemForValue = function(oConfig) {
277
+ var oContent = this._getContent();
278
+ if (oContent) {
279
+ return oContent.getItemForValue(oConfig);
280
+ }
281
+ };
282
+
283
+ Popover.prototype.isValidationSupported = function(oConfig) {
284
+ var oContent = this._getContent();
285
+ if (oContent) {
286
+ return oContent.isValidationSupported();
287
+ }
288
+ };
289
+
290
+ Popover.prototype.getUseAsValueHelp = function() {
291
+
292
+ var oContent = this._getContent();
293
+ return oContent && oContent.getUseAsValueHelp && oContent.getUseAsValueHelp();
294
+
295
+ };
296
+
297
+ Popover.prototype.getValueHelpIcon = function() {
298
+
299
+ // ask content for icon
300
+ var oContent = this._getContent();
301
+ return oContent && oContent.getValueHelpIcon();
302
+
303
+ };
304
+
305
+ Popover.prototype.getAriaAttributes = function(iMaxConditions) {
306
+
307
+ var oContent = this._getContent();
308
+ var oContentAttributes = oContent && oContent.getAriaAttributes(iMaxConditions);
309
+
310
+ if (oContentAttributes) {
311
+ return {
312
+ contentId: oContentAttributes.contentId,
313
+ ariaHasPopup: oContentAttributes.ariaHasPopup,
314
+ role: this.getUseAsValueHelp() ? "combobox" : null, // Popover is a ComboBox, but only if used as valuehelp, only typeahead has no role (see sap.m.Input)
315
+ roleDescription: oContentAttributes.roleDescription // for multiselect-mTable it needs to be set
316
+ };
317
+ }
318
+
319
+ return Container.prototype.getAriaAttributes.apply(this, arguments);
320
+
321
+ };
322
+
323
+ Popover.prototype.shouldOpenOnClick = function() {
324
+
325
+ var oContent = this._getContent();
326
+ return !!oContent && oContent.shouldOpenOnClick();
327
+
328
+ };
329
+
330
+ Popover.prototype.shouldOpenOnNavigate = function() {
331
+
332
+ var oContent = this._getContent();
333
+ return !!oContent && oContent.shouldOpenOnNavigate();
334
+
335
+ };
336
+
337
+ Popover.prototype.isFocusInHelp = function() {
338
+
339
+ var oContent = this._getContent();
340
+ return !!oContent && oContent.isFocusInHelp();
341
+
342
+ };
343
+
344
+ Popover.prototype.isMultiSelect = function() {
345
+
346
+ var oContent = this._getContent();
347
+ return !!oContent && oContent.isMultiSelect();
348
+
349
+ };
350
+
351
+ Popover.prototype.exit = function () {
352
+ if (this._oCurrentContent) {
353
+ if (!this._oCurrentContent.bIsDestroyed) {
354
+ this._oCurrentContent.destroy();
355
+ }
356
+ this._oCurrentContent = null;
357
+ }
358
+ };
359
+
360
+ return Popover;
361
+
362
+ });