@openui5/sap.ui.mdc 1.99.0 → 1.100.1
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/THIRDPARTY.txt +2 -2
- 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/Chart.js +50 -32
- package/src/sap/ui/mdc/ChartDelegate.js +66 -21
- package/src/sap/ui/mdc/ChartRenderer.js +1 -1
- package/src/sap/ui/mdc/Control.js +11 -6
- package/src/sap/ui/mdc/Element.js +10 -6
- package/src/sap/ui/mdc/Field.js +19 -4
- package/src/sap/ui/mdc/FilterBar.js +1 -1
- package/src/sap/ui/mdc/FilterBarDelegate.js +26 -0
- package/src/sap/ui/mdc/FilterField.js +41 -3
- package/src/sap/ui/mdc/Link.js +3 -3
- package/src/sap/ui/mdc/MultiValueField.js +11 -1
- package/src/sap/ui/mdc/Table.js +73 -39
- package/src/sap/ui/mdc/TableDelegate.js +28 -1
- package/src/sap/ui/mdc/ValueHelp.js +8 -3
- package/src/sap/ui/mdc/ValueHelpDelegate.js +2 -1
- package/src/sap/ui/mdc/actiontoolbar/ActionToolbarAction.js +1 -1
- package/src/sap/ui/mdc/actiontoolbar/ActionToolbarActionRenderer.js +1 -1
- package/src/sap/ui/mdc/chart/ChartSelectionDetails.js +1 -1
- package/src/sap/ui/mdc/chart/ChartToolbar.js +13 -6
- package/src/sap/ui/mdc/chart/DrillBreadcrumbs.js +7 -7
- package/src/sap/ui/mdc/chart/DrillStackHandler.js +6 -6
- package/src/sap/ui/mdc/chart/PropertyHelper.js +1 -1
- package/src/sap/ui/mdc/condition/Condition.js +1 -1
- 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 +4 -2
- package/src/sap/ui/mdc/condition/FilterOperatorUtil.js +133 -25
- package/src/sap/ui/mdc/condition/Operator.js +4 -2
- package/src/sap/ui/mdc/condition/OperatorDynamicDateOption.js +78 -24
- package/src/sap/ui/mdc/condition/RangeOperator.js +5 -5
- package/src/sap/ui/mdc/designtime/Util.js +63 -0
- package/src/sap/ui/mdc/designtime/actiontoolbar/ActionToolbar.designtime.js +23 -30
- package/src/sap/ui/mdc/designtime/chart/Chart.designtime.js +3 -0
- package/src/sap/ui/mdc/designtime/link/PanelItem.designtime.js +3 -1
- package/src/sap/ui/mdc/designtime/table/Table.designtime.js +39 -52
- package/src/sap/ui/mdc/field/BoolFieldHelp.js +1 -1
- package/src/sap/ui/mdc/field/ConditionFieldHelp.js +1 -1
- package/src/sap/ui/mdc/field/ConditionType.js +15 -4
- package/src/sap/ui/mdc/field/ConditionsType.js +2 -1
- 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 +16 -5
- package/src/sap/ui/mdc/field/DynamicDateRangeConditionsType.js +76 -19
- package/src/sap/ui/mdc/field/FieldBase.js +62 -11
- package/src/sap/ui/mdc/field/FieldBaseDelegate.js +1 -1
- package/src/sap/ui/mdc/field/FieldHelpBase.js +1 -1
- package/src/sap/ui/mdc/field/FieldInfoBase.js +2 -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 +4 -1
- package/src/sap/ui/mdc/field/FieldValueHelpContentWrapperBase.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelpDelegate.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelpMTableWrapper.js +5 -4
- package/src/sap/ui/mdc/field/FieldValueHelpMdcTableWrapper.js +5 -3
- package/src/sap/ui/mdc/field/FieldValueHelpTableWrapperBase.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelpUITableWrapper.js +7 -7
- package/src/sap/ui/mdc/field/InParameter.js +1 -1
- package/src/sap/ui/mdc/field/ListFieldHelp.js +1 -1
- package/src/sap/ui/mdc/field/ListFieldHelpItem.js +1 -1
- package/src/sap/ui/mdc/field/MultiValueFieldItem.js +1 -1
- package/src/sap/ui/mdc/field/OutParameter.js +1 -1
- package/src/sap/ui/mdc/field/TokenDisplay.js +1 -1
- package/src/sap/ui/mdc/field/TokenizerDisplay.js +1 -1
- package/src/sap/ui/mdc/field/ValueHelpPanel.js +1 -1
- package/src/sap/ui/mdc/field/content/ContentFactory.js +5 -1
- package/src/sap/ui/mdc/field/content/DateContent.js +27 -19
- package/src/sap/ui/mdc/field/content/DateTimeContent.js +0 -6
- package/src/sap/ui/mdc/filterbar/FilterBarBase.js +76 -208
- package/src/sap/ui/mdc/filterbar/PropertyHelper.js +27 -2
- package/src/sap/ui/mdc/filterbar/p13n/AdaptationFilterBar.js +127 -57
- package/src/sap/ui/mdc/filterbar/p13n/FilterColumnLayout.js +2 -2
- package/src/sap/ui/mdc/filterbar/p13n/GroupContainer.js +7 -3
- package/src/sap/ui/mdc/filterbar/p13n/TableContainer.js +52 -14
- package/src/sap/ui/mdc/filterbar/vh/FilterBar.js +37 -19
- package/src/sap/ui/mdc/filterbar/vh/FilterContainer.js +1 -1
- package/src/sap/ui/mdc/flexibility/AggregationConfigFlex.js +48 -31
- package/src/sap/ui/mdc/flexibility/Chart.flexibility.js +1 -1
- package/src/sap/ui/mdc/flexibility/ChartItemFlex.js +36 -0
- package/src/sap/ui/mdc/flexibility/ConditionFlex.js +47 -10
- 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/ItemBaseFlex.js +0 -1
- package/src/sap/ui/mdc/flexibility/PropertyInfoFlex.js +2 -85
- package/src/sap/ui/mdc/library.js +11 -4
- 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/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 +2 -1
- package/src/sap/ui/mdc/mixin/AdaptationMixin.js +20 -19
- package/src/sap/ui/mdc/mixin/DelegateMixin.js +1 -141
- package/src/sap/ui/mdc/mixin/FilterIntegrationMixin.js +1 -9
- package/src/sap/ui/mdc/mixin/PromiseMixin.js +1 -1
- package/src/sap/ui/mdc/mixin/PropertyHelperMixin.js +348 -0
- package/src/sap/ui/mdc/odata/TypeUtil.js +1 -1
- package/src/sap/ui/mdc/odata/v4/ChartPropertyHelper.js +70 -3
- package/src/sap/ui/mdc/odata/v4/FilterBarDelegate.js +116 -20
- package/src/sap/ui/mdc/odata/v4/ODataMetaModelUtil.js +2 -2
- package/src/sap/ui/mdc/odata/v4/TableDelegate.js +11 -33
- package/src/sap/ui/mdc/odata/v4/TypeUtil.js +2 -4
- package/src/sap/ui/mdc/odata/v4/ValueHelpDelegate.js +1 -1
- package/src/sap/ui/mdc/odata/v4/vizChart/ChartDelegate.js +281 -263
- package/src/sap/ui/mdc/p13n/AdaptationProvider.js +1 -1
- package/src/sap/ui/mdc/p13n/Engine.js +21 -18
- package/src/sap/ui/mdc/p13n/FlexUtil.js +0 -5
- package/src/sap/ui/mdc/p13n/PropertyHelper.js +2 -2
- package/src/sap/ui/mdc/p13n/StateUtil.js +4 -0
- package/src/sap/ui/mdc/p13n/UIManager.js +16 -13
- package/src/sap/ui/mdc/p13n/modification/ModificationHandler.js +18 -14
- package/src/sap/ui/mdc/p13n/modules/DefaultProviderRegistry.js +1 -1
- package/src/sap/ui/mdc/p13n/panels/ActionToolbarPanel.js +6 -6
- package/src/sap/ui/mdc/p13n/panels/AdaptFiltersPanel.js +49 -27
- package/src/sap/ui/mdc/p13n/panels/ChartItemPanel.js +4 -3
- package/src/sap/ui/mdc/p13n/panels/FilterPanel.js +136 -0
- package/src/sap/ui/mdc/p13n/panels/GroupView.js +53 -28
- package/src/sap/ui/mdc/p13n/panels/LinkSelectionPanel.js +54 -18
- package/src/sap/ui/mdc/p13n/subcontroller/ActionToolbarController.js +4 -7
- package/src/sap/ui/mdc/p13n/subcontroller/AdaptFiltersController.js +1 -2
- package/src/sap/ui/mdc/p13n/subcontroller/BaseController.js +1 -1
- package/src/sap/ui/mdc/p13n/subcontroller/FilterController.js +8 -4
- package/src/sap/ui/mdc/p13n/subcontroller/LinkPanelController.js +1 -0
- package/src/sap/ui/mdc/p13n/subcontroller/SortController.js +2 -2
- package/src/sap/ui/mdc/table/CreationRow.js +1 -1
- package/src/sap/ui/mdc/table/GridTableType.js +75 -27
- package/src/sap/ui/mdc/table/PropertyHelper.js +20 -13
- package/src/sap/ui/mdc/table/ResponsiveTableType.js +86 -13
- package/src/sap/ui/mdc/table/RowActionItem.js +119 -0
- package/src/sap/ui/mdc/table/RowSettings.js +42 -1
- package/src/sap/ui/mdc/table/V4AnalyticsPropertyHelper.js +2 -2
- package/src/sap/ui/mdc/themes/base/Chart.less +2 -0
- package/src/sap/ui/mdc/themes/base/ValueHelpDialog.less +1 -0
- package/src/sap/ui/mdc/util/DateUtil.js +32 -7
- package/src/sap/ui/mdc/util/FilterUtil.js +1 -1
- package/src/sap/ui/mdc/util/PromiseCache.js +1 -1
- package/src/sap/ui/mdc/util/PropertyHelper.js +201 -76
- package/src/sap/ui/mdc/util/TypeUtil.js +1 -1
- package/src/sap/ui/mdc/valuehelp/Dialog.js +1 -1
- package/src/sap/ui/mdc/valuehelp/Popover.js +5 -3
- package/src/sap/ui/mdc/valuehelp/base/Container.js +1 -1
- package/src/sap/ui/mdc/valuehelp/base/Content.js +1 -1
- package/src/sap/ui/mdc/valuehelp/base/DialogTab.js +1 -1
- package/src/sap/ui/mdc/valuehelp/base/FilterableListContent.js +4 -4
- package/src/sap/ui/mdc/valuehelp/base/ListContent.js +1 -1
- package/src/sap/ui/mdc/valuehelp/content/Bool.js +1 -1
- package/src/sap/ui/mdc/valuehelp/content/Conditions.js +1 -1
- package/src/sap/ui/mdc/valuehelp/content/FixedList.js +13 -10
- package/src/sap/ui/mdc/valuehelp/content/MDCTable.js +4 -10
- package/src/sap/ui/mdc/valuehelp/content/MTable.js +6 -4
- package/test/sap/ui/mdc/testutils/opa/chart/TestObjects.js +2 -0
- package/test/sap/ui/mdc/testutils/opa/filterbar/TestObjects.js +0 -1
- package/test/sap/ui/mdc/testutils/opa/p13n/Actions.js +8 -6
- package/src/sap/ui/mdc/filterbar/vh/GenericFilterBarDelegate.js +0 -150
- package/src/sap/ui/mdc/p13n/panels/BasePanel.js +0 -721
- package/src/sap/ui/mdc/p13n/panels/ListView.js +0 -408
- package/src/sap/ui/mdc/p13n/panels/SelectionPanel.js +0 -92
- package/src/sap/ui/mdc/p13n/panels/SortPanel.js +0 -150
- package/src/sap/ui/mdc/ui/Container.js +0 -240
- package/src/sap/ui/mdc/ui/ContainerItem.js +0 -79
|
@@ -25,7 +25,9 @@ sap.ui.define([
|
|
|
25
25
|
"sap/m/MessageStrip",
|
|
26
26
|
"../TypeUtil",
|
|
27
27
|
"../FilterBarDelegate",
|
|
28
|
-
"sap/ui/model/Filter"
|
|
28
|
+
"sap/ui/model/Filter",
|
|
29
|
+
"sap/ui/mdc/odata/v4/ChartPropertyHelper",
|
|
30
|
+
"sap/ui/thirdparty/jquery"
|
|
29
31
|
], function (
|
|
30
32
|
V4ChartDelegate,
|
|
31
33
|
loadModules,
|
|
@@ -47,7 +49,9 @@ sap.ui.define([
|
|
|
47
49
|
MessageStrip,
|
|
48
50
|
V4TypeUtil,
|
|
49
51
|
V4FilterBarDelegate,
|
|
50
|
-
Filter
|
|
52
|
+
Filter,
|
|
53
|
+
PropertyHelper,
|
|
54
|
+
jQuery
|
|
51
55
|
) {
|
|
52
56
|
"use strict";
|
|
53
57
|
/**
|
|
@@ -96,6 +100,36 @@ sap.ui.define([
|
|
|
96
100
|
return V4FilterBarDelegate;
|
|
97
101
|
};
|
|
98
102
|
|
|
103
|
+
/**
|
|
104
|
+
* This methods is called during the appliance of the add condition change.
|
|
105
|
+
* This intention is to update the propertyInfo property.
|
|
106
|
+
*
|
|
107
|
+
* @param {string} sPropertyName The name of a property.
|
|
108
|
+
* @param {sap.ui.mdc.Control} oControl - the instance of the mdc control
|
|
109
|
+
* @param {Object} mPropertyBag Instance of property bag from Flex change API
|
|
110
|
+
* @returns {Promise} Promise that resolves once the properyInfo property was updated
|
|
111
|
+
*/
|
|
112
|
+
ChartDelegate.addCondition = function(sPropertyName, oControl, mPropertyBag) {
|
|
113
|
+
//return this.getFilterDelegate().addCondition(sPropertyName, oControl, mPropertyBag);
|
|
114
|
+
// will be activated, once mdc.Chart has the property propertyInfo.
|
|
115
|
+
return Promise.resolve();
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* This methods is called during the appliance of the remove condition change.
|
|
120
|
+
* This intention is to update the propertyInfo property.
|
|
121
|
+
*
|
|
122
|
+
* @param {string} sPropertyName The name of a property.
|
|
123
|
+
* @param {sap.ui.mdc.Control} oControl - the instance of the mdc control
|
|
124
|
+
* @param {Object} mPropertyBag Instance of property bag from Flex change API
|
|
125
|
+
* @returns {Promise} Promise that resolves once the properyInfo property was updated
|
|
126
|
+
*/
|
|
127
|
+
ChartDelegate.removeCondition = function(sPropertyName, oControl, mPropertyBag) {
|
|
128
|
+
//return this.getFilterDelegate().removeCondition(sPropertyName, oControl, mPropertyBag);
|
|
129
|
+
// will be activated, once mdc.Chart has the property propertyInfo.
|
|
130
|
+
return Promise.resolve();
|
|
131
|
+
};
|
|
132
|
+
|
|
99
133
|
ChartDelegate._deleteState = function(oMDCChart) {
|
|
100
134
|
|
|
101
135
|
if (this._getState(oMDCChart).vizTooltip) {
|
|
@@ -213,7 +247,7 @@ sap.ui.define([
|
|
|
213
247
|
|
|
214
248
|
/**
|
|
215
249
|
* Gets the current zooming information for the inner chart
|
|
216
|
-
* @returns {
|
|
250
|
+
* @returns {int} Current zoom level on the inner chart
|
|
217
251
|
*/
|
|
218
252
|
ChartDelegate.getZoomState = function (oMDCChart) {
|
|
219
253
|
|
|
@@ -296,6 +330,10 @@ sap.ui.define([
|
|
|
296
330
|
|
|
297
331
|
ChartDelegate.getAdaptionUI = function(oMDCChart) {
|
|
298
332
|
|
|
333
|
+
return Promise.resolve(this._setupAdaptionUI(oMDCChart));
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
ChartDelegate._setupAdaptionUI = function(oMDCChart) {
|
|
299
337
|
var oLayoutConfig = this.getChartTypeLayoutConfig().find(function(it){return it.key === oMDCChart.getChartType();});
|
|
300
338
|
|
|
301
339
|
//Default case -> everything allowed
|
|
@@ -322,12 +360,13 @@ sap.ui.define([
|
|
|
322
360
|
oPanel.setMessageStrip(new MessageStrip({text: MDCRb.getText("chart.PERSONALIZATION_DIALOG_MEASURE_WARNING"), type:"Warning"}));
|
|
323
361
|
}
|
|
324
362
|
|
|
325
|
-
return
|
|
363
|
+
return oPanel;
|
|
326
364
|
};
|
|
327
365
|
|
|
328
366
|
/**
|
|
329
367
|
* Sets the visibility of the legend
|
|
330
368
|
* This is called by the MDC Chart, do not call it directly!
|
|
369
|
+
* @param {sap.ui.mdc.Chart} oMDCChart Chart to the set the legend visibility on
|
|
331
370
|
* @param {boolean} bVisible true to show legend, false to hide
|
|
332
371
|
*
|
|
333
372
|
* @experimental
|
|
@@ -370,7 +409,8 @@ sap.ui.define([
|
|
|
370
409
|
/**
|
|
371
410
|
* Inserts an MDC Chart Item (in case of sap.chart.Chart a Measure/Dimension) on the inner chart
|
|
372
411
|
* This function is called by MDC Chart on a change of the <code>Items</code> aggregation
|
|
373
|
-
* @param {sap.ui.mdc.
|
|
412
|
+
* @param {sap.ui.mdc.Chart} oMDCChart the MDC Chart to insert the item into
|
|
413
|
+
* @param {sap.ui.mdc.chart.Item} oMDCChartItem the MDC Chart Item to insert into the inner chart
|
|
374
414
|
* @param {int} iIndex the index to insert into
|
|
375
415
|
*/
|
|
376
416
|
ChartDelegate.insertItemToInnerChart = function (oMDCChart, oMDCChartItem, iIndex) {
|
|
@@ -404,14 +444,14 @@ sap.ui.define([
|
|
|
404
444
|
this._updateColoring(oMDCChart, this._getChart(oMDCChart).getVisibleDimensions(), this._getChart(oMDCChart).getVisibleMeasures());
|
|
405
445
|
}.bind(this));
|
|
406
446
|
|
|
407
|
-
this.
|
|
408
|
-
|
|
409
|
-
}.bind(this));
|
|
447
|
+
this._updateSemanticalPattern(oMDCChart);
|
|
448
|
+
|
|
410
449
|
};
|
|
411
450
|
|
|
412
451
|
/**
|
|
413
452
|
* Removes an Item (in case of sap.chart.Chart a Measure/Dimension) from the inner chart
|
|
414
453
|
* This function is called by MDC Chart on a change of the <code>Items</code> aggregation
|
|
454
|
+
* @param {sap.ui.mdc.Chart} oMDCChart the MDC Chart to remove the item from
|
|
415
455
|
* @param {sap.ui.mdc.chart.Item} oMDCChartItem The Item to remove from the inner chart
|
|
416
456
|
*/
|
|
417
457
|
ChartDelegate.removeItemFromInnerChart = function (oMDCChart, oMDCChartItem) {
|
|
@@ -441,9 +481,8 @@ sap.ui.define([
|
|
|
441
481
|
|
|
442
482
|
//Update coloring and semantical patterns on Item change
|
|
443
483
|
this._updateColoring(oMDCChart, this._getChart(oMDCChart).getVisibleDimensions(), this._getChart(oMDCChart).getVisibleMeasures());
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
}.bind(this));
|
|
484
|
+
|
|
485
|
+
this._updateSemanticalPattern(oMDCChart);
|
|
447
486
|
};
|
|
448
487
|
|
|
449
488
|
/**
|
|
@@ -458,29 +497,64 @@ sap.ui.define([
|
|
|
458
497
|
if (oMDCChart.getModel) {
|
|
459
498
|
return Promise.resolve(this._createMDCChartItem(sPropertyName, oMDCChart, sRole));
|
|
460
499
|
}
|
|
461
|
-
return Promise.resolve(null);
|
|
462
500
|
};
|
|
463
501
|
|
|
464
502
|
ChartDelegate.removeItem = function (oProperty, oMDCChart) {
|
|
465
503
|
return Promise.resolve(true);
|
|
466
504
|
};
|
|
467
505
|
|
|
468
|
-
|
|
469
|
-
|
|
506
|
+
/**
|
|
507
|
+
* This will iterate over all items of the MDC Chart to make sure all necessary information is available on them
|
|
508
|
+
* If something is missing, this method will update the item accordingly
|
|
509
|
+
* @param {sap.ui.mdc.Chart} oMDCChart the MDC Chart to check the items on
|
|
510
|
+
* @returns {Promise} resolves once check is complete
|
|
511
|
+
*/
|
|
512
|
+
ChartDelegate.checkAndUpdateMDCItems = function(oMDCChart) {
|
|
513
|
+
return new Promise(function(resolve, reject){
|
|
514
|
+
var aPropPromises = [];
|
|
515
|
+
|
|
516
|
+
oMDCChart.getItems().forEach(function(oMDCItem){
|
|
517
|
+
var bIsComplete = oMDCItem.getName() && oMDCItem.getLabel() && oMDCItem.getType() && oMDCItem.getRole();
|
|
518
|
+
|
|
519
|
+
if (!bIsComplete) {
|
|
520
|
+
aPropPromises.push(this._getPropertyInfosByName(oMDCItem.getName(), oMDCChart).then(function(oPropertyInfo){
|
|
521
|
+
oMDCItem.setLabel(oPropertyInfo.label);
|
|
522
|
+
|
|
523
|
+
if (oPropertyInfo.groupable) {
|
|
524
|
+
oMDCItem.setType("groupable");
|
|
525
|
+
oMDCItem.setRole(oMDCItem.getRole() ? oMDCItem.getRole() : "category");
|
|
526
|
+
} else if (oPropertyInfo.aggregatable) {
|
|
527
|
+
oMDCItem.setType("aggregatable");
|
|
528
|
+
oMDCItem.setRole(oMDCItem.getRole() ? oMDCItem.getRole() : "axis1");
|
|
529
|
+
}
|
|
530
|
+
}));
|
|
531
|
+
}
|
|
532
|
+
}.bind(this));
|
|
470
533
|
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
return oCurrentPropertyInfo.name === sPropertyName;
|
|
534
|
+
Promise.all(aPropPromises).then(function(){
|
|
535
|
+
resolve();
|
|
474
536
|
});
|
|
537
|
+
}.bind(this));
|
|
538
|
+
|
|
539
|
+
};
|
|
475
540
|
|
|
541
|
+
ChartDelegate._createMDCChartItem = function (sPropertyName, oMDCChart, sRole) {
|
|
542
|
+
|
|
543
|
+
return this._getPropertyInfosByName(sPropertyName, oMDCChart).then(function(oPropertyInfo){
|
|
476
544
|
if (!oPropertyInfo) {
|
|
477
545
|
return null;
|
|
478
546
|
}
|
|
479
547
|
|
|
548
|
+
return this._createMDCItemFromProperty(oPropertyInfo, oMDCChart.getId(), sRole);
|
|
549
|
+
|
|
550
|
+
}.bind(this));
|
|
551
|
+
|
|
552
|
+
};
|
|
553
|
+
|
|
554
|
+
ChartDelegate._createMDCItemFromProperty = function(oPropertyInfo, idPrefix, sRole) {
|
|
480
555
|
|
|
481
|
-
//TODO: Check for case: both aggegatable and groupable
|
|
482
556
|
if (oPropertyInfo.groupable) {
|
|
483
|
-
return new MDCChartItem(
|
|
557
|
+
return new MDCChartItem(idPrefix + "--GroupableItem--" + oPropertyInfo.name, {
|
|
484
558
|
name: oPropertyInfo.name,
|
|
485
559
|
label: oPropertyInfo.label,
|
|
486
560
|
type: "groupable",
|
|
@@ -490,14 +564,15 @@ sap.ui.define([
|
|
|
490
564
|
|
|
491
565
|
if (oPropertyInfo.aggregatable) {
|
|
492
566
|
|
|
493
|
-
return new MDCChartItem(
|
|
567
|
+
return new MDCChartItem(idPrefix + "--AggregatableItem--" + oPropertyInfo.name, {
|
|
494
568
|
name: oPropertyInfo.name,
|
|
495
569
|
label: oPropertyInfo.label,
|
|
496
570
|
type: "aggregatable",
|
|
497
571
|
role: sRole ? sRole : "axis1"
|
|
498
572
|
});
|
|
499
573
|
}
|
|
500
|
-
|
|
574
|
+
|
|
575
|
+
return null;
|
|
501
576
|
};
|
|
502
577
|
|
|
503
578
|
/**
|
|
@@ -542,114 +617,121 @@ sap.ui.define([
|
|
|
542
617
|
};
|
|
543
618
|
|
|
544
619
|
ChartDelegate._createContentFromItems = function (oMDCChart) {
|
|
545
|
-
|
|
546
|
-
|
|
620
|
+
return new Promise(function(resolve, reject){
|
|
621
|
+
//This is done so the user doesn't have to specify property path & aggregation method in the XML
|
|
547
622
|
var aColorPromises = [];
|
|
623
|
+
var aPropPromises = [];
|
|
548
624
|
|
|
549
625
|
var aVisibleDimensions = [];
|
|
550
626
|
var aVisibleMeasures = [];
|
|
551
627
|
oMDCChart.getItems().forEach(function (oItem, iIndex) {
|
|
552
628
|
|
|
553
629
|
//Uses excact mdc chart item id
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
630
|
+
aPropPromises.push(this._getPropertyInfosByName( oItem.getName(), oMDCChart).then(function(oPropertyInfo){
|
|
631
|
+
//Skip a Item if there is no property representing the Item inside the backend
|
|
632
|
+
if (!oPropertyInfo){
|
|
633
|
+
Log.error("sap.ui.mdc.Chart: Item " + oItem.getName() + " has no property info representing it in the metadata. Make sure the name is correct and the metadata is defined correctly. Skipping the item!");
|
|
634
|
+
return;
|
|
635
|
+
}
|
|
557
636
|
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
return;
|
|
562
|
-
}
|
|
637
|
+
switch (oItem.getType()) {
|
|
638
|
+
case "groupable":
|
|
639
|
+
aVisibleDimensions.push(this.getInternalChartNameFromPropertyNameAndKind(oItem.getName(), "groupable", oMDCChart));
|
|
563
640
|
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
641
|
+
this._addInnerDimension(oMDCChart, oItem, oPropertyInfo);
|
|
642
|
+
break;
|
|
643
|
+
case "aggregatable":
|
|
567
644
|
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
case "aggregatable":
|
|
645
|
+
//TODO: Alias might be changing after backend request
|
|
646
|
+
aVisibleMeasures.push(this._getAggregatedMeasureNameForMDCItem(oItem));
|
|
571
647
|
|
|
572
|
-
|
|
573
|
-
|
|
648
|
+
this._addInnerMeasure(oMDCChart, oItem, oPropertyInfo);
|
|
649
|
+
break;
|
|
574
650
|
|
|
575
|
-
|
|
576
|
-
|
|
651
|
+
default:
|
|
652
|
+
Log.error("MDC Chart Item " + oItem.getId() + " with label " + oItem.getLabel() + " has no known type. Supported typed are: \"groupable\" & \"aggregatable\"");
|
|
653
|
+
}
|
|
577
654
|
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
}
|
|
655
|
+
aColorPromises.push(this._prepareColoringForItem(oItem));
|
|
656
|
+
}.bind(this)));
|
|
581
657
|
|
|
582
|
-
aColorPromises.push(this._prepareColoringForItem(oItem));
|
|
583
658
|
}.bind(this));
|
|
584
659
|
|
|
585
|
-
|
|
660
|
+
Promise.all(aPropPromises).then(function(){
|
|
661
|
+
this._getState(oMDCChart).aColMeasures.forEach(function(sKey) {
|
|
586
662
|
|
|
587
|
-
|
|
663
|
+
if (this._getState(oMDCChart).aInSettings.indexOf(sKey) == -1) {
|
|
588
664
|
|
|
589
|
-
|
|
665
|
+
aColorPromises.push(new Promise(function(resolve, reject){
|
|
666
|
+
oMDCChart._getPropertyByNameAsync(sKey).then(function(oPropertyInfo){
|
|
667
|
+
var aggregationMethod = oPropertyInfo.aggregationMethod;
|
|
668
|
+
var propertyPath = oPropertyInfo.propertyPath;
|
|
669
|
+
var sName = this.getInternalChartNameFromPropertyNameAndKind(sKey, "aggregatable", oMDCChart);
|
|
590
670
|
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
671
|
+
var oMeasureSettings = {
|
|
672
|
+
name: sName,
|
|
673
|
+
label: oPropertyInfo.label,
|
|
674
|
+
role: "axis1"
|
|
675
|
+
};
|
|
594
676
|
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
677
|
+
if (aggregationMethod && propertyPath) {
|
|
678
|
+
oMeasureSettings.analyticalInfo = {
|
|
679
|
+
propertyPath: propertyPath,
|
|
680
|
+
"with": aggregationMethod
|
|
681
|
+
};
|
|
682
|
+
}
|
|
600
683
|
|
|
601
|
-
|
|
602
|
-
oMeasureSettings.analyticalInfo = {
|
|
603
|
-
propertyPath: propertyPath,
|
|
604
|
-
"with": aggregationMethod
|
|
605
|
-
};
|
|
606
|
-
}
|
|
684
|
+
var oMeasure = new Measure(oMeasureSettings);
|
|
607
685
|
|
|
608
|
-
|
|
686
|
+
aVisibleMeasures.push(oMeasure);
|
|
687
|
+
this._getChart(oMDCChart).addMeasure(oMeasure);
|
|
688
|
+
resolve();
|
|
689
|
+
}); //this.getPropertyFromNameAndKind not used as the key is the name of the MDC Chart Item
|
|
609
690
|
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
}
|
|
691
|
+
}));
|
|
692
|
+
}
|
|
613
693
|
|
|
614
|
-
|
|
694
|
+
}.bind(this));
|
|
615
695
|
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
696
|
+
Promise.all(aColorPromises).then(function(){
|
|
697
|
+
this._getChart(oMDCChart).setVisibleDimensions(aVisibleDimensions);
|
|
698
|
+
this._getChart(oMDCChart).setVisibleMeasures(aVisibleMeasures);
|
|
619
699
|
|
|
620
|
-
|
|
621
|
-
|
|
700
|
+
var aInResultDimensions = oMDCChart.getDelegate().inResultDimensions; //TODO: Does this use internal name? If so, change _getPropertyInfosByName below; Most likely not the case
|
|
701
|
+
if (aInResultDimensions && aInResultDimensions instanceof Array && aInResultDimensions.length != 0) {
|
|
622
702
|
|
|
623
|
-
|
|
703
|
+
var aInResultPromises = [];
|
|
624
704
|
|
|
625
|
-
|
|
705
|
+
aInResultDimensions.forEach(function(sInResultDim){
|
|
626
706
|
|
|
627
|
-
|
|
628
|
-
|
|
707
|
+
aInResultPromises.push(this._getPropertyInfosByName(sInResultDim, oMDCChart).then(function(oPropertyInfos){
|
|
708
|
+
var sName = this.getInternalChartNameFromPropertyNameAndKind(oPropertyInfos.name, "groupable", oMDCChart);
|
|
629
709
|
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
710
|
+
var oDim = new Dimension({
|
|
711
|
+
name: sName,
|
|
712
|
+
label: oPropertyInfos.label
|
|
713
|
+
});
|
|
634
714
|
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
715
|
+
this._getState(oMDCChart).inResultDimensions.push(sName);
|
|
716
|
+
this._getChart(oMDCChart).addDimension(oDim);
|
|
717
|
+
}.bind(this)));
|
|
638
718
|
|
|
639
|
-
|
|
719
|
+
}.bind(this));
|
|
640
720
|
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
721
|
+
Promise.all(aInResultPromises).then(function(){
|
|
722
|
+
this._getChart(oMDCChart).setInResultDimensions(this._getState(oMDCChart).inResultDimensions);
|
|
723
|
+
}.bind(this));
|
|
644
724
|
|
|
645
|
-
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
this._updateColoring(oMDCChart, aVisibleDimensions, aVisibleMeasures);
|
|
728
|
+
this._updateSemanticalPattern(oMDCChart);
|
|
646
729
|
|
|
647
|
-
|
|
648
|
-
|
|
730
|
+
resolve();
|
|
731
|
+
}.bind(this));
|
|
649
732
|
}.bind(this));
|
|
650
733
|
|
|
651
734
|
}.bind(this));
|
|
652
|
-
|
|
653
735
|
};
|
|
654
736
|
|
|
655
737
|
ChartDelegate.getInnerChart = function (oMDCChart) {
|
|
@@ -752,7 +834,7 @@ sap.ui.define([
|
|
|
752
834
|
|
|
753
835
|
/**
|
|
754
836
|
* Updates the coloring on the inner chart
|
|
755
|
-
* @param {sap.chart.Chart}
|
|
837
|
+
* @param {sap.chart.Chart} oMDCChart inner chart
|
|
756
838
|
* @param {array} aVisibleDimensions visible dimensions for inner chart
|
|
757
839
|
* @param {array} aVisibleMeasures visible measures for inner chart
|
|
758
840
|
*
|
|
@@ -810,15 +892,14 @@ sap.ui.define([
|
|
|
810
892
|
/**
|
|
811
893
|
* Updates the semantical pattern for given measures
|
|
812
894
|
*
|
|
813
|
-
* @param {sap.chart.Chart}
|
|
814
|
-
* @param {
|
|
815
|
-
* @param {*} mDataPoints data points of the inner chart
|
|
895
|
+
* @param {sap.chart.Chart} oMDCChart the inner chart
|
|
896
|
+
* @param {*} aProperties // TODO what is this parameter used for?
|
|
816
897
|
*
|
|
817
898
|
* @experimental
|
|
818
899
|
* @private
|
|
819
900
|
* @ui5-restricted Fiori Elements, sap.ui.mdc
|
|
820
901
|
*/
|
|
821
|
-
ChartDelegate._updateSemanticalPattern = function (oMDCChart
|
|
902
|
+
ChartDelegate._updateSemanticalPattern = function (oMDCChart) {
|
|
822
903
|
|
|
823
904
|
var aVisibleMeasures = this._getChart(oMDCChart).getVisibleMeasures();
|
|
824
905
|
|
|
@@ -969,23 +1050,31 @@ sap.ui.define([
|
|
|
969
1050
|
*/
|
|
970
1051
|
ChartDelegate.getSortedDimensions = function (oMDCChart) {
|
|
971
1052
|
return new Promise(function (resolve, reject) {
|
|
972
|
-
this.fetchProperties(oMDCChart).then(function (aProperties) {
|
|
973
1053
|
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
1054
|
+
if (oMDCChart.isPropertyHelperFinal()){
|
|
1055
|
+
resolve(this._sortPropertyDimensions(oMDCChart.getPropertyHelper().getProperties()));
|
|
1056
|
+
} else {
|
|
1057
|
+
oMDCChart.finalizePropertyHelper().then(function(){
|
|
1058
|
+
resolve(this._sortPropertyDimensions(oMDCChart.getPropertyHelper().getProperties()));
|
|
1059
|
+
}.bind(this));
|
|
1060
|
+
}
|
|
1061
|
+
}.bind(this));
|
|
1062
|
+
};
|
|
977
1063
|
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
}
|
|
983
|
-
});
|
|
984
|
-
}
|
|
1064
|
+
ChartDelegate._sortPropertyDimensions = function(aProperties) {
|
|
1065
|
+
var aDimensions = aProperties.filter(function (oItem) {
|
|
1066
|
+
return oItem.groupable; //Groupable means "Dimension" for sap.chart.Chart
|
|
1067
|
+
});
|
|
985
1068
|
|
|
986
|
-
|
|
1069
|
+
if (aDimensions) {
|
|
1070
|
+
aDimensions.sort(function (a, b) {
|
|
1071
|
+
if (a.label && b.label) {
|
|
1072
|
+
return a.label.localeCompare(b.label);
|
|
1073
|
+
}
|
|
987
1074
|
});
|
|
988
|
-
}
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
return aDimensions;
|
|
989
1078
|
};
|
|
990
1079
|
|
|
991
1080
|
/**
|
|
@@ -1006,6 +1095,7 @@ sap.ui.define([
|
|
|
1006
1095
|
/**
|
|
1007
1096
|
* Sets the chart type of the inner chart
|
|
1008
1097
|
* Is called by MDC Chart when <code>chartType</code> property is updated
|
|
1098
|
+
* @param {sap.ui.mdc.Chart} oMDCChart the MDC Chart to set the chart type for
|
|
1009
1099
|
* @param {string} sChartType the new chart type
|
|
1010
1100
|
*/
|
|
1011
1101
|
ChartDelegate.setChartType = function (oMDCChart, sChartType) {
|
|
@@ -1017,53 +1107,60 @@ sap.ui.define([
|
|
|
1017
1107
|
*/
|
|
1018
1108
|
ChartDelegate.createInnerChartContent = function (oMDCChart, fnCallbackDataLoaded) {
|
|
1019
1109
|
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1110
|
+
return new Promise(function(resolve,reject){
|
|
1111
|
+
this._setChart(oMDCChart, new Chart({
|
|
1112
|
+
id: oMDCChart.getId() + "--innerChart",
|
|
1113
|
+
chartType: "column",
|
|
1114
|
+
width: "100%",
|
|
1115
|
+
isAnalytical: true//,
|
|
1116
|
+
}));
|
|
1026
1117
|
|
|
1027
|
-
|
|
1028
|
-
|
|
1118
|
+
//Initialize empty; will get filled later on
|
|
1119
|
+
this._getState(oMDCChart).inResultDimensions = [];
|
|
1029
1120
|
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1121
|
+
if (oMDCChart.getHeight()){
|
|
1122
|
+
this._getChart(oMDCChart).setHeight(this._calculateInnerChartHeight(oMDCChart));
|
|
1123
|
+
}
|
|
1033
1124
|
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1125
|
+
//Set height correctly again if chart changes
|
|
1126
|
+
ResizeHandler.register(oMDCChart, function(){
|
|
1127
|
+
this.adjustChartHeight(oMDCChart);
|
|
1128
|
+
}.bind(this));
|
|
1038
1129
|
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1130
|
+
var oState = this._getState(oMDCChart);
|
|
1131
|
+
oState.aColMeasures = [];
|
|
1132
|
+
oState.aInSettings = [];
|
|
1133
|
+
this._setState(oMDCChart, oState);
|
|
1134
|
+
|
|
1135
|
+
//Create initial content during pre-processing
|
|
1136
|
+
this._createContentFromItems(oMDCChart).then(function(){
|
|
1137
|
+
//Since zoom information is not yet available for sap.chart.Chart after data load is complete, do it on renderComplete instead
|
|
1138
|
+
//This is a workaround which is hopefully not needed in other chart libraries
|
|
1139
|
+
this._getChart(oMDCChart).attachRenderComplete(function () {
|
|
1140
|
+
if (this._getState(oMDCChart).toolbarUpdateRequested){
|
|
1141
|
+
oMDCChart._updateToolbar();
|
|
1142
|
+
this._getState(oMDCChart).toolbarUpdateRequested = false;
|
|
1143
|
+
}
|
|
1144
|
+
}.bind(this));
|
|
1145
|
+
|
|
1146
|
+
this._getInnerStructure(oMDCChart).removeAllItems();
|
|
1147
|
+
this._getInnerStructure(oMDCChart).setJustifyContent(FlexJustifyContent.Start);
|
|
1148
|
+
this._getInnerStructure(oMDCChart).setAlignItems(FlexAlignItems.Stretch);
|
|
1149
|
+
this._getInnerStructure(oMDCChart).addItem(this._getChart(oMDCChart));
|
|
1055
1150
|
|
|
1056
|
-
|
|
1057
|
-
this._getInnerStructure(oMDCChart).setJustifyContent(FlexJustifyContent.Start);
|
|
1058
|
-
this._getInnerStructure(oMDCChart).setAlignItems(FlexAlignItems.Stretch);
|
|
1059
|
-
this._getInnerStructure(oMDCChart).addItem(this._getChart(oMDCChart));
|
|
1151
|
+
oState.dataLoadedCallback = fnCallbackDataLoaded;
|
|
1060
1152
|
|
|
1061
|
-
|
|
1153
|
+
this._setState(oMDCChart, oState);
|
|
1154
|
+
var oBindingInfo = this._getBindingInfo(oMDCChart);
|
|
1155
|
+
this.updateBindingInfo(oMDCChart, oBindingInfo); //Applies filters
|
|
1156
|
+
this.rebind(oMDCChart, oBindingInfo);
|
|
1157
|
+
|
|
1158
|
+
resolve();
|
|
1159
|
+
}.bind(this));
|
|
1160
|
+
|
|
1161
|
+
|
|
1162
|
+
}.bind(this));
|
|
1062
1163
|
|
|
1063
|
-
this._setState(oMDCChart, oState);
|
|
1064
|
-
var oBindingInfo = this._getBindingInfo(oMDCChart);
|
|
1065
|
-
this.updateBindingInfo(oMDCChart, oBindingInfo); //Applies filters
|
|
1066
|
-
this.rebind(oMDCChart, oBindingInfo);
|
|
1067
1164
|
};
|
|
1068
1165
|
|
|
1069
1166
|
ChartDelegate._calculateInnerChartHeight = function(oMDCChart) {
|
|
@@ -1110,32 +1207,18 @@ sap.ui.define([
|
|
|
1110
1207
|
//TODO: Check for Hierachy and Time
|
|
1111
1208
|
//TODO: Check for role annotation
|
|
1112
1209
|
|
|
1113
|
-
this.
|
|
1114
|
-
|
|
1115
|
-
//Uses MDC Chart Item ID to identify preoperty, not internal chart id
|
|
1116
|
-
var oPropertyInfo = aProperties.find(function (oCurrentPropertyInfo) {
|
|
1117
|
-
return oCurrentPropertyInfo.name === oMDCChartItem.getName();
|
|
1118
|
-
});
|
|
1119
|
-
|
|
1120
|
-
this._addInnerDimension(oMDCChart, oMDCChartItem, oPropertyInfo);
|
|
1121
|
-
|
|
1210
|
+
this._getPropertyInfosByName(oMDCChartItem.getName(), oMDCChart).then(function(oPropInfo){
|
|
1211
|
+
this._addInnerDimension(oMDCChart, oMDCChartItem, oPropInfo);
|
|
1122
1212
|
}.bind(this));
|
|
1123
1213
|
|
|
1214
|
+
|
|
1124
1215
|
};
|
|
1125
1216
|
|
|
1126
1217
|
ChartDelegate.createInnerMeasure = function (oMDCChart, oMDCChartItem) {
|
|
1127
1218
|
|
|
1128
|
-
this.
|
|
1129
|
-
|
|
1130
|
-
//Uses MDC Chart Item ID to identify preoperty, not internal chart id
|
|
1131
|
-
var oPropertyInfo = aProperties.find(function (oCurrentPropertyInfo) {
|
|
1132
|
-
return oCurrentPropertyInfo.name === oMDCChartItem.getName();
|
|
1133
|
-
});
|
|
1134
|
-
|
|
1135
|
-
this._addInnerMeasure(oMDCChart, oMDCChartItem, oPropertyInfo);
|
|
1136
|
-
|
|
1219
|
+
this._getPropertyInfosByName(oMDCChartItem.getName(), oMDCChart).then(function(oPropInfo){
|
|
1220
|
+
this._addInnerMeasure(oMDCChart, oMDCChartItem, oPropInfo);
|
|
1137
1221
|
}.bind(this));
|
|
1138
|
-
|
|
1139
1222
|
};
|
|
1140
1223
|
|
|
1141
1224
|
/**
|
|
@@ -1151,7 +1234,7 @@ sap.ui.define([
|
|
|
1151
1234
|
if (oPropertyInfo.textProperty){
|
|
1152
1235
|
oDimension.setTextProperty(oPropertyInfo.textProperty);
|
|
1153
1236
|
if (oPropertyInfo.textFormatter){
|
|
1154
|
-
oDimension.setTextFormatter(oPropertyInfo
|
|
1237
|
+
oDimension.setTextFormatter(this._formatText.bind(oPropertyInfo));
|
|
1155
1238
|
}
|
|
1156
1239
|
oDimension.setDisplayText(true);
|
|
1157
1240
|
}
|
|
@@ -1357,41 +1440,6 @@ sap.ui.define([
|
|
|
1357
1440
|
return oMDCChart.getPropertyHelper().getProperty(sName);
|
|
1358
1441
|
};
|
|
1359
1442
|
|
|
1360
|
-
/**
|
|
1361
|
-
* This returns the layout options for a specific type of Item (measure/dimension,groupable/aggregatable)
|
|
1362
|
-
* It is used by p13n to determine which layout options to show in the p13n panel
|
|
1363
|
-
* @param {string} sType the type for which the layout options are requested
|
|
1364
|
-
*/
|
|
1365
|
-
ChartDelegate._getLayoutOptionsForType = function(sType){
|
|
1366
|
-
var MDCRb = sap.ui.getCore().getLibraryResourceBundle("sap.ui.mdc");
|
|
1367
|
-
var oAvailableRoles = {
|
|
1368
|
-
groupable: [
|
|
1369
|
-
{
|
|
1370
|
-
key: MDCLib.ChartItemRoleType.category,
|
|
1371
|
-
text: MDCRb.getText('chart.PERSONALIZATION_DIALOG_CHARTROLE_CATEGORY')
|
|
1372
|
-
}, {
|
|
1373
|
-
key: MDCLib.ChartItemRoleType.category2,
|
|
1374
|
-
text: MDCRb.getText('chart.PERSONALIZATION_DIALOG_CHARTROLE_CATEGORY2')
|
|
1375
|
-
}, {
|
|
1376
|
-
key: MDCLib.ChartItemRoleType.series,
|
|
1377
|
-
text: MDCRb.getText('chart.PERSONALIZATION_DIALOG_CHARTROLE_SERIES')
|
|
1378
|
-
}
|
|
1379
|
-
],
|
|
1380
|
-
aggregatable: [
|
|
1381
|
-
{
|
|
1382
|
-
key: MDCLib.ChartItemRoleType.axis1,
|
|
1383
|
-
text: MDCRb.getText('chart.PERSONALIZATION_DIALOG_CHARTROLE_AXIS1')
|
|
1384
|
-
}, {
|
|
1385
|
-
key: MDCLib.ChartItemRoleType.axis2,
|
|
1386
|
-
text: MDCRb.getText('chart.PERSONALIZATION_DIALOG_CHARTROLE_AXIS2')
|
|
1387
|
-
}, {
|
|
1388
|
-
key: MDCLib.ChartItemRoleType.axis3,
|
|
1389
|
-
text: MDCRb.getText('chart.PERSONALIZATION_DIALOG_CHARTROLE_AXIS3')
|
|
1390
|
-
}
|
|
1391
|
-
]
|
|
1392
|
-
};
|
|
1393
|
-
return oAvailableRoles[sType];
|
|
1394
|
-
};
|
|
1395
1443
|
|
|
1396
1444
|
/**
|
|
1397
1445
|
* Adds an item to the inner chart (measure/dimension)
|
|
@@ -1417,6 +1465,7 @@ sap.ui.define([
|
|
|
1417
1465
|
|
|
1418
1466
|
/**
|
|
1419
1467
|
* Sets tooltips visible/invisible on inner chart
|
|
1468
|
+
* @param {sap.ui.mdc.Chart} oMDCChart the MDC Chart
|
|
1420
1469
|
* @param {boolean} bFlag true for visible, false for invisible
|
|
1421
1470
|
*/
|
|
1422
1471
|
ChartDelegate.setChartTooltipVisibility = function (oMDCChart, bFlag) {
|
|
@@ -1468,44 +1517,24 @@ sap.ui.define([
|
|
|
1468
1517
|
};
|
|
1469
1518
|
|
|
1470
1519
|
/**
|
|
1471
|
-
*
|
|
1472
|
-
*
|
|
1473
|
-
* @param {sap.ui.mdc.Chart} oMDCChart reference to the MDC Chart
|
|
1474
|
-
* @returns {Promise<sap.ui.mdc.table.V4AnalyticsPropertyHelper>} A promise that resolves with the property helper.
|
|
1475
|
-
* @private
|
|
1476
|
-
* @ui5-restricted sap.ui.mdc
|
|
1520
|
+
* Returns the propertyHelper used for the chart delegate
|
|
1521
|
+
* @returns {Promise} Promise with the property helper reference
|
|
1477
1522
|
*/
|
|
1478
|
-
ChartDelegate.
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
this.fetchProperties(oMDCChart),
|
|
1482
|
-
loadModules("sap/ui/mdc/odata/v4/ChartPropertyHelper")
|
|
1483
|
-
]).then(function (aResult) {
|
|
1484
|
-
return Promise.all(aResult.concat(this.fetchPropertyExtensions(oMDCChart, aResult[0])));
|
|
1485
|
-
}.bind(this)).then(function (aResult) {
|
|
1486
|
-
var aProperties = aResult[0];
|
|
1487
|
-
var PropertyHelper = aResult[1][0];
|
|
1488
|
-
var mExtensions = aResult[2];
|
|
1489
|
-
var iMatchingExtensions = 0;
|
|
1490
|
-
var aPropertiesWithExtension = [];
|
|
1491
|
-
|
|
1492
|
-
for (var i = 0; i < aProperties.length; i++) {
|
|
1493
|
-
aPropertiesWithExtension.push(Object.assign({}, aProperties[i], {
|
|
1494
|
-
extension: mExtensions[aProperties[i].name] || {}
|
|
1495
|
-
}));
|
|
1496
|
-
|
|
1497
|
-
if (aProperties[i].name in mExtensions) {
|
|
1498
|
-
iMatchingExtensions++;
|
|
1499
|
-
}
|
|
1500
|
-
}
|
|
1501
|
-
|
|
1502
|
-
if (iMatchingExtensions !== Object.keys(mExtensions).length) {
|
|
1503
|
-
throw new Error("At least one property extension does not point to an existing property");
|
|
1504
|
-
}
|
|
1523
|
+
ChartDelegate.getPropertyHelperClass = function () {
|
|
1524
|
+
return PropertyHelper;
|
|
1525
|
+
};
|
|
1505
1526
|
|
|
1506
|
-
|
|
1507
|
-
|
|
1527
|
+
/**
|
|
1528
|
+
* This allows formatting for axis labels of the inner sap.chart.Chart.
|
|
1529
|
+
* Note: As the inner chart has no association to the propertyInfo, "this" will be bound to the propertyInfo object when calling this method
|
|
1530
|
+
* @param {string} sKey the key of the dimension
|
|
1531
|
+
* @param {string} SDesc the description provided by the metadata
|
|
1532
|
+
* @returns {string} the label which should be shown on the chart axis
|
|
1533
|
+
*/
|
|
1534
|
+
ChartDelegate._formatText = function(sKey, SDesc) {
|
|
1535
|
+
return sKey;
|
|
1508
1536
|
};
|
|
1537
|
+
|
|
1509
1538
|
/**
|
|
1510
1539
|
* Returns the relevant propery infos based on the metadata used with the MDC Chart instance.
|
|
1511
1540
|
*
|
|
@@ -1513,6 +1542,7 @@ sap.ui.define([
|
|
|
1513
1542
|
* @returns {array} Array of the property infos to be used within MDC Chart
|
|
1514
1543
|
*/
|
|
1515
1544
|
ChartDelegate.fetchProperties = function (oMDCChart) {
|
|
1545
|
+
|
|
1516
1546
|
var oModel = this._getModel(oMDCChart);
|
|
1517
1547
|
var pCreatePropertyInfos;
|
|
1518
1548
|
|
|
@@ -1522,10 +1552,10 @@ sap.ui.define([
|
|
|
1522
1552
|
resolver: resolve
|
|
1523
1553
|
}, onModelContextChange, this);
|
|
1524
1554
|
}.bind(this)).then(function (oModel) {
|
|
1525
|
-
return this._createPropertyInfos(oMDCChart, oModel);
|
|
1555
|
+
return this._createPropertyInfos(oMDCChart.getDelegate().payload, oModel);
|
|
1526
1556
|
}.bind(this));
|
|
1527
1557
|
} else {
|
|
1528
|
-
pCreatePropertyInfos = this._createPropertyInfos(oMDCChart, oModel);
|
|
1558
|
+
pCreatePropertyInfos = this._createPropertyInfos(oMDCChart.getDelegate().payload, oModel);
|
|
1529
1559
|
}
|
|
1530
1560
|
|
|
1531
1561
|
return pCreatePropertyInfos.then(function (aProperties) {
|
|
@@ -1546,10 +1576,10 @@ sap.ui.define([
|
|
|
1546
1576
|
}
|
|
1547
1577
|
}
|
|
1548
1578
|
|
|
1549
|
-
ChartDelegate._createPropertyInfos = function (
|
|
1550
|
-
var oMetadataInfo = oMDCChart.getDelegate().payload;
|
|
1579
|
+
ChartDelegate._createPropertyInfos = function (oDelegatePayload, oModel) {
|
|
1580
|
+
//var oMetadataInfo = oMDCChart.getDelegate().payload;
|
|
1551
1581
|
var aProperties = [];
|
|
1552
|
-
var sEntitySetPath = "/" +
|
|
1582
|
+
var sEntitySetPath = "/" + oDelegatePayload.collectionName;
|
|
1553
1583
|
var oMetaModel = oModel.getMetaModel();
|
|
1554
1584
|
|
|
1555
1585
|
return Promise.all([
|
|
@@ -1598,13 +1628,13 @@ sap.ui.define([
|
|
|
1598
1628
|
aggregatable: false,
|
|
1599
1629
|
maxConditions: ODataMetaModelUtil.isMultiValueFilterExpression(oFilterRestrictionsInfo.propertyInfo[sKey]) ? -1 : 1,
|
|
1600
1630
|
sortKey: sKey,
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1631
|
+
dataType: oObj.$Type,
|
|
1632
|
+
//formatOptions: null,
|
|
1633
|
+
//constraints: {},
|
|
1604
1634
|
role: MDCLib.ChartItemRoleType.category, //standard, normally this should be interpreted from UI.Chart annotation
|
|
1605
1635
|
criticality: null ,//To be implemented by FE
|
|
1606
1636
|
textProperty: oPropertyAnnotations["@com.sap.vocabularies.Common.v1.Text"] ? oPropertyAnnotations["@com.sap.vocabularies.Common.v1.Text"].$Path : null //To be implemented by FE
|
|
1607
|
-
//textFormatter:
|
|
1637
|
+
//textFormatter: string-> can be used to provide a custom formatter for the textProperty
|
|
1608
1638
|
});
|
|
1609
1639
|
}
|
|
1610
1640
|
}
|
|
@@ -1628,14 +1658,10 @@ sap.ui.define([
|
|
|
1628
1658
|
aggregatable: oPropertyAnnotations["@Org.OData.Aggregation.V1.Aggregatable"],
|
|
1629
1659
|
aggregationMethod: sAggregationMethod,
|
|
1630
1660
|
maxConditions: ODataMetaModelUtil.isMultiValueFilterExpression(oFilterRestrictionsInfo.propertyInfo[sKey]) ? -1 : 1,
|
|
1631
|
-
|
|
1632
|
-
typeConfig: this.getTypeUtil().getTypeConfig(oObj.$Type, null, {}),
|
|
1633
|
-
kind: "Aggregatable",//Only needed for P13n Item Panel
|
|
1634
|
-
availableRoles: this._getLayoutOptionsForType("aggregatable"), //for p13n
|
|
1635
|
-
role: MDCLib.ChartItemRoleType.axis1,
|
|
1661
|
+
dataType: oObj.$Type,
|
|
1636
1662
|
datapoint: null //To be implemented by FE
|
|
1637
1663
|
});
|
|
1638
|
-
}
|
|
1664
|
+
});
|
|
1639
1665
|
}
|
|
1640
1666
|
|
|
1641
1667
|
return aProperties;
|
|
@@ -1643,15 +1669,7 @@ sap.ui.define([
|
|
|
1643
1669
|
|
|
1644
1670
|
//Gets internal property infos by excact property name
|
|
1645
1671
|
ChartDelegate._getPropertyInfosByName = function(sName, oMDCChart){
|
|
1646
|
-
return
|
|
1647
|
-
this.fetchProperties(oMDCChart).then(function(aProperties){
|
|
1648
|
-
var oPropertyInfo = aProperties.find(function (oCurrentPropertyInfo) {
|
|
1649
|
-
return oCurrentPropertyInfo.name === sName;
|
|
1650
|
-
});
|
|
1651
|
-
|
|
1652
|
-
resolve(oPropertyInfo);
|
|
1653
|
-
});
|
|
1654
|
-
}.bind(this));
|
|
1672
|
+
return oMDCChart._getPropertyByNameAsync(sName);
|
|
1655
1673
|
};
|
|
1656
1674
|
|
|
1657
1675
|
|