@openui5/sap.ui.mdc 1.92.0 → 1.95.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 (220) hide show
  1. package/.reuse/dep5 +1 -6
  2. package/THIRDPARTY.txt +4 -10
  3. package/package.json +4 -4
  4. package/src/sap/ui/mdc/.library +1 -1
  5. package/src/sap/ui/mdc/ActionToolbar.js +1 -1
  6. package/src/sap/ui/mdc/AggregationBaseDelegate.js +2 -1
  7. package/src/sap/ui/mdc/Chart.js +14 -6
  8. package/src/sap/ui/mdc/ChartDelegate.js +1 -1
  9. package/src/sap/ui/mdc/ChartNew.js +104 -32
  10. package/src/sap/ui/mdc/Control.js +1 -1
  11. package/src/sap/ui/mdc/Element.js +2 -2
  12. package/src/sap/ui/mdc/Field.js +15 -2
  13. package/src/sap/ui/mdc/FilterBar.js +11 -1
  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 +406 -0
  17. package/src/sap/ui/mdc/Table.js +166 -102
  18. package/src/sap/ui/mdc/TableDelegate.js +30 -21
  19. package/src/sap/ui/mdc/ValueHelp.js +1459 -0
  20. package/src/sap/ui/mdc/ValueHelpDelegate.js +41 -0
  21. package/src/sap/ui/mdc/chart/ToolbarHandler.js +233 -223
  22. package/src/sap/ui/mdc/chartNew/ChartSelectionDetailsNew.js +1 -1
  23. package/src/sap/ui/mdc/chartNew/ChartToolbarNew.js +9 -18
  24. package/src/sap/ui/mdc/chartNew/ChartTypeButtonNew.js +1 -1
  25. package/src/sap/ui/mdc/chartNew/DrillStackHandlerNew.js +1 -1
  26. package/src/sap/ui/mdc/chartNew/ItemNew.js +1 -1
  27. package/src/sap/ui/mdc/chartNew/PropertyHelperNew.js +1 -1
  28. package/src/sap/ui/mdc/condition/Condition.js +2 -2
  29. package/src/sap/ui/mdc/condition/ConditionConverter.js +1 -1
  30. package/src/sap/ui/mdc/condition/ConditionModel.js +1 -1
  31. package/src/sap/ui/mdc/condition/FilterConverter.js +27 -15
  32. package/src/sap/ui/mdc/condition/FilterOperatorUtil.js +15 -9
  33. package/src/sap/ui/mdc/condition/Operator.js +13 -8
  34. package/src/sap/ui/mdc/condition/RangeOperator.js +3 -6
  35. package/src/sap/ui/mdc/designtime/filterbar/FilterBar.designtime.js +1 -0
  36. package/src/sap/ui/mdc/enum/SelectType.js +43 -0
  37. package/src/sap/ui/mdc/field/BoolFieldHelp.js +1 -1
  38. package/src/sap/ui/mdc/field/ConditionFieldHelp.js +5 -4
  39. package/src/sap/ui/mdc/field/ConditionType.js +69 -33
  40. package/src/sap/ui/mdc/field/ConditionsType.js +4 -3
  41. package/src/sap/ui/mdc/field/CustomFieldHelp.js +1 -1
  42. package/src/sap/ui/mdc/field/CustomFieldInfo.js +1 -1
  43. package/src/sap/ui/mdc/field/DefineConditionPanel.js +38 -24
  44. package/src/sap/ui/mdc/field/FieldBase.js +106 -42
  45. package/src/sap/ui/mdc/field/FieldBaseDelegate.js +25 -2
  46. package/src/sap/ui/mdc/field/FieldHelpBase.js +64 -4
  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 +55 -33
  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 +52 -32
  55. package/src/sap/ui/mdc/field/FieldValueHelpTableWrapperBase.js +8 -10
  56. package/src/sap/ui/mdc/field/FieldValueHelpUITableWrapper.js +2 -1
  57. package/src/sap/ui/mdc/field/InParameter.js +1 -1
  58. package/src/sap/ui/mdc/field/ListFieldHelp.js +3 -3
  59. package/src/sap/ui/mdc/field/ListFieldHelpItem.js +1 -1
  60. package/src/sap/ui/mdc/field/MultiValueFieldDelegate.js +49 -0
  61. package/src/sap/ui/mdc/field/MultiValueFieldItem.js +70 -0
  62. package/src/sap/ui/mdc/field/OutParameter.js +1 -1
  63. package/src/sap/ui/mdc/field/ValueHelpPanel.js +1 -1
  64. package/src/sap/ui/mdc/field/content/ContentFactory.js +2 -2
  65. package/src/sap/ui/mdc/filterbar/FilterBarBase.js +146 -76
  66. package/src/sap/ui/mdc/filterbar/PropertyHelper.js +52 -0
  67. package/src/sap/ui/mdc/filterbar/p13n/AdaptationFilterBar.js +4 -20
  68. package/src/sap/ui/mdc/filterbar/p13n/FilterGroupLayout.js +9 -3
  69. package/src/sap/ui/mdc/filterbar/vh/FilterBar.js +1 -1
  70. package/src/sap/ui/mdc/filterbar/vh/GenericFilterBarDelegate.js +55 -39
  71. package/src/sap/ui/mdc/flexibility/AggregateFlex.js +31 -22
  72. package/src/sap/ui/mdc/flexibility/AggregationConfigFlex.js +33 -29
  73. package/src/sap/ui/mdc/flexibility/Chart.flexibility.js +10 -5
  74. package/src/sap/ui/mdc/flexibility/ChartItemFlex.js +18 -6
  75. package/src/sap/ui/mdc/flexibility/ColumnFlex.js +15 -4
  76. package/src/sap/ui/mdc/flexibility/ConditionFlex.js +92 -79
  77. package/src/sap/ui/mdc/flexibility/FilterBar.flexibility.js +1 -1
  78. package/src/sap/ui/mdc/flexibility/FilterItemFlex.js +1 -1
  79. package/src/sap/ui/mdc/flexibility/GroupFlex.js +70 -52
  80. package/src/sap/ui/mdc/flexibility/ItemBaseFlex.js +184 -115
  81. package/src/sap/ui/mdc/flexibility/Panel.flexibility.js +59 -41
  82. package/src/sap/ui/mdc/flexibility/SortFlex.js +72 -54
  83. package/src/sap/ui/mdc/flp/FlpLinkDelegate.js +2 -1
  84. package/src/sap/ui/mdc/library.js +618 -7
  85. package/src/sap/ui/mdc/link/ContactDetails.js +1 -1
  86. package/src/sap/ui/mdc/link/ContactDetailsAddressItem.js +1 -1
  87. package/src/sap/ui/mdc/link/ContactDetailsEmailItem.js +1 -1
  88. package/src/sap/ui/mdc/link/ContactDetailsItem.js +1 -1
  89. package/src/sap/ui/mdc/link/ContactDetailsPhoneItem.js +1 -1
  90. package/src/sap/ui/mdc/link/Factory.js +1 -1
  91. package/src/sap/ui/mdc/link/FakeFlpConnector.js +1 -1
  92. package/src/sap/ui/mdc/link/LinkItem.js +1 -1
  93. package/src/sap/ui/mdc/link/Panel.js +1 -1
  94. package/src/sap/ui/mdc/link/PanelItem.js +1 -1
  95. package/src/sap/ui/mdc/link/PanelListItem.js +1 -1
  96. package/src/sap/ui/mdc/link/SelectionDialog.js +1 -1
  97. package/src/sap/ui/mdc/link/SelectionDialogItem.js +1 -1
  98. package/src/sap/ui/mdc/link/SemanticObjectMapping.js +1 -1
  99. package/src/sap/ui/mdc/link/SemanticObjectMappingItem.js +1 -1
  100. package/src/sap/ui/mdc/link/SemanticObjectUnavailableAction.js +1 -1
  101. package/src/sap/ui/mdc/messagebundle.properties +20 -8
  102. package/src/sap/ui/mdc/messagebundle_ar.properties +16 -6
  103. package/src/sap/ui/mdc/messagebundle_bg.properties +15 -5
  104. package/src/sap/ui/mdc/messagebundle_ca.properties +15 -5
  105. package/src/sap/ui/mdc/messagebundle_cs.properties +17 -7
  106. package/src/sap/ui/mdc/messagebundle_cy.properties +15 -5
  107. package/src/sap/ui/mdc/messagebundle_da.properties +15 -5
  108. package/src/sap/ui/mdc/messagebundle_de.properties +23 -13
  109. package/src/sap/ui/mdc/messagebundle_el.properties +16 -6
  110. package/src/sap/ui/mdc/messagebundle_en.properties +14 -4
  111. package/src/sap/ui/mdc/messagebundle_en_GB.properties +15 -5
  112. package/src/sap/ui/mdc/messagebundle_en_US_sappsd.properties +12 -4
  113. package/src/sap/ui/mdc/messagebundle_en_US_saprigi.properties +3 -1
  114. package/src/sap/ui/mdc/messagebundle_en_US_saptrc.properties +12 -4
  115. package/src/sap/ui/mdc/messagebundle_es.properties +40 -30
  116. package/src/sap/ui/mdc/messagebundle_es_MX.properties +15 -5
  117. package/src/sap/ui/mdc/messagebundle_et.properties +15 -5
  118. package/src/sap/ui/mdc/messagebundle_fi.properties +16 -6
  119. package/src/sap/ui/mdc/messagebundle_fr.properties +27 -17
  120. package/src/sap/ui/mdc/messagebundle_fr_CA.properties +15 -5
  121. package/src/sap/ui/mdc/messagebundle_hi.properties +13 -3
  122. package/src/sap/ui/mdc/messagebundle_hr.properties +15 -5
  123. package/src/sap/ui/mdc/messagebundle_hu.properties +16 -6
  124. package/src/sap/ui/mdc/messagebundle_id.properties +14 -4
  125. package/src/sap/ui/mdc/messagebundle_it.properties +38 -28
  126. package/src/sap/ui/mdc/messagebundle_iw.properties +15 -5
  127. package/src/sap/ui/mdc/messagebundle_ja.properties +16 -6
  128. package/src/sap/ui/mdc/messagebundle_kk.properties +15 -5
  129. package/src/sap/ui/mdc/messagebundle_ko.properties +13 -3
  130. package/src/sap/ui/mdc/messagebundle_lt.properties +15 -5
  131. package/src/sap/ui/mdc/messagebundle_lv.properties +15 -5
  132. package/src/sap/ui/mdc/messagebundle_ms.properties +13 -3
  133. package/src/sap/ui/mdc/messagebundle_nl.properties +16 -6
  134. package/src/sap/ui/mdc/messagebundle_no.properties +22 -12
  135. package/src/sap/ui/mdc/messagebundle_pl.properties +19 -9
  136. package/src/sap/ui/mdc/messagebundle_pt.properties +15 -5
  137. package/src/sap/ui/mdc/messagebundle_pt_PT.properties +14 -4
  138. package/src/sap/ui/mdc/messagebundle_ro.properties +18 -8
  139. package/src/sap/ui/mdc/messagebundle_ru.properties +15 -5
  140. package/src/sap/ui/mdc/messagebundle_sh.properties +15 -5
  141. package/src/sap/ui/mdc/messagebundle_sk.properties +16 -6
  142. package/src/sap/ui/mdc/messagebundle_sl.properties +15 -5
  143. package/src/sap/ui/mdc/messagebundle_sv.properties +16 -6
  144. package/src/sap/ui/mdc/messagebundle_th.properties +19 -9
  145. package/src/sap/ui/mdc/messagebundle_tr.properties +15 -5
  146. package/src/sap/ui/mdc/messagebundle_uk.properties +16 -6
  147. package/src/sap/ui/mdc/messagebundle_vi.properties +15 -5
  148. package/src/sap/ui/mdc/messagebundle_zh_CN.properties +13 -3
  149. package/src/sap/ui/mdc/messagebundle_zh_TW.properties +13 -3
  150. package/src/sap/ui/mdc/mixin/AdaptationMixin.js +1 -1
  151. package/src/sap/ui/mdc/mixin/DelegateMixin.js +2 -2
  152. package/src/sap/ui/mdc/mixin/FilterIntegrationMixin.js +28 -16
  153. package/src/sap/ui/mdc/mixin/PromiseMixin.js +94 -0
  154. package/src/sap/ui/mdc/odata/json/FilterBarDelegate.js +9 -8
  155. package/src/sap/ui/mdc/odata/v4/ChartDelegate.js +5 -5
  156. package/src/sap/ui/mdc/odata/v4/ChartPropertyHelperNew.js +1 -1
  157. package/src/sap/ui/mdc/odata/v4/FieldBaseDelegate.js +9 -0
  158. package/src/sap/ui/mdc/odata/v4/FilterBarDelegate.js +88 -80
  159. package/src/sap/ui/mdc/odata/v4/TableDelegate.js +37 -10
  160. package/src/sap/ui/mdc/odata/v4/TypeUtil.js +17 -0
  161. package/src/sap/ui/mdc/odata/v4/ValueHelpDelegate.js +94 -0
  162. package/src/sap/ui/mdc/odata/v4/util/DelegateUtil.js +45 -53
  163. package/src/sap/ui/mdc/odata/v4/vizChart/ChartDelegateNew.js +302 -179
  164. package/src/sap/ui/mdc/p13n/DefaultProviderRegistry.js +1 -1
  165. package/src/sap/ui/mdc/p13n/Engine.js +21 -16
  166. package/src/sap/ui/mdc/p13n/P13nBuilder.js +5 -59
  167. package/src/sap/ui/mdc/p13n/PropertyHelper.js +1 -1
  168. package/src/sap/ui/mdc/p13n/UIManager.js +1 -1
  169. package/src/sap/ui/mdc/p13n/modification/ModificationHandler.js +130 -53
  170. package/src/sap/ui/mdc/p13n/panels/BasePanel.js +16 -7
  171. package/src/sap/ui/mdc/p13n/panels/GroupPanel.js +1 -1
  172. package/src/sap/ui/mdc/p13n/panels/ListView.js +58 -2
  173. package/src/sap/ui/mdc/p13n/panels/QueryPanel.js +17 -10
  174. package/src/sap/ui/mdc/p13n/panels/SortQueryPanel.js +6 -1
  175. package/src/sap/ui/mdc/p13n/panels/Wrapper.js +1 -1
  176. package/src/sap/ui/mdc/p13n/subcontroller/BaseController.js +1 -1
  177. package/src/sap/ui/mdc/p13n/subcontroller/ColumnController.js +10 -11
  178. package/src/sap/ui/mdc/p13n/subcontroller/FilterController.js +13 -1
  179. package/src/sap/ui/mdc/p13n/subcontroller/GroupController.js +1 -1
  180. package/src/sap/ui/mdc/p13n/subcontroller/SortController.js +11 -2
  181. package/src/sap/ui/mdc/table/Column.js +21 -4
  182. package/src/sap/ui/mdc/table/CreationRow.js +1 -1
  183. package/src/sap/ui/mdc/table/PropertyHelper.js +176 -4
  184. package/src/sap/ui/mdc/table/ResponsiveTableType.js +11 -1
  185. package/src/sap/ui/mdc/table/RowSettings.js +1 -1
  186. package/src/sap/ui/mdc/table/TableSettings.js +4 -49
  187. package/src/sap/ui/mdc/table/V4AnalyticsPropertyHelper.js +1 -1
  188. package/src/sap/ui/mdc/themes/base/FieldBase.less +4 -0
  189. package/src/sap/ui/mdc/themes/base/FilterBar.less +2 -2
  190. package/src/sap/ui/mdc/themes/base/GroupView.less +2 -2
  191. package/src/sap/ui/mdc/themes/base/ListView.less +2 -2
  192. package/src/sap/ui/mdc/themes/base/ValueHelpDialog.less +56 -21
  193. package/src/sap/ui/mdc/ui/Container.js +3 -3
  194. package/src/sap/ui/mdc/ui/ContainerItem.js +2 -2
  195. package/src/sap/ui/mdc/util/Common.js +26 -0
  196. package/src/sap/ui/mdc/util/FilterUtil.js +68 -16
  197. package/src/sap/ui/mdc/util/IdentifierUtil.js +4 -0
  198. package/src/sap/ui/mdc/util/PromiseCache.js +266 -0
  199. package/src/sap/ui/mdc/util/PropertyHelper.js +27 -2
  200. package/src/sap/ui/mdc/valuehelp/Dialog.js +475 -0
  201. package/src/sap/ui/mdc/valuehelp/Popover.js +346 -0
  202. package/src/sap/ui/mdc/valuehelp/base/Container.js +440 -0
  203. package/src/sap/ui/mdc/valuehelp/base/Content.js +442 -0
  204. package/src/sap/ui/mdc/valuehelp/base/DialogTab.js +96 -0
  205. package/src/sap/ui/mdc/valuehelp/base/FilterableListContent.js +537 -0
  206. package/src/sap/ui/mdc/valuehelp/base/ListContent.js +105 -0
  207. package/src/sap/ui/mdc/valuehelp/content/Bool.js +232 -0
  208. package/src/sap/ui/mdc/valuehelp/content/Conditions.js +250 -0
  209. package/src/sap/ui/mdc/valuehelp/content/FixedList.js +504 -0
  210. package/src/sap/ui/mdc/valuehelp/content/MDCTable.js +619 -0
  211. package/src/sap/ui/mdc/valuehelp/content/MTable.js +881 -0
  212. package/test/sap/ui/mdc/testutils/opa/TestLibrary.js +2 -2
  213. package/test/sap/ui/mdc/testutils/opa/filterbar/Actions.js +250 -0
  214. package/test/sap/ui/mdc/testutils/opa/filterbar/Assertions.js +91 -0
  215. package/test/sap/ui/mdc/testutils/opa/filterbar/TestObjects.js +137 -0
  216. package/test/sap/ui/mdc/testutils/opa/filterbar/Util.js +25 -0
  217. package/test/sap/ui/mdc/testutils/opa/p13n/Actions.js +256 -94
  218. package/test/sap/ui/mdc/testutils/opa/p13n/Util.js +2 -1
  219. package/test/sap/ui/mdc/testutils/opa/p13n/{waitForP13nButtonWithParentAndIcon.js → waitForP13nButtonWithMatchers.js} +5 -18
  220. package/test/sap/ui/mdc/testutils/opa/table/TestObjects.js +0 -1
