@sapui5/sap.fe.core 1.96.4 → 1.99.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 (253) hide show
  1. package/package.json +6 -5
  2. package/src/sap/fe/core/.library +1 -1
  3. package/src/sap/fe/core/AnnotationHelper.js +377 -405
  4. package/src/sap/fe/core/AnnotationHelper.ts +385 -0
  5. package/src/sap/fe/core/AppComponent.js +5 -3
  6. package/src/sap/fe/core/AppStateHandler.js +229 -195
  7. package/src/sap/fe/core/AppStateHandler.ts +171 -0
  8. package/src/sap/fe/core/BaseController.js +3 -2
  9. package/src/sap/fe/core/BusyLocker.js +105 -121
  10. package/src/sap/fe/core/BusyLocker.ts +98 -0
  11. package/src/sap/fe/core/CommonUtils.js +2073 -2606
  12. package/src/sap/fe/core/CommonUtils.ts +2078 -0
  13. package/src/sap/fe/core/ExtensionAPI.js +16 -7
  14. package/src/sap/fe/core/PageController.js +84 -119
  15. package/src/sap/fe/core/PageController.ts +101 -0
  16. package/src/sap/fe/core/RouterProxy.js +986 -809
  17. package/src/sap/fe/core/RouterProxy.ts +838 -0
  18. package/src/sap/fe/core/Synchronization.js +51 -35
  19. package/src/sap/fe/core/Synchronization.ts +29 -0
  20. package/src/sap/fe/core/TemplateComponent.js +173 -155
  21. package/src/sap/fe/core/TemplateComponent.ts +166 -0
  22. package/src/sap/fe/core/TemplateModel.js +97 -54
  23. package/src/sap/fe/core/TemplateModel.ts +63 -0
  24. package/src/sap/fe/core/TransactionHelper.js +1576 -1627
  25. package/src/sap/fe/core/TransactionHelper.ts +1706 -0
  26. package/src/sap/fe/core/actions/draft.js +559 -581
  27. package/src/sap/fe/core/actions/draft.ts +593 -0
  28. package/src/sap/fe/core/actions/messageHandling.js +545 -435
  29. package/src/sap/fe/core/actions/messageHandling.ts +532 -0
  30. package/src/sap/fe/core/actions/nonDraft.js +17 -19
  31. package/src/sap/fe/core/actions/nonDraft.ts +12 -0
  32. package/src/sap/fe/core/actions/operations.js +1074 -1192
  33. package/src/sap/fe/core/actions/operations.ts +1162 -0
  34. package/src/sap/fe/core/actions/sticky.js +102 -105
  35. package/src/sap/fe/core/actions/sticky.ts +102 -0
  36. package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +3 -2
  37. package/src/sap/fe/core/controllerextensions/EditFlow.js +235 -264
  38. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +3 -2
  39. package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +288 -13
  40. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +35 -25
  41. package/src/sap/fe/core/controllerextensions/InternalRouting.js +79 -46
  42. package/src/sap/fe/core/controllerextensions/KPIManagement.js +86 -10
  43. package/src/sap/fe/core/controllerextensions/KPIManagement.ts +109 -31
  44. package/src/sap/fe/core/controllerextensions/MassEdit.js +172 -0
  45. package/src/sap/fe/core/controllerextensions/MessageHandler.js +237 -104
  46. package/src/sap/fe/core/controllerextensions/PageReady.js +3 -3
  47. package/src/sap/fe/core/controllerextensions/PageReady.ts +12 -8
  48. package/src/sap/fe/core/controllerextensions/Paginator.js +37 -9
  49. package/src/sap/fe/core/controllerextensions/Placeholder.js +8 -4
  50. package/src/sap/fe/core/controllerextensions/Routing.js +25 -5
  51. package/src/sap/fe/core/controllerextensions/RoutingListener.js +3 -2
  52. package/src/sap/fe/core/controllerextensions/Share.js +3 -2
  53. package/src/sap/fe/core/controllerextensions/SideEffects.js +9 -9
  54. package/src/sap/fe/core/controllerextensions/SideEffects.ts +22 -21
  55. package/src/sap/fe/core/controllerextensions/ViewState.js +36 -8
  56. package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +2 -1
  57. package/src/sap/fe/core/controls/CommandExecution.js +3 -2
  58. package/src/sap/fe/core/controls/ConditionalWrapper.js +3 -2
  59. package/src/sap/fe/core/controls/CustomQuickViewPage.js +112 -113
  60. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +9 -5
  61. package/src/sap/fe/core/controls/FieldWrapper.js +18 -23
  62. package/src/sap/fe/core/controls/FilterBar.js +3 -2
  63. package/src/sap/fe/core/controls/FormElementWrapper.js +3 -7
  64. package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +3 -2
  65. package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +2 -1
  66. package/src/sap/fe/core/controls/filterbar/FilterContainer.js +3 -2
  67. package/src/sap/fe/core/controls/filterbar/VisualFilter.js +5 -4
  68. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +3 -2
  69. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +3 -2
  70. package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +106 -0
  71. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +79 -0
  72. package/src/sap/fe/core/converters/ConverterContext.js +14 -2
  73. package/src/sap/fe/core/converters/ConverterContext.ts +14 -3
  74. package/src/sap/fe/core/converters/ManifestSettings.js +2 -1
  75. package/src/sap/fe/core/converters/ManifestSettings.ts +8 -1
  76. package/src/sap/fe/core/converters/ManifestWrapper.js +56 -32
  77. package/src/sap/fe/core/converters/ManifestWrapper.ts +24 -6
  78. package/src/sap/fe/core/converters/MetaModelConverter.js +76 -6
  79. package/src/sap/fe/core/converters/MetaModelConverter.ts +79 -15
  80. package/src/sap/fe/core/converters/TemplateConverter.js +1 -1
  81. package/src/sap/fe/core/converters/TemplateConverter.ts +2 -2
  82. package/src/sap/fe/core/converters/annotations/DataField.js +3 -3
  83. package/src/sap/fe/core/converters/annotations/DataField.ts +1 -1
  84. package/src/sap/fe/core/converters/common/AnnotationConverter.js +85 -46
  85. package/src/sap/fe/core/converters/controls/Common/Action.js +16 -4
  86. package/src/sap/fe/core/converters/controls/Common/Action.ts +14 -5
  87. package/src/sap/fe/core/converters/controls/Common/Chart.js +5 -3
  88. package/src/sap/fe/core/converters/controls/Common/Chart.ts +11 -3
  89. package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +3 -3
  90. package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +2 -2
  91. package/src/sap/fe/core/converters/controls/Common/Form.js +60 -19
  92. package/src/sap/fe/core/converters/controls/Common/Form.ts +66 -14
  93. package/src/sap/fe/core/converters/controls/Common/KPI.js +69 -4
  94. package/src/sap/fe/core/converters/controls/Common/KPI.ts +72 -0
  95. package/src/sap/fe/core/converters/controls/Common/Table.js +503 -399
  96. package/src/sap/fe/core/converters/controls/Common/Table.ts +615 -480
  97. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +527 -0
  98. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +655 -0
  99. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +489 -37
  100. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +506 -58
  101. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +2 -2
  102. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +1 -1
  103. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +6 -6
  104. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +9 -15
  105. package/src/sap/fe/core/converters/helpers/Aggregation.js +18 -3
  106. package/src/sap/fe/core/converters/helpers/Aggregation.ts +28 -5
  107. package/src/sap/fe/core/converters/helpers/ID.js +9 -1
  108. package/src/sap/fe/core/converters/helpers/ID.ts +4 -0
  109. package/src/sap/fe/core/converters/helpers/IssueManager.js +7 -1
  110. package/src/sap/fe/core/converters/helpers/IssueManager.ts +6 -0
  111. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +4 -4
  112. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +3 -3
  113. package/src/sap/fe/core/converters/templates/ListReportConverter.js +29 -11
  114. package/src/sap/fe/core/converters/templates/ListReportConverter.ts +36 -20
  115. package/src/sap/fe/core/designtime/AppComponent.designtime.js +13 -3
  116. package/src/sap/fe/core/formatters/CriticalityFormatter.js +1 -1
  117. package/src/sap/fe/core/formatters/CriticalityFormatter.ts +1 -1
  118. package/src/sap/fe/core/formatters/FPMFormatter.js +1 -1
  119. package/src/sap/fe/core/formatters/FPMFormatter.ts +4 -10
  120. package/src/sap/fe/core/formatters/KPIFormatter.js +1 -1
  121. package/src/sap/fe/core/formatters/KPIFormatter.ts +3 -1
  122. package/src/sap/fe/core/formatters/TableFormatter.js +65 -31
  123. package/src/sap/fe/core/formatters/TableFormatter.ts +62 -30
  124. package/src/sap/fe/core/formatters/ValueFormatter.js +30 -5
  125. package/src/sap/fe/core/formatters/ValueFormatter.ts +30 -7
  126. package/src/sap/fe/core/fpm/Component.js +3 -2
  127. package/src/sap/fe/core/helpers/AppStartupHelper.js +359 -0
  128. package/src/sap/fe/core/helpers/AppStartupHelper.ts +391 -0
  129. package/src/sap/fe/core/helpers/BindingExpression.js +479 -464
  130. package/src/sap/fe/core/helpers/BindingExpression.ts +477 -483
  131. package/src/sap/fe/core/helpers/ClassSupport.js +27 -15
  132. package/src/sap/fe/core/helpers/ClassSupport.ts +31 -20
  133. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +63 -59
  134. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +56 -0
  135. package/src/sap/fe/core/helpers/EditState.js +81 -84
  136. package/src/sap/fe/core/helpers/EditState.ts +81 -0
  137. package/src/sap/fe/core/helpers/ExcelFormatHelper.js +62 -48
  138. package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +49 -0
  139. package/src/sap/fe/core/helpers/FPMHelper.js +52 -56
  140. package/src/sap/fe/core/helpers/FPMHelper.ts +62 -0
  141. package/src/sap/fe/core/helpers/KeepAliveHelper.js +210 -0
  142. package/src/sap/fe/core/helpers/KeepAliveHelper.ts +202 -0
  143. package/src/sap/fe/core/helpers/KeepAliveRefreshTypes.js +32 -0
  144. package/src/sap/fe/core/helpers/KeepAliveRefreshTypes.ts +36 -0
  145. package/src/sap/fe/core/helpers/MassEditHelper.js +687 -0
  146. package/src/sap/fe/core/helpers/ModelHelper.js +229 -174
  147. package/src/sap/fe/core/helpers/ModelHelper.ts +227 -0
  148. package/src/sap/fe/core/helpers/PasteHelper.js +210 -132
  149. package/src/sap/fe/core/helpers/PasteHelper.ts +196 -0
  150. package/src/sap/fe/core/helpers/SemanticDateOperators.js +332 -313
  151. package/src/sap/fe/core/helpers/SemanticDateOperators.ts +330 -0
  152. package/src/sap/fe/core/helpers/SemanticKeyHelper.js +66 -67
  153. package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +73 -0
  154. package/src/sap/fe/core/helpers/StableIdHelper.js +4 -7
  155. package/src/sap/fe/core/helpers/StableIdHelper.ts +2 -6
  156. package/src/sap/fe/core/jsx-runtime/jsx.js +1 -1
  157. package/src/sap/fe/core/jsx-runtime/jsx.ts +1 -1
  158. package/src/sap/fe/core/library.js +30 -3
  159. package/src/sap/fe/core/library.support.js +12 -5
  160. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +62 -0
  161. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +66 -0
  162. package/src/sap/fe/core/messagebundle.properties +72 -10
  163. package/src/sap/fe/core/messagebundle_ar.properties +41 -0
  164. package/src/sap/fe/core/messagebundle_bg.properties +41 -0
  165. package/src/sap/fe/core/messagebundle_ca.properties +41 -0
  166. package/src/sap/fe/core/messagebundle_cs.properties +42 -1
  167. package/src/sap/fe/core/messagebundle_cy.properties +41 -0
  168. package/src/sap/fe/core/messagebundle_da.properties +41 -0
  169. package/src/sap/fe/core/messagebundle_de.properties +41 -0
  170. package/src/sap/fe/core/messagebundle_el.properties +41 -0
  171. package/src/sap/fe/core/messagebundle_en.properties +41 -0
  172. package/src/sap/fe/core/messagebundle_en_GB.properties +41 -0
  173. package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +41 -0
  174. package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +35 -0
  175. package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +41 -0
  176. package/src/sap/fe/core/messagebundle_es.properties +41 -0
  177. package/src/sap/fe/core/messagebundle_es_MX.properties +41 -0
  178. package/src/sap/fe/core/messagebundle_et.properties +41 -0
  179. package/src/sap/fe/core/messagebundle_fi.properties +41 -0
  180. package/src/sap/fe/core/messagebundle_fr.properties +46 -5
  181. package/src/sap/fe/core/messagebundle_fr_CA.properties +41 -0
  182. package/src/sap/fe/core/messagebundle_hi.properties +41 -0
  183. package/src/sap/fe/core/messagebundle_hr.properties +41 -0
  184. package/src/sap/fe/core/messagebundle_hu.properties +42 -1
  185. package/src/sap/fe/core/messagebundle_id.properties +45 -4
  186. package/src/sap/fe/core/messagebundle_it.properties +41 -0
  187. package/src/sap/fe/core/messagebundle_iw.properties +41 -0
  188. package/src/sap/fe/core/messagebundle_ja.properties +50 -9
  189. package/src/sap/fe/core/messagebundle_kk.properties +41 -0
  190. package/src/sap/fe/core/messagebundle_ko.properties +41 -0
  191. package/src/sap/fe/core/messagebundle_lt.properties +41 -0
  192. package/src/sap/fe/core/messagebundle_lv.properties +41 -0
  193. package/src/sap/fe/core/messagebundle_ms.properties +41 -0
  194. package/src/sap/fe/core/messagebundle_nl.properties +41 -0
  195. package/src/sap/fe/core/messagebundle_no.properties +41 -0
  196. package/src/sap/fe/core/messagebundle_pl.properties +41 -0
  197. package/src/sap/fe/core/messagebundle_pt.properties +43 -2
  198. package/src/sap/fe/core/messagebundle_pt_PT.properties +41 -0
  199. package/src/sap/fe/core/messagebundle_ro.properties +41 -0
  200. package/src/sap/fe/core/messagebundle_ru.properties +41 -0
  201. package/src/sap/fe/core/messagebundle_sh.properties +41 -0
  202. package/src/sap/fe/core/messagebundle_sk.properties +41 -0
  203. package/src/sap/fe/core/messagebundle_sl.properties +41 -0
  204. package/src/sap/fe/core/messagebundle_sv.properties +42 -1
  205. package/src/sap/fe/core/messagebundle_th.properties +41 -0
  206. package/src/sap/fe/core/messagebundle_tr.properties +41 -0
  207. package/src/sap/fe/core/messagebundle_uk.properties +41 -0
  208. package/src/sap/fe/core/messagebundle_vi.properties +41 -0
  209. package/src/sap/fe/core/messagebundle_zh_CN.properties +41 -0
  210. package/src/sap/fe/core/messagebundle_zh_TW.properties +41 -0
  211. package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +2 -2
  212. package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +3 -1
  213. package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +269 -202
  214. package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +212 -0
  215. package/src/sap/fe/core/services/EnvironmentServiceFactory.js +4 -3
  216. package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +9 -5
  217. package/src/sap/fe/core/services/NavigationServiceFactory.js +406 -300
  218. package/src/sap/fe/core/services/NavigationServiceFactory.ts +316 -0
  219. package/src/sap/fe/core/services/ResourceModelServiceFactory.js +149 -81
  220. package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +80 -0
  221. package/src/sap/fe/core/services/RoutingServiceFactory.js +987 -1166
  222. package/src/sap/fe/core/services/RoutingServiceFactory.ts +898 -0
  223. package/src/sap/fe/core/services/ShellServicesFactory.js +31 -2
  224. package/src/sap/fe/core/services/ShellServicesFactory.ts +45 -11
  225. package/src/sap/fe/core/services/SideEffectsServiceFactory.js +41 -84
  226. package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +56 -99
  227. package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +461 -478
  228. package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +453 -0
  229. package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +10 -8
  230. package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +8 -0
  231. package/src/sap/fe/core/support/AnnotationIssue.support.js +15 -3
  232. package/src/sap/fe/core/support/AnnotationIssue.support.ts +16 -2
  233. package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.js +2 -2
  234. package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.ts +1 -1
  235. package/src/sap/fe/core/support/InvalidAnnotationColumnKey.support.js +38 -0
  236. package/src/sap/fe/core/support/InvalidAnnotationColumnKey.support.ts +18 -0
  237. package/src/sap/fe/core/templating/DataModelPathHelper.js +6 -24
  238. package/src/sap/fe/core/templating/DataModelPathHelper.ts +10 -23
  239. package/src/sap/fe/core/templating/DisplayModeFormatter.js +114 -0
  240. package/src/sap/fe/core/templating/DisplayModeFormatter.ts +86 -0
  241. package/src/sap/fe/core/templating/EntitySetHelper.js +80 -7
  242. package/src/sap/fe/core/templating/EntitySetHelper.ts +42 -2
  243. package/src/sap/fe/core/templating/FieldControlHelper.js +8 -8
  244. package/src/sap/fe/core/templating/FieldControlHelper.ts +25 -7
  245. package/src/sap/fe/core/templating/FilterHelper.js +139 -70
  246. package/src/sap/fe/core/templating/FilterHelper.ts +140 -70
  247. package/src/sap/fe/core/templating/PropertyHelper.js +2 -2
  248. package/src/sap/fe/core/templating/PropertyHelper.ts +1 -1
  249. package/src/sap/fe/core/templating/UIFormatters.js +45 -113
  250. package/src/sap/fe/core/templating/UIFormatters.ts +39 -76
  251. package/src/sap/fe/core/type/Email.js +1 -1
  252. package/src/sap/fe/core/type/Email.ts +4 -6
  253. package/ui5.yaml +0 -3
