@openui5/sap.ui.mdc 1.124.2 → 1.126.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.reuse/dep5 +9 -4
- package/THIRDPARTY.txt +13 -6
- package/package.json +4 -4
- package/src/sap/ui/mdc/.library +1 -1
- package/src/sap/ui/mdc/ActionToolbar.js +2 -2
- package/src/sap/ui/mdc/Chart.js +69 -40
- package/src/sap/ui/mdc/ChartDelegate.js +50 -26
- package/src/sap/ui/mdc/Control.js +1 -1
- package/src/sap/ui/mdc/DefaultTypeMap.js +1 -1
- package/src/sap/ui/mdc/Element.js +1 -1
- package/src/sap/ui/mdc/Field.js +2 -2
- package/src/sap/ui/mdc/FilterBar.js +55 -7
- package/src/sap/ui/mdc/FilterField.js +68 -11
- package/src/sap/ui/mdc/Link.js +6 -5
- package/src/sap/ui/mdc/MultiValueField.js +1 -1
- package/src/sap/ui/mdc/Table.js +8 -2
- package/src/sap/ui/mdc/ValueHelp.js +22 -1
- package/src/sap/ui/mdc/actiontoolbar/ActionToolbarAction.js +1 -1
- package/src/sap/ui/mdc/chart/ChartImplementationContainer.js +1 -1
- package/src/sap/ui/mdc/chart/ChartSelectionDetails.js +220 -113
- package/src/sap/ui/mdc/chart/PropertyHelper.js +1 -1
- package/src/sap/ui/mdc/chart/ToolbarControlFactory.js +10 -6
- package/src/sap/ui/mdc/condition/Condition.js +1 -1
- package/src/sap/ui/mdc/condition/ConditionConverter.js +1 -1
- package/src/sap/ui/mdc/condition/ConditionModel.js +1 -1
- package/src/sap/ui/mdc/condition/ConditionModelPropertyBinding.js +22 -4
- package/src/sap/ui/mdc/condition/FilterConverter.js +1 -1
- package/src/sap/ui/mdc/condition/FilterOperatorUtil.js +19 -11
- package/src/sap/ui/mdc/condition/Operator.js +3 -3
- package/src/sap/ui/mdc/condition/OperatorDynamicDateOption.js +2 -2
- package/src/sap/ui/mdc/condition/RangeOperator.js +34 -8
- package/src/sap/ui/mdc/designtime/field/Field.designtime.js +6 -3
- package/src/sap/ui/mdc/field/ConditionType.js +35 -40
- package/src/sap/ui/mdc/field/ConditionTypeMixin.js +1 -1
- package/src/sap/ui/mdc/field/ConditionsType.js +10 -6
- package/src/sap/ui/mdc/field/CustomFieldInfo.js +1 -1
- package/src/sap/ui/mdc/field/DynamicDateRangeConditionsType.js +1 -1
- package/src/sap/ui/mdc/field/FieldBase.js +66 -22
- package/src/sap/ui/mdc/field/FieldInfoBase.js +12 -3
- 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 +108 -4
- 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/TokenDisplay.js +1 -1
- package/src/sap/ui/mdc/field/TokenizerDisplay.js +1 -1
- package/src/sap/ui/mdc/field/TokenizerDisplayRenderer.js +1 -0
- package/src/sap/ui/mdc/field/content/DateContent.js +2 -2
- package/src/sap/ui/mdc/field/content/DefaultContent.js +4 -4
- package/src/sap/ui/mdc/field/content/UnitContent.js +3 -3
- package/src/sap/ui/mdc/filterbar/FilterBarBase.js +19 -3
- package/src/sap/ui/mdc/filterbar/PropertyHelper.js +1 -1
- package/src/sap/ui/mdc/filterbar/p13n/AdaptationFilterBar.js +2 -2
- package/src/sap/ui/mdc/filterbar/vh/FilterBar.js +1 -1
- package/src/sap/ui/mdc/flexibility/Chart.flexibility.js +1 -1
- 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/Panel.flexibility.js +90 -100
- package/src/sap/ui/mdc/flexibility/Util.js +5 -2
- package/src/sap/ui/mdc/library.js +2 -2
- package/src/sap/ui/mdc/link/Factory.js +1 -1
- package/src/sap/ui/mdc/link/LinkItem.js +1 -1
- package/src/sap/ui/mdc/link/Panel.js +12 -15
- package/src/sap/ui/mdc/link/PanelItem.js +1 -1
- package/src/sap/ui/mdc/link/SemanticObjectMapping.js +1 -1
- package/src/sap/ui/mdc/link/SemanticObjectMappingItem.js +1 -1
- package/src/sap/ui/mdc/link/SemanticObjectUnavailableAction.js +1 -1
- package/src/sap/ui/mdc/messagebundle.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_ar.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_bg.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_ca.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_cnr.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_cs.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_cy.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_da.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_de.properties +5 -2
- package/src/sap/ui/mdc/messagebundle_el.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_en.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_en_GB.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_en_US_saprigi.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_es.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_es_MX.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_et.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_fi.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_fr.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_fr_CA.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_hi.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_hr.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_hu.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_id.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_it.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_iw.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_ja.properties +5 -2
- package/src/sap/ui/mdc/messagebundle_kk.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_ko.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_lt.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_lv.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_mk.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_ms.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_nl.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_no.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_pl.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_pt.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_pt_PT.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_ro.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_ru.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_sh.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_sk.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_sl.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_sr.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_sv.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_th.properties +4 -1
- package/src/sap/ui/mdc/messagebundle_tr.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_uk.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_vi.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_zh_CN.properties +3 -0
- package/src/sap/ui/mdc/messagebundle_zh_TW.properties +3 -0
- package/src/sap/ui/mdc/mixin/AdaptationMixin.js +1 -1
- package/src/sap/ui/mdc/mixin/DelegateMixin.js +1 -1
- package/src/sap/ui/mdc/mixin/FilterIntegrationMixin.js +1 -1
- package/src/sap/ui/mdc/mixin/PromiseMixin.js +1 -1
- package/src/sap/ui/mdc/mixin/PropertyHelperMixin.js +1 -1
- package/src/sap/ui/mdc/odata/TypeMap.js +1 -1
- package/src/sap/ui/mdc/odata/v4/ChartDelegate.js +3 -1
- package/src/sap/ui/mdc/odata/v4/TypeMap.js +1 -1
- package/src/sap/ui/mdc/odata/v4/vizChart/ChartDelegate.js +1 -1
- package/src/sap/ui/mdc/p13n/PropertyHelper.js +1 -1
- package/src/sap/ui/mdc/p13n/panels/AdaptFiltersPanel.js +10 -3
- package/src/sap/ui/mdc/p13n/subcontroller/ColumnController.js +7 -3
- package/src/sap/ui/mdc/table/Column.js +6 -0
- package/src/sap/ui/mdc/table/ColumnSettings.js +1 -1
- package/src/sap/ui/mdc/table/CreationRow.js +1 -1
- package/src/sap/ui/mdc/table/DragDropConfig.js +37 -13
- package/src/sap/ui/mdc/table/GridTableType.js +1 -1
- package/src/sap/ui/mdc/table/PropertyHelper.js +1 -1
- package/src/sap/ui/mdc/table/ResponsiveColumnSettings.js +1 -1
- package/src/sap/ui/mdc/table/ResponsiveTableType.js +6 -7
- package/src/sap/ui/mdc/table/RowActionItem.js +2 -1
- package/src/sap/ui/mdc/table/RowSettings.js +1 -1
- package/src/sap/ui/mdc/table/TableTypeBase.js +1 -0
- package/src/sap/ui/mdc/table/V4AnalyticsPropertyHelper.js +1 -1
- package/src/sap/ui/mdc/table/utils/Personalization.js +1 -1
- package/src/sap/ui/mdc/themes/base/PersonalizationDialog.less +4 -4
- package/src/sap/ui/mdc/themes/base/Table.less +1 -0
- package/src/sap/ui/mdc/ushell/LinkDelegate.js +25 -19
- package/src/sap/ui/mdc/ushell/SemanticObjectMapping.js +1 -1
- package/src/sap/ui/mdc/ushell/SemanticObjectMappingItem.js +1 -1
- package/src/sap/ui/mdc/ushell/SemanticObjectUnavailableAction.js +1 -1
- package/src/sap/ui/mdc/util/InfoBar.js +1 -1
- package/src/sap/ui/mdc/util/PromiseCache.js +1 -1
- package/src/sap/ui/mdc/util/PropertyHelper.js +1 -1
- package/src/sap/ui/mdc/valuehelp/Dialog.js +2 -2
- package/src/sap/ui/mdc/valuehelp/FilterBar.js +1 -1
- package/src/sap/ui/mdc/valuehelp/Popover.js +21 -3
- package/src/sap/ui/mdc/valuehelp/base/Container.js +28 -1
- package/src/sap/ui/mdc/valuehelp/base/Content.js +19 -1
- package/src/sap/ui/mdc/valuehelp/base/DefineConditionPanel.js +1 -1
- package/src/sap/ui/mdc/valuehelp/base/DialogTab.js +1 -1
- package/src/sap/ui/mdc/valuehelp/base/FilterableListContent.js +1 -1
- package/src/sap/ui/mdc/valuehelp/base/ListContent.js +1 -1
- package/src/sap/ui/mdc/valuehelp/content/Bool.js +1 -1
- package/src/sap/ui/mdc/valuehelp/content/Conditions.js +1 -1
- package/src/sap/ui/mdc/valuehelp/content/FixedList.js +1 -1
- package/src/sap/ui/mdc/valuehelp/content/FixedListItem.js +1 -1
- package/src/sap/ui/mdc/valuehelp/content/MDCTable.js +1 -1
- package/src/sap/ui/mdc/valuehelp/content/MTable.js +57 -45
- package/test/sap/ui/mdc/testutils/opa/chart/ActionsBase.js +339 -332
- package/test/sap/ui/mdc/testutils/opa/filterbar/Actions.js +7 -1
- package/test/sap/ui/mdc/testutils/opa/p13n/Actions.js +23 -1
- package/test/sap/ui/mdc/testutils/opa/p13n/Util.js +2 -1
- package/test/sap/ui/mdc/testutils/opa/valueHelp/Actions.js +6 -2
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
sap.ui.define([
|
|
7
7
|
'sap/ui/mdc/condition/Operator',
|
|
8
8
|
'sap/ui/mdc/util/DateUtil',
|
|
9
|
+
'sap/ui/mdc/enums/OperatorValueType',
|
|
9
10
|
'sap/ui/model/Filter',
|
|
10
11
|
'sap/ui/model/FilterOperator',
|
|
11
12
|
'sap/base/Log'
|
|
@@ -14,6 +15,7 @@ sap.ui.define([
|
|
|
14
15
|
(
|
|
15
16
|
Operator,
|
|
16
17
|
DateUtil,
|
|
18
|
+
OperatorValueType,
|
|
17
19
|
Filter,
|
|
18
20
|
FilterOperator,
|
|
19
21
|
Log
|
|
@@ -25,17 +27,19 @@ sap.ui.define([
|
|
|
25
27
|
* Creates a <code>sap.ui.mdc.condition.RangeOperator</code> object.
|
|
26
28
|
* This is used in the {@link sap.ui.mdc.FilterField FilterField} control to define which filter operators are supported.
|
|
27
29
|
*
|
|
30
|
+
* <b>Note:</b> Use this class only for filter field of type date or time related data types.
|
|
31
|
+
*
|
|
28
32
|
* If a function or property is initial, the default implementation is used.
|
|
29
33
|
*
|
|
30
34
|
* @extends sap.ui.mdc.condition.Operator
|
|
31
35
|
* @param {object} oConfiguration Included all parameters of {@link sap.ui.mdc.condition.Operator Operator} and adds some special ones
|
|
32
36
|
* @param {string} [oConfiguration.label] additional array of labels for the values of the operator. Will be shown as placeholder text or label on the value fields.
|
|
33
|
-
* @param {function}
|
|
37
|
+
* @param {function} oConfiguration.calcRange function to calculate the date range of the operation. The function returns an array of UniversalDates. In case of a single <code>filterOperator</code> the array can return a single value.
|
|
34
38
|
* @param {function} [oConfiguration.formatRange] function to format the date range.
|
|
35
39
|
* @param {int[]|function} [oConfiguration.defaultValues] Array of values for the defaults of <code>RangeOperators</code> parameter. This can be a function, which returns the array of values. If not used the default for the values is 1.
|
|
36
40
|
* @constructor
|
|
37
41
|
* @author SAP SE
|
|
38
|
-
* @version 1.
|
|
42
|
+
* @version 1.126.0
|
|
39
43
|
* @public
|
|
40
44
|
* @alias sap.ui.mdc.condition.RangeOperator
|
|
41
45
|
* @since 1.74.0
|
|
@@ -43,10 +47,19 @@ sap.ui.define([
|
|
|
43
47
|
*/
|
|
44
48
|
const RangeOperator = Operator.extend("sap.ui.mdc.condition.RangeOperator", /** @lends sap.ui.mdc.condition.RangeOperator.prototype */ {
|
|
45
49
|
constructor: function(oConfiguration) {
|
|
46
|
-
oConfiguration.filterOperator =
|
|
50
|
+
oConfiguration.filterOperator = oConfiguration.filterOperator || FilterOperator.BT;
|
|
47
51
|
if (oConfiguration.valueTypes && oConfiguration.valueTypes.length > 0) {
|
|
48
|
-
oConfiguration.
|
|
49
|
-
|
|
52
|
+
if (oConfiguration.valueTypes[0] === OperatorValueType.Static) { // as static operators cannot hold any value only the text is interesting
|
|
53
|
+
if (oConfiguration.longText && oConfiguration.longText !== oConfiguration.tokenText) {
|
|
54
|
+
oConfiguration.tokenTest = oConfiguration.tokenTest || "^" + oConfiguration.longText + "$|^#tokenText#$"; // as static text don't need to be entered allow longText too
|
|
55
|
+
} else {
|
|
56
|
+
oConfiguration.tokenTest = oConfiguration.tokenTest || "^#tokenText#$";
|
|
57
|
+
}
|
|
58
|
+
oConfiguration.tokenParse = oConfiguration.tokenParse || "^(.+)?$"; // as no value can be entered, everything is valid (validity tested with tokenTest)
|
|
59
|
+
} else {
|
|
60
|
+
oConfiguration.tokenTest = oConfiguration.tokenTest || "^#tokenText#$";
|
|
61
|
+
oConfiguration.tokenParse = oConfiguration.tokenParse || "^#tokenText#$|^(.+)?$"; // if text not entered take everything as just argument might be entered
|
|
62
|
+
}
|
|
50
63
|
} else {
|
|
51
64
|
oConfiguration.tokenParse = oConfiguration.tokenParse || "^#tokenText#$";
|
|
52
65
|
}
|
|
@@ -85,7 +98,7 @@ sap.ui.define([
|
|
|
85
98
|
this.formatRange = oConfiguration.formatRange;
|
|
86
99
|
} else if (this.calcRange) {
|
|
87
100
|
this.formatRange = function(aRange, oDataType) {
|
|
88
|
-
return oDataType.formatValue(aRange[0], "string") + " - " + oDataType.formatValue(aRange[1], "string");
|
|
101
|
+
return oDataType.formatValue(aRange[0], "string") + (aRange[1] ? " - " + oDataType.formatValue(aRange[1], "string") : "");
|
|
89
102
|
};
|
|
90
103
|
}
|
|
91
104
|
|
|
@@ -94,7 +107,7 @@ sap.ui.define([
|
|
|
94
107
|
|
|
95
108
|
RangeOperator.prototype.getModelFilter = function(oCondition, sFieldPath, oType, bCaseSensitive, sBaseType) {
|
|
96
109
|
const aRange = this._getRange(oCondition.values, oType, sBaseType);
|
|
97
|
-
return new Filter({ path: sFieldPath, operator:
|
|
110
|
+
return new Filter({ path: sFieldPath, operator: this.filterOperator, value1: aRange[0], value2: aRange[1] });
|
|
98
111
|
};
|
|
99
112
|
|
|
100
113
|
RangeOperator.prototype._getRange = function(aValues, oType, sBaseType) {
|
|
@@ -109,7 +122,7 @@ sap.ui.define([
|
|
|
109
122
|
aRange = this.calcRange();
|
|
110
123
|
}
|
|
111
124
|
|
|
112
|
-
for (let i = 0; i <
|
|
125
|
+
for (let i = 0; i < aRange.length; i++) {
|
|
113
126
|
//the calcRange result must be converted from local time into the correct type format.
|
|
114
127
|
aRange[i] = DateUtil.dateToType(aRange[i].getJSDate(), oType, sBaseType);
|
|
115
128
|
}
|
|
@@ -131,6 +144,19 @@ sap.ui.define([
|
|
|
131
144
|
return this.formatRange(aRange, oType);
|
|
132
145
|
};
|
|
133
146
|
|
|
147
|
+
RangeOperator.prototype.format = function(oCondition, oType, sDisplay, bHideOperator, aCompositeTypes, oAdditionalType, aAdditionalCompositeTypes, sCustomFormat) { // sDisplay, oAdditionalType and aAdditionalCompositeTypes needed in EQ formatter
|
|
148
|
+
|
|
149
|
+
const sTokenText = sCustomFormat || this.tokenFormat;
|
|
150
|
+
|
|
151
|
+
if (this.valueTypes.length === 1 && this.valueTypes[0] === OperatorValueType.Static && sTokenText.indexOf("{0}") >= 0) {
|
|
152
|
+
// for static Operators what should display a real value use static text
|
|
153
|
+
const sReplace = this.getStaticText(oType);
|
|
154
|
+
return sTokenText.replace(new RegExp("\\{" + 0 + "\\}", "g"), sReplace);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return Operator.prototype.format.apply(this, arguments);
|
|
158
|
+
|
|
159
|
+
};
|
|
134
160
|
return RangeOperator;
|
|
135
161
|
|
|
136
162
|
}, /* bExport= */
|
|
@@ -8,10 +8,13 @@ sap.ui.define([
|
|
|
8
8
|
"sap/ui/core/Element",
|
|
9
9
|
'sap/ui/fl/Utils',
|
|
10
10
|
'sap/ui/fl/apply/api/FlexRuntimeInfoAPI',
|
|
11
|
-
'sap/m/p13n/Engine'
|
|
12
|
-
|
|
11
|
+
'sap/m/p13n/Engine',
|
|
12
|
+
"sap/ui/core/Lib"
|
|
13
|
+
], (Element, Utils, FlexRuntimeInfoAPI, Engine, Library) => {
|
|
13
14
|
"use strict";
|
|
14
15
|
|
|
16
|
+
const oRB = Library.getResourceBundleFor("sap.ui.mdc");
|
|
17
|
+
|
|
15
18
|
return {
|
|
16
19
|
properties: {
|
|
17
20
|
value: {
|
|
@@ -42,7 +45,7 @@ sap.ui.define([
|
|
|
42
45
|
actions: {
|
|
43
46
|
settings: {
|
|
44
47
|
"sap.ui.mdc": {
|
|
45
|
-
name: "info.POPOVER_DEFINE_LINKS",
|
|
48
|
+
name: oRB.getText("info.POPOVER_DEFINE_LINKS"),
|
|
46
49
|
isEnabled: (oControl) => !!oControl.getFieldInfo(),
|
|
47
50
|
handler: function(oControl, mPropertyBag) {
|
|
48
51
|
const oFieldInfo = oControl.getFieldInfo();
|
|
@@ -23,7 +23,8 @@ sap.ui.define([
|
|
|
23
23
|
'sap/ui/mdc/enums/ConditionValidated',
|
|
24
24
|
'sap/base/util/merge',
|
|
25
25
|
'sap/base/strings/whitespaceReplacer',
|
|
26
|
-
'sap/ui/base/SyncPromise'
|
|
26
|
+
'sap/ui/base/SyncPromise',
|
|
27
|
+
'sap/base/util/Deferred'
|
|
27
28
|
],
|
|
28
29
|
(
|
|
29
30
|
Element,
|
|
@@ -43,7 +44,8 @@ sap.ui.define([
|
|
|
43
44
|
ConditionValidated,
|
|
44
45
|
merge,
|
|
45
46
|
whitespaceReplacer,
|
|
46
|
-
SyncPromise
|
|
47
|
+
SyncPromise,
|
|
48
|
+
Deferred
|
|
47
49
|
) => {
|
|
48
50
|
"use strict";
|
|
49
51
|
|
|
@@ -59,7 +61,7 @@ sap.ui.define([
|
|
|
59
61
|
* @extends sap.ui.model.SimpleType
|
|
60
62
|
*
|
|
61
63
|
* @author SAP SE
|
|
62
|
-
* @version 1.
|
|
64
|
+
* @version 1.126.0
|
|
63
65
|
*
|
|
64
66
|
* @since 1.62.0
|
|
65
67
|
* @public
|
|
@@ -83,6 +85,7 @@ sap.ui.define([
|
|
|
83
85
|
* @param {object} [oFormatOptions.delegate] Field delegate to handle model-specific logic
|
|
84
86
|
* @param {object} [oFormatOptions.payload] Payload of the delegate
|
|
85
87
|
* @param {boolean} [oFormatOptions.preventGetDescription] If set, description is not read by <code>formatValue</code> as it is known that no description exists or might be set later
|
|
88
|
+
* @param {function(sap.ui.mdc.condition.ConditionObject,Promise<sap.ui.mdc.condition.ConditionObject>)} [oFormatOptions.awaitFormatCondition] Provides control access to condition enhancements done by the ConditionType during formatting (e.g. description retrieval for item condition)
|
|
86
89
|
* @param {string} [oFormatOptions.defaultOperatorName] Name of the default <code>Operator</code>
|
|
87
90
|
* @param {boolean} [oFormatOptions.convertWhitespaces] If set, whitespaces will be replaced by special characters to display whitespaces in HTML
|
|
88
91
|
* @param {sap.ui.core.Control} [oFormatOptions.control] Instance of the calling control
|
|
@@ -137,7 +140,9 @@ sap.ui.define([
|
|
|
137
140
|
*/
|
|
138
141
|
ConditionType.prototype.formatValue = function(oCondition, sTargetType) {
|
|
139
142
|
|
|
143
|
+
let oType = this._getValueType();
|
|
140
144
|
if (oCondition == undefined || oCondition == null || this._bDestroyed) { // if destroyed do nothing
|
|
145
|
+
_attachCurrentValueAtType.call(this, oCondition, oType); // initialize current value
|
|
141
146
|
return null;
|
|
142
147
|
}
|
|
143
148
|
|
|
@@ -150,7 +155,6 @@ sap.ui.define([
|
|
|
150
155
|
sTargetType = "string";
|
|
151
156
|
}
|
|
152
157
|
|
|
153
|
-
let oType = this._getValueType();
|
|
154
158
|
const oAdditionalType = this._getAdditionalValueType();
|
|
155
159
|
const bIsUnit = this._isUnit(oType);
|
|
156
160
|
const bPreventGetDescription = this.oFormatOptions.preventGetDescription;
|
|
@@ -177,36 +181,38 @@ sap.ui.define([
|
|
|
177
181
|
const oBindingContext = this.oFormatOptions.bindingContext;
|
|
178
182
|
const vKey = bIsUnit ? oCondition.values[0][1] : oCondition.values[0];
|
|
179
183
|
|
|
184
|
+
// Provides communication of ongoing async formatting incl. description retrieval to the observing control (to allow FilterFields to persist the description in the ConditionModel)
|
|
185
|
+
const fnAwaitFormatCondition = this.oFormatOptions.awaitFormatCondition;
|
|
186
|
+
const oFormatConditionDeferred = fnAwaitFormatCondition && new Deferred();
|
|
187
|
+
fnAwaitFormatCondition?.(oCondition, oFormatConditionDeferred.promise);
|
|
188
|
+
|
|
180
189
|
return SyncPromise.resolve().then(() => {
|
|
181
190
|
return _getDescription.call(this, vKey, oCondition, oType, oAdditionalType, oBindingContext);
|
|
182
191
|
}).then((vDescription) => { // if description needs to be requested -> return if it is resolved
|
|
192
|
+
const oFormatCondition = merge({}, oCondition); // do not manipulate original object
|
|
183
193
|
if (vDescription) {
|
|
184
194
|
oCondition = merge({}, oCondition); // do not manipulate original object
|
|
185
|
-
if (bIsUnit) {
|
|
186
|
-
// in unit case create "standard" condition using String type for text arrangement
|
|
195
|
+
if (bIsUnit) { // in unit case create "standard" condition using String type for text arrangement
|
|
187
196
|
oType = this._getDefaultType();
|
|
188
197
|
oCondition.operator = oEQOperator.name;
|
|
189
198
|
if (typeof vDescription !== "object") {
|
|
190
199
|
vDescription = { key: vKey, description: vDescription };
|
|
191
200
|
}
|
|
192
201
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
} else {
|
|
199
|
-
oCondition.values[1] = vDescription;
|
|
200
|
-
}
|
|
202
|
+
const sDescription = typeof vDescription === "object" ? vDescription.description : vDescription;
|
|
203
|
+
oFormatCondition.values[1] = sDescription;
|
|
204
|
+
oFormatConditionDeferred?.resolve(oFormatCondition);
|
|
205
|
+
} else {
|
|
206
|
+
oFormatConditionDeferred?.reject(null);
|
|
201
207
|
}
|
|
202
|
-
return _returnResult.call(this,
|
|
208
|
+
return _returnResult.call(this, oFormatCondition, undefined, iCallCount, true, oType, oAdditionalType);
|
|
203
209
|
}).catch((oException) => {
|
|
204
210
|
let oMyException;
|
|
205
211
|
if (!(oException instanceof FormatException) || !_isInvalidInputAllowed.call(this)) {
|
|
206
212
|
// if "invalid" input is allowed don't fire an exception
|
|
207
213
|
oMyException = oException;
|
|
208
214
|
}
|
|
209
|
-
|
|
215
|
+
oFormatConditionDeferred?.reject(oException);
|
|
210
216
|
return _returnResult.call(this, oCondition, oMyException, iCallCount, true, oType, oAdditionalType);
|
|
211
217
|
}).unwrap();
|
|
212
218
|
}
|
|
@@ -310,7 +316,7 @@ sap.ui.define([
|
|
|
310
316
|
*
|
|
311
317
|
* @protected
|
|
312
318
|
*/
|
|
313
|
-
|
|
319
|
+
ConditionType.prototype.getTextForCopy = function(oCondition) {
|
|
314
320
|
|
|
315
321
|
// TODO: what if description is not known in the moment? Can copy be async?
|
|
316
322
|
const oOperator = FilterOperatorUtil.getOperator(oCondition.operator);
|
|
@@ -324,7 +330,7 @@ sap.ui.define([
|
|
|
324
330
|
|
|
325
331
|
return oOperator.getTextForCopy(oCondition, oType, sDisplay, bHideOperator, aCompositeTypes, oAdditionalType, aAdditionalCompositeTypes);
|
|
326
332
|
|
|
327
|
-
|
|
333
|
+
};
|
|
328
334
|
|
|
329
335
|
/**
|
|
330
336
|
* Parses an external value of the given source type to a condition that holds the value in model
|
|
@@ -904,17 +910,24 @@ sap.ui.define([
|
|
|
904
910
|
|
|
905
911
|
function _attachCurrentValueAtType(oCondition, oType) {
|
|
906
912
|
|
|
907
|
-
if (this._isCompositeType(oType)
|
|
908
|
-
|
|
913
|
+
if (this._isCompositeType(oType)) {
|
|
914
|
+
let aCurrentValue;
|
|
915
|
+
|
|
916
|
+
if (oCondition && oCondition.values[0]) {
|
|
917
|
+
aCurrentValue = oCondition.values[0];
|
|
918
|
+
} else {
|
|
919
|
+
aCurrentValue = []; // need to have an array to process it in Operator._parseValue
|
|
920
|
+
}
|
|
921
|
+
oType._aCurrentValue = merge([], aCurrentValue); // use copy to prevent changes on original arry change aCurrentValue too
|
|
909
922
|
|
|
910
923
|
const oAdditionalType = this._getAdditionalType();
|
|
911
924
|
if (this._isCompositeType(oAdditionalType)) { // store in corresponding unit or measure type too
|
|
912
|
-
oAdditionalType._aCurrentValue = merge([],
|
|
925
|
+
oAdditionalType._aCurrentValue = merge([], aCurrentValue);
|
|
913
926
|
}
|
|
914
927
|
|
|
915
928
|
const oOriginalType = this._getOriginalType();
|
|
916
929
|
if (this._isCompositeType(oOriginalType)) { // store in original type too (Currently not used in Unit/Currency type, but basically in CompositeType for parsing)
|
|
917
|
-
oOriginalType._aCurrentValue = merge([],
|
|
930
|
+
oOriginalType._aCurrentValue = merge([], aCurrentValue);
|
|
918
931
|
}
|
|
919
932
|
}
|
|
920
933
|
|
|
@@ -935,24 +948,6 @@ sap.ui.define([
|
|
|
935
948
|
|
|
936
949
|
}
|
|
937
950
|
|
|
938
|
-
function _mapResultToCondition(oCondition, oResult) {
|
|
939
|
-
|
|
940
|
-
oCondition.values = [oResult.key, oResult.description];
|
|
941
|
-
|
|
942
|
-
if (oResult.inParameters) {
|
|
943
|
-
oCondition.inParameters = oResult.inParameters;
|
|
944
|
-
}
|
|
945
|
-
if (oResult.outParameters) {
|
|
946
|
-
oCondition.outParameters = oResult.outParameters;
|
|
947
|
-
}
|
|
948
|
-
if (oResult.payload) {
|
|
949
|
-
oCondition.payload = oResult.payload;
|
|
950
|
-
}
|
|
951
|
-
|
|
952
|
-
return oCondition;
|
|
953
|
-
|
|
954
|
-
}
|
|
955
|
-
|
|
956
951
|
function _isInputValidationEnabled() {
|
|
957
952
|
|
|
958
953
|
const oValueHelp = _getValueHelp.call(this);
|
|
@@ -54,7 +54,7 @@ sap.ui.define([
|
|
|
54
54
|
* @extends sap.ui.model.SimpleType
|
|
55
55
|
*
|
|
56
56
|
* @author SAP SE
|
|
57
|
-
* @version 1.
|
|
57
|
+
* @version 1.126.0
|
|
58
58
|
*
|
|
59
59
|
* @since 1.62.0
|
|
60
60
|
* @public
|
|
@@ -197,11 +197,15 @@ sap.ui.define([
|
|
|
197
197
|
});
|
|
198
198
|
};
|
|
199
199
|
|
|
200
|
-
|
|
201
|
-
aSyncPromises.push(fnCreateSyncPromise.call(this,
|
|
200
|
+
if (aConditions.length === 0) { // call ConditionType with no condition to let it initialize types and so on (To have same behavior as ConditionType would be used in binding)
|
|
201
|
+
aSyncPromises.push(fnCreateSyncPromise.call(this, null, sTargetType));
|
|
202
|
+
} else {
|
|
203
|
+
for (let i = 0; i < aConditions.length; i++) {
|
|
204
|
+
aSyncPromises.push(fnCreateSyncPromise.call(this, aConditions[i], sTargetType));
|
|
202
205
|
|
|
203
|
-
|
|
204
|
-
|
|
206
|
+
if (iMaxConditions > 0 && i >= iMaxConditions - 1) {
|
|
207
|
+
break;
|
|
208
|
+
}
|
|
205
209
|
}
|
|
206
210
|
}
|
|
207
211
|
|
|
@@ -216,7 +220,7 @@ sap.ui.define([
|
|
|
216
220
|
for (let i = 0; i < aFormattedValues.length; i++) {
|
|
217
221
|
if (vValue) {
|
|
218
222
|
vValue = vValue + this._oResourceBundle.getText("field.SEPARATOR") + aFormattedValues[i];
|
|
219
|
-
} else {
|
|
223
|
+
} else if (aFormattedValues[i]) {
|
|
220
224
|
vValue = aFormattedValues[i];
|
|
221
225
|
}
|
|
222
226
|
}
|
|
@@ -16,7 +16,7 @@ sap.ui.define([
|
|
|
16
16
|
* @param {object} [mSettings] Initial settings for the new control
|
|
17
17
|
* @class A field help used in the <code>FieldInfo</code> aggregation in <code>FieldBase</code> controls that allows you to add custom content.
|
|
18
18
|
* @extends sap.ui.mdc.field.FieldInfoBase
|
|
19
|
-
* @version 1.
|
|
19
|
+
* @version 1.126.0
|
|
20
20
|
* @constructor
|
|
21
21
|
* @private
|
|
22
22
|
* @ui5-restricted sap.fe
|
|
@@ -99,7 +99,7 @@ sap.ui.define([
|
|
|
99
99
|
* @implements sap.ui.core.IFormContent, sap.ui.core.ISemanticFormContent, sap.m.IOverflowToolbarContent
|
|
100
100
|
*
|
|
101
101
|
* @author SAP SE
|
|
102
|
-
* @version 1.
|
|
102
|
+
* @version 1.126.0
|
|
103
103
|
*
|
|
104
104
|
* @constructor
|
|
105
105
|
* @alias sap.ui.mdc.field.FieldBase
|
|
@@ -671,6 +671,8 @@ sap.ui.define([
|
|
|
671
671
|
|
|
672
672
|
this._oCreateContentPromise = undefined;
|
|
673
673
|
|
|
674
|
+
this._oValueHelpRequestPromise = undefined;
|
|
675
|
+
|
|
674
676
|
this._sFilterValue = "";
|
|
675
677
|
|
|
676
678
|
};
|
|
@@ -755,6 +757,8 @@ sap.ui.define([
|
|
|
755
757
|
this._oObserver = undefined;
|
|
756
758
|
this._oCreateContentPromise = undefined;
|
|
757
759
|
|
|
760
|
+
this._oValueHelpRequestPromise = undefined;
|
|
761
|
+
|
|
758
762
|
const oValueHelp = _getValueHelp.call(this);
|
|
759
763
|
if (oValueHelp) {
|
|
760
764
|
if (this._bConnected) {
|
|
@@ -1051,8 +1055,8 @@ sap.ui.define([
|
|
|
1051
1055
|
* @returns {string} fieldPath of the field
|
|
1052
1056
|
* @private
|
|
1053
1057
|
* @ui5-restricted sap.ui.mdc.filterbar.FilterBarBase
|
|
1058
|
+
* @deprecated as of 1.115.0, replaced by {@link #setPropertyKey propertyKey} property
|
|
1054
1059
|
*/
|
|
1055
|
-
// @deprecated as of 1.115.0, replaced by {@link #setPropertyKey propertyKey} property
|
|
1056
1060
|
FieldBase.prototype.getFieldPath = function() {
|
|
1057
1061
|
|
|
1058
1062
|
const sBindingPath = this.getBindingPath("conditions");
|
|
@@ -2882,27 +2886,44 @@ sap.ui.define([
|
|
|
2882
2886
|
|
|
2883
2887
|
}
|
|
2884
2888
|
|
|
2885
|
-
|
|
2889
|
+
/* This allows FilterFields to defer valuehelp opening until all validated conditions are formatted and their descriptions are updated in the conditionmodel */
|
|
2890
|
+
function _waitForFormatting () {
|
|
2891
|
+
const oFormattingPromise = this.getFormattingPromise();
|
|
2892
|
+
const bModifyBusy = oFormattingPromise && !this.getBusy();
|
|
2893
|
+
if (bModifyBusy) {
|
|
2894
|
+
this.setBusy(true);
|
|
2895
|
+
}
|
|
2896
|
+
return oFormattingPromise?.finally(() => {
|
|
2897
|
+
if (bModifyBusy) {
|
|
2898
|
+
this.setBusy(false);
|
|
2899
|
+
}
|
|
2900
|
+
});
|
|
2901
|
+
}
|
|
2886
2902
|
|
|
2887
|
-
|
|
2903
|
+
async function _handleValueHelpRequest(oEvent, bOpenAsTypeahed) { // if triggered by valueHelpRequest event always open as dialog, if called from Tap or Focus as typeahead
|
|
2888
2904
|
|
|
2889
|
-
|
|
2905
|
+
const oValueHelp = _getValueHelp.call(this);
|
|
2906
|
+
if (oValueHelp && !this._oValueHelpRequestPromise) {
|
|
2890
2907
|
if (this._fnLiveChangeTimer) { // as live change might pending we need to update the filterValue
|
|
2891
2908
|
this._fnLiveChangeTimer.flush();
|
|
2892
2909
|
}
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2910
|
+
this._oValueHelpRequestPromise = _waitForFormatting.call(this);
|
|
2911
|
+
await this._oValueHelpRequestPromise;
|
|
2912
|
+
if (!this.isFieldDestroyed()) {
|
|
2913
|
+
oValueHelp.setFilterValue(this._sFilterValue); // use types value for filtering, even if reopening ValueHelp
|
|
2914
|
+
const aConditions = this.getConditions();
|
|
2915
|
+
_setConditionsOnValueHelp.call(this, aConditions, oValueHelp);
|
|
2916
|
+
oValueHelp.toggleOpen(!!bOpenAsTypeahed);
|
|
2917
|
+
const oContent = oEvent.srcControl || oEvent.getSource(); // as, if called from Tap or other browser event getSource is not available
|
|
2918
|
+
if (!oValueHelp.isFocusInHelp()) {
|
|
2919
|
+
// need to reset bValueHelpRequested in Input, otherwise on focusout no change event and navigation don't work
|
|
2920
|
+
if (oContent.bValueHelpRequested) {
|
|
2921
|
+
oContent.bValueHelpRequested = false; // TODO: need API
|
|
2922
|
+
}
|
|
2902
2923
|
}
|
|
2924
|
+
this._oValueHelpRequestPromise = undefined;
|
|
2903
2925
|
}
|
|
2904
2926
|
}
|
|
2905
|
-
|
|
2906
2927
|
}
|
|
2907
2928
|
|
|
2908
2929
|
function _setShowValueStateMessage(bValue) {
|
|
@@ -3253,11 +3274,11 @@ sap.ui.define([
|
|
|
3253
3274
|
oContentFactory.updateConditionType();
|
|
3254
3275
|
_setAriaAttributes.call(this, true, sItemId); // TODO: check if still open?
|
|
3255
3276
|
}
|
|
3256
|
-
}
|
|
3257
3277
|
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3278
|
+
if (sItemId) {
|
|
3279
|
+
// in Typeahead we don't have to wait for onOpened as we know that something is found
|
|
3280
|
+
oContent.removeStyleClass("sapMFocus"); // to have focus outline on selected item in valueHelp only
|
|
3281
|
+
}
|
|
3261
3282
|
}
|
|
3262
3283
|
|
|
3263
3284
|
}
|
|
@@ -3751,9 +3772,21 @@ sap.ui.define([
|
|
|
3751
3772
|
*/
|
|
3752
3773
|
FieldBase.prototype.isSearchField = function() {
|
|
3753
3774
|
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3775
|
+
/**
|
|
3776
|
+
* @deprecated Since version 1.115.0
|
|
3777
|
+
*/
|
|
3778
|
+
// eslint-disable-next-line no-lone-blocks
|
|
3779
|
+
{
|
|
3780
|
+
let bIsSearchField = false;
|
|
3781
|
+
const sFieldPath = this.getFieldPath();
|
|
3782
|
+
|
|
3783
|
+
if (sFieldPath) {
|
|
3784
|
+
const regexp = new RegExp("^\\*(.*)\\*|\\$search$");
|
|
3785
|
+
bIsSearchField = regexp.test(sFieldPath) && this.getMaxConditions() === 1;
|
|
3786
|
+
}
|
|
3787
|
+
|
|
3788
|
+
return bIsSearchField;
|
|
3789
|
+
}
|
|
3757
3790
|
|
|
3758
3791
|
};
|
|
3759
3792
|
|
|
@@ -3847,6 +3880,17 @@ sap.ui.define([
|
|
|
3847
3880
|
|
|
3848
3881
|
};
|
|
3849
3882
|
|
|
3883
|
+
/**
|
|
3884
|
+
* Allows fields to wait for async formatting result processing
|
|
3885
|
+
*
|
|
3886
|
+
* @returns {undefined|Promise} returns a promise waiting for ongoing formatting
|
|
3887
|
+
* @protected
|
|
3888
|
+
* @since 1.126.0
|
|
3889
|
+
*/
|
|
3890
|
+
FieldBase.prototype.getFormattingPromise = function () {
|
|
3891
|
+
return undefined;
|
|
3892
|
+
};
|
|
3893
|
+
|
|
3850
3894
|
function _isFocused() {
|
|
3851
3895
|
|
|
3852
3896
|
const oFocusedElement = document.activeElement;
|
|
@@ -31,7 +31,7 @@ sap.ui.define([
|
|
|
31
31
|
* A <code>FieldInfoBase</code> element is a base class that shows any kind of information related to the <code>Field</code> control, for example, navigation targets or contact details.
|
|
32
32
|
* This is the basis for link-features. If the link is pressed a popover might be opened.
|
|
33
33
|
* @extends sap.ui.mdc.Element
|
|
34
|
-
* @version 1.
|
|
34
|
+
* @version 1.126.0
|
|
35
35
|
* @constructor
|
|
36
36
|
* @since 1.54.0
|
|
37
37
|
* @public
|
|
@@ -174,7 +174,7 @@ sap.ui.define([
|
|
|
174
174
|
* @private
|
|
175
175
|
*/
|
|
176
176
|
FieldInfoBase.prototype._createPopover = function(oPanel) {
|
|
177
|
-
const oPopover = new ResponsivePopover(this.
|
|
177
|
+
const oPopover = new ResponsivePopover(this.getPopoverId(), {
|
|
178
178
|
contentWidth: "380px",
|
|
179
179
|
horizontalScrolling: false,
|
|
180
180
|
showHeader: Device.system.phone,
|
|
@@ -215,10 +215,19 @@ sap.ui.define([
|
|
|
215
215
|
*/
|
|
216
216
|
FieldInfoBase.prototype.getPopover = function() {
|
|
217
217
|
return this.getDependents().find((oDependent) => {
|
|
218
|
-
return oDependent.isA("sap.m.ResponsivePopover");
|
|
218
|
+
return oDependent.isA("sap.m.ResponsivePopover") && oDependent.getId() === this.getPopoverId();
|
|
219
219
|
});
|
|
220
220
|
};
|
|
221
221
|
|
|
222
|
+
/**
|
|
223
|
+
* Gets the ID for the <code>Popover/code> by adding "-popover" to the ID of the <code>FieldInfo</code>
|
|
224
|
+
* @returns {string} ID for the <code>Popover/code>
|
|
225
|
+
* @private
|
|
226
|
+
*/
|
|
227
|
+
FieldInfoBase.prototype.getPopoverId = function() {
|
|
228
|
+
return this.getId() + "-popover";
|
|
229
|
+
};
|
|
230
|
+
|
|
222
231
|
return FieldInfoBase;
|
|
223
232
|
|
|
224
233
|
});
|
|
@@ -21,7 +21,7 @@ sap.ui.define([
|
|
|
21
21
|
* The <code>FieldInput</code> control is used to render an input field inside a control based on {@link sap.ui.mdc.field.FieldBase FieldBase}.
|
|
22
22
|
* It enhances the {@link sap.m.Input Input} control to add ARIA attributes and other {@link sap.ui.mdc.field.FieldBase FieldBase}-specific logic.
|
|
23
23
|
* @extends sap.m.Input
|
|
24
|
-
* @version 1.
|
|
24
|
+
* @version 1.126.0
|
|
25
25
|
* @constructor
|
|
26
26
|
* @abstract
|
|
27
27
|
* @private
|
|
@@ -16,7 +16,7 @@ sap.ui.define([
|
|
|
16
16
|
* @class Functions uses in <code>FieldInputRenderer</code> and <code>FieldMultiInputRenderer</code> to adjust aria attributes.
|
|
17
17
|
*
|
|
18
18
|
* @author SAP SE
|
|
19
|
-
* @version 1.
|
|
19
|
+
* @version 1.126.0
|
|
20
20
|
* @since 1.86.0
|
|
21
21
|
* @alias sap.ui.mdc.field.FieldInputRenderUtil
|
|
22
22
|
*
|