@openui5/sap.ui.mdc 1.111.1 → 1.112.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/Chart.js +21 -23
- package/src/sap/ui/mdc/ChartDelegate.js +1 -1
- package/src/sap/ui/mdc/ChartRenderer.js +0 -2
- 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 +6 -6
- package/src/sap/ui/mdc/FilterBar.js +1 -1
- package/src/sap/ui/mdc/FilterBarDelegate.js +0 -37
- package/src/sap/ui/mdc/FilterField.js +4 -4
- package/src/sap/ui/mdc/Link.js +1 -1
- package/src/sap/ui/mdc/MultiValueField.js +1 -1
- package/src/sap/ui/mdc/Table.js +3 -11
- package/src/sap/ui/mdc/TableDelegate.js +5 -3
- package/src/sap/ui/mdc/ValueHelp.js +28 -15
- 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/ChartImplementationContainerRenderer.js +0 -2
- package/src/sap/ui/mdc/chart/ChartSelectionDetails.js +1 -1
- package/src/sap/ui/mdc/chart/ChartToolbar.js +2 -2
- package/src/sap/ui/mdc/chart/ChartTypeButton.js +2 -2
- package/src/sap/ui/mdc/chart/PropertyHelper.js +35 -2
- 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/FilterConverter.js +1 -1
- package/src/sap/ui/mdc/condition/FilterOperatorUtil.js +43 -1
- package/src/sap/ui/mdc/condition/Operator.js +1 -1
- package/src/sap/ui/mdc/condition/OperatorDynamicDateOption.js +10 -17
- package/src/sap/ui/mdc/condition/RangeOperator.js +7 -8
- package/src/sap/ui/mdc/field/ConditionType.js +1 -1
- package/src/sap/ui/mdc/field/ConditionsType.js +1 -1
- package/src/sap/ui/mdc/field/CustomFieldInfo.js +1 -1
- package/src/sap/ui/mdc/field/DefineConditionPanel.js +6 -6
- package/src/sap/ui/mdc/field/DynamicDateRangeConditionsType.js +49 -62
- package/src/sap/ui/mdc/field/FieldBase.js +93 -33
- package/src/sap/ui/mdc/field/FieldInfoBase.js +1 -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/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/content/DateContent.js +1 -2
- package/src/sap/ui/mdc/filterbar/FilterBarBase.js +2 -2
- package/src/sap/ui/mdc/filterbar/FilterBarBaseRenderer.js +3 -0
- package/src/sap/ui/mdc/filterbar/PropertyHelper.js +1 -1
- package/src/sap/ui/mdc/filterbar/p13n/AdaptationFilterBar.js +29 -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/GroupFlex.js +56 -9
- package/src/sap/ui/mdc/flexibility/SortFlex.js +56 -9
- package/src/sap/ui/mdc/flexibility/Util.js +8 -3
- package/src/sap/ui/mdc/library.js +108 -2
- 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 +1 -1
- package/src/sap/ui/mdc/link/Panel.js +1 -1
- 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 +15 -0
- package/src/sap/ui/mdc/messagebundle_ar.properties +11 -1
- package/src/sap/ui/mdc/messagebundle_bg.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_ca.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_cs.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_cy.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_da.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_de.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_el.properties +13 -3
- package/src/sap/ui/mdc/messagebundle_en.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_en_GB.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_en_US_sappsd.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_en_US_saprigi.properties +2 -0
- package/src/sap/ui/mdc/messagebundle_en_US_saptrc.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_es.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_es_MX.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_et.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_fi.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_fr.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_fr_CA.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_hi.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_hr.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_hu.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_id.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_it.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_iw.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_ja.properties +11 -1
- package/src/sap/ui/mdc/messagebundle_kk.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_ko.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_lt.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_lv.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_ms.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_nl.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_no.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_pl.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_pt.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_pt_PT.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_ro.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_ru.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_sh.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_sk.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_sl.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_sv.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_th.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_tr.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_uk.properties +15 -5
- package/src/sap/ui/mdc/messagebundle_vi.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_zh_CN.properties +10 -0
- package/src/sap/ui/mdc/messagebundle_zh_TW.properties +10 -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 +4 -3
- package/src/sap/ui/mdc/mixin/PromiseMixin.js +1 -1
- package/src/sap/ui/mdc/mixin/PropertyHelperMixin.js +1 -71
- package/src/sap/ui/mdc/odata/v4/TableDelegate.js +7 -0
- package/src/sap/ui/mdc/p13n/P13nBuilder.js +382 -376
- 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/panels/FilterPanel.js +1 -1
- package/src/sap/ui/mdc/p13n/subcontroller/AdaptFiltersController.js +5 -3
- package/src/sap/ui/mdc/p13n/subcontroller/ColumnWidthController.js +1 -1
- package/src/sap/ui/mdc/p13n/subcontroller/FilterController.js +158 -11
- package/src/sap/ui/mdc/p13n/subcontroller/LinkPanelController.js +7 -7
- package/src/sap/ui/mdc/p13n/subcontroller/SelectionController.js +1 -1
- 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/GridTableType.js +19 -0
- 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/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/table/menu/Item.js +6 -0
- package/src/sap/ui/mdc/themes/base/Chart.less +1 -1
- package/src/sap/ui/mdc/themes/base/ValueHelpDialog.less +5 -1
- package/src/sap/ui/mdc/util/DateUtil.js +84 -95
- package/src/sap/ui/mdc/util/InfoBar.js +88 -60
- package/src/sap/ui/mdc/util/PromiseCache.js +1 -1
- package/src/sap/ui/mdc/util/PropertyHelper.js +5 -1
- package/src/sap/ui/mdc/util/TypeUtil.js +6 -3
- package/src/sap/ui/mdc/valuehelp/Dialog.js +67 -58
- package/src/sap/ui/mdc/valuehelp/Popover.js +19 -1
- package/src/sap/ui/mdc/valuehelp/base/Container.js +12 -1
- package/src/sap/ui/mdc/valuehelp/base/Content.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/MDCTable.js +1 -1
- package/src/sap/ui/mdc/valuehelp/content/MTable.js +6 -8
- package/src/sap/ui/mdc/p13n/Engine.js +0 -1200
- package/src/sap/ui/mdc/p13n/FlexUtil.js +0 -276
- package/src/sap/ui/mdc/p13n/subcontroller/BaseController.js +0 -438
|
@@ -54,7 +54,7 @@ function(
|
|
|
54
54
|
*
|
|
55
55
|
* @namespace
|
|
56
56
|
* @author SAP SE
|
|
57
|
-
* @version 1.
|
|
57
|
+
* @version 1.112.0
|
|
58
58
|
* @since 1.73.0
|
|
59
59
|
* @alias sap.ui.mdc.condition.FilterOperatorUtil
|
|
60
60
|
*
|
|
@@ -917,7 +917,44 @@ function(
|
|
|
917
917
|
calcRange: function() {
|
|
918
918
|
return UniversalDateUtils.ranges.dateToYear();
|
|
919
919
|
}
|
|
920
|
+
}),
|
|
921
|
+
lastMinutes: new RangeOperator({
|
|
922
|
+
name: "LASTMINUTES",
|
|
923
|
+
valueTypes: [{name: "sap.ui.model.type.Integer", formatOptions: {emptyString: null}, constraints: { minimum: 0 }}],
|
|
924
|
+
paramTypes: ["(\\d+)"],
|
|
925
|
+
additionalInfo: "",
|
|
926
|
+
calcRange: function(iDuration) {
|
|
927
|
+
return UniversalDateUtils.ranges.lastMinutes(iDuration);
|
|
928
|
+
}
|
|
929
|
+
}),
|
|
930
|
+
nextMinutes: new RangeOperator({
|
|
931
|
+
name: "NEXTMINUTES",
|
|
932
|
+
valueTypes: [{name: "sap.ui.model.type.Integer", formatOptions: {emptyString: null}, constraints: { minimum: 0 }}],
|
|
933
|
+
paramTypes: ["(\\d+)"],
|
|
934
|
+
additionalInfo: "",
|
|
935
|
+
calcRange: function(iDuration) {
|
|
936
|
+
return UniversalDateUtils.ranges.nextMinutes(iDuration);
|
|
937
|
+
}
|
|
938
|
+
}),
|
|
939
|
+
lastHours: new RangeOperator({
|
|
940
|
+
name: "LASTHOURS",
|
|
941
|
+
valueTypes: [{name: "sap.ui.model.type.Integer", formatOptions: {emptyString: null}, constraints: { minimum: 0 }}],
|
|
942
|
+
paramTypes: ["(\\d+)"],
|
|
943
|
+
additionalInfo: "",
|
|
944
|
+
calcRange: function(iDuration) {
|
|
945
|
+
return UniversalDateUtils.ranges.lastHours(iDuration);
|
|
946
|
+
}
|
|
947
|
+
}),
|
|
948
|
+
nextHours: new RangeOperator({
|
|
949
|
+
name: "NEXTHOURS",
|
|
950
|
+
valueTypes: [{name: "sap.ui.model.type.Integer", formatOptions: {emptyString: null}, constraints: { minimum: 0 }}],
|
|
951
|
+
paramTypes: ["(\\d+)"],
|
|
952
|
+
additionalInfo: "",
|
|
953
|
+
calcRange: function(iDuration) {
|
|
954
|
+
return UniversalDateUtils.ranges.nextHours(iDuration);
|
|
955
|
+
}
|
|
920
956
|
})
|
|
957
|
+
|
|
921
958
|
},
|
|
922
959
|
|
|
923
960
|
_mDefaultOpsForType: {}, // defines default operators for types
|
|
@@ -1643,6 +1680,11 @@ function(
|
|
|
1643
1680
|
FilterOperatorUtil._mOperators.notGreaterThan,
|
|
1644
1681
|
FilterOperatorUtil._mOperators.notGreaterEqual,
|
|
1645
1682
|
|
|
1683
|
+
FilterOperatorUtil._mOperators.lastMinutes,
|
|
1684
|
+
FilterOperatorUtil._mOperators.nextMinutes,
|
|
1685
|
+
FilterOperatorUtil._mOperators.lastHours,
|
|
1686
|
+
FilterOperatorUtil._mOperators.nextHours,
|
|
1687
|
+
|
|
1646
1688
|
FilterOperatorUtil._mOperators.today,
|
|
1647
1689
|
FilterOperatorUtil._mOperators.yesterday,
|
|
1648
1690
|
FilterOperatorUtil._mOperators.tomorrow,
|
|
@@ -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.112.0
|
|
88
88
|
* @private
|
|
89
89
|
* @ui5-restricted sap.fe
|
|
90
90
|
* @MDC_PUBLIC_CANDIDATE
|
|
@@ -51,7 +51,7 @@ sap.ui.define([
|
|
|
51
51
|
* @extends sap.m.DynamicDateOption
|
|
52
52
|
*
|
|
53
53
|
* @author SAP SE
|
|
54
|
-
* @version 1.
|
|
54
|
+
* @version 1.112.0
|
|
55
55
|
*
|
|
56
56
|
* @private
|
|
57
57
|
* @ui5-restricted sap.ui.mdc
|
|
@@ -262,8 +262,7 @@ sap.ui.define([
|
|
|
262
262
|
// TODO: DatePicker or Calendar?
|
|
263
263
|
// convert internal value to date
|
|
264
264
|
if (oValue && oValue.values[i]) {
|
|
265
|
-
oDate = DateUtil.
|
|
266
|
-
oDate = DateUtil.utcToLocal(oDate);
|
|
265
|
+
oDate = DateUtil.typeToDate(oValue.values[i], oType, sBaseType);
|
|
267
266
|
}
|
|
268
267
|
var oFormatOptions = oType.getFormatOptions();
|
|
269
268
|
|
|
@@ -379,11 +378,10 @@ sap.ui.define([
|
|
|
379
378
|
if (!oInputControl.isValidValue()) {
|
|
380
379
|
throw new ParseException(); // to show error state
|
|
381
380
|
}
|
|
382
|
-
vValue = oInputControl.getDateValue();
|
|
381
|
+
vValue = oInputControl.getDateValue(); // returns local UI5Date
|
|
383
382
|
if (vValue) {
|
|
384
383
|
// parse to Types format
|
|
385
|
-
vValue = DateUtil.
|
|
386
|
-
vValue = DateUtil.universalDateToType(vValue, oType, sBaseType);
|
|
384
|
+
vValue = DateUtil.dateToType(vValue, oType, sBaseType);
|
|
387
385
|
}
|
|
388
386
|
} else {
|
|
389
387
|
vValue = oInputControl.getValue();
|
|
@@ -424,21 +422,17 @@ sap.ui.define([
|
|
|
424
422
|
var i = 0;
|
|
425
423
|
|
|
426
424
|
if (oOperator.isA("sap.ui.mdc.condition.RangeOperator")) {
|
|
427
|
-
aRange = oOperator._getRange(oValue && oValue.values, oType, sBaseType);
|
|
425
|
+
aRange = oOperator._getRange(oValue && oValue.values, oType, sBaseType); // aRange contains date in Type presentation
|
|
428
426
|
// convert to local date
|
|
429
427
|
for (i = 0; i < aRange.length; i++) {
|
|
430
|
-
aRange[i] = DateUtil.
|
|
431
|
-
aRange[i] = DateUtil.utcToLocal(aRange[i]);
|
|
428
|
+
aRange[i] = DateUtil.typeToDate(aRange[i], oType, sBaseType);
|
|
432
429
|
}
|
|
433
430
|
} else if (oOperator.valueTypes.length === 0) {
|
|
434
431
|
aRange = [];
|
|
435
432
|
} else if (oOperator.valueTypes[0] === Operator.ValueType.Self) {
|
|
436
|
-
aRange =
|
|
437
|
-
for (i = 0; i <
|
|
438
|
-
|
|
439
|
-
aRange[i] = DateUtil.typeToUniversalDate(aRange[i], oType, sBaseType);
|
|
440
|
-
aRange[i] = DateUtil.utcToLocal(aRange[i]);
|
|
441
|
-
}
|
|
433
|
+
aRange = [];
|
|
434
|
+
for (i = 0; i < oValue.values.length; i++) {
|
|
435
|
+
aRange.push(oValue.values[i] ? DateUtil.typeToDate(oValue.values[i], oType, sBaseType) : oValue.values[i]);
|
|
442
436
|
}
|
|
443
437
|
if (aRange.length === 1) {
|
|
444
438
|
// TODO: better solution for single dates
|
|
@@ -446,10 +440,9 @@ sap.ui.define([
|
|
|
446
440
|
}
|
|
447
441
|
// TODO How to convert GT or GE.....
|
|
448
442
|
} else if ([Operator.ValueType.Self, Operator.ValueType.Static].indexOf(oOperator.valueTypes[0]) === -1) {
|
|
449
|
-
// oType = oOperator._createLocalType(oOperator.valueTypes[0], this.type);
|
|
450
443
|
throw new Error("Cannot convert to date, use RangeOperator");
|
|
451
444
|
}
|
|
452
|
-
return aRange;
|
|
445
|
+
return aRange; // aRange contains local UI5Dates
|
|
453
446
|
};
|
|
454
447
|
|
|
455
448
|
OperatorDynamicDateOption.prototype.format = function(oValue) {
|
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
7
7
|
'sap/ui/mdc/condition/Operator',
|
|
8
|
-
'sap/ui/model/Filter',
|
|
9
8
|
'sap/ui/mdc/util/DateUtil',
|
|
9
|
+
'sap/ui/model/Filter',
|
|
10
10
|
'sap/base/Log'
|
|
11
11
|
],
|
|
12
12
|
|
|
13
13
|
function(
|
|
14
14
|
Operator,
|
|
15
|
-
Filter,
|
|
16
15
|
DateUtil,
|
|
16
|
+
Filter,
|
|
17
17
|
Log
|
|
18
18
|
) {
|
|
19
19
|
"use strict";
|
|
@@ -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.112.0
|
|
37
37
|
* @private
|
|
38
38
|
* @ui5-restricted sap.fe
|
|
39
39
|
* @MDC_PUBLIC_CANDIDATE
|
|
@@ -93,7 +93,7 @@ sap.ui.define([
|
|
|
93
93
|
};
|
|
94
94
|
|
|
95
95
|
RangeOperator.prototype._getRange = function(aValues, oType, sBaseType) {
|
|
96
|
-
var aRange;
|
|
96
|
+
var aRange; // contains UniversalDates in local time
|
|
97
97
|
if (aValues) {
|
|
98
98
|
if (aValues.length === 2) {
|
|
99
99
|
aRange = this.calcRange(aValues[0], aValues[1]);
|
|
@@ -105,12 +105,11 @@ sap.ui.define([
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
for (var i = 0; i < 2; i++) {
|
|
108
|
-
//the calcRange result must be converted from local time
|
|
109
|
-
aRange[i]
|
|
110
|
-
aRange[i] = DateUtil.universalDateToType(aRange[i], oType, sBaseType);
|
|
108
|
+
//the calcRange result must be converted from local time into the correct type format.
|
|
109
|
+
aRange[i] = DateUtil.dateToType(aRange[i].getJSDate(), oType, sBaseType);
|
|
111
110
|
}
|
|
112
111
|
|
|
113
|
-
return aRange;
|
|
112
|
+
return aRange; // containes type presentation of dates in local time
|
|
114
113
|
};
|
|
115
114
|
|
|
116
115
|
/**
|
|
@@ -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.112.0
|
|
20
20
|
* @constructor
|
|
21
21
|
* @private
|
|
22
22
|
* @ui5-restricted sap.fe
|
|
@@ -93,7 +93,7 @@ sap.ui.define([
|
|
|
93
93
|
* @extends sap.ui.core.Control
|
|
94
94
|
*
|
|
95
95
|
* @author SAP SE
|
|
96
|
-
* @version 1.
|
|
96
|
+
* @version 1.112.0
|
|
97
97
|
*
|
|
98
98
|
* @constructor
|
|
99
99
|
* @alias sap.ui.mdc.field.DefineConditionPanel
|
|
@@ -290,7 +290,7 @@ sap.ui.define([
|
|
|
290
290
|
for (var i = 0; i < aGridContent.length && iRow <= iIndex; i++) {
|
|
291
291
|
var oField = aGridContent[i];
|
|
292
292
|
if (iRow === iIndex && oField instanceof Field && oField.hasOwnProperty("_iValueIndex")) {
|
|
293
|
-
if (oField.
|
|
293
|
+
if (oField._isInvalidInput()) { // TODO: better was to find out parsing error
|
|
294
294
|
oField.setValue(null); // to remove invalid value from parsing
|
|
295
295
|
}
|
|
296
296
|
}
|
|
@@ -594,7 +594,7 @@ sap.ui.define([
|
|
|
594
594
|
for (var i = 0; i < aGridContent.length; i++) {
|
|
595
595
|
var oField = aGridContent[i];
|
|
596
596
|
if (oField instanceof Field && oField.hasOwnProperty("_iValueIndex")) {
|
|
597
|
-
if (oField.
|
|
597
|
+
if (oField._isInvalidInput()) { // TODO: better was to find out parsing error
|
|
598
598
|
oField.setValue(); // to remove invalid value from parsing
|
|
599
599
|
}
|
|
600
600
|
}
|
|
@@ -705,14 +705,14 @@ sap.ui.define([
|
|
|
705
705
|
// find fields and initialize error state
|
|
706
706
|
oValue0Field = oGrid.getContent()[iIndex + 2];
|
|
707
707
|
if (oValue0Field && oValue0Field.hasOwnProperty("_iValueIndex") && oValue0Field._iValueIndex === 0) {
|
|
708
|
-
if (oValue0Field instanceof Field && !oValue0Field.
|
|
708
|
+
if (oValue0Field instanceof Field && !oValue0Field._isInvalidInput()) { // TODO: better was to find out parsing error // TODO: handle custom controls
|
|
709
709
|
// if Field is in parsing error state, don't remove error
|
|
710
710
|
oValue0Field.setValueState(ValueState.None);
|
|
711
711
|
oValue0Field.setValueStateText();
|
|
712
712
|
}
|
|
713
713
|
oValue1Field = oGrid.getContent()[iIndex + 3]; // second field only exists if first field exist
|
|
714
714
|
if (oValue1Field && oValue1Field.hasOwnProperty("_iValueIndex") && oValue1Field._iValueIndex === 1) {
|
|
715
|
-
if (oValue1Field instanceof Field && !oValue1Field.
|
|
715
|
+
if (oValue1Field instanceof Field && !oValue1Field._isInvalidInput()) { // TODO: better was to find out parsing error // TODO: handle custom controls
|
|
716
716
|
// if Field is in parsing error state, don't remove error
|
|
717
717
|
oValue1Field.setValueState(ValueState.None);
|
|
718
718
|
oValue1Field.setValueStateText();
|
|
@@ -1604,7 +1604,7 @@ sap.ui.define([
|
|
|
1604
1604
|
}
|
|
1605
1605
|
}
|
|
1606
1606
|
|
|
1607
|
-
if (oField.getMetadata().getAllProperties().valueState && !oField.
|
|
1607
|
+
if (oField.getMetadata().getAllProperties().valueState && !oField._isInvalidInput() && (!oField2 || !oField2._isInvalidInput())) { // TODO: better was to find out parsing error
|
|
1608
1608
|
// if Field is in parsing error state, user entry is not transfered to condition, so validating makes no sense.
|
|
1609
1609
|
var oType = oField.getBinding("value").getType(); // use nullable data type from Field - don't create new type for each check
|
|
1610
1610
|
try {
|
|
@@ -12,12 +12,11 @@ sap.ui.define([
|
|
|
12
12
|
'sap/ui/mdc/condition/Condition',
|
|
13
13
|
'sap/ui/mdc/enum/ConditionValidated',
|
|
14
14
|
'sap/ui/mdc/enum/BaseType',
|
|
15
|
-
|
|
15
|
+
'sap/ui/mdc/util/DateUtil',
|
|
16
16
|
'sap/ui/model/SimpleType',
|
|
17
17
|
'sap/ui/model/FormatException',
|
|
18
18
|
'sap/ui/model/ParseException',
|
|
19
19
|
'sap/ui/model/ValidateException',
|
|
20
|
-
'sap/m/DynamicDate',
|
|
21
20
|
'sap/m/library'
|
|
22
21
|
],
|
|
23
22
|
function(
|
|
@@ -32,7 +31,6 @@ sap.ui.define([
|
|
|
32
31
|
FormatException,
|
|
33
32
|
ParseException,
|
|
34
33
|
ValidateException,
|
|
35
|
-
DynamicDateType,
|
|
36
34
|
mLibrary
|
|
37
35
|
) {
|
|
38
36
|
"use strict";
|
|
@@ -46,7 +44,7 @@ sap.ui.define([
|
|
|
46
44
|
* @extends sap.ui.mdc.field.ConditionsType
|
|
47
45
|
*
|
|
48
46
|
* @author SAP SE
|
|
49
|
-
* @version 1.
|
|
47
|
+
* @version 1.112.0
|
|
50
48
|
*
|
|
51
49
|
* @since 1.96.0
|
|
52
50
|
* @private
|
|
@@ -122,10 +120,21 @@ sap.ui.define([
|
|
|
122
120
|
var sOption = FilterOperatorUtil.getDynamicDateOptionForOperator(oOperator, mLibrary.StandardDynamicDateRangeKeys, sBaseType);
|
|
123
121
|
|
|
124
122
|
for (var i = 0; i < oOperator.valueTypes.length; i++) {
|
|
125
|
-
if (
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
123
|
+
if (oOperator.valueTypes[i] && oOperator.valueTypes[i] !== Operator.ValueType.Static) {
|
|
124
|
+
if (sOption) { // only for standard operators (dates are needed as local dates)
|
|
125
|
+
if (oOperator.valueTypes[i] === Operator.ValueType.Self) {
|
|
126
|
+
aValues.push(DateUtil.typeToDate(oCondition.values[i], _getValueType.call(this), sBaseType));
|
|
127
|
+
} else {
|
|
128
|
+
var sOperatorBaseType = _getBaseTypeForValueType.call(this, oOperator.valueTypes[i]);
|
|
129
|
+
if (sOperatorBaseType === BaseType.Date || sOperatorBaseType === BaseType.DateTime) {
|
|
130
|
+
aValues.push(DateUtil.typeToDate(oCondition.values[i], _getOperatorType.call(this, oOperator, i), sOperatorBaseType));
|
|
131
|
+
} else {
|
|
132
|
+
aValues.push(oCondition.values[i]); // e.g integer value
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
} else {
|
|
136
|
+
aValues.push(oCondition.values[i]); // for custom operators just forward value. (Operator inside handle it)
|
|
137
|
+
}
|
|
129
138
|
}
|
|
130
139
|
}
|
|
131
140
|
|
|
@@ -133,56 +142,13 @@ sap.ui.define([
|
|
|
133
142
|
sOption = FilterOperatorUtil.getCustomDynamicDateOptionForOperator(oOperator, sBaseType);
|
|
134
143
|
}
|
|
135
144
|
|
|
136
|
-
|
|
137
|
-
vResult = oDynamicDateType.formatValue({operator: sOption, values: aValues}, sInternalType);
|
|
145
|
+
vResult = {operator: sOption, values: aValues};
|
|
138
146
|
}
|
|
139
147
|
|
|
140
148
|
return vResult;
|
|
141
149
|
|
|
142
150
|
};
|
|
143
151
|
|
|
144
|
-
function _getDynamicDateType(sBaseType) {
|
|
145
|
-
|
|
146
|
-
if (!this._oDynamicDateType) {
|
|
147
|
-
var oDynamicDateFormatOptions = {
|
|
148
|
-
date: {
|
|
149
|
-
source: {pattern: "timestamp"}
|
|
150
|
-
},
|
|
151
|
-
"int": {}
|
|
152
|
-
};
|
|
153
|
-
if (sBaseType === BaseType.DateTime) {
|
|
154
|
-
oDynamicDateFormatOptions.datetime = {
|
|
155
|
-
source: {pattern: "timestamp"}
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
this._oDynamicDateType = new DynamicDateType(oDynamicDateFormatOptions);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
return this._oDynamicDateType;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
function _dateToTimestamp(vValue) {
|
|
166
|
-
|
|
167
|
-
var oType = _getValueType.call(this);
|
|
168
|
-
var oModelFormat = oType.getModelFormat();
|
|
169
|
-
var oDate = oModelFormat.parse(vValue); // All Date and DateTime types parse the model specific value into a JS-Date via ModelFormat. UTC is used, so the JS Date is timezone independent. For Date types UTC 00:00:00 is used.
|
|
170
|
-
return oDate.getTime();
|
|
171
|
-
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
function _timestampToDate(iTimeStamp) {
|
|
175
|
-
|
|
176
|
-
var oType = _getValueType.call(this);
|
|
177
|
-
var oModelFormat = oType.getModelFormat();
|
|
178
|
-
var oDate = new Date(iTimeStamp);
|
|
179
|
-
oDate.setUTCMilliseconds(0); // ignore missiseconds for the moment (As not saved in variants)
|
|
180
|
-
var vDate = oModelFormat.format(oDate); // All Date and DateTime types parse the model specific value into a JS-Date via ModelFormat. UTC is used, so the JS Date is timezone independent. For Date types UTC 00:00:00 is used.
|
|
181
|
-
|
|
182
|
-
return vDate;
|
|
183
|
-
|
|
184
|
-
}
|
|
185
|
-
|
|
186
152
|
DynamicDateRangeConditionsType.prototype.parseValue = function(oValue, sInternalType) {
|
|
187
153
|
|
|
188
154
|
if (this._bDestroyed) { // if destroyed do nothing
|
|
@@ -200,21 +166,29 @@ sap.ui.define([
|
|
|
200
166
|
throw new ParseException(oValue.values[0]);
|
|
201
167
|
}
|
|
202
168
|
|
|
203
|
-
var
|
|
204
|
-
var oOperator = FilterOperatorUtil.getOperatorForDynamicDateOption(
|
|
205
|
-
sOperator = oOperator.name; // map it back to the real Operator name
|
|
169
|
+
var sOption = oValue.operator; // sOperator is the Option name
|
|
170
|
+
var oOperator = FilterOperatorUtil.getOperatorForDynamicDateOption(sOption, _getBaseType.call(this)); // search via name and alias
|
|
206
171
|
|
|
207
172
|
if (oOperator) {
|
|
208
173
|
var sBaseType = _getBaseType.call(this);
|
|
209
|
-
var oDynamicDateType = _getDynamicDateType.call(this, sBaseType);
|
|
210
|
-
var vResult = oDynamicDateType.parseValue(oValue, sInternalType);
|
|
211
174
|
var aValues = [];
|
|
212
175
|
|
|
213
176
|
for (var i = 0; i < oOperator.valueTypes.length; i++) {
|
|
214
|
-
if (
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
177
|
+
if (oOperator.valueTypes[i] && oOperator.valueTypes[i] !== Operator.ValueType.Static) {
|
|
178
|
+
if (mLibrary.StandardDynamicDateRangeKeys[sOption]) { // only for standard operators (dates are returned as local dates)
|
|
179
|
+
if (oOperator.valueTypes[i] === Operator.ValueType.Self) {
|
|
180
|
+
aValues.push(DateUtil.dateToType(oValue.values[i], _getValueType.call(this), sBaseType));
|
|
181
|
+
} else {
|
|
182
|
+
var sOperatorBaseType = oOperator.valueTypes[i] === Operator.ValueType.Self ? sBaseType : _getBaseTypeForValueType.call(this, oOperator.valueTypes[i]);
|
|
183
|
+
if (sOperatorBaseType === BaseType.Date || sOperatorBaseType === BaseType.DateTime) {
|
|
184
|
+
aValues.push(DateUtil.dateToType(oValue.values[i], _getOperatorType.call(this, oOperator, i), sOperatorBaseType));
|
|
185
|
+
} else {
|
|
186
|
+
aValues.push(oValue.values[i]); // e.g integer values
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
} else {
|
|
190
|
+
aValues.push(oValue.values[i]); // for custom operators take what comes (inside the Operator already creted te right value)
|
|
191
|
+
}
|
|
218
192
|
}
|
|
219
193
|
}
|
|
220
194
|
|
|
@@ -300,14 +274,27 @@ sap.ui.define([
|
|
|
300
274
|
var sType = oType.getMetadata().getName();
|
|
301
275
|
var oFormatOptions = oType.getFormatOptions();
|
|
302
276
|
var oConstraints = oType.getConstraints();
|
|
277
|
+
|
|
278
|
+
return _getBaseTypeForValueType.call(this, {name: sType, formatOptions: oFormatOptions, constraints: oConstraints});
|
|
279
|
+
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
function _getBaseTypeForValueType(oValueType) {
|
|
283
|
+
|
|
303
284
|
var oDelegate = this.oFormatOptions.delegate;
|
|
304
285
|
var oPayload = this.oFormatOptions.payload;
|
|
305
|
-
var sBaseType = oDelegate ? oDelegate.getTypeUtil(oPayload).getBaseType(
|
|
286
|
+
var sBaseType = oDelegate ? oDelegate.getTypeUtil(oPayload).getBaseType(oValueType.name, oValueType.formatOptions, oValueType.constraints) : BaseType.Date;
|
|
306
287
|
|
|
307
288
|
return sBaseType;
|
|
308
289
|
|
|
309
290
|
}
|
|
310
291
|
|
|
292
|
+
function _getOperatorType(oOperator, iIndex) {
|
|
293
|
+
|
|
294
|
+
return oOperator._createLocalType(oOperator.valueTypes[iIndex]);
|
|
295
|
+
|
|
296
|
+
}
|
|
297
|
+
|
|
311
298
|
return DynamicDateRangeConditionsType;
|
|
312
299
|
|
|
313
300
|
});
|