@openui5/sap.ui.mdc 1.113.0 → 1.115.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (269) hide show
  1. package/.reuse/dep5 +0 -5
  2. package/README.md +22 -9
  3. package/THIRDPARTY.txt +1 -7
  4. package/package.json +4 -4
  5. package/src/sap/ui/mdc/.library +1 -1
  6. package/src/sap/ui/mdc/ActionToolbar.js +5 -7
  7. package/src/sap/ui/mdc/AggregationBaseDelegate.js +5 -5
  8. package/src/sap/ui/mdc/BaseDelegate.js +49 -14
  9. package/src/sap/ui/mdc/Chart.js +147 -179
  10. package/src/sap/ui/mdc/ChartDelegate.js +404 -514
  11. package/src/sap/ui/mdc/ChartRenderer.js +11 -11
  12. package/src/sap/ui/mdc/Control.js +4 -4
  13. package/src/sap/ui/mdc/DefaultTypeMap.js +84 -0
  14. package/src/sap/ui/mdc/Element.js +4 -4
  15. package/src/sap/ui/mdc/Field.js +98 -96
  16. package/src/sap/ui/mdc/FilterBar.js +33 -56
  17. package/src/sap/ui/mdc/FilterBarDelegate.js +36 -69
  18. package/src/sap/ui/mdc/FilterField.js +93 -47
  19. package/src/sap/ui/mdc/Link.js +83 -82
  20. package/src/sap/ui/mdc/LinkDelegate.js +29 -48
  21. package/src/sap/ui/mdc/MultiValueField.js +34 -30
  22. package/src/sap/ui/mdc/Table.js +182 -193
  23. package/src/sap/ui/mdc/TableDelegate.js +244 -33
  24. package/src/sap/ui/mdc/ValueHelp.js +67 -50
  25. package/src/sap/ui/mdc/ValueHelpDelegate.js +57 -89
  26. package/src/sap/ui/mdc/actiontoolbar/ActionToolbarAction.js +4 -12
  27. package/src/sap/ui/mdc/chart/ChartImplementationContainer.js +192 -197
  28. package/src/sap/ui/mdc/chart/ChartSelectionDetails.js +10 -20
  29. package/src/sap/ui/mdc/chart/ChartToolbar.js +50 -50
  30. package/src/sap/ui/mdc/chart/ChartTypeButton.js +23 -27
  31. package/src/sap/ui/mdc/chart/DrillBreadcrumbs.js +10 -10
  32. package/src/sap/ui/mdc/chart/DrillStackHandler.js +14 -14
  33. package/src/sap/ui/mdc/chart/Item.js +30 -17
  34. package/src/sap/ui/mdc/chart/PropertyHelper.js +10 -10
  35. package/src/sap/ui/mdc/chart/SelectionDetailsActions.js +23 -15
  36. package/src/sap/ui/mdc/condition/Condition.js +11 -23
  37. package/src/sap/ui/mdc/condition/ConditionConverter.js +8 -8
  38. package/src/sap/ui/mdc/condition/ConditionModel.js +1 -1
  39. package/src/sap/ui/mdc/condition/FilterConverter.js +2 -2
  40. package/src/sap/ui/mdc/condition/FilterOperatorUtil.js +771 -123
  41. package/src/sap/ui/mdc/condition/Operator.js +52 -50
  42. package/src/sap/ui/mdc/condition/OperatorDynamicDateOption.js +14 -14
  43. package/src/sap/ui/mdc/condition/RangeOperator.js +3 -5
  44. package/src/sap/ui/mdc/designtime/table/Table.designtime.js +2 -2
  45. package/src/sap/ui/mdc/enum/ActionToolbarActionAlignment.js +5 -9
  46. package/src/sap/ui/mdc/enum/BaseType.js +15 -20
  47. package/src/sap/ui/mdc/enum/ConditionValidated.js +5 -9
  48. package/src/sap/ui/mdc/enum/ContentMode.js +1 -0
  49. package/src/sap/ui/mdc/enum/EditMode.js +7 -19
  50. package/src/sap/ui/mdc/enum/FieldDisplay.js +12 -18
  51. package/src/sap/ui/mdc/enum/FilterBarValidationStatus.js +3 -1
  52. package/src/sap/ui/mdc/enum/LinkType.js +40 -0
  53. package/src/sap/ui/mdc/enum/OperatorOverwrite.js +4 -2
  54. package/src/sap/ui/mdc/enum/OperatorValueType.js +47 -0
  55. package/src/sap/ui/mdc/enum/PersistenceMode.js +36 -36
  56. package/src/sap/ui/mdc/enum/ProcessingStrategy.js +3 -1
  57. package/src/sap/ui/mdc/enum/PropagationReason.js +1 -1
  58. package/src/sap/ui/mdc/enum/ReasonMode.js +1 -0
  59. package/src/sap/ui/mdc/enum/SelectType.js +1 -0
  60. package/src/sap/ui/mdc/enums/ActionToolbarActionAlignment.js +31 -0
  61. package/src/sap/ui/mdc/enums/BaseType.js +72 -0
  62. package/src/sap/ui/mdc/enums/ChartItemRoleType.js +61 -0
  63. package/src/sap/ui/mdc/enums/ChartItemType.js +31 -0
  64. package/src/sap/ui/mdc/enums/ChartP13nMode.js +48 -0
  65. package/src/sap/ui/mdc/enums/ChartToolbarActionType.js +49 -0
  66. package/src/sap/ui/mdc/enums/ConditionValidated.js +43 -0
  67. package/src/sap/ui/mdc/enums/ContentMode.js +74 -0
  68. package/src/sap/ui/mdc/enums/FieldDisplay.js +49 -0
  69. package/src/sap/ui/mdc/enums/FieldEditMode.js +55 -0
  70. package/src/sap/ui/mdc/enums/FilterBarP13nMode.js +36 -0
  71. package/src/sap/ui/mdc/enums/FilterBarValidationStatus.js +56 -0
  72. package/src/sap/ui/mdc/enums/LinkType.js +38 -0
  73. package/src/sap/ui/mdc/enums/OperatorOverwrite.js +34 -0
  74. package/src/sap/ui/mdc/enums/OperatorValueType.js +44 -0
  75. package/src/sap/ui/mdc/enums/PersistenceMode.js +44 -0
  76. package/src/sap/ui/mdc/enums/ProcessingStrategy.js +39 -0
  77. package/src/sap/ui/mdc/enums/ReasonMode.js +53 -0
  78. package/src/sap/ui/mdc/enums/TableGrowingMode.js +42 -0
  79. package/src/sap/ui/mdc/enums/TableMultiSelectMode.js +35 -0
  80. package/src/sap/ui/mdc/enums/TableP13nMode.js +54 -0
  81. package/src/sap/ui/mdc/enums/TableRowAction.js +30 -0
  82. package/src/sap/ui/mdc/enums/TableRowCountMode.js +36 -0
  83. package/src/sap/ui/mdc/enums/TableSelectionMode.js +45 -0
  84. package/src/sap/ui/mdc/enums/TableType.js +43 -0
  85. package/src/sap/ui/mdc/enums/ValueHelpPropagationReason.js +41 -0
  86. package/src/sap/ui/mdc/enums/ValueHelpSelectionType.js +46 -0
  87. package/src/sap/ui/mdc/field/ConditionType.js +120 -88
  88. package/src/sap/ui/mdc/field/ConditionsType.js +149 -44
  89. package/src/sap/ui/mdc/field/CustomFieldInfo.js +1 -1
  90. package/src/sap/ui/mdc/field/DynamicDateRangeConditionsType.js +15 -17
  91. package/src/sap/ui/mdc/field/FieldBase.js +512 -323
  92. package/src/sap/ui/mdc/field/FieldBaseDelegate.js +31 -114
  93. package/src/sap/ui/mdc/field/FieldBaseRenderer.js +4 -4
  94. package/src/sap/ui/mdc/field/FieldInfoBase.js +23 -21
  95. package/src/sap/ui/mdc/field/FieldInput.js +1 -1
  96. package/src/sap/ui/mdc/field/FieldInputRenderUtil.js +1 -1
  97. package/src/sap/ui/mdc/field/FieldMultiInput.js +1 -1
  98. package/src/sap/ui/mdc/field/ListFieldHelpItem.js +8 -29
  99. package/src/sap/ui/mdc/field/MultiValueFieldDelegate.js +2 -7
  100. package/src/sap/ui/mdc/field/MultiValueFieldItem.js +2 -6
  101. package/src/sap/ui/mdc/field/TokenDisplay.js +1 -1
  102. package/src/sap/ui/mdc/field/TokenizerDisplay.js +2 -1
  103. package/src/sap/ui/mdc/field/TokenizerDisplayRenderer.js +0 -4
  104. package/src/sap/ui/mdc/field/content/BooleanContent.js +2 -2
  105. package/src/sap/ui/mdc/field/content/ContentFactory.js +47 -35
  106. package/src/sap/ui/mdc/field/content/DateContent.js +49 -43
  107. package/src/sap/ui/mdc/field/content/DateTimeContent.js +2 -2
  108. package/src/sap/ui/mdc/field/content/DefaultContent.js +8 -8
  109. package/src/sap/ui/mdc/field/content/LinkContent.js +10 -6
  110. package/src/sap/ui/mdc/field/content/SearchContent.js +4 -4
  111. package/src/sap/ui/mdc/field/content/TimeContent.js +2 -2
  112. package/src/sap/ui/mdc/field/content/UnitContent.js +19 -11
  113. package/src/sap/ui/mdc/field/splitValue.js +45 -0
  114. package/src/sap/ui/mdc/filterbar/FilterBarBase.js +109 -218
  115. package/src/sap/ui/mdc/filterbar/IFilterContainer.js +22 -19
  116. package/src/sap/ui/mdc/filterbar/PropertyHelper.js +6 -7
  117. package/src/sap/ui/mdc/filterbar/aligned/FilterContainer.js +2 -4
  118. package/src/sap/ui/mdc/filterbar/aligned/FilterItemLayout.js +3 -7
  119. package/src/sap/ui/mdc/filterbar/p13n/AdaptationFilterBar.js +52 -41
  120. package/src/sap/ui/mdc/filterbar/p13n/FilterColumnLayout.js +2 -4
  121. package/src/sap/ui/mdc/filterbar/p13n/FilterGroupLayout.js +1 -3
  122. package/src/sap/ui/mdc/filterbar/p13n/TableContainer.js +4 -2
  123. package/src/sap/ui/mdc/filterbar/vh/FilterBar.js +14 -21
  124. package/src/sap/ui/mdc/filterbar/vh/FilterBarDelegate.js +1 -1
  125. package/src/sap/ui/mdc/flexibility/Chart.flexibility.js +1 -1
  126. package/src/sap/ui/mdc/flexibility/ChartItemFlex.js +2 -38
  127. package/src/sap/ui/mdc/flexibility/ColumnFlex.js +3 -3
  128. package/src/sap/ui/mdc/flexibility/ConditionFlex.js +11 -6
  129. package/src/sap/ui/mdc/flexibility/FilterBar.flexibility.js +1 -1
  130. package/src/sap/ui/mdc/flexibility/FilterItemFlex.js +2 -2
  131. package/src/sap/ui/mdc/flexibility/GroupFlex.js +11 -2
  132. package/src/sap/ui/mdc/flexibility/ItemBaseFlex.js +25 -9
  133. package/src/sap/ui/mdc/flexibility/SortFlex.js +11 -1
  134. package/src/sap/ui/mdc/flexibility/Util.js +2 -2
  135. package/src/sap/ui/mdc/flp/FlpLinkDelegate.js +7 -4
  136. package/src/sap/ui/mdc/library.js +178 -84
  137. package/src/sap/ui/mdc/link/ContactDetails.js +1 -1
  138. package/src/sap/ui/mdc/link/ContactDetailsAddressItem.js +1 -1
  139. package/src/sap/ui/mdc/link/ContactDetailsEmailItem.js +1 -1
  140. package/src/sap/ui/mdc/link/ContactDetailsItem.js +1 -1
  141. package/src/sap/ui/mdc/link/ContactDetailsPhoneItem.js +1 -1
  142. package/src/sap/ui/mdc/link/Factory.js +1 -1
  143. package/src/sap/ui/mdc/link/FakeFlpConnector.js +1 -1
  144. package/src/sap/ui/mdc/link/LinkItem.js +26 -5
  145. package/src/sap/ui/mdc/link/Panel.js +1 -1
  146. package/src/sap/ui/mdc/link/PanelItem.js +1 -1
  147. package/src/sap/ui/mdc/link/SemanticObjectMapping.js +1 -1
  148. package/src/sap/ui/mdc/link/SemanticObjectMappingItem.js +1 -1
  149. package/src/sap/ui/mdc/link/SemanticObjectUnavailableAction.js +1 -1
  150. package/src/sap/ui/mdc/messagebundle.properties +9 -0
  151. package/src/sap/ui/mdc/messagebundle_ar.properties +7 -1
  152. package/src/sap/ui/mdc/messagebundle_bg.properties +19 -13
  153. package/src/sap/ui/mdc/messagebundle_ca.properties +6 -0
  154. package/src/sap/ui/mdc/messagebundle_cs.properties +6 -0
  155. package/src/sap/ui/mdc/messagebundle_cy.properties +6 -0
  156. package/src/sap/ui/mdc/messagebundle_da.properties +6 -0
  157. package/src/sap/ui/mdc/messagebundle_de.properties +6 -0
  158. package/src/sap/ui/mdc/messagebundle_el.properties +13 -7
  159. package/src/sap/ui/mdc/messagebundle_en.properties +6 -0
  160. package/src/sap/ui/mdc/messagebundle_en_GB.properties +6 -0
  161. package/src/sap/ui/mdc/messagebundle_en_US_sappsd.properties +6 -0
  162. package/src/sap/ui/mdc/messagebundle_en_US_saprigi.properties +6 -0
  163. package/src/sap/ui/mdc/messagebundle_en_US_saptrc.properties +6 -0
  164. package/src/sap/ui/mdc/messagebundle_es.properties +6 -0
  165. package/src/sap/ui/mdc/messagebundle_es_MX.properties +6 -0
  166. package/src/sap/ui/mdc/messagebundle_et.properties +6 -0
  167. package/src/sap/ui/mdc/messagebundle_fi.properties +7 -1
  168. package/src/sap/ui/mdc/messagebundle_fr.properties +6 -0
  169. package/src/sap/ui/mdc/messagebundle_fr_CA.properties +10 -4
  170. package/src/sap/ui/mdc/messagebundle_hi.properties +6 -0
  171. package/src/sap/ui/mdc/messagebundle_hr.properties +15 -9
  172. package/src/sap/ui/mdc/messagebundle_hu.properties +8 -2
  173. package/src/sap/ui/mdc/messagebundle_id.properties +6 -0
  174. package/src/sap/ui/mdc/messagebundle_it.properties +10 -4
  175. package/src/sap/ui/mdc/messagebundle_iw.properties +6 -0
  176. package/src/sap/ui/mdc/messagebundle_ja.properties +14 -8
  177. package/src/sap/ui/mdc/messagebundle_kk.properties +16 -10
  178. package/src/sap/ui/mdc/messagebundle_ko.properties +9 -3
  179. package/src/sap/ui/mdc/messagebundle_lt.properties +6 -0
  180. package/src/sap/ui/mdc/messagebundle_lv.properties +6 -0
  181. package/src/sap/ui/mdc/messagebundle_ms.properties +9 -3
  182. package/src/sap/ui/mdc/messagebundle_nl.properties +7 -1
  183. package/src/sap/ui/mdc/messagebundle_no.properties +6 -0
  184. package/src/sap/ui/mdc/messagebundle_pl.properties +8 -2
  185. package/src/sap/ui/mdc/messagebundle_pt.properties +6 -0
  186. package/src/sap/ui/mdc/messagebundle_pt_PT.properties +6 -0
  187. package/src/sap/ui/mdc/messagebundle_ro.properties +6 -0
  188. package/src/sap/ui/mdc/messagebundle_ru.properties +6 -0
  189. package/src/sap/ui/mdc/messagebundle_sh.properties +6 -0
  190. package/src/sap/ui/mdc/messagebundle_sk.properties +8 -2
  191. package/src/sap/ui/mdc/messagebundle_sl.properties +6 -0
  192. package/src/sap/ui/mdc/messagebundle_sv.properties +6 -0
  193. package/src/sap/ui/mdc/messagebundle_th.properties +19 -13
  194. package/src/sap/ui/mdc/messagebundle_tr.properties +6 -0
  195. package/src/sap/ui/mdc/messagebundle_uk.properties +7 -1
  196. package/src/sap/ui/mdc/messagebundle_vi.properties +6 -0
  197. package/src/sap/ui/mdc/messagebundle_zh_CN.properties +7 -1
  198. package/src/sap/ui/mdc/messagebundle_zh_TW.properties +6 -0
  199. package/src/sap/ui/mdc/mixin/AdaptationMixin.js +1 -1
  200. package/src/sap/ui/mdc/mixin/DelegateMixin.js +33 -14
  201. package/src/sap/ui/mdc/mixin/FilterIntegrationMixin.js +3 -5
  202. package/src/sap/ui/mdc/mixin/PromiseMixin.js +1 -1
  203. package/src/sap/ui/mdc/mixin/PropertyHelperMixin.js +1 -1
  204. package/src/sap/ui/mdc/odata/TypeMap.js +155 -0
  205. package/src/sap/ui/mdc/odata/TypeUtil.js +42 -1
  206. package/src/sap/ui/mdc/odata/v4/ChartDelegate.js +17 -11
  207. package/src/sap/ui/mdc/odata/v4/FieldBaseDelegate.js +5 -50
  208. package/src/sap/ui/mdc/odata/v4/ODataMetaModelUtil.js +1 -1
  209. package/src/sap/ui/mdc/odata/v4/TableDelegate.js +156 -44
  210. package/src/sap/ui/mdc/odata/v4/TypeMap.js +70 -0
  211. package/src/sap/ui/mdc/odata/v4/TypeUtil.js +2 -1
  212. package/src/sap/ui/mdc/odata/v4/ValueHelpDelegate.js +8 -9
  213. package/src/sap/ui/mdc/odata/v4/vizChart/ChartDelegate.js +380 -390
  214. package/src/sap/ui/mdc/p13n/PropertyHelper.js +1 -1
  215. package/src/sap/ui/mdc/p13n/StateUtil.js +6 -19
  216. package/src/sap/ui/mdc/p13n/UIManager.js +1 -1
  217. package/src/sap/ui/mdc/p13n/panels/ChartItemPanel.js +43 -34
  218. package/src/sap/ui/mdc/p13n/panels/FilterPanel.js +3 -4
  219. package/src/sap/ui/mdc/p13n/subcontroller/FilterController.js +1 -1
  220. package/src/sap/ui/mdc/p13n/subcontroller/LinkPanelController.js +4 -6
  221. package/src/sap/ui/mdc/table/Column.js +45 -17
  222. package/src/sap/ui/mdc/table/ColumnSettings.js +2 -5
  223. package/src/sap/ui/mdc/table/CreationRow.js +4 -6
  224. package/src/sap/ui/mdc/table/GridTableType.js +31 -115
  225. package/src/sap/ui/mdc/table/PropertyHelper.js +56 -11
  226. package/src/sap/ui/mdc/table/ResponsiveColumnSettings.js +2 -5
  227. package/src/sap/ui/mdc/table/ResponsiveTableType.js +13 -84
  228. package/src/sap/ui/mdc/table/RowActionItem.js +9 -14
  229. package/src/sap/ui/mdc/table/RowSettings.js +2 -5
  230. package/src/sap/ui/mdc/table/TableSettings.js +23 -19
  231. package/src/sap/ui/mdc/table/TableTypeBase.js +43 -15
  232. package/src/sap/ui/mdc/table/TreeTableType.js +12 -32
  233. package/src/sap/ui/mdc/table/V4AnalyticsPropertyHelper.js +2 -5
  234. package/src/sap/ui/mdc/table/menu/Item.js +1 -1
  235. package/src/sap/ui/mdc/table/menu/QuickActionContainer.js +3 -3
  236. package/src/sap/ui/mdc/table/utils/Personalization.js +4 -4
  237. package/src/sap/ui/mdc/themes/base/ValueHelpDialog.less +6 -6
  238. package/src/sap/ui/mdc/util/DateUtil.js +15 -11
  239. package/src/sap/ui/mdc/util/FilterUtil.js +44 -19
  240. package/src/sap/ui/mdc/util/IdentifierUtil.js +0 -1
  241. package/src/sap/ui/mdc/util/InfoBar.js +1 -2
  242. package/src/sap/ui/mdc/util/PromiseCache.js +1 -1
  243. package/src/sap/ui/mdc/util/PropertyHelper.js +15 -8
  244. package/src/sap/ui/mdc/util/TypeMap.js +377 -0
  245. package/src/sap/ui/mdc/util/TypeUtil.js +35 -2
  246. package/src/sap/ui/mdc/util/mapVersions.js +225 -0
  247. package/src/sap/ui/mdc/valuehelp/Dialog.js +52 -33
  248. package/src/sap/ui/mdc/valuehelp/Popover.js +33 -35
  249. package/src/sap/ui/mdc/valuehelp/base/Container.js +193 -62
  250. package/src/sap/ui/mdc/valuehelp/base/Content.js +134 -57
  251. package/src/sap/ui/mdc/{field → valuehelp/base}/DefineConditionPanel.js +426 -197
  252. package/src/sap/ui/mdc/valuehelp/base/DialogTab.js +2 -2
  253. package/src/sap/ui/mdc/valuehelp/base/FilterableListContent.js +140 -47
  254. package/src/sap/ui/mdc/valuehelp/base/ListContent.js +11 -9
  255. package/src/sap/ui/mdc/valuehelp/content/Bool.js +11 -20
  256. package/src/sap/ui/mdc/valuehelp/content/Conditions.js +26 -32
  257. package/src/sap/ui/mdc/valuehelp/content/FixedList.js +14 -17
  258. package/src/sap/ui/mdc/valuehelp/content/FixedListItem.js +60 -0
  259. package/src/sap/ui/mdc/valuehelp/content/MDCTable.js +194 -199
  260. package/src/sap/ui/mdc/valuehelp/content/MTable.js +48 -51
  261. package/test/sap/ui/mdc/testutils/opa/chart/AssertionsViz.js +4 -4
  262. package/test/sap/ui/mdc/testutils/opa/field/Actions.js +1 -1
  263. package/test/sap/ui/mdc/testutils/opa/field/Assertions.js +3 -3
  264. package/test/sap/ui/mdc/testutils/opa/filterfield/Actions.js +4 -2
  265. package/test/sap/ui/mdc/testutils/opa/filterfield/Assertions.js +1 -1
  266. package/test/sap/ui/mdc/testutils/opa/table/Actions.js +41 -70
  267. package/test/sap/ui/mdc/testutils/opa/valueHelp/doWait.js +1 -1
  268. package/src/sap/ui/mdc/designtime/p13n/PersistenceProvider.designtime.js +0 -21
  269. package/src/sap/ui/mdc/util/FormatUtil.js +0 -82
