@openui5/sap.ui.mdc 1.98.0 → 1.101.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRDPARTY.txt +6 -6
- package/package.json +4 -4
- package/src/sap/ui/mdc/.library +1 -1
- package/src/sap/ui/mdc/ActionToolbar.js +6 -3
- package/src/sap/ui/mdc/AggregationBaseDelegate.js +1 -1
- package/src/sap/ui/mdc/Chart.js +186 -102
- package/src/sap/ui/mdc/ChartDelegate.js +85 -30
- 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 +22 -4
- package/src/sap/ui/mdc/LinkDelegate.js +9 -7
- package/src/sap/ui/mdc/MultiValueField.js +30 -6
- package/src/sap/ui/mdc/Table.js +332 -316
- package/src/sap/ui/mdc/TableDelegate.js +146 -31
- package/src/sap/ui/mdc/ValueHelp.js +136 -624
- package/src/sap/ui/mdc/ValueHelpDelegate.js +154 -7
- package/src/sap/ui/mdc/actiontoolbar/ActionToolbarAction.js +2 -2
- 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 +56 -11
- package/src/sap/ui/mdc/chart/ChartTypeButton.js +24 -10
- package/src/sap/ui/mdc/chart/DrillBreadcrumbs.js +9 -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 +14 -9
- package/src/sap/ui/mdc/condition/ConditionConverter.js +58 -6
- 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 +393 -68
- package/src/sap/ui/mdc/condition/Operator.js +14 -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 +6 -0
- package/src/sap/ui/mdc/designtime/filterbar/FilterBar.designtime.js +3 -1
- package/src/sap/ui/mdc/designtime/link/PanelItem.designtime.js +3 -1
- package/src/sap/ui/mdc/designtime/table/Table.designtime.js +36 -9
- package/src/sap/ui/mdc/enum/PropagationReason.js +43 -0
- 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 +44 -13
- package/src/sap/ui/mdc/field/ConditionsType.js +3 -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 +31 -9
- package/src/sap/ui/mdc/field/DynamicDateRangeConditionsType.js +76 -19
- package/src/sap/ui/mdc/field/FieldBase.js +69 -14
- package/src/sap/ui/mdc/field/FieldBaseDelegate.js +41 -19
- package/src/sap/ui/mdc/field/FieldHelpBase.js +2 -2
- package/src/sap/ui/mdc/field/FieldInfoBase.js +24 -10
- 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 +9 -4
- 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 +6 -4
- package/src/sap/ui/mdc/field/FieldValueHelpTableWrapperBase.js +6 -3
- 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 +70 -0
- package/src/sap/ui/mdc/field/TokenDisplayRenderer.js +24 -0
- package/src/sap/ui/mdc/field/TokenizerDisplay.js +80 -0
- package/src/sap/ui/mdc/field/TokenizerDisplayRenderer.js +69 -0
- package/src/sap/ui/mdc/field/ValueHelpPanel.js +1 -1
- package/src/sap/ui/mdc/field/content/ContentFactory.js +10 -6
- 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/field/content/DefaultContent.js +35 -13
- package/src/sap/ui/mdc/field/content/LinkContent.js +1 -1
- package/src/sap/ui/mdc/filterbar/FilterBarBase.js +137 -216
- package/src/sap/ui/mdc/filterbar/FilterBarBaseRenderer.js +1 -1
- package/src/sap/ui/mdc/filterbar/IFilterContainer.js +5 -0
- package/src/sap/ui/mdc/filterbar/PropertyHelper.js +27 -2
- package/src/sap/ui/mdc/filterbar/aligned/FilterContainer.js +1 -0
- package/src/sap/ui/mdc/filterbar/aligned/FilterItemLayout.js +1 -0
- package/src/sap/ui/mdc/filterbar/p13n/AdaptationFilterBar.js +144 -64
- 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 +73 -23
- 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 +7 -42
- package/src/sap/ui/mdc/flexibility/ChartItemFlex.js +36 -0
- package/src/sap/ui/mdc/flexibility/ChartTypeFlex.js +54 -0
- package/src/sap/ui/mdc/flexibility/ConditionFlex.js +49 -12
- 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/flp/FlpLinkDelegate.js +5 -5
- package/src/sap/ui/mdc/library.js +41 -30
- package/src/sap/ui/mdc/link/ContactDetails.js +107 -23
- 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/ContactDetailsRenderer.js +26 -0
- 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/Log.js +1 -1
- package/src/sap/ui/mdc/link/Panel.js +205 -29
- package/src/sap/ui/mdc/link/PanelItem.js +1 -1
- package/src/sap/ui/mdc/link/PanelRenderer.js +26 -0
- 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 +59 -6
- package/src/sap/ui/mdc/messagebundle_ar.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_bg.properties +58 -24
- package/src/sap/ui/mdc/messagebundle_ca.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_cs.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_cy.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_da.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_de.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_el.properties +39 -5
- package/src/sap/ui/mdc/messagebundle_en.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_en_GB.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_en_US_sappsd.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_en_US_saprigi.properties +68 -9
- package/src/sap/ui/mdc/messagebundle_en_US_saptrc.properties +41 -7
- package/src/sap/ui/mdc/messagebundle_es.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_es_MX.properties +41 -7
- package/src/sap/ui/mdc/messagebundle_et.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_fi.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_fr.properties +41 -7
- package/src/sap/ui/mdc/messagebundle_fr_CA.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_hi.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_hr.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_hu.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_id.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_it.properties +41 -7
- package/src/sap/ui/mdc/messagebundle_iw.properties +39 -5
- package/src/sap/ui/mdc/messagebundle_ja.properties +41 -7
- package/src/sap/ui/mdc/messagebundle_kk.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_ko.properties +39 -5
- package/src/sap/ui/mdc/messagebundle_lt.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_lv.properties +44 -10
- package/src/sap/ui/mdc/messagebundle_ms.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_nl.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_no.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_pl.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_pt.properties +41 -7
- package/src/sap/ui/mdc/messagebundle_pt_PT.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_ro.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_ru.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_sh.properties +43 -9
- package/src/sap/ui/mdc/messagebundle_sk.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_sl.properties +41 -7
- package/src/sap/ui/mdc/messagebundle_sv.properties +41 -7
- package/src/sap/ui/mdc/messagebundle_th.properties +43 -9
- package/src/sap/ui/mdc/messagebundle_tr.properties +41 -7
- package/src/sap/ui/mdc/messagebundle_uk.properties +43 -9
- package/src/sap/ui/mdc/messagebundle_vi.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_zh_CN.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_zh_TW.properties +40 -6
- package/src/sap/ui/mdc/mixin/AdaptationMixin.js +24 -15
- 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 +354 -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/FieldBaseDelegate.js +8 -6
- 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 +32 -69
- package/src/sap/ui/mdc/odata/v4/TypeUtil.js +2 -4
- package/src/sap/ui/mdc/odata/v4/ValueHelpDelegate.js +65 -5
- package/src/sap/ui/mdc/odata/v4/vizChart/ChartDelegate.js +412 -326
- package/src/sap/ui/mdc/p13n/AdaptationProvider.js +1 -1
- package/src/sap/ui/mdc/p13n/Engine.js +169 -66
- package/src/sap/ui/mdc/p13n/FlexUtil.js +26 -19
- package/src/sap/ui/mdc/p13n/P13nBuilder.js +6 -6
- package/src/sap/ui/mdc/p13n/PropertyHelper.js +2 -2
- package/src/sap/ui/mdc/p13n/StateUtil.js +34 -51
- package/src/sap/ui/mdc/p13n/UIManager.js +21 -14
- package/src/sap/ui/mdc/p13n/modification/ModificationHandler.js +0 -174
- package/src/sap/ui/mdc/p13n/modules/DefaultProviderRegistry.js +2 -2
- package/src/sap/ui/mdc/p13n/modules/xConfigAPI.js +219 -0
- 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 +76 -16
- 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/AggregateController.js +2 -2
- package/src/sap/ui/mdc/p13n/subcontroller/BaseController.js +30 -2
- package/src/sap/ui/mdc/p13n/subcontroller/ChartTypeController.js +46 -0
- package/src/sap/ui/mdc/p13n/subcontroller/ColumnWidthController.js +37 -6
- package/src/sap/ui/mdc/p13n/subcontroller/FilterController.js +40 -12
- package/src/sap/ui/mdc/p13n/subcontroller/GroupController.js +9 -2
- package/src/sap/ui/mdc/p13n/subcontroller/LinkPanelController.js +1 -0
- package/src/sap/ui/mdc/p13n/subcontroller/SortController.js +4 -4
- package/src/sap/ui/mdc/table/Column.js +271 -132
- 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 +71 -95
- package/src/sap/ui/mdc/table/ResponsiveTableType.js +121 -40
- 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/TableSettings.js +10 -22
- package/src/sap/ui/mdc/table/V4AnalyticsPropertyHelper.js +2 -2
- package/src/sap/ui/mdc/table/menu/Item.js +78 -0
- package/src/sap/ui/mdc/table/menu/ItemContainer.js +60 -0
- package/src/sap/ui/mdc/table/menu/QuickActionContainer.js +151 -0
- package/src/sap/ui/mdc/themes/base/Chart.less +6 -0
- package/src/sap/ui/mdc/themes/base/TokenDisplay.less +89 -0
- package/src/sap/ui/mdc/themes/base/TokenizerDisplay.less +90 -0
- package/src/sap/ui/mdc/themes/base/ValueHelpDialog.less +4 -3
- package/src/sap/ui/mdc/themes/base/library.source.less +2 -0
- package/src/sap/ui/mdc/ui/Container.js +0 -240
- package/src/sap/ui/mdc/util/DateUtil.js +32 -7
- package/src/sap/ui/mdc/util/FilterUtil.js +2 -2
- package/src/sap/ui/mdc/util/FormatUtil.js +2 -2
- package/src/sap/ui/mdc/util/IdentifierUtil.js +7 -7
- package/src/sap/ui/mdc/util/PromiseCache.js +6 -2
- package/src/sap/ui/mdc/util/PropertyHelper.js +205 -76
- package/src/sap/ui/mdc/util/TypeUtil.js +1 -1
- package/src/sap/ui/mdc/valuehelp/Dialog.js +234 -44
- package/src/sap/ui/mdc/valuehelp/Popover.js +7 -4
- package/src/sap/ui/mdc/valuehelp/base/Container.js +63 -48
- package/src/sap/ui/mdc/valuehelp/base/Content.js +35 -16
- package/src/sap/ui/mdc/valuehelp/base/DialogTab.js +1 -1
- package/src/sap/ui/mdc/valuehelp/base/FilterableListContent.js +161 -284
- package/src/sap/ui/mdc/valuehelp/base/ListContent.js +4 -4
- package/src/sap/ui/mdc/valuehelp/content/Bool.js +4 -4
- package/src/sap/ui/mdc/valuehelp/content/Conditions.js +4 -4
- package/src/sap/ui/mdc/valuehelp/content/FixedList.js +16 -13
- package/src/sap/ui/mdc/valuehelp/content/ListCollection.js +205 -0
- package/src/sap/ui/mdc/valuehelp/content/MDCTable.js +67 -66
- package/src/sap/ui/mdc/valuehelp/content/MTable.js +94 -185
- package/test/sap/ui/mdc/testutils/opa/TestLibrary.js +2 -1
- package/test/sap/ui/mdc/testutils/opa/chart/TestObjects.js +6 -5
- package/test/sap/ui/mdc/testutils/opa/chartNew/TestObjects.js +4 -5
- package/test/sap/ui/mdc/testutils/opa/filterbar/TestObjects.js +8 -9
- package/test/sap/ui/mdc/testutils/opa/link/TestObjects.js +8 -8
- package/test/sap/ui/mdc/testutils/opa/p13n/Actions.js +43 -27
- package/test/sap/ui/mdc/testutils/opa/valueHelp/Actions.js +54 -0
- package/test/sap/ui/mdc/testutils/opa/valueHelp/Assertions.js +5 -0
- package/test/sap/ui/mdc/testutils/opa/valueHelp/TestObjects.js +40 -0
- package/test/sap/ui/mdc/testutils/opa/valueHelp/Util.js +28 -0
- package/src/sap/ui/mdc/filterbar/vh/GenericFilterBarDelegate.js +0 -150
- package/src/sap/ui/mdc/link/ContactDetails.control.xml +0 -29
- package/src/sap/ui/mdc/link/Panel.control.xml +0 -36
- package/src/sap/ui/mdc/link/PanelListItem.control.xml +0 -24
- package/src/sap/ui/mdc/link/PanelListItem.js +0 -101
- 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/ContainerItem.js +0 -79
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
|
+
* (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
sap.ui.define(["sap/base/util/Deferred", "sap/ui/mdc/util/loadModules", "sap/base/Log"], function (Deferred, loadModules, Log) {
|
|
8
|
+
"use strict";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Enhances a given control prototype with consolidated asynchronous handling for providing a PropertyHelper
|
|
12
|
+
*
|
|
13
|
+
* The following methods are available:
|
|
14
|
+
*
|
|
15
|
+
* <ul>
|
|
16
|
+
* <li><code>initPropertyHelper</code> - Loads and initializes the property helper related to the enhanced control.</li>
|
|
17
|
+
* <li><code>awaitPropertyHelper</code> - Provides access to the property helper initialization <code>Promise</code>.</li>
|
|
18
|
+
* <li><code>finalizePropertyHelper</code> - Finalizes the propertyHelper fetching all available propertyInfo via a given control delegate.</li>
|
|
19
|
+
* <li><code>isPropertyHelperFinal</code> - Indicates if the propertyHelper for this control allready contains all available propertyInfo.</li>
|
|
20
|
+
* <li><code>getPropertyHelper</code> - Returns the property helper instance, if available.</li>
|
|
21
|
+
* </ul>
|
|
22
|
+
*
|
|
23
|
+
* Additionally, the following methods are wrapped:
|
|
24
|
+
*
|
|
25
|
+
* <ul>
|
|
26
|
+
* <li><code>applySettings</code></li>
|
|
27
|
+
* <li><code>exit</code></li>
|
|
28
|
+
* <li><code>init</code></li>
|
|
29
|
+
* </ul>
|
|
30
|
+
*
|
|
31
|
+
* @author SAP SE
|
|
32
|
+
* @version 1.101.0
|
|
33
|
+
* @alias sap.ui.mdc.mixin.PropertyHelperMixin
|
|
34
|
+
* @namespace
|
|
35
|
+
* @since 1.100.0
|
|
36
|
+
* @private
|
|
37
|
+
* @experimental
|
|
38
|
+
* @ui5-restricted sap.ui.mdc
|
|
39
|
+
*/
|
|
40
|
+
var PropertyHelperMixin = {};
|
|
41
|
+
|
|
42
|
+
PropertyHelperMixin.init = function (fnInit) {
|
|
43
|
+
return function () {
|
|
44
|
+
|
|
45
|
+
this._oPropertyHelper = null;
|
|
46
|
+
this._oPropertyHelperDeferred = new Deferred();
|
|
47
|
+
this._oApplySettingsDeferred = new Deferred();
|
|
48
|
+
|
|
49
|
+
this._bPropertyHelperFinal = false;
|
|
50
|
+
this._bPropertyHelperInitializing = false;
|
|
51
|
+
this._sPropertyInfoStore = null;
|
|
52
|
+
|
|
53
|
+
if (fnInit) {
|
|
54
|
+
fnInit.apply(this, arguments);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
PropertyHelperMixin.applySettings = function (fnApplySettings) {
|
|
61
|
+
return function () {
|
|
62
|
+
if (fnApplySettings) {
|
|
63
|
+
fnApplySettings.apply(this, arguments);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// initialize propertyHelper also, when store is initially empty
|
|
67
|
+
if (this._sPropertyInfoStore && (!arguments[0] || !arguments[0].hasOwnProperty(this._sPropertyInfoStore))) {
|
|
68
|
+
_createOrUpdatePropertyHelper.call(this, [], false);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
this._oApplySettingsDeferred.resolve(this); // We want to make sure all other initial properties are set before initializing propertyHelper (e.g. delegate)
|
|
72
|
+
return this;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Loads and initializes the property helper related to the enhanced control.
|
|
78
|
+
*
|
|
79
|
+
* @protected
|
|
80
|
+
* @param {sap.ui.mdc.util.PropertyHelper} [PropertyHelperClass] Custom property helper class
|
|
81
|
+
* @param {object[]} [aProperties] optional set of initial properties
|
|
82
|
+
* @param {object[]} [bFinal] flag for mark the propertyHelper as final
|
|
83
|
+
* @returns {Promise<sap.ui.mdc.util.PropertyHelper>} Returns a <code>Promise</code> that resolves with the property helper
|
|
84
|
+
*/
|
|
85
|
+
PropertyHelperMixin.initPropertyHelper = function(PropertyHelperClass, aProperties, bFinal) {
|
|
86
|
+
if (PropertyHelperClass) {
|
|
87
|
+
this._setPropertyHelperClass(PropertyHelperClass);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return _createOrUpdatePropertyHelper.call(this, aProperties, bFinal);
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Provide a new set of properties for the propertyHelper.
|
|
95
|
+
*
|
|
96
|
+
* @protected
|
|
97
|
+
* @param {object[]} [aProperties] optional set of initial properties
|
|
98
|
+
* @param {object[]} [bFinal] flag for mark the propertyHelper as final
|
|
99
|
+
* @returns {Promise<sap.ui.mdc.util.PropertyHelper>} Returns a <code>Promise</code> that resolves with the property helper
|
|
100
|
+
* @throws exception if propertyHelper is already marked as final
|
|
101
|
+
*/
|
|
102
|
+
PropertyHelperMixin.updatePropertyHelper = function(aProperties, bFinal) {
|
|
103
|
+
return _createOrUpdatePropertyHelper.call(this, aProperties, bFinal);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Finalize the propertyHelper using the control's delegate.
|
|
108
|
+
*
|
|
109
|
+
* @protected
|
|
110
|
+
* @param {object[]} [aProperties] optional set of initial properties
|
|
111
|
+
* @param {object[]} [bFinal] flag for mark the propertyHelper as final
|
|
112
|
+
* @returns {Promise<sap.ui.mdc.util.PropertyHelper>} Returns a <code>Promise</code> that resolves with the property helper
|
|
113
|
+
*/
|
|
114
|
+
PropertyHelperMixin.finalizePropertyHelper = function() {
|
|
115
|
+
this._pHelperFinalizationPromise = this._pHelperFinalizationPromise || _getDelegateProperties(this).then(function (aResult) {
|
|
116
|
+
return _createOrUpdatePropertyHelper.call(this, aResult, true);
|
|
117
|
+
}.bind(this));
|
|
118
|
+
return this._pHelperFinalizationPromise;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Indicates if the control's propertyHelper already contains all available properties
|
|
123
|
+
*
|
|
124
|
+
* @protected
|
|
125
|
+
* @returns {boolean} Returns a <code>boolean</code> indicating the propertyHelper's final state
|
|
126
|
+
*/
|
|
127
|
+
PropertyHelperMixin.isPropertyHelperFinal = function() {
|
|
128
|
+
return this._bPropertyHelperFinal;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Provides access to the property helper initialization <code>Promise</code>.
|
|
133
|
+
*
|
|
134
|
+
* @protected
|
|
135
|
+
* @returns {Promise<sap.ui.mdc.util.PropertyHelper>} Returns a <code>Promise</code> that resolves with the property helper
|
|
136
|
+
*/
|
|
137
|
+
PropertyHelperMixin.awaitPropertyHelper = function() {
|
|
138
|
+
return this._oPropertyHelperDeferred.promise;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Returns the property helper instance, if available.
|
|
143
|
+
*
|
|
144
|
+
* @protected
|
|
145
|
+
* @returns {sap.ui.mdc.util.PropertyHelper} The property helper
|
|
146
|
+
*/
|
|
147
|
+
PropertyHelperMixin.getPropertyHelper = function() {
|
|
148
|
+
return this._oPropertyHelper;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
PropertyHelperMixin.exit = function (fnExit) {
|
|
152
|
+
return function () {
|
|
153
|
+
this._oPropertyHelper = null;
|
|
154
|
+
this._oPropertyHelperDeferred = null;
|
|
155
|
+
this._oApplySettingsDeferred = null;
|
|
156
|
+
this._bPropertyHelperFinal = null;
|
|
157
|
+
this._bPropertyHelperInitializing = null;
|
|
158
|
+
this._pHelperFinalizationPromise = null;
|
|
159
|
+
this._oPropertyHelperClass = null;
|
|
160
|
+
this._sPropertyInfoStore = null;
|
|
161
|
+
|
|
162
|
+
if (this._oPropertyInfoStoreMutatorOverride) {
|
|
163
|
+
this[this._oPropertyInfoStoreMutatorOverride.key] = this._oPropertyInfoStoreMutatorOverride.mutator;
|
|
164
|
+
this._oPropertyInfoStoreMutatorOverride = null;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
if (fnExit) {
|
|
168
|
+
fnExit.apply(this, arguments);
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Controls may provide a property identifier representing a propertyInfo store for this control.
|
|
175
|
+
* This should be called as early as possible as the given property's mutator is overriden.
|
|
176
|
+
* @private
|
|
177
|
+
* @param {string} sPropertyName Name of the property containing propertyInfo for this control
|
|
178
|
+
*
|
|
179
|
+
*/
|
|
180
|
+
PropertyHelperMixin._setupPropertyInfoStore = function(sPropertyName) {
|
|
181
|
+
var oProperties = this.getMetadata().getAllProperties();
|
|
182
|
+
var oPropertyInfoProperty = oProperties && oProperties[sPropertyName];
|
|
183
|
+
if (!oPropertyInfoProperty) {
|
|
184
|
+
throw new Error("PropertyHelperMixin: Property '" + sPropertyName + "' not found.");
|
|
185
|
+
}
|
|
186
|
+
var oJSONKeys = this.getMetadata().getJSONKeys()[sPropertyName];
|
|
187
|
+
this._oPropertyInfoStoreMutatorOverride = {key: oJSONKeys._sMutator, mutator: this[oJSONKeys._sMutator]};
|
|
188
|
+
|
|
189
|
+
this[oJSONKeys._sMutator] = function () {
|
|
190
|
+
this._oPropertyInfoStoreMutatorOverride.mutator.apply(this, arguments);
|
|
191
|
+
if (!this._bPropertyHelperFinal) {
|
|
192
|
+
_createOrUpdatePropertyHelper.call(this, this[oJSONKeys._sGetter](), false);
|
|
193
|
+
}
|
|
194
|
+
return this;
|
|
195
|
+
};
|
|
196
|
+
this._sPropertyInfoStore = sPropertyName;
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
// Should ideally be called already during init for controls featuring a propertyInfo property (auto-initalization of PH after applySettings).
|
|
200
|
+
PropertyHelperMixin._setPropertyHelperClass = function (PropertyHelperClass) {
|
|
201
|
+
if (this._oPropertyHelper || this._bPropertyHelperInitializing) {
|
|
202
|
+
throw new Error("PropertyHelper already initializing/ed.");
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
if (PropertyHelperClass && (!PropertyHelperClass.getMetadata || !PropertyHelperClass.getMetadata().isA("sap.ui.mdc.util.PropertyHelper"))) {
|
|
206
|
+
throw new Error("The custom property helper class must be sap.ui.mdc.util.PropertyHelper or a subclass of it.");
|
|
207
|
+
}
|
|
208
|
+
this._oPropertyHelperClass = PropertyHelperClass;
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
PropertyHelperMixin._getPropertyByName = function(sName) {
|
|
212
|
+
return this._oPropertyHelper && this._oPropertyHelper.getProperty(sName);
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
PropertyHelperMixin._getPropertyByNameAsync = function(sName) {
|
|
216
|
+
var oProperty = this._oPropertyHelper && this._oPropertyHelper.getProperty(sName);
|
|
217
|
+
|
|
218
|
+
if (!oProperty) {
|
|
219
|
+
return this.finalizePropertyHelper().then(function (oPropertyHelper) {
|
|
220
|
+
return oPropertyHelper.getProperty(sName);
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
return Promise.resolve(oProperty);
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
function _createOrUpdatePropertyHelper(aProperties, bFinal) {
|
|
227
|
+
if (!this.bIsDestroyed) {
|
|
228
|
+
if (this._bPropertyHelperInitializing && typeof aProperties !== "undefined") {
|
|
229
|
+
return this._oPropertyHelperDeferred.promise.then(function () {
|
|
230
|
+
return _updatePropertyHelper.call(this, aProperties, bFinal);
|
|
231
|
+
}.bind(this));
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
if (this._oPropertyHelper && typeof aProperties !== "undefined") {
|
|
235
|
+
_updatePropertyHelper.call(this, aProperties, bFinal);
|
|
236
|
+
}
|
|
237
|
+
if (!this._oPropertyHelper) {
|
|
238
|
+
_createPropertyHelper.call(this, aProperties, bFinal);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return this._oPropertyHelperDeferred && this._oPropertyHelperDeferred.promise;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
function _createPropertyHelper (aProperties, bFinal) {
|
|
245
|
+
this._bPropertyHelperInitializing = true;
|
|
246
|
+
|
|
247
|
+
if (bFinal || !aProperties) { // also fall back to delegate if no initial properties given
|
|
248
|
+
bFinal = true;
|
|
249
|
+
this._pHelperFinalizationPromise = this._oPropertyHelperDeferred.promise;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
var oDelegate;
|
|
253
|
+
|
|
254
|
+
// we need to initialize the delegate for extensions or ph overrides first
|
|
255
|
+
return this._oApplySettingsDeferred.promise.then(function () {
|
|
256
|
+
return this.initControlDelegate();
|
|
257
|
+
}.bind(this)).then(function (oControlDelegate) {
|
|
258
|
+
oDelegate = oControlDelegate;
|
|
259
|
+
return bFinal ? _getDelegateProperties(this) : aProperties;
|
|
260
|
+
}.bind(this)).then(function(aProperties) {
|
|
261
|
+
if (this.bIsDestroyed) {
|
|
262
|
+
return [];
|
|
263
|
+
}
|
|
264
|
+
var aResult = [aProperties];
|
|
265
|
+
if (oDelegate && typeof oDelegate.fetchPropertyExtensions === "function") {
|
|
266
|
+
return oDelegate.fetchPropertyExtensions(this, aProperties).then(function(mExtensions) {
|
|
267
|
+
return aResult.concat(mExtensions);
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
return aResult.concat(undefined);
|
|
271
|
+
}.bind(this)).then(function(aResult) {
|
|
272
|
+
if (this.bIsDestroyed) {
|
|
273
|
+
return [];
|
|
274
|
+
}
|
|
275
|
+
return fetchPropertyHelperClass(this, oDelegate, aResult[0], aResult[1]).then(function(PropertyHelper) {
|
|
276
|
+
return aResult.concat(PropertyHelper);
|
|
277
|
+
});
|
|
278
|
+
}.bind(this)).then(function(aResult) {
|
|
279
|
+
if (this.bIsDestroyed) {
|
|
280
|
+
return undefined;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
var aProperties = aResult[0];
|
|
284
|
+
var mExtensions = aResult[1];
|
|
285
|
+
var PropertyHelper = aResult[2];
|
|
286
|
+
this._oPropertyHelper = new PropertyHelper(aProperties, mExtensions, this, undefined, undefined);
|
|
287
|
+
this._bPropertyHelperInitializing = false;
|
|
288
|
+
if (bFinal) {
|
|
289
|
+
this._bPropertyHelperFinal = true;
|
|
290
|
+
}
|
|
291
|
+
return this._oPropertyHelperDeferred.resolve(this._oPropertyHelper);
|
|
292
|
+
}.bind(this)).catch(function (oError) {
|
|
293
|
+
return this._oPropertyHelperDeferred && this._oPropertyHelperDeferred.reject(oError);
|
|
294
|
+
}.bind(this));
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
function _updatePropertyHelper(aProperties, bFinal) {
|
|
298
|
+
if (this._bPropertyHelperFinal) {
|
|
299
|
+
throw new Error("This property helper is already final and cannot be updated further.");
|
|
300
|
+
}
|
|
301
|
+
this._oPropertyHelper.setProperties(aProperties);
|
|
302
|
+
this._bPropertyHelperFinal = bFinal || this._bPropertyHelperFinal;
|
|
303
|
+
return this._oPropertyHelper;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
// use delegate for final properties
|
|
307
|
+
function _getDelegateProperties (oControl) {
|
|
308
|
+
return oControl.initControlDelegate().then(function () {
|
|
309
|
+
return oControl.getControlDelegate(oControl).fetchProperties(oControl); // not using arg as some unit tests override "getControlDelegate"
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
function fetchPropertyHelperClass(oControl, oDelegate, aProperties) {
|
|
316
|
+
if (oDelegate && typeof oDelegate.getPropertyHelperClass === "function") {
|
|
317
|
+
var oDelegatePropertyHelperClass = oDelegate.getPropertyHelperClass();
|
|
318
|
+
var sBaseClass = oControl._oPropertyHelperClass ? oControl._oPropertyHelperClass.getMetadata().getName() : "sap.ui.mdc.util.PropertyHelper";
|
|
319
|
+
|
|
320
|
+
if (!oDelegatePropertyHelperClass || !oDelegatePropertyHelperClass.getMetadata || !oDelegatePropertyHelperClass.getMetadata().isA(sBaseClass)) {
|
|
321
|
+
throw new Error("The property helper class must be " + sBaseClass + " or a subclass of it.");
|
|
322
|
+
}
|
|
323
|
+
return Promise.resolve(oDelegatePropertyHelperClass);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
if (oControl._oPropertyHelperClass) {
|
|
327
|
+
return Promise.resolve(oControl._oPropertyHelperClass);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
return loadModules("sap/ui/mdc/util/PropertyHelper").then(function(aResult) {
|
|
331
|
+
return aResult[0];
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
return function () {
|
|
336
|
+
this.init = PropertyHelperMixin.init(this.init);
|
|
337
|
+
this.exit = PropertyHelperMixin.exit(this.exit);
|
|
338
|
+
this.applySettings = PropertyHelperMixin.applySettings(this.applySettings);
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
this.initPropertyHelper = PropertyHelperMixin.initPropertyHelper;
|
|
342
|
+
this.awaitPropertyHelper = PropertyHelperMixin.awaitPropertyHelper;
|
|
343
|
+
this.getPropertyHelper = PropertyHelperMixin.getPropertyHelper;
|
|
344
|
+
|
|
345
|
+
this.finalizePropertyHelper = PropertyHelperMixin.finalizePropertyHelper;
|
|
346
|
+
this.isPropertyHelperFinal = PropertyHelperMixin.isPropertyHelperFinal;
|
|
347
|
+
|
|
348
|
+
this._getPropertyByName = PropertyHelperMixin._getPropertyByName;
|
|
349
|
+
this._getPropertyByNameAsync = PropertyHelperMixin._getPropertyByNameAsync;
|
|
350
|
+
this._setPropertyHelperClass = PropertyHelperMixin._setPropertyHelperClass;
|
|
351
|
+
this._setupPropertyInfoStore = PropertyHelperMixin._setupPropertyInfoStore;
|
|
352
|
+
|
|
353
|
+
};
|
|
354
|
+
});
|
|
@@ -29,7 +29,7 @@ sap.ui.define([
|
|
|
29
29
|
*
|
|
30
30
|
* Falls back to 'object' if type cannot be found.
|
|
31
31
|
*
|
|
32
|
-
* @param {string}
|
|
32
|
+
* @param {string} sDataType Given model specific type
|
|
33
33
|
* @returns {string} primitive type name
|
|
34
34
|
*/
|
|
35
35
|
getPrimitiveType: function (sDataType) {
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
|
-
"sap/ui/mdc/chart/PropertyHelper"
|
|
8
|
+
"sap/ui/mdc/chart/PropertyHelper",
|
|
9
|
+
"sap/ui/mdc/library"
|
|
9
10
|
], function(
|
|
10
|
-
PropertyHelperBase
|
|
11
|
+
PropertyHelperBase,
|
|
12
|
+
MDCLib
|
|
11
13
|
) {
|
|
12
14
|
"use strict";
|
|
13
15
|
|
|
@@ -25,7 +27,7 @@ sap.ui.define([
|
|
|
25
27
|
* @extends sap.ui.mdc.chart.PropertyHelper
|
|
26
28
|
*
|
|
27
29
|
* @author SAP SE
|
|
28
|
-
* @version 1.
|
|
30
|
+
* @version 1.101.0
|
|
29
31
|
*
|
|
30
32
|
* @private
|
|
31
33
|
* @experimental
|
|
@@ -35,5 +37,70 @@ sap.ui.define([
|
|
|
35
37
|
*/
|
|
36
38
|
var PropertyHelper = PropertyHelperBase.extend("sap.ui.mdc.odata.v4.ChartPropertyHelper");
|
|
37
39
|
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Applies defaults and resolves property references.
|
|
43
|
+
*
|
|
44
|
+
* @param {object} oProperty The property to prepare
|
|
45
|
+
* @protected
|
|
46
|
+
*/
|
|
47
|
+
PropertyHelper.prototype.prepareProperty = function(oProperty) {
|
|
48
|
+
|
|
49
|
+
if (oProperty.groupable) {
|
|
50
|
+
oProperty.availableRoles = this._getLayoutOptionsForType("groupable");
|
|
51
|
+
oProperty.kind = "Groupable";
|
|
52
|
+
} else if (oProperty.aggregatable) {
|
|
53
|
+
oProperty.availableRoles = this._getLayoutOptionsForType("aggregatable");
|
|
54
|
+
oProperty.kind = "Aggregatable";
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (!oProperty.typeConfig && oProperty.dataType){
|
|
58
|
+
var oFormatOptions = oProperty.formatOptions ? oProperty.formatOptions : null;
|
|
59
|
+
var oConstraints = oProperty.constraints ? oProperty.constraints : {};
|
|
60
|
+
|
|
61
|
+
oProperty.typeConfig = this.getParent().getControlDelegate().getTypeUtil().getTypeConfig(oProperty.dataType, oFormatOptions, oConstraints);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
PropertyHelperBase.prototype.prepareProperty.apply(this, arguments);
|
|
65
|
+
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* This returns the layout options for a specific type of Item (measure/dimension,groupable/aggregatable)
|
|
70
|
+
* It is used by p13n to determine which layout options to show in the p13n panel
|
|
71
|
+
* @param {string} sType the type for which the layout options are requested
|
|
72
|
+
*/
|
|
73
|
+
PropertyHelper.prototype._getLayoutOptionsForType = function(sType){
|
|
74
|
+
var MDCRb = sap.ui.getCore().getLibraryResourceBundle("sap.ui.mdc");
|
|
75
|
+
var oAvailableRoles = {
|
|
76
|
+
groupable: [
|
|
77
|
+
{
|
|
78
|
+
key: MDCLib.ChartItemRoleType.category,
|
|
79
|
+
text: MDCRb.getText('chart.PERSONALIZATION_DIALOG_CHARTROLE_CATEGORY')
|
|
80
|
+
}, {
|
|
81
|
+
key: MDCLib.ChartItemRoleType.category2,
|
|
82
|
+
text: MDCRb.getText('chart.PERSONALIZATION_DIALOG_CHARTROLE_CATEGORY2')
|
|
83
|
+
}, {
|
|
84
|
+
key: MDCLib.ChartItemRoleType.series,
|
|
85
|
+
text: MDCRb.getText('chart.PERSONALIZATION_DIALOG_CHARTROLE_SERIES')
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
aggregatable: [
|
|
89
|
+
{
|
|
90
|
+
key: MDCLib.ChartItemRoleType.axis1,
|
|
91
|
+
text: MDCRb.getText('chart.PERSONALIZATION_DIALOG_CHARTROLE_AXIS1')
|
|
92
|
+
}, {
|
|
93
|
+
key: MDCLib.ChartItemRoleType.axis2,
|
|
94
|
+
text: MDCRb.getText('chart.PERSONALIZATION_DIALOG_CHARTROLE_AXIS2')
|
|
95
|
+
}, {
|
|
96
|
+
key: MDCLib.ChartItemRoleType.axis3,
|
|
97
|
+
text: MDCRb.getText('chart.PERSONALIZATION_DIALOG_CHARTROLE_AXIS3')
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
};
|
|
101
|
+
return oAvailableRoles[sType];
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
|
|
38
105
|
return PropertyHelper;
|
|
39
106
|
});
|
|
@@ -19,17 +19,19 @@ sap.ui.define([
|
|
|
19
19
|
"use strict";
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* Delegate for {@link sap.ui.mdc.field.FieldBase FieldBase}.<br>
|
|
23
23
|
* <h3><b>Note:</b></h3>
|
|
24
24
|
* The class is experimental and the API/behaviour is not finalized and hence this should not be used for productive usage.
|
|
25
25
|
*
|
|
26
|
+
* @namespace
|
|
26
27
|
* @author SAP SE
|
|
27
28
|
* @private
|
|
28
29
|
* @ui5-restricted sap.fe
|
|
29
30
|
* @MDC_PUBLIC_CANDIDATE
|
|
30
31
|
* @experimental As of version 1.74
|
|
31
32
|
* @since 1.74.0
|
|
32
|
-
* @
|
|
33
|
+
* @extends module:sap/ui/mdc/field/FieldBaseDelegate
|
|
34
|
+
* @alias module:sap/ui/mdc/odata/v4/FieldBaseDelegate
|
|
33
35
|
*/
|
|
34
36
|
var ODataFieldBaseDelegate = Object.assign({}, FieldBaseDelegate);
|
|
35
37
|
|
|
@@ -93,11 +95,11 @@ sap.ui.define([
|
|
|
93
95
|
|
|
94
96
|
};
|
|
95
97
|
|
|
96
|
-
ODataFieldBaseDelegate.enhanceValueForUnit = function(oPayload,
|
|
98
|
+
ODataFieldBaseDelegate.enhanceValueForUnit = function(oPayload, aValues, oTypeInitialization) {
|
|
97
99
|
|
|
98
|
-
if (oTypeInitialization && oTypeInitialization.bTypeInitialized &&
|
|
99
|
-
|
|
100
|
-
return
|
|
100
|
+
if (oTypeInitialization && oTypeInitialization.bTypeInitialized && aValues.length === 2) {
|
|
101
|
+
aValues.push(oTypeInitialization.mCustomUnits);
|
|
102
|
+
return aValues;
|
|
101
103
|
}
|
|
102
104
|
|
|
103
105
|
};
|
|
@@ -44,9 +44,7 @@ sap.ui.define([
|
|
|
44
44
|
"Edm.Time": "TimeOfDay"
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
var
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
var InstanceCache = new Map();
|
|
50
48
|
|
|
51
49
|
ODataFilterBarDelegate._fetchPropertiesByMetadata = function(oControl, mPropertyBag) {
|
|
52
50
|
|
|
@@ -92,7 +90,7 @@ sap.ui.define([
|
|
|
92
90
|
}
|
|
93
91
|
};
|
|
94
92
|
|
|
95
|
-
return mPropertyBag ? this.fetchProperties(oObj) : oControl.
|
|
93
|
+
return mPropertyBag ? this.fetchProperties(oObj) : Promise.resolve(oControl.getPropertyHelper().getProperties());
|
|
96
94
|
}.bind(this));
|
|
97
95
|
};
|
|
98
96
|
|
|
@@ -246,6 +244,109 @@ sap.ui.define([
|
|
|
246
244
|
return Promise.resolve(this._createFilter(sPropertyName, oFilterBar, mPropertyBag));
|
|
247
245
|
};
|
|
248
246
|
|
|
247
|
+
|
|
248
|
+
ODataFilterBarDelegate._getInstanceCacheEntry = function(oControl, sKey) {
|
|
249
|
+
var sId = oControl.getId && oControl.getId() || oControl.id;
|
|
250
|
+
var oCacheEntry = InstanceCache.get(sId);
|
|
251
|
+
return oCacheEntry && oCacheEntry[sKey];
|
|
252
|
+
};
|
|
253
|
+
ODataFilterBarDelegate._setInstanceCacheEntry = function(oControl, sKey, oValue) {
|
|
254
|
+
var sId = oControl.getId && oControl.getId() || oControl.id;
|
|
255
|
+
var oCacheEntry = InstanceCache.get(sId) || {};
|
|
256
|
+
oCacheEntry[sKey] = oValue;
|
|
257
|
+
InstanceCache.set(sId, oCacheEntry);
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
ODataFilterBarDelegate._addPropertyInfoEntry = function(oControl, sPropertyName, aPropertyInfo, aFetchedProperties, oModifier) {
|
|
261
|
+
|
|
262
|
+
if (aFetchedProperties) {
|
|
263
|
+
var nIdx = aFetchedProperties.findIndex(function(oEntry) {
|
|
264
|
+
return oEntry.name === sPropertyName;
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
if (nIdx >= 0) {
|
|
268
|
+
aPropertyInfo.push({
|
|
269
|
+
name: sPropertyName,
|
|
270
|
+
dataType: aFetchedProperties[nIdx].typeConfig.className,
|
|
271
|
+
maxConditions: aFetchedProperties[nIdx].maxConditions,
|
|
272
|
+
constraints: aFetchedProperties[nIdx].constraints,
|
|
273
|
+
formatOption: aFetchedProperties[nIdx].formatOptions,
|
|
274
|
+
required: aFetchedProperties[nIdx].required,
|
|
275
|
+
caseSensitive: aFetchedProperties[nIdx].caseSensitive,
|
|
276
|
+
display: aFetchedProperties[nIdx].display,
|
|
277
|
+
label: aFetchedProperties[nIdx].label,
|
|
278
|
+
hiddenFilter: aFetchedProperties[nIdx].hiddenFilter
|
|
279
|
+
});
|
|
280
|
+
oModifier.setProperty(oControl, "propertyInfo", aPropertyInfo);
|
|
281
|
+
} else {
|
|
282
|
+
Log.error("ConditionFlex-ChangeHandler: no type info for property '" + sPropertyName + "'");
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
ODataFilterBarDelegate._updatePropertyInfo = function(sPropertyName, oFilterBar, mPropertyBag) {
|
|
289
|
+
|
|
290
|
+
if (oFilterBar.isA && oFilterBar.isA("sap.ui.mdc.FilterBar")) {
|
|
291
|
+
return Promise.resolve();
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
var oModifier = mPropertyBag.modifier;
|
|
295
|
+
|
|
296
|
+
return oModifier.getProperty(oFilterBar, "propertyInfo")
|
|
297
|
+
.then(function(aPropertyInfo) {
|
|
298
|
+
if (!aPropertyInfo) {
|
|
299
|
+
return Promise.resolve();
|
|
300
|
+
}
|
|
301
|
+
var nIdx = aPropertyInfo.findIndex(function(oEntry) {
|
|
302
|
+
return oEntry.name === sPropertyName;
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
if (nIdx < 0) {
|
|
306
|
+
|
|
307
|
+
var aFetchedProperties = ODataFilterBarDelegate._getInstanceCacheEntry(oFilterBar, "fetchedProperties");
|
|
308
|
+
if (aFetchedProperties) {
|
|
309
|
+
ODataFilterBarDelegate._addPropertyInfoEntry(oFilterBar, sPropertyName, aPropertyInfo, aFetchedProperties, oModifier);
|
|
310
|
+
} else {
|
|
311
|
+
//fetch
|
|
312
|
+
return ODataFilterBarDelegate.fetchProperties(oFilterBar, mPropertyBag)
|
|
313
|
+
.then(function(aProperties) {
|
|
314
|
+
ODataFilterBarDelegate._setInstanceCacheEntry(oFilterBar, "fetchedProperties", aProperties);
|
|
315
|
+
ODataFilterBarDelegate._addPropertyInfoEntry(oFilterBar, sPropertyName, aPropertyInfo, aProperties, oModifier);
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* This methods is called during the appliance of the add condition change.
|
|
325
|
+
* This intention is to update the propertyInfo property.
|
|
326
|
+
*
|
|
327
|
+
* @param {string} sPropertyName The name of a property.
|
|
328
|
+
* @param {sap.ui.mdc.FilterBar} oFilterBar - the instance of filter bar
|
|
329
|
+
* @param {Object} mPropertyBag Instance of property bag from Flex change API
|
|
330
|
+
* @returns {Promise} Promise that resolves once the properyInfo property was updated
|
|
331
|
+
*/
|
|
332
|
+
ODataFilterBarDelegate.addCondition = function(sPropertyName, oFilterBar, mPropertyBag) {
|
|
333
|
+
return ODataFilterBarDelegate._updatePropertyInfo(sPropertyName, oFilterBar, mPropertyBag);
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* This methods is called during the appliance of the remove condition change.
|
|
338
|
+
* This intention is to update the propertyInfo property.
|
|
339
|
+
*
|
|
340
|
+
* @param {string} sPropertyName The name of a property.
|
|
341
|
+
* @param {sap.ui.mdc.FilterBar} oFilterBar - the instance of filter bar
|
|
342
|
+
* @param {Object} mPropertyBag Instance of property bag from Flex change API
|
|
343
|
+
* @returns {Promise} Promise that resolves once the properyInfo property was updated
|
|
344
|
+
*/
|
|
345
|
+
ODataFilterBarDelegate.removeCondition = function(sPropertyName, oFilterBar, mPropertyBag) {
|
|
346
|
+
return ODataFilterBarDelegate._updatePropertyInfo(sPropertyName, oFilterBar, mPropertyBag);
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
|
|
249
350
|
/**
|
|
250
351
|
* Can be used to trigger any necessary follow-up steps on removal of filter items. The returned boolean value inside the Promise can be used to
|
|
251
352
|
* prevent default follow-up behaviour of Flex.
|
|
@@ -560,7 +661,11 @@ sap.ui.define([
|
|
|
560
661
|
* @param {object} oFilterBar - the instance of filter bar
|
|
561
662
|
* @returns {Promise} once resolved an array of property info is returned
|
|
562
663
|
*/
|
|
563
|
-
ODataFilterBarDelegate.fetchProperties = function (oFilterBar) {
|
|
664
|
+
ODataFilterBarDelegate.fetchProperties = function (oFilterBar, mPropertyBag) {
|
|
665
|
+
|
|
666
|
+
if (!(oFilterBar.isA && oFilterBar.isA("sap.ui.mdc.FilterBar")) && mPropertyBag) {
|
|
667
|
+
return ODataFilterBarDelegate._fetchPropertiesByMetadata(oFilterBar, mPropertyBag);
|
|
668
|
+
}
|
|
564
669
|
|
|
565
670
|
var sModelName = oFilterBar.getDelegate().payload.modelName;
|
|
566
671
|
var sEntitySet = oFilterBar.getDelegate().payload.collectionName;
|
|
@@ -569,9 +674,9 @@ sap.ui.define([
|
|
|
569
674
|
|
|
570
675
|
var oMetaModel;
|
|
571
676
|
|
|
572
|
-
var
|
|
573
|
-
if (
|
|
574
|
-
resolve(
|
|
677
|
+
var oCachedEntitySet = ODataFilterBarDelegate._getInstanceCacheEntry(oFilterBar, "fetchedProperties");
|
|
678
|
+
if (oCachedEntitySet) {
|
|
679
|
+
resolve(oCachedEntitySet);
|
|
575
680
|
return;
|
|
576
681
|
}
|
|
577
682
|
|
|
@@ -594,7 +699,7 @@ sap.ui.define([
|
|
|
594
699
|
ODataFilterBarDelegate._fetchEntitySet(oMetaModel, '/' + sEntitySet, aVisitedEntityTypes, null, oParamInfo).then(function(aProperties) {
|
|
595
700
|
|
|
596
701
|
if (oParamInfo.parameterNavigationName && (oParamInfo.parameters.length > 0)) {
|
|
597
|
-
|
|
702
|
+
ODataFilterBarDelegate._setInstanceCacheEntry(oFilterBar, sEntitySet + "-Parameters", oParamInfo);
|
|
598
703
|
|
|
599
704
|
//parameters are initially at the top of the result
|
|
600
705
|
aProperties.sort(function(p1, p2) {
|
|
@@ -622,7 +727,7 @@ sap.ui.define([
|
|
|
622
727
|
return mProperties[sName];
|
|
623
728
|
});
|
|
624
729
|
|
|
625
|
-
|
|
730
|
+
ODataFilterBarDelegate._setInstanceCacheEntry(oFilterBar, "fetchedProperties", aProperties);
|
|
626
731
|
resolve(aProperties);
|
|
627
732
|
});
|
|
628
733
|
}
|
|
@@ -633,17 +738,8 @@ sap.ui.define([
|
|
|
633
738
|
}.bind(this));
|
|
634
739
|
};
|
|
635
740
|
|
|
636
|
-
|
|
637
741
|
ODataFilterBarDelegate.cleanup = function (oFilterBar) {
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
Object.keys(mMainEntitySet).forEach(function(sKey){
|
|
641
|
-
if (sKey.indexOf(sFilterBarId) === 0) {
|
|
642
|
-
|
|
643
|
-
delete window[sFilterBarId + sKey + "-Parameters"];
|
|
644
|
-
delete mMainEntitySet[sKey];
|
|
645
|
-
}
|
|
646
|
-
});
|
|
742
|
+
InstanceCache.delete(oFilterBar.getId());
|
|
647
743
|
};
|
|
648
744
|
|
|
649
745
|
ODataFilterBarDelegate.getTypeUtil = function (oPayload) {
|