@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
|
@@ -19,7 +19,8 @@ sap.ui.define([
|
|
|
19
19
|
'sap/base/strings/formatMessage',
|
|
20
20
|
'sap/base/util/merge',
|
|
21
21
|
'sap/ui/mdc/enum/SelectType',
|
|
22
|
-
'sap/base/Log'
|
|
22
|
+
'sap/base/Log',
|
|
23
|
+
'sap/ui/thirdparty/jquery'
|
|
23
24
|
], function(
|
|
24
25
|
FilterableListContent,
|
|
25
26
|
Condition,
|
|
@@ -35,7 +36,8 @@ sap.ui.define([
|
|
|
35
36
|
formatMessage,
|
|
36
37
|
merge,
|
|
37
38
|
SelectType,
|
|
38
|
-
Log
|
|
39
|
+
Log,
|
|
40
|
+
jQuery
|
|
39
41
|
) {
|
|
40
42
|
"use strict";
|
|
41
43
|
|
|
@@ -45,11 +47,11 @@ sap.ui.define([
|
|
|
45
47
|
/**
|
|
46
48
|
* Constructor for a new <code>MTable</code> content.
|
|
47
49
|
*
|
|
48
|
-
* @param {string} [sId] ID for the new
|
|
49
|
-
* @param {object} [mSettings] Initial settings for the new
|
|
50
|
-
* @class Content for the
|
|
50
|
+
* @param {string} [sId] ID for the new element, generated automatically if no ID is given
|
|
51
|
+
* @param {object} [mSettings] Initial settings for the new element
|
|
52
|
+
* @class Content for the {@link sap.ui.mdc.valuehelp.base.Container Container} element using a {@link sap.m.Table}.
|
|
51
53
|
* @extends sap.ui.mdc.valuehelp.base.FilterableListContent
|
|
52
|
-
* @version 1.
|
|
54
|
+
* @version 1.102.0
|
|
53
55
|
* @constructor
|
|
54
56
|
* @abstract
|
|
55
57
|
* @private
|
|
@@ -75,7 +77,7 @@ sap.ui.define([
|
|
|
75
77
|
* Table to be used in value help
|
|
76
78
|
*
|
|
77
79
|
* <b>Note:</b> Set the right selection mode (multiple selection or single selection) as it cannot be determined automatically
|
|
78
|
-
* for every case. (In type-ahead also for multi-value
|
|
80
|
+
* for every case. (In type-ahead also for multi-value {@link sap.ui.mdc.FilterField FilterField} controls only single selection from table might be wanted.)
|
|
79
81
|
*/
|
|
80
82
|
table: {
|
|
81
83
|
type: "sap.m.Table",
|
|
@@ -128,17 +130,11 @@ sap.ui.define([
|
|
|
128
130
|
}
|
|
129
131
|
}
|
|
130
132
|
}
|
|
131
|
-
|
|
132
|
-
// function _getListItemKey(oListItem) {
|
|
133
|
-
// var oContext = oListItem.getBindingContext();
|
|
134
|
-
// var oContextValue = oContext && oContext.getObject();
|
|
135
|
-
// return oContextValue && oContextValue[this.getKeyPath()];
|
|
136
|
-
// }
|
|
137
133
|
MTable.prototype.applyFilters = function(sFieldSearch) {
|
|
138
|
-
var oListBinding = this.
|
|
134
|
+
var oListBinding = this.getListBinding();
|
|
139
135
|
var bValueHelpDelegateInitialized = this._isValueHelpDelegateInitialized();
|
|
140
136
|
|
|
141
|
-
if ((!oListBinding || !bValueHelpDelegateInitialized) && (this.isContainerOpening() || this.isTypeahead())) {
|
|
137
|
+
if ((!oListBinding || !bValueHelpDelegateInitialized)/* && (this.isContainerOpening() || this.isTypeahead())*/) {
|
|
142
138
|
Promise.all([this._retrievePromise("listBinding"), this._awaitValueHelpDelegate()]).then(function () {
|
|
143
139
|
if (!this.bIsDestroyed) {
|
|
144
140
|
this.applyFilters(sFieldSearch);
|
|
@@ -156,7 +152,7 @@ sap.ui.define([
|
|
|
156
152
|
|
|
157
153
|
var sFilterFields = this.getFilterFields();
|
|
158
154
|
var oFilterBar = this._getPriorityFilterBar();
|
|
159
|
-
var oConditions = oFilterBar ? oFilterBar.getInternalConditions() : this.
|
|
155
|
+
var oConditions = oFilterBar ? oFilterBar.getInternalConditions() : this._oInitialFilterConditions || {};
|
|
160
156
|
|
|
161
157
|
if (!oFilterBar && sFieldSearch && sFilterFields && sFilterFields !== "$search") {
|
|
162
158
|
// add condition for Search value
|
|
@@ -188,7 +184,7 @@ sap.ui.define([
|
|
|
188
184
|
bUseFilter = false;
|
|
189
185
|
}
|
|
190
186
|
|
|
191
|
-
if (sFilterFields === "$search" && oDelegate && oDelegate.isSearchSupported(oDelegatePayload, oListBinding)){
|
|
187
|
+
if (sFilterFields === "$search" && oDelegate && oDelegate.isSearchSupported(oDelegatePayload, this, oListBinding)){
|
|
192
188
|
if (!oListBinding.isSuspended() && bUseFilter) {
|
|
193
189
|
// as we trigger two changes this would result to two requests therefore we suspend the binding
|
|
194
190
|
oListBinding.suspend();
|
|
@@ -211,15 +207,17 @@ sap.ui.define([
|
|
|
211
207
|
};
|
|
212
208
|
|
|
213
209
|
MTable.prototype._handleSelectionChange = function (oEvent) {
|
|
210
|
+
var sModelName = oEvent.getSource().getBindingInfo("items").model;
|
|
214
211
|
var bIsTypeahead = this.isTypeahead();
|
|
215
212
|
if (!bIsTypeahead || !this._isSingleSelect()) {
|
|
216
213
|
var oParams = oEvent.getParameters();
|
|
217
214
|
var aListItems = oParams.listItems || oParams.listItem && [oParams.listItem];
|
|
218
215
|
var aConditions = aListItems.map(function (oItem) {
|
|
219
|
-
var
|
|
220
|
-
|
|
216
|
+
var oItemContext = oItem.getBindingContext(sModelName);
|
|
217
|
+
var oValues = this._getItemFromContext(oItemContext);
|
|
218
|
+
return oValues && this._createCondition(oValues.key, oValues.description, oValues.payload);
|
|
221
219
|
}.bind(this));
|
|
222
|
-
this.
|
|
220
|
+
this._fireSelect({type: oParams.selected ? SelectType.Add : SelectType.Remove, conditions: aConditions});
|
|
223
221
|
if (bIsTypeahead) {
|
|
224
222
|
this.fireConfirm();
|
|
225
223
|
}
|
|
@@ -227,8 +225,10 @@ sap.ui.define([
|
|
|
227
225
|
};
|
|
228
226
|
|
|
229
227
|
MTable.prototype._handleItemPress = function (oEvent) {
|
|
228
|
+
var sModelName = oEvent.getSource().getBindingInfo("items").model;
|
|
230
229
|
var oItem = oEvent.getParameter("listItem");
|
|
231
|
-
var
|
|
230
|
+
var oItemContext = oItem.getBindingContext(sModelName);
|
|
231
|
+
var oValues = this._getItemFromContext(oItemContext);
|
|
232
232
|
var bIsSingleSelect = this._isSingleSelect();
|
|
233
233
|
var bSelected = bIsSingleSelect ? true : !oItem.getSelected();
|
|
234
234
|
var sSelectType = SelectType.Set;
|
|
@@ -237,8 +237,8 @@ sap.ui.define([
|
|
|
237
237
|
oItem.setSelected(bSelected);
|
|
238
238
|
sSelectType = bSelected ? SelectType.Add : SelectType.Remove;
|
|
239
239
|
}
|
|
240
|
-
var oCondition = this._createCondition(oValues.key, oValues.description, oValues.
|
|
241
|
-
this.
|
|
240
|
+
var oCondition = this._createCondition(oValues.key, oValues.description, oValues.payload);
|
|
241
|
+
this._fireSelect({type: sSelectType, conditions: [oCondition]});
|
|
242
242
|
if (this.isTypeahead()) {
|
|
243
243
|
this.fireConfirm({close: true});
|
|
244
244
|
}
|
|
@@ -369,6 +369,12 @@ sap.ui.define([
|
|
|
369
369
|
if (!oConfig.checkKey && oConfig.parsedValue && !oConfig.checkDescription) {
|
|
370
370
|
return null;
|
|
371
371
|
}
|
|
372
|
+
if (oConfig.checkKey && !this.getKeyPath()) {
|
|
373
|
+
throw new Error("MTable: KeyPath missing! " + this.getId());
|
|
374
|
+
}
|
|
375
|
+
if (oConfig.checkDescription && !this.getDescriptionPath()) {
|
|
376
|
+
throw new Error("MTable: DescriptionPath missing! " + this.getId());
|
|
377
|
+
}
|
|
372
378
|
|
|
373
379
|
/* load data from model if nothing is found in the current items / contexts
|
|
374
380
|
/ steps:
|
|
@@ -378,16 +384,23 @@ sap.ui.define([
|
|
|
378
384
|
*/
|
|
379
385
|
oConfig.caseSensitive = oConfig.caseSensitive || this.getCaseSensitive();
|
|
380
386
|
|
|
381
|
-
|
|
387
|
+
var oPromise1 = _checkListBindingPending.call(this);
|
|
388
|
+
var oDelegate = this._getValueHelpDelegate();
|
|
389
|
+
var oDelegatePayload = this._getValueHelpDelegatePayload();
|
|
390
|
+
var oPromise2 = oDelegate && oDelegate.getInitialFilterConditions(oDelegatePayload, this, oConfig.control);
|
|
391
|
+
|
|
392
|
+
return Promise.all([oPromise1, oPromise2]).then(function(aResult) {
|
|
393
|
+
var bPending = aResult[0];
|
|
394
|
+
var oInitialConditions = aResult[1];
|
|
382
395
|
var oResult;
|
|
383
396
|
|
|
384
397
|
if (!bPending) {
|
|
385
398
|
var oTable = this.getTable();
|
|
386
|
-
oResult = _filterItems.call(this, oConfig, oTable.getItems());
|
|
399
|
+
oResult = _filterItems.call(this, oConfig, oTable.getItems(), oInitialConditions);
|
|
387
400
|
}
|
|
388
401
|
|
|
389
402
|
if (!oResult) {
|
|
390
|
-
oResult = this._loadItemForValue(oConfig);
|
|
403
|
+
oResult = this._loadItemForValue(oConfig, oInitialConditions);
|
|
391
404
|
}
|
|
392
405
|
|
|
393
406
|
return oResult;
|
|
@@ -395,95 +408,83 @@ sap.ui.define([
|
|
|
395
408
|
|
|
396
409
|
};
|
|
397
410
|
|
|
398
|
-
function
|
|
399
|
-
return this._retrievePromise("listBinding").then(function (oListBinding) {
|
|
400
|
-
var oDelegate = this._getValueHelpDelegate();
|
|
401
|
-
var oDelegatePayload = this._getValueHelpDelegatePayload();
|
|
402
|
-
var oListBindingInfo = this._getListBindingInfo();
|
|
403
|
-
if (oListBinding && oDelegate){
|
|
404
|
-
return oDelegate.checkListBindingPending(oDelegatePayload, oListBinding, oListBindingInfo);
|
|
405
|
-
} else {
|
|
406
|
-
return true;
|
|
407
|
-
}
|
|
408
|
-
}.bind(this));
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
function _filterItems(oConfig, aItems) {
|
|
411
|
+
function _filterItems(oConfig, aItems, oInitialConditions) {
|
|
412
412
|
|
|
413
413
|
if (aItems.length === 0) {
|
|
414
414
|
return;
|
|
415
415
|
}
|
|
416
416
|
|
|
417
|
-
var
|
|
418
|
-
|
|
419
|
-
if (oConfig.checkKey && oConfig.hasOwnProperty("parsedValue")) { // empty string or false could be key too
|
|
420
|
-
aFields.push({path: this.getKeyPath(), value: oConfig.parsedValue});
|
|
421
|
-
}
|
|
422
|
-
if (oConfig.checkDescription && oConfig.value) {
|
|
423
|
-
aFields.push({path: this.getDescriptionPath(), value: oConfig.value});
|
|
424
|
-
}
|
|
417
|
+
var oBindingInfo = this._getListBindingInfo();
|
|
418
|
+
var sModelName = oBindingInfo.model;
|
|
425
419
|
|
|
426
420
|
var _getFilterValue = function(oItem, sPath) {
|
|
427
|
-
var oBindingContext = oItem.isA("sap.ui.model.Context") ? oItem : oItem.getBindingContext();
|
|
421
|
+
var oBindingContext = oItem.isA("sap.ui.model.Context") ? oItem : oItem.getBindingContext(sModelName);
|
|
428
422
|
return oBindingContext.getProperty(sPath);
|
|
429
423
|
};
|
|
430
424
|
|
|
431
|
-
var oFilter;
|
|
432
|
-
var aFilters = [];
|
|
433
425
|
var aInParameters;
|
|
434
426
|
var aOutParameters;
|
|
435
|
-
var i = 0;
|
|
436
427
|
|
|
437
|
-
|
|
438
|
-
if (!aFields[i].path) {
|
|
439
|
-
throw new Error("path for filter missing"); // as we cannot filter key or description without path
|
|
440
|
-
}
|
|
441
|
-
aFilters.push(new Filter({path: aFields[i].path, operator: FilterOperator.EQ, value1: aFields[i].value, caseSensitive: oConfig.caseSensitive}));
|
|
442
|
-
}
|
|
443
|
-
if (aFilters.length === 1) {
|
|
444
|
-
oFilter = aFilters[0];
|
|
445
|
-
} else {
|
|
446
|
-
oFilter = new Filter({filters: aFilters, and: false}); // key OR description
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
if (oConfig.inParameters/* || oConfig.outParameters*/) {
|
|
450
|
-
aFilters = [oFilter];
|
|
451
|
-
if (oConfig.inParameters) {
|
|
452
|
-
aFilters.push(oConfig.inParameters);
|
|
453
|
-
aInParameters = []; // TODO: maybe provide paths from outside? No need to analyze Filters backwards
|
|
454
|
-
if (!oConfig.inParameters.aFilters) {
|
|
455
|
-
aInParameters.push(oConfig.inParameters.sPath);
|
|
456
|
-
} else {
|
|
457
|
-
for (i = 0; i < oConfig.inParameters.aFilters.length; i++) {
|
|
458
|
-
if (aInParameters.indexOf(oConfig.inParameters.aFilters[i].sPath) < 0) {
|
|
459
|
-
aInParameters.push(oConfig.inParameters.aFilters[i].sPath);
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
// if (oConfig.outParameters) {
|
|
465
|
-
// aFilters.push(oConfig.outParameters);
|
|
466
|
-
// }
|
|
467
|
-
oFilter = new Filter({filters: aFilters, and: true});
|
|
468
|
-
}
|
|
428
|
+
var oFilter = _createItemFilters.call(this, oConfig, oInitialConditions);
|
|
469
429
|
|
|
470
430
|
var aFilteredItems = FilterProcessor.apply(aItems, oFilter, _getFilterValue);
|
|
471
431
|
if (aFilteredItems.length === 1) {
|
|
472
|
-
var
|
|
473
|
-
|
|
432
|
+
var oBindingContext = aFilteredItems[0].getBindingContext(sModelName);
|
|
433
|
+
var oValue = this._getItemFromContext(oBindingContext, {inParameters: aInParameters, outParameters: aOutParameters});
|
|
434
|
+
return {key: oValue.key, description: oValue.description, payload: oValue.payload};
|
|
474
435
|
} else if (aFilteredItems.length > 1) {
|
|
475
436
|
if (!oConfig.caseSensitive) {
|
|
476
437
|
// try with case sensitive search
|
|
477
438
|
var oNewConfig = merge({}, oConfig);
|
|
478
439
|
oNewConfig.caseSensitive = true;
|
|
479
|
-
return _filterItems.call(this, oNewConfig, aItems);
|
|
440
|
+
return _filterItems.call(this, oNewConfig, aItems, oInitialConditions);
|
|
441
|
+
}
|
|
442
|
+
throw _createException.call(this, oConfig.exception, true, oConfig.parsedValue || oConfig.value);
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
function _createItemFilters(oConfig, oInitialConditions) {
|
|
448
|
+
|
|
449
|
+
var bCaseSensitive = oConfig.caseSensitive;
|
|
450
|
+
var sKeyPath = this.getKeyPath();
|
|
451
|
+
var sDescriptionPath = this.getDescriptionPath();
|
|
452
|
+
var aFilters = [];
|
|
453
|
+
if (oConfig.checkKey && oConfig.hasOwnProperty("parsedValue")) { // empty string or false could be key too
|
|
454
|
+
aFilters.push(new Filter({ path: sKeyPath, operator: FilterOperator.EQ, value1: oConfig.parsedValue, caseSensitive: bCaseSensitive}));
|
|
455
|
+
}
|
|
456
|
+
if (oConfig.checkDescription && oConfig.value) {
|
|
457
|
+
aFilters.push(new Filter({path: sDescriptionPath, operator: FilterOperator.EQ, value1: oConfig.value, caseSensitive: bCaseSensitive}));
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
var oFilter = aFilters.length > 1 ? new Filter({filters: aFilters, and: false}) : aFilters[0];
|
|
461
|
+
|
|
462
|
+
if (oInitialConditions) {
|
|
463
|
+
var oConditionTypes = this._getTypesForConditions(oInitialConditions);
|
|
464
|
+
var oConditionsFilter = FilterConverter.createFilters(oInitialConditions, oConditionTypes, undefined, this.getCaseSensitive());
|
|
465
|
+
if (oConditionsFilter) {
|
|
466
|
+
oFilter = new Filter({filters: [oFilter, oConditionsFilter], and: true});
|
|
480
467
|
}
|
|
481
|
-
throw _createException.call(this, oConfig.exception, true, aFields[0].value);
|
|
482
468
|
}
|
|
483
469
|
|
|
470
|
+
return oFilter;
|
|
471
|
+
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
function _checkListBindingPending() {
|
|
475
|
+
return this._retrievePromise("listBinding").then(function (oListBinding) {
|
|
476
|
+
var oDelegate = this._getValueHelpDelegate();
|
|
477
|
+
var oDelegatePayload = this._getValueHelpDelegatePayload();
|
|
478
|
+
var oListBindingInfo = this._getListBindingInfo();
|
|
479
|
+
if (oListBinding && oDelegate){
|
|
480
|
+
return oDelegate.checkListBindingPending(oDelegatePayload, oListBinding, oListBindingInfo);
|
|
481
|
+
} else {
|
|
482
|
+
return true;
|
|
483
|
+
}
|
|
484
|
+
}.bind(this));
|
|
484
485
|
}
|
|
485
486
|
|
|
486
|
-
MTable.prototype.
|
|
487
|
+
MTable.prototype.getListBinding = function () {
|
|
487
488
|
var oTable = this._getTable();
|
|
488
489
|
return oTable && oTable.getBinding("items");
|
|
489
490
|
};
|
|
@@ -493,7 +494,7 @@ sap.ui.define([
|
|
|
493
494
|
return oTable && oTable.getBindingInfo("items");
|
|
494
495
|
};
|
|
495
496
|
|
|
496
|
-
MTable.prototype._loadItemForValue = function (oConfig) {
|
|
497
|
+
MTable.prototype._loadItemForValue = function (oConfig, oInitialConditions) {
|
|
497
498
|
|
|
498
499
|
if (!oConfig.checkKey && oConfig.parsedValue && !oConfig.checkDescription) {
|
|
499
500
|
return null;
|
|
@@ -506,7 +507,6 @@ sap.ui.define([
|
|
|
506
507
|
var sKeyPath = this.getKeyPath();
|
|
507
508
|
var sDescriptionPath = this.getDescriptionPath();
|
|
508
509
|
var bUseFirstMatch = this.getUseFirstMatch();
|
|
509
|
-
var bCaseSensitive = oConfig.caseSensitive;
|
|
510
510
|
|
|
511
511
|
var oTable = this._getTable();
|
|
512
512
|
var oListBinding = oTable && oTable.getBinding("items"); //this.getListBinding();
|
|
@@ -520,66 +520,7 @@ sap.ui.define([
|
|
|
520
520
|
var sPromiseKey = ["loadItemForValue", sPath, sKeyPath, oConfig.parsedValue || oConfig.value].join("_");
|
|
521
521
|
|
|
522
522
|
return this._retrievePromise(sPromiseKey, function () {
|
|
523
|
-
|
|
524
|
-
var aFilters = [];
|
|
525
|
-
|
|
526
|
-
if (oConfig.checkKey && oConfig.hasOwnProperty("parsedValue")) { // empty string or false could be key too
|
|
527
|
-
aFilters.push(new Filter({ path: sKeyPath, operator: FilterOperator.EQ, value1: oConfig.parsedValue, caseSensitive: bCaseSensitive}));
|
|
528
|
-
}
|
|
529
|
-
if (oConfig.checkDescription && oConfig.value) {
|
|
530
|
-
aFilters.push(new Filter({path: sDescriptionPath, operator: FilterOperator.EQ, value1: oConfig.value, caseSensitive: bCaseSensitive}));
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
var oFilter = aFilters.length > 1 ? new Filter({filters: aFilters, and: false}) : aFilters[0];
|
|
534
|
-
aFilters = [oFilter];
|
|
535
|
-
|
|
536
|
-
var aInParameters;
|
|
537
|
-
if (oConfig.inParameters) {
|
|
538
|
-
// use in-parameters as additional filters
|
|
539
|
-
aFilters.push(oConfig.inParameters);
|
|
540
|
-
aInParameters = []; // TODO: maybe provide paths from outside? No need to analyze Filters backwards
|
|
541
|
-
if (!oConfig.inParameters.aFilters) {
|
|
542
|
-
aInParameters.push(oConfig.inParameters.sPath);
|
|
543
|
-
} else {
|
|
544
|
-
for (var i = 0; i < oConfig.inParameters.aFilters.length; i++) {
|
|
545
|
-
var oInFilter = oConfig.inParameters.aFilters[i];
|
|
546
|
-
if (oInFilter.aFilters) {
|
|
547
|
-
for (var j = 0; j < oInFilter.aFilters.length; j++) {
|
|
548
|
-
if (oInFilter.aFilters[j].sPath && aInParameters.indexOf(oInFilter.aFilters[j].sPath) < 0) {
|
|
549
|
-
aInParameters.push(oInFilter.aFilters[j].sPath);
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
} else if (oInFilter.sPath && aInParameters.indexOf(oInFilter.sPath) < 0) {
|
|
553
|
-
aInParameters.push(oInFilter.sPath);
|
|
554
|
-
}
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
// if (oConfig.oOutParameters) {
|
|
559
|
-
// // use out-parameters as additional filters (only if not already set by InParameter
|
|
560
|
-
// if (oConfig.oInParameters) {
|
|
561
|
-
// var aOutFilters = oConfig.oOutParameters.aFilters ? oConfig.oOutParameters.aFilters : [oConfig.oOutParameters];
|
|
562
|
-
// var aInFilters = oConfig.oInParameters.aFilters ? oConfig.oInParameters.aFilters : [oConfig.oInParameters];
|
|
563
|
-
// for (var i = 0; i < aOutFilters.length; i++) {
|
|
564
|
-
// var oOutFilter = aOutFilters[i];
|
|
565
|
-
// var bFound = false;
|
|
566
|
-
// for (var j = 0; j < aInFilters.length; j++) {
|
|
567
|
-
// var oInFilter = aInFilters[j];
|
|
568
|
-
// if (oInFilter.sPath === oOutFilter.sPath && oInFilter.oValue1 === oOutFilter.oValue1 && oInFilter.oValue2 === oOutFilter.oValue2) {
|
|
569
|
-
// bFound = true;
|
|
570
|
-
// break;
|
|
571
|
-
// }
|
|
572
|
-
// }
|
|
573
|
-
// if (!bFound) {
|
|
574
|
-
// aFilters.push(oOutFilter);
|
|
575
|
-
// }
|
|
576
|
-
// }
|
|
577
|
-
// } else {
|
|
578
|
-
// aFilters.push(oConfig.oOutParameters);
|
|
579
|
-
// }
|
|
580
|
-
// }
|
|
581
|
-
|
|
582
|
-
oFilter = aFilters.length > 1 ? new Filter({filters: aFilters, and: true}) : aFilters[0];
|
|
523
|
+
var oFilter = _createItemFilters.call(this, oConfig, oInitialConditions);
|
|
583
524
|
var oFilterListBinding = oModel.bindList(sPath, oBindingContext);
|
|
584
525
|
|
|
585
526
|
return oDelegate.executeFilter(oDelegatePayload, oFilterListBinding, oFilter, 2).then(function (oBinding) {
|
|
@@ -590,7 +531,7 @@ sap.ui.define([
|
|
|
590
531
|
}, 0);
|
|
591
532
|
|
|
592
533
|
if (aContexts.length && (aContexts.length < 2 || bUseFirstMatch)) {
|
|
593
|
-
return this._getItemFromContext(aContexts[0], {keyPath: sKeyPath, descriptionPath: sDescriptionPath, inParameters:
|
|
534
|
+
return this._getItemFromContext(aContexts[0], {keyPath: sKeyPath, descriptionPath: sDescriptionPath, inParameters: undefined});
|
|
594
535
|
} else if (oConfig.checkKey && oConfig.parsedValue === "" && aContexts.length === 0) {
|
|
595
536
|
// nothing found for empty key -> this is not an error
|
|
596
537
|
return null;
|
|
@@ -622,7 +563,7 @@ sap.ui.define([
|
|
|
622
563
|
|
|
623
564
|
MTable.prototype.navigate = function (iStep) {
|
|
624
565
|
|
|
625
|
-
var oListBinding = this.
|
|
566
|
+
var oListBinding = this.getListBinding();
|
|
626
567
|
|
|
627
568
|
if (!oListBinding || !oListBinding.getLength()) {
|
|
628
569
|
return _checkListBindingPending.call(this).then(function (bPending) {
|
|
@@ -697,8 +638,11 @@ sap.ui.define([
|
|
|
697
638
|
if (oItem !== oSelectedItem) {
|
|
698
639
|
oItem.setSelected(true);
|
|
699
640
|
|
|
700
|
-
var
|
|
701
|
-
|
|
641
|
+
var oBindingInfo = this._getListBindingInfo();
|
|
642
|
+
var sModelName = oBindingInfo.model;
|
|
643
|
+
var oItemContext = oItem.getBindingContext(sModelName);
|
|
644
|
+
var oValues = this._getItemFromContext(oItemContext);
|
|
645
|
+
oCondition = oValues && this._createCondition(oValues.key, oValues.description, oValues.payload);
|
|
702
646
|
this.setProperty("conditions", [oCondition], true);
|
|
703
647
|
|
|
704
648
|
if (this._bVisible) {
|
|
@@ -805,41 +749,12 @@ sap.ui.define([
|
|
|
805
749
|
_adjustTable.call(this);
|
|
806
750
|
};
|
|
807
751
|
|
|
808
|
-
|
|
752
|
+
MTable.prototype._handleSearch = function (oEvent) {
|
|
809
753
|
return this.applyFilters(this.getFilterValue());
|
|
810
754
|
};
|
|
811
755
|
|
|
812
756
|
MTable.prototype._observeChanges = function (oChanges) {
|
|
813
757
|
|
|
814
|
-
var oFilterBar, oDefaultFilterBar;
|
|
815
|
-
if (oChanges.name === "_defaultFilterBar") {
|
|
816
|
-
oDefaultFilterBar = oChanges.child;
|
|
817
|
-
if (oChanges.mutation === "insert") {
|
|
818
|
-
oFilterBar = this.getFilterBar();
|
|
819
|
-
if (!oFilterBar) {
|
|
820
|
-
oDefaultFilterBar.attachSearch(_handleSearch, this);
|
|
821
|
-
}
|
|
822
|
-
} else {
|
|
823
|
-
oDefaultFilterBar.detachSearch(_handleSearch, this);
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
|
|
827
|
-
if (oChanges.name === "filterBar") {
|
|
828
|
-
oFilterBar = oChanges.child;
|
|
829
|
-
oDefaultFilterBar = this.getAggregation("_defaultFilterBar");
|
|
830
|
-
if (oChanges.mutation === "insert") {
|
|
831
|
-
if (oDefaultFilterBar) {
|
|
832
|
-
oDefaultFilterBar.detachSearch(_handleSearch, this);
|
|
833
|
-
}
|
|
834
|
-
oFilterBar.attachSearch(_handleSearch, this);
|
|
835
|
-
} else {
|
|
836
|
-
if (oDefaultFilterBar) {
|
|
837
|
-
oDefaultFilterBar.attachSearch(_handleSearch, this);
|
|
838
|
-
}
|
|
839
|
-
oFilterBar.detachSearch(_handleSearch, this);
|
|
840
|
-
}
|
|
841
|
-
}
|
|
842
|
-
|
|
843
758
|
if (oChanges.name === "config") {
|
|
844
759
|
_adjustTable.call(this);
|
|
845
760
|
}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
sap.ui.define([
|
|
2
|
+
"sap/ui/test/Opa5",
|
|
2
3
|
"sap/ui/test/actions/Press",
|
|
3
4
|
"sap/base/Log",
|
|
4
5
|
"sap/ui/test/matchers/Ancestor",
|
|
5
|
-
"sap/ui/test/matchers/PropertyStrictEquals"
|
|
6
|
-
|
|
6
|
+
"sap/ui/test/matchers/PropertyStrictEquals",
|
|
7
|
+
"sap/ui/test/matchers/Properties",
|
|
8
|
+
"../p13n/Util",
|
|
9
|
+
"../p13n/waitForP13nButtonWithMatchers",
|
|
10
|
+
"../p13n/waitForP13nDialog"
|
|
11
|
+
], function (Opa5, Press, Log, Ancestor, PropertyStrictEquals, Properties, p13nUtil, waitForP13nButtonWithMatchers, waitForP13nDialog) {
|
|
7
12
|
"use strict";
|
|
8
13
|
|
|
9
14
|
var oCore = sap.ui.test.Opa5.getWindow().sap.ui.getCore();
|
|
15
|
+
var oMDCBundle = oCore.getLibraryResourceBundle("sap.ui.mdc");
|
|
10
16
|
|
|
11
17
|
var waitForMDCChartWithId = function(sId, oSettings) {
|
|
12
18
|
return this.waitFor({
|
|
@@ -85,6 +91,46 @@ sap.ui.define([
|
|
|
85
91
|
};
|
|
86
92
|
|
|
87
93
|
return {
|
|
94
|
+
iOpenThePersonalizationDialog: function(oControl, oSettings) {
|
|
95
|
+
var sControlId = typeof oControl === "string" ? oControl : oControl.getId();
|
|
96
|
+
var aDialogMatchers = [];
|
|
97
|
+
var aButtonMatchers = [];
|
|
98
|
+
return this.waitFor({
|
|
99
|
+
id: sControlId,
|
|
100
|
+
success: function(oControlInstance) {
|
|
101
|
+
Opa5.assert.ok(oControlInstance);
|
|
102
|
+
|
|
103
|
+
aButtonMatchers.push(new Ancestor(oControlInstance));
|
|
104
|
+
|
|
105
|
+
aDialogMatchers.push(new Ancestor(oControlInstance, false));
|
|
106
|
+
|
|
107
|
+
// Add matcher for p13n button icon
|
|
108
|
+
aButtonMatchers.push(new Properties({
|
|
109
|
+
icon: p13nUtil.icons.settings
|
|
110
|
+
}));
|
|
111
|
+
aDialogMatchers.push(new Properties({
|
|
112
|
+
title: oMDCBundle.getText("p13nDialog.VIEW_SETTINGS")
|
|
113
|
+
}));
|
|
114
|
+
|
|
115
|
+
waitForP13nButtonWithMatchers.call(this, {
|
|
116
|
+
actions: new Press(),
|
|
117
|
+
matchers: aButtonMatchers,
|
|
118
|
+
success: function() {
|
|
119
|
+
waitForP13nDialog.call(this, {
|
|
120
|
+
matchers: aDialogMatchers,
|
|
121
|
+
success: function(oP13nDialog) {
|
|
122
|
+
if (oSettings && typeof oSettings.success === "function") {
|
|
123
|
+
oSettings.success.call(this, oP13nDialog);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
},
|
|
128
|
+
errorMessage: "Control '" + sControlId + "' has no P13n button"
|
|
129
|
+
});
|
|
130
|
+
},
|
|
131
|
+
errorMessage: "Control '" + sControlId + "' not found."
|
|
132
|
+
});
|
|
133
|
+
},
|
|
88
134
|
/**
|
|
89
135
|
* Clicks on the "Zoom In" button in the toolbar of a mdc chart.
|
|
90
136
|
* @param {string} sId The id of the mdc chart
|
|
@@ -26,7 +26,6 @@ sap.ui.define([
|
|
|
26
26
|
* OPA5 test action
|
|
27
27
|
* This only works with the new chart personalization
|
|
28
28
|
* @param {sap.ui.core.Control | string} oChart Instance / ID of the <code>MDCChart</code> that is personalized
|
|
29
|
-
* @param {string} sChartType String containing the type of chart that is displayed
|
|
30
29
|
* @param {ChartPersonalizationConfiguration[]} aConfigurations Array containing the chart personalization configuration objects
|
|
31
30
|
* @returns {Promise} OPA waitFor
|
|
32
31
|
* 1. Opens the personalization dialog of a given chart.
|
|
@@ -34,8 +33,8 @@ sap.ui.define([
|
|
|
34
33
|
* 3. Executes the given ChartPersonalizationConfigurations.
|
|
35
34
|
* 4. Closes the personalization dialog.
|
|
36
35
|
*/
|
|
37
|
-
iPersonalizeChart: function(oChart,
|
|
38
|
-
return p13nActions.iPersonalizeChart.call(this, oChart,
|
|
36
|
+
iPersonalizeChart: function(oChart, aConfigurations){
|
|
37
|
+
return p13nActions.iPersonalizeChart.call(this, oChart, null, aConfigurations, true, chartActions.iOpenThePersonalizationDialog);
|
|
39
38
|
},
|
|
40
39
|
/**
|
|
41
40
|
* @typedef {object} SortPersonalizationConfiguration
|
|
@@ -52,7 +51,7 @@ sap.ui.define([
|
|
|
52
51
|
* 3. Closes the personalization dialog.
|
|
53
52
|
*/
|
|
54
53
|
iPersonalizeSort: function(oChart, aConfigurations) {
|
|
55
|
-
return p13nActions.iPersonalizeSort.call(this, oChart, aConfigurations);
|
|
54
|
+
return p13nActions.iPersonalizeSort.call(this, oChart, aConfigurations, chartActions.iOpenThePersonalizationDialog);
|
|
56
55
|
},
|
|
57
56
|
/**
|
|
58
57
|
* Opa5 test action
|
|
@@ -64,7 +63,7 @@ sap.ui.define([
|
|
|
64
63
|
* 4. Closes the personalization dialog.
|
|
65
64
|
*/
|
|
66
65
|
iResetThePersonalization: function(oChart) {
|
|
67
|
-
return p13nActions.iResetThePersonalization.call(this, oChart);
|
|
66
|
+
return p13nActions.iResetThePersonalization.call(this, oChart, chartActions.iOpenThePersonalizationDialog);
|
|
68
67
|
},
|
|
69
68
|
|
|
70
69
|
/**
|
|
@@ -268,6 +267,7 @@ sap.ui.define([
|
|
|
268
267
|
},
|
|
269
268
|
/**
|
|
270
269
|
* Assertion to check visible dimensions on the MDC Chart
|
|
270
|
+
* @param {array} aDimensions
|
|
271
271
|
* @param {string} sId Id of the MDC Chart
|
|
272
272
|
* @returns {Promise} OPA waitFor
|
|
273
273
|
*/
|
|
@@ -276,6 +276,7 @@ sap.ui.define([
|
|
|
276
276
|
},
|
|
277
277
|
/**
|
|
278
278
|
* Assertion to check visible measures on the MDC Chart
|
|
279
|
+
* @param {array} aMeasures
|
|
279
280
|
* @param {string} sId Id of the MDC Chart
|
|
280
281
|
* @returns {Promise} OPA waitFor
|
|
281
282
|
*/
|
|
@@ -26,7 +26,6 @@ sap.ui.define([
|
|
|
26
26
|
* OPA5 test action
|
|
27
27
|
* This only works with the new chart personalization
|
|
28
28
|
* @param {sap.ui.core.Control | string} oChart Instance / ID of the <code>MDCChart</code> that is personalized
|
|
29
|
-
* @param {string} sChartType String containing the type of chart that is displayed
|
|
30
29
|
* @param {ChartPersonalizationConfiguration[]} aConfigurations Array containing the chart personalization configuration objects
|
|
31
30
|
* @returns {Promise} OPA waitFor
|
|
32
31
|
* 1. Opens the personalization dialog of a given chart.
|
|
@@ -34,8 +33,8 @@ sap.ui.define([
|
|
|
34
33
|
* 3. Executes the given ChartPersonalizationConfigurations.
|
|
35
34
|
* 4. Closes the personalization dialog.
|
|
36
35
|
*/
|
|
37
|
-
iPersonalizeChart: function(oChart,
|
|
38
|
-
return p13nActions.iPersonalizeChart.call(this, oChart,
|
|
36
|
+
iPersonalizeChart: function(oChart, aConfigurations){
|
|
37
|
+
return p13nActions.iPersonalizeChart.call(this, oChart, null, aConfigurations, true, chartActions.iOpenThePersonalizationDialog);
|
|
39
38
|
},
|
|
40
39
|
/**
|
|
41
40
|
* @typedef {object} SortPersonalizationConfiguration
|
|
@@ -52,7 +51,7 @@ sap.ui.define([
|
|
|
52
51
|
* 3. Closes the personalization dialog.
|
|
53
52
|
*/
|
|
54
53
|
iPersonalizeSort: function(oChart, aConfigurations) {
|
|
55
|
-
return p13nActions.iPersonalizeSort.call(this, oChart, aConfigurations);
|
|
54
|
+
return p13nActions.iPersonalizeSort.call(this, oChart, aConfigurations, chartActions.iOpenThePersonalizationDialog);
|
|
56
55
|
},
|
|
57
56
|
/**
|
|
58
57
|
* Opa5 test action
|
|
@@ -64,7 +63,7 @@ sap.ui.define([
|
|
|
64
63
|
* 4. Closes the personalization dialog.
|
|
65
64
|
*/
|
|
66
65
|
iResetThePersonalization: function(oChart) {
|
|
67
|
-
return p13nActions.iResetThePersonalization.call(this, oChart);
|
|
66
|
+
return p13nActions.iResetThePersonalization.call(this, oChart, chartActions.iOpenThePersonalizationDialog);
|
|
68
67
|
},
|
|
69
68
|
|
|
70
69
|
/**
|