@openui5/sap.ui.mdc 1.99.1 → 1.102.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/.eslintrc.json +19 -0
- package/THIRDPARTY.txt +5 -5
- 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 +77 -77
- package/src/sap/ui/mdc/ChartDelegate.js +76 -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 +26 -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/LinkDelegate.js +7 -5
- package/src/sap/ui/mdc/MultiValueField.js +11 -1
- package/src/sap/ui/mdc/Table.js +340 -417
- package/src/sap/ui/mdc/TableDelegate.js +115 -35
- package/src/sap/ui/mdc/ValueHelp.js +150 -632
- package/src/sap/ui/mdc/ValueHelpDelegate.js +161 -8
- 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 +18 -6
- package/src/sap/ui/mdc/chart/ChartTypeButton.js +11 -2
- 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 +146 -34
- package/src/sap/ui/mdc/condition/Operator.js +98 -16
- package/src/sap/ui/mdc/condition/OperatorDynamicDateOption.js +80 -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 +16 -1
- 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 +39 -52
- package/src/sap/ui/mdc/enum/PropagationReason.js +43 -0
- package/src/sap/ui/mdc/enum/SelectType.js +3 -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 +70 -22
- package/src/sap/ui/mdc/field/ConditionsType.js +8 -2
- 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 +30 -23
- package/src/sap/ui/mdc/field/DynamicDateRangeConditionsType.js +76 -19
- package/src/sap/ui/mdc/field/FieldBase.js +84 -17
- package/src/sap/ui/mdc/field/FieldBaseDelegate.js +41 -19
- 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 +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 +7 -4
- package/src/sap/ui/mdc/field/FieldValueHelpMdcTableWrapper.js +11 -3
- package/src/sap/ui/mdc/field/FieldValueHelpTableWrapperBase.js +3 -3
- package/src/sap/ui/mdc/field/FieldValueHelpUITableWrapper.js +31 -32
- 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 +13 -1
- package/src/sap/ui/mdc/field/content/DateContent.js +27 -19
- package/src/sap/ui/mdc/field/content/DateTimeContent.js +42 -7
- package/src/sap/ui/mdc/filterbar/FilterBarBase.js +128 -239
- 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 +164 -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 +4 -41
- 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/library.js +30 -27
- 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/Panel.js +197 -22
- 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 +11 -6
- package/src/sap/ui/mdc/messagebundle_ar.properties +9 -7
- package/src/sap/ui/mdc/messagebundle_bg.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_ca.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_cs.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_cy.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_da.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_de.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_el.properties +6 -4
- package/src/sap/ui/mdc/messagebundle_en.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_en_GB.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_en_US_sappsd.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_en_US_saprigi.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_en_US_saptrc.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_es.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_es_MX.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_et.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_fi.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_fr.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_fr_CA.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_hi.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_hr.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_hu.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_id.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_it.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_iw.properties +6 -4
- package/src/sap/ui/mdc/messagebundle_ja.properties +8 -6
- package/src/sap/ui/mdc/messagebundle_kk.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_ko.properties +6 -4
- package/src/sap/ui/mdc/messagebundle_lt.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_lv.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_ms.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_nl.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_no.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_pl.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_pt.properties +13 -11
- package/src/sap/ui/mdc/messagebundle_pt_PT.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_ro.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_ru.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_sh.properties +10 -8
- package/src/sap/ui/mdc/messagebundle_sk.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_sl.properties +8 -6
- package/src/sap/ui/mdc/messagebundle_sv.properties +8 -6
- package/src/sap/ui/mdc/messagebundle_th.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_tr.properties +10 -8
- package/src/sap/ui/mdc/messagebundle_uk.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_vi.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_zh_CN.properties +7 -5
- package/src/sap/ui/mdc/messagebundle_zh_TW.properties +7 -5
- package/src/sap/ui/mdc/mixin/AdaptationMixin.js +23 -29
- 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 +2 -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 +29 -66
- 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 +353 -262
- package/src/sap/ui/mdc/p13n/AdaptationProvider.js +1 -1
- package/src/sap/ui/mdc/p13n/Engine.js +172 -69
- package/src/sap/ui/mdc/p13n/FlexUtil.js +26 -19
- 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 +15 -12
- 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 +75 -15
- package/src/sap/ui/mdc/p13n/panels/FilterPanel.js +160 -0
- package/src/sap/ui/mdc/p13n/panels/GroupView.js +54 -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 +32 -10
- 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 +70 -27
- package/src/sap/ui/mdc/table/PropertyHelper.js +92 -163
- package/src/sap/ui/mdc/table/ResponsiveTableType.js +133 -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 +11 -0
- package/src/sap/ui/mdc/themes/base/ValueHelpDialog.less +1 -0
- package/src/sap/ui/mdc/ui/Container.js +0 -240
- package/src/sap/ui/mdc/util/DateUtil.js +56 -6
- package/src/sap/ui/mdc/util/FilterUtil.js +2 -2
- package/src/sap/ui/mdc/util/IdentifierUtil.js +3 -3
- 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 +291 -66
- package/src/sap/ui/mdc/valuehelp/Popover.js +8 -5
- package/src/sap/ui/mdc/valuehelp/base/Container.js +71 -52
- package/src/sap/ui/mdc/valuehelp/base/Content.js +57 -24
- package/src/sap/ui/mdc/valuehelp/base/DialogTab.js +1 -1
- package/src/sap/ui/mdc/valuehelp/base/FilterableListContent.js +196 -283
- package/src/sap/ui/mdc/valuehelp/base/ListContent.js +6 -6
- 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/MDCTable.js +66 -66
- package/src/sap/ui/mdc/valuehelp/content/MTable.js +100 -185
- package/test/sap/ui/mdc/testutils/opa/chart/ActionsBase.js +48 -2
- 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/Actions.js +55 -4
- package/test/sap/ui/mdc/testutils/opa/filterbar/TestObjects.js +2 -3
- package/test/sap/ui/mdc/testutils/opa/link/Actions.js +53 -12
- package/test/sap/ui/mdc/testutils/opa/link/TestObjects.js +6 -6
- package/test/sap/ui/mdc/testutils/opa/p13n/Actions.js +111 -128
- package/test/sap/ui/mdc/testutils/opa/p13n/waitForSelectWithSelectedTextOnPanel.js +5 -2
- package/test/sap/ui/mdc/testutils/opa/table/Actions.js +70 -0
- package/test/sap/ui/mdc/testutils/opa/table/TestObjects.js +9 -7
- package/test/sap/ui/mdc/testutils/opa/valueHelp/Actions.js +2 -2
- 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
|
@@ -4,28 +4,6 @@
|
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
/*
|
|
9
|
-
TODO: Remove!
|
|
10
|
-
|
|
11
|
-
<ValueHelp>
|
|
12
|
-
<typeahead>
|
|
13
|
-
<valuehelp.Popover useFirstMatch="true">
|
|
14
|
-
<popover.MTableContent><mTable/></popover.MTableContent>
|
|
15
|
-
</valuehelp.Popover>
|
|
16
|
-
</typeahead>
|
|
17
|
-
<dialog>
|
|
18
|
-
<valueHelp.Dialog title="My cool Dialog">
|
|
19
|
-
<dialog.MdcTableContent title="List View" keyPath="ID" descriptionPath="descr">
|
|
20
|
-
<filterbar><FilterBar/></filterbar>
|
|
21
|
-
<mdc.Table/>
|
|
22
|
-
</dialog.MdcTableContent>
|
|
23
|
-
<dialog.Conditions title="Condition View"/>
|
|
24
|
-
</valueHelp.Dialog>
|
|
25
|
-
</dialog>
|
|
26
|
-
</ValueHelp>
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
7
|
sap.ui.define([
|
|
30
8
|
'sap/ui/mdc/Element',
|
|
31
9
|
'sap/ui/mdc/mixin/PromiseMixin',
|
|
@@ -41,7 +19,8 @@ sap.ui.define([
|
|
|
41
19
|
'sap/ui/model/base/ManagedObjectModel',
|
|
42
20
|
'sap/ui/base/ManagedObjectObserver',
|
|
43
21
|
'sap/base/util/merge',
|
|
44
|
-
'sap/base/util/deepEqual'
|
|
22
|
+
'sap/base/util/deepEqual',
|
|
23
|
+
'sap/ui/mdc/enum/PropagationReason'
|
|
45
24
|
], function(
|
|
46
25
|
Element,
|
|
47
26
|
PromiseMixin,
|
|
@@ -57,19 +36,54 @@ sap.ui.define([
|
|
|
57
36
|
ManagedObjectModel,
|
|
58
37
|
ManagedObjectObserver,
|
|
59
38
|
merge,
|
|
60
|
-
deepEqual
|
|
39
|
+
deepEqual,
|
|
40
|
+
PropagationReason
|
|
61
41
|
) {
|
|
62
42
|
"use strict";
|
|
63
43
|
|
|
44
|
+
/**
|
|
45
|
+
* Modules for {@link sap.ui.mdc.ValueHelp ValueHelp}
|
|
46
|
+
* @namespace
|
|
47
|
+
* @name sap.ui.mdc.valuehelp
|
|
48
|
+
* @since 1.95.0
|
|
49
|
+
* @private
|
|
50
|
+
* @experimental As of version 1.95
|
|
51
|
+
* @ui5-restricted sap.ui.mdc
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Base-modules for {@link sap.ui.mdc.ValueHelp ValueHelp}
|
|
56
|
+
*
|
|
57
|
+
* These modules are not to be used stand-alone.
|
|
58
|
+
* @namespace
|
|
59
|
+
* @name sap.ui.mdc.valuehelp.base
|
|
60
|
+
* @since 1.95.0
|
|
61
|
+
* @private
|
|
62
|
+
* @experimental As of version 1.95
|
|
63
|
+
* @ui5-restricted sap.ui.mdc
|
|
64
|
+
*/
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Content-modules to be used in {@link sap.ui.mdc.valueHelp.Popover Popover} or {@link sap.ui.mdc.valueHelp.Dialog Dialog}
|
|
68
|
+
*
|
|
69
|
+
* These modules are not to be used stand-alone.
|
|
70
|
+
* @namespace
|
|
71
|
+
* @name sap.ui.mdc.valuehelp.content
|
|
72
|
+
* @since 1.95.0
|
|
73
|
+
* @private
|
|
74
|
+
* @experimental As of version 1.95
|
|
75
|
+
* @ui5-restricted sap.ui.mdc
|
|
76
|
+
*/
|
|
77
|
+
|
|
64
78
|
/**
|
|
65
79
|
* Constructor for a new <code>ValueHelp</code>.
|
|
66
80
|
*
|
|
67
|
-
* @param {string} [sId] ID for the new
|
|
68
|
-
* @param {object} [mSettings] Initial settings for the new
|
|
69
|
-
* @class Element for the <code>FieldHelp</code> association in the
|
|
81
|
+
* @param {string} [sId] ID for the new element, generated automatically if no ID is given
|
|
82
|
+
* @param {object} [mSettings] Initial settings for the new element
|
|
83
|
+
* @class Element for the <code>FieldHelp</code> association in the {@link sap.ui.mdc.field.FieldBase FieldBase} controls.
|
|
70
84
|
* @extends sap.ui.mdc.Element
|
|
71
85
|
* @implements sap.ui.core.PopupInterface
|
|
72
|
-
* @version 1.
|
|
86
|
+
* @version 1.102.0
|
|
73
87
|
* @constructor
|
|
74
88
|
* @abstract
|
|
75
89
|
* @private
|
|
@@ -99,6 +113,13 @@ sap.ui.define([
|
|
|
99
113
|
byValue: true
|
|
100
114
|
},
|
|
101
115
|
|
|
116
|
+
/**
|
|
117
|
+
* Path to the <code>Delegate</code> module that provides the required APIs to execute model-specific logic.<br>
|
|
118
|
+
* <b>Note:</b> Ensure that the related file can be requested (any required library has to be loaded before that).<br>
|
|
119
|
+
* Do not bind or modify the module. This property can only be configured during control initialization.
|
|
120
|
+
*
|
|
121
|
+
* @experimental
|
|
122
|
+
*/
|
|
102
123
|
delegate: {
|
|
103
124
|
type: "object",
|
|
104
125
|
group: "Data",
|
|
@@ -121,8 +142,8 @@ sap.ui.define([
|
|
|
121
142
|
},
|
|
122
143
|
|
|
123
144
|
/**
|
|
124
|
-
* If this property is set, the user input is validated against the value help.
|
|
125
|
-
* If no entry is found for the user input, an error
|
|
145
|
+
* If this property is set, the user input of the corresponding field is validated against the value help.
|
|
146
|
+
* If no entry is found for the user input, an error is shown on the field.
|
|
126
147
|
*
|
|
127
148
|
* If this property is not set, the user input is still checked against the value help.
|
|
128
149
|
* But if no entry is found, the user input is set to the field if the used data type allows this.
|
|
@@ -148,24 +169,6 @@ sap.ui.define([
|
|
|
148
169
|
group: "Appearance",
|
|
149
170
|
defaultValue: true,
|
|
150
171
|
visibility: "hidden"
|
|
151
|
-
},
|
|
152
|
-
/**
|
|
153
|
-
* Internal property to allow to bind the conditions created by InParameters to content
|
|
154
|
-
*/
|
|
155
|
-
_inConditions: {
|
|
156
|
-
type: "object",
|
|
157
|
-
defaultValue: {},
|
|
158
|
-
byValue: true,
|
|
159
|
-
visibility: "hidden"
|
|
160
|
-
},
|
|
161
|
-
/**
|
|
162
|
-
* Internal property to allow to bind the paths used by OutParameters to content
|
|
163
|
-
*/
|
|
164
|
-
_outParameters: {
|
|
165
|
-
type: "string[]",
|
|
166
|
-
defaultValue: [],
|
|
167
|
-
byValue: true,
|
|
168
|
-
visibility: "hidden"
|
|
169
172
|
}
|
|
170
173
|
},
|
|
171
174
|
aggregations: {
|
|
@@ -182,39 +185,13 @@ sap.ui.define([
|
|
|
182
185
|
typeahead: {
|
|
183
186
|
type: "sap.ui.mdc.valuehelp.ITypeaheadContainer",
|
|
184
187
|
multiple: false
|
|
185
|
-
},
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Sets the in parameters of a field help.
|
|
189
|
-
*
|
|
190
|
-
* If set, the value help reads the data of these entities in the model and uses it to filter in the value help.
|
|
191
|
-
*
|
|
192
|
-
* <b>Note:</b> In parameters are only used if the content of the value help supports it
|
|
193
|
-
*/
|
|
194
|
-
inParameters: {
|
|
195
|
-
type: "sap.ui.mdc.field.InParameter",
|
|
196
|
-
group: "Data",
|
|
197
|
-
multiple: true
|
|
198
|
-
},
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* Sets the out parameters of a field help.
|
|
202
|
-
*
|
|
203
|
-
* If set, the fields sets the data of these entities in the model based to the selected values.
|
|
204
|
-
*
|
|
205
|
-
* <b>Note:</b> Out parameters are only used if the content of the value help supports it
|
|
206
|
-
*/
|
|
207
|
-
outParameters: {
|
|
208
|
-
type: "sap.ui.mdc.field.OutParameter",
|
|
209
|
-
group: "Data",
|
|
210
|
-
multiple: true
|
|
211
188
|
}
|
|
212
189
|
},
|
|
213
190
|
events: {
|
|
214
191
|
/**
|
|
215
|
-
* This event is fired when a value is selected in the
|
|
192
|
+
* This event is fired when a value is selected in the value help.
|
|
216
193
|
*
|
|
217
|
-
* <b>Note:</b> This event must only be handled by the control the <code>
|
|
194
|
+
* <b>Note:</b> This event must only be handled by the control the <code>ValueHelp</code> element
|
|
218
195
|
* belongs to, not by the application.
|
|
219
196
|
*/
|
|
220
197
|
select: {
|
|
@@ -233,35 +210,35 @@ sap.ui.define([
|
|
|
233
210
|
add: { type: "boolean" },
|
|
234
211
|
|
|
235
212
|
/**
|
|
236
|
-
* Indicator if the
|
|
213
|
+
* Indicator if the value help is closed while selection
|
|
237
214
|
*/
|
|
238
215
|
close: {type: "boolean"}
|
|
239
216
|
}
|
|
240
217
|
},
|
|
241
218
|
|
|
242
219
|
/**
|
|
243
|
-
* This event is fired when the <code>
|
|
220
|
+
* This event is fired when the <code>ValueHelp</code> element is disconnected from a control.
|
|
244
221
|
*
|
|
245
|
-
* <b>Note:</b> This event must only be handled by the control the <code>
|
|
222
|
+
* <b>Note:</b> This event must only be handled by the control the <code>ValueHelp</code> element
|
|
246
223
|
* belongs to, not by the application.
|
|
247
224
|
*/
|
|
248
225
|
disconnect: {
|
|
249
226
|
},
|
|
250
227
|
|
|
251
228
|
/**
|
|
252
|
-
* This event is fired after the
|
|
229
|
+
* This event is fired after the value help has been closed.
|
|
253
230
|
*/
|
|
254
231
|
closed: {},
|
|
255
232
|
|
|
256
233
|
/**
|
|
257
|
-
* This event is fired after the user navigated in the value help.
|
|
234
|
+
* This event is fired after the user navigated, using the arrow keys, in the value help.
|
|
258
235
|
*/
|
|
259
236
|
navigated: {
|
|
260
237
|
parameters: {
|
|
261
238
|
/**
|
|
262
239
|
* True if the focus should be set back to the field.
|
|
263
240
|
*/
|
|
264
|
-
|
|
241
|
+
leaveFocus: { type: "boolean" },
|
|
265
242
|
/**
|
|
266
243
|
* Navigated condition.
|
|
267
244
|
*
|
|
@@ -291,7 +268,7 @@ sap.ui.define([
|
|
|
291
268
|
|
|
292
269
|
this._oObserver.observe(this, {
|
|
293
270
|
// properties: ["filterValue", "conditions"],
|
|
294
|
-
aggregations: ["
|
|
271
|
+
aggregations: ["typeahead", "dialog"]
|
|
295
272
|
});
|
|
296
273
|
|
|
297
274
|
this.setBindingContext(null); // don't inherit from parent as this could have a invalid BindingContent to read InParameters...
|
|
@@ -302,6 +279,7 @@ sap.ui.define([
|
|
|
302
279
|
|
|
303
280
|
ValueHelp.prototype.exit = function() {
|
|
304
281
|
|
|
282
|
+
|
|
305
283
|
if (this._oManagedObjectModel) {
|
|
306
284
|
this._oManagedObjectModel.destroy();
|
|
307
285
|
delete this._oManagedObjectModel;
|
|
@@ -426,13 +404,30 @@ sap.ui.define([
|
|
|
426
404
|
};
|
|
427
405
|
|
|
428
406
|
// retrieve delegate based content modifications
|
|
429
|
-
ValueHelp.prototype._retrieveDelegateContent = function(oContainer) {
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
407
|
+
ValueHelp.prototype._retrieveDelegateContent = function(oContainer, sContentId) {
|
|
408
|
+
var oPromise;
|
|
409
|
+
if (!sContentId) {
|
|
410
|
+
var oSelectedContent = oContainer.getSelectedContent(); // use currently active content id if no other is given
|
|
411
|
+
sContentId = oSelectedContent && oSelectedContent.getId();
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
oPromise = this._retrievePromise("delegateContent");
|
|
415
|
+
var bIsOpen = this.isOpen();
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
if (!oPromise || (oPromise && bIsOpen) || (oPromise && oPromise.aggregation !== oContainer.sParentAggregationName)) { // Create promises or stack running promises if VH is open or if the previous promise was meant for another container
|
|
419
|
+
var fnFetchContent = function () {
|
|
420
|
+
return this._getControlDelegatePromise().then(function (oDelegateModule) {
|
|
421
|
+
return oDelegateModule.retrieveContent(this.getPayload(), oContainer, sContentId);
|
|
422
|
+
}.bind(this));
|
|
423
|
+
}.bind(this);
|
|
424
|
+
|
|
425
|
+
var bChainPromises = oPromise && oPromise.isPending(); // ignore existing promise in case of non-happy result, maybe use .finally instead?
|
|
426
|
+
oPromise = this._addPromise("delegateContent", bChainPromises ? oPromise.getInternalPromise().then(fnFetchContent) : fnFetchContent);
|
|
427
|
+
oPromise.aggregation = oContainer.sParentAggregationName;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
return oPromise.getInternalPromise(); // make sure to always return a non-cancellable promise here as we rely on fulfillment for opening a container
|
|
436
431
|
};
|
|
437
432
|
|
|
438
433
|
ValueHelp.prototype._getControlDelegatePromise = function(oContainer) {
|
|
@@ -461,15 +456,13 @@ sap.ui.define([
|
|
|
461
456
|
}
|
|
462
457
|
|
|
463
458
|
if (oContainer && !oContainer.isOpen() && !oContainer.isOpening()) {
|
|
464
|
-
this.
|
|
465
|
-
oContainer.open(this._retrieveDelegateContent(oContainer, true));
|
|
459
|
+
oContainer.open(this._retrieveDelegateContent(oContainer));
|
|
466
460
|
}
|
|
467
461
|
};
|
|
468
462
|
|
|
469
463
|
function _handleRequestDelegateContent(oEvent) {
|
|
470
|
-
var oContainer = oEvent.
|
|
471
|
-
this.
|
|
472
|
-
this._retrieveDelegateContent(oContainer);
|
|
464
|
+
var oContainer = oEvent.getSource();
|
|
465
|
+
this._retrieveDelegateContent(oContainer, oEvent.getParameter("contentId"));
|
|
473
466
|
}
|
|
474
467
|
|
|
475
468
|
function _handleRequestSwitchToDialog(oEvent) {
|
|
@@ -544,7 +537,7 @@ sap.ui.define([
|
|
|
544
537
|
ValueHelp.prototype.isOpen = function() {
|
|
545
538
|
var oTypeahead = this.getTypeahead();
|
|
546
539
|
var oDialog = this.getDialog();
|
|
547
|
-
return (oTypeahead && oTypeahead.isOpen()) || (oDialog && oDialog.isOpen());
|
|
540
|
+
return !!((oTypeahead && oTypeahead.isOpen()) || (oDialog && oDialog.isOpen()));
|
|
548
541
|
};
|
|
549
542
|
|
|
550
543
|
/**
|
|
@@ -571,14 +564,14 @@ sap.ui.define([
|
|
|
571
564
|
};
|
|
572
565
|
|
|
573
566
|
/**
|
|
574
|
-
* Calls initialization of the ValueHelp before the
|
|
575
|
-
* This is called in Typeahead on first letter before the
|
|
567
|
+
* Calls initialization of the <code>ValueHelp</code> element before the value help is really opened.
|
|
568
|
+
* This is called in Typeahead on first letter before the value help is opened with a delay. So the
|
|
576
569
|
* content can be determined in the delegate coding early.
|
|
577
570
|
*
|
|
578
571
|
* <b>Note:</b> This function must only be called by the control the <code>ValueHelp</code> element
|
|
579
572
|
* belongs to, not by the application.
|
|
580
573
|
*
|
|
581
|
-
* @param {boolean} bTypeahead Flag that determines whether value help is opened for
|
|
574
|
+
* @param {boolean} bTypeahead Flag that determines whether value help is opened for type-ahead or for complex help
|
|
582
575
|
*
|
|
583
576
|
* @private
|
|
584
577
|
* @ui5-restricted sap.ui.mdc.field.FieldBase
|
|
@@ -674,8 +667,6 @@ sap.ui.define([
|
|
|
674
667
|
/**
|
|
675
668
|
* Triggers navigation in the value help.
|
|
676
669
|
*
|
|
677
|
-
* As this could be asyncron as data might be loaded a promise is returned.
|
|
678
|
-
*
|
|
679
670
|
* <b>Note:</b> This function must only be called by the control the <code>ValueHelp</code> element
|
|
680
671
|
* belongs to, not by the application.
|
|
681
672
|
*
|
|
@@ -702,12 +693,11 @@ sap.ui.define([
|
|
|
702
693
|
}
|
|
703
694
|
};
|
|
704
695
|
|
|
705
|
-
ValueHelp.prototype.getTextForKey = function (vKey,
|
|
696
|
+
ValueHelp.prototype.getTextForKey = function (vKey, oContext, oBindingContext, oConditionModel, sConditionModelName) {
|
|
706
697
|
return this.getItemForValue({
|
|
707
698
|
parsedValue: vKey,
|
|
708
699
|
value: vKey,
|
|
709
|
-
|
|
710
|
-
outParameters: oOutParameters,
|
|
700
|
+
context: oContext,
|
|
711
701
|
bindingContext: oBindingContext,
|
|
712
702
|
conditionModel: oConditionModel,
|
|
713
703
|
conditionModelName: sConditionModelName,
|
|
@@ -717,10 +707,10 @@ sap.ui.define([
|
|
|
717
707
|
});
|
|
718
708
|
};
|
|
719
709
|
|
|
720
|
-
ValueHelp.prototype.getKeyForText = function(sText,
|
|
710
|
+
ValueHelp.prototype.getKeyForText = function(sText, oContext) {
|
|
721
711
|
return this.getItemForValue({
|
|
722
712
|
value: sText,
|
|
723
|
-
|
|
713
|
+
context: oContext,
|
|
724
714
|
checkDescription: true,
|
|
725
715
|
exception: ParseException,
|
|
726
716
|
caseSensitive: true // case sensitive as used to get description for known description
|
|
@@ -738,8 +728,10 @@ sap.ui.define([
|
|
|
738
728
|
* @param {object} oConfig Configuration
|
|
739
729
|
* @param {any} oConfig.value Value as entered by user
|
|
740
730
|
* @param {any} [oConfig.parsedValue] Value parsed by type to fit the data type of the key
|
|
741
|
-
* @param {object} [oConfig.
|
|
742
|
-
* @param {object} [oConfig.
|
|
731
|
+
* @param {object} [oConfig.context] Contextual information provided by condition payload or inParameters/outParameters. This is only filled if the description needs to be determined for an existing condition.
|
|
732
|
+
* @param {object} [oConfig.context.inParameter] inParameters of the current condition
|
|
733
|
+
* @param {object} [oConfig.context.ouParameter] outParameters of the current condition
|
|
734
|
+
* @param {object} [oConfig.context.payload] payload of the current condition
|
|
743
735
|
* @param {sap.ui.model.Context} [oConfig.bindingContext] <code>BindingContext</code> of the checked field. Inside a table the <code>ValueHelp</code> element might be connected to a different row.
|
|
744
736
|
* @param {boolean} [oConfig.checkKeyFirst] If set, the value help checks first if the value fits a key // TODO: not longer needed?
|
|
745
737
|
* @param {boolean} oConfig.checkKey If set, the value help checks only if there is an item with the given key. This is set to <code>false</code> if the value cannot be a valid key because of type validation.
|
|
@@ -747,6 +739,7 @@ sap.ui.define([
|
|
|
747
739
|
* @param {sap.ui.mdc.condition.ConditionModel} [oConfig.conditionModel] <code>ConditionModel</code>, in case of <code>FilterField</code>
|
|
748
740
|
* @param {string} [oConfig.conditionModelName] Name of the <code>ConditionModel</code>, in case of <code>FilterField</code>
|
|
749
741
|
* @param {boolean} [oConfig.caseSensitive] If set, the check is done case sensitive
|
|
742
|
+
* @param {sap.ui.core.Control} oConfig.control Instance of the calling control
|
|
750
743
|
* @returns {Promise<sap.ui.mdc.field.FieldHelpItem>} Promise returning object containing description, key, in and out parameters.
|
|
751
744
|
* @throws {sap.ui.model.FormatException|sap.ui.model.ParseException} if entry is not found or not unique
|
|
752
745
|
*
|
|
@@ -759,30 +752,17 @@ sap.ui.define([
|
|
|
759
752
|
var oTypeahead = this.getTypeahead();
|
|
760
753
|
if (oTypeahead) {
|
|
761
754
|
//TODO: determine values from Inparameters from BindingContext (If not given from outside)
|
|
762
|
-
var aPromiseKey = ["getItemForValue", oConfig.parsedValue || oConfig.value, JSON.stringify(oConfig.
|
|
755
|
+
var aPromiseKey = ["getItemForValue", oConfig.parsedValue || oConfig.value, JSON.stringify(oConfig.context), oConfig.oBindingContext && oConfig.oBindingContext.getPath()];
|
|
763
756
|
var sPromisekey = aPromiseKey.join("_");
|
|
764
757
|
return this._retrievePromise(sPromisekey, function () {
|
|
765
758
|
return this._retrieveDelegateContent(oTypeahead).then(function() {
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
_cleanupParameterBinding.call(this, aInBindings);
|
|
774
|
-
if (oItem) {
|
|
775
|
-
if (oItem.inParameters) {
|
|
776
|
-
oItem.inParameters = _mapParametersToField.call(this, oItem.inParameters, this.getInParameters());
|
|
777
|
-
}
|
|
778
|
-
if (oItem.outParameters) {
|
|
779
|
-
oItem.outParameters = _mapParametersToField.call(this, oItem.outParameters, this.getOutParameters());
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
return oItem;
|
|
783
|
-
}.bind(this));
|
|
784
|
-
}.bind(this));
|
|
785
|
-
}.bind(this));
|
|
759
|
+
oConfig.caseSensitive = oConfig.hasOwnProperty("caseSensitive") ? oConfig.caseSensitive : false; // If supported, search case insensitive
|
|
760
|
+
var pGetItemPromise = oTypeahead.getItemForValue(oConfig);
|
|
761
|
+
// pGetItemPromise.then(function (oResult) {
|
|
762
|
+
// _onConditionPropagation.call(this, PropagationReason.Info, oConfig);
|
|
763
|
+
// }.bind(this));
|
|
764
|
+
return pGetItemPromise;
|
|
765
|
+
}/*.bind(this)*/);
|
|
786
766
|
}.bind(this));
|
|
787
767
|
} else {
|
|
788
768
|
// to return always a Promise
|
|
@@ -825,77 +805,10 @@ sap.ui.define([
|
|
|
825
805
|
if (this.bIsDestroyed) {
|
|
826
806
|
return; // if destroyed meanwhile, don't update
|
|
827
807
|
}
|
|
828
|
-
// apply out-parameters
|
|
829
|
-
var aOutParameters = this.getOutParameters();
|
|
830
808
|
|
|
809
|
+
_onConditionPropagation.call(this, PropagationReason.ControlChange);
|
|
831
810
|
// as BindingContext of Field might change (happens if fast typed and FieldHelp not opened) update if needed
|
|
832
811
|
_updateBindingContext.call(this);
|
|
833
|
-
|
|
834
|
-
// if OutParameters are bound and binding is pending, wait until finished
|
|
835
|
-
var aOutBindings = _getParameterBinding.call(this, aOutParameters); // do not provide BindingContext or ConditionModel, as only the current binding is used
|
|
836
|
-
_checkBindingsPending.call(this, aOutBindings).then(function() {
|
|
837
|
-
var aConditions = this.getConditions();
|
|
838
|
-
for (var j = 0; j < aOutParameters.length; j++) {
|
|
839
|
-
var oOutParameter = aOutParameters[j];
|
|
840
|
-
var vValue = oOutParameter.getValue();
|
|
841
|
-
var bUseConditions = oOutParameter.getUseConditions();
|
|
842
|
-
var bUpdate = true;
|
|
843
|
-
if (oOutParameter.getMode() === OutParameterMode.WhenEmpty) {
|
|
844
|
-
if (bUseConditions) {
|
|
845
|
-
bUpdate = !vValue || (Array.isArray(vValue) && vValue.length === 0);
|
|
846
|
-
} else {
|
|
847
|
-
bUpdate = !vValue;
|
|
848
|
-
}
|
|
849
|
-
}
|
|
850
|
-
if (bUpdate) {
|
|
851
|
-
var vNewValue;
|
|
852
|
-
var oNewCondition;
|
|
853
|
-
if (bUseConditions) {
|
|
854
|
-
if (!Array.isArray(vValue)) {
|
|
855
|
-
throw new Error("Value on OutParameter must be an array " + oOutParameter);
|
|
856
|
-
}
|
|
857
|
-
vNewValue = merge([], vValue);
|
|
858
|
-
} else {
|
|
859
|
-
vNewValue = vValue;
|
|
860
|
-
}
|
|
861
|
-
if (!oOutParameter.getHelpPath()) { // use fixed value
|
|
862
|
-
if (bUseConditions) {
|
|
863
|
-
oNewCondition = Condition.createCondition("EQ", [oOutParameter.getFixedValue()], undefined, undefined, ConditionValidated.Validated);
|
|
864
|
-
if (FilterOperatorUtil.indexOfCondition(oNewCondition, vNewValue) < 0) {
|
|
865
|
-
vNewValue.push(oNewCondition);
|
|
866
|
-
}
|
|
867
|
-
} else {
|
|
868
|
-
vNewValue = oOutParameter.getFixedValue();
|
|
869
|
-
}
|
|
870
|
-
} else {
|
|
871
|
-
for (var i = 0; i < aConditions.length; i++) {
|
|
872
|
-
var oCondition = aConditions[i];
|
|
873
|
-
if (oCondition.outParameters) {
|
|
874
|
-
for ( var sPath in oCondition.outParameters) {
|
|
875
|
-
if (oOutParameter.getFieldPath() === sPath) { // in Conditions fieldPath is used
|
|
876
|
-
if (bUseConditions) {
|
|
877
|
-
oNewCondition = Condition.createCondition("EQ", [oCondition.outParameters[sPath]], undefined, undefined, ConditionValidated.Validated); // as choosen from help -> validated
|
|
878
|
-
|
|
879
|
-
// TODO: handle in/out Parameters in ConditionModel (to let the condition know it's out-Parameters)
|
|
880
|
-
if (FilterOperatorUtil.indexOfCondition(oNewCondition, vNewValue) < 0) {
|
|
881
|
-
vNewValue.push(oNewCondition);
|
|
882
|
-
}
|
|
883
|
-
} else {
|
|
884
|
-
vNewValue = oCondition.outParameters[sPath];
|
|
885
|
-
}
|
|
886
|
-
}
|
|
887
|
-
}
|
|
888
|
-
}
|
|
889
|
-
}
|
|
890
|
-
}
|
|
891
|
-
if (bUseConditions) {
|
|
892
|
-
FilterOperatorUtil.checkConditionsEmpty(vNewValue); // to set isEmpty same as on directly selected in ValueHelp
|
|
893
|
-
}
|
|
894
|
-
oOutParameter.setValue(vNewValue);
|
|
895
|
-
}
|
|
896
|
-
}
|
|
897
|
-
}.bind(this));
|
|
898
|
-
|
|
899
812
|
};
|
|
900
813
|
|
|
901
814
|
/**
|
|
@@ -938,7 +851,7 @@ sap.ui.define([
|
|
|
938
851
|
};
|
|
939
852
|
|
|
940
853
|
/**
|
|
941
|
-
* If only typeahead is enabled the field should not show a
|
|
854
|
+
* If only typeahead is enabled the field should not show a value help icon or open the value help using F4.
|
|
942
855
|
*
|
|
943
856
|
* @returns {boolean} <code>true</code> if value help is enabled, <code>false</code> if only typeahead is enabled
|
|
944
857
|
* @private
|
|
@@ -958,41 +871,58 @@ sap.ui.define([
|
|
|
958
871
|
|
|
959
872
|
};
|
|
960
873
|
|
|
874
|
+
function _onConditionPropagation(sReason, oConfig) {
|
|
875
|
+
var oDelegate = this.bDelegateInitialized && this.getControlDelegate();
|
|
876
|
+
if (oDelegate) {
|
|
877
|
+
oDelegate.onConditionPropagation(this._oPayload, this, sReason, oConfig || this.getProperty("_config"));
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
|
|
961
881
|
function _handleNavigated(oEvent) {
|
|
962
882
|
|
|
963
|
-
var oCondition =
|
|
883
|
+
var oCondition = oEvent.getParameter("condition");
|
|
964
884
|
this.fireNavigated({condition: oCondition, itemId: oEvent.getParameter("itemId"), leaveFocus: oEvent.getParameter("leaveFocus")});
|
|
965
|
-
|
|
966
885
|
}
|
|
967
886
|
|
|
968
887
|
function _handleSelect(oEvent) {
|
|
969
888
|
|
|
970
|
-
var bSingleSelect = this.getMaxConditions() === 1;
|
|
971
889
|
|
|
972
890
|
var sType = oEvent.getParameter("type");
|
|
973
891
|
var aEventConditions = oEvent.getParameter("conditions") || [];
|
|
974
892
|
var aNextConditions;
|
|
975
893
|
|
|
894
|
+
var bSingleSelect = this.getMaxConditions() === 1;
|
|
895
|
+
|
|
976
896
|
if (bSingleSelect) {
|
|
977
|
-
|
|
897
|
+
aNextConditions = sType === SelectType.Remove ? [] : aEventConditions.slice(0,1);
|
|
978
898
|
}
|
|
979
899
|
|
|
980
|
-
if (sType === SelectType.Set || sType === SelectType.Add) {
|
|
981
|
-
aNextConditions = sType === SelectType.Set || bSingleSelect ? [] : this.getConditions();
|
|
982
900
|
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
901
|
+
if (sType === SelectType.Set) {
|
|
902
|
+
aNextConditions = [].concat(bSingleSelect ? aEventConditions.slice(0,1) : aEventConditions);
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
if (sType === SelectType.Add) {
|
|
906
|
+
if (bSingleSelect) {
|
|
907
|
+
aNextConditions = aEventConditions.slice(0,1);
|
|
908
|
+
} else {
|
|
909
|
+
aNextConditions = this.getConditions();
|
|
910
|
+
for (var i = 0; i < aEventConditions.length; i++) {
|
|
911
|
+
aNextConditions.push(aEventConditions[i]);
|
|
912
|
+
}
|
|
988
913
|
}
|
|
989
|
-
}
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
if (sType === SelectType.Remove) {
|
|
917
|
+
if (bSingleSelect) {
|
|
918
|
+
aNextConditions = [];
|
|
919
|
+
} else {
|
|
920
|
+
aNextConditions = this.getConditions();
|
|
921
|
+
for (var j = 0; j < aEventConditions.length; j++) {
|
|
922
|
+
var iIndex = FilterOperatorUtil.indexOfCondition(aEventConditions[j], aNextConditions);
|
|
923
|
+
if (iIndex >= 0) {
|
|
924
|
+
aNextConditions.splice(iIndex, 1);
|
|
925
|
+
}
|
|
996
926
|
}
|
|
997
927
|
}
|
|
998
928
|
}
|
|
@@ -1015,11 +945,13 @@ sap.ui.define([
|
|
|
1015
945
|
aConditions = Condition._removeEmptyConditions(aConditions);
|
|
1016
946
|
aConditions = Condition._removeInitialFlags(aConditions);
|
|
1017
947
|
FilterOperatorUtil.updateConditionsValues(aConditions); // to remove static text from static conditions
|
|
948
|
+
|
|
1018
949
|
this.fireSelect({conditions: aConditions, add: bAdd, close: bCloseAfterConfirm});
|
|
950
|
+
_onConditionPropagation.call(this, PropagationReason.Select);
|
|
1019
951
|
}
|
|
1020
|
-
|
|
1021
952
|
}
|
|
1022
953
|
|
|
954
|
+
|
|
1023
955
|
function _handleCancel(oEvent) {
|
|
1024
956
|
|
|
1025
957
|
this.close();
|
|
@@ -1031,8 +963,7 @@ sap.ui.define([
|
|
|
1031
963
|
}
|
|
1032
964
|
|
|
1033
965
|
function _handleClosed(oEvent) {
|
|
1034
|
-
|
|
1035
|
-
this._removePromise("delegateContent--" + oContainer.getId());
|
|
966
|
+
this._removePromise("delegateContent");
|
|
1036
967
|
this._removePromise("navigate");
|
|
1037
968
|
this.fireClosed();
|
|
1038
969
|
}
|
|
@@ -1066,415 +997,12 @@ sap.ui.define([
|
|
|
1066
997
|
oContainer.setModel(this._oManagedObjectModel, "$valueHelp");
|
|
1067
998
|
}
|
|
1068
999
|
}
|
|
1069
|
-
|
|
1070
|
-
if (oChanges.object == this) { // ValueHelp
|
|
1071
|
-
if (oChanges.name === "inParameters") {
|
|
1072
|
-
_inParametersChanged.call(this, oChanges.child, oChanges.mutation);
|
|
1073
|
-
}
|
|
1074
|
-
|
|
1075
|
-
if (oChanges.name === "outParameters") {
|
|
1076
|
-
_outParametersChanged.call(this, oChanges.child, oChanges.mutation);
|
|
1077
|
-
}
|
|
1078
|
-
} else if (oChanges.object.isA("sap.ui.mdc.field.OutParameter")){
|
|
1079
|
-
if (oChanges.name === "helpPath") {
|
|
1080
|
-
_outParameterPathChanged.call(this, oChanges.current, oChanges.old);
|
|
1081
|
-
}
|
|
1082
|
-
} else if (oChanges.object.isA("sap.ui.mdc.field.InParameter")){
|
|
1083
|
-
if (oChanges.name === "value") {
|
|
1084
|
-
_inParameterValueChanged.call(this, oChanges.object.getHelpPath(), oChanges.current, oChanges.object.getUseConditions(), oChanges.object.getInitialValueFilterEmpty());
|
|
1085
|
-
}
|
|
1086
|
-
if (oChanges.name === "helpPath") {
|
|
1087
|
-
_inParameterPathChanged.call(this, oChanges.current, oChanges.old, oChanges.object.getValue(), oChanges.object.getUseConditions(), oChanges.object.getInitialValueFilterEmpty());
|
|
1088
|
-
}
|
|
1089
|
-
}
|
|
1090
|
-
|
|
1091
|
-
}
|
|
1092
|
-
|
|
1093
|
-
function _inParametersChanged(oInParameter, sMutation) {
|
|
1094
|
-
|
|
1095
|
-
var sFilterPath = oInParameter.getHelpPath();
|
|
1096
|
-
|
|
1097
|
-
if (sMutation === "remove") {
|
|
1098
|
-
this._oObserver.unobserve(oInParameter);
|
|
1099
|
-
var oInConditions = this.getProperty("_inConditions");
|
|
1100
|
-
delete oInConditions[sFilterPath];
|
|
1101
|
-
this.setProperty("_inConditions", oInConditions, true);
|
|
1102
|
-
} else {
|
|
1103
|
-
this._oObserver.observe(oInParameter, {properties: ["value", "helpPath"]});
|
|
1104
|
-
_inParameterValueChanged.call(this, sFilterPath, oInParameter.getValue(), oInParameter.getUseConditions(), oInParameter.getInitialValueFilterEmpty());
|
|
1105
|
-
}
|
|
1106
|
-
|
|
1107
|
-
}
|
|
1108
|
-
|
|
1109
|
-
function _inParameterValueChanged(sFilterPath, vValue, bUseConditions, bInitialValueFilterEmpty) {
|
|
1110
|
-
|
|
1111
|
-
var oInConditions = this.getProperty("_inConditions");
|
|
1112
|
-
var oCondition;
|
|
1113
|
-
|
|
1114
|
-
oInConditions[sFilterPath] = [];
|
|
1115
|
-
|
|
1116
|
-
if (bUseConditions) {
|
|
1117
|
-
if (Array.isArray(vValue)) {
|
|
1118
|
-
for (var i = 0; i < vValue.length; i++) {
|
|
1119
|
-
oCondition = merge({}, vValue[i]);
|
|
1120
|
-
// change paths of in- and out-parameters
|
|
1121
|
-
if (oCondition.inParameters) {
|
|
1122
|
-
oCondition.inParameters = _mapParametersToHelp.call(this, oCondition.inParameters, this.getInParameters());
|
|
1123
|
-
}
|
|
1124
|
-
if (oCondition.outParameters) {
|
|
1125
|
-
oCondition.outParameters = _mapParametersToHelp.call(this, oCondition.outParameters, this.getOutParameters());
|
|
1126
|
-
}
|
|
1127
|
-
|
|
1128
|
-
oInConditions[sFilterPath].push(oCondition);
|
|
1129
|
-
}
|
|
1130
|
-
}
|
|
1131
|
-
} else {
|
|
1132
|
-
if (!vValue && bInitialValueFilterEmpty) {
|
|
1133
|
-
oCondition = Condition.createCondition("Empty", []);
|
|
1134
|
-
oCondition.isEmpty = false; // no explicit check needed
|
|
1135
|
-
} else if (vValue !== null) {
|
|
1136
|
-
// TODO: way to provide description on InParameter
|
|
1137
|
-
// validated to let FilterField determine description if visible on FilterBar.
|
|
1138
|
-
// Also to show it as selected on table in FieldHelp of FilterField.
|
|
1139
|
-
oCondition = Condition.createItemCondition(vValue);
|
|
1140
|
-
oCondition.validated = ConditionValidated.Validated;
|
|
1141
|
-
}
|
|
1142
|
-
if (oCondition) {
|
|
1143
|
-
oInConditions[sFilterPath].push(oCondition);
|
|
1144
|
-
}
|
|
1145
|
-
}
|
|
1146
|
-
|
|
1147
|
-
this.setProperty("_inConditions", oInConditions, true);
|
|
1148
|
-
|
|
1149
|
-
}
|
|
1150
|
-
|
|
1151
|
-
function _inParameterPathChanged(sFilterPath, sOldFilterPath, vValue, bUseConditions, bInitialValueFilterEmpty) {
|
|
1152
|
-
|
|
1153
|
-
var oInConditions = this.getProperty("_inConditions");
|
|
1154
|
-
|
|
1155
|
-
delete oInConditions[sOldFilterPath];
|
|
1156
|
-
this.setProperty("_inConditions", oInConditions, true);
|
|
1157
|
-
|
|
1158
|
-
_inParameterValueChanged.call(this, sFilterPath, vValue, bUseConditions, bInitialValueFilterEmpty);
|
|
1159
|
-
|
|
1160
|
-
}
|
|
1161
|
-
|
|
1162
|
-
function _outParametersChanged(oOutParameter, sMutation) {
|
|
1163
|
-
|
|
1164
|
-
var sFilterPath = oOutParameter.getHelpPath();
|
|
1165
|
-
var aOutParameters = this.getProperty("_outParameters");
|
|
1166
|
-
var iIndex = aOutParameters.indexOf(sFilterPath);
|
|
1167
|
-
|
|
1168
|
-
if (sMutation === "remove") {
|
|
1169
|
-
this._oObserver.unobserve(oOutParameter);
|
|
1170
|
-
if (iIndex > -1) {
|
|
1171
|
-
aOutParameters.splice(iIndex, 1);
|
|
1172
|
-
}
|
|
1173
|
-
} else {
|
|
1174
|
-
this._oObserver.observe(oOutParameter, {properties: ["helpPath"]});
|
|
1175
|
-
if (iIndex === -1) {
|
|
1176
|
-
aOutParameters.push(sFilterPath);
|
|
1177
|
-
}
|
|
1178
|
-
}
|
|
1179
|
-
|
|
1180
|
-
this.setProperty("_outParameters", aOutParameters, true);
|
|
1181
|
-
|
|
1182
|
-
}
|
|
1183
|
-
|
|
1184
|
-
function _outParameterPathChanged(sFilterPath, sOldFilterPath) {
|
|
1185
|
-
|
|
1186
|
-
var aOutParameters = this.getProperty("_outParameters");
|
|
1187
|
-
var iIndex = aOutParameters.indexOf(sOldFilterPath);
|
|
1188
|
-
if (iIndex > -1) {
|
|
1189
|
-
aOutParameters[iIndex] = sFilterPath;
|
|
1190
|
-
}
|
|
1191
|
-
|
|
1192
|
-
this.setProperty("_outParameters", aOutParameters, true);
|
|
1193
|
-
|
|
1194
|
-
}
|
|
1195
|
-
|
|
1196
|
-
function _mapParametersToHelp(oParameters, aParameters) {
|
|
1197
|
-
|
|
1198
|
-
var oHelpParameters;
|
|
1199
|
-
|
|
1200
|
-
if (aParameters.length > 0) {
|
|
1201
|
-
for (var sMyFieldPath in oParameters) {
|
|
1202
|
-
for (var i = 0; i < aParameters.length; i++) {
|
|
1203
|
-
var oParameter = aParameters[i];
|
|
1204
|
-
var sHelpPath = "conditions/" + oParameter.getHelpPath(); // if InParameter of InParameter it is part of the same FilterBar
|
|
1205
|
-
var sFieldPath = oParameter.getFieldPath();
|
|
1206
|
-
if (sFieldPath && (sFieldPath === sMyFieldPath || sFieldPath === "conditions/" + sMyFieldPath) && sHelpPath) { // support also old saved conditions without "conditions/" in name
|
|
1207
|
-
if (!oHelpParameters) {
|
|
1208
|
-
oHelpParameters = {};
|
|
1209
|
-
}
|
|
1210
|
-
oHelpParameters[sHelpPath] = oParameters[sMyFieldPath];
|
|
1211
|
-
}
|
|
1212
|
-
}
|
|
1213
|
-
}
|
|
1214
|
-
}
|
|
1215
|
-
|
|
1216
|
-
return oHelpParameters;
|
|
1217
|
-
|
|
1218
|
-
}
|
|
1219
|
-
|
|
1220
|
-
function _mapParametersToField(oParameters, aParameters) {
|
|
1221
|
-
|
|
1222
|
-
if (!oParameters || aParameters.length === 0) {
|
|
1223
|
-
return null; // should not happen
|
|
1224
|
-
}
|
|
1225
|
-
|
|
1226
|
-
var oFieldParameters = {};
|
|
1227
|
-
|
|
1228
|
-
for (var i = 0; i < aParameters.length; i++) {
|
|
1229
|
-
var oParameter = aParameters[i];
|
|
1230
|
-
var sHelpPath = oParameter.getHelpPath();
|
|
1231
|
-
var sFieldPath = oParameter.getFieldPath();
|
|
1232
|
-
if (sHelpPath && sFieldPath) {
|
|
1233
|
-
for (var sMyFieldPath in oParameters) {
|
|
1234
|
-
if ([sHelpPath,sFieldPath].indexOf(sMyFieldPath) >= 0) {
|
|
1235
|
-
oFieldParameters[sFieldPath] = oParameters[sMyFieldPath];
|
|
1236
|
-
break;
|
|
1237
|
-
}
|
|
1238
|
-
}
|
|
1239
|
-
} else if (!sHelpPath && sFieldPath && oParameter.getFixedValue) {
|
|
1240
|
-
// if helpPath is not set we expect a fix value for out-parameter
|
|
1241
|
-
oFieldParameters[sFieldPath] = oParameter.getFixedValue(); // TODO: do we want to add fixedValues to condition?
|
|
1242
|
-
}
|
|
1243
|
-
}
|
|
1244
|
-
|
|
1245
|
-
return oFieldParameters;
|
|
1246
|
-
|
|
1247
|
-
}
|
|
1248
|
-
|
|
1249
|
-
function _mapConditionParametersToField(oCondition) {
|
|
1250
|
-
|
|
1251
|
-
oCondition = merge({}, oCondition);
|
|
1252
|
-
if (oCondition.inParameters) {
|
|
1253
|
-
oCondition.inParameters = _mapParametersToField.call(this, oCondition.inParameters, this.getInParameters());
|
|
1254
|
-
}
|
|
1255
|
-
if (oCondition.outParameters) {
|
|
1256
|
-
oCondition.outParameters = _mapParametersToField.call(this, oCondition.outParameters, this.getOutParameters());
|
|
1257
|
-
}
|
|
1258
|
-
return oCondition;
|
|
1259
|
-
|
|
1260
1000
|
}
|
|
1261
1001
|
|
|
1262
1002
|
function _updateBindingContext() {
|
|
1263
1003
|
|
|
1264
1004
|
var oBindingContext = this._oControl ? this._oControl.getBindingContext() : null; // if not connected use no BindingContext
|
|
1265
1005
|
this.setBindingContext(oBindingContext);
|
|
1266
|
-
|
|
1267
|
-
// in FilterField case also set right ConditionModel
|
|
1268
|
-
var oConfig = this.getProperty("_config");
|
|
1269
|
-
if (oConfig && oConfig.conditionModel && this.getModel(oConfig.conditionModelName) !== oConfig.conditionModel) { // don't update propagated model
|
|
1270
|
-
this.setModel(oConfig.conditionModel, oConfig.conditionModelName);
|
|
1271
|
-
}
|
|
1272
|
-
|
|
1273
|
-
}
|
|
1274
|
-
|
|
1275
|
-
function _getParameterBinding(aParameters, oBindingContext, oConditionModel, sConditionModelName) {
|
|
1276
|
-
|
|
1277
|
-
var aBindings = [];
|
|
1278
|
-
var bBindingChanged = false;
|
|
1279
|
-
var oMyBindingContext;
|
|
1280
|
-
|
|
1281
|
-
if (oBindingContext) {
|
|
1282
|
-
oMyBindingContext = this.oBindingContexts[undefined]; // as getBindingContext returns propagated Context if own context don't fit to model
|
|
1283
|
-
if (oBindingContext && Context.hasChanged(oMyBindingContext, oBindingContext)) {
|
|
1284
|
-
bBindingChanged = true;
|
|
1285
|
-
}
|
|
1286
|
-
}
|
|
1287
|
-
|
|
1288
|
-
for (var i = 0; i < aParameters.length; i++) {
|
|
1289
|
-
var oParameter = aParameters[i];
|
|
1290
|
-
var oBinding = oParameter.getBinding("value");
|
|
1291
|
-
|
|
1292
|
-
if (oParameter.getUseConditions() && oConditionModel) {
|
|
1293
|
-
// if ConditionModel is used, check if Binding is OK and same ConditionModel is used
|
|
1294
|
-
var oMyConditionModel = this.getModel(sConditionModelName);
|
|
1295
|
-
if (oMyConditionModel !== oConditionModel) {
|
|
1296
|
-
// no or different ConditionModel -> create new binding on given ConditionModel
|
|
1297
|
-
oBinding = oConditionModel.bindProperty("/" + oParameter.getFieldPath());
|
|
1298
|
-
oBinding._bValueHelp = true; // to make cleanup easier
|
|
1299
|
-
aBindings.push(oBinding);
|
|
1300
|
-
}
|
|
1301
|
-
} else if (oBinding) {
|
|
1302
|
-
var sPath = oBinding.getPath();
|
|
1303
|
-
var oParameterBindingContext = oBinding.getContext();
|
|
1304
|
-
|
|
1305
|
-
if (bBindingChanged && oBinding.isRelative() && (oParameterBindingContext === oMyBindingContext || (!oParameterBindingContext && oMyBindingContext))) {
|
|
1306
|
-
// InParameter is bound and uses the same BindingContext like the FieldHelp or has no BindingContext right now.
|
|
1307
|
-
// If InParameter is bound to a different BindingContext just use this one.
|
|
1308
|
-
if (oBindingContext.getProperty(sPath) === undefined) {
|
|
1309
|
-
// if value is already known in BindingContext from other existing Binding, don't request again.
|
|
1310
|
-
var oModel = oBinding.getModel();
|
|
1311
|
-
oBinding = oModel.bindProperty(sPath, oBindingContext);
|
|
1312
|
-
oBinding._bValueHelp = true; // to make cleanup easier
|
|
1313
|
-
aBindings.push(oBinding);
|
|
1314
|
-
}
|
|
1315
|
-
} else if ((!oParameterBindingContext && oBinding.isRelative()) // we don't have a BindingContext but need one -> need to wait for one
|
|
1316
|
-
|| (oParameterBindingContext && oParameterBindingContext.getProperty(sPath) === undefined) // the BindingContext has no data right now -> need to wait for update
|
|
1317
|
-
|| oBinding.getValue() === undefined // the Binding has no data right now, need to wait for update
|
|
1318
|
-
|| (oParameterBindingContext && !deepEqual(oParameter.validateProperty("value", oParameterBindingContext.getProperty(sPath)), oParameter.getValue()))) { // value not alreday set
|
|
1319
|
-
// Property not already known on BindingContext or not already updated in Parameter value
|
|
1320
|
-
// use validateProperty as null might be converted to undefined, if invalid value don't run into a check
|
|
1321
|
-
// use deepEqual as, depending on type, the value could be complex (same logic as in setProperty)
|
|
1322
|
-
aBindings.push(oBinding);
|
|
1323
|
-
}
|
|
1324
|
-
}
|
|
1325
|
-
}
|
|
1326
|
-
|
|
1327
|
-
return aBindings;
|
|
1328
|
-
|
|
1329
|
-
}
|
|
1330
|
-
|
|
1331
|
-
function _cleanupParameterBinding(aBindings) {
|
|
1332
|
-
|
|
1333
|
-
for (var i = 0; i < aBindings.length; i++) {
|
|
1334
|
-
if (aBindings[i]._bValueHelp) {
|
|
1335
|
-
aBindings[i].destroy();
|
|
1336
|
-
}
|
|
1337
|
-
}
|
|
1338
|
-
|
|
1339
|
-
}
|
|
1340
|
-
|
|
1341
|
-
function _checkBindingsPending(aBindings) {
|
|
1342
|
-
|
|
1343
|
-
var oDelegatePromise = this._getControlDelegatePromise();
|
|
1344
|
-
return oDelegatePromise.then(function (oDelegateModule) {
|
|
1345
|
-
if (aBindings.length === 0) {
|
|
1346
|
-
return null;
|
|
1347
|
-
}
|
|
1348
|
-
|
|
1349
|
-
return oDelegateModule.checkBindingsPending(this.getPayload(), aBindings);
|
|
1350
|
-
}.bind(this));
|
|
1351
|
-
|
|
1352
|
-
}
|
|
1353
|
-
|
|
1354
|
-
function _getParameterFilter(oParameters, aParameters, aBindings, oBindingContext) {
|
|
1355
|
-
|
|
1356
|
-
if (aParameters.length === 0) {
|
|
1357
|
-
return null;
|
|
1358
|
-
}
|
|
1359
|
-
|
|
1360
|
-
var oConditions = {};
|
|
1361
|
-
var oCondition;
|
|
1362
|
-
var oParameter;
|
|
1363
|
-
var sHelpPath;
|
|
1364
|
-
var sFieldPath;
|
|
1365
|
-
var i = 0;
|
|
1366
|
-
|
|
1367
|
-
if (oParameters) {
|
|
1368
|
-
// InParameters provided for value -> use it
|
|
1369
|
-
for (var sMyFieldPath in oParameters) {
|
|
1370
|
-
for (i = 0; i < aParameters.length; i++) {
|
|
1371
|
-
oParameter = aParameters[i];
|
|
1372
|
-
sHelpPath = oParameter.getHelpPath();
|
|
1373
|
-
sFieldPath = oParameter.getFieldPath();
|
|
1374
|
-
if (sFieldPath && sHelpPath && (sFieldPath === sMyFieldPath || sFieldPath === "conditions/" + sMyFieldPath)) { // support also old saved conditions without "conditions/" in name
|
|
1375
|
-
oConditions[sHelpPath] = [];
|
|
1376
|
-
oCondition = Condition.createItemCondition(oParameters[sMyFieldPath]);
|
|
1377
|
-
oCondition.validated = ConditionValidated.Validated;
|
|
1378
|
-
oConditions[sHelpPath].push(oCondition);
|
|
1379
|
-
}
|
|
1380
|
-
}
|
|
1381
|
-
}
|
|
1382
|
-
} else {
|
|
1383
|
-
// use current values of in/out-parameters
|
|
1384
|
-
// If Bindings are provided (from different BindingContext) use the value of this Binding
|
|
1385
|
-
var oMyBindingContext = this.getBindingContext();
|
|
1386
|
-
for (i = 0; i < aParameters.length; i++) {
|
|
1387
|
-
oParameter = aParameters[i];
|
|
1388
|
-
sHelpPath = oParameter.getHelpPath();
|
|
1389
|
-
if (sHelpPath) {
|
|
1390
|
-
var vValue = oParameter.getValue();
|
|
1391
|
-
var bUseConditions = oParameter.getUseConditions();
|
|
1392
|
-
var bInitialValueFilterEmpty = oParameter.getInitialValueFilterEmpty();
|
|
1393
|
-
var j = 0;
|
|
1394
|
-
if ((aBindings && aBindings.length > 0) || oBindingContext) {
|
|
1395
|
-
var oBinding = oParameter.getBinding("value");
|
|
1396
|
-
var bFound = false;
|
|
1397
|
-
if (oBinding || bUseConditions) {
|
|
1398
|
-
sFieldPath = oParameter.getFieldPath();
|
|
1399
|
-
for (j = 0; j < aBindings.length; j++) {
|
|
1400
|
-
if ((oBinding && oBinding.getPath() === aBindings[j].getPath()) ||
|
|
1401
|
-
(bUseConditions && aBindings[j].getPath() === "/" + sFieldPath)) {
|
|
1402
|
-
vValue = aBindings[j].getValue();
|
|
1403
|
-
bFound = true;
|
|
1404
|
-
break;
|
|
1405
|
-
}
|
|
1406
|
-
}
|
|
1407
|
-
if (!bFound && !bUseConditions && oBindingContext && oBinding && oBinding.isRelative() && (!oBinding.getContext() || (oBinding.getContext() !== oBindingContext && oBinding.getContext() === oMyBindingContext))) {
|
|
1408
|
-
// no new binding created and different BindingContext -> use propery from BindingConext (was already read before)
|
|
1409
|
-
vValue = oBindingContext.getProperty(oBinding.getPath());
|
|
1410
|
-
}
|
|
1411
|
-
}
|
|
1412
|
-
}
|
|
1413
|
-
|
|
1414
|
-
// create Filter statements here as here the data type of the Parameters can be determined
|
|
1415
|
-
// allow multiple values
|
|
1416
|
-
// ignore empty conditions for filtering
|
|
1417
|
-
oConditions[sHelpPath] = [];
|
|
1418
|
-
if (bUseConditions) { // just use conditions
|
|
1419
|
-
for (j = 0; j < vValue.length; j++) {
|
|
1420
|
-
oCondition = merge({}, vValue[j]);
|
|
1421
|
-
// change paths of in- and out-parameters
|
|
1422
|
-
if (oCondition.inParameters) {
|
|
1423
|
-
oCondition.inParameters = _mapParametersToHelp.call(this, oCondition.inParameters, this.getInParameters());
|
|
1424
|
-
}
|
|
1425
|
-
if (oCondition.outParameters) {
|
|
1426
|
-
oCondition.outParameters = _mapParametersToHelp.call(this, oCondition.outParameters, this.getOutParameters());
|
|
1427
|
-
}
|
|
1428
|
-
oConditions[sHelpPath].push(oCondition);
|
|
1429
|
-
}
|
|
1430
|
-
} else {
|
|
1431
|
-
if (!vValue && bInitialValueFilterEmpty) {
|
|
1432
|
-
oCondition = Condition.createCondition("Empty", []);
|
|
1433
|
-
oCondition.isEmpty = false; // no explicit check needed
|
|
1434
|
-
} else if (vValue) {
|
|
1435
|
-
oCondition = Condition.createItemCondition(vValue);
|
|
1436
|
-
oCondition.validated = ConditionValidated.Validated;
|
|
1437
|
-
}
|
|
1438
|
-
if (oCondition) {
|
|
1439
|
-
oConditions[sHelpPath].push(oCondition);
|
|
1440
|
-
}
|
|
1441
|
-
}
|
|
1442
|
-
oCondition = undefined;
|
|
1443
|
-
}
|
|
1444
|
-
}
|
|
1445
|
-
}
|
|
1446
|
-
|
|
1447
|
-
// return filters for filtering
|
|
1448
|
-
var oConditionTypes = _getTypesForConditions.call(this, oConditions);
|
|
1449
|
-
var oFilter = FilterConverter.createFilters(oConditions, oConditionTypes);
|
|
1450
|
-
|
|
1451
|
-
return oFilter;
|
|
1452
|
-
|
|
1453
|
-
}
|
|
1454
|
-
|
|
1455
|
-
function _getTypesForConditions(oConditions) {
|
|
1456
|
-
|
|
1457
|
-
var aInParameters = this.getInParameters();
|
|
1458
|
-
var oConditionTypes = {};
|
|
1459
|
-
var sFieldPath;
|
|
1460
|
-
|
|
1461
|
-
// collect condition Fieldpaths here
|
|
1462
|
-
for (sFieldPath in oConditions) {
|
|
1463
|
-
var oType;
|
|
1464
|
-
// try to find missing type from InParameter
|
|
1465
|
-
for (var i = 0; i < aInParameters.length; i++) {
|
|
1466
|
-
var oInParameter = aInParameters[i];
|
|
1467
|
-
if (oInParameter.getHelpPath() === sFieldPath) {
|
|
1468
|
-
oType = oInParameter.getDataType();
|
|
1469
|
-
break;
|
|
1470
|
-
}
|
|
1471
|
-
}
|
|
1472
|
-
|
|
1473
|
-
oConditionTypes[sFieldPath] = {type: oType};
|
|
1474
|
-
}
|
|
1475
|
-
|
|
1476
|
-
return oConditionTypes;
|
|
1477
|
-
|
|
1478
1006
|
}
|
|
1479
1007
|
|
|
1480
1008
|
function _getValueHelpContainer() {
|
|
@@ -1498,13 +1026,3 @@ sap.ui.define([
|
|
|
1498
1026
|
return ValueHelp;
|
|
1499
1027
|
|
|
1500
1028
|
});
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
/*
|
|
1504
|
-
|
|
1505
|
-
Valuehelp Interface:
|
|
1506
|
-
_getOperator
|
|
1507
|
-
_getControlForSuggestion
|
|
1508
|
-
getFieldPath
|
|
1509
|
-
|
|
1510
|
-
*/
|