@openui5/sap.ui.mdc 1.111.6 → 1.112.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.
Files changed (167) hide show
  1. package/package.json +4 -4
  2. package/src/sap/ui/mdc/.library +1 -1
  3. package/src/sap/ui/mdc/ActionToolbar.js +1 -1
  4. package/src/sap/ui/mdc/Chart.js +21 -23
  5. package/src/sap/ui/mdc/ChartDelegate.js +1 -1
  6. package/src/sap/ui/mdc/ChartRenderer.js +0 -2
  7. package/src/sap/ui/mdc/Control.js +1 -1
  8. package/src/sap/ui/mdc/Element.js +1 -1
  9. package/src/sap/ui/mdc/Field.js +6 -6
  10. package/src/sap/ui/mdc/FilterBar.js +1 -1
  11. package/src/sap/ui/mdc/FilterBarDelegate.js +0 -37
  12. package/src/sap/ui/mdc/FilterField.js +4 -4
  13. package/src/sap/ui/mdc/Link.js +1 -1
  14. package/src/sap/ui/mdc/MultiValueField.js +1 -1
  15. package/src/sap/ui/mdc/Table.js +3 -11
  16. package/src/sap/ui/mdc/TableDelegate.js +5 -3
  17. package/src/sap/ui/mdc/ValueHelp.js +28 -15
  18. package/src/sap/ui/mdc/actiontoolbar/ActionToolbarAction.js +1 -1
  19. package/src/sap/ui/mdc/chart/ChartImplementationContainer.js +1 -1
  20. package/src/sap/ui/mdc/chart/ChartImplementationContainerRenderer.js +0 -2
  21. package/src/sap/ui/mdc/chart/ChartSelectionDetails.js +1 -1
  22. package/src/sap/ui/mdc/chart/ChartToolbar.js +2 -2
  23. package/src/sap/ui/mdc/chart/ChartTypeButton.js +2 -2
  24. package/src/sap/ui/mdc/chart/PropertyHelper.js +35 -2
  25. package/src/sap/ui/mdc/condition/Condition.js +1 -1
  26. package/src/sap/ui/mdc/condition/ConditionConverter.js +1 -1
  27. package/src/sap/ui/mdc/condition/ConditionModel.js +1 -1
  28. package/src/sap/ui/mdc/condition/FilterConverter.js +1 -1
  29. package/src/sap/ui/mdc/condition/FilterOperatorUtil.js +43 -1
  30. package/src/sap/ui/mdc/condition/Operator.js +1 -1
  31. package/src/sap/ui/mdc/condition/OperatorDynamicDateOption.js +10 -17
  32. package/src/sap/ui/mdc/condition/RangeOperator.js +7 -8
  33. package/src/sap/ui/mdc/field/ConditionType.js +1 -1
  34. package/src/sap/ui/mdc/field/ConditionsType.js +1 -1
  35. package/src/sap/ui/mdc/field/CustomFieldInfo.js +1 -1
  36. package/src/sap/ui/mdc/field/DefineConditionPanel.js +6 -6
  37. package/src/sap/ui/mdc/field/DynamicDateRangeConditionsType.js +49 -62
  38. package/src/sap/ui/mdc/field/FieldBase.js +93 -33
  39. package/src/sap/ui/mdc/field/FieldInfoBase.js +1 -1
  40. package/src/sap/ui/mdc/field/FieldInput.js +1 -1
  41. package/src/sap/ui/mdc/field/FieldInputRenderUtil.js +1 -1
  42. package/src/sap/ui/mdc/field/FieldMultiInput.js +1 -1
  43. package/src/sap/ui/mdc/field/ListFieldHelpItem.js +1 -1
  44. package/src/sap/ui/mdc/field/MultiValueFieldItem.js +1 -1
  45. package/src/sap/ui/mdc/field/TokenDisplay.js +1 -1
  46. package/src/sap/ui/mdc/field/TokenizerDisplay.js +1 -1
  47. package/src/sap/ui/mdc/field/content/DateContent.js +1 -2
  48. package/src/sap/ui/mdc/filterbar/FilterBarBase.js +4 -4
  49. package/src/sap/ui/mdc/filterbar/FilterBarBaseRenderer.js +3 -0
  50. package/src/sap/ui/mdc/filterbar/PropertyHelper.js +1 -1
  51. package/src/sap/ui/mdc/filterbar/p13n/AdaptationFilterBar.js +29 -2
  52. package/src/sap/ui/mdc/filterbar/vh/FilterBar.js +1 -1
  53. package/src/sap/ui/mdc/flexibility/Chart.flexibility.js +1 -1
  54. package/src/sap/ui/mdc/flexibility/FilterBar.flexibility.js +1 -1
  55. package/src/sap/ui/mdc/flexibility/FilterItemFlex.js +1 -1
  56. package/src/sap/ui/mdc/flexibility/GroupFlex.js +56 -9
  57. package/src/sap/ui/mdc/flexibility/SortFlex.js +56 -9
  58. package/src/sap/ui/mdc/flexibility/Util.js +7 -1
  59. package/src/sap/ui/mdc/library.js +108 -2
  60. package/src/sap/ui/mdc/link/ContactDetails.js +1 -1
  61. package/src/sap/ui/mdc/link/ContactDetailsAddressItem.js +1 -1
  62. package/src/sap/ui/mdc/link/ContactDetailsEmailItem.js +1 -1
  63. package/src/sap/ui/mdc/link/ContactDetailsItem.js +1 -1
  64. package/src/sap/ui/mdc/link/ContactDetailsPhoneItem.js +1 -1
  65. package/src/sap/ui/mdc/link/Factory.js +1 -1
  66. package/src/sap/ui/mdc/link/FakeFlpConnector.js +1 -1
  67. package/src/sap/ui/mdc/link/LinkItem.js +1 -1
  68. package/src/sap/ui/mdc/link/Panel.js +1 -1
  69. package/src/sap/ui/mdc/link/PanelItem.js +1 -1
  70. package/src/sap/ui/mdc/link/SemanticObjectMapping.js +1 -1
  71. package/src/sap/ui/mdc/link/SemanticObjectMappingItem.js +1 -1
  72. package/src/sap/ui/mdc/link/SemanticObjectUnavailableAction.js +1 -1
  73. package/src/sap/ui/mdc/messagebundle.properties +15 -0
  74. package/src/sap/ui/mdc/messagebundle_ar.properties +11 -1
  75. package/src/sap/ui/mdc/messagebundle_bg.properties +10 -0
  76. package/src/sap/ui/mdc/messagebundle_ca.properties +10 -0
  77. package/src/sap/ui/mdc/messagebundle_cs.properties +10 -0
  78. package/src/sap/ui/mdc/messagebundle_cy.properties +10 -0
  79. package/src/sap/ui/mdc/messagebundle_da.properties +10 -0
  80. package/src/sap/ui/mdc/messagebundle_de.properties +10 -0
  81. package/src/sap/ui/mdc/messagebundle_el.properties +13 -3
  82. package/src/sap/ui/mdc/messagebundle_en.properties +10 -0
  83. package/src/sap/ui/mdc/messagebundle_en_GB.properties +10 -0
  84. package/src/sap/ui/mdc/messagebundle_en_US_sappsd.properties +10 -0
  85. package/src/sap/ui/mdc/messagebundle_en_US_saprigi.properties +2 -0
  86. package/src/sap/ui/mdc/messagebundle_en_US_saptrc.properties +10 -0
  87. package/src/sap/ui/mdc/messagebundle_es.properties +10 -0
  88. package/src/sap/ui/mdc/messagebundle_es_MX.properties +10 -0
  89. package/src/sap/ui/mdc/messagebundle_et.properties +10 -0
  90. package/src/sap/ui/mdc/messagebundle_fi.properties +10 -0
  91. package/src/sap/ui/mdc/messagebundle_fr.properties +10 -0
  92. package/src/sap/ui/mdc/messagebundle_fr_CA.properties +10 -0
  93. package/src/sap/ui/mdc/messagebundle_hi.properties +10 -0
  94. package/src/sap/ui/mdc/messagebundle_hr.properties +10 -0
  95. package/src/sap/ui/mdc/messagebundle_hu.properties +10 -0
  96. package/src/sap/ui/mdc/messagebundle_id.properties +10 -0
  97. package/src/sap/ui/mdc/messagebundle_it.properties +10 -0
  98. package/src/sap/ui/mdc/messagebundle_iw.properties +10 -0
  99. package/src/sap/ui/mdc/messagebundle_ja.properties +11 -1
  100. package/src/sap/ui/mdc/messagebundle_kk.properties +10 -0
  101. package/src/sap/ui/mdc/messagebundle_ko.properties +10 -0
  102. package/src/sap/ui/mdc/messagebundle_lt.properties +10 -0
  103. package/src/sap/ui/mdc/messagebundle_lv.properties +10 -0
  104. package/src/sap/ui/mdc/messagebundle_ms.properties +10 -0
  105. package/src/sap/ui/mdc/messagebundle_nl.properties +10 -0
  106. package/src/sap/ui/mdc/messagebundle_no.properties +10 -0
  107. package/src/sap/ui/mdc/messagebundle_pl.properties +10 -0
  108. package/src/sap/ui/mdc/messagebundle_pt.properties +10 -0
  109. package/src/sap/ui/mdc/messagebundle_pt_PT.properties +10 -0
  110. package/src/sap/ui/mdc/messagebundle_ro.properties +10 -0
  111. package/src/sap/ui/mdc/messagebundle_ru.properties +10 -0
  112. package/src/sap/ui/mdc/messagebundle_sh.properties +10 -0
  113. package/src/sap/ui/mdc/messagebundle_sk.properties +10 -0
  114. package/src/sap/ui/mdc/messagebundle_sl.properties +10 -0
  115. package/src/sap/ui/mdc/messagebundle_sv.properties +10 -0
  116. package/src/sap/ui/mdc/messagebundle_th.properties +10 -0
  117. package/src/sap/ui/mdc/messagebundle_tr.properties +10 -0
  118. package/src/sap/ui/mdc/messagebundle_uk.properties +15 -5
  119. package/src/sap/ui/mdc/messagebundle_vi.properties +10 -0
  120. package/src/sap/ui/mdc/messagebundle_zh_CN.properties +10 -0
  121. package/src/sap/ui/mdc/messagebundle_zh_TW.properties +10 -0
  122. package/src/sap/ui/mdc/mixin/AdaptationMixin.js +1 -1
  123. package/src/sap/ui/mdc/mixin/DelegateMixin.js +1 -1
  124. package/src/sap/ui/mdc/mixin/FilterIntegrationMixin.js +4 -3
  125. package/src/sap/ui/mdc/mixin/PromiseMixin.js +1 -1
  126. package/src/sap/ui/mdc/mixin/PropertyHelperMixin.js +1 -71
  127. package/src/sap/ui/mdc/odata/v4/TableDelegate.js +7 -0
  128. package/src/sap/ui/mdc/p13n/P13nBuilder.js +382 -376
  129. package/src/sap/ui/mdc/p13n/PropertyHelper.js +1 -1
  130. package/src/sap/ui/mdc/p13n/UIManager.js +1 -1
  131. package/src/sap/ui/mdc/p13n/panels/FilterPanel.js +1 -1
  132. package/src/sap/ui/mdc/p13n/subcontroller/AdaptFiltersController.js +5 -3
  133. package/src/sap/ui/mdc/p13n/subcontroller/ColumnWidthController.js +1 -1
  134. package/src/sap/ui/mdc/p13n/subcontroller/FilterController.js +158 -11
  135. package/src/sap/ui/mdc/p13n/subcontroller/LinkPanelController.js +7 -7
  136. package/src/sap/ui/mdc/p13n/subcontroller/SelectionController.js +1 -1
  137. package/src/sap/ui/mdc/table/ColumnSettings.js +1 -1
  138. package/src/sap/ui/mdc/table/CreationRow.js +1 -1
  139. package/src/sap/ui/mdc/table/GridTableType.js +19 -0
  140. package/src/sap/ui/mdc/table/PropertyHelper.js +1 -1
  141. package/src/sap/ui/mdc/table/ResponsiveColumnSettings.js +1 -1
  142. package/src/sap/ui/mdc/table/RowActionItem.js +1 -1
  143. package/src/sap/ui/mdc/table/RowSettings.js +1 -1
  144. package/src/sap/ui/mdc/table/V4AnalyticsPropertyHelper.js +1 -1
  145. package/src/sap/ui/mdc/table/menu/Item.js +6 -0
  146. package/src/sap/ui/mdc/themes/base/Chart.less +1 -1
  147. package/src/sap/ui/mdc/themes/base/ValueHelpDialog.less +5 -1
  148. package/src/sap/ui/mdc/util/DateUtil.js +84 -95
  149. package/src/sap/ui/mdc/util/InfoBar.js +88 -60
  150. package/src/sap/ui/mdc/util/PromiseCache.js +1 -1
  151. package/src/sap/ui/mdc/util/PropertyHelper.js +5 -1
  152. package/src/sap/ui/mdc/util/TypeUtil.js +6 -3
  153. package/src/sap/ui/mdc/valuehelp/Dialog.js +67 -58
  154. package/src/sap/ui/mdc/valuehelp/Popover.js +19 -1
  155. package/src/sap/ui/mdc/valuehelp/base/Container.js +12 -1
  156. package/src/sap/ui/mdc/valuehelp/base/Content.js +1 -1
  157. package/src/sap/ui/mdc/valuehelp/base/DialogTab.js +1 -1
  158. package/src/sap/ui/mdc/valuehelp/base/FilterableListContent.js +1 -1
  159. package/src/sap/ui/mdc/valuehelp/base/ListContent.js +1 -1
  160. package/src/sap/ui/mdc/valuehelp/content/Bool.js +1 -1
  161. package/src/sap/ui/mdc/valuehelp/content/Conditions.js +1 -1
  162. package/src/sap/ui/mdc/valuehelp/content/FixedList.js +1 -1
  163. package/src/sap/ui/mdc/valuehelp/content/MDCTable.js +1 -1
  164. package/src/sap/ui/mdc/valuehelp/content/MTable.js +6 -8
  165. package/src/sap/ui/mdc/p13n/Engine.js +0 -1200
  166. package/src/sap/ui/mdc/p13n/FlexUtil.js +0 -276
  167. package/src/sap/ui/mdc/p13n/subcontroller/BaseController.js +0 -438