@@ -17,7 +17,8 @@ sap.ui.define([
17
17
  "sap/ui/mdc/chartNew/ChartTypeButtonNew",
18
18
  "sap/ui/mdc/chartNew/ItemNew",
19
19
  "sap/ui/model/Sorter",
20
- "sap/m/VBox"
20
+ "sap/m/VBox",
21
+ "sap/ui/base/ManagedObjectObserver"
21
22
  ], function (
22
23
  V4ChartDelegate,
23
24
  loadModules,
@@ -31,7 +32,8 @@ sap.ui.define([
31
32
  ChartTypeButton,
32
33
  MDCChartItem,
33
34
  Sorter,
34
- VBox
35
+ VBox,
36
+ ManagedObjectObserver
35
37
  ) {
36
38
  "use strict";
37
39
  /**
@@ -46,6 +48,8 @@ sap.ui.define([
46
48
  */
47
49
  var ChartDelegate = Object.assign({}, V4ChartDelegate);
48
50
 
51
+
52
+ var mStateMap = new window.WeakMap();
49
53
  //var ChartLibrary;
50
54
  var Chart;
51
55
  var Dimension;
@@ -54,9 +58,101 @@ sap.ui.define([
54
58
  var Measure;
55
59
  //var VizPopover;
56
60
  var VizTooltip;
57
- var oColorings;
58
- var aInSettings = [];
59
- var aColMeasures = [];
61
+
62
+ //API to access state
63
+ ChartDelegate._getState = function (oMDCChart) {
64
+ if (mStateMap.has(oMDCChart)){
65
+ return mStateMap.get(oMDCChart);
66
+ }
67
+
68
+ Log.info("Couldn't get state for " + oMDCChart.getId());
69
+ };
70
+
71
+ ChartDelegate._setState = function(oMDCChart, oState) {
72
+ mStateMap.set(oMDCChart, oState);
73
+ };
74
+
75
+ ChartDelegate._deleteState = function(oMDCChart) {
76
+
77
+ if (this._getState(oMDCChart).vizTooltip) {
78
+ this._getState(oMDCChart).vizTooltip.destroy();
79
+ }
80
+
81
+ return mStateMap.delete(oMDCChart);
82
+ };
83
+
84
+
85
+ ChartDelegate._getChart = function (oMDCChart){
86
+
87
+ if (mStateMap.has(oMDCChart)) {
88
+ return mStateMap.get(oMDCChart).innerChart;
89
+ }
90
+
91
+ Log.info("Couldn't get state for " + oMDCChart.getId());
92
+
93
+ return undefined;
94
+
95
+ };
96
+
97
+ ChartDelegate._setChart = function (oMDCChart, oInnerChart) {
98
+ if (mStateMap.has(oMDCChart)) {
99
+ mStateMap.get(oMDCChart).innerChart = oInnerChart;
100
+ } else {
101
+ mStateMap.set(oMDCChart, {innerChart: oInnerChart});
102
+ }
103
+ };
104
+
105
+ ChartDelegate._getInnerStructure = function (oMDCChart) {
106
+ if (mStateMap.has(oMDCChart)) {
107
+ return mStateMap.get(oMDCChart).innerStructure;
108
+ }
109
+
110
+ Log.info("Couldn't get state for " + oMDCChart.getId());
111
+
112
+ return undefined;
113
+ };
114
+
115
+ ChartDelegate._setInnerStructure = function (oMDCChart, oInnerStructure) {
116
+ if (mStateMap.has(oMDCChart)) {
117
+ mStateMap.get(oMDCChart).innerStructure = oInnerStructure;
118
+ } else {
119
+ mStateMap.set(oMDCChart, {innerStructure: oInnerStructure});
120
+ }
121
+ };
122
+
123
+ ChartDelegate._getBindingInfoFromState = function (oMDCChart) {
124
+ if (mStateMap.has(oMDCChart)) {
125
+ return mStateMap.get(oMDCChart).bindingInfo;
126
+ }
127
+
128
+ Log.info("Couldn't get state for " + oMDCChart.getId());
129
+
130
+ return undefined;
131
+ };
132
+
133
+ ChartDelegate._setBindingInfoForState = function (oMDCChart, oBindingInfo) {
134
+ if (mStateMap.has(oMDCChart)) {
135
+ mStateMap.get(oMDCChart).bindingInfo = oBindingInfo;
136
+ } else {
137
+ mStateMap.set(oMDCChart, {bindingInfo: oBindingInfo});
138
+ }
139
+ };
140
+
141
+ ChartDelegate._setUpChartObserver = function(oMDCChart) {
142
+ var mChartMap = this._getState(oMDCChart);
143
+
144
+ if (!mChartMap.observer) {
145
+ mChartMap.observer = new ManagedObjectObserver(function(oChange) {
146
+ if (oChange.type === "destroy") {
147
+ this.exit(oChange.object);
148
+ }
149
+ }.bind(this));
150
+ }
151
+
152
+ mChartMap.observer.observe(oMDCChart, {
153
+ destroy: true
154
+ });
155
+ };
60
156
 
61
157
 
62
158
  /**
@@ -96,15 +192,23 @@ sap.ui.define([
96
192
  };
97
193
  };
98
194
 
195
+ ChartDelegate.exit = function(oMDCChart) {
196
+ if (this._getInnerStructure(oMDCChart)){
197
+ this._getInnerStructure(oMDCChart).destroy();
198
+ }
199
+
200
+ this._deleteState(oMDCChart);
201
+ };
202
+
99
203
  /**
100
204
  * Toolbar relevant API (WIP)
101
205
  */
102
- ChartDelegate.zoomIn = function (iValue) {
103
- this._oInnerChart.zoom({direction: "in"});
206
+ ChartDelegate.zoomIn = function (oMDCChart, iValue) {
207
+ this._getChart(oMDCChart).zoom({direction: "in"});
104
208
  };
105
209
 
106
- ChartDelegate.zoomOut = function (iValue) {
107
- this._oInnerChart.zoom({direction: "out"});
210
+ ChartDelegate.zoomOut = function (oMDCChart, iValue) {
211
+ this._getChart(oMDCChart).zoom({direction: "out"});
108
212
  };
109
213
 
110
214
 
@@ -112,10 +216,10 @@ sap.ui.define([
112
216
  * Gets the current zooming information for the inner chart
113
217
  * @returns {integer} Current zoom level on the inner chart
114
218
  */
115
- ChartDelegate.getZoomState = function () {
219
+ ChartDelegate.getZoomState = function (oMDCChart) {
116
220
 
117
- if (this._oInnerChart) {
118
- return this._oInnerChart.getZoomInfo(this);
221
+ if (this._getChart(oMDCChart)) {
222
+ return this._getChart(oMDCChart).getZoomInfo(this);
119
223
  }
120
224
 
121
225
  };
@@ -128,8 +232,8 @@ sap.ui.define([
128
232
  *
129
233
  * @returns {object} event handler for chartSelectionDetails
130
234
  */
131
- ChartDelegate.getInnerChartSelectionHandler = function () {
132
- return {eventId: "_selectionDetails", listener: this._oInnerChart};
235
+ ChartDelegate.getInnerChartSelectionHandler = function (oMDCChart) {
236
+ return {eventId: "_selectionDetails", listener: this._getChart(oMDCChart)};
133
237
  };
134
238
 
135
239
  /**
@@ -141,9 +245,9 @@ sap.ui.define([
141
245
  * @private
142
246
  * @ui5-restricted Fiori Elements, sap.ui.mdc
143
247
  */
144
- ChartDelegate.setLegendVisible = function (bVisible) {
145
- if (this._oInnerChart) {
146
- this._oInnerChart.setVizProperties({
248
+ ChartDelegate.setLegendVisible = function (oMDCChart, bVisible) {
249
+ if (this._getChart(oMDCChart)) {
250
+ this._getChart(oMDCChart).setVizProperties({
147
251
  'legend': {
148
252
  'visible': bVisible
149
253
  },
@@ -180,25 +284,25 @@ sap.ui.define([
180
284
  * @param {sap.ui.mdc.chartNew-ItemNew} oMDCChartItem the MDC CHart Item to insert into the inner chart
181
285
  * @param {int} iIndex the index to insert into
182
286
  */
183
- ChartDelegate.insertItemToInnerChart = function (oMDCChartItem, iIndex) {
287
+ ChartDelegate.insertItemToInnerChart = function (oMDCChart, oMDCChartItem, iIndex) {
184
288
  //TODO: Create Measures/Dimension only when required?
185
289
  if (oMDCChartItem.getType() === "groupable") {
186
- this.createInnerDimension(oMDCChartItem);
187
- var aVisibleDimension = this._oInnerChart.getVisibleDimensions();
290
+ this.createInnerDimension(oMDCChart, oMDCChartItem);
291
+ var aVisibleDimension = this._getChart(oMDCChart).getVisibleDimensions();
188
292
  aVisibleDimension.splice(iIndex, 0, oMDCChartItem.getName()); //Insert Item without deleting existing dimension
189
- this._oInnerChart.setVisibleDimensions(aVisibleDimension);
293
+ this._getChart(oMDCChart).setVisibleDimensions(aVisibleDimension);
190
294
  } else if (oMDCChartItem.getType() === "aggregatable") {
191
- this.createInnerMeasure(oMDCChartItem);
192
- var aVisibleMeasures = this._oInnerChart.getVisibleMeasures();
295
+ this.createInnerMeasure(oMDCChart, oMDCChartItem);
296
+ var aVisibleMeasures = this._getChart(oMDCChart).getVisibleMeasures();
193
297
  aVisibleMeasures.splice(iIndex, 0, this._getAggregatedMeasureNameForMDCItem(oMDCChartItem));
194
- this._oInnerChart.setVisibleMeasures(aVisibleMeasures);
298
+ this._getChart(oMDCChart).setVisibleMeasures(aVisibleMeasures);
195
299
  }
196
300
 
197
301
  //Update coloring and semantical patterns on Item change
198
302
  this._prepareColoringForItem(oMDCChartItem);
199
- this._updateColoring(this._oInnerChart.getVisibleDimensions(), this._oInnerChart.getVisibleMeasures());
303
+ this._updateColoring(oMDCChart, this._getChart(oMDCChart).getVisibleDimensions(), this._getChart(oMDCChart).getVisibleMeasures());
200
304
  this.fetchProperties(oMDCChartItem.getParent()).then(function (aProperties) {
201
- this._updateSemanticalPattern(aProperties);
305
+ this._updateSemanticalPattern(oMDCChart, aProperties);
202
306
  }.bind(this));
203
307
  };
204
308
 
@@ -207,27 +311,27 @@ sap.ui.define([
207
311
  * This function is called by MDC Chart on a change of the <code>Items</code> aggregation
208
312
  * @param {sap.ui.mdc.chartNew.ItemNew} oMDCChartItem The Item to remove from the inner chart
209
313
  */
210
- ChartDelegate.removeItemFromInnerChart = function (oMDCChartItem) {
211
- if (oMDCChartItem.getType() === "groupable" && this._oInnerChart.getVisibleDimensions().includes(oMDCChartItem.getName())) {
212
- var aNewVisibleDimensions = this._oInnerChart.getVisibleDimensions().filter(function (e) {
314
+ ChartDelegate.removeItemFromInnerChart = function (oMDCChart, oMDCChartItem) {
315
+ if (oMDCChartItem.getType() === "groupable" && this._getChart(oMDCChart).getVisibleDimensions().includes(oMDCChartItem.getName())) {
316
+ var aNewVisibleDimensions = this._getChart(oMDCChart).getVisibleDimensions().filter(function (e) {
213
317
  return e !== oMDCChartItem.getName();
214
318
  });
215
- this._oInnerChart.setVisibleDimensions(aNewVisibleDimensions);
319
+ this._getChart(oMDCChart).setVisibleDimensions(aNewVisibleDimensions);
216
320
 
217
- this._oInnerChart.removeDimension(this._oInnerChart.getDimensionByName(oMDCChartItem.getName()));
218
- } else if (oMDCChartItem.getType() === "aggregatable" && this._oInnerChart.getVisibleMeasures().includes(this._getAggregatedMeasureNameForMDCItem(oMDCChartItem))) {
219
- var aNewVisibleMeasures = this._oInnerChart.getVisibleMeasures().filter(function (e) {
321
+ this._getChart(oMDCChart).removeDimension(this._getChart(oMDCChart).getDimensionByName(oMDCChartItem.getName()));
322
+ } else if (oMDCChartItem.getType() === "aggregatable" && this._getChart(oMDCChart).getVisibleMeasures().includes(this._getAggregatedMeasureNameForMDCItem(oMDCChartItem))) {
323
+ var aNewVisibleMeasures = this._getChart(oMDCChart).getVisibleMeasures().filter(function (e) {
220
324
  return e !== this._getAggregatedMeasureNameForMDCItem(oMDCChartItem);
221
325
  }.bind(this));
222
- this._oInnerChart.setVisibleMeasures(aNewVisibleMeasures);
326
+ this._getChart(oMDCChart).setVisibleMeasures(aNewVisibleMeasures);
223
327
 
224
- this._oInnerChart.removeMeasure(this._oInnerChart.getMeasureByName(this._getAggregatedMeasureNameForMDCItem(oMDCChartItem)));
328
+ this._getChart(oMDCChart).removeMeasure(this._getChart(oMDCChart).getMeasureByName(this._getAggregatedMeasureNameForMDCItem(oMDCChartItem)));
225
329
  }
226
330
 
227
331
  //Update coloring and semantical patterns on Item change
228
- this._updateColoring(this._oInnerChart.getVisibleDimensions(), this._oInnerChart.getVisibleMeasures());
332
+ this._updateColoring(oMDCChart, this._getChart(oMDCChart).getVisibleDimensions(), this._getChart(oMDCChart).getVisibleMeasures());
229
333
  this.fetchProperties(oMDCChartItem.getParent()).then(function (aProperties) {
230
- this._updateSemanticalPattern(aProperties);
334
+ this._updateSemanticalPattern(oMDCChart, aProperties);
231
335
  }.bind(this));
232
336
  };
233
337
 
@@ -291,24 +395,25 @@ sap.ui.define([
291
395
  * @returns {Promise} resolved when inner chart is ready
292
396
  */
293
397
  ChartDelegate.initializeInnerChart = function (oMDCChart) {
294
- this._oMDCChart = oMDCChart;
295
398
 
296
399
  return new Promise(function (resolve, reject) {
297
400
 
298
401
  this._loadChart().then(function (aModules) {
299
402
 
300
- this._oInnerStructure = new VBox({
403
+ this._setInnerStructure(oMDCChart, new VBox({
301
404
  justifyContent: "Center",
302
405
  alignItems: "Center",
303
406
  height: "100%",
304
407
  width: "100%"
305
- });
408
+ }));
306
409
  var oText = new Text();
307
410
  oText.setText(oMDCChart.getNoDataText());
308
411
 
309
- this._oInnerStructure.addItem(oText);
412
+ this._getInnerStructure(oMDCChart).addItem(oText);
310
413
 
311
- resolve(this._oInnerStructure); //Not applicable in this case
414
+ this._setUpChartObserver(oMDCChart);
415
+
416
+ resolve(this._getInnerStructure(oMDCChart)); //Not applicable in this case
312
417
  }.bind(this));
313
418
  }.bind(this));
314
419
  };
@@ -343,48 +448,33 @@ sap.ui.define([
343
448
  switch (oItem.getType()) {
344
449
  case "groupable":
345
450
  aVisibleDimensions.push(oItem.getName());
346
- var oDimension = new Dimension({name: oItem.getName(), label: oItem.getLabel(), role: "category"});
347
-
348
- if (oPropertyInfo.textProperty){
349
- oDimension.setTextProperty(oPropertyInfo.textProperty);
350
- oDimension.setDisplayText(true);
351
- }
352
-
353
- this._oInnerChart.addDimension(oDimension);
451
+ this._addInnerDimension(oMDCChart, oItem, oPropertyInfo);
354
452
  break;
355
453
  case "aggregatable":
356
454
 
357
- var aggregationMethod = oPropertyInfo.aggregationMethod;
358
- var propertyPath = oPropertyInfo.propertyPath;
359
-
360
455
  //TODO: Alias might be changing after backend request
361
456
  aVisibleMeasures.push(this._getAggregatedMeasureNameForMDCItem(oItem));
362
- var oMeasure = new Measure({
363
- name: this._getAggregatedMeasureNameForMDCItem(oItem),//"average" + oItem.getName(),
364
- label: oItem.getLabel(),
365
- role: "axis1",
366
- analyticalInfo: {
367
- propertyPath: propertyPath, //TODO: What to fill here without PropertyInfos? Consider property at MDC Item level
368
- "with": aggregationMethod
369
- }
370
- });
371
- this._oInnerChart.addMeasure(oMeasure);
457
+
458
+ this._addInnerMeasure(oMDCChart, oItem, oPropertyInfo);
372
459
  break;
460
+
461
+ default:
462
+ Log.error("MDC Chart Item " + oItem.getId() + " with label " + oItem.getLabel() + " has no known type. Supported typed are: \"groupable\" & \"aggregatable\"");
373
463
  }
374
464
 
375
465
  aColorPromises.push(this._prepareColoringForItem(oItem));
376
466
  }.bind(this));
377
467
 
378
- aColMeasures.forEach(function(sKey) {
468
+ this._getState(oMDCChart).aColMeasures.forEach(function(sKey) {
379
469
 
380
- if (aInSettings.indexOf(sKey) == -1) {
470
+ if (this._getState(oMDCChart).aInSettings.indexOf(sKey) == -1) {
381
471
 
382
472
  var oPropertyInfo = aProperties.find(function (oCurrentPropertyInfo) {
383
473
  return oCurrentPropertyInfo.name === sKey;
384
474
  });
385
475
 
386
476
  var oMeasure = new Measure({
387
- name: this._getAggregatedMeasureNameForMDCItem(oPropertyInfo),//"average" + oItem.getName(),
477
+ name: sKey,
388
478
  label: oPropertyInfo.label,
389
479
  role: "axis1",
390
480
  analyticalInfo: {
@@ -394,45 +484,45 @@ sap.ui.define([
394
484
  });
395
485
 
396
486
  aVisibleMeasures.push();
397
- this._oInnerChart.addMeasure(oMeasure);
487
+ this._getChart(oMDCChart).addMeasure(oMeasure);
398
488
  }
399
489
 
400
490
  }.bind(this));
401
491
 
402
492
  Promise.all(aColorPromises).then(function(){
403
- this._oInnerChart.setVisibleDimensions(aVisibleDimensions);
404
- this._oInnerChart.setVisibleMeasures(aVisibleMeasures);
493
+ this._getChart(oMDCChart).setVisibleDimensions(aVisibleDimensions);
494
+ this._getChart(oMDCChart).setVisibleMeasures(aVisibleMeasures);
405
495
 
406
- this._updateColoring(aVisibleDimensions, aVisibleMeasures);
407
- this._updateSemanticalPattern(aProperties);
496
+ this._updateColoring(oMDCChart, aVisibleDimensions, aVisibleMeasures);
497
+ this._updateSemanticalPattern(oMDCChart, aProperties);
408
498
  }.bind(this));
409
499
 
410
500
  }.bind(this));
411
501
 
412
502
  };
413
503
 
414
- ChartDelegate.getInnerChart = function () {
415
- return this._oInnerChart;
504
+ ChartDelegate.getInnerChart = function (oMDCChart) {
505
+ return this._getChart(oMDCChart);
416
506
  };
417
507
 
418
508
 
419
509
  ChartDelegate._prepareColoringForItem = function(oItem) {
420
510
  //COLORING
421
511
  return this._addCriticality(oItem).then(function(){
422
- aInSettings.push(oItem.getName());
512
+ this._getState(oItem.getParent()).aInSettings.push(oItem.getName());
423
513
 
424
514
  if (oItem.getType === "aggregatable") {
425
515
 
426
516
  this._getPropertyInfosByName(oItem.getName(), oItem.getParent()).then(function (oPropertyInfo) {
427
517
  for (var j = 0; j < this._getAdditionalColoringMeasuresForItem(oPropertyInfo); j++) {
428
518
 
429
- if (aColMeasures.indexOf(this._getAdditionalColoringMeasuresForItem(oPropertyInfo)[j]) == -1) {
430
- aColMeasures.push(this._getAdditionalColoringMeasuresForItem(oPropertyInfo)[j]);
519
+ if (this._getState(oItem.getParent()).aColMeasures.indexOf(this._getAdditionalColoringMeasuresForItem(oPropertyInfo)[j]) == -1) {
520
+ this._getState(oItem.getParent()).aColMeasures.push(this._getAdditionalColoringMeasuresForItem(oPropertyInfo)[j]);
431
521
  }
432
522
  }
433
523
  }.bind(this));
434
524
  }
435
- });
525
+ }.bind(this));
436
526
 
437
527
  };
438
528
 
@@ -463,7 +553,7 @@ sap.ui.define([
463
553
  return this._getPropertyInfosByName(oItem.getName(), oItem.getParent()).then(function (oPropertyInfo) {
464
554
 
465
555
  if (oPropertyInfo.criticality || (oPropertyInfo.datapoint && oPropertyInfo.datapoint.criticality)){
466
- oColorings = oColorings || {
556
+ var oColorings = this._getState(oItem.getParent()).oColorings || {
467
557
  Criticality: {
468
558
  DimensionValues: {},
469
559
  MeasureValues: {}
@@ -484,6 +574,7 @@ sap.ui.define([
484
574
  }
485
575
 
486
576
  oColorings.Criticality.DimensionValues[oItem.getName()] = mChartCrit;
577
+
487
578
  } else {
488
579
  var mCrit = oPropertyInfo.datapoint && oPropertyInfo.datapoint.criticality ? oPropertyInfo.datapoint.criticality : [];
489
580
 
@@ -493,6 +584,11 @@ sap.ui.define([
493
584
 
494
585
  oColorings.Criticality.MeasureValues[oItem.getName()] = mChartCrit;
495
586
  }
587
+
588
+ var oState = this._getState(oItem.getParent());
589
+ oState.oColorings = oColorings;
590
+ this._setState(oItem.getParent(), oState);
591
+
496
592
  }
497
593
 
498
594
  });
@@ -509,8 +605,8 @@ sap.ui.define([
509
605
  * @private
510
606
  * @ui5-restricted Fiori Elements
511
607
  */
512
- ChartDelegate._updateColoring = function (aVisibleDimensions, aVisibleMeasures) {
513
- var oTempColorings = jQuery.extend(true, {}, oColorings), k;
608
+ ChartDelegate._updateColoring = function (oMDCChart, aVisibleDimensions, aVisibleMeasures) {
609
+ var oTempColorings = jQuery.extend(true, {}, this._getState(oMDCChart).oColorings), k;
514
610
 
515
611
  if (oTempColorings && oTempColorings.Criticality) {
516
612
  var oActiveColoring;
@@ -518,7 +614,7 @@ sap.ui.define([
518
614
  //dimensions overrule
519
615
  for (k = 0; k < aVisibleDimensions.length; k++) {
520
616
 
521
- if (oColorings.Criticality.DimensionValues[aVisibleDimensions[k]]) {
617
+ if (this._getState(oMDCChart).oColorings.Criticality.DimensionValues[aVisibleDimensions[k]]) {
522
618
  oActiveColoring = {
523
619
  coloring: "Criticality",
524
620
  parameters: {
@@ -550,8 +646,8 @@ sap.ui.define([
550
646
  }
551
647
 
552
648
  if (oActiveColoring) {
553
- this._oInnerChart.setColorings(oTempColorings);
554
- this._oInnerChart.setActiveColoring(oActiveColoring);
649
+ this._getChart(oMDCChart).setColorings(oTempColorings);
650
+ this._getChart(oMDCChart).setActiveColoring(oActiveColoring);
555
651
  }
556
652
  }
557
653
  };
@@ -567,9 +663,9 @@ sap.ui.define([
567
663
  * @private
568
664
  * @ui5-restricted Fiori Elements, sap.ui.mdc
569
665
  */
570
- ChartDelegate._updateSemanticalPattern = function (aProperties) {
666
+ ChartDelegate._updateSemanticalPattern = function (oMDCChart, aProperties) {
571
667
 
572
- var aVisibleMeasures = this._oInnerChart.getVisibleMeasures();
668
+ var aVisibleMeasures = this._getChart(oMDCChart).getVisibleMeasures();
573
669
 
574
670
  aVisibleMeasures.forEach(function(sVisibleMeasureName){
575
671
  //first draft only with semantic pattern
@@ -586,12 +682,12 @@ sap.ui.define([
586
682
  if (oDataPoint) {
587
683
 
588
684
  if (oDataPoint.targetValue || oDataPoint.foreCastValue) {
589
- var oActualMeasure = this._oInnerChart.getMeasureByName(sVisibleMeasureName);
685
+ var oActualMeasure = this._getChart(oMDCChart).getMeasureByName(sVisibleMeasureName);
590
686
 
591
687
  oActualMeasure.setSemantics("actual");
592
688
 
593
689
  if (oDataPoint.targetValue != null) {
594
- var oReferenceMeasure = this._oInnerChart.getMeasureByName(oDataPoint.targetValue);
690
+ var oReferenceMeasure = this._getChart(oMDCChart).getMeasureByName(oDataPoint.targetValue);
595
691
 
596
692
  if (oReferenceMeasure) {
597
693
  oReferenceMeasure.setSemantics("reference");
@@ -601,7 +697,7 @@ sap.ui.define([
601
697
  }
602
698
 
603
699
  if (oDataPoint.foreCastValue) {
604
- var oProjectionMeasure = this._oInnerChart.getMeasureByName(oDataPoint.foreCastValue);
700
+ var oProjectionMeasure = this._getChart(oMDCChart).getMeasureByName(oDataPoint.foreCastValue);
605
701
 
606
702
  if (oProjectionMeasure) {
607
703
  oProjectionMeasure.setSemantics("projected");
@@ -630,12 +726,12 @@ sap.ui.define([
630
726
  * @returns {object} information about the current chart type
631
727
  * @throws exception if inner chart is not yet ready
632
728
  */
633
- ChartDelegate.getChartTypeInfo = function () {
634
- if (!this._oInnerChart) {
729
+ ChartDelegate.getChartTypeInfo = function (oMDCChart) {
730
+ if (!this._getChart(oMDCChart)) {
635
731
  throw 'inner chart is not bound';
636
732
  }
637
733
 
638
- var sType = this._oMDCChart.getChartType(),
734
+ var sType = oMDCChart.getChartType(),
639
735
  oMDCResourceBundle = Core.getLibraryResourceBundle("sap.ui.mdc");
640
736
 
641
737
  var mInfo = {
@@ -657,11 +753,11 @@ sap.ui.define([
657
753
  * @private
658
754
  * @ui5-restricted Fiori Elements
659
755
  */
660
- ChartDelegate.getAvailableChartTypes = function () {
756
+ ChartDelegate.getAvailableChartTypes = function (oMDCChart) {
661
757
  var aChartTypes = [];
662
758
 
663
- if (this._oInnerChart) {
664
- var aAvailableChartTypes = this._oInnerChart.getAvailableChartTypes().available;
759
+ if (this._getChart(oMDCChart)) {
760
+ var aAvailableChartTypes = this._getChart(oMDCChart).getAvailableChartTypes().available;
665
761
 
666
762
  if (aChartTypes) {
667
763
 
@@ -673,7 +769,7 @@ sap.ui.define([
673
769
  key: sType,
674
770
  icon: ChartTypeButton.mMatchingIcon[sType],
675
771
  text: oChartResourceBundle.getText("info/" + sType),
676
- selected: (sType == this._oMDCChart.getChartType())
772
+ selected: (sType == oMDCChart.getChartType())
677
773
  });
678
774
  }
679
775
  }
@@ -692,9 +788,9 @@ sap.ui.define([
692
788
  * The returned objects need at least a "label" and a "name" property
693
789
  * @returns {array} Array containing the drill stack
694
790
  */
695
- ChartDelegate.getDrillStack = function () {
791
+ ChartDelegate.getDrillStack = function (oMDCChart) {
696
792
  //TODO: Generify the return values here for other chart frameworks
697
- return this._oInnerChart.getDrillStack();
793
+ return this._getChart(oMDCChart).getDrillStack();
698
794
  };
699
795
 
700
796
  /**
@@ -743,8 +839,8 @@ sap.ui.define([
743
839
  * Is called by MDC Chart when <code>chartType</code> property is updated
744
840
  * @param {string} sChartType the new chart type
745
841
  */
746
- ChartDelegate.setChartType = function (sChartType) {
747
- this._oInnerChart.setChartType(sChartType);
842
+ ChartDelegate.setChartType = function (oMDCChart, sChartType) {
843
+ this._getChart(oMDCChart).setChartType(sChartType);
748
844
  };
749
845
 
750
846
  /**
@@ -752,47 +848,45 @@ sap.ui.define([
752
848
  */
753
849
  ChartDelegate.createInnerChartContent = function (oMDCChart, fnCallbackDataLoaded) {
754
850
 
755
- //Create content based on propertyInfos and MDCChart items
756
- //var oPropertyHelper = oMDCChart.getPropertyHelper();
757
- //var aGroupableProperties = oPropertyHelper.getAllGroupableProperties();
758
- //var aAggregatableProperties = oPropertyHelper.getAllAggregatableProperties();
759
-
760
- //create inner instances for aggregations
761
- //this.createInnerDimensions(aGroupableProperties);
762
- //this.createInnerMeasures(aAggregatableProperties, oPropertyHelper);
763
- //rebind after everything is ready
764
-
765
- this._oInnerChart = new Chart({
851
+ this._setChart(oMDCChart, new Chart({
766
852
  id: oMDCChart.getId() + "--innerChart",
767
853
  chartType: "column",
768
854
  height: "330px",
769
855
  width: "100%",
770
856
  isAnalytical: true//,
771
- });
857
+ }));
858
+
859
+ var oState = this._getState(oMDCChart);
860
+ oState.aColMeasures = [];
861
+ oState.aInSettings = [];
862
+ this._setState(oMDCChart, oState);
863
+
772
864
  //Create initial content during pre-processing
773
865
  this._createContentFromItems(oMDCChart);
774
866
 
775
867
  //Since zoom information is not yet available for sap.chart.Chart after data load is complete, do it on renderComplete instead
776
868
  //This is a workaround which is hopefully not needed in other chart libraries
777
- this._oInnerChart.attachRenderComplete(function () {
869
+ this._getChart(oMDCChart).attachRenderComplete(function () {
778
870
  oMDCChart._updateToolbar();
779
871
  });
780
872
 
781
- this._oInnerStructure.removeAllItems();
782
- this._oInnerStructure.setJustifyContent(sap.m.FlexJustifyContent.Start);
783
- this._oInnerStructure.setAlignItems(sap.m.FlexAlignItems.Stretch);
784
- this._oInnerStructure.addItem(this._oInnerChart);
873
+ this._getInnerStructure(oMDCChart).removeAllItems();
874
+ this._getInnerStructure(oMDCChart).setJustifyContent(sap.m.FlexJustifyContent.Start);
875
+ this._getInnerStructure(oMDCChart).setAlignItems(sap.m.FlexAlignItems.Stretch);
876
+ this._getInnerStructure(oMDCChart).addItem(this._getChart(oMDCChart));
877
+
878
+ var oState = this._getState(oMDCChart);
879
+ oState.dataLoadedCallback = fnCallbackDataLoaded;
785
880
 
786
- this._fnDataLoadedCallback = fnCallbackDataLoaded;
881
+ this._setState(oMDCChart, oState);
787
882
  var oBindingInfo = this._getBindingInfo(oMDCChart);
788
883
  this.updateBindingInfo(oMDCChart, oBindingInfo); //Applies filters
789
884
  this.rebindChart(oMDCChart, oBindingInfo);
790
885
  };
791
886
 
792
- ChartDelegate.createInnerDimension = function (oMDCChartItem) {
887
+ ChartDelegate.createInnerDimension = function (oMDCChart, oMDCChartItem) {
793
888
  //TODO: Check for Hierachy and Time
794
889
  //TODO: Check for role annotation
795
- //var aVisibleDimensions = [];
796
890
 
797
891
  this.fetchProperties(oMDCChartItem.getParent()).then(function (aProperties) {
798
892
 
@@ -800,58 +894,72 @@ sap.ui.define([
800
894
  return oCurrentPropertyInfo.name === oMDCChartItem.getName();
801
895
  });
802
896
 
803
- var oDimension = new Dimension({
804
- name: oMDCChartItem.getName(),
805
- role: oMDCChartItem.getRole() ? oMDCChartItem.getRole() : "category",
806
- label: oMDCChartItem.getLabel()
807
- });
808
-
809
- if (oPropertyInfo.textProperty){
810
- oDimension.setTextProperty(oPropertyInfo.textProperty);
811
- oDimension.setDisplayText(true);
812
- }
813
-
814
- this._oInnerChart.addDimension(oDimension);
897
+ this._addInnerDimension(oMDCChart, oMDCChartItem, oPropertyInfo);
815
898
 
816
899
  }.bind(this));
817
900
 
818
-
819
- //add to visibleDimensions
820
- //TODO: Check this
821
- /*
822
- if (oProperty.isVisible()){
823
- aVisibleDimensions.push(oProperty.getName());
824
- }*/
825
-
826
- //this._oInnerChart.setVisibleDimensions(aVisibleDimensions);
827
901
  };
828
902
 
829
- ChartDelegate.createInnerMeasure = function (oMDChartItem) {
903
+ ChartDelegate.createInnerMeasure = function (oMDCChart, oMDCChartItem) {
830
904
 
831
- this.fetchProperties(oMDChartItem.getParent()).then(function (aProperties) {
905
+ this.fetchProperties(oMDCChartItem.getParent()).then(function (aProperties) {
832
906
 
833
907
  var oPropertyInfo = aProperties.find(function (oCurrentPropertyInfo) {
834
- return oCurrentPropertyInfo.name === oMDChartItem.getName();
908
+ return oCurrentPropertyInfo.name === oMDCChartItem.getName();
835
909
  });
836
910
 
837
- var aggregationMethod = oPropertyInfo.aggregationMethod;
838
- var propertyPath = oPropertyInfo.propertyPath;
839
-
840
- //TODO: Check for Criticality, Coloring and so on
841
- var oMeasure = new Measure({
842
- name: this._getAggregatedMeasureNameForMDCItem(oMDChartItem),//"average" + oItem.getName(),
843
- label: oMDChartItem.getLabel(),
844
- role: "axis1",
845
- analyticalInfo: {
846
- propertyPath: propertyPath, //TODO: What to fill here without PropertyInfos? Consider property at MDC Item level
847
- "with": aggregationMethod
848
- }
849
- });
850
- this._oInnerChart.addMeasure(oMeasure);
911
+ this._addInnerMeasure(oMDCChart, oMDCChartItem, oPropertyInfo);
912
+
851
913
  }.bind(this));
852
914
 
853
915
  };
854
916
 
917
+ /**
918
+ * @private
919
+ */
920
+ ChartDelegate._addInnerDimension = function(oMDCChart, oMDCChartItem, oPropertyInfo) {
921
+ var oDimension = new Dimension({
922
+ name: oMDCChartItem.getName(),
923
+ role: oMDCChartItem.getRole() ? oMDCChartItem.getRole() : "category",
924
+ label: oMDCChartItem.getLabel()
925
+ });
926
+
927
+ if (oPropertyInfo.textProperty){
928
+ oDimension.setTextProperty(oPropertyInfo.textProperty);
929
+ if (oPropertyInfo.textFormatter){
930
+ oDimension.setTextFormatter(oPropertyInfo.textFormatter);
931
+ }
932
+ oDimension.setDisplayText(true);
933
+ }
934
+
935
+ this._getChart(oMDCChart).addDimension(oDimension);
936
+ };
937
+
938
+ /**
939
+ * @private
940
+ */
941
+ ChartDelegate._addInnerMeasure = function(oMDCChart, oMDCChartItem, oPropertyInfo) {
942
+ var aggregationMethod = oPropertyInfo.aggregationMethod;
943
+ var propertyPath = oPropertyInfo.propertyPath;
944
+
945
+ var oMeasureSettings = {
946
+ name: this._getAggregatedMeasureNameForMDCItem(oMDCChartItem),//"average" + oItem.getName(),
947
+ label: oMDCChartItem.getLabel(),
948
+ role: oMDCChartItem.getRole() ? oMDCChartItem.getRole() : "axis1"
949
+ };
950
+
951
+ if (aggregationMethod && propertyPath) {
952
+ oMeasureSettings.analyticalInfo = {
953
+ propertyPath: propertyPath,
954
+ "with": aggregationMethod
955
+ };
956
+ }
957
+
958
+
959
+ var oMeasure = new Measure(oMeasureSettings);
960
+ this._getChart(oMDCChart).addMeasure(oMeasure);
961
+ };
962
+
855
963
  ChartDelegate._getAggregatedMeasureNameForProperty = function(oPoperty){
856
964
  return oPoperty.aggregationMethod + oPoperty.name;
857
965
  };
@@ -863,9 +971,9 @@ sap.ui.define([
863
971
  * @param {object} oBindingInfo The bindingInfo of the chart
864
972
  */
865
973
  ChartDelegate.rebindChart = function (oMDCChart, oBindingInfo) {
866
- if (oMDCChart && oBindingInfo && this._oInnerChart) {
974
+ if (oMDCChart && oBindingInfo && this._getChart(oMDCChart)) {
867
975
  //TODO: bindData sap.chart.Chart specific and therefore needs to be changed to a general API.
868
- this._addBindingListener(oBindingInfo, "change", this._onDataLoadComplete.bind(this));
976
+ this._addBindingListener(oBindingInfo, "change", this._getState(oMDCChart).dataLoadedCallback.bind(oMDCChart));
869
977
 
870
978
  //TODO: Clarify why sap.ui.model.odata.v4.ODataListBinding.destroy this.bHasAnalyticalInfo is false
871
979
  //TODO: on second call, as it leads to issues when changing layout options within the settings dialog.
@@ -875,16 +983,17 @@ sap.ui.define([
875
983
  }
876
984
 
877
985
 
878
- this._oInnerChart.bindData(oBindingInfo);
879
- this._oBindingInfo = oBindingInfo;
880
- this._innerChartBound = true;
986
+ this._getChart(oMDCChart).bindData(oBindingInfo);
987
+ this._setBindingInfoForState(oMDCChart, oBindingInfo);
988
+ var oState = this._getState(oMDCChart);
989
+ oState.innerChartBound = true;
881
990
  }
882
991
  };
883
992
 
884
993
  ChartDelegate._getBindingInfo = function (oMDCChart) {
885
994
 
886
- if (this._oBindingInfo) {
887
- return this._oBindingInfo;
995
+ if (this._getBindingInfoFromState(oMDCChart)) {
996
+ return this._getBindingInfoFromState(oMDCChart);
888
997
  }
889
998
 
890
999
  var oMetadataInfo = oMDCChart.getDelegate().payload;
@@ -906,8 +1015,14 @@ sap.ui.define([
906
1015
  * Returns whether the inner chart is currently bound
907
1016
  * @returns {bool} true if inner chart is bound; false if not
908
1017
  */
909
- ChartDelegate.getInnerChartBound = function () {
910
- return !!this._innerChartBound;
1018
+ ChartDelegate.getInnerChartBound = function (oMDCChart) {
1019
+ var oState = this._getState(oMDCChart);
1020
+
1021
+ if (!oState) {
1022
+ return false;
1023
+ }
1024
+
1025
+ return oState.innerChartBound ? true : false;
911
1026
  };
912
1027
 
913
1028
  /**
@@ -929,19 +1044,19 @@ sap.ui.define([
929
1044
 
930
1045
  var aPropertiesMetadata = oFilter.getPropertyInfoSet ? oFilter.getPropertyInfoSet() : null;
931
1046
  var aParameterNames = DelegateUtil.getParameterNames(oFilter);
932
- var oFilterInfo = FilterUtil.getFilterInfo(oFilter, mConditions, aPropertiesMetadata, aParameterNames);
1047
+ var oFilterInfo = FilterUtil.getFilterInfo(ChartDelegate.getTypeUtil(), mConditions, aPropertiesMetadata, aParameterNames);
933
1048
  if (oFilterInfo) {
934
1049
  oBindingInfo.filters = oFilterInfo.filters;
935
1050
  }
936
1051
 
937
- var sParameterPath = DelegateUtil.getParametersInfo(oFilter, mConditions);
1052
+ var sParameterPath = DelegateUtil.getParametersInfo(oFilter);
938
1053
  if (sParameterPath) {
939
1054
  oBindingInfo.path = sParameterPath;
940
1055
  }
941
1056
  }
942
1057
 
943
1058
  // get the basic search
944
- var sSearchText = oFilter.getSearch();
1059
+ var sSearchText = oFilter.getSearch instanceof Function ? oFilter.getSearch() : "";
945
1060
  if (sSearchText) {
946
1061
 
947
1062
  if (!oBindingInfo) {
@@ -1025,19 +1140,21 @@ sap.ui.define([
1025
1140
  * Sets tooltips visible/invisible on inner chart
1026
1141
  * @param {bool} bFlag true for visible, false for invisible
1027
1142
  */
1028
- ChartDelegate.setChartTooltipVisibility = function (bFlag) {
1143
+ ChartDelegate.setChartTooltipVisibility = function (oMDCChart, bFlag) {
1029
1144
 
1030
- if (this._oInnerChart) {
1145
+ if (this._getChart(oMDCChart)) {
1031
1146
  if (bFlag) {
1032
- if (!this._vizTooltip) {
1033
- this._vizTooltip = new VizTooltip();
1147
+ if (!this._getState(oMDCChart).vizTooltip) {
1148
+
1149
+ var oState = this._getState(oMDCChart);
1150
+ oState.vizTooltip = new VizTooltip();
1151
+ this._setState(oMDCChart, oState);
1034
1152
  }
1035
1153
  // Make this dynamic for setter calls
1036
- this._vizTooltip.connect(this._oInnerChart.getVizUid());
1037
- } else {
1038
- if (this._vizTooltip) {
1039
- this._vizTooltip.destroy();
1040
- }
1154
+ //this._vizTooltip.connect(this._oInnerChart.getVizUid());
1155
+ this._getState(oMDCChart).vizTooltip.connect(this._getChart(oMDCChart).getVizUid());
1156
+ } else if (this._getState(oMDCChart).vizTooltip) {
1157
+ this._getState(oMDCChart).vizTooltip.destroy();
1041
1158
  }
1042
1159
  } else {
1043
1160
  Log.error("Trying to set chart tooltip while inner chart was not yet initialized");
@@ -1206,6 +1323,7 @@ sap.ui.define([
1206
1323
  role: MDCLib.ChartItemRoleType.category, //standard, normally this should be interpreted from UI.Chart annotation
1207
1324
  criticality: null ,//To be implemented by FE
1208
1325
  textProperty: oPropertyAnnotations["@com.sap.vocabularies.Common.v1.Text"] ? oPropertyAnnotations["@com.sap.vocabularies.Common.v1.Text"].$Path : null //To be implemented by FE
1326
+ //textFormatter: function(){} -> can be used to provide a custom formatter for the textProperty
1209
1327
  });
1210
1328
  }
1211
1329
  }
@@ -1276,11 +1394,16 @@ sap.ui.define([
1276
1394
  }
1277
1395
  };
1278
1396
 
1397
+ ChartDelegate.checkEventForDataLoaded = function(mEventParams) {
1398
+ return (mEventParams.mParameters.reason === "change" && !mEventParams.mParameters.detailedReason);
1399
+ };
1400
+
1401
+ /*
1279
1402
  ChartDelegate._onDataLoadComplete = function (mEventParams) {
1280
1403
  if (mEventParams.mParameters.reason === "change" && !mEventParams.mParameters.detailedReason) {
1281
1404
  this._fnDataLoadedCallback.call();
1282
1405
  }
1283
- };
1406
+ };*/
1284
1407
 
1285
1408
  return ChartDelegate;
1286
1409
  });