@openui5/sap.ui.integration 1.95.0 → 1.96.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.reuse/dep5 +10 -5
- package/THIRDPARTY.txt +17 -8
- package/package.json +3 -3
- package/src/sap/ui/integration/.library +6 -1
- package/src/sap/ui/integration/ActionDefinition.js +1 -1
- package/src/sap/ui/integration/Designtime.js +1 -1
- package/src/sap/ui/integration/Extension.js +1 -1
- package/src/sap/ui/integration/Host.js +30 -2
- package/src/sap/ui/integration/cards/AdaptiveContent.js +1 -1
- package/src/sap/ui/integration/cards/AnalyticalContent.js +1 -1
- package/src/sap/ui/integration/cards/AnalyticsCloudContent.js +1 -1
- package/src/sap/ui/integration/cards/BaseContent.js +1 -1
- package/src/sap/ui/integration/cards/BaseListContent.js +23 -3
- package/src/sap/ui/integration/cards/CalendarContent.js +1 -1
- package/src/sap/ui/integration/cards/CalendarContentRenderer.js +8 -3
- package/src/sap/ui/integration/cards/ComponentContent.js +1 -1
- package/src/sap/ui/integration/cards/Footer.js +1 -1
- package/src/sap/ui/integration/cards/Header.js +1 -1
- package/src/sap/ui/integration/cards/ListContent.js +37 -13
- package/src/sap/ui/integration/cards/ListContentRenderer.js +38 -7
- package/src/sap/ui/integration/cards/NumericHeader.js +3 -2
- package/src/sap/ui/integration/cards/ObjectContent.js +1 -1
- package/src/sap/ui/integration/cards/TableContent.js +9 -2
- package/src/sap/ui/integration/cards/TimelineContent.js +1 -1
- package/src/sap/ui/integration/cards/WebPageContent.js +1 -1
- package/src/sap/ui/integration/cards/adaptivecards/elements/UI5InputChoiceSet.js +1 -1
- package/src/sap/ui/integration/cards/adaptivecards/elements/UI5InputDate.js +1 -1
- package/src/sap/ui/integration/cards/adaptivecards/elements/UI5InputNumber.js +1 -1
- package/src/sap/ui/integration/cards/adaptivecards/elements/UI5InputText.js +1 -1
- package/src/sap/ui/integration/cards/adaptivecards/elements/UI5InputToggle.js +1 -1
- package/src/sap/ui/integration/cards/{Filter.js → filters/BaseFilter.js} +56 -134
- package/src/sap/ui/integration/cards/filters/DateRangeFilter.js +232 -0
- package/src/sap/ui/integration/{util → cards/filters}/FilterBarFactory.js +37 -12
- package/src/sap/ui/integration/cards/filters/SelectFilter.js +157 -0
- package/src/sap/ui/integration/controls/ActionsStrip.js +1 -1
- package/src/sap/ui/integration/controls/ActionsToolbar.js +1 -1
- package/src/sap/ui/integration/controls/ListContentItem.js +13 -2
- package/src/sap/ui/integration/controls/ListContentItemRenderer.js +65 -2
- package/src/sap/ui/integration/controls/Microchart.js +1 -1
- package/src/sap/ui/integration/controls/MicrochartLegend.js +1 -1
- package/src/sap/ui/integration/designtime/baseEditor/BaseEditor.js +26 -1
- package/src/sap/ui/integration/designtime/baseEditor/PropertyEditor.js +44 -2
- package/src/sap/ui/integration/designtime/baseEditor/PropertyEditors.js +27 -1
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n.properties +34 -25
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_ar.properties +18 -14
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_bg.properties +18 -14
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_ca.properties +18 -14
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_cs.properties +18 -14
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_cy.properties +18 -14
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_da.properties +17 -13
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_de.properties +17 -13
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_el.properties +18 -14
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_en.properties +15 -11
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_en_GB.properties +15 -11
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_en_US_sappsd.properties +4 -2
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_en_US_saprigi.properties +19 -13
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_es.properties +18 -14
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_es_MX.properties +18 -14
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_et.properties +18 -14
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_fi.properties +18 -14
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_fr.properties +18 -14
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_fr_CA.properties +18 -14
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_hi.properties +18 -14
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_hr.properties +18 -14
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_hu.properties +18 -14
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_id.properties +17 -13
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_it.properties +18 -14
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_iw.properties +18 -14
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_ja.properties +18 -14
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_kk.properties +18 -14
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_ko.properties +18 -14
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_lt.properties +18 -14
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_lv.properties +18 -14
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_ms.properties +17 -13
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_nl.properties +17 -13
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_no.properties +17 -13
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_pl.properties +18 -14
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_pt.properties +18 -14
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_pt_PT.properties +18 -14
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_ro.properties +18 -14
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_ru.properties +18 -14
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_sh.properties +18 -14
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_sk.properties +17 -13
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_sl.properties +17 -13
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_sv.properties +17 -13
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_th.properties +18 -14
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_tr.properties +18 -14
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_uk.properties +18 -14
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_vi.properties +18 -14
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_zh_CN.properties +18 -14
- package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_zh_TW.properties +18 -14
- package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/BasePropertyEditor.js +48 -3
- package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/PropertyEditorFactory.js +2 -2
- package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/arrayEditor/ArrayEditor.js +4 -1
- package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/booleanEditor/BooleanEditor.js +4 -1
- package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/dateEditor/DateEditor.fragment.xml +1 -1
- package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/dateEditor/DateEditor.js +65 -17
- package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/dateTimeEditor/DateTimeEditor.fragment.xml +1 -1
- package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/dateTimeEditor/DateTimeEditor.js +17 -4
- package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/enumStringEditor/EnumStringEditor.js +1 -1
- package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/groupEditor/GroupEditor.js +4 -1
- package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/iconEditor/IconEditor.js +10 -2
- package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/iconEditor/IsInIconPool.validator.js +1 -1
- package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/integerEditor/IntegerEditor.js +10 -2
- package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/jsonEditor/JsonEditor.js +11 -2
- package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/listEditor/ListEditor.js +1 -1
- package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/mapEditor/MapEditor.fragment.xml +8 -2
- package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/mapEditor/MapEditor.js +62 -35
- package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/numberEditor/NumberEditor.js +10 -2
- package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/selectEditor/SelectEditor.js +1 -1
- package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/separatorEditor/SeparatorEditor.js +4 -1
- package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/stringEditor/StringEditor.js +4 -1
- package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/textAreaEditor/TextAreaEditor.js +1 -1
- package/src/sap/ui/integration/designtime/baseEditor/util/binding/ObjectBinding.js +1 -1
- package/src/sap/ui/integration/designtime/baseEditor/util/unset.js +1 -1
- package/src/sap/ui/integration/designtime/baseEditor/validator/IsBoolean.js +1 -1
- package/src/sap/ui/integration/designtime/baseEditor/validator/IsDate.js +5 -4
- package/src/sap/ui/integration/designtime/baseEditor/validator/IsInteger.js +1 -5
- package/src/sap/ui/integration/designtime/baseEditor/validator/IsNumber.js +1 -1
- package/src/sap/ui/integration/designtime/baseEditor/validator/IsSelectedKey.js +1 -1
- package/src/sap/ui/integration/designtime/baseEditor/validator/IsStringList.js +1 -1
- package/src/sap/ui/integration/designtime/baseEditor/validator/IsUniqueKey.js +1 -1
- package/src/sap/ui/integration/designtime/baseEditor/validator/IsUniqueList.js +1 -1
- package/src/sap/ui/integration/designtime/baseEditor/validator/IsValidBinding.js +1 -1
- package/src/sap/ui/integration/designtime/baseEditor/validator/MaxLength.js +1 -1
- package/src/sap/ui/integration/designtime/baseEditor/validator/NotABinding.js +1 -1
- package/src/sap/ui/integration/designtime/baseEditor/validator/ValidatorRegistry.js +1 -1
- package/src/sap/ui/integration/designtime/cardEditor/BASEditor.js +7 -1
- package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_en_US_saprigi.properties +4 -0
- package/src/sap/ui/integration/designtime/cardEditor/propertyEditor/complexMapEditor/ComplexMapEditor.js +1 -1
- package/src/sap/ui/integration/designtime/cardEditor/propertyEditor/destinationsEditor/DestinationsEditor.js +1 -1
- package/src/sap/ui/integration/designtime/cardEditor/propertyEditor/iconEditor/IconEditor.js +11 -1
- package/src/sap/ui/integration/designtime/cardEditor/propertyEditor/parametersEditor/ParametersEditor.js +1 -1
- package/src/sap/ui/integration/designtime/editor/CardEditor.js +1 -1
- package/src/sap/ui/integration/designtime/editor/CardPreview.js +2 -2
- package/src/sap/ui/integration/editor/Editor.js +33 -34
- package/src/sap/ui/integration/editor/EditorResourceBundles.js +3 -3
- package/src/sap/ui/integration/editor/Extension.js +1 -1
- package/src/sap/ui/integration/editor/Manifest.js +2 -2
- package/src/sap/ui/integration/editor/Merger.js +5 -3
- package/src/sap/ui/integration/editor/Settings.js +1 -1
- package/src/sap/ui/integration/editor/css/Editor.css +0 -3
- package/src/sap/ui/integration/editor/fields/BaseField.js +1 -1
- package/src/sap/ui/integration/editor/fields/BooleanField.js +1 -1
- package/src/sap/ui/integration/editor/fields/DateField.js +1 -1
- package/src/sap/ui/integration/editor/fields/DateTimeField.js +1 -1
- package/src/sap/ui/integration/editor/fields/DestinationField.js +1 -20
- package/src/sap/ui/integration/editor/fields/IntegerField.js +1 -1
- package/src/sap/ui/integration/editor/fields/ListField.js +45 -47
- package/src/sap/ui/integration/editor/fields/NumberField.js +1 -1
- package/src/sap/ui/integration/editor/fields/StringField.js +2 -23
- package/src/sap/ui/integration/editor/fields/viz/ColorSelect.js +1 -1
- package/src/sap/ui/integration/editor/fields/viz/IconSelect.js +1 -1
- package/src/sap/ui/integration/editor/fields/viz/ShapeSelect.js +1 -1
- package/src/sap/ui/integration/editor/languages.json +32 -32
- package/src/sap/ui/integration/library.js +22 -2
- package/src/sap/ui/integration/messagebundle_en_US_saprigi.properties +81 -55
- package/src/sap/ui/integration/model/ContextModel.js +1 -1
- package/src/sap/ui/integration/model/ObservableModel.js +1 -1
- package/src/sap/ui/integration/schemas/sap-card.json +222 -28
- package/src/sap/ui/integration/themes/base/CalendarContent.less +4 -2
- package/src/sap/ui/integration/themes/base/ListContentItem.less +101 -68
- package/src/sap/ui/integration/themes/base/Microchart.less +0 -1
- package/src/sap/ui/integration/util/BaseFactory.js +1 -1
- package/src/sap/ui/integration/util/BindingHelper.js +1 -1
- package/src/sap/ui/integration/util/BindingResolver.js +1 -1
- package/src/sap/ui/integration/util/CacheAndRequestDataProvider.js +35 -13
- package/src/sap/ui/integration/util/CardActions.js +1 -1
- package/src/sap/ui/integration/util/CardMerger.js +5 -3
- package/src/sap/ui/integration/util/CardObserver.js +1 -1
- package/src/sap/ui/integration/util/ContentFactory.js +1 -1
- package/src/sap/ui/integration/util/DataProvider.js +4 -4
- package/src/sap/ui/integration/util/DataProviderFactory.js +14 -8
- package/src/sap/ui/integration/util/Destinations.js +1 -1
- package/src/sap/ui/integration/util/ExtensionDataProvider.js +1 -1
- package/src/sap/ui/integration/util/HeaderFactory.js +8 -7
- package/src/sap/ui/integration/util/JSONBindingHelper.js +3 -3
- package/src/sap/ui/integration/util/LoadingProvider.js +1 -1
- package/src/sap/ui/integration/util/Manifest.js +3 -2
- package/src/sap/ui/integration/util/RequestDataProvider.js +3 -3
- package/src/sap/ui/integration/util/ServiceDataProvider.js +1 -1
- package/src/sap/ui/integration/util/ServiceManager.js +1 -1
- package/src/sap/ui/integration/util/Utils.js +1 -1
- package/src/sap/ui/integration/widgets/Card.js +125 -70
- package/ui5.yaml +4 -1
|
@@ -10,9 +10,6 @@ sap.ui.define([
|
|
|
10
10
|
"sap/ui/core/Icon",
|
|
11
11
|
"sap/m/HBox",
|
|
12
12
|
"sap/m/Text",
|
|
13
|
-
"sap/m/Select",
|
|
14
|
-
"sap/ui/core/ListItem",
|
|
15
|
-
"sap/ui/model/json/JSONModel",
|
|
16
13
|
"sap/ui/integration/model/ObservableModel",
|
|
17
14
|
"sap/ui/integration/util/LoadingProvider"
|
|
18
15
|
], function (
|
|
@@ -22,16 +19,13 @@ sap.ui.define([
|
|
|
22
19
|
Icon,
|
|
23
20
|
HBox,
|
|
24
21
|
Text,
|
|
25
|
-
Select,
|
|
26
|
-
ListItem,
|
|
27
|
-
JSONModel,
|
|
28
22
|
ObservableModel,
|
|
29
23
|
LoadingProvider
|
|
30
24
|
) {
|
|
31
25
|
"use strict";
|
|
32
26
|
|
|
33
27
|
/**
|
|
34
|
-
* Constructor for a new <code>
|
|
28
|
+
* Constructor for a new <code>BaseFilter</code>.
|
|
35
29
|
*
|
|
36
30
|
* @param {string} [sId] ID for the new control, generated automatically if no ID is given
|
|
37
31
|
* @param {object} [mSettings] Initial settings for the new control
|
|
@@ -41,16 +35,17 @@ sap.ui.define([
|
|
|
41
35
|
* @extends sap.ui.core.Control
|
|
42
36
|
*
|
|
43
37
|
* @author SAP SE
|
|
44
|
-
* @version 1.
|
|
38
|
+
* @version 1.96.3
|
|
45
39
|
*
|
|
46
40
|
* @constructor
|
|
47
41
|
* @private
|
|
48
|
-
* @since 1.
|
|
49
|
-
* @alias sap.ui.integration.cards.
|
|
42
|
+
* @since 1.96
|
|
43
|
+
* @alias sap.ui.integration.cards.filters.BaseFilter
|
|
50
44
|
*/
|
|
51
|
-
var
|
|
45
|
+
var BaseFilter = Control.extend("sap.ui.integration.cards.filters.BaseFilter", {
|
|
52
46
|
metadata: {
|
|
53
|
-
|
|
47
|
+
"abstract" : true,
|
|
48
|
+
library: "sap.ui.integration",
|
|
54
49
|
properties: {
|
|
55
50
|
/**
|
|
56
51
|
* Filter's key as it's defined in the manifest.
|
|
@@ -63,23 +58,16 @@ sap.ui.define([
|
|
|
63
58
|
config: { type: "object", defaultValue: "null" },
|
|
64
59
|
|
|
65
60
|
/**
|
|
66
|
-
* The
|
|
61
|
+
* The value of the filter that can be used in the manifest.
|
|
67
62
|
*/
|
|
68
|
-
value: { type: "
|
|
63
|
+
value: { type: "object", defaultValue: null }
|
|
69
64
|
},
|
|
70
|
-
|
|
71
65
|
aggregations: {
|
|
72
|
-
/**
|
|
73
|
-
* The internally used sap.m.Select control instance.
|
|
74
|
-
*/
|
|
75
|
-
_select: { type: "sap.m.Select", multiple: false, visibility: "hidden" },
|
|
76
|
-
|
|
77
66
|
/**
|
|
78
67
|
* The internally used LoadingProvider.
|
|
79
68
|
*/
|
|
80
69
|
_loadingProvider: { type: "sap.ui.core.Element", multiple: false, visibility: "hidden" }
|
|
81
70
|
},
|
|
82
|
-
|
|
83
71
|
associations: {
|
|
84
72
|
|
|
85
73
|
/**
|
|
@@ -89,7 +77,6 @@ sap.ui.define([
|
|
|
89
77
|
}
|
|
90
78
|
|
|
91
79
|
},
|
|
92
|
-
|
|
93
80
|
renderer: {
|
|
94
81
|
apiVersion: 2,
|
|
95
82
|
render: function (oRM, oFilter) {
|
|
@@ -106,7 +93,7 @@ sap.ui.define([
|
|
|
106
93
|
if (oFilter._hasError()) {
|
|
107
94
|
oRM.renderControl(oFilter._getErrorMessage());
|
|
108
95
|
} else {
|
|
109
|
-
oRM.renderControl(oFilter.
|
|
96
|
+
oRM.renderControl(oFilter.getField());
|
|
110
97
|
}
|
|
111
98
|
|
|
112
99
|
oRM.close("div");
|
|
@@ -114,7 +101,7 @@ sap.ui.define([
|
|
|
114
101
|
}
|
|
115
102
|
});
|
|
116
103
|
|
|
117
|
-
|
|
104
|
+
BaseFilter.prototype.init = function () {
|
|
118
105
|
this.setAggregation("_loadingProvider", new LoadingProvider());
|
|
119
106
|
|
|
120
107
|
this.attachEventOnce("_dataReady", function () {
|
|
@@ -122,34 +109,64 @@ sap.ui.define([
|
|
|
122
109
|
});
|
|
123
110
|
};
|
|
124
111
|
|
|
125
|
-
|
|
112
|
+
BaseFilter.prototype.exit = function () {
|
|
126
113
|
if (this._oDataProvider) {
|
|
127
114
|
this._oDataProvider.destroy();
|
|
128
115
|
this._oDataProvider = null;
|
|
129
116
|
}
|
|
130
117
|
};
|
|
131
118
|
|
|
132
|
-
|
|
119
|
+
BaseFilter.prototype.isLoading = function () {
|
|
133
120
|
var oLoadingProvider = this.getAggregation("_loadingProvider");
|
|
134
121
|
|
|
135
122
|
return !oLoadingProvider.isDataProviderJson() && oLoadingProvider.getLoading();
|
|
136
123
|
};
|
|
137
124
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
125
|
+
BaseFilter.prototype.getField = function () {
|
|
126
|
+
return null;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* @private
|
|
131
|
+
* @ui5-restricted
|
|
132
|
+
*/
|
|
133
|
+
BaseFilter.prototype.showLoadingPlaceholders = function () {
|
|
134
|
+
this.getAggregation("_loadingProvider").setLoading(true);
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* @private
|
|
139
|
+
* @ui5-restricted
|
|
140
|
+
*/
|
|
141
|
+
BaseFilter.prototype.hideLoadingPlaceholders = function () {
|
|
142
|
+
this.getAggregation("_loadingProvider").setLoading(false);
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
BaseFilter.prototype.onDataChanged = function () { };
|
|
146
|
+
|
|
147
|
+
BaseFilter.prototype.getValueForModel = function () { };
|
|
148
|
+
|
|
149
|
+
BaseFilter.prototype.refreshData = function () {
|
|
150
|
+
if (this._oDataProvider) {
|
|
151
|
+
this._oDataProvider.triggerDataUpdate();
|
|
143
152
|
}
|
|
153
|
+
};
|
|
144
154
|
|
|
145
|
-
|
|
155
|
+
/**
|
|
156
|
+
* Gets the card instance of which this element is part of.
|
|
157
|
+
* @ui5-restricted
|
|
158
|
+
* @private
|
|
159
|
+
* @returns {sap.ui.integration.widgets.Card} The card instance.
|
|
160
|
+
*/
|
|
161
|
+
BaseFilter.prototype.getCardInstance = function () {
|
|
162
|
+
return Core.byId(this.getCard());
|
|
146
163
|
};
|
|
147
164
|
|
|
148
|
-
|
|
165
|
+
BaseFilter.prototype._hasError = function () {
|
|
149
166
|
return !!this._bError;
|
|
150
167
|
};
|
|
151
168
|
|
|
152
|
-
|
|
169
|
+
BaseFilter.prototype._getErrorMessage = function () {
|
|
153
170
|
var sMessage = "Unable to load the filter.";
|
|
154
171
|
|
|
155
172
|
return new HBox({
|
|
@@ -162,47 +179,24 @@ sap.ui.define([
|
|
|
162
179
|
});
|
|
163
180
|
};
|
|
164
181
|
|
|
165
|
-
|
|
182
|
+
BaseFilter.prototype._handleError = function (sLogMessage) {
|
|
166
183
|
Log.error(sLogMessage);
|
|
167
184
|
|
|
168
185
|
this._bError = true;
|
|
169
186
|
this.invalidate();
|
|
170
187
|
};
|
|
171
188
|
|
|
172
|
-
|
|
189
|
+
BaseFilter.prototype._onDataRequestComplete = function () {
|
|
173
190
|
this.fireEvent("_dataReady");
|
|
174
191
|
this.hideLoadingPlaceholders();
|
|
175
192
|
};
|
|
176
193
|
|
|
177
|
-
/**
|
|
178
|
-
* @private
|
|
179
|
-
* @ui5-restricted
|
|
180
|
-
*/
|
|
181
|
-
Filter.prototype.showLoadingPlaceholders = function () {
|
|
182
|
-
this.getAggregation("_loadingProvider").setLoading(true);
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* @private
|
|
187
|
-
* @ui5-restricted
|
|
188
|
-
*/
|
|
189
|
-
Filter.prototype.hideLoadingPlaceholders = function () {
|
|
190
|
-
this.getAggregation("_loadingProvider").setLoading(false);
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
Filter.prototype._onDataChanged = function () {
|
|
194
|
-
var oSelect = this._getSelect();
|
|
195
|
-
|
|
196
|
-
oSelect.setSelectedKey(this.getValue());
|
|
197
|
-
this._updateSelected(oSelect.getSelectedItem());
|
|
198
|
-
};
|
|
199
|
-
|
|
200
194
|
/**
|
|
201
195
|
* Uses the Card's own DataProvider and the provided oDataConfig object to populate the Filter's data.
|
|
202
196
|
* @private
|
|
203
197
|
* @param {object} oDataConfig Data configuration
|
|
204
198
|
*/
|
|
205
|
-
|
|
199
|
+
BaseFilter.prototype._setDataConfiguration = function (oDataConfig) {
|
|
206
200
|
var oCard = this.getCardInstance(),
|
|
207
201
|
oModel;
|
|
208
202
|
|
|
@@ -227,7 +221,7 @@ sap.ui.define([
|
|
|
227
221
|
}
|
|
228
222
|
|
|
229
223
|
oModel.attachEvent("change", function () {
|
|
230
|
-
this.
|
|
224
|
+
this.onDataChanged();
|
|
231
225
|
}.bind(this));
|
|
232
226
|
|
|
233
227
|
this._oDataProvider.attachDataRequested(function () {
|
|
@@ -247,77 +241,5 @@ sap.ui.define([
|
|
|
247
241
|
this._oDataProvider.triggerDataUpdate();
|
|
248
242
|
};
|
|
249
243
|
|
|
250
|
-
|
|
251
|
-
var oFiltersModel = this.getModel("filters"),
|
|
252
|
-
sFilterKey = this.getKey();
|
|
253
|
-
|
|
254
|
-
oFiltersModel.setProperty("/" + sFilterKey, {
|
|
255
|
-
"value": oSelectedItem.getKey(),
|
|
256
|
-
"selectedItem": {
|
|
257
|
-
"title": oSelectedItem.getText(),
|
|
258
|
-
"key": oSelectedItem.getKey()
|
|
259
|
-
}
|
|
260
|
-
});
|
|
261
|
-
};
|
|
262
|
-
|
|
263
|
-
/**
|
|
264
|
-
* Constructs a Select control configured with the Filter's properties.
|
|
265
|
-
*
|
|
266
|
-
* @private
|
|
267
|
-
* @returns {sap.m.Select} configured instance
|
|
268
|
-
*/
|
|
269
|
-
Filter.prototype._createSelect = function () {
|
|
270
|
-
var oSelect = new Select(),
|
|
271
|
-
sItemTemplateKey,
|
|
272
|
-
sItemTemplateTitle,
|
|
273
|
-
sItemsPath = "/",
|
|
274
|
-
oConfig = this.getConfig();
|
|
275
|
-
|
|
276
|
-
oSelect.attachChange(function (oEvent) {
|
|
277
|
-
var sValue = oEvent.getParameter("selectedItem").getKey();
|
|
278
|
-
this.setValue(sValue);
|
|
279
|
-
this._updateSelected(oEvent.getParameter("selectedItem"));
|
|
280
|
-
}.bind(this));
|
|
281
|
-
|
|
282
|
-
if (oConfig && oConfig.item) {
|
|
283
|
-
sItemsPath = oConfig.item.path || sItemsPath;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
if (oConfig && oConfig.item && oConfig.item.template) {
|
|
287
|
-
sItemTemplateKey = oConfig.item.template.key;
|
|
288
|
-
sItemTemplateTitle = oConfig.item.template.title;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
if (oConfig && oConfig.items) {
|
|
292
|
-
sItemTemplateKey = "{key}";
|
|
293
|
-
sItemTemplateTitle = "{title}";
|
|
294
|
-
this.setModel(new JSONModel(oConfig.items));
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
oSelect.bindItems({
|
|
298
|
-
path: sItemsPath,
|
|
299
|
-
template: new ListItem({ key: sItemTemplateKey, text: sItemTemplateTitle })
|
|
300
|
-
});
|
|
301
|
-
oSelect.setSelectedKey(this.getValue());
|
|
302
|
-
|
|
303
|
-
return oSelect;
|
|
304
|
-
};
|
|
305
|
-
|
|
306
|
-
Filter.prototype.refreshData = function () {
|
|
307
|
-
if (this._oDataProvider) {
|
|
308
|
-
this._oDataProvider.triggerDataUpdate();
|
|
309
|
-
}
|
|
310
|
-
};
|
|
311
|
-
|
|
312
|
-
/**
|
|
313
|
-
* Gets the card instance of which this element is part of.
|
|
314
|
-
* @ui5-restricted
|
|
315
|
-
* @private
|
|
316
|
-
* @returns {sap.ui.integration.widgets.Card} The card instance.
|
|
317
|
-
*/
|
|
318
|
-
Filter.prototype.getCardInstance = function () {
|
|
319
|
-
return Core.byId(this.getCard());
|
|
320
|
-
};
|
|
321
|
-
|
|
322
|
-
return Filter;
|
|
244
|
+
return BaseFilter;
|
|
323
245
|
});
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
|
+
* (c) Copyright 2009-2021 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
|
+
"./BaseFilter",
|
|
8
|
+
"sap/ui/core/library",
|
|
9
|
+
"sap/m/DynamicDateRange",
|
|
10
|
+
"sap/m/DynamicDateUtil"
|
|
11
|
+
], function (
|
|
12
|
+
BaseFilter,
|
|
13
|
+
coreLibrary,
|
|
14
|
+
DynamicDateRange,
|
|
15
|
+
DynamicDateUtil
|
|
16
|
+
) {
|
|
17
|
+
"use strict";
|
|
18
|
+
|
|
19
|
+
var ValueState = coreLibrary.ValueState;
|
|
20
|
+
var MIN_DATE = new Date(-8640000000000000);
|
|
21
|
+
var MIN_ODATA_DATE = new Date("1753-01-01");
|
|
22
|
+
var MAX_DATE = new Date(8640000000000000);
|
|
23
|
+
var MAX_ODATA_DATE = new Date("9999-12-31");
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @param {string} sOperator sap.m.StandardDynamicDateRangeKeys operator in upper case
|
|
27
|
+
* @returns {string} Operator in camel case
|
|
28
|
+
*/
|
|
29
|
+
function operatorToCamelCase(sOperator) {
|
|
30
|
+
var mOperators = {
|
|
31
|
+
"DATE": "date",
|
|
32
|
+
"TODAY": "today",
|
|
33
|
+
"YESTERDAY": "yesterday",
|
|
34
|
+
"TOMORROW": "tomorrow",
|
|
35
|
+
|
|
36
|
+
"DATERANGE": "dateRange",
|
|
37
|
+
"FROM": "from",
|
|
38
|
+
"TO": "to",
|
|
39
|
+
"YEARTODATE": "yearToDate",
|
|
40
|
+
"LASTDAYS": "lastDays",
|
|
41
|
+
"LASTWEEKS": "lastWeeks",
|
|
42
|
+
"LASTMONTHS": "lastMonths",
|
|
43
|
+
"LASTQUARTERS": "lastQuarters",
|
|
44
|
+
"LASTYEARS": "lastYears",
|
|
45
|
+
"NEXTDAYS": "nextDays",
|
|
46
|
+
"NEXTWEEKS": "nextWeeks",
|
|
47
|
+
"NEXTMONTHS": "nextMonths",
|
|
48
|
+
"NEXTQUARTERS": "nextQuarters",
|
|
49
|
+
"NEXTYEARS": "nextYears",
|
|
50
|
+
"TODAYFROMTO": "todayFromTo",
|
|
51
|
+
|
|
52
|
+
"THISWEEK": "thisWeek",
|
|
53
|
+
"LASTWEEK": "lastWeek",
|
|
54
|
+
"NEXTWEEK": "nextWeek",
|
|
55
|
+
|
|
56
|
+
"SPECIFICMONTH": "specificMonth",
|
|
57
|
+
"THISMONTH": "thisMonth",
|
|
58
|
+
"LASTMONTH": "lastMonth",
|
|
59
|
+
"NEXTMONTH": "nextMonth",
|
|
60
|
+
|
|
61
|
+
"THISQUARTER": "thisQuarter",
|
|
62
|
+
"LASTQUARTER": "lastQuarter",
|
|
63
|
+
"NEXTQUARTER": "nextQuarter",
|
|
64
|
+
"QUARTER1": "quarter1",
|
|
65
|
+
"QUARTER2": "quarter2",
|
|
66
|
+
"QUARTER3": "quarter3",
|
|
67
|
+
"QUARTER4": "quarter4",
|
|
68
|
+
|
|
69
|
+
"THISYEAR": "thisYear",
|
|
70
|
+
"LASTYEAR": "lastYear",
|
|
71
|
+
"NEXTYEAR": "nextYear"
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
return mOperators[sOperator];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Constructor for a new <code>DateRangeFilter</code>.
|
|
79
|
+
*
|
|
80
|
+
* @param {string} [sId] ID for the new control, generated automatically if no ID is given
|
|
81
|
+
* @param {object} [mSettings] Initial settings for the new control
|
|
82
|
+
*
|
|
83
|
+
* @class
|
|
84
|
+
*
|
|
85
|
+
* @extends sap.ui.integration.cards.filters.BaseFilter
|
|
86
|
+
*
|
|
87
|
+
* @author SAP SE
|
|
88
|
+
* @version 1.96.3
|
|
89
|
+
*
|
|
90
|
+
* @constructor
|
|
91
|
+
* @private
|
|
92
|
+
* @since 1.96
|
|
93
|
+
* @alias sap.ui.integration.cards.filters.DateRangeFilter
|
|
94
|
+
*/
|
|
95
|
+
var DateRangeFilter = BaseFilter.extend("sap.ui.integration.cards.filters.DateRangeFilter", {
|
|
96
|
+
metadata: {
|
|
97
|
+
library: "sap.ui.integration",
|
|
98
|
+
aggregations: {
|
|
99
|
+
/**
|
|
100
|
+
* The internally used sap.m.DynamicDateRange control instance.
|
|
101
|
+
*/
|
|
102
|
+
_ddr: { type: "sap.m.DynamicDateRange", multiple: false, visibility: "hidden" }
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
renderer: {
|
|
106
|
+
apiVersion: 2
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* @override
|
|
112
|
+
*/
|
|
113
|
+
DateRangeFilter.prototype.getField = function () {
|
|
114
|
+
return this._getDdr();
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* @override
|
|
119
|
+
*/
|
|
120
|
+
DateRangeFilter.prototype.getValueForModel = function () {
|
|
121
|
+
var oDateRangeValue = this._getDdr().getValue();
|
|
122
|
+
var oValue;
|
|
123
|
+
var oRange;
|
|
124
|
+
var oRangeOData;
|
|
125
|
+
|
|
126
|
+
if (oDateRangeValue) {
|
|
127
|
+
oValue = Object.assign({}, oDateRangeValue);
|
|
128
|
+
var aDates = DynamicDateUtil.toDates(oValue),
|
|
129
|
+
dStart = aDates[0].getJSDate ? aDates[0].getJSDate() : aDates[0],
|
|
130
|
+
dEnd = aDates[1].getJSDate ? aDates[1].getJSDate() : aDates[1];
|
|
131
|
+
|
|
132
|
+
oRange = {
|
|
133
|
+
start: dStart.toISOString(),
|
|
134
|
+
end: dEnd.toISOString()
|
|
135
|
+
};
|
|
136
|
+
oRangeOData = {
|
|
137
|
+
start: dStart.toISOString(),
|
|
138
|
+
end: dEnd.toISOString()
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
if (oValue.operator === "TO") {
|
|
142
|
+
oRange.start = MIN_DATE.toISOString();
|
|
143
|
+
oRangeOData.start = MIN_ODATA_DATE.toISOString();
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if (oValue.operator === "FROM") {
|
|
147
|
+
oRange.end = MAX_DATE.toISOString();
|
|
148
|
+
oRangeOData.end = MAX_ODATA_DATE.toISOString();
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
oValue.operator = operatorToCamelCase(oValue.operator);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return {
|
|
155
|
+
value: oValue,
|
|
156
|
+
range: oRange,
|
|
157
|
+
rangeOData: oRangeOData
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
DateRangeFilter.prototype._getDdr = function () {
|
|
162
|
+
var oControl = this.getAggregation("_ddr");
|
|
163
|
+
if (!oControl) {
|
|
164
|
+
oControl = this._createDdr();
|
|
165
|
+
this.setAggregation("_ddr", oControl);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return oControl;
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Constructs a DynamicDateRange control configured with the Filter's properties.
|
|
173
|
+
*
|
|
174
|
+
* @private
|
|
175
|
+
* @returns {sap.m.DynamicDateRange} configured instance
|
|
176
|
+
*/
|
|
177
|
+
DateRangeFilter.prototype._createDdr = function () {
|
|
178
|
+
var oConfig = Object.assign({}, this.getConfig());
|
|
179
|
+
var oValue;
|
|
180
|
+
|
|
181
|
+
if (oConfig.value) {
|
|
182
|
+
var sOption = oConfig.value.operator.toUpperCase();
|
|
183
|
+
var aTypes = DynamicDateUtil.getOption(sOption).getValueTypes();
|
|
184
|
+
oValue = {
|
|
185
|
+
operator: sOption,
|
|
186
|
+
values: oConfig.value.values.map(function (vValue, i) {
|
|
187
|
+
if (aTypes[i] === "date") {
|
|
188
|
+
return new Date(vValue);
|
|
189
|
+
}
|
|
190
|
+
return vValue;
|
|
191
|
+
})
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
oConfig.options = oConfig.options || this._getDefaultOptions();
|
|
196
|
+
oConfig.options = oConfig.options.map(function (sOption) {
|
|
197
|
+
return sOption.toUpperCase();
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
var oDdr = new DynamicDateRange({
|
|
201
|
+
value: oValue,
|
|
202
|
+
options: oConfig.options
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
oDdr.attachChange(function (oEvent) {
|
|
206
|
+
if (oEvent.getParameter("valid")) {
|
|
207
|
+
oDdr.setValueState(ValueState.None);
|
|
208
|
+
this.setValue(this.getValueForModel());
|
|
209
|
+
} else {
|
|
210
|
+
oDdr.setValueState(ValueState.Error);
|
|
211
|
+
}
|
|
212
|
+
}.bind(this));
|
|
213
|
+
|
|
214
|
+
return oDdr;
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
DateRangeFilter.prototype._getDefaultOptions = function () {
|
|
218
|
+
return [
|
|
219
|
+
"date",
|
|
220
|
+
"today",
|
|
221
|
+
"dateRange",
|
|
222
|
+
"from",
|
|
223
|
+
"to",
|
|
224
|
+
"lastDays",
|
|
225
|
+
"nextDays",
|
|
226
|
+
"lastWeeks",
|
|
227
|
+
"nextWeeks"
|
|
228
|
+
];
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
return DateRangeFilter;
|
|
232
|
+
});
|
|
@@ -4,15 +4,17 @@
|
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
7
|
+
"./SelectFilter",
|
|
8
|
+
"./DateRangeFilter",
|
|
7
9
|
"sap/ui/base/Object",
|
|
8
10
|
"sap/m/library",
|
|
9
|
-
"sap/m/HBox"
|
|
10
|
-
"sap/ui/integration/cards/Filter"
|
|
11
|
+
"sap/m/HBox"
|
|
11
12
|
], function (
|
|
13
|
+
SelectFilter,
|
|
14
|
+
DateRangeFilter,
|
|
12
15
|
BaseObject,
|
|
13
16
|
mLibrary,
|
|
14
|
-
HBox
|
|
15
|
-
Filter
|
|
17
|
+
HBox
|
|
16
18
|
) {
|
|
17
19
|
"use strict";
|
|
18
20
|
|
|
@@ -28,7 +30,7 @@ sap.ui.define([
|
|
|
28
30
|
* @extends sap.ui.base.Object
|
|
29
31
|
*
|
|
30
32
|
* @author SAP SE
|
|
31
|
-
* @version 1.
|
|
33
|
+
* @version 1.96.3
|
|
32
34
|
*
|
|
33
35
|
* @constructor
|
|
34
36
|
* @private
|
|
@@ -47,30 +49,38 @@ sap.ui.define([
|
|
|
47
49
|
});
|
|
48
50
|
|
|
49
51
|
/**
|
|
50
|
-
* Creates a new filter bar which holds
|
|
52
|
+
* Creates a new filter bar which holds fields for filtering.
|
|
53
|
+
* Each field is bound to the given model.
|
|
51
54
|
*
|
|
52
|
-
* @param {map} mFiltersConfig A map of the parameters config - the same that is defined in sap.card/configuration/
|
|
53
|
-
* @param {
|
|
55
|
+
* @param {map} mFiltersConfig A map of the parameters config - the same that is defined in sap.card/configuration/filters.
|
|
56
|
+
* @param {sap.ui.model.json.JSONModel} oModel The model for filters.
|
|
54
57
|
* @returns {sap.m.HBox} The Filter bar.
|
|
55
58
|
*/
|
|
56
|
-
FilterBarFactory.prototype.create = function (mFiltersConfig,
|
|
59
|
+
FilterBarFactory.prototype.create = function (mFiltersConfig, oModel) {
|
|
57
60
|
var aFilters = [],
|
|
58
61
|
aReadyPromises = [],
|
|
59
62
|
mConfig,
|
|
60
63
|
sKey,
|
|
61
64
|
oFilter,
|
|
62
|
-
oFilterBarStrip
|
|
65
|
+
oFilterBarStrip,
|
|
66
|
+
FilterClass = null;
|
|
63
67
|
|
|
64
68
|
for (sKey in mFiltersConfig) {
|
|
65
69
|
mConfig = mFiltersConfig[sKey];
|
|
70
|
+
FilterClass = this._getClass(mConfig.type);
|
|
66
71
|
|
|
67
|
-
oFilter = new
|
|
72
|
+
oFilter = new FilterClass({
|
|
68
73
|
card: this._oCard,
|
|
69
74
|
key: sKey,
|
|
70
75
|
config: mConfig,
|
|
71
|
-
value:
|
|
76
|
+
value: {
|
|
77
|
+
model: "filters",
|
|
78
|
+
path: "/" + sKey
|
|
79
|
+
}
|
|
72
80
|
});
|
|
73
81
|
|
|
82
|
+
oModel.setProperty("/" + sKey, oFilter.getValueForModel());
|
|
83
|
+
|
|
74
84
|
this._awaitEvent(aReadyPromises, oFilter, "_ready");
|
|
75
85
|
oFilter._setDataConfiguration(mConfig.data);
|
|
76
86
|
|
|
@@ -114,5 +124,20 @@ sap.ui.define([
|
|
|
114
124
|
}));
|
|
115
125
|
};
|
|
116
126
|
|
|
127
|
+
FilterBarFactory.prototype._getClass = function (sType) {
|
|
128
|
+
sType = sType || "select";
|
|
129
|
+
|
|
130
|
+
switch (sType.toLowerCase()) {
|
|
131
|
+
case "string": // backwards compatibility
|
|
132
|
+
case "integer": // backwards compatibility
|
|
133
|
+
case "select":
|
|
134
|
+
return SelectFilter;
|
|
135
|
+
case "daterange":
|
|
136
|
+
return DateRangeFilter;
|
|
137
|
+
default:
|
|
138
|
+
return undefined;
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
|
|
117
142
|
return FilterBarFactory;
|
|
118
143
|
});
|