@@ -7,12 +7,14 @@
7
7
  sap.ui.define([
8
8
  "sap/ui/base/Object",
9
9
  "sap/ui/base/DataType",
10
+ "sap/ui/core/Core",
10
11
  "sap/base/util/merge",
11
12
  "sap/base/util/isPlainObject",
12
13
  "sap/base/Log"
13
14
  ], function(
14
15
  BaseObject,
15
16
  DataType,
17
+ Core,
16
18
  merge,
17
19
  isPlainObject,
18
20
  Log
@@ -58,10 +60,7 @@ sap.ui.define([
58
60
  * @property {boolean} [caseSensitive=true]
59
61
  * Whether filtering by this property is case-sensitive.
60
62
  *
61
- * @private
62
- * @experimental
63
- * @ui5-restricted sap.fe
64
- * @MDC_PUBLIC_CANDIDATE
63
+ * @public
65
64
  */
66
65
 
67
66
  /*
@@ -272,6 +271,14 @@ sap.ui.define([
272
271
  }
273
272
 
274
273
  function reportInvalidProperty(sMessage, oAdditionalInfo) {
274
+ var mLoadedLibraries = Core.getLoadedLibraries();
275
+ if (!(window.top['sap-ui-mdc-config'] && window.top['sap-ui-mdc-config'].disableStrictPropertyInfoValidation)
276
+ && !("sap.fe.core" in mLoadedLibraries
277
+ || "sap.fe.macros" in mLoadedLibraries
278
+ || "sap.sac.df" in mLoadedLibraries)) {
279
+ throwInvalidPropertyError(sMessage, oAdditionalInfo);
280
+ }
281
+
275
282
  // TODO: warning is logged momentarily so that consumers can adapt to have valid property definitions
276
283
  // valid use case would be to throw an error
277
284
  if (Log.getLevel() < Log.WARNING) {
@@ -531,7 +538,7 @@ sap.ui.define([
531
538
  * @extends sap.ui.base.Object
532
539
  *
533
540
  * @author SAP SE
534
- * @version 1.113.0
541
+ * @version 1.115.0
535
542
  *
536
543
  * @private
537
544
  * @experimental
@@ -612,13 +619,13 @@ sap.ui.define([
612
619
  */
613
620
  PropertyHelper.prototype.validateProperty = function(oProperty, aProperties, aPreviousProperties) {
614
621
  if (!isPlainObject(oProperty)) {
615
- throwInvalidPropertyError("Property info must be a plain object.", oProperty);
622
+ throwInvalidPropertyError("Property info must be a plain object.");
616
623
  }
617
624
 
618
625
  validatePropertyDeep(this, oProperty, aProperties);
619
626
 
620
627
  if (PropertyHelper.isPropertyComplex(oProperty)) {
621
- if (oProperty.propertyInfos.length === 0) {
628
+ if (!oProperty.propertyInfos || oProperty.propertyInfos.length === 0) {
622
629
  throwInvalidPropertyError("Complex property does not reference existing properties.", oProperty);
623
630
  }
624
631
  }
@@ -678,7 +685,7 @@ sap.ui.define([
678
685
  var oUniquePropertiesSet = new Set(aPropertyNames);
679
686
 
680
687
  if (aPropertyNames.indexOf(oProperty.name) > -1) {
681
- throwInvalidPropertyError("Property references itself in the '" + sPath + "' attribute", oProperty);
688
+ throwInvalidPropertyError("Property references itself in the '" + sPath + "' attribute.", oProperty);
682
689
  }
683
690
 
684
691
  if (oUniquePropertiesSet.size !== aPropertyNames.length) {
@@ -0,0 +1,377 @@
1
+ /*!
2
+ * OpenUI5
3
+ * (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
4
+ * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
+ */
6
+
7
+ sap.ui.define([
8
+ 'sap/ui/mdc/enums/BaseType',
9
+ 'sap/ui/model/SimpleType',
10
+ 'sap/base/util/ObjectPath',
11
+ 'sap/ui/mdc/util/DateUtil',
12
+ 'sap/base/util/merge'
13
+ ], function(
14
+ BaseType, SimpleType, ObjectPath, DateUtil, merge
15
+ ) {
16
+ "use strict";
17
+
18
+ var sDatePattern = "yyyy-MM-dd";
19
+ var sTimePattern = "HH:mm:ss";
20
+
21
+ var _cache = new WeakMap(); // We do not want to share Maps with derived TypeMaps
22
+
23
+ /**
24
+ * Configuration class for type-handling in MDC delegates.
25
+ * Allows mapping of model-types to <code>sap.ui.mdc.enums.BaseType</code> and enables model-specific type configuration.
26
+ *
27
+ * <b>Note:</b>
28
+ * This utility is experimental and the API/behavior is not finalized and hence this should not be used for productive usage.
29
+ *
30
+ * @namespace
31
+ * @author SAP SE
32
+ * @public
33
+ * @since 1.114.0
34
+ * @alias module:sap/ui/mdc/util/TypeMap
35
+ */
36
+ var TypeMap = {};
37
+
38
+ /*
39
+ * Gets values of the internal map, treating string values as references to other keys (aliases)
40
+ */
41
+ TypeMap._get = function (sType) {
42
+ var vEntry = this._getMap().get(sType);
43
+ if (typeof vEntry === "string") {
44
+ return this._get(vEntry);
45
+ } else if (vEntry) {
46
+ return [sType, vEntry];
47
+ }
48
+ };
49
+
50
+ /*
51
+ * Updates the internal map's values, if not suppressed by TypeMap.freeze()
52
+ */
53
+ TypeMap._set = function (sKey, vValue) {
54
+ var oMap = this._getMap();
55
+ if (oMap._bFrozen) {
56
+ throw "TypeMap: You must not modify a frozen TypeMap";
57
+ }
58
+ oMap.set(sKey, vValue);
59
+ };
60
+
61
+ /*
62
+ * As derived typemaps want to act as singletons with separate data-sets, we provide a context based cache for each map's internal data.
63
+ * Please also see <code>sap.ui.mdc.util.TypeMap.import</code>
64
+ */
65
+ TypeMap._getMap = function () {
66
+ var oMap = _cache.get(this);
67
+ if (!oMap) {
68
+ oMap = new Map();
69
+ _cache.set(this, oMap);
70
+ }
71
+ return oMap;
72
+ };
73
+
74
+ /**
75
+ * Sets a BaseType and an optional model- or scenario-specific configuration method for a given sap.ui.model.SimpleType ObjectPath string
76
+ *
77
+ * As default <code>string</code> is returned.
78
+ *
79
+ * @final
80
+ * @param {string} sType Objectpath string for sap.ui.model.SimpleType
81
+ * @param {sap.ui.mdc.enums.BaseType|function} vBaseType BaseType fitting the given sType or method returning a BaseType based on type configuration
82
+ * @param {function} [fnOptions] Optional customizing method for formatoptions and constraints. See <code>sap.ui.mdc.DefaultTypeMap</code> for examples.
83
+ * @public
84
+ */
85
+ TypeMap.set = function (sType, vBaseType, fnOptions) {
86
+ this._set(sType, [vBaseType, fnOptions]);
87
+ };
88
+
89
+ /**
90
+ * Allows alternative identifiers for Types, such as "Boolean" for "sap.ui.model.type.Boolean"
91
+ *
92
+ * @final
93
+ * @param {string} sType Objectpath string for sap.ui.model.SimpleType
94
+ * @param {string} sAlias Alternative identifier for sType
95
+ * @public
96
+ */
97
+ TypeMap.setAlias = function (sType, sAlias) {
98
+ this._set(sType, sAlias);
99
+ };
100
+
101
+ /**
102
+ * Returns the <code>sap.ui.mdc.enums.BaseType</code> or a method to resolve the BaseType dynamically for the given type
103
+ *
104
+ * @param {string} sType Objectpath string for sap.ui.model.SimpleType
105
+ * @returns {sap.ui.mdc.enums.BaseType|function} BaseType configured for the sap.ui.model.SimpleType or function to resolve BaseType based on configuration
106
+ * @private
107
+ */
108
+ TypeMap._getBaseType = function (sType) {
109
+ var aResult = this._get(sType);
110
+ return aResult && aResult[1][0];
111
+ };
112
+
113
+ /**
114
+ * Returns the optional customizing method configured for a sap.ui.model.SimpleType
115
+ *
116
+ * @param {string} sType Objectpath string for sap.ui.model.SimpleType
117
+ * @returns {function} Method for model-specific type configuration. See <code>sap.ui.mdc.DefaultTypeMap</code> for examples.
118
+ * @private
119
+ */
120
+ TypeMap._getOptions = function (sType) {
121
+ var aResult = this._get(sType);
122
+ return aResult && aResult[1][1];
123
+ };
124
+
125
+ /**
126
+ * Returns the ObjectPath string for a given type alias.
127
+ *
128
+ * @param {string} sAlias Identifier for a configured Type Alias
129
+ * @returns {string} Objectpath string for sap.ui.model.SimpleType
130
+ * @private
131
+ */
132
+ TypeMap._getClass = function (sAlias) {
133
+ var aResult = this._get(sAlias);
134
+ return aResult && aResult[0];
135
+ };
136
+
137
+ /**
138
+ * Exports the TypeMap's current data
139
+ *
140
+ * @final
141
+ * @returns {Array} Array created from this TypeMap's internal map
142
+ * @public
143
+ */
144
+ TypeMap.export = function () {
145
+ return Array.from(this._getMap());
146
+ };
147
+
148
+ /**
149
+ * Imports a TypeMap's data into another TypeMap
150
+ *
151
+ * @final
152
+ * @param {sap.ui.mdc.util.TypeMap} oTypeMap TypeMap to import
153
+ * @public
154
+ */
155
+ TypeMap.import = function (oTypeMap) {
156
+ oTypeMap.export().forEach(function (aEntry) {
157
+ this._getMap().set(aEntry[0], aEntry[1]);
158
+ }.bind(this));
159
+ };
160
+
161
+ /**
162
+ * Prevents further manipulation of a TypeMap's data
163
+ *
164
+ * @final
165
+ * @public
166
+ */
167
+ TypeMap.freeze = function () {
168
+ this._getMap()._bFrozen = true;
169
+ };
170
+
171
+
172
+
173
+ // <!-- TypeUtil functionality -->
174
+
175
+ /**
176
+ * @final
177
+ * @param {string} sType Given type string or sap.ui.model.SimpleType
178
+ * @param {object} oFormatOptions Used <code>FormatOptions</code>
179
+ * @param {object} oConstraints Used <code>Constraints</code>
180
+ * @returns {sap.ui.mdc.enums.BaseType} output <code>Date</code>, <code>DateTime</code> or <code>Time</code>...
181
+ * @public
182
+ */
183
+ TypeMap.getBaseType = function(sType, oFormatOptions, oConstraints) {
184
+ var vBaseType = this._getBaseType(sType);
185
+ return vBaseType && (typeof vBaseType === "function" ? vBaseType(oFormatOptions, oConstraints) : vBaseType) || BaseType.String;
186
+ };
187
+
188
+ /**
189
+ * @final
190
+ * @param {sap.ui.model.SimpleType} oType Given type string or sap.ui.model.SimpleType
191
+ * @returns {string} output <code>Date</code>, <code>DateTime</code> or <code>Time</code>...
192
+ * @public
193
+ */
194
+ TypeMap.getBaseTypeForType = function(oType) {
195
+ return this.getBaseType(oType.getMetadata && oType.getMetadata().getName(), oType.getFormatOptions(), oType.getConstraints());
196
+ };
197
+
198
+ /**
199
+ * @final
200
+ * @param {string} sType Given model specific type
201
+ * @returns {string} Data type name
202
+ * @public
203
+ */
204
+ TypeMap.getDataTypeClassName = function(sType) {
205
+ return this._getClass(sType) || sType;
206
+ };
207
+
208
+ /**
209
+ * @final
210
+ * @param {string} sDataType Class path as string where each name is separated by '.'
211
+ * @returns {sap.ui.model.SimpleType} creates returns a dataType class
212
+ * @public
213
+ */
214
+ TypeMap.getDataTypeClass = function(sDataType) {
215
+ var TypeClass = ObjectPath.get(this.getDataTypeClassName(sDataType) || "");
216
+ if (!TypeClass) {
217
+ throw new Error("DataType '" + sDataType + "' cannot be determined");
218
+ }
219
+ return TypeClass;
220
+ };
221
+
222
+ /**
223
+ * @final
224
+ * @param {string} sDataType Class path as string where each name is separated by '.'
225
+ * @param {object} [oFormatOptions] formatoptions for the dataType
226
+ * @param {object} [oConstraints] constraints for the dataType
227
+ * @param {object} [oOptions] Additional options for overrides
228
+ * @returns {sap.ui.model.SimpleType} creates returns an instance of the resolved dataType
229
+ * @public
230
+ */
231
+ TypeMap.getDataTypeInstance = function(sDataType, oFormatOptions, oConstraints, oOptions) {
232
+ var TypeClass = this.getDataTypeClass(sDataType);
233
+ var fnOptions = this._getOptions(TypeClass.getMetadata().getName());
234
+ var aOverrides = fnOptions && fnOptions(merge({}, oFormatOptions), merge({}, oConstraints), oOptions);
235
+ oFormatOptions = aOverrides && aOverrides[0] || oFormatOptions;
236
+ oConstraints = aOverrides && aOverrides[1] || oConstraints;
237
+ return new TypeClass(oFormatOptions, oConstraints);
238
+ };
239
+
240
+ /**
241
+ * @final
242
+ * @param {string|sap.ui.model.SimpleType} vType Given dataType as string or type
243
+ * @param {object} [oFormatOptions] formatoptions for the given dataType
244
+ * @param {object} [oConstraints] constraints for the given dataType
245
+ * @returns {sap.ui.mdc.TypeConfig} output returns typeConfig object
246
+ * @public
247
+ */
248
+ TypeMap.getTypeConfig = function(vType, oFormatOptions, oConstraints) {
249
+ var oType = this._normalizeType.call(this, vType, oFormatOptions, oConstraints);
250
+ return {
251
+ className: oType.getMetadata().getName(),
252
+ typeInstance: oType,
253
+ baseType: this.getBaseTypeForType(oType)
254
+ };
255
+ };
256
+
257
+ /**
258
+ * @final
259
+ * @param {object} vValue typed value
260
+ * @param {string|sap.ui.model.SimpleType} vType Data type considered for conversion
261
+ * @param {object} [oFormatOptions] formatoptions for the dataType
262
+ * @param {object} [oConstraints] constraints for the dataType
263
+ * @returns {string} converted value
264
+ * @public
265
+ */
266
+ TypeMap.externalizeValue = function(vValue, vType, oFormatOptions, oConstraints) {
267
+ var oTypeInstance = this._normalizeType.call(this, vType, oFormatOptions, oConstraints);
268
+ var sBaseType = this.getBaseTypeForType(oTypeInstance);
269
+ switch (sBaseType) {
270
+ case BaseType.DateTime:
271
+ return DateUtil.typeToISO(vValue, oTypeInstance, sBaseType);
272
+
273
+ case BaseType.Date:
274
+ return DateUtil.typeToString(vValue, oTypeInstance, sDatePattern);
275
+
276
+ case BaseType.Time:
277
+ return DateUtil.typeToString(vValue, oTypeInstance, sTimePattern);
278
+
279
+ case BaseType.Boolean:
280
+ return vValue;
281
+
282
+ case BaseType.Numeric:
283
+ if (typeof vValue !== "string" && (oTypeInstance.getMetadata().getName() === "sap.ui.model.odata.type.Int64" || oTypeInstance.getMetadata().getName() === "sap.ui.model.odata.type.Decimal")) {
284
+ // INT64 and Decimal parsed always to string, if for some reason a number comes in -> convert to string, but don't use type at this might have locale dependent formatting
285
+ return vValue.toString();
286
+ }
287
+ return vValue;
288
+
289
+ default:
290
+ // just use type to convert
291
+ return oTypeInstance.formatValue(vValue, "string");
292
+ }
293
+ };
294
+
295
+ /**
296
+ * @final
297
+ * @param {string} vValue externalized value
298
+ * @param {string|sap.ui.model.SimpleType} vType Data type considered for conversion
299
+ * @param {object} [oFormatOptions] formatoptions for the dataType
300
+ * @param {object} [oConstraints] constraints for the dataType
301
+ * @returns {object} converted value
302
+ * @public
303
+ */
304
+ TypeMap.internalizeValue = function(vValue, vType, oFormatOptions, oConstraints) {
305
+ var oTypeInstance = this._normalizeType.call(this, vType, oFormatOptions, oConstraints);
306
+ var sBaseType = this.getBaseTypeForType(oTypeInstance);
307
+ switch (sBaseType) {
308
+ case BaseType.DateTime:
309
+ // eslint-disable-next-line new-cap
310
+ return DateUtil.ISOToType(vValue, oTypeInstance, sBaseType);
311
+
312
+ case BaseType.Date:
313
+ if (vValue.indexOf("T") >= 0) { // old variant with DateTime for DateValues
314
+ vValue = vValue.substr(0, vValue.indexOf("T")); // just take the date part
315
+ }
316
+ return DateUtil.stringToType(vValue, oTypeInstance, sDatePattern);
317
+
318
+ case BaseType.Time:
319
+ return DateUtil.stringToType(vValue, oTypeInstance, sTimePattern);
320
+
321
+ case BaseType.Boolean:
322
+ return vValue;
323
+
324
+ case BaseType.Numeric:
325
+ if (typeof vValue !== "string" && (oTypeInstance.getMetadata().getName() === "sap.ui.model.odata.type.Int64" || oTypeInstance.getMetadata().getName() === "sap.ui.model.odata.type.Decimal")) {
326
+ // INT64 and Decimal parsed always to string, if for some reason a number comes in -> convert to string, but don't use type at this might have locale dependent formatting
327
+ return vValue.toString();
328
+ }
329
+ return vValue;
330
+
331
+ default:
332
+ // just use type to convert
333
+ return oTypeInstance.parseValue(vValue, "string");
334
+ }
335
+ };
336
+
337
+ TypeMap._normalizeType = function (vType, oFormatOptions, oConstraints) {
338
+ if (vType instanceof SimpleType) { // simpletype
339
+ return vType;
340
+ }
341
+ return this.getDataTypeInstance(vType, oFormatOptions, oConstraints); // string
342
+ };
343
+
344
+ /**
345
+ * If the <code>Field</code> control is used, the used data type comes from the binding.
346
+ * Some data types (like Currency or Unit) might need some initialization.
347
+ * To initialize the internal ("cloned") Type later on, the result of this function
348
+ * is provided to <code>initializeInternalType</code>.
349
+ *
350
+ * @param {sap.ui.model.SimpleType} oType Type from binding
351
+ * @param {any} vValue Given value
352
+ * @returns {null|object} Information needed to initialize internal type
353
+ * @private
354
+ * @ui5-restricted sap.ui.mdc.field.FieldBase
355
+ * @since 1.115.0
356
+ */
357
+ TypeMap.initializeTypeFromValue = function(oType, vValue) {
358
+
359
+ return {}; // to mark initialization as finished as not needed for normal types
360
+
361
+ };
362
+
363
+ /**
364
+ * This function initializes the internal ("cloned") Type.
365
+ *
366
+ * @param {sap.ui.model.SimpleType} oType original Type (e.g. from Binding)
367
+ * @param {object} oTypeInitialization Information needed to initialize internal type (created in <code>initializeTypeFromValue</code>)
368
+ * @private
369
+ * @ui5-restricted sap.ui.mdc.field.FieldBase
370
+ * @since 1.115.0
371
+ */
372
+ TypeMap.initializeInternalType = function(oType, oTypeInitialization) {
373
+
374
+ };
375
+
376
+ return TypeMap;
377
+ });
@@ -5,7 +5,7 @@
5
5
  */
6
6
 
7
7
  sap.ui.define([
8
- 'sap/ui/mdc/enum/BaseType',
8
+ 'sap/ui/mdc/enums/BaseType',
9
9
  'sap/base/util/ObjectPath',
10
10
  'sap/base/util/isEmptyObject',
11
11
  'sap/base/util/merge',
@@ -28,6 +28,7 @@ sap.ui.define([
28
28
  * @ui5-restricted sap.ui.mdc, sap.fe
29
29
  * @experimental As of version 1.79
30
30
  * @since 1.79.0
31
+ * @deprecated (since 1.115.0) - please see {@link sap.ui.mdc.BaseDelegate.getTypeMap}
31
32
  * @alias sap.ui.mdc.util.TypeUtil
32
33
  */
33
34
  var TypeUtil = {
@@ -70,7 +71,7 @@ sap.ui.define([
70
71
  * @param {string} sType Given type string or sap.ui.model.SimpleType
71
72
  * @param {object} oFormatOptions Used <code>FormatOptions</code>
72
73
  * @param {object} oConstraints Used <code>Constraints</code>
73
- * @returns {sap.ui.mdc.enum.BaseType} output <code>Date</code>, <code>DateTime</code> or <code>Time</code>...
74
+ * @returns {sap.ui.mdc.enums.BaseType} output <code>Date</code>, <code>DateTime</code> or <code>Time</code>...
74
75
  * @private
75
76
  * @ui5-restricted sap.ui.mdc
76
77
  */
@@ -292,6 +293,38 @@ sap.ui.define([
292
293
  oFormatOptions.showNumber = bShowNumber;
293
294
  oFormatOptions.showMeasure = bShowMeasure;
294
295
  oFormatOptions.strictParsing = true; // do not allow to enter unit in number field
296
+ },
297
+
298
+ /**
299
+ * If the <code>Field</code> control is used, the used data type comes from the binding.
300
+ * Some data types (like Currency or Unit) might need some initialization. To initialize
301
+ * To initialize the internal ("cloned") Type later on, the result of this function
302
+ * is provided to <code>initializeInternalType</code>.
303
+ *
304
+ * @param {sap.ui.model.SimpleType} oType Type from binding
305
+ * @param {any} vValue Given value
306
+ * @returns {null|object} Information needed to initialize internal type
307
+ * @private
308
+ * @ui5-restricted sap.ui.mdc.field.FieldBase
309
+ * @since 1.115.0
310
+ */
311
+ initializeTypeFromValue: function(oType, vValue) {
312
+
313
+ return {}; // to mark initialization as finished as not needed for normal types
314
+
315
+ },
316
+
317
+ /**
318
+ * This function initializes the internal ("cloned") Type.
319
+ *
320
+ * @param {sap.ui.model.SimpleType} oType original Type (e.g. from Binding)
321
+ * @param {object} oTypeInitialization Information needed to initialize internal type (created in <code>initializeTypeFromValue</code>)
322
+ * @private
323
+ * @ui5-restricted sap.ui.mdc.field.FieldBase
324
+ * @since 1.115.0
325
+ */
326
+ initializeInternalType: function(oType, oTypeInitialization) {
327
+
295
328
  }
296
329
  };
297
330