@openui5/sap.ui.mdc 1.99.0 → 1.100.1
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/THIRDPARTY.txt +2 -2
- 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 +50 -32
- package/src/sap/ui/mdc/ChartDelegate.js +66 -21
- package/src/sap/ui/mdc/ChartRenderer.js +1 -1
- package/src/sap/ui/mdc/Control.js +11 -6
- package/src/sap/ui/mdc/Element.js +10 -6
- package/src/sap/ui/mdc/Field.js +19 -4
- package/src/sap/ui/mdc/FilterBar.js +1 -1
- package/src/sap/ui/mdc/FilterBarDelegate.js +26 -0
- package/src/sap/ui/mdc/FilterField.js +41 -3
- package/src/sap/ui/mdc/Link.js +3 -3
- package/src/sap/ui/mdc/MultiValueField.js +11 -1
- package/src/sap/ui/mdc/Table.js +73 -39
- package/src/sap/ui/mdc/TableDelegate.js +28 -1
- package/src/sap/ui/mdc/ValueHelp.js +8 -3
- package/src/sap/ui/mdc/ValueHelpDelegate.js +2 -1
- package/src/sap/ui/mdc/actiontoolbar/ActionToolbarAction.js +1 -1
- package/src/sap/ui/mdc/actiontoolbar/ActionToolbarActionRenderer.js +1 -1
- package/src/sap/ui/mdc/chart/ChartSelectionDetails.js +1 -1
- package/src/sap/ui/mdc/chart/ChartToolbar.js +13 -6
- package/src/sap/ui/mdc/chart/DrillBreadcrumbs.js +7 -7
- package/src/sap/ui/mdc/chart/DrillStackHandler.js +6 -6
- package/src/sap/ui/mdc/chart/PropertyHelper.js +1 -1
- package/src/sap/ui/mdc/condition/Condition.js +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 +4 -2
- package/src/sap/ui/mdc/condition/FilterOperatorUtil.js +133 -25
- package/src/sap/ui/mdc/condition/Operator.js +4 -2
- package/src/sap/ui/mdc/condition/OperatorDynamicDateOption.js +78 -24
- package/src/sap/ui/mdc/condition/RangeOperator.js +5 -5
- package/src/sap/ui/mdc/designtime/Util.js +63 -0
- package/src/sap/ui/mdc/designtime/actiontoolbar/ActionToolbar.designtime.js +23 -30
- package/src/sap/ui/mdc/designtime/chart/Chart.designtime.js +3 -0
- package/src/sap/ui/mdc/designtime/link/PanelItem.designtime.js +3 -1
- package/src/sap/ui/mdc/designtime/table/Table.designtime.js +39 -52
- package/src/sap/ui/mdc/field/BoolFieldHelp.js +1 -1
- package/src/sap/ui/mdc/field/ConditionFieldHelp.js +1 -1
- package/src/sap/ui/mdc/field/ConditionType.js +15 -4
- package/src/sap/ui/mdc/field/ConditionsType.js +2 -1
- package/src/sap/ui/mdc/field/CustomFieldHelp.js +1 -1
- package/src/sap/ui/mdc/field/CustomFieldInfo.js +1 -1
- package/src/sap/ui/mdc/field/DefineConditionPanel.js +16 -5
- package/src/sap/ui/mdc/field/DynamicDateRangeConditionsType.js +76 -19
- package/src/sap/ui/mdc/field/FieldBase.js +62 -11
- package/src/sap/ui/mdc/field/FieldBaseDelegate.js +1 -1
- package/src/sap/ui/mdc/field/FieldHelpBase.js +1 -1
- package/src/sap/ui/mdc/field/FieldInfoBase.js +2 -1
- package/src/sap/ui/mdc/field/FieldInput.js +1 -1
- package/src/sap/ui/mdc/field/FieldInputRenderUtil.js +1 -1
- package/src/sap/ui/mdc/field/FieldMultiInput.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelp.js +4 -1
- package/src/sap/ui/mdc/field/FieldValueHelpContentWrapperBase.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelpDelegate.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelpMTableWrapper.js +5 -4
- package/src/sap/ui/mdc/field/FieldValueHelpMdcTableWrapper.js +5 -3
- package/src/sap/ui/mdc/field/FieldValueHelpTableWrapperBase.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelpUITableWrapper.js +7 -7
- package/src/sap/ui/mdc/field/InParameter.js +1 -1
- package/src/sap/ui/mdc/field/ListFieldHelp.js +1 -1
- package/src/sap/ui/mdc/field/ListFieldHelpItem.js +1 -1
- package/src/sap/ui/mdc/field/MultiValueFieldItem.js +1 -1
- package/src/sap/ui/mdc/field/OutParameter.js +1 -1
- package/src/sap/ui/mdc/field/TokenDisplay.js +1 -1
- package/src/sap/ui/mdc/field/TokenizerDisplay.js +1 -1
- package/src/sap/ui/mdc/field/ValueHelpPanel.js +1 -1
- package/src/sap/ui/mdc/field/content/ContentFactory.js +5 -1
- package/src/sap/ui/mdc/field/content/DateContent.js +27 -19
- package/src/sap/ui/mdc/field/content/DateTimeContent.js +0 -6
- package/src/sap/ui/mdc/filterbar/FilterBarBase.js +76 -208
- package/src/sap/ui/mdc/filterbar/PropertyHelper.js +27 -2
- package/src/sap/ui/mdc/filterbar/p13n/AdaptationFilterBar.js +127 -57
- package/src/sap/ui/mdc/filterbar/p13n/FilterColumnLayout.js +2 -2
- package/src/sap/ui/mdc/filterbar/p13n/GroupContainer.js +7 -3
- package/src/sap/ui/mdc/filterbar/p13n/TableContainer.js +52 -14
- package/src/sap/ui/mdc/filterbar/vh/FilterBar.js +37 -19
- package/src/sap/ui/mdc/filterbar/vh/FilterContainer.js +1 -1
- package/src/sap/ui/mdc/flexibility/AggregationConfigFlex.js +48 -31
- package/src/sap/ui/mdc/flexibility/Chart.flexibility.js +1 -1
- package/src/sap/ui/mdc/flexibility/ChartItemFlex.js +36 -0
- package/src/sap/ui/mdc/flexibility/ConditionFlex.js +47 -10
- package/src/sap/ui/mdc/flexibility/FilterBar.flexibility.js +1 -1
- package/src/sap/ui/mdc/flexibility/FilterItemFlex.js +1 -1
- package/src/sap/ui/mdc/flexibility/ItemBaseFlex.js +0 -1
- package/src/sap/ui/mdc/flexibility/PropertyInfoFlex.js +2 -85
- package/src/sap/ui/mdc/library.js +11 -4
- 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/PanelListItem.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 +2 -1
- package/src/sap/ui/mdc/mixin/AdaptationMixin.js +20 -19
- package/src/sap/ui/mdc/mixin/DelegateMixin.js +1 -141
- package/src/sap/ui/mdc/mixin/FilterIntegrationMixin.js +1 -9
- package/src/sap/ui/mdc/mixin/PromiseMixin.js +1 -1
- package/src/sap/ui/mdc/mixin/PropertyHelperMixin.js +348 -0
- package/src/sap/ui/mdc/odata/TypeUtil.js +1 -1
- package/src/sap/ui/mdc/odata/v4/ChartPropertyHelper.js +70 -3
- package/src/sap/ui/mdc/odata/v4/FilterBarDelegate.js +116 -20
- package/src/sap/ui/mdc/odata/v4/ODataMetaModelUtil.js +2 -2
- package/src/sap/ui/mdc/odata/v4/TableDelegate.js +11 -33
- package/src/sap/ui/mdc/odata/v4/TypeUtil.js +2 -4
- package/src/sap/ui/mdc/odata/v4/ValueHelpDelegate.js +1 -1
- package/src/sap/ui/mdc/odata/v4/vizChart/ChartDelegate.js +281 -263
- package/src/sap/ui/mdc/p13n/AdaptationProvider.js +1 -1
- package/src/sap/ui/mdc/p13n/Engine.js +21 -18
- package/src/sap/ui/mdc/p13n/FlexUtil.js +0 -5
- package/src/sap/ui/mdc/p13n/PropertyHelper.js +2 -2
- package/src/sap/ui/mdc/p13n/StateUtil.js +4 -0
- package/src/sap/ui/mdc/p13n/UIManager.js +16 -13
- package/src/sap/ui/mdc/p13n/modification/ModificationHandler.js +18 -14
- package/src/sap/ui/mdc/p13n/modules/DefaultProviderRegistry.js +1 -1
- package/src/sap/ui/mdc/p13n/panels/ActionToolbarPanel.js +6 -6
- package/src/sap/ui/mdc/p13n/panels/AdaptFiltersPanel.js +49 -27
- package/src/sap/ui/mdc/p13n/panels/ChartItemPanel.js +4 -3
- package/src/sap/ui/mdc/p13n/panels/FilterPanel.js +136 -0
- package/src/sap/ui/mdc/p13n/panels/GroupView.js +53 -28
- package/src/sap/ui/mdc/p13n/panels/LinkSelectionPanel.js +54 -18
- package/src/sap/ui/mdc/p13n/subcontroller/ActionToolbarController.js +4 -7
- package/src/sap/ui/mdc/p13n/subcontroller/AdaptFiltersController.js +1 -2
- package/src/sap/ui/mdc/p13n/subcontroller/BaseController.js +1 -1
- package/src/sap/ui/mdc/p13n/subcontroller/FilterController.js +8 -4
- package/src/sap/ui/mdc/p13n/subcontroller/LinkPanelController.js +1 -0
- package/src/sap/ui/mdc/p13n/subcontroller/SortController.js +2 -2
- package/src/sap/ui/mdc/table/CreationRow.js +1 -1
- package/src/sap/ui/mdc/table/GridTableType.js +75 -27
- package/src/sap/ui/mdc/table/PropertyHelper.js +20 -13
- package/src/sap/ui/mdc/table/ResponsiveTableType.js +86 -13
- package/src/sap/ui/mdc/table/RowActionItem.js +119 -0
- package/src/sap/ui/mdc/table/RowSettings.js +42 -1
- package/src/sap/ui/mdc/table/V4AnalyticsPropertyHelper.js +2 -2
- package/src/sap/ui/mdc/themes/base/Chart.less +2 -0
- package/src/sap/ui/mdc/themes/base/ValueHelpDialog.less +1 -0
- package/src/sap/ui/mdc/util/DateUtil.js +32 -7
- package/src/sap/ui/mdc/util/FilterUtil.js +1 -1
- package/src/sap/ui/mdc/util/PromiseCache.js +1 -1
- package/src/sap/ui/mdc/util/PropertyHelper.js +201 -76
- package/src/sap/ui/mdc/util/TypeUtil.js +1 -1
- package/src/sap/ui/mdc/valuehelp/Dialog.js +1 -1
- package/src/sap/ui/mdc/valuehelp/Popover.js +5 -3
- package/src/sap/ui/mdc/valuehelp/base/Container.js +1 -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 +4 -4
- 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 +13 -10
- package/src/sap/ui/mdc/valuehelp/content/MDCTable.js +4 -10
- package/src/sap/ui/mdc/valuehelp/content/MTable.js +6 -4
- package/test/sap/ui/mdc/testutils/opa/chart/TestObjects.js +2 -0
- package/test/sap/ui/mdc/testutils/opa/filterbar/TestObjects.js +0 -1
- package/test/sap/ui/mdc/testutils/opa/p13n/Actions.js +8 -6
- package/src/sap/ui/mdc/filterbar/vh/GenericFilterBarDelegate.js +0 -150
- package/src/sap/ui/mdc/p13n/panels/BasePanel.js +0 -721
- package/src/sap/ui/mdc/p13n/panels/ListView.js +0 -408
- package/src/sap/ui/mdc/p13n/panels/SelectionPanel.js +0 -92
- package/src/sap/ui/mdc/p13n/panels/SortPanel.js +0 -150
- package/src/sap/ui/mdc/ui/Container.js +0 -240
- package/src/sap/ui/mdc/ui/ContainerItem.js +0 -79
|
@@ -56,7 +56,7 @@ function(
|
|
|
56
56
|
*
|
|
57
57
|
* @namespace
|
|
58
58
|
* @author SAP SE
|
|
59
|
-
* @version 1.
|
|
59
|
+
* @version 1.100.1
|
|
60
60
|
* @since 1.73.0
|
|
61
61
|
* @alias sap.ui.mdc.condition.FilterOperatorUtil
|
|
62
62
|
*
|
|
@@ -70,7 +70,7 @@ function(
|
|
|
70
70
|
_mOperators: {
|
|
71
71
|
equal: new Operator({
|
|
72
72
|
name: "EQ",
|
|
73
|
-
alias: "DATE",
|
|
73
|
+
alias: {Date: "DATE", DateTime: "DATETIME"},
|
|
74
74
|
filterOperator: ModelOperator.EQ,
|
|
75
75
|
tokenParse: "^=([^=].*)$",
|
|
76
76
|
tokenFormat: "{1} ({0})", // all placeholder should use the {x} format - the text could be store in the resourcebundel file.
|
|
@@ -207,7 +207,7 @@ function(
|
|
|
207
207
|
}),
|
|
208
208
|
between: new Operator({
|
|
209
209
|
name: "BT",
|
|
210
|
-
alias: "DATERANGE",
|
|
210
|
+
alias: {Date: "DATERANGE", DateTime:"DATETIMERANGE"},
|
|
211
211
|
filterOperator: ModelOperator.BT,
|
|
212
212
|
tokenParse: "^([^!].*)\\.\\.\\.(.+)$", // TODO: does this work?? At least also matches crap like ".....". I guess validation of value types needs to get rid of those.
|
|
213
213
|
tokenFormat: "{0}...{1}",
|
|
@@ -276,7 +276,7 @@ function(
|
|
|
276
276
|
}),
|
|
277
277
|
lessEqual: new Operator({
|
|
278
278
|
name: "LE",
|
|
279
|
-
alias: "TO",
|
|
279
|
+
alias: {Date: "TO", DateTime: "TODATETIME"},
|
|
280
280
|
filterOperator: ModelOperator.LE,
|
|
281
281
|
tokenParse: "^<=(.+)$",
|
|
282
282
|
tokenFormat: "<={0}",
|
|
@@ -292,7 +292,7 @@ function(
|
|
|
292
292
|
}),
|
|
293
293
|
greaterEqual: new Operator({
|
|
294
294
|
name: "GE",
|
|
295
|
-
alias: "FROM",
|
|
295
|
+
alias: {Date: "FROM", DateTime: "FROMDATETIME"},
|
|
296
296
|
filterOperator: ModelOperator.GE,
|
|
297
297
|
tokenParse: "^>=(.+)$",
|
|
298
298
|
tokenFormat: ">={0}",
|
|
@@ -365,7 +365,7 @@ function(
|
|
|
365
365
|
tokenParse: "^<#tokenText#>$",
|
|
366
366
|
tokenFormat: "<#tokenText#>",
|
|
367
367
|
valueTypes: [],
|
|
368
|
-
getModelFilter: function(oCondition, sFieldPath, oType, bCaseSensitive) {
|
|
368
|
+
getModelFilter: function(oCondition, sFieldPath, oType, bCaseSensitive, sBaseType) {
|
|
369
369
|
var isNullable = false;
|
|
370
370
|
if (oType) {
|
|
371
371
|
var vResult = oType.parseValue("", "string");
|
|
@@ -397,7 +397,7 @@ function(
|
|
|
397
397
|
tokenFormat: "!(<#tokenText#>)",
|
|
398
398
|
valueTypes: [],
|
|
399
399
|
exclude: true,
|
|
400
|
-
getModelFilter: function(oCondition, sFieldPath, oType, bCaseSensitive) {
|
|
400
|
+
getModelFilter: function(oCondition, sFieldPath, oType, bCaseSensitive, sBaseType) {
|
|
401
401
|
var isNullable = false;
|
|
402
402
|
if (oType) {
|
|
403
403
|
var vResult = oType.parseValue("", "string");
|
|
@@ -544,7 +544,6 @@ function(
|
|
|
544
544
|
}
|
|
545
545
|
}),
|
|
546
546
|
todayFromTo: new RangeOperator({
|
|
547
|
-
alias: "TODAYXYDAYS",
|
|
548
547
|
name: "TODAYFROMTO",
|
|
549
548
|
valueTypes: [
|
|
550
549
|
{name: "sap.ui.model.type.Integer", formatOptions: { emptyString: null }},
|
|
@@ -581,7 +580,6 @@ function(
|
|
|
581
580
|
}
|
|
582
581
|
}),
|
|
583
582
|
thisWeek: new RangeOperator({
|
|
584
|
-
alias: "CURRENTWEEK",
|
|
585
583
|
name: "THISWEEK",
|
|
586
584
|
valueTypes: [Operator.ValueType.Static],
|
|
587
585
|
calcRange: function() {
|
|
@@ -621,7 +619,6 @@ function(
|
|
|
621
619
|
}
|
|
622
620
|
}),
|
|
623
621
|
thisMonth: new RangeOperator({
|
|
624
|
-
alias: "CURRENTMONTH",
|
|
625
622
|
name: "THISMONTH",
|
|
626
623
|
valueTypes: [Operator.ValueType.Static],
|
|
627
624
|
calcRange: function() {
|
|
@@ -661,7 +658,6 @@ function(
|
|
|
661
658
|
}
|
|
662
659
|
}),
|
|
663
660
|
thisQuarter: new RangeOperator({
|
|
664
|
-
alias: "CURRENTQUARTER",
|
|
665
661
|
name: "THISQUARTER",
|
|
666
662
|
valueTypes: [Operator.ValueType.Static],
|
|
667
663
|
calcRange: function() {
|
|
@@ -694,7 +690,6 @@ function(
|
|
|
694
690
|
}
|
|
695
691
|
}),
|
|
696
692
|
quarter1: new RangeOperator({
|
|
697
|
-
alias: "FIRSTQUARTER",
|
|
698
693
|
name: "QUARTER1",
|
|
699
694
|
valueTypes: [Operator.ValueType.Static],
|
|
700
695
|
calcRange: function() {
|
|
@@ -702,7 +697,6 @@ function(
|
|
|
702
697
|
}
|
|
703
698
|
}),
|
|
704
699
|
quarter2: new RangeOperator({
|
|
705
|
-
alias: "SECONDQUARTER",
|
|
706
700
|
name: "QUARTER2",
|
|
707
701
|
valueTypes: [Operator.ValueType.Static],
|
|
708
702
|
calcRange: function() {
|
|
@@ -710,7 +704,6 @@ function(
|
|
|
710
704
|
}
|
|
711
705
|
}),
|
|
712
706
|
quarter3: new RangeOperator({
|
|
713
|
-
alias: "THIRDQUARTER",
|
|
714
707
|
name: "QUARTER3",
|
|
715
708
|
valueTypes: [Operator.ValueType.Static],
|
|
716
709
|
calcRange: function() {
|
|
@@ -718,7 +711,6 @@ function(
|
|
|
718
711
|
}
|
|
719
712
|
}),
|
|
720
713
|
quarter4: new RangeOperator({
|
|
721
|
-
alias: "FOURTHQUARTER",
|
|
722
714
|
name: "QUARTER4",
|
|
723
715
|
valueTypes: [Operator.ValueType.Static],
|
|
724
716
|
calcRange: function() {
|
|
@@ -733,7 +725,6 @@ function(
|
|
|
733
725
|
}
|
|
734
726
|
}),
|
|
735
727
|
thisYear: new RangeOperator({
|
|
736
|
-
alias: "CURRENTYEAR",
|
|
737
728
|
name: "THISYEAR",
|
|
738
729
|
valueTypes: [Operator.ValueType.Static],
|
|
739
730
|
calcRange: function() {
|
|
@@ -1223,14 +1214,7 @@ function(
|
|
|
1223
1214
|
|
|
1224
1215
|
for (var sName in FilterOperatorUtil._mOperators) {
|
|
1225
1216
|
var oOperator = FilterOperatorUtil._mOperators[sName];
|
|
1226
|
-
if (
|
|
1227
|
-
return oOperator;
|
|
1228
|
-
}
|
|
1229
|
-
}
|
|
1230
|
-
|
|
1231
|
-
for (var sName in FilterOperatorUtil._mOperators) {
|
|
1232
|
-
var oOperator = FilterOperatorUtil._mOperators[sName];
|
|
1233
|
-
if ( oOperator.alias === sOperator) {
|
|
1217
|
+
if (oOperator.name === sOperator) {
|
|
1234
1218
|
return oOperator;
|
|
1235
1219
|
}
|
|
1236
1220
|
}
|
|
@@ -1477,6 +1461,81 @@ function(
|
|
|
1477
1461
|
oOperator.checkValidated(oCondition);
|
|
1478
1462
|
}
|
|
1479
1463
|
|
|
1464
|
+
},
|
|
1465
|
+
|
|
1466
|
+
/**
|
|
1467
|
+
* Returns the operator object for the given <code>DynamicDateOption</code> name.
|
|
1468
|
+
* @param {string} sOption Name of the operator
|
|
1469
|
+
* @param {sap.ui.mdc.enum.BaseType} [sBaseType] Basic type
|
|
1470
|
+
* @returns {sap.ui.mdc.condition.Operator} the operator object, or undefined if the operator with the requested name does not exist
|
|
1471
|
+
*
|
|
1472
|
+
* @protected
|
|
1473
|
+
* @since: 1.100.0
|
|
1474
|
+
*/
|
|
1475
|
+
getOperatorForDynamicDateOption: function(sOption, sBaseType) {
|
|
1476
|
+
|
|
1477
|
+
var oOperator;
|
|
1478
|
+
|
|
1479
|
+
// determine operator name if used as custom DynamicDateOption created in DateContent using getCustomDynamicDateOptionForOperator
|
|
1480
|
+
if (sBaseType && sOption.startsWith(sBaseType)) {
|
|
1481
|
+
oOperator = this.getOperator(sOption.slice(sBaseType.length + 1));
|
|
1482
|
+
} else {
|
|
1483
|
+
oOperator = this.getOperator(sOption);
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
if (!oOperator && sBaseType) {
|
|
1487
|
+
for (var sName in FilterOperatorUtil._mOperators) {
|
|
1488
|
+
var oCheckOperator = FilterOperatorUtil._mOperators[sName];
|
|
1489
|
+
if (oCheckOperator.alias && oCheckOperator.alias[sBaseType] === sOption) {
|
|
1490
|
+
oOperator = oCheckOperator;
|
|
1491
|
+
break;
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1496
|
+
return oOperator;
|
|
1497
|
+
|
|
1498
|
+
},
|
|
1499
|
+
|
|
1500
|
+
/**
|
|
1501
|
+
* Determines the corresponding <code>DynamicDateOption</code> for an <code>Operator</code>
|
|
1502
|
+
* from a map of known keys
|
|
1503
|
+
*
|
|
1504
|
+
* @param {sap.ui.mdc.condition.Operator} oOperator Condition to check
|
|
1505
|
+
* @param {object} oDynamicDateRangeKeys Keys for <code>DynamicDateOption</code>
|
|
1506
|
+
* @param {sap.ui.mdc.enum.BaseType} sBaseType Basic type
|
|
1507
|
+
* @returns {string} <code>DynamicDateOption</code>
|
|
1508
|
+
* @protected
|
|
1509
|
+
* @since: 1.100.0
|
|
1510
|
+
*/
|
|
1511
|
+
getDynamicDateOptionForOperator: function(oOperator, oDynamicDateRangeKeys, sBaseType) {
|
|
1512
|
+
|
|
1513
|
+
var sOption;
|
|
1514
|
+
if (oOperator) {
|
|
1515
|
+
if (oDynamicDateRangeKeys[oOperator.name]) {
|
|
1516
|
+
sOption = oOperator.name;
|
|
1517
|
+
} else if (oOperator.alias && oDynamicDateRangeKeys[oOperator.alias[sBaseType]]) {
|
|
1518
|
+
sOption = oOperator.alias[sBaseType];
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
return sOption;
|
|
1523
|
+
|
|
1524
|
+
},
|
|
1525
|
+
|
|
1526
|
+
/**
|
|
1527
|
+
* Determines the corresponding custom <code>DynamicDateOption</code> for an <code>Operator</code>
|
|
1528
|
+
*
|
|
1529
|
+
* @param {sap.ui.mdc.condition.Operator} oOperator Condition to check
|
|
1530
|
+
* @param {sap.ui.mdc.enum.BaseType} sBaseType Basic type
|
|
1531
|
+
* @returns {string} <code>DynamicDateOption</code>
|
|
1532
|
+
* @protected
|
|
1533
|
+
* @since: 1.100.0
|
|
1534
|
+
*/
|
|
1535
|
+
getCustomDynamicDateOptionForOperator: function(oOperator, sBaseType) {
|
|
1536
|
+
|
|
1537
|
+
return sBaseType + "-" + oOperator.name;
|
|
1538
|
+
|
|
1480
1539
|
}
|
|
1481
1540
|
};
|
|
1482
1541
|
|
|
@@ -1591,7 +1650,56 @@ function(
|
|
|
1591
1650
|
FilterOperatorUtil._mOperators.notLessThan,
|
|
1592
1651
|
FilterOperatorUtil._mOperators.notLessEqual,
|
|
1593
1652
|
FilterOperatorUtil._mOperators.notGreaterThan,
|
|
1594
|
-
FilterOperatorUtil._mOperators.notGreaterEqual
|
|
1653
|
+
FilterOperatorUtil._mOperators.notGreaterEqual,
|
|
1654
|
+
|
|
1655
|
+
FilterOperatorUtil._mOperators.today,
|
|
1656
|
+
FilterOperatorUtil._mOperators.yesterday,
|
|
1657
|
+
FilterOperatorUtil._mOperators.tomorrow,
|
|
1658
|
+
FilterOperatorUtil._mOperators.firstDayWeek,
|
|
1659
|
+
FilterOperatorUtil._mOperators.lastDayWeek,
|
|
1660
|
+
FilterOperatorUtil._mOperators.firstDayMonth,
|
|
1661
|
+
FilterOperatorUtil._mOperators.lastDayMonth,
|
|
1662
|
+
FilterOperatorUtil._mOperators.firstDayQuarter,
|
|
1663
|
+
FilterOperatorUtil._mOperators.lastDayQuarter,
|
|
1664
|
+
FilterOperatorUtil._mOperators.firstDayYear,
|
|
1665
|
+
FilterOperatorUtil._mOperators.lastDayYear,
|
|
1666
|
+
FilterOperatorUtil._mOperators.todayFromTo,
|
|
1667
|
+
FilterOperatorUtil._mOperators.lastDays,
|
|
1668
|
+
FilterOperatorUtil._mOperators.nextDays,
|
|
1669
|
+
|
|
1670
|
+
FilterOperatorUtil._mOperators.thisWeek,
|
|
1671
|
+
FilterOperatorUtil._mOperators.lastWeek,
|
|
1672
|
+
FilterOperatorUtil._mOperators.lastWeeks,
|
|
1673
|
+
FilterOperatorUtil._mOperators.nextWeek,
|
|
1674
|
+
FilterOperatorUtil._mOperators.nextWeeks,
|
|
1675
|
+
|
|
1676
|
+
FilterOperatorUtil._mOperators.specificMonth,
|
|
1677
|
+
FilterOperatorUtil._mOperators.specificMonthInYear,
|
|
1678
|
+
FilterOperatorUtil._mOperators.thisMonth,
|
|
1679
|
+
FilterOperatorUtil._mOperators.lastMonth,
|
|
1680
|
+
FilterOperatorUtil._mOperators.lastMonths,
|
|
1681
|
+
FilterOperatorUtil._mOperators.nextMonth,
|
|
1682
|
+
FilterOperatorUtil._mOperators.nextMonths,
|
|
1683
|
+
|
|
1684
|
+
FilterOperatorUtil._mOperators.thisQuarter,
|
|
1685
|
+
FilterOperatorUtil._mOperators.lastQuarter,
|
|
1686
|
+
FilterOperatorUtil._mOperators.lastQuarters,
|
|
1687
|
+
FilterOperatorUtil._mOperators.nextQuarter,
|
|
1688
|
+
FilterOperatorUtil._mOperators.nextQuarters,
|
|
1689
|
+
|
|
1690
|
+
FilterOperatorUtil._mOperators.quarter1,
|
|
1691
|
+
FilterOperatorUtil._mOperators.quarter2,
|
|
1692
|
+
FilterOperatorUtil._mOperators.quarter3,
|
|
1693
|
+
FilterOperatorUtil._mOperators.quarter4,
|
|
1694
|
+
|
|
1695
|
+
FilterOperatorUtil._mOperators.thisYear,
|
|
1696
|
+
FilterOperatorUtil._mOperators.lastYear,
|
|
1697
|
+
FilterOperatorUtil._mOperators.lastYears,
|
|
1698
|
+
FilterOperatorUtil._mOperators.nextYear,
|
|
1699
|
+
FilterOperatorUtil._mOperators.nextYears,
|
|
1700
|
+
|
|
1701
|
+
FilterOperatorUtil._mOperators.yearToDate,
|
|
1702
|
+
FilterOperatorUtil._mOperators.dateToYear
|
|
1595
1703
|
]
|
|
1596
1704
|
);
|
|
1597
1705
|
FilterOperatorUtil.setOperatorsForType(
|
|
@@ -46,6 +46,7 @@ sap.ui.define([
|
|
|
46
46
|
* @extends sap.ui.base.Object
|
|
47
47
|
* @param {object} oConfiguration Properties of the operator
|
|
48
48
|
* @param {string} oConfiguration.name Name of the operator used in the condition
|
|
49
|
+
* @param {object} [oConfiguration.alias] Alias names based on <code>BaseType</code>, used to map to <code>DynamicDateOption</code> if <code>DynamicDateRange</code> is used
|
|
49
50
|
* @param {string} oConfiguration.filterOperator The operator's default filter operator that is created as defined in {@link sap.ui.model.FilterOperator FilterOperator}
|
|
50
51
|
* @param {string} oConfiguration.tokenParse The string representation of the regular expression that is used by the operator to parse a value
|
|
51
52
|
* to eliminate the operator and get the data string. A placeholder that refers to the translated tokenText can be used. <code>#tokenText#</code> refers to the
|
|
@@ -83,7 +84,7 @@ sap.ui.define([
|
|
|
83
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.
|
|
84
85
|
* @constructor
|
|
85
86
|
* @author SAP SE
|
|
86
|
-
* @version 1.
|
|
87
|
+
* @version 1.100.1
|
|
87
88
|
* @private
|
|
88
89
|
* @ui5-restricted sap.fe
|
|
89
90
|
* @MDC_PUBLIC_CANDIDATE
|
|
@@ -287,11 +288,12 @@ sap.ui.define([
|
|
|
287
288
|
* @param {string} sFieldPath Path of filter
|
|
288
289
|
* @param {sap.ui.model.Type} oType Data type of the used filter field
|
|
289
290
|
* @param {boolean} [bCaseSensitive] creates a caseSensitive filter
|
|
291
|
+
* @param {sap.ui.mdc.enum.BaseType} [sBaseType] Basic type
|
|
290
292
|
* @returns {sap.ui.model.Filter} filter object
|
|
291
293
|
* @private
|
|
292
294
|
* @ui5-restricted sap.ui.mdc
|
|
293
295
|
*/
|
|
294
|
-
Operator.prototype.getModelFilter = function(oCondition, sFieldPath, oType, bCaseSensitive) {
|
|
296
|
+
Operator.prototype.getModelFilter = function(oCondition, sFieldPath, oType, bCaseSensitive, sBaseType) {
|
|
295
297
|
|
|
296
298
|
var vValue = oCondition.values[0];
|
|
297
299
|
var oFilter;
|
|
@@ -8,9 +8,11 @@ sap.ui.define([
|
|
|
8
8
|
'sap/m/DynamicDateOption',
|
|
9
9
|
'sap/m/DynamicDateValueHelpUIType',
|
|
10
10
|
'sap/m/Input',
|
|
11
|
-
'sap/m/DatePicker',
|
|
12
11
|
'sap/ui/mdc/condition/Operator',
|
|
12
|
+
"sap/ui/mdc/enum/BaseType",
|
|
13
|
+
'sap/ui/mdc/enum/FieldDisplay',
|
|
13
14
|
'sap/ui/mdc/util/DateUtil',
|
|
15
|
+
'sap/ui/mdc/util/loadModules',
|
|
14
16
|
'sap/ui/model/json/JSONModel',
|
|
15
17
|
'sap/ui/model/FormatException',
|
|
16
18
|
'sap/ui/model/ParseException',
|
|
@@ -20,9 +22,11 @@ sap.ui.define([
|
|
|
20
22
|
DynamicDateOption,
|
|
21
23
|
DynamicDateValueHelpUIType,
|
|
22
24
|
Input,
|
|
23
|
-
DatePicker,
|
|
24
25
|
Operator,
|
|
26
|
+
BaseType,
|
|
27
|
+
FieldDisplay,
|
|
25
28
|
DateUtil,
|
|
29
|
+
loadModules,
|
|
26
30
|
JSONModel,
|
|
27
31
|
FormatException,
|
|
28
32
|
ParseException,
|
|
@@ -32,6 +36,8 @@ sap.ui.define([
|
|
|
32
36
|
"use strict";
|
|
33
37
|
|
|
34
38
|
var ValueState = coreLibrary.ValueState;
|
|
39
|
+
var DatePicker;
|
|
40
|
+
var DateTimePicker;
|
|
35
41
|
|
|
36
42
|
/**
|
|
37
43
|
* Constructor for a new OperatorDynamicDateOption.
|
|
@@ -45,7 +51,7 @@ sap.ui.define([
|
|
|
45
51
|
* @extends sap.m.DynamicDateOption
|
|
46
52
|
*
|
|
47
53
|
* @author SAP SE
|
|
48
|
-
* @version 1.
|
|
54
|
+
* @version 1.100.1
|
|
49
55
|
*
|
|
50
56
|
* @private
|
|
51
57
|
* @ui5-restricted sap.ui.mdc
|
|
@@ -61,20 +67,25 @@ sap.ui.define([
|
|
|
61
67
|
/**
|
|
62
68
|
* Operator used in the corresponding filter field.
|
|
63
69
|
*
|
|
64
|
-
* <b>Note:</b>
|
|
70
|
+
* <b>Note:</b> An operator must be an instance of {@link sap.ui.mdc.condition.Operator Operator}.
|
|
65
71
|
*/
|
|
66
72
|
operator: { type: "object" },
|
|
67
73
|
/**
|
|
68
74
|
* Data type of the corresponding filter field.
|
|
69
75
|
*
|
|
70
|
-
* <b>Note:</b> A
|
|
76
|
+
* <b>Note:</b> A type must be an instance of {@link sap.ui.model.Type Type}.
|
|
71
77
|
*/
|
|
72
|
-
type: { type: "object" }
|
|
78
|
+
type: { type: "object" },
|
|
79
|
+
/**
|
|
80
|
+
* Basic type of the corresponding filter field.
|
|
81
|
+
*/
|
|
82
|
+
baseType: { type: "sap.ui.mdc.enum.BaseType" }
|
|
73
83
|
}
|
|
74
84
|
}
|
|
75
85
|
});
|
|
76
86
|
|
|
77
87
|
OperatorDynamicDateOption.prototype.exit = function() {
|
|
88
|
+
DynamicDateOption.prototype.exit.apply(this, arguments);
|
|
78
89
|
if (this._oModel) {
|
|
79
90
|
this._oModel.destroy();
|
|
80
91
|
this._oModel = undefined;
|
|
@@ -90,6 +101,31 @@ sap.ui.define([
|
|
|
90
101
|
// _removeControls.call(this);
|
|
91
102
|
};
|
|
92
103
|
|
|
104
|
+
OperatorDynamicDateOption.prototype.applySettings = function() {
|
|
105
|
+
DynamicDateOption.prototype.applySettings.apply(this, arguments);
|
|
106
|
+
|
|
107
|
+
// load needed pickers
|
|
108
|
+
// TODO: request in DateContent to be sure that loaded? But needed only on opening, so async loading on initialization should be ok
|
|
109
|
+
var aModules = [];
|
|
110
|
+
var sBaseType = this.getBaseType();
|
|
111
|
+
if (sBaseType === BaseType.DateTime && !DateTimePicker) {
|
|
112
|
+
aModules.push("sap/m/DateTimePicker");
|
|
113
|
+
} else if (!DatePicker) {
|
|
114
|
+
aModules.push("sap/m/DatePicker");
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if (aModules.length > 0) {
|
|
118
|
+
return loadModules(aModules).then(function (aModules) {
|
|
119
|
+
if (sBaseType === BaseType.DateTime) {
|
|
120
|
+
DateTimePicker = aModules[0];
|
|
121
|
+
} else {
|
|
122
|
+
DatePicker = aModules[0];
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
};
|
|
128
|
+
|
|
93
129
|
OperatorDynamicDateOption.prototype.validateProperty = function(sPropertyName, oValue) {
|
|
94
130
|
|
|
95
131
|
if (sPropertyName === "operator" && oValue && (typeof oValue !== "object" || !oValue.isA || !oValue.isA("sap.ui.mdc.condition.Operator"))) {
|
|
@@ -104,13 +140,6 @@ sap.ui.define([
|
|
|
104
140
|
|
|
105
141
|
};
|
|
106
142
|
|
|
107
|
-
OperatorDynamicDateOption.prototype.getKey = function() {
|
|
108
|
-
|
|
109
|
-
var oOperator = this.getOperator();
|
|
110
|
-
return oOperator.name;
|
|
111
|
-
|
|
112
|
-
};
|
|
113
|
-
|
|
114
143
|
OperatorDynamicDateOption.prototype.isRange = function() {
|
|
115
144
|
|
|
116
145
|
var oOperator = this.getOperator();
|
|
@@ -130,15 +159,22 @@ sap.ui.define([
|
|
|
130
159
|
if (!this._aUITypes) {
|
|
131
160
|
var oOperator = this.getOperator();
|
|
132
161
|
var oType = this.getType();
|
|
162
|
+
var sBaseType = this.getBaseType();
|
|
133
163
|
this._aUITypes = [];
|
|
134
164
|
|
|
135
165
|
for (var i = 0; i < oOperator.valueTypes.length; i++) {
|
|
136
166
|
var vType = oOperator.valueTypes[i];
|
|
137
167
|
if (vType === Operator.ValueType.Self) {
|
|
168
|
+
var sType;
|
|
169
|
+
if (sBaseType === BaseType.DateTime) {
|
|
170
|
+
sType = "datetime";
|
|
171
|
+
} else {
|
|
172
|
+
sType = "date";
|
|
173
|
+
}
|
|
138
174
|
this._aUITypes.push(new DynamicDateValueHelpUIType({
|
|
139
|
-
type:
|
|
175
|
+
type: sType
|
|
140
176
|
}));
|
|
141
|
-
} else if (vType === Operator.ValueType.Static) {
|
|
177
|
+
} else if (!vType || vType === Operator.ValueType.Static) {
|
|
142
178
|
continue;
|
|
143
179
|
} else {
|
|
144
180
|
oType = oOperator._createLocalType(vType, oType);
|
|
@@ -187,8 +223,12 @@ sap.ui.define([
|
|
|
187
223
|
|
|
188
224
|
for (var i = 0; i < oOperator.valueTypes.length; i++) {
|
|
189
225
|
var vType = oOperator.valueTypes[i];
|
|
226
|
+
var sBaseType = this.getBaseType();
|
|
190
227
|
var oDate;
|
|
191
228
|
|
|
229
|
+
if (!vType) {
|
|
230
|
+
continue;
|
|
231
|
+
}
|
|
192
232
|
if (!oControl.aControlsByParameters[sKey][i]) {
|
|
193
233
|
if (oOperator.createControl) {
|
|
194
234
|
// use internal model to bind the control
|
|
@@ -221,12 +261,18 @@ sap.ui.define([
|
|
|
221
261
|
// TODO: DatePicker or Calendar?
|
|
222
262
|
// convert internal value to date
|
|
223
263
|
if (oValue && oValue.values[i]) {
|
|
224
|
-
oDate = DateUtil.typeToUniversalDate(oValue.values[i], oType);
|
|
264
|
+
oDate = DateUtil.typeToUniversalDate(oValue.values[i], oType, sBaseType);
|
|
225
265
|
oDate = DateUtil.utcToLocal(oDate);
|
|
226
266
|
}
|
|
227
267
|
var oFormatOptions = oType.getFormatOptions();
|
|
228
268
|
|
|
229
|
-
var
|
|
269
|
+
var Picker;
|
|
270
|
+
if (sBaseType === BaseType.DateTime) {
|
|
271
|
+
Picker = DateTimePicker;
|
|
272
|
+
} else {
|
|
273
|
+
Picker = DatePicker;
|
|
274
|
+
}
|
|
275
|
+
var oDatePicker = new Picker(sControlId + "-" + i, {
|
|
230
276
|
dateValue: oDate,
|
|
231
277
|
displayFormat: oFormatOptions.style || oFormatOptions.pattern,
|
|
232
278
|
displayFormatType: oFormatOptions.calendarType,
|
|
@@ -235,8 +281,11 @@ sap.ui.define([
|
|
|
235
281
|
oControl.aControlsByParameters[sKey].push(oDatePicker);
|
|
236
282
|
} else if (typeof vType === "object"){
|
|
237
283
|
// just use Input
|
|
284
|
+
oType = oOperator._createLocalType(oOperator.valueTypes[i], oType);
|
|
285
|
+
// format value to String using type
|
|
286
|
+
var sValue = oType.formatValue(oValue && oValue.values[i], "string");
|
|
238
287
|
var oInput = new Input(sControlId + "-" + i, {
|
|
239
|
-
value:
|
|
288
|
+
value: sValue,
|
|
240
289
|
change: fnChangeHandler
|
|
241
290
|
});
|
|
242
291
|
oControl.aControlsByParameters[sKey].push(oInput);
|
|
@@ -311,9 +360,13 @@ sap.ui.define([
|
|
|
311
360
|
var oResult = {operator: sKey, values: []};
|
|
312
361
|
var oOperator = this.getOperator();
|
|
313
362
|
var oType = this.getType();
|
|
363
|
+
var sBaseType = this.getBaseType();
|
|
314
364
|
var sControlId = oControl.getId();
|
|
315
365
|
|
|
316
366
|
for (var i = 0; i < oOperator.valueTypes.length; i++) {
|
|
367
|
+
if (!oOperator.valueTypes[i]) {
|
|
368
|
+
continue;
|
|
369
|
+
}
|
|
317
370
|
var oInputControl = oControl.aControlsByParameters[sKey][i];
|
|
318
371
|
if (oInputControl) {
|
|
319
372
|
var vValue;
|
|
@@ -329,7 +382,7 @@ sap.ui.define([
|
|
|
329
382
|
if (vValue) {
|
|
330
383
|
// parse to Types format
|
|
331
384
|
vValue = DateUtil.localToUtc(vValue);
|
|
332
|
-
vValue = DateUtil.universalDateToType(vValue, oType);
|
|
385
|
+
vValue = DateUtil.universalDateToType(vValue, oType, sBaseType);
|
|
333
386
|
}
|
|
334
387
|
} else {
|
|
335
388
|
vValue = oInputControl.getValue();
|
|
@@ -365,21 +418,22 @@ sap.ui.define([
|
|
|
365
418
|
OperatorDynamicDateOption.prototype.toDates = function(oValue) {
|
|
366
419
|
var oOperator = this.getOperator();
|
|
367
420
|
var oType = this.getType();
|
|
421
|
+
var sBaseType = this.getBaseType();
|
|
368
422
|
var aRange;
|
|
369
423
|
var i = 0;
|
|
370
424
|
|
|
371
425
|
if (oOperator.isA("sap.ui.mdc.condition.RangeOperator")) {
|
|
372
|
-
aRange = oOperator._getRange(oValue && oValue.values, oType);
|
|
426
|
+
aRange = oOperator._getRange(oValue && oValue.values, oType, sBaseType);
|
|
373
427
|
// convert to local date
|
|
374
428
|
for (i = 0; i < aRange.length; i++) {
|
|
375
|
-
aRange[i] = DateUtil.typeToUniversalDate(aRange[i], oType);
|
|
429
|
+
aRange[i] = DateUtil.typeToUniversalDate(aRange[i], oType, sBaseType);
|
|
376
430
|
aRange[i] = DateUtil.utcToLocal(aRange[i]);
|
|
377
431
|
}
|
|
378
432
|
} else if (oOperator.valueTypes[0] === Operator.ValueType.Self) {
|
|
379
433
|
aRange = oValue.values;
|
|
380
434
|
for (i = 0; i < aRange.length; i++) {
|
|
381
435
|
if (aRange[i]) {
|
|
382
|
-
aRange[i] = DateUtil.typeToUniversalDate(aRange[i], oType);
|
|
436
|
+
aRange[i] = DateUtil.typeToUniversalDate(aRange[i], oType, sBaseType);
|
|
383
437
|
aRange[i] = DateUtil.utcToLocal(aRange[i]);
|
|
384
438
|
}
|
|
385
439
|
}
|
|
@@ -398,7 +452,7 @@ sap.ui.define([
|
|
|
398
452
|
OperatorDynamicDateOption.prototype.format = function(oValue) {
|
|
399
453
|
var oOperator = this.getOperator();
|
|
400
454
|
var oType = this.getType();
|
|
401
|
-
return oOperator.format(oValue, oType);
|
|
455
|
+
return oOperator.format(oValue, oType, FieldDisplay.Value);
|
|
402
456
|
};
|
|
403
457
|
|
|
404
458
|
OperatorDynamicDateOption.prototype.parse = function(sValue) {
|
|
@@ -408,7 +462,7 @@ sap.ui.define([
|
|
|
408
462
|
if (sValue && oOperator.parse(sValue)) {
|
|
409
463
|
var oResult = {};
|
|
410
464
|
oResult.operator = this.getKey();
|
|
411
|
-
oResult.values = oOperator.parse(sValue, oType);
|
|
465
|
+
oResult.values = oOperator.parse(sValue, oType, FieldDisplay.Value);
|
|
412
466
|
return oResult;
|
|
413
467
|
}
|
|
414
468
|
};
|
|
@@ -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.100.1
|
|
37
37
|
* @private
|
|
38
38
|
* @ui5-restricted sap.fe
|
|
39
39
|
* @MDC_PUBLIC_CANDIDATE
|
|
@@ -87,12 +87,12 @@ sap.ui.define([
|
|
|
87
87
|
}
|
|
88
88
|
});
|
|
89
89
|
|
|
90
|
-
RangeOperator.prototype.getModelFilter = function(oCondition, sFieldPath, oType, bCaseSensitive) {
|
|
91
|
-
var aRange = this._getRange(oCondition.values, oType);
|
|
90
|
+
RangeOperator.prototype.getModelFilter = function(oCondition, sFieldPath, oType, bCaseSensitive, sBaseType) {
|
|
91
|
+
var aRange = this._getRange(oCondition.values, oType, sBaseType);
|
|
92
92
|
return new Filter({ path: sFieldPath, operator: "BT", value1: aRange[0], value2: aRange[1] });
|
|
93
93
|
};
|
|
94
94
|
|
|
95
|
-
RangeOperator.prototype._getRange = function(aValues, oType) {
|
|
95
|
+
RangeOperator.prototype._getRange = function(aValues, oType, sBaseType) {
|
|
96
96
|
var aRange;
|
|
97
97
|
if (aValues) {
|
|
98
98
|
if (aValues.length === 2) {
|
|
@@ -107,7 +107,7 @@ sap.ui.define([
|
|
|
107
107
|
for (var i = 0; i < 2; i++) {
|
|
108
108
|
//the calcRange result must be converted from local time to UTC and into the correct type format.
|
|
109
109
|
aRange[i].oDate = DateUtil.localToUtc(aRange[i].oDate);
|
|
110
|
-
aRange[i] = DateUtil.universalDateToType(aRange[i], oType);
|
|
110
|
+
aRange[i] = DateUtil.universalDateToType(aRange[i], oType, sBaseType);
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
return aRange;
|
|
@@ -0,0 +1,63 @@
|
|
|
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([], function () {
|
|
7
|
+
"use strict";
|
|
8
|
+
|
|
9
|
+
function getDefaultDesginTime() {
|
|
10
|
+
return {
|
|
11
|
+
actions: {},
|
|
12
|
+
aggregations: {},
|
|
13
|
+
description: "{description}",
|
|
14
|
+
name: "{name}",
|
|
15
|
+
properties: {}
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Returns the designTime metadata for the control. By default all the properties/aggregations which are not part of the allowed list array will be ignored from RTA/DTA
|
|
20
|
+
function enhanceDesignTimeMetadata(aAllowed, sKey, oDesignTime) {
|
|
21
|
+
var bAllowed = aAllowed.includes(sKey);
|
|
22
|
+
var oObject = bAllowed && oDesignTime[sKey] || {};
|
|
23
|
+
if (!Object.keys(oObject).length) {
|
|
24
|
+
oObject[sKey] = {
|
|
25
|
+
ignore: !bAllowed
|
|
26
|
+
};
|
|
27
|
+
Object.assign(oDesignTime, oObject);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
getDesignTime: function(ControlClass, aAllowedProperties, aAllowedAggregations, oDesignTime) {
|
|
33
|
+
// Check if designTime is provided and has all the necessary attributes.
|
|
34
|
+
oDesignTime = oDesignTime ? oDesignTime : getDefaultDesginTime();
|
|
35
|
+
oDesignTime.actions = oDesignTime.actions ? oDesignTime.actions : {};
|
|
36
|
+
oDesignTime.properties = oDesignTime.properties ? oDesignTime.properties : {};
|
|
37
|
+
oDesignTime.aggregations = oDesignTime.aggregations ? oDesignTime.aggregations : {};
|
|
38
|
+
|
|
39
|
+
var oControlMetadata = ControlClass.getMetadata(),
|
|
40
|
+
// array containing all allowed control properties. Update the aAllowedProperties to enable a property for DTA
|
|
41
|
+
aAllowedProperties = aAllowedProperties ? aAllowedProperties : [],
|
|
42
|
+
// array containing all allowed control aggregations. Update the aAllowedAggregations to enable an aggregation for DTA
|
|
43
|
+
aAllowedAggregations = aAllowedAggregations ? aAllowedAggregations : [],
|
|
44
|
+
// array containing all control properties
|
|
45
|
+
aAllProperties = Object.keys(oControlMetadata.getAllProperties()).concat(Object.keys(oControlMetadata.getAllPrivateProperties())),
|
|
46
|
+
// array containing all control aggregations
|
|
47
|
+
aAllAggregations = Object.keys(oControlMetadata.getAllAggregations()).concat(Object.keys(oControlMetadata.getAllPrivateAggregations()));
|
|
48
|
+
|
|
49
|
+
// populate the oDesignTime.properties with the control properties (allowed/disallowed). By default all properties are ignored.
|
|
50
|
+
aAllProperties.forEach(function(sPropertyName) {
|
|
51
|
+
enhanceDesignTimeMetadata(aAllowedProperties, sPropertyName, oDesignTime.properties);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// populate the oDesignTime.aggregations with the control aggregations (allowed/disallowed). By default all aggregations are ignored.
|
|
55
|
+
aAllAggregations.forEach(function(sAggregationName) {
|
|
56
|
+
enhanceDesignTimeMetadata(aAllowedAggregations, sAggregationName, oDesignTime.aggregations);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
return oDesignTime;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
});
|