@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.
- package/.reuse/dep5 +1 -6
- package/THIRDPARTY.txt +4 -10
- package/package.json +4 -4
- package/src/sap/ui/mdc/.library +1 -1
- package/src/sap/ui/mdc/ActionToolbar.js +1 -1
- package/src/sap/ui/mdc/AggregationBaseDelegate.js +2 -1
- package/src/sap/ui/mdc/Chart.js +14 -6
- package/src/sap/ui/mdc/ChartDelegate.js +1 -1
- package/src/sap/ui/mdc/ChartNew.js +104 -32
- package/src/sap/ui/mdc/Control.js +1 -1
- package/src/sap/ui/mdc/Element.js +2 -2
- package/src/sap/ui/mdc/Field.js +15 -2
- package/src/sap/ui/mdc/FilterBar.js +11 -1
- package/src/sap/ui/mdc/FilterField.js +28 -4
- package/src/sap/ui/mdc/Link.js +2 -2
- package/src/sap/ui/mdc/MultiValueField.js +406 -0
- package/src/sap/ui/mdc/Table.js +166 -102
- package/src/sap/ui/mdc/TableDelegate.js +30 -21
- package/src/sap/ui/mdc/ValueHelp.js +1459 -0
- package/src/sap/ui/mdc/ValueHelpDelegate.js +41 -0
- package/src/sap/ui/mdc/chart/ToolbarHandler.js +233 -223
- package/src/sap/ui/mdc/chartNew/ChartSelectionDetailsNew.js +1 -1
- package/src/sap/ui/mdc/chartNew/ChartToolbarNew.js +9 -18
- package/src/sap/ui/mdc/chartNew/ChartTypeButtonNew.js +1 -1
- package/src/sap/ui/mdc/chartNew/DrillStackHandlerNew.js +1 -1
- package/src/sap/ui/mdc/chartNew/ItemNew.js +1 -1
- package/src/sap/ui/mdc/chartNew/PropertyHelperNew.js +1 -1
- package/src/sap/ui/mdc/condition/Condition.js +2 -2
- package/src/sap/ui/mdc/condition/ConditionConverter.js +1 -1
- package/src/sap/ui/mdc/condition/ConditionModel.js +1 -1
- package/src/sap/ui/mdc/condition/FilterConverter.js +27 -15
- package/src/sap/ui/mdc/condition/FilterOperatorUtil.js +15 -9
- package/src/sap/ui/mdc/condition/Operator.js +13 -8
- package/src/sap/ui/mdc/condition/RangeOperator.js +3 -6
- package/src/sap/ui/mdc/designtime/filterbar/FilterBar.designtime.js +1 -0
- package/src/sap/ui/mdc/enum/SelectType.js +43 -0
- package/src/sap/ui/mdc/field/BoolFieldHelp.js +1 -1
- package/src/sap/ui/mdc/field/ConditionFieldHelp.js +5 -4
- package/src/sap/ui/mdc/field/ConditionType.js +69 -33
- package/src/sap/ui/mdc/field/ConditionsType.js +4 -3
- package/src/sap/ui/mdc/field/CustomFieldHelp.js +1 -1
- package/src/sap/ui/mdc/field/CustomFieldInfo.js +1 -1
- package/src/sap/ui/mdc/field/DefineConditionPanel.js +38 -24
- package/src/sap/ui/mdc/field/FieldBase.js +106 -42
- package/src/sap/ui/mdc/field/FieldBaseDelegate.js +25 -2
- package/src/sap/ui/mdc/field/FieldHelpBase.js +64 -4
- package/src/sap/ui/mdc/field/FieldInfoBase.js +1 -1
- package/src/sap/ui/mdc/field/FieldInput.js +1 -1
- package/src/sap/ui/mdc/field/FieldInputRenderUtil.js +1 -1
- package/src/sap/ui/mdc/field/FieldMultiInput.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelp.js +55 -33
- package/src/sap/ui/mdc/field/FieldValueHelpContentWrapperBase.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelpMTableWrapper.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelpMdcTableWrapper.js +52 -32
- package/src/sap/ui/mdc/field/FieldValueHelpTableWrapperBase.js +8 -10
- package/src/sap/ui/mdc/field/FieldValueHelpUITableWrapper.js +2 -1
- package/src/sap/ui/mdc/field/InParameter.js +1 -1
- package/src/sap/ui/mdc/field/ListFieldHelp.js +3 -3
- package/src/sap/ui/mdc/field/ListFieldHelpItem.js +1 -1
- package/src/sap/ui/mdc/field/MultiValueFieldDelegate.js +49 -0
- package/src/sap/ui/mdc/field/MultiValueFieldItem.js +70 -0
- package/src/sap/ui/mdc/field/OutParameter.js +1 -1
- package/src/sap/ui/mdc/field/ValueHelpPanel.js +1 -1
- package/src/sap/ui/mdc/field/content/ContentFactory.js +2 -2
- package/src/sap/ui/mdc/filterbar/FilterBarBase.js +146 -76
- package/src/sap/ui/mdc/filterbar/PropertyHelper.js +52 -0
- package/src/sap/ui/mdc/filterbar/p13n/AdaptationFilterBar.js +4 -20
- package/src/sap/ui/mdc/filterbar/p13n/FilterGroupLayout.js +9 -3
- package/src/sap/ui/mdc/filterbar/vh/FilterBar.js +1 -1
- package/src/sap/ui/mdc/filterbar/vh/GenericFilterBarDelegate.js +55 -39
- package/src/sap/ui/mdc/flexibility/AggregateFlex.js +31 -22
- package/src/sap/ui/mdc/flexibility/AggregationConfigFlex.js +33 -29
- package/src/sap/ui/mdc/flexibility/Chart.flexibility.js +10 -5
- package/src/sap/ui/mdc/flexibility/ChartItemFlex.js +18 -6
- package/src/sap/ui/mdc/flexibility/ColumnFlex.js +15 -4
- package/src/sap/ui/mdc/flexibility/ConditionFlex.js +92 -79
- package/src/sap/ui/mdc/flexibility/FilterBar.flexibility.js +1 -1
- package/src/sap/ui/mdc/flexibility/FilterItemFlex.js +1 -1
- package/src/sap/ui/mdc/flexibility/GroupFlex.js +70 -52
- package/src/sap/ui/mdc/flexibility/ItemBaseFlex.js +184 -115
- package/src/sap/ui/mdc/flexibility/Panel.flexibility.js +59 -41
- package/src/sap/ui/mdc/flexibility/SortFlex.js +72 -54
- package/src/sap/ui/mdc/flp/FlpLinkDelegate.js +2 -1
- package/src/sap/ui/mdc/library.js +618 -7
- package/src/sap/ui/mdc/link/ContactDetails.js +1 -1
- package/src/sap/ui/mdc/link/ContactDetailsAddressItem.js +1 -1
- package/src/sap/ui/mdc/link/ContactDetailsEmailItem.js +1 -1
- package/src/sap/ui/mdc/link/ContactDetailsItem.js +1 -1
- package/src/sap/ui/mdc/link/ContactDetailsPhoneItem.js +1 -1
- package/src/sap/ui/mdc/link/Factory.js +1 -1
- package/src/sap/ui/mdc/link/FakeFlpConnector.js +1 -1
- package/src/sap/ui/mdc/link/LinkItem.js +1 -1
- package/src/sap/ui/mdc/link/Panel.js +1 -1
- package/src/sap/ui/mdc/link/PanelItem.js +1 -1
- package/src/sap/ui/mdc/link/PanelListItem.js +1 -1
- package/src/sap/ui/mdc/link/SelectionDialog.js +1 -1
- package/src/sap/ui/mdc/link/SelectionDialogItem.js +1 -1
- package/src/sap/ui/mdc/link/SemanticObjectMapping.js +1 -1
- package/src/sap/ui/mdc/link/SemanticObjectMappingItem.js +1 -1
- package/src/sap/ui/mdc/link/SemanticObjectUnavailableAction.js +1 -1
- package/src/sap/ui/mdc/messagebundle.properties +20 -8
- package/src/sap/ui/mdc/messagebundle_ar.properties +16 -6
- package/src/sap/ui/mdc/messagebundle_bg.properties +15 -5
- package/src/sap/ui/mdc/messagebundle_ca.properties +15 -5
- package/src/sap/ui/mdc/messagebundle_cs.properties +17 -7
- package/src/sap/ui/mdc/messagebundle_cy.properties +15 -5
- package/src/sap/ui/mdc/messagebundle_da.properties +15 -5
- package/src/sap/ui/mdc/messagebundle_de.properties +23 -13
- package/src/sap/ui/mdc/messagebundle_el.properties +16 -6
- package/src/sap/ui/mdc/messagebundle_en.properties +14 -4
- package/src/sap/ui/mdc/messagebundle_en_GB.properties +15 -5
- package/src/sap/ui/mdc/messagebundle_en_US_sappsd.properties +12 -4
- package/src/sap/ui/mdc/messagebundle_en_US_saprigi.properties +3 -1
- package/src/sap/ui/mdc/messagebundle_en_US_saptrc.properties +12 -4
- package/src/sap/ui/mdc/messagebundle_es.properties +40 -30
- package/src/sap/ui/mdc/messagebundle_es_MX.properties +15 -5
- package/src/sap/ui/mdc/messagebundle_et.properties +15 -5
- package/src/sap/ui/mdc/messagebundle_fi.properties +16 -6
- package/src/sap/ui/mdc/messagebundle_fr.properties +27 -17
- package/src/sap/ui/mdc/messagebundle_fr_CA.properties +15 -5
- package/src/sap/ui/mdc/messagebundle_hi.properties +13 -3
- package/src/sap/ui/mdc/messagebundle_hr.properties +15 -5
- package/src/sap/ui/mdc/messagebundle_hu.properties +16 -6
- package/src/sap/ui/mdc/messagebundle_id.properties +14 -4
- package/src/sap/ui/mdc/messagebundle_it.properties +38 -28
- package/src/sap/ui/mdc/messagebundle_iw.properties +15 -5
- package/src/sap/ui/mdc/messagebundle_ja.properties +16 -6
- package/src/sap/ui/mdc/messagebundle_kk.properties +15 -5
- package/src/sap/ui/mdc/messagebundle_ko.properties +13 -3
- package/src/sap/ui/mdc/messagebundle_lt.properties +15 -5
- package/src/sap/ui/mdc/messagebundle_lv.properties +15 -5
- package/src/sap/ui/mdc/messagebundle_ms.properties +13 -3
- package/src/sap/ui/mdc/messagebundle_nl.properties +16 -6
- package/src/sap/ui/mdc/messagebundle_no.properties +22 -12
- package/src/sap/ui/mdc/messagebundle_pl.properties +19 -9
- package/src/sap/ui/mdc/messagebundle_pt.properties +15 -5
- package/src/sap/ui/mdc/messagebundle_pt_PT.properties +14 -4
- package/src/sap/ui/mdc/messagebundle_ro.properties +18 -8
- package/src/sap/ui/mdc/messagebundle_ru.properties +15 -5
- package/src/sap/ui/mdc/messagebundle_sh.properties +15 -5
- package/src/sap/ui/mdc/messagebundle_sk.properties +16 -6
- package/src/sap/ui/mdc/messagebundle_sl.properties +15 -5
- package/src/sap/ui/mdc/messagebundle_sv.properties +16 -6
- package/src/sap/ui/mdc/messagebundle_th.properties +19 -9
- package/src/sap/ui/mdc/messagebundle_tr.properties +15 -5
- package/src/sap/ui/mdc/messagebundle_uk.properties +16 -6
- package/src/sap/ui/mdc/messagebundle_vi.properties +15 -5
- package/src/sap/ui/mdc/messagebundle_zh_CN.properties +13 -3
- package/src/sap/ui/mdc/messagebundle_zh_TW.properties +13 -3
- package/src/sap/ui/mdc/mixin/AdaptationMixin.js +1 -1
- package/src/sap/ui/mdc/mixin/DelegateMixin.js +2 -2
- package/src/sap/ui/mdc/mixin/FilterIntegrationMixin.js +28 -16
- package/src/sap/ui/mdc/mixin/PromiseMixin.js +94 -0
- package/src/sap/ui/mdc/odata/json/FilterBarDelegate.js +9 -8
- package/src/sap/ui/mdc/odata/v4/ChartDelegate.js +5 -5
- package/src/sap/ui/mdc/odata/v4/ChartPropertyHelperNew.js +1 -1
- package/src/sap/ui/mdc/odata/v4/FieldBaseDelegate.js +9 -0
- package/src/sap/ui/mdc/odata/v4/FilterBarDelegate.js +88 -80
- package/src/sap/ui/mdc/odata/v4/TableDelegate.js +37 -10
- package/src/sap/ui/mdc/odata/v4/TypeUtil.js +17 -0
- package/src/sap/ui/mdc/odata/v4/ValueHelpDelegate.js +94 -0
- package/src/sap/ui/mdc/odata/v4/util/DelegateUtil.js +45 -53
- package/src/sap/ui/mdc/odata/v4/vizChart/ChartDelegateNew.js +302 -179
- package/src/sap/ui/mdc/p13n/DefaultProviderRegistry.js +1 -1
- package/src/sap/ui/mdc/p13n/Engine.js +21 -16
- package/src/sap/ui/mdc/p13n/P13nBuilder.js +5 -59
- package/src/sap/ui/mdc/p13n/PropertyHelper.js +1 -1
- package/src/sap/ui/mdc/p13n/UIManager.js +1 -1
- package/src/sap/ui/mdc/p13n/modification/ModificationHandler.js +130 -53
- package/src/sap/ui/mdc/p13n/panels/BasePanel.js +16 -7
- package/src/sap/ui/mdc/p13n/panels/GroupPanel.js +1 -1
- package/src/sap/ui/mdc/p13n/panels/ListView.js +58 -2
- package/src/sap/ui/mdc/p13n/panels/QueryPanel.js +17 -10
- package/src/sap/ui/mdc/p13n/panels/SortQueryPanel.js +6 -1
- package/src/sap/ui/mdc/p13n/panels/Wrapper.js +1 -1
- package/src/sap/ui/mdc/p13n/subcontroller/BaseController.js +1 -1
- package/src/sap/ui/mdc/p13n/subcontroller/ColumnController.js +10 -11
- package/src/sap/ui/mdc/p13n/subcontroller/FilterController.js +13 -1
- package/src/sap/ui/mdc/p13n/subcontroller/GroupController.js +1 -1
- package/src/sap/ui/mdc/p13n/subcontroller/SortController.js +11 -2
- package/src/sap/ui/mdc/table/Column.js +21 -4
- package/src/sap/ui/mdc/table/CreationRow.js +1 -1
- package/src/sap/ui/mdc/table/PropertyHelper.js +176 -4
- package/src/sap/ui/mdc/table/ResponsiveTableType.js +11 -1
- package/src/sap/ui/mdc/table/RowSettings.js +1 -1
- package/src/sap/ui/mdc/table/TableSettings.js +4 -49
- package/src/sap/ui/mdc/table/V4AnalyticsPropertyHelper.js +1 -1
- package/src/sap/ui/mdc/themes/base/FieldBase.less +4 -0
- package/src/sap/ui/mdc/themes/base/FilterBar.less +2 -2
- package/src/sap/ui/mdc/themes/base/GroupView.less +2 -2
- package/src/sap/ui/mdc/themes/base/ListView.less +2 -2
- package/src/sap/ui/mdc/themes/base/ValueHelpDialog.less +56 -21
- package/src/sap/ui/mdc/ui/Container.js +3 -3
- package/src/sap/ui/mdc/ui/ContainerItem.js +2 -2
- package/src/sap/ui/mdc/util/Common.js +26 -0
- package/src/sap/ui/mdc/util/FilterUtil.js +68 -16
- package/src/sap/ui/mdc/util/IdentifierUtil.js +4 -0
- package/src/sap/ui/mdc/util/PromiseCache.js +266 -0
- package/src/sap/ui/mdc/util/PropertyHelper.js +27 -2
- package/src/sap/ui/mdc/valuehelp/Dialog.js +475 -0
- package/src/sap/ui/mdc/valuehelp/Popover.js +346 -0
- package/src/sap/ui/mdc/valuehelp/base/Container.js +440 -0
- package/src/sap/ui/mdc/valuehelp/base/Content.js +442 -0
- package/src/sap/ui/mdc/valuehelp/base/DialogTab.js +96 -0
- package/src/sap/ui/mdc/valuehelp/base/FilterableListContent.js +537 -0
- package/src/sap/ui/mdc/valuehelp/base/ListContent.js +105 -0
- package/src/sap/ui/mdc/valuehelp/content/Bool.js +232 -0
- package/src/sap/ui/mdc/valuehelp/content/Conditions.js +250 -0
- package/src/sap/ui/mdc/valuehelp/content/FixedList.js +504 -0
- package/src/sap/ui/mdc/valuehelp/content/MDCTable.js +619 -0
- package/src/sap/ui/mdc/valuehelp/content/MTable.js +881 -0
- package/test/sap/ui/mdc/testutils/opa/TestLibrary.js +2 -2
- package/test/sap/ui/mdc/testutils/opa/filterbar/Actions.js +250 -0
- package/test/sap/ui/mdc/testutils/opa/filterbar/Assertions.js +91 -0
- package/test/sap/ui/mdc/testutils/opa/filterbar/TestObjects.js +137 -0
- package/test/sap/ui/mdc/testutils/opa/filterbar/Util.js +25 -0
- package/test/sap/ui/mdc/testutils/opa/p13n/Actions.js +256 -94
- package/test/sap/ui/mdc/testutils/opa/p13n/Util.js +2 -1
- package/test/sap/ui/mdc/testutils/opa/p13n/{waitForP13nButtonWithParentAndIcon.js → waitForP13nButtonWithMatchers.js} +5 -18
- 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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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.
|
|
206
|
+
ChartDelegate.zoomIn = function (oMDCChart, iValue) {
|
|
207
|
+
this._getChart(oMDCChart).zoom({direction: "in"});
|
|
104
208
|
};
|
|
105
209
|
|
|
106
|
-
ChartDelegate.zoomOut = function (iValue) {
|
|
107
|
-
this.
|
|
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.
|
|
118
|
-
return 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.
|
|
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.
|
|
146
|
-
this.
|
|
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.
|
|
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.
|
|
293
|
+
this._getChart(oMDCChart).setVisibleDimensions(aVisibleDimension);
|
|
190
294
|
} else if (oMDCChartItem.getType() === "aggregatable") {
|
|
191
|
-
this.createInnerMeasure(oMDCChartItem);
|
|
192
|
-
var aVisibleMeasures = this.
|
|
295
|
+
this.createInnerMeasure(oMDCChart, oMDCChartItem);
|
|
296
|
+
var aVisibleMeasures = this._getChart(oMDCChart).getVisibleMeasures();
|
|
193
297
|
aVisibleMeasures.splice(iIndex, 0, this._getAggregatedMeasureNameForMDCItem(oMDCChartItem));
|
|
194
|
-
this.
|
|
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.
|
|
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.
|
|
212
|
-
var aNewVisibleDimensions = this.
|
|
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.
|
|
319
|
+
this._getChart(oMDCChart).setVisibleDimensions(aNewVisibleDimensions);
|
|
216
320
|
|
|
217
|
-
this.
|
|
218
|
-
} else if (oMDCChartItem.getType() === "aggregatable" && this.
|
|
219
|
-
var aNewVisibleMeasures = this.
|
|
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.
|
|
326
|
+
this._getChart(oMDCChart).setVisibleMeasures(aNewVisibleMeasures);
|
|
223
327
|
|
|
224
|
-
this.
|
|
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.
|
|
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.
|
|
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.
|
|
412
|
+
this._getInnerStructure(oMDCChart).addItem(oText);
|
|
310
413
|
|
|
311
|
-
|
|
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
|
-
|
|
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
|
-
|
|
363
|
-
|
|
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:
|
|
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.
|
|
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.
|
|
404
|
-
this.
|
|
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.
|
|
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.
|
|
554
|
-
this.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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 =
|
|
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.
|
|
664
|
-
var aAvailableChartTypes = this.
|
|
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 ==
|
|
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.
|
|
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.
|
|
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
|
-
|
|
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.
|
|
869
|
+
this._getChart(oMDCChart).attachRenderComplete(function () {
|
|
778
870
|
oMDCChart._updateToolbar();
|
|
779
871
|
});
|
|
780
872
|
|
|
781
|
-
this.
|
|
782
|
-
this.
|
|
783
|
-
this.
|
|
784
|
-
this.
|
|
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.
|
|
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
|
-
|
|
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 (
|
|
903
|
+
ChartDelegate.createInnerMeasure = function (oMDCChart, oMDCChartItem) {
|
|
830
904
|
|
|
831
|
-
this.fetchProperties(
|
|
905
|
+
this.fetchProperties(oMDCChartItem.getParent()).then(function (aProperties) {
|
|
832
906
|
|
|
833
907
|
var oPropertyInfo = aProperties.find(function (oCurrentPropertyInfo) {
|
|
834
|
-
return oCurrentPropertyInfo.name ===
|
|
908
|
+
return oCurrentPropertyInfo.name === oMDCChartItem.getName();
|
|
835
909
|
});
|
|
836
910
|
|
|
837
|
-
|
|
838
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
879
|
-
this.
|
|
880
|
-
|
|
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.
|
|
887
|
-
return this.
|
|
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
|
-
|
|
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(
|
|
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
|
|
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.
|
|
1145
|
+
if (this._getChart(oMDCChart)) {
|
|
1031
1146
|
if (bFlag) {
|
|
1032
|
-
if (!this.
|
|
1033
|
-
|
|
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
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
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
|
});
|