@@ -1,4 +1,4 @@
1
- import { Context } from "sap/ui/model/odata/v4";
1
+ import Context from "sap/ui/model/odata/v4/Context";
2
2
  import { convertMetaModelContext, getInvolvedDataModelObjects } from "sap/fe/core/converters/MetaModelConverter";
3
3
  import {
4
4
  addTypeInformation,
@@ -37,9 +37,20 @@ import {
37
37
  isPathUpdatable,
38
38
  getPathRelativeLocation
39
39
  } from "sap/fe/core/templating/DataModelPathHelper";
40
- import { isReadOnlyExpression, isNonEditableExpression, isDisabledExpression } from "sap/fe/core/templating/FieldControlHelper";
40
+ import {
41
+ isReadOnlyExpression,
42
+ isNonEditableExpression,
43
+ isDisabledExpression,
44
+ isRequiredExpression
45
+ } from "sap/fe/core/templating/FieldControlHelper";
41
46
  import valueFormatters from "sap/fe/core/formatters/ValueFormatter";
42
47
  import { DataFieldAbstractTypes } from "@sap-ux/vocabularies-types";
48
+ import * as DisplayModeFormatter from "sap/fe/core/templating/DisplayModeFormatter";
49
+
50
+ // Import-export method used by the converter to use them in the templating through the UIFormatters.
51
+ export type DisplayMode = DisplayModeFormatter.DisplayMode;
52
+ export const getDisplayMode = DisplayModeFormatter.getDisplayMode;
53
+ export const EDM_TYPE_MAPPING = DisplayModeFormatter.EDM_TYPE_MAPPING;
43
54
 
44
55
  export type PropertyOrPath<P> = string | P | PathAnnotationExpression<P>;
45
56
  export type MetaModelContext = {
@@ -73,52 +84,6 @@ export type configType = {
73
84
  formatOptions: configTypeformatOptions;
74
85
  };
75
86
 
76
- export const EDM_TYPE_MAPPING: Record<string, any> = {
77
- "Edm.Boolean": { type: "sap.ui.model.odata.type.Boolean" },
78
- "Edm.Byte": { type: "sap.ui.model.odata.type.Byte" },
79
- "Edm.Date": { type: "sap.ui.model.odata.type.Date" },
80
- "Edm.DateTimeOffset": {
81
- constraints: {
82
- "$Precision": "precision"
83
- },
84
- type: "sap.ui.model.odata.type.DateTimeOffset"
85
- },
86
- "Edm.Decimal": {
87
- constraints: {
88
- "@Org.OData.Validation.V1.Minimum/$Decimal": "minimum",
89
- "@Org.OData.Validation.V1.Minimum@Org.OData.Validation.V1.Exclusive": "minimumExclusive",
90
- "@Org.OData.Validation.V1.Maximum/$Decimal": "maximum",
91
- "@Org.OData.Validation.V1.Maximum@Org.OData.Validation.V1.Exclusive": "maximumExclusive",
92
- "$Precision": "precision",
93
- "$Scale": "scale"
94
- },
95
- type: "sap.ui.model.odata.type.Decimal"
96
- },
97
- "Edm.Double": { type: "sap.ui.model.odata.type.Double" },
98
- "Edm.Guid": { type: "sap.ui.model.odata.type.Guid" },
99
- "Edm.Int16": { type: "sap.ui.model.odata.type.Int16" },
100
- "Edm.Int32": { type: "sap.ui.model.odata.type.Int32" },
101
- "Edm.Int64": { type: "sap.ui.model.odata.type.Int64" },
102
- "Edm.SByte": { type: "sap.ui.model.odata.type.SByte" },
103
- "Edm.Single": { type: "sap.ui.model.odata.type.Single" },
104
- "Edm.Stream": { type: "sap.ui.model.odata.type.Stream" },
105
- "Edm.Binary": { type: "sap.ui.model.odata.type.Stream" },
106
- "Edm.String": {
107
- constraints: {
108
- "@com.sap.vocabularies.Common.v1.IsDigitSequence": "isDigitSequence",
109
- "$MaxLength": "maxLength",
110
- "$Nullable": "nullable"
111
- },
112
- type: "sap.ui.model.odata.type.String"
113
- },
114
- "Edm.TimeOfDay": {
115
- constraints: {
116
- "$Precision": "precision"
117
- },
118
- type: "sap.ui.model.odata.type.TimeOfDay"
119
- }
120
- };
121
-
122
87
  /**
123
88
  * Create the expression to generate an "editable" boolean value.
124
89
  *
@@ -290,34 +255,6 @@ export const ifUnitEditable = function(
290
255
  return compileBinding(ifElse(editableExpression, sEditableValue, sNonEditableValue));
291
256
  };
292
257
 
293
- export type DisplayMode = "Value" | "Description" | "DescriptionValue" | "ValueDescription";
294
- export const getDisplayMode = function(oPropertyPath: PropertyOrPath<Property>, oDataModelObjectPath?: DataModelObjectPath): DisplayMode {
295
- if (!oPropertyPath || typeof oPropertyPath === "string") {
296
- return "Value";
297
- }
298
- const oProperty = (isPathExpression(oPropertyPath) && oPropertyPath.$target) || (oPropertyPath as Property);
299
- const oEntityType = oDataModelObjectPath && oDataModelObjectPath.targetEntityType;
300
- const oTextAnnotation = oProperty.annotations?.Common?.Text;
301
- const oTextArrangementAnnotation =
302
- (typeof oTextAnnotation !== "string" && oTextAnnotation?.annotations?.UI?.TextArrangement?.toString()) ||
303
- oEntityType?.annotations?.UI?.TextArrangement?.toString();
304
-
305
- let sDisplayValue = oTextAnnotation ? "DescriptionValue" : "Value";
306
- if ((oTextAnnotation && oTextArrangementAnnotation) || oEntityType?.annotations?.UI?.TextArrangement?.toString()) {
307
- if (oTextArrangementAnnotation === "UI.TextArrangementType/TextOnly") {
308
- sDisplayValue = "Description";
309
- } else if (oTextArrangementAnnotation === "UI.TextArrangementType/TextLast") {
310
- sDisplayValue = "ValueDescription";
311
- } else if (oTextArrangementAnnotation === "UI.TextArrangementType/TextSeparate") {
312
- sDisplayValue = "Value";
313
- } else {
314
- //Default should be TextFirst if there is a Text annotation and neither TextOnly nor TextLast are set
315
- sDisplayValue = "DescriptionValue";
316
- }
317
- }
318
- return sDisplayValue as DisplayMode;
319
- };
320
-
321
258
  export const getFieldDisplay = function(
322
259
  oPropertyPath: PropertyOrPath<Property>,
323
260
  sTargetDisplayMode: string,
@@ -559,3 +496,29 @@ export const isCollectionField = function(oDataModelPath: DataModelObjectPath):
559
496
  }
560
497
  return false;
561
498
  };
499
+
500
+ export const getRequiredExpression = function(
501
+ oPropertyPath: PropertyOrPath<Property>,
502
+ oDataFieldConverted?: any,
503
+ forceEditMode: boolean = false,
504
+ bAsObject: boolean = false
505
+ ): BindingExpression<boolean> | ExpressionOrPrimitive<boolean> {
506
+ if (!oPropertyPath || typeof oPropertyPath === "string") {
507
+ return compileBinding(false);
508
+ }
509
+
510
+ let dataFieldRequiredExpression: BindingExpression<boolean> | ExpressionOrPrimitive<boolean> = true;
511
+ if (oDataFieldConverted !== null) {
512
+ dataFieldRequiredExpression = isRequiredExpression(oDataFieldConverted);
513
+ }
514
+
515
+ const oProperty: Property = (isPathExpression(oPropertyPath) && oPropertyPath.$target) || (oPropertyPath as Property);
516
+ // Enablement depends on the field control expression
517
+ // If the Field control is statically in Inapplicable (disabled) -> not enabled
518
+ const requiredExpression = isRequiredExpression(oProperty);
519
+ const editMode = forceEditMode || UI.IsEditable;
520
+ if (bAsObject) {
521
+ return and(or(requiredExpression, dataFieldRequiredExpression), editMode);
522
+ }
523
+ return compileBinding(and(or(requiredExpression, dataFieldRequiredExpression), editMode));
524
+ };
@@ -17,4 +17,4 @@ sap.ui.define(["sap/ui/model/odata/type/String", "sap/ui/model/ValidateException
17
17
  });
18
18
  return EmailType;
19
19
  }, false);
20
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzI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qKy89P15fYHt8fX4tXStAW2EtekEtWjAtOS1dKyg/Oi5bYS16QS1aMC05LV0rKSokLztcbmNvbnN0IEVtYWlsVHlwZSA9IE9EYXRhU3RyaW5nVHlwZS5leHRlbmQoXCJzYXAuZmUuY29yZS50eXBlLkVtYWlsXCIsIHtcblx0dmFsaWRhdGVWYWx1ZShzVmFsdWU6IHN0cmluZykge1xuXHRcdGlmICghZW1haWxXM0NSZWdleHAudGVzdChzVmFsdWUpKSB7XG5cdFx0XHR0aHJvdyBuZXcgVmFsaWRhdGVFeGNlcHRpb24oXG5cdFx0XHRcdChzYXAudWkuZ2V0Q29yZSgpLmdldExpYnJhcnlSZXNvdXJjZUJ1bmRsZShcInNhcC5mZS5jb3JlXCIpIGFzIFJlc291cmNlQnVuZGxlKS5nZXRUZXh0KFwiVF9FTUFJTFRZUEVfSU5WQUxJRF9WQUxVRVwiKVxuXHRcdFx0KTtcblx0XHR9XG5cdFx0T0RhdGFTdHJpbmdUeXBlLnByb3RvdHlwZS52YWxpZGF0ZVZhbHVlLmFwcGx5KHRoaXMsIFtzVmFsdWVdKTtcblx0fVxufSk7XG5leHBvcnQgZGVmYXVsdCBFbWFpbFR5cGU7XG4iXX0=
@@ -1,15 +1,13 @@
1
- import { String as ODataStringType } from "sap/ui/model/odata/type";
2
- import { ValidateException } from "sap/ui/model";
1
+ import ResourceBundle from "sap/base/i18n/ResourceBundle";
2
+ import ODataStringType from "sap/ui/model/odata/type/String";
3
+ import ValidateException from "sap/ui/model/ValidateException";
3
4
 
4
5
  const emailW3CRegexp = /^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$/;
5
6
  const EmailType = ODataStringType.extend("sap.fe.core.type.Email", {
6
7
  validateValue(sValue: string) {
7
8
  if (!emailW3CRegexp.test(sValue)) {
8
9
  throw new ValidateException(
9
- sap.ui
10
- .getCore()
11
- .getLibraryResourceBundle("sap.fe.core")
12
- .getText("T_EMAILTYPE_INVALID_VALUE")
10
+ (sap.ui.getCore().getLibraryResourceBundle("sap.fe.core") as ResourceBundle).getText("T_EMAILTYPE_INVALID_VALUE")
13
11
  );
14
12
  }
15
13
  ODataStringType.prototype.validateValue.apply(this, [sValue]);
package/ui5.yaml CHANGED
@@ -3,9 +3,6 @@ type: library
3
3
  metadata:
4
4
  sapInternal: true
5
5
  name: sap.fe.core
6
- copyright: |-
7
- SAPUI5
8
- * (c) Copyright 2009-${currentYear} SAP SE. All rights reserved.
9
6
  framework:
10
7
  name: SAPUI5
11
8
  libraries: