@openui5/sap.ui.mdc 1.102.1 → 1.103.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/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/AggregationBaseDelegate.js +11 -0
- package/src/sap/ui/mdc/Chart.js +111 -55
- package/src/sap/ui/mdc/ChartDelegate.js +97 -92
- package/src/sap/ui/mdc/Control.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 +1 -1
- package/src/sap/ui/mdc/FilterField.js +2 -2
- package/src/sap/ui/mdc/Link.js +4 -1
- package/src/sap/ui/mdc/MultiValueField.js +1 -1
- package/src/sap/ui/mdc/Table.js +48 -12
- package/src/sap/ui/mdc/ValueHelp.js +1 -19
- package/src/sap/ui/mdc/actiontoolbar/ActionToolbarAction.js +2 -1
- package/src/sap/ui/mdc/chart/ChartSelectionDetails.js +1 -2
- package/src/sap/ui/mdc/chart/ChartToolbar.js +34 -2
- package/src/sap/ui/mdc/chart/DrillBreadcrumbs.js +6 -2
- package/src/sap/ui/mdc/chart/Item.js +6 -11
- package/src/sap/ui/mdc/chart/PropertyHelper.js +7 -8
- package/src/sap/ui/mdc/chart/SelectionDetailsActions.js +2 -3
- package/src/sap/ui/mdc/condition/Condition.js +1 -1
- package/src/sap/ui/mdc/condition/ConditionConverter.js +16 -131
- package/src/sap/ui/mdc/condition/ConditionModel.js +50 -21
- package/src/sap/ui/mdc/condition/FilterConverter.js +1 -1
- package/src/sap/ui/mdc/condition/FilterOperatorUtil.js +3 -3
- package/src/sap/ui/mdc/condition/Operator.js +1 -1
- package/src/sap/ui/mdc/condition/OperatorDynamicDateOption.js +1 -1
- package/src/sap/ui/mdc/condition/RangeOperator.js +1 -1
- package/src/sap/ui/mdc/designtime/actiontoolbar/ActionToolbar.designtime.js +6 -3
- package/src/sap/ui/mdc/designtime/actiontoolbar/ActionToolbarAction.designtime.js +53 -0
- package/src/sap/ui/mdc/designtime/field/Field.designtime.js +9 -4
- package/src/sap/ui/mdc/designtime/table/Table.designtime.js +1 -1
- 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 +135 -39
- package/src/sap/ui/mdc/field/ConditionsType.js +71 -10
- package/src/sap/ui/mdc/field/CustomFieldHelp.js +1 -2
- package/src/sap/ui/mdc/field/CustomFieldInfo.js +1 -1
- package/src/sap/ui/mdc/field/DefineConditionPanel.js +93 -81
- package/src/sap/ui/mdc/field/DynamicDateRangeConditionsType.js +9 -62
- package/src/sap/ui/mdc/field/FieldBase.js +91 -70
- package/src/sap/ui/mdc/field/FieldBaseDelegate.js +20 -1
- package/src/sap/ui/mdc/field/FieldHelpBase.js +1 -39
- package/src/sap/ui/mdc/field/FieldInfoBase.js +1 -1
- package/src/sap/ui/mdc/field/FieldInput.js +2 -2
- package/src/sap/ui/mdc/field/FieldInputRenderUtil.js +1 -1
- package/src/sap/ui/mdc/field/FieldMultiInput.js +2 -2
- package/src/sap/ui/mdc/field/FieldValueHelp.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelpContentWrapperBase.js +1 -19
- package/src/sap/ui/mdc/field/FieldValueHelpMTableWrapper.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelpMdcTableWrapper.js +7 -1
- package/src/sap/ui/mdc/field/FieldValueHelpTableWrapperBase.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelpUITableWrapper.js +1 -1
- package/src/sap/ui/mdc/field/InParameter.js +1 -4
- 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 +2 -2
- package/src/sap/ui/mdc/field/TokenizerDisplay.js +2 -2
- package/src/sap/ui/mdc/field/ValueHelpPanel.js +1 -5
- package/src/sap/ui/mdc/field/content/DateContent.js +3 -3
- package/src/sap/ui/mdc/field/content/DateTimeContent.js +1 -1
- package/src/sap/ui/mdc/filterbar/FilterBarBase.js +4 -4
- package/src/sap/ui/mdc/filterbar/IFilterContainer.js +1 -1
- package/src/sap/ui/mdc/filterbar/PropertyHelper.js +1 -1
- package/src/sap/ui/mdc/filterbar/p13n/AdaptationFilterBar.js +1 -1
- package/src/sap/ui/mdc/filterbar/vh/FilterBar.js +1 -1
- package/src/sap/ui/mdc/flexibility/ActionToolbar.flexibility.js +80 -4
- package/src/sap/ui/mdc/flexibility/AggregateFlex.js +19 -38
- package/src/sap/ui/mdc/flexibility/Chart.flexibility.js +1 -1
- package/src/sap/ui/mdc/flexibility/ChartTypeFlex.js +23 -41
- package/src/sap/ui/mdc/flexibility/ConditionFlex.js +43 -58
- 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/GroupFlex.js +25 -55
- package/src/sap/ui/mdc/flexibility/ItemBaseFlex.js +21 -42
- package/src/sap/ui/mdc/flexibility/SortFlex.js +23 -52
- package/src/sap/ui/mdc/flexibility/Table.flexibility.js +3 -3
- package/src/sap/ui/mdc/flexibility/Util.js +82 -0
- package/src/sap/ui/mdc/flexibility/xConfigFlex.js +137 -0
- package/src/sap/ui/mdc/flp/FlpLinkDelegate.js +3 -1
- package/src/sap/ui/mdc/library.js +4 -15
- package/src/sap/ui/mdc/link/ContactDetails.js +1 -1
- package/src/sap/ui/mdc/link/ContactDetailsAddressItem.js +1 -1
- package/src/sap/ui/mdc/link/ContactDetailsEmailItem.js +1 -1
- package/src/sap/ui/mdc/link/ContactDetailsItem.js +1 -1
- package/src/sap/ui/mdc/link/ContactDetailsPhoneItem.js +1 -1
- package/src/sap/ui/mdc/link/Factory.js +1 -1
- package/src/sap/ui/mdc/link/FakeFlpConnector.js +1 -1
- package/src/sap/ui/mdc/link/LinkItem.js +9 -1
- package/src/sap/ui/mdc/link/Panel.js +25 -10
- package/src/sap/ui/mdc/link/PanelItem.js +10 -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 +12 -0
- package/src/sap/ui/mdc/messagebundle_ar.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_bg.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_ca.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_cs.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_cy.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_da.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_de.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_el.properties +19 -11
- package/src/sap/ui/mdc/messagebundle_en.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_en_GB.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_en_US_sappsd.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_en_US_saprigi.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_en_US_saptrc.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_es.properties +14 -6
- package/src/sap/ui/mdc/messagebundle_es_MX.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_et.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_fi.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_fr.properties +9 -1
- package/src/sap/ui/mdc/messagebundle_fr_CA.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_hi.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_hr.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_hu.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_id.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_it.properties +9 -1
- package/src/sap/ui/mdc/messagebundle_iw.properties +9 -1
- package/src/sap/ui/mdc/messagebundle_ja.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_kk.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_ko.properties +10 -2
- package/src/sap/ui/mdc/messagebundle_lt.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_lv.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_ms.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_nl.properties +22 -14
- package/src/sap/ui/mdc/messagebundle_no.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_pl.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_pt.properties +12 -4
- package/src/sap/ui/mdc/messagebundle_pt_PT.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_ro.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_ru.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_sh.properties +9 -1
- package/src/sap/ui/mdc/messagebundle_sk.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_sl.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_sv.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_th.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_tr.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_uk.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_vi.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_zh_CN.properties +8 -0
- package/src/sap/ui/mdc/messagebundle_zh_TW.properties +9 -1
- 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/TypeUtil.js +24 -2
- package/src/sap/ui/mdc/odata/v4/ChartPropertyHelper.js +5 -5
- package/src/sap/ui/mdc/odata/v4/FieldBaseDelegate.js +6 -0
- package/src/sap/ui/mdc/odata/v4/TypeUtil.js +6 -6
- package/src/sap/ui/mdc/odata/v4/ValueHelpDelegate.js +0 -33
- package/src/sap/ui/mdc/odata/v4/vizChart/ChartDelegate.js +359 -151
- package/src/sap/ui/mdc/p13n/Engine.js +1 -1
- package/src/sap/ui/mdc/p13n/PersistenceProvider.js +1 -0
- package/src/sap/ui/mdc/p13n/PropertyHelper.js +1 -1
- package/src/sap/ui/mdc/p13n/UIManager.js +1 -1
- package/src/sap/ui/mdc/p13n/modules/DefaultProviderRegistry.js +1 -1
- package/src/sap/ui/mdc/p13n/panels/ActionToolbarPanel.js +133 -0
- package/src/sap/ui/mdc/p13n/panels/FilterPanel.js +7 -32
- package/src/sap/ui/mdc/p13n/panels/LinkSelectionPanel.js +12 -4
- package/src/sap/ui/mdc/p13n/subcontroller/ActionToolbarController.js +1 -1
- package/src/sap/ui/mdc/p13n/subcontroller/BaseController.js +1 -1
- package/src/sap/ui/mdc/p13n/subcontroller/LinkPanelController.js +22 -27
- package/src/sap/ui/mdc/table/Column.js +4 -1
- package/src/sap/ui/mdc/table/CreationRow.js +1 -1
- package/src/sap/ui/mdc/table/PropertyHelper.js +1 -1
- package/src/sap/ui/mdc/table/RowActionItem.js +1 -1
- package/src/sap/ui/mdc/table/RowSettings.js +1 -1
- package/src/sap/ui/mdc/table/V4AnalyticsPropertyHelper.js +1 -1
- package/src/sap/ui/mdc/themes/base/ValueHelpDialog.less +5 -0
- package/src/sap/ui/mdc/util/FilterUtil.js +2 -2
- 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/util/TypeUtil.js +105 -17
- package/src/sap/ui/mdc/valuehelp/Dialog.js +95 -30
- package/src/sap/ui/mdc/valuehelp/Popover.js +15 -2
- package/src/sap/ui/mdc/valuehelp/base/Container.js +37 -28
- package/src/sap/ui/mdc/valuehelp/base/Content.js +39 -21
- package/src/sap/ui/mdc/valuehelp/base/DialogTab.js +5 -5
- package/src/sap/ui/mdc/valuehelp/base/FilterableListContent.js +41 -34
- package/src/sap/ui/mdc/valuehelp/base/ListContent.js +1 -1
- package/src/sap/ui/mdc/valuehelp/content/Bool.js +4 -4
- package/src/sap/ui/mdc/valuehelp/content/Conditions.js +11 -3
- package/src/sap/ui/mdc/valuehelp/content/FixedList.js +1 -1
- package/src/sap/ui/mdc/valuehelp/content/MDCTable.js +1 -1
- package/src/sap/ui/mdc/valuehelp/content/MTable.js +2 -2
- package/test/sap/ui/mdc/testutils/opa/p13n/Actions.js +34 -82
- package/src/sap/ui/mdc/flexibility/AggregationConfigFlex.js +0 -139
|
@@ -35,7 +35,7 @@ sap.ui.define([
|
|
|
35
35
|
* @extends sap.ui.model.json.JSONModel
|
|
36
36
|
*
|
|
37
37
|
* @author SAP SE
|
|
38
|
-
* @version 1.
|
|
38
|
+
* @version 1.103.0
|
|
39
39
|
* @since 1.48.0
|
|
40
40
|
* @alias sap.ui.mdc.condition.ConditionModel
|
|
41
41
|
*
|
|
@@ -259,21 +259,44 @@ sap.ui.define([
|
|
|
259
259
|
var i = 0;
|
|
260
260
|
var oCondition;
|
|
261
261
|
|
|
262
|
-
this.setProperty("/conditions", {}, undefined, true); // async checkUpdate
|
|
263
|
-
|
|
264
262
|
if (Array.isArray(oConditions)) {
|
|
265
263
|
throw new Error("setConditions with an Array of condition is not supported! " + this);
|
|
266
264
|
} else {
|
|
267
|
-
this._bNoSingleEvent = true;
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
265
|
+
this._bNoSingleEvent = true; // to fire event only once per FieldPath
|
|
266
|
+
var bUpdate = false;
|
|
267
|
+
var sExternalFieldPath; // used for FieldPath from outside
|
|
268
|
+
var sFieldPath; // used for escaped FieldPath
|
|
269
|
+
// check old conditions to fire right propertyChange events
|
|
270
|
+
var oOldConditions = merge({}, this.getProperty("/conditions")); // in oOldConditions the escaped FieldPath is used
|
|
271
|
+
for (sExternalFieldPath in oConditions) { // in oConditions the external FieldPath is used
|
|
272
|
+
this._getFieldPathProperty(sExternalFieldPath); // to initialize FieldPath
|
|
273
|
+
sFieldPath = _escapeFieldPath.call(this, sExternalFieldPath);
|
|
274
|
+
var aOldConditions = oOldConditions[sFieldPath] || [];
|
|
275
|
+
var aConditions = oConditions[sExternalFieldPath] || [];
|
|
276
|
+
if (!FilterOperatorUtil.compareConditionsArray(aOldConditions, aConditions)) {
|
|
277
|
+
bUpdate = true;
|
|
278
|
+
this.removeAllConditions(sExternalFieldPath);
|
|
279
|
+
for (i = 0; i < oConditions[sExternalFieldPath].length; i++) {
|
|
280
|
+
oCondition = oConditions[sExternalFieldPath][i];
|
|
281
|
+
this.insertCondition(sExternalFieldPath, -1, oCondition, true);
|
|
282
|
+
}
|
|
283
|
+
this.firePropertyChange({ reason: ChangeReason.Binding, path: "/conditions/" + sExternalFieldPath, context: undefined, value: oConditions[sExternalFieldPath] });
|
|
284
|
+
}
|
|
285
|
+
delete oOldConditions[sFieldPath]; // is processed
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
var oFieldPath = this.getProperty("/fieldPath");
|
|
289
|
+
for (sFieldPath in oOldConditions) { // just entries without update left here
|
|
290
|
+
if (oOldConditions[sFieldPath].length > 0) { // there where conditions and no there are none -> update
|
|
291
|
+
bUpdate = true;
|
|
292
|
+
sExternalFieldPath = oFieldPath[sFieldPath].fieldPath;
|
|
293
|
+
this.removeAllConditions(sExternalFieldPath);
|
|
294
|
+
this.firePropertyChange({ reason: ChangeReason.Binding, path: "/conditions/" + sExternalFieldPath, context: undefined, value: [] });
|
|
273
295
|
}
|
|
274
|
-
this.firePropertyChange({ reason: ChangeReason.Add, path: "/conditions/" + sMyFieldPath, context: undefined, value: oConditions[sMyFieldPath] });
|
|
275
296
|
}
|
|
276
|
-
|
|
297
|
+
if (bUpdate) {
|
|
298
|
+
this.checkUpdate(false, true); // do not force, only fire real updates. But do async as not known if any other changes via api triggered.
|
|
299
|
+
}
|
|
277
300
|
this._bNoSingleEvent = false;
|
|
278
301
|
}
|
|
279
302
|
|
|
@@ -343,8 +366,8 @@ sap.ui.define([
|
|
|
343
366
|
}
|
|
344
367
|
|
|
345
368
|
if (!this._bNoSingleEvent) {
|
|
346
|
-
this.checkUpdate(
|
|
347
|
-
this.firePropertyChange({ reason: ChangeReason.
|
|
369
|
+
this.checkUpdate(false, true); // do not force, only fire real updates. But do async as not known if any other changes via api triggered.
|
|
370
|
+
this.firePropertyChange({ reason: ChangeReason.Binding, path: "/conditions/" + sFieldPath, context: undefined, value: aConditions });
|
|
348
371
|
}
|
|
349
372
|
|
|
350
373
|
return this;
|
|
@@ -386,7 +409,7 @@ sap.ui.define([
|
|
|
386
409
|
* Removes a condition for a specified <code>FieldPath</code>.
|
|
387
410
|
*
|
|
388
411
|
* @param {string} sFieldPath fieldPath of the condition
|
|
389
|
-
* @param {int|
|
|
412
|
+
* @param {int|sap.ui.mdc.condition.ConditionObject} vCondition condition or index of the condition
|
|
390
413
|
* @returns {boolean} flag if condition was removed.
|
|
391
414
|
* @private
|
|
392
415
|
* @ui5-restricted sap.ui.mdc
|
|
@@ -409,8 +432,8 @@ sap.ui.define([
|
|
|
409
432
|
var aConditions = this.getConditions(sFieldPath);
|
|
410
433
|
if (aConditions.length > iIndex) {
|
|
411
434
|
aConditions.splice(iIndex, 1);
|
|
412
|
-
this.checkUpdate(
|
|
413
|
-
this.firePropertyChange({ reason: ChangeReason.
|
|
435
|
+
this.checkUpdate(false, true); // do not force, only fire real updates. But do async as not known if any other changes via api triggered.
|
|
436
|
+
this.firePropertyChange({ reason: ChangeReason.Binding, path: "/conditions/" + sFieldPath, context: undefined, value: aConditions });
|
|
414
437
|
return true;
|
|
415
438
|
}
|
|
416
439
|
}
|
|
@@ -435,20 +458,26 @@ sap.ui.define([
|
|
|
435
458
|
var sEscapedFieldPath = _escapeFieldPath.call(this, sFieldPath);
|
|
436
459
|
if (oConditions[sEscapedFieldPath] && oConditions[sEscapedFieldPath].length > 0) {
|
|
437
460
|
oConditions[sEscapedFieldPath] = [];
|
|
438
|
-
this.
|
|
461
|
+
if (!this._bNoSingleEvent) {
|
|
462
|
+
this.firePropertyChange({ reason: ChangeReason.Binding, path: "/conditions/" + sFieldPath, context: undefined, value: oConditions[sEscapedFieldPath] });
|
|
463
|
+
}
|
|
439
464
|
}
|
|
440
465
|
} else {
|
|
441
466
|
for (var sMyFieldPath in oConditions) {
|
|
442
467
|
if (oConditions[sMyFieldPath] && oConditions[sMyFieldPath].length > 0) {
|
|
443
468
|
oConditions[sMyFieldPath] = [];
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
469
|
+
if (!this._bNoSingleEvent) {
|
|
470
|
+
var oFieldPath = this.getProperty("/fieldPath");
|
|
471
|
+
var sOriginalFieldPath = oFieldPath[sMyFieldPath].fieldPath;
|
|
472
|
+
this.firePropertyChange({ reason: ChangeReason.Binding, path: "/conditions/" + sOriginalFieldPath, context: undefined, value: oConditions[sMyFieldPath] });
|
|
473
|
+
}
|
|
447
474
|
}
|
|
448
475
|
}
|
|
449
476
|
}
|
|
450
477
|
|
|
451
|
-
this.
|
|
478
|
+
if (!this._bNoSingleEvent) {
|
|
479
|
+
this.checkUpdate(false, true); // do not force, only fire real updates. But do async as not known if any other changes via api triggered.
|
|
480
|
+
}
|
|
452
481
|
|
|
453
482
|
return this;
|
|
454
483
|
|
|
@@ -56,7 +56,7 @@ function(
|
|
|
56
56
|
*
|
|
57
57
|
* @namespace
|
|
58
58
|
* @author SAP SE
|
|
59
|
-
* @version 1.
|
|
59
|
+
* @version 1.103.0
|
|
60
60
|
* @since 1.73.0
|
|
61
61
|
* @alias sap.ui.mdc.condition.FilterOperatorUtil
|
|
62
62
|
*
|
|
@@ -1208,7 +1208,7 @@ function(
|
|
|
1208
1208
|
/**
|
|
1209
1209
|
* Returns the operator object for the given operator name.
|
|
1210
1210
|
* @param {string} sOperator Name of the operator
|
|
1211
|
-
* @returns {sap.ui.mdc.condition.Operator} the operator object, or undefined if the operator with the requested name does not exist
|
|
1211
|
+
* @returns {sap.ui.mdc.condition.Operator|undefined} the operator object, or <code>undefined<code> if the operator with the requested name does not exist
|
|
1212
1212
|
*
|
|
1213
1213
|
* @private
|
|
1214
1214
|
* @ui5-restricted sap.fe
|
|
@@ -1471,7 +1471,7 @@ function(
|
|
|
1471
1471
|
* Returns the operator object for the given <code>DynamicDateOption</code> name.
|
|
1472
1472
|
* @param {string} sOption Name of the operator
|
|
1473
1473
|
* @param {sap.ui.mdc.enum.BaseType} [sBaseType] Basic type
|
|
1474
|
-
* @returns {sap.ui.mdc.condition.Operator} the operator object, or undefined if the operator with the requested name does not exist
|
|
1474
|
+
* @returns {sap.ui.mdc.condition.Operator|undefined} the operator object, or <code>undefined</code> if the operator with the requested name does not exist
|
|
1475
1475
|
*
|
|
1476
1476
|
* @protected
|
|
1477
1477
|
* @since: 1.100.0
|
|
@@ -84,7 +84,7 @@ sap.ui.define([
|
|
|
84
84
|
* @param {string} [oConfiguration.additionalInfo] additionalInfo text for the operator. Will be shown in the operator suggest as second column. If not used (undefined) the Include or Exclude information of the operator is used.
|
|
85
85
|
* @constructor
|
|
86
86
|
* @author SAP SE
|
|
87
|
-
* @version 1.
|
|
87
|
+
* @version 1.103.0
|
|
88
88
|
* @private
|
|
89
89
|
* @ui5-restricted sap.fe
|
|
90
90
|
* @MDC_PUBLIC_CANDIDATE
|
|
@@ -33,7 +33,7 @@ sap.ui.define([
|
|
|
33
33
|
* @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.
|
|
34
34
|
* @constructor
|
|
35
35
|
* @author SAP SE
|
|
36
|
-
* @version 1.
|
|
36
|
+
* @version 1.103.0
|
|
37
37
|
* @private
|
|
38
38
|
* @ui5-restricted sap.fe
|
|
39
39
|
* @MDC_PUBLIC_CANDIDATE
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
7
7
|
"sap/ui/mdc/ActionToolbar",
|
|
8
|
+
"sap/ui/mdc/p13n/Engine",
|
|
8
9
|
"../Util"
|
|
9
|
-
], function (ActionToolbar, Util) {
|
|
10
|
+
], function (ActionToolbar, Engine, Util) {
|
|
10
11
|
"use strict";
|
|
11
12
|
|
|
12
13
|
var oResourceBundle = sap.ui.getCore().getLibraryResourceBundle("sap.ui.mdc");
|
|
@@ -20,7 +21,7 @@ sap.ui.define([
|
|
|
20
21
|
settings: {
|
|
21
22
|
name: oResourceBundle.getText("actiontoolbar.RTA_SETTINGS_NAME"),
|
|
22
23
|
handler: function (oControl, mPropertyBag) {
|
|
23
|
-
return
|
|
24
|
+
return Engine.getInstance().getRTASettingsActionHandler(oControl, mPropertyBag, "actionsKey").then(function(aChanges){
|
|
24
25
|
return aChanges;
|
|
25
26
|
});
|
|
26
27
|
},
|
|
@@ -28,7 +29,9 @@ sap.ui.define([
|
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
},
|
|
31
|
-
aAllowedAggregations = [
|
|
32
|
+
aAllowedAggregations = [
|
|
33
|
+
"actions"
|
|
34
|
+
],
|
|
32
35
|
aAllProperties = [];
|
|
33
36
|
|
|
34
37
|
return Util.getDesignTime(ActionToolbar, aAllProperties, aAllowedAggregations, oDesignTime);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* ! OpenUI5
|
|
3
|
+
* (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
+
*/
|
|
6
|
+
sap.ui.define([
|
|
7
|
+
"sap/ui/mdc/actiontoolbar/ActionToolbarAction",
|
|
8
|
+
"../Util"
|
|
9
|
+
], function (ActionToolbarAction, Util) {
|
|
10
|
+
"use strict";
|
|
11
|
+
|
|
12
|
+
var oDesignTime = {
|
|
13
|
+
description: "{description}",
|
|
14
|
+
name: "{name}",
|
|
15
|
+
aggregations: {
|
|
16
|
+
action: {
|
|
17
|
+
propagateMetadata: function(oInnerControl) {
|
|
18
|
+
return {
|
|
19
|
+
actions: {
|
|
20
|
+
rename: { // mandatory
|
|
21
|
+
changeType: "rename", // mandatory
|
|
22
|
+
domRef: function (oControl){ // mandatory
|
|
23
|
+
return oControl.$();
|
|
24
|
+
},
|
|
25
|
+
getTextMutators: function (oControl) { // optional
|
|
26
|
+
return {
|
|
27
|
+
getText: function () {
|
|
28
|
+
return oControl.getDomRef().textContent;
|
|
29
|
+
},
|
|
30
|
+
setText: function (sNewText) {
|
|
31
|
+
oControl.getDomRef().textContent = sNewText;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
remove: null,
|
|
37
|
+
reveal: null
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
properties: {},
|
|
44
|
+
actions: {}
|
|
45
|
+
},
|
|
46
|
+
aAllowedAggregations = [
|
|
47
|
+
"action"
|
|
48
|
+
],
|
|
49
|
+
aAllProperties = [];
|
|
50
|
+
|
|
51
|
+
return Util.getDesignTime(ActionToolbarAction, aAllProperties, aAllowedAggregations, oDesignTime);
|
|
52
|
+
|
|
53
|
+
});
|
|
@@ -4,10 +4,15 @@
|
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
sap.ui.define([
|
|
7
|
+
sap.ui.define([
|
|
8
|
+
'sap/ui/fl/Utils',
|
|
9
|
+
'sap/ui/fl/apply/api/FlexRuntimeInfoAPI',
|
|
10
|
+
'sap/ui/mdc/p13n/Engine',
|
|
11
|
+
'sap/ui/core/Core'
|
|
12
|
+
], function(Utils, FlexRuntimeInfoAPI, Engine, oCore) {
|
|
8
13
|
"use strict";
|
|
9
14
|
|
|
10
|
-
var oResourceBundle =
|
|
15
|
+
var oResourceBundle = oCore.getLibraryResourceBundle("sap.ui.mdc");
|
|
11
16
|
|
|
12
17
|
return {
|
|
13
18
|
properties: {
|
|
@@ -24,7 +29,7 @@ sap.ui.define(['sap/ui/fl/Utils', 'sap/ui/fl/apply/api/FlexRuntimeInfoAPI'], fun
|
|
|
24
29
|
return [];
|
|
25
30
|
}
|
|
26
31
|
var oFieldInfo = oField.getFieldInfo();
|
|
27
|
-
var oControl = typeof oFieldInfo.getSourceControl() === "string" ?
|
|
32
|
+
var oControl = typeof oFieldInfo.getSourceControl() === "string" ? oCore.byId(oFieldInfo.getSourceControl()) : oFieldInfo.getSourceControl();
|
|
28
33
|
if (!oControl) {
|
|
29
34
|
oControl = oField;
|
|
30
35
|
}
|
|
@@ -54,7 +59,7 @@ sap.ui.define(['sap/ui/fl/Utils', 'sap/ui/fl/apply/api/FlexRuntimeInfoAPI'], fun
|
|
|
54
59
|
return FlexRuntimeInfoAPI.waitForChanges({
|
|
55
60
|
element: oPanel
|
|
56
61
|
}).then(function() {
|
|
57
|
-
var oEngine =
|
|
62
|
+
var oEngine = Engine.getInstance();
|
|
58
63
|
mPropertyBag.fnAfterClose = function() {
|
|
59
64
|
oPanel.destroy();
|
|
60
65
|
};
|
|
@@ -28,7 +28,7 @@ sap.ui.define([
|
|
|
28
28
|
aggregations: {
|
|
29
29
|
_content: {
|
|
30
30
|
propagateMetadata: function(oElement) {
|
|
31
|
-
if (oElement.isA("sap.ui.mdc.ActionToolbar")) {
|
|
31
|
+
if (oElement.isA("sap.ui.mdc.ActionToolbar") || (oElement.getParent() && oElement.getParent().isA("sap.ui.mdc.actiontoolbar.ActionToolbarAction"))) {
|
|
32
32
|
return {
|
|
33
33
|
actions: {
|
|
34
34
|
settings: {}
|
|
@@ -35,7 +35,7 @@ sap.ui.define([
|
|
|
35
35
|
* @param {object} [mSettings] Initial settings for the new control
|
|
36
36
|
* @class A field help used in the <code>FieldHelp</code> association in <code>FieldBase</code> controls that shows a list for Boolean values.
|
|
37
37
|
* @extends sap.ui.mdc.field.FieldHelpBase
|
|
38
|
-
* @version 1.
|
|
38
|
+
* @version 1.103.0
|
|
39
39
|
* @constructor
|
|
40
40
|
* @private
|
|
41
41
|
* @ui5-restricted sap.ui.mdc.field.FieldBase
|
|
@@ -35,7 +35,7 @@ sap.ui.define([
|
|
|
35
35
|
* @param {object} [mSettings] Initial settings for the new control
|
|
36
36
|
* @class A field help used in the <code>FieldHelp</code> association in <code>FieldBase</code> controls to show a popover of conditions.
|
|
37
37
|
* @extends sap.ui.mdc.field.FieldHelpBase
|
|
38
|
-
* @version 1.
|
|
38
|
+
* @version 1.103.0
|
|
39
39
|
* @constructor
|
|
40
40
|
* @private
|
|
41
41
|
* @ui5-restricted sap.ui.mdc.field.FieldBase, sap.fe
|
|
@@ -39,6 +39,9 @@ sap.ui.define([
|
|
|
39
39
|
) {
|
|
40
40
|
"use strict";
|
|
41
41
|
|
|
42
|
+
var sTargetTypeRaw = "sap.ui.mdc.raw";
|
|
43
|
+
var sTargetTypeRawComposite = "sap.ui.mdc.raw:";
|
|
44
|
+
|
|
42
45
|
/**
|
|
43
46
|
* Constructor for a Condition type.
|
|
44
47
|
*
|
|
@@ -48,7 +51,7 @@ sap.ui.define([
|
|
|
48
51
|
* @extends sap.ui.model.SimpleType
|
|
49
52
|
*
|
|
50
53
|
* @author SAP SE
|
|
51
|
-
* @version 1.
|
|
54
|
+
* @version 1.103.0
|
|
52
55
|
*
|
|
53
56
|
* @since 1.62.0
|
|
54
57
|
* @private
|
|
@@ -56,7 +59,7 @@ sap.ui.define([
|
|
|
56
59
|
* @MDC_PUBLIC_CANDIDATE
|
|
57
60
|
*
|
|
58
61
|
* @param {object} [oFormatOptions] Formatting options
|
|
59
|
-
* @param {sap.ui.model.Type} [oFormatOptions.valueType] Type of the value of the condition (used for formatting and
|
|
62
|
+
* @param {sap.ui.model.Type} [oFormatOptions.valueType] Type of the value of the condition (used for formatting, parsing and validating)
|
|
60
63
|
* @param {string[]} [oFormatOptions.operators] Possible operators to be used in the condition
|
|
61
64
|
* @param {sap.ui.mdc.enum.FieldDisplay} [oFormatOptions.display] DisplayFormat used to visualize a value
|
|
62
65
|
* @param {string} [oFormatOptions.fieldHelpID] ID of the field help to determine the key and description // TODO: async request????
|
|
@@ -104,7 +107,28 @@ sap.ui.define([
|
|
|
104
107
|
|
|
105
108
|
};
|
|
106
109
|
|
|
107
|
-
|
|
110
|
+
/**
|
|
111
|
+
* Formats the given condition to an output value of the given target type.
|
|
112
|
+
* This values are formatted using the given data type. Depending of the operator
|
|
113
|
+
* and the configuration (set in <code>FormatOptions</code>) a description will be determined via given value help or delegate.
|
|
114
|
+
*
|
|
115
|
+
* @param {sap.ui.mdc.condition.ConditionObject} oCondition
|
|
116
|
+
* The condition to be formatted
|
|
117
|
+
* @param {string} sTargetType
|
|
118
|
+
* The target type; see {@link topic:ac56d92162ed47ff858fdf1ce26c18c4 Allowed Property Types}
|
|
119
|
+
* In addition to the standard target types <code>sap.ui.mdc.raw</code> can be used. In this case the value is not formatted and just
|
|
120
|
+
* forwarded to the target. If the value is an array representing data for a <code>CompositeType</code> the index of the needed raw value can be added to the
|
|
121
|
+
* name (For example if a unit should be forwarded as raw value <code>sap.ui.mdc.raw:1</code> can be used).
|
|
122
|
+
* @return {any|Promise}
|
|
123
|
+
* The formatted output value or a <code>Promise</code> resolving with the formatted value
|
|
124
|
+
* @throws {sap.ui.model.FormatException}
|
|
125
|
+
* If formatting to the target type is not possible
|
|
126
|
+
*
|
|
127
|
+
* @private
|
|
128
|
+
* @ui5-restricted sap.ui.mdc.field.FieldBase, sap.fe
|
|
129
|
+
* @MDC_PUBLIC_CANDIDATE
|
|
130
|
+
*/
|
|
131
|
+
ConditionType.prototype.formatValue = function(oCondition, sTargetType) {
|
|
108
132
|
|
|
109
133
|
if (oCondition == undefined || oCondition == null || this._bDestroyed) { // if destroyed do nothing
|
|
110
134
|
return null;
|
|
@@ -115,8 +139,8 @@ sap.ui.define([
|
|
|
115
139
|
throw new FormatException("No valid condition provided");
|
|
116
140
|
}
|
|
117
141
|
|
|
118
|
-
if (!
|
|
119
|
-
|
|
142
|
+
if (!sTargetType) {
|
|
143
|
+
sTargetType = "string";
|
|
120
144
|
}
|
|
121
145
|
|
|
122
146
|
var oType = _getValueType.call(this);
|
|
@@ -125,7 +149,7 @@ sap.ui.define([
|
|
|
125
149
|
|
|
126
150
|
_attachCurrentValueAtType.call(this, oCondition, oType); // use original condition
|
|
127
151
|
|
|
128
|
-
switch (this.getPrimitiveType(
|
|
152
|
+
switch (this.getPrimitiveType(sTargetType)) {
|
|
129
153
|
case "string":
|
|
130
154
|
case "any":
|
|
131
155
|
var sDisplay = _getDisplay.call(this);
|
|
@@ -146,7 +170,7 @@ sap.ui.define([
|
|
|
146
170
|
var vKey = bIsUnit ? oCondition.values[0][1] : oCondition.values[0];
|
|
147
171
|
|
|
148
172
|
return SyncPromise.resolve().then(function() {
|
|
149
|
-
return _getDescription.call(this, vKey, oCondition, oBindingContext, oConditionModel, sConditionModelName);
|
|
173
|
+
return _getDescription.call(this, vKey, oCondition, oType, oBindingContext, oConditionModel, sConditionModelName);
|
|
150
174
|
}.bind(this)).then(function(vDescription) { // if description needs to be requested -> return if it is resolved
|
|
151
175
|
if (vDescription) {
|
|
152
176
|
oCondition = merge({}, oCondition); // do not manipulate original object
|
|
@@ -181,12 +205,20 @@ sap.ui.define([
|
|
|
181
205
|
|
|
182
206
|
return _returnResult.call(this, oCondition, undefined, iCallCount, true, oType);
|
|
183
207
|
default:
|
|
184
|
-
|
|
185
|
-
if (
|
|
186
|
-
|
|
208
|
+
var iIndex = _getIndexOfRawValue(sTargetType);
|
|
209
|
+
if (iIndex >= 0) {
|
|
210
|
+
if (_isCompositeType.call(this, oType)) {
|
|
211
|
+
//used for compositeTypes if just one value needs to be transfered without any formatting (e.g. for Timezone)
|
|
212
|
+
return oCondition.values.length >= 1 ? oCondition.values[0][iIndex] : null;
|
|
213
|
+
}
|
|
214
|
+
} else if (sTargetType === sTargetTypeRaw) {
|
|
215
|
+
return oCondition.values.length >= 1 ? oCondition.values[0] : null; // TODO: how to handle operators <> EQ
|
|
216
|
+
} else if (oType && oCondition.values.length >= 1) {
|
|
217
|
+
// operators can only be formatted to string. But other controls (like Slider) might just use the value
|
|
218
|
+
return oType.formatValue(oCondition.values[0], sTargetType);
|
|
187
219
|
}
|
|
188
220
|
|
|
189
|
-
throw new FormatException("Don't know how to format Condition to " +
|
|
221
|
+
throw new FormatException("Don't know how to format Condition to " + sTargetType);
|
|
190
222
|
}
|
|
191
223
|
|
|
192
224
|
};
|
|
@@ -256,22 +288,47 @@ sap.ui.define([
|
|
|
256
288
|
|
|
257
289
|
}
|
|
258
290
|
|
|
259
|
-
|
|
291
|
+
/**
|
|
292
|
+
* Parses an external value of the given source type to a condition that holds the value in model
|
|
293
|
+
* representation.
|
|
294
|
+
* These values are parsed using the given data type. Depending of the operator
|
|
295
|
+
* and the configuration (set in <code>FormatOptions</code>) a value will be determined via given value help or delegate.
|
|
296
|
+
*
|
|
297
|
+
* @param {any} vValue
|
|
298
|
+
* The value to be parsed
|
|
299
|
+
* @param {string} sSourceType
|
|
300
|
+
* The type of the given value; see
|
|
301
|
+
* {@link topic:ac56d92162ed47ff858fdf1ce26c18c4 Allowed Property Types}
|
|
302
|
+
* In addition to the standard source types <code>sap.ui.mdc.raw</code> can be used. In this case the value is not parsed and just
|
|
303
|
+
* used in the condition. If the value of the condition is an array representing data for a <code>CompositeType</code> the index of the needed raw value can be added to the
|
|
304
|
+
* name (For example if a unit should be forwarded as raw value <code>sap.ui.mdc.raw:1</code> can be used).
|
|
305
|
+
* @return {null|sap.ui.mdc.condition.ConditionObject|Promise<null|sap.ui.mdc.condition.ConditionObject>}
|
|
306
|
+
* The condition or a <code>Promise</code> resolving with the condition.
|
|
307
|
+
* If there is no value <code>null</code> is returned.
|
|
308
|
+
* @throws {sap.ui.model.ParseException}
|
|
309
|
+
* If parsing to the model type is not possible; the message of the exception is language
|
|
310
|
+
* dependent as it may be displayed on the UI
|
|
311
|
+
*
|
|
312
|
+
* @private
|
|
313
|
+
* @ui5-restricted sap.ui.mdc.field.FieldBase, sap.fe
|
|
314
|
+
* @MDC_PUBLIC_CANDIDATE
|
|
315
|
+
*/
|
|
316
|
+
ConditionType.prototype.parseValue = function(vValue, sSourceType) {
|
|
260
317
|
|
|
261
318
|
if (this._bDestroyed) { // if destroyed do nothing
|
|
262
319
|
return null;
|
|
263
320
|
}
|
|
264
321
|
|
|
265
|
-
if (!
|
|
266
|
-
|
|
267
|
-
} else if (
|
|
268
|
-
|
|
322
|
+
if (!sSourceType) {
|
|
323
|
+
sSourceType = "string";
|
|
324
|
+
} else if (sSourceType === "any" && typeof vValue === "string") {
|
|
325
|
+
sSourceType = "string";
|
|
269
326
|
}
|
|
270
327
|
|
|
271
328
|
var oNavigateCondition = this.oFormatOptions.navigateCondition;
|
|
272
329
|
if (oNavigateCondition) {
|
|
273
330
|
// condition already known from navigation. Just check if it is really the same as the input.
|
|
274
|
-
var vOutput = this.formatValue(oNavigateCondition,
|
|
331
|
+
var vOutput = this.formatValue(oNavigateCondition, sSourceType);
|
|
275
332
|
if (vOutput === vValue) {
|
|
276
333
|
return merge({}, oNavigateCondition); // use copy
|
|
277
334
|
}
|
|
@@ -293,7 +350,7 @@ sap.ui.define([
|
|
|
293
350
|
|
|
294
351
|
_initCurrentValueAtType.call(this, oType);
|
|
295
352
|
|
|
296
|
-
switch (this.getPrimitiveType(
|
|
353
|
+
switch (this.getPrimitiveType(sSourceType)) {
|
|
297
354
|
case "string":
|
|
298
355
|
var oOperator;
|
|
299
356
|
var bCheckForDefault = false;
|
|
@@ -396,10 +453,22 @@ sap.ui.define([
|
|
|
396
453
|
}
|
|
397
454
|
}
|
|
398
455
|
if (sDefaultOperator) {
|
|
399
|
-
|
|
456
|
+
var iIndex = _getIndexOfRawValue(sSourceType);
|
|
457
|
+
if (iIndex >= 0) {
|
|
458
|
+
if (_isCompositeType.call(this, oType)) {
|
|
459
|
+
//used for compositeTypes if just one value needs to be transfered without any parsing (Timezone)
|
|
460
|
+
var aValue = merge([], oType._aCurrentValue);
|
|
461
|
+
aValue[iIndex] = vValue;
|
|
462
|
+
return Condition.createCondition(sDefaultOperator, [aValue], undefined, undefined, ConditionValidated.NotValidated);
|
|
463
|
+
}
|
|
464
|
+
} else if (sSourceType === sTargetTypeRaw) {
|
|
465
|
+
return Condition.createCondition(sDefaultOperator, [vValue], undefined, undefined, ConditionValidated.NotValidated);
|
|
466
|
+
} else {
|
|
467
|
+
return Condition.createCondition(sDefaultOperator, [oType.parseValue(vValue, sSourceType)], undefined, undefined, ConditionValidated.NotValidated);
|
|
468
|
+
}
|
|
400
469
|
}
|
|
401
470
|
}
|
|
402
|
-
throw new ParseException("Don't know how to parse Condition from " +
|
|
471
|
+
throw new ParseException("Don't know how to parse Condition from " + sSourceType);
|
|
403
472
|
}
|
|
404
473
|
|
|
405
474
|
};
|
|
@@ -557,7 +626,7 @@ sap.ui.define([
|
|
|
557
626
|
}
|
|
558
627
|
|
|
559
628
|
return SyncPromise.resolve().then(function() {
|
|
560
|
-
return _getItemForValue.call(this, vCheckValue, vCheckParsedValue, oBindingContext, bCheckKeyFirst, bCheckKey, bCheckDescription, oConditionModel, sConditionModelName);
|
|
629
|
+
return _getItemForValue.call(this, vCheckValue, vCheckParsedValue, oType, oBindingContext, bCheckKeyFirst, bCheckKey, bCheckDescription, oConditionModel, sConditionModelName);
|
|
561
630
|
}.bind(this)).then(function(oResult) {
|
|
562
631
|
return fnGetResult.call(this, oResult, fnSuccess);
|
|
563
632
|
}.bind(this)).catch(function(oException) {
|
|
@@ -617,6 +686,21 @@ sap.ui.define([
|
|
|
617
686
|
|
|
618
687
|
}
|
|
619
688
|
|
|
689
|
+
/**
|
|
690
|
+
* Validates a given condition. The values of the condition are validated using the given data type.
|
|
691
|
+
*
|
|
692
|
+
* @param {sap.ui.mdc.condition.ConditionObject} oCondition
|
|
693
|
+
* The condition to be validated
|
|
694
|
+
* @returns {void|Promise}
|
|
695
|
+
* <code>undefined</code> or a <code>Promise</code> resolving with an undefined value
|
|
696
|
+
* @throws {sap.ui.model.ValidateException}
|
|
697
|
+
* If at least one of the values of the condition is not valid for the given data type; the message of the exception is
|
|
698
|
+
* language dependent as it may be displayed on the UI
|
|
699
|
+
*
|
|
700
|
+
* @private
|
|
701
|
+
* @ui5-restricted sap.ui.mdc.field.FieldBase, sap.fe
|
|
702
|
+
* @MDC_PUBLIC_CANDIDATE
|
|
703
|
+
*/
|
|
620
704
|
ConditionType.prototype.validateValue = function(oCondition) {
|
|
621
705
|
|
|
622
706
|
var oType = _getValueType.call(this);
|
|
@@ -886,7 +970,7 @@ sap.ui.define([
|
|
|
886
970
|
|
|
887
971
|
}
|
|
888
972
|
|
|
889
|
-
function _getItemForValue(vValue, vParsedValue, oBindingContext, bCheckKeyFirst, bCheckKey, bCheckDescription, oConditionModel, sConditionModelName) {
|
|
973
|
+
function _getItemForValue(vValue, vParsedValue, oType, oBindingContext, bCheckKeyFirst, bCheckKey, bCheckDescription, oConditionModel, sConditionModelName) {
|
|
890
974
|
|
|
891
975
|
var oFieldHelp = _getFieldHelp.call(this);
|
|
892
976
|
var oDelegate = this.oFormatOptions.delegate;
|
|
@@ -895,6 +979,7 @@ sap.ui.define([
|
|
|
895
979
|
var oConfig = {
|
|
896
980
|
value: vValue,
|
|
897
981
|
parsedValue: vParsedValue,
|
|
982
|
+
dataType: oType,
|
|
898
983
|
inParameters: undefined, // TODO: needed?
|
|
899
984
|
outParameters: undefined, // TODO: needed?
|
|
900
985
|
bindingContext: oBindingContext,
|
|
@@ -917,31 +1002,32 @@ sap.ui.define([
|
|
|
917
1002
|
|
|
918
1003
|
}
|
|
919
1004
|
|
|
920
|
-
function _getDescription(vKey, oCondition, oBindingContext, oConditionModel, sConditionModelName) {
|
|
1005
|
+
function _getDescription(vKey, oCondition, oType, oBindingContext, oConditionModel, sConditionModelName) {
|
|
921
1006
|
|
|
922
1007
|
var oFieldHelp = _getFieldHelp.call(this);
|
|
923
1008
|
var oDelegate = this.oFormatOptions.delegate;
|
|
924
1009
|
var oPayload = this.oFormatOptions.payload;
|
|
925
1010
|
var oControl = this.oFormatOptions.control;
|
|
926
1011
|
if (oDelegate) {
|
|
927
|
-
return oDelegate.getDescription(oPayload, oFieldHelp, vKey, oCondition.inParameters, oCondition.outParameters, oBindingContext, oConditionModel, sConditionModelName, oCondition.payload, oControl);
|
|
1012
|
+
return oDelegate.getDescription(oPayload, oFieldHelp, vKey, oCondition.inParameters, oCondition.outParameters, oBindingContext, oConditionModel, sConditionModelName, oCondition.payload, oControl, oType);
|
|
928
1013
|
} else if (oFieldHelp) {
|
|
929
1014
|
if (oFieldHelp.isA("sap.ui.mdc.ValueHelp")) {
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
1015
|
+
var oConfig = {
|
|
1016
|
+
value: vKey,
|
|
1017
|
+
parsedValue: vKey,
|
|
1018
|
+
dataType: oType,
|
|
1019
|
+
context: {inParameters: oCondition.inParameters, outParameters: oCondition.outParameters, payload: oCondition.payload},
|
|
1020
|
+
bindingContext: oBindingContext,
|
|
1021
|
+
conditionModel: oConditionModel,
|
|
1022
|
+
conditionModelName: sConditionModelName,
|
|
1023
|
+
checkKey: true,
|
|
1024
|
+
checkDescription: false,
|
|
1025
|
+
caseSensitive: true, // case sensitive as used to get description for known key
|
|
1026
|
+
exception: FormatException,
|
|
1027
|
+
control: oControl
|
|
1028
|
+
};
|
|
1029
|
+
return oFieldHelp.getItemForValue(oConfig);
|
|
1030
|
+
} else {
|
|
945
1031
|
return oFieldHelp.getTextForKey(vKey, oCondition.inParameters, oCondition.outParameters, oBindingContext, oConditionModel, sConditionModelName);
|
|
946
1032
|
}
|
|
947
1033
|
}
|
|
@@ -974,6 +1060,16 @@ sap.ui.define([
|
|
|
974
1060
|
|
|
975
1061
|
}
|
|
976
1062
|
|
|
1063
|
+
function _getIndexOfRawValue(sType) {
|
|
1064
|
+
|
|
1065
|
+
var iIndex = -1;
|
|
1066
|
+
if (sType.startsWith(sTargetTypeRawComposite)) {
|
|
1067
|
+
iIndex = parseInt(sType[sTargetTypeRawComposite.length]);
|
|
1068
|
+
}
|
|
1069
|
+
return iIndex;
|
|
1070
|
+
|
|
1071
|
+
}
|
|
1072
|
+
|
|
977
1073
|
return ConditionType;
|
|
978
1074
|
|
|
979
1075
|
});
|