@@ -5,13 +5,13 @@
5
5
  */
6
6
  sap.ui.define([
7
7
  'sap/ui/core/library',
8
- 'sap/ui/core/date/UniversalDate',
8
+ 'sap/ui/core/date/UI5Date',
9
9
  'sap/ui/mdc/enum/BaseType',
10
10
  'sap/base/util/merge'
11
11
  ],
12
12
  function(
13
13
  coreLibrary,
14
- UniversalDate,
14
+ UI5Date,
15
15
  BaseType,
16
16
  merge
17
17
  ) {
@@ -31,74 +31,6 @@ sap.ui.define([
31
31
  */
32
32
  var DateUtil = {
33
33
 
34
- /**
35
- * Converts a data type specific date to a UniversalDate.
36
- *
37
- * @param {any} vDate Date
38
- * @param {sap.ui.model.SimpleType} oType Data type
39
- * @param {sap.ui.mdc.enum.BaseType} [sBaseType] Basic type
40
- * @return {sap.ui.core.date.UniversalDate} UniversalDate
41
- * @private
42
- * @ui5-restricted sap.ui.mdc
43
- * @since 1.74.0
44
- */
45
- typeToUniversalDate: function(vDate, oType, sBaseType) {
46
-
47
- var sPattern;
48
- if (sBaseType && sBaseType === BaseType.DateTime) {
49
- sPattern = "yyyyMMdd-HHmmssSSS";
50
- } else {
51
- sPattern = "yyyyMMdd";
52
- }
53
- var sDate = this.typeToString(vDate, oType, sPattern);
54
- var iYear = parseInt(sDate.slice(0,4));
55
- var iMonth = parseInt(sDate.slice(4,6)) - 1;
56
- var iDate = parseInt(sDate.slice(6,8));
57
- var iHour = sBaseType === BaseType.DateTime ? parseInt(sDate.slice(9,11)) : 0;
58
- var iMinute = sBaseType === BaseType.DateTime ? parseInt(sDate.slice(11,13)) : 0;
59
- var iSecond = sBaseType === BaseType.DateTime ? parseInt(sDate.slice(13,15)) : 0;
60
- var iMillisecond = sBaseType === BaseType.DateTime ? parseInt(sDate.slice(15,18)) : 0;
61
- var oUniversalDate = new UniversalDate(UniversalDate.UTC(iYear, iMonth, iDate, iHour, iMinute, iSecond, iMillisecond));
62
-
63
- return oUniversalDate;
64
-
65
- },
66
-
67
- /**
68
- * Converts a UniversalDate to data type specific date.
69
- *
70
- * @param {sap.ui.core.date.UniversalDate} oDate UniversalDate
71
- * @param {sap.ui.model.SimpleType} oType Data type
72
- * @param {sap.ui.mdc.enum.BaseType} [sBaseType] Basic type
73
- * @return {any} type specific date
74
- * @private
75
- * @ui5-restricted sap.ui.mdc
76
- * @since 1.74.0
77
- */
78
- universalDateToType: function(oDate, oType, sBaseType) {
79
-
80
- var iYear = oDate.getUTCFullYear();
81
- var iMonth = oDate.getUTCMonth() + 1;
82
- var iDate = oDate.getUTCDate();
83
- var sYear = (iYear < 10 ? "0" : "") + (iYear < 100 ? "0" : "") + (iYear < 1000 ? "0" : "") + iYear.toString();
84
- var sDate = sYear + ((iMonth < 10) ? "0" : "") + iMonth.toString() + ((iDate < 10) ? "0" : "") + iDate.toString();
85
- var sPattern;
86
- if (sBaseType && sBaseType === BaseType.DateTime) {
87
- sPattern = "yyyyMMdd-HHmmssSSS";
88
- var iHour = oDate.getUTCHours();
89
- var iMinute = oDate.getUTCMinutes();
90
- var iSecond = oDate.getUTCSeconds();
91
- var iMillisecond = oDate.getUTCMilliseconds();
92
- sDate = sDate + "-" + ((iHour < 10) ? "0" : "") + iHour.toString() + ((iMinute < 10) ? "0" : "") + iMinute.toString() + ((iSecond < 10) ? "0" : "") + iSecond.toString() + ((iMillisecond < 100) ? "0" : "") + ((iMillisecond < 10) ? "0" : "") + iMillisecond.toString();
93
- } else {
94
- sPattern = "yyyyMMdd";
95
- }
96
- var vDate = this.stringToType(sDate, oType, sPattern);
97
-
98
- return vDate;
99
-
100
- },
101
-
102
34
  /**
103
35
  * "Clones" a given data type to use a given pattern.
104
36
  *
@@ -189,44 +121,101 @@ sap.ui.define([
189
121
  },
190
122
 
191
123
  /**
192
- * Convert time part of a JS Date object from local time to UTC
124
+ * Converts a data type representation of a dateTime to a ISO-string.
193
125
  *
194
- * Returns a new date object, where the UTC time is set to the same value as
195
- * the local time on the original date object.
196
- *
197
- * If a date has a local time of to 14:00 GMT+0200, the resulting date will have
198
- * 14:00 UTC on the same day.
126
+ * @param {any} vDate Date
127
+ * @param {sap.ui.model.SimpleType} oType Data type
128
+ * @param {sap.ui.mdc.enum.BaseType} [sBaseType] Basic type
129
+ * @return {string} Date as ISOString
130
+ * @private
131
+ * @ui5-restricted sap.ui.mdc
132
+ * @since 1.112.0
133
+ */
134
+ typeToISO: function(vDate, oType, sBaseType) {
135
+
136
+ var oDate = this.typeToDate(vDate, oType, sBaseType);
137
+
138
+ // if (oType.getFormatOptions().UTC) { // in UTC date we need to bring the local date to UTC
139
+ // oDate = UI5Date.getInstance(Date.UTC(oDate.getFullYear(), oDate.getMonth(), oDate.getDate(), oDate.getHours(), oDate.getMinutes(), oDate.getSeconds(), oDate.getMilliseconds()));
140
+ // }
141
+
142
+ return oDate.toISOString();
143
+
144
+ },
145
+
146
+ /**
147
+ * Converts a ISO representation of a DateTime into the data-type representation.
199
148
  *
200
- * @param {Date} oDate the date to convert
201
- * @returns {Date} a new date object with converted time
149
+ * @param {string} sISODate Date
150
+ * @param {sap.ui.model.SimpleType} oType Data type
151
+ * @param {sap.ui.mdc.enum.BaseType} [sBaseType] Basic type
152
+ * @return {any} Date for type
202
153
  * @private
154
+ * @ui5-restricted sap.ui.mdc
155
+ * @since 1.112.0
203
156
  */
204
- localToUtc: function(oDate) {
205
- return new Date( Date.UTC(oDate.getFullYear(), oDate.getMonth(), oDate.getDate(),
206
- oDate.getHours(), oDate.getMinutes(), oDate.getSeconds(), oDate.getMilliseconds())
207
- );
157
+ ISOToType: function(sISODate, oType, sBaseType) {
158
+
159
+ var oDate = UI5Date.getInstance(sISODate); // can also interpret string with pattern "yyyy-MM-ddTHH:mm:ssZ"
160
+
161
+ if (oType.getFormatOptions().UTC) { // in UTC date we need to bring the UTC to local date
162
+ oDate = UI5Date.getInstance(oDate.getUTCFullYear(), oDate.getUTCMonth(), oDate.getUTCDate(), oDate.getUTCHours(), oDate.getUTCMinutes(), oDate.getUTCSeconds(), oDate.getUTCMilliseconds());
163
+ }
164
+
165
+ return this.dateToType(oDate, oType, sBaseType);
166
+
208
167
  },
209
168
 
210
169
  /**
211
- * Convert time part of a JS Date object from UTC to local time
170
+ * Convert time part of a JS Date ino the type representation
212
171
  *
213
- * Returns a new date object, where the local time is set to the same value as
214
- * the UTC time on the original date object.
172
+ * The incomming date is a local date, so for Date and Time the local value needs to be used, for DateTime it depends on the UTC configuration.
215
173
  *
216
- * If a date has a time of to 14:00 UTC, the resulting date will have
217
- * 14:00 GMT+0200 on the same day.
174
+ * @param {Date} oDate the date to convert
175
+ * @param {sap.ui.model.SimpleType} oType Data type
176
+ * @param {sap.ui.mdc.enum.BaseType} [sBaseType] Basic type
177
+ * @returns {any} date in type representation
178
+ * @private
179
+ */
180
+ dateToType: function(oDate, oType, sBaseType) {
181
+ var vDate;
182
+
183
+ if (oType.getModelValue) {
184
+ vDate = oType.getModelValue(oDate);
185
+ } else { // older types don't support the new getModelValue
186
+ var oModelFormat = oType.getModelFormat();
187
+ var oFormatOptions = oType.getFormatOptions();
188
+ var bUTC = sBaseType === BaseType.DateTime ? !!oFormatOptions.UTC : false;
189
+ vDate = oModelFormat.format(oDate, bUTC);
190
+ }
191
+
192
+ return vDate;
193
+ },
194
+
195
+ /**
196
+ * Convert time part of a JS Date ino the type representation
218
197
  *
219
- * Please be aware that due to summer/winter time and changes in timezones,
220
- * not all times can be converted to local time.
198
+ * The needed date is a local date, so for Date and Time the local value needs to be used, for DateTime it depends on the UTC configuration.
221
199
  *
222
- * @param {Date} oDate the date to convert
223
- * @returns {Date} a new date object with converted time
200
+ * @param {any} vDate date in type representation
201
+ * @param {sap.ui.model.SimpleType} oType Data type
202
+ * @param {sap.ui.mdc.enum.BaseType} [sBaseType] Basic type
203
+ * @returns {Date} JSDate (local)
224
204
  * @private
225
205
  */
226
- utcToLocal: function(oDate) {
227
- return new Date( oDate.getUTCFullYear(), oDate.getUTCMonth(), oDate.getUTCDate(),
228
- oDate.getUTCHours(), oDate.getUTCMinutes(), oDate.getUTCSeconds(), oDate.getUTCMilliseconds()
229
- );
206
+ typeToDate: function(vDate, oType, sBaseType) {
207
+ var oDate;
208
+
209
+ if (oType.isA("sap.ui.model.odata.type.DateTime") && oType.getConstraints().displayFormat === "Date") { // TODO: need some type-function to convert
210
+ oDate = UI5Date.getInstance(vDate.getUTCFullYear(), vDate.getUTCMonth(), vDate.getUTCDate());
211
+ } else {
212
+ var oModelFormat = oType.getModelFormat();
213
+ var oFormatOptions = oType.getFormatOptions();
214
+ var bUTC = sBaseType === BaseType.DateTime ? !!oFormatOptions.UTC : false;
215
+ oDate = oModelFormat.parse(vDate, bUTC);
216
+ }
217
+
218
+ return oDate;
230
219
  }
231
220
  };
232
221
 
@@ -5,82 +5,105 @@
5
5
  */
6
6
  sap.ui.define([
7
7
  'sap/ui/core/Control',
8
- 'sap/m/OverflowToolbar',
8
+ 'sap/m/OverflowToolbar',
9
9
  "sap/ui/mdc/util/InfoBarRenderer",
10
10
  "sap/m/Text",
11
11
  "sap/ui/core/InvisibleText",
12
- "sap/m/Label"
13
- ], function(Control, Toolbar, InfoBarRenderer, Text, InvisibleText, Label) {
14
- "use strict";
15
-
16
- /**
17
- * Constructor for a new InfoBar.
18
- * @param {string} [sId] ID for the new control, generated automatically if no ID is given
19
- * @param {object} [mSettings] Initial settings for the new control
20
- * @class The <code>InfoBar</code> control provides an easy way of displaying filter information inside an <code>sap.ui.mdc.Chart</code> and an <code>sap.ui.mdc.Table</code>.
21
- * @extends sap.ui.core.Control
22
- * @author SAP SE
23
- * @version 1.111.6
24
- * @constructor
25
- * @experimental As of version 1.111
26
- * @private
27
- * @ui5-restricted sap.ui.mdc
28
- * @MDC_PUBLIC_CANDIDATE
29
- * @since 1.111.0
30
- * @alias sap.ui.mdc.util.InfoBar
31
- */
32
- var InfoBar = Control.extend("sap.ui.mdc.util.InfoBar", {
33
- metadata: {
34
- properties: {
12
+ "sap/m/Label",
13
+ "sap/m/Button",
14
+ "sap/m/library",
15
+ "sap/m/ToolbarSpacer"
16
+ ], function (Control, Toolbar, InfoBarRenderer, Text, InvisibleText, Label, Button, mLibrary, ToolbarSpacer) {
17
+ "use strict";
18
+
19
+ /**
20
+ * Constructor for a new InfoBar.
21
+ * @param {string} [sId] ID for the new control, generated automatically if no ID is given
22
+ * @param {object} [mSettings] Initial settings for the new control
23
+ * @class The <code>InfoBar</code> control provides an easy way of displaying filter information inside an <code>sap.ui.mdc.Chart</code> and an <code>sap.ui.mdc.Table</code>.
24
+ * @extends sap.ui.core.Control
25
+ * @author SAP SE
26
+ * @version 1.112.1
27
+ * @constructor
28
+ * @experimental As of version 1.111
29
+ * @private
30
+ * @ui5-restricted sap.ui.mdc
31
+ * @MDC_PUBLIC_CANDIDATE
32
+ * @since 1.111.0
33
+ * @alias sap.ui.mdc.util.InfoBar
34
+ */
35
+ var InfoBar = Control.extend("sap.ui.mdc.util.InfoBar", {
36
+ metadata: {
37
+ properties: {
35
38
  infoText: {
36
39
  type: "string"
37
40
  }
38
- },
41
+ },
39
42
  aggregations: {
40
- _toolbar : {
43
+ _toolbar: {
41
44
  type: "sap.m.Toolbar",
42
45
  multiple: false,
43
46
  visibility: "hidden"
44
47
  }
45
48
  },
46
49
  events: {
47
- /**
48
- * This event is fired when the user clicks on the infobar.
49
- */
50
- press : {
51
- parameters : {
52
-
53
- /**
54
- * The toolbar item that was pressed
55
- */
56
- srcControl : {type : "sap.ui.core.Control"}
57
- }
58
- }
50
+ /**
51
+ * This event is fired when the user clicks on the infobar.
52
+ */
53
+ press: {
54
+ parameters: {
55
+
56
+ /**
57
+ * The toolbar item that was pressed
58
+ */
59
+ srcControl: { type: "sap.ui.core.Control" }
60
+ }
61
+ },
62
+ /**
63
+ * This event is fired when the user clicks on the RemoveAllfilters button.
64
+ */
65
+ removeAllFilters: {
66
+ parameters: {
67
+ }
68
+ }
59
69
  }
60
- },
70
+ },
61
71
  renderer: InfoBarRenderer
62
- });
72
+ });
63
73
 
64
- InfoBar.prototype.init = function() {
65
74
 
66
- this.setVisible(!!this.getInfoText());
67
- this.oText = new Text({
68
- text: this.getInfoText(),
69
- wrapping: false
75
+ InfoBar.prototype.applySettings = function () {
76
+ Control.prototype.applySettings.apply(this, arguments);
77
+
78
+ this.setInfoText(this.getInfoText());
79
+ };
80
+
81
+ InfoBar.prototype.init = function () {
82
+
83
+ this.setVisible(false);
84
+ this.oText = new Text({ wrapping: false });
85
+ this.oInvisibleText = new InvisibleText().toStatic();
86
+
87
+ this.oRemoveAllFiltersBtn = new Button(this.getId() + "-RemoveAllFilters", {
88
+ press: function (oEvent) {
89
+ this.fireRemoveAllFilters();
90
+ // TODO this.oInvisibleMessage.announce(oMessageBundle.getText("valuehelp.REMOVEALLTOKEN_ANNOUNCE"), InvisibleMessageMode.Polite);
91
+ }.bind(this),
92
+ icon: "sap-icon://decline",
93
+ tooltip: sap.ui.getCore().getLibraryResourceBundle("sap.ui.mdc").getText("infobar.REMOVEALLFILTERS")
70
94
  });
71
- this.oInvisibleText = new InvisibleText({text: this.getInfoText()}).toStatic();
72
95
 
73
- var oToolbar = new Toolbar(this.getId() + "--bar", { design: "Info", active: true, content: [this.oText]});
74
- oToolbar.attachPress(function(oSrc){
96
+ var oToolbar = new Toolbar(this.getId() + "--bar", { design: "Info", active: true, content: [this.oText, new ToolbarSpacer(), this.oRemoveAllFiltersBtn] });
97
+ oToolbar.attachPress(function (oSrc) {
75
98
  this.firePress({
76
- srcControl : oSrc
77
- });
99
+ srcControl: oSrc
100
+ });
78
101
  }.bind(this));
79
102
  this.setAggregation("_toolbar", oToolbar);
80
103
 
81
104
  };
82
105
 
83
- InfoBar.prototype.setInfoText = function(sText){
106
+ InfoBar.prototype.setInfoText = function (sText) {
84
107
  this.setProperty("infoText", sText);
85
108
  this.setVisible(!!sText);
86
109
 
@@ -96,23 +119,28 @@ sap.ui.define([
96
119
  * Provides the ID of the invisible text created by the <code>InfoBar</code>. Can be used to set ARIA labels correctly.
97
120
  * @returns {string} ID of the invisible text control
98
121
  */
99
- InfoBar.prototype.getACCTextId = function() {
122
+ InfoBar.prototype.getACCTextId = function () {
100
123
  return this.oInvisibleText.getId();
101
124
  };
102
125
 
103
- InfoBar.prototype.exit = function() {
126
+ InfoBar.prototype.exit = function () {
104
127
  if (this.oInvisibleText) {
105
- this.oInvisibleText.destroy();
106
- this.oInvisibleText = null;
107
- }
128
+ this.oInvisibleText.destroy();
129
+ this.oInvisibleText = null;
130
+ }
108
131
 
109
132
  if (this.oText) {
110
- this.oText.destroy();
111
- this.oText = null;
112
- }
133
+ this.oText.destroy();
134
+ this.oText = null;
135
+ }
136
+
137
+ if (this.oRemoveAllFiltersBtn) {
138
+ this.oRemoveAllFiltersBtn.destroy();
139
+ this.oRemoveAllFiltersBtn = null;
140
+ }
113
141
  };
114
142
 
115
143
 
116
- return InfoBar;
144
+ return InfoBar;
117
145
 
118
146
  });
@@ -45,7 +45,7 @@ sap.ui.define(
45
45
  * Destroying the cache will cancel all registered promises and delete references. Convenience methods for promise creation, wrapping and replacement are offered.
46
46
  *
47
47
  * @author SAP SE
48
- * @version 1.111.6
48
+ * @version 1.112.1
49
49
  * @alias sap.ui.mdc.util.PromiseCache
50
50
  * @since 1.85.0
51
51
  * @private
@@ -274,6 +274,10 @@ sap.ui.define([
274
274
  function reportInvalidProperty(sMessage, oAdditionalInfo) {
275
275
  // TODO: warning is logged momentarily so that consumers can adapt to have valid property definitions
276
276
  // valid use case would be to throw an error
277
+ if (Log.getLevel() < Log.WARNING) {
278
+ return; // Avoid stringification overhead if logging is not required.
279
+ }
280
+
277
281
  var sAdditionalInfo = stringifyPlainObject(oAdditionalInfo);
278
282
  Log.warning("Invalid property definition: " + sMessage + (sAdditionalInfo ? "\n" + sAdditionalInfo : ""));
279
283
  }
@@ -527,7 +531,7 @@ sap.ui.define([
527
531
  * @extends sap.ui.base.Object
528
532
  *
529
533
  * @author SAP SE
530
- * @version 1.111.6
534
+ * @version 1.112.1
531
535
  *
532
536
  * @private
533
537
  * @experimental
@@ -14,7 +14,7 @@ sap.ui.define([
14
14
  ], function(BaseType, ObjectPath, isEmptyObject, merge, SimpleType, DateUtil) {
15
15
  "use strict";
16
16
 
17
- var sDateTimePattern = "yyyy-MM-ddTHH:mm:ssZ"; // milliseconds missing
17
+ // var sDateTimePattern = "yyyy-MM-ddTHH:mm:ssZ"; // milliseconds missing
18
18
  var sDatePattern = "yyyy-MM-dd";
19
19
  var sTimePattern = "HH:mm:ss";
20
20
 
@@ -194,9 +194,12 @@ sap.ui.define([
194
194
  var sBaseType = this.getBaseTypeForType(oTypeInstance);
195
195
  switch (sBaseType) {
196
196
  case BaseType.DateTime:
197
- return DateUtil.stringToType(sValue, oTypeInstance, sDateTimePattern);
197
+ return DateUtil.ISOToType(sValue, oTypeInstance, sBaseType);
198
198
 
199
199
  case BaseType.Date:
200
+ if (sValue.indexOf("T") >= 0) { // old variant with DateTime for DateValues
201
+ sValue = sValue.substr(0, sValue.indexOf("T")); // just take the date part
202
+ }
200
203
  return DateUtil.stringToType(sValue, oTypeInstance, sDatePattern);
201
204
 
202
205
  case BaseType.Time:
@@ -235,7 +238,7 @@ sap.ui.define([
235
238
  var sBaseType = this.getBaseTypeForType(oTypeInstance);
236
239
  switch (sBaseType) {
237
240
  case BaseType.DateTime:
238
- return DateUtil.typeToString(vValue, oTypeInstance, sDateTimePattern);
241
+ return DateUtil.typeToISO(vValue, oTypeInstance, sBaseType);
239
242
 
240
243
  case BaseType.Date:
241
244
  return DateUtil.typeToString(vValue, oTypeInstance, sDatePattern);