@sapui5/sap.fe.core 1.97.0 → 1.99.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 (249) hide show
  1. package/package.json +5 -4
  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 +6 -3
  6. package/src/sap/fe/core/AppStateHandler.js +229 -181
  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 -2379
  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 -807
  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 +64 -0
  24. package/src/sap/fe/core/TransactionHelper.js +1576 -1579
  25. package/src/sap/fe/core/TransactionHelper.ts +1706 -0
  26. package/src/sap/fe/core/actions/draft.js +560 -581
  27. package/src/sap/fe/core/actions/draft.ts +594 -0
  28. package/src/sap/fe/core/actions/messageHandling.js +545 -511
  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 -1211
  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 +229 -260
  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 +27 -23
  41. package/src/sap/fe/core/controllerextensions/InternalRouting.js +82 -46
  42. package/src/sap/fe/core/controllerextensions/KPIManagement.js +113 -25
  43. package/src/sap/fe/core/controllerextensions/KPIManagement.ts +135 -44
  44. package/src/sap/fe/core/controllerextensions/MassEdit.js +172 -0
  45. package/src/sap/fe/core/controllerextensions/MessageHandler.js +22 -9
  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 +22 -8
  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 +3 -2
  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 +3 -2
  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 +1 -1
  75. package/src/sap/fe/core/converters/ManifestSettings.ts +4 -0
  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 +67 -6
  79. package/src/sap/fe/core/converters/MetaModelConverter.ts +70 -14
  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 +33 -21
  85. package/src/sap/fe/core/converters/controls/Common/Action.js +11 -2
  86. package/src/sap/fe/core/converters/controls/Common/Action.ts +8 -2
  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 +20 -10
  92. package/src/sap/fe/core/converters/controls/Common/Form.ts +24 -4
  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 +390 -398
  96. package/src/sap/fe/core/converters/controls/Common/Table.ts +497 -484
  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 +17 -9
  104. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +24 -9
  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/IssueManager.js +7 -1
  108. package/src/sap/fe/core/converters/helpers/IssueManager.ts +6 -0
  109. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +4 -4
  110. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +3 -3
  111. package/src/sap/fe/core/converters/templates/ListReportConverter.js +13 -6
  112. package/src/sap/fe/core/converters/templates/ListReportConverter.ts +26 -15
  113. package/src/sap/fe/core/designtime/AppComponent.designtime.js +11 -2
  114. package/src/sap/fe/core/formatters/CriticalityFormatter.js +1 -1
  115. package/src/sap/fe/core/formatters/CriticalityFormatter.ts +1 -1
  116. package/src/sap/fe/core/formatters/FPMFormatter.js +1 -1
  117. package/src/sap/fe/core/formatters/FPMFormatter.ts +4 -10
  118. package/src/sap/fe/core/formatters/KPIFormatter.js +1 -1
  119. package/src/sap/fe/core/formatters/KPIFormatter.ts +3 -1
  120. package/src/sap/fe/core/formatters/TableFormatter.js +39 -28
  121. package/src/sap/fe/core/formatters/TableFormatter.ts +43 -28
  122. package/src/sap/fe/core/formatters/ValueFormatter.js +30 -5
  123. package/src/sap/fe/core/formatters/ValueFormatter.ts +30 -7
  124. package/src/sap/fe/core/fpm/Component.js +3 -2
  125. package/src/sap/fe/core/helpers/AppStartupHelper.js +359 -0
  126. package/src/sap/fe/core/helpers/AppStartupHelper.ts +391 -0
  127. package/src/sap/fe/core/helpers/BindingExpression.js +484 -437
  128. package/src/sap/fe/core/helpers/BindingExpression.ts +480 -463
  129. package/src/sap/fe/core/helpers/ClassSupport.js +27 -15
  130. package/src/sap/fe/core/helpers/ClassSupport.ts +31 -20
  131. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +63 -59
  132. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +56 -0
  133. package/src/sap/fe/core/helpers/EditState.js +81 -84
  134. package/src/sap/fe/core/helpers/EditState.ts +81 -0
  135. package/src/sap/fe/core/helpers/ExcelFormatHelper.js +62 -48
  136. package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +49 -0
  137. package/src/sap/fe/core/helpers/FPMHelper.js +52 -56
  138. package/src/sap/fe/core/helpers/FPMHelper.ts +62 -0
  139. package/src/sap/fe/core/helpers/KeepAliveHelper.js +4 -5
  140. package/src/sap/fe/core/helpers/KeepAliveHelper.ts +10 -10
  141. package/src/sap/fe/core/helpers/MassEditHelper.js +687 -0
  142. package/src/sap/fe/core/helpers/ModelHelper.js +229 -225
  143. package/src/sap/fe/core/helpers/ModelHelper.ts +227 -0
  144. package/src/sap/fe/core/helpers/PasteHelper.js +210 -132
  145. package/src/sap/fe/core/helpers/PasteHelper.ts +196 -0
  146. package/src/sap/fe/core/helpers/SemanticDateOperators.js +332 -313
  147. package/src/sap/fe/core/helpers/SemanticDateOperators.ts +330 -0
  148. package/src/sap/fe/core/helpers/SemanticKeyHelper.js +66 -67
  149. package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +73 -0
  150. package/src/sap/fe/core/helpers/StableIdHelper.js +4 -7
  151. package/src/sap/fe/core/helpers/StableIdHelper.ts +2 -6
  152. package/src/sap/fe/core/jsx-runtime/jsx.js +1 -1
  153. package/src/sap/fe/core/jsx-runtime/jsx.ts +1 -1
  154. package/src/sap/fe/core/library.js +30 -3
  155. package/src/sap/fe/core/library.support.js +12 -5
  156. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +62 -0
  157. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +66 -0
  158. package/src/sap/fe/core/messagebundle.properties +61 -13
  159. package/src/sap/fe/core/messagebundle_ar.properties +33 -2
  160. package/src/sap/fe/core/messagebundle_bg.properties +33 -2
  161. package/src/sap/fe/core/messagebundle_ca.properties +33 -2
  162. package/src/sap/fe/core/messagebundle_cs.properties +34 -3
  163. package/src/sap/fe/core/messagebundle_cy.properties +33 -2
  164. package/src/sap/fe/core/messagebundle_da.properties +33 -2
  165. package/src/sap/fe/core/messagebundle_de.properties +33 -2
  166. package/src/sap/fe/core/messagebundle_el.properties +33 -2
  167. package/src/sap/fe/core/messagebundle_en.properties +32 -1
  168. package/src/sap/fe/core/messagebundle_en_GB.properties +32 -1
  169. package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +36 -1
  170. package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +33 -2
  171. package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +33 -2
  172. package/src/sap/fe/core/messagebundle_es.properties +33 -2
  173. package/src/sap/fe/core/messagebundle_es_MX.properties +33 -2
  174. package/src/sap/fe/core/messagebundle_et.properties +33 -2
  175. package/src/sap/fe/core/messagebundle_fi.properties +34 -3
  176. package/src/sap/fe/core/messagebundle_fr.properties +38 -7
  177. package/src/sap/fe/core/messagebundle_fr_CA.properties +33 -2
  178. package/src/sap/fe/core/messagebundle_hi.properties +33 -2
  179. package/src/sap/fe/core/messagebundle_hr.properties +33 -2
  180. package/src/sap/fe/core/messagebundle_hu.properties +34 -3
  181. package/src/sap/fe/core/messagebundle_id.properties +36 -5
  182. package/src/sap/fe/core/messagebundle_it.properties +33 -2
  183. package/src/sap/fe/core/messagebundle_iw.properties +33 -2
  184. package/src/sap/fe/core/messagebundle_ja.properties +33 -2
  185. package/src/sap/fe/core/messagebundle_kk.properties +33 -2
  186. package/src/sap/fe/core/messagebundle_ko.properties +33 -2
  187. package/src/sap/fe/core/messagebundle_lt.properties +33 -2
  188. package/src/sap/fe/core/messagebundle_lv.properties +33 -2
  189. package/src/sap/fe/core/messagebundle_ms.properties +33 -2
  190. package/src/sap/fe/core/messagebundle_nl.properties +33 -2
  191. package/src/sap/fe/core/messagebundle_no.properties +33 -2
  192. package/src/sap/fe/core/messagebundle_pl.properties +33 -2
  193. package/src/sap/fe/core/messagebundle_pt.properties +34 -3
  194. package/src/sap/fe/core/messagebundle_pt_PT.properties +33 -2
  195. package/src/sap/fe/core/messagebundle_ro.properties +33 -2
  196. package/src/sap/fe/core/messagebundle_ru.properties +33 -2
  197. package/src/sap/fe/core/messagebundle_sh.properties +33 -2
  198. package/src/sap/fe/core/messagebundle_sk.properties +33 -2
  199. package/src/sap/fe/core/messagebundle_sl.properties +33 -2
  200. package/src/sap/fe/core/messagebundle_sv.properties +34 -3
  201. package/src/sap/fe/core/messagebundle_th.properties +33 -2
  202. package/src/sap/fe/core/messagebundle_tr.properties +33 -2
  203. package/src/sap/fe/core/messagebundle_uk.properties +33 -2
  204. package/src/sap/fe/core/messagebundle_vi.properties +33 -2
  205. package/src/sap/fe/core/messagebundle_zh_CN.properties +33 -2
  206. package/src/sap/fe/core/messagebundle_zh_TW.properties +33 -2
  207. package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +2 -2
  208. package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +3 -1
  209. package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +269 -202
  210. package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +212 -0
  211. package/src/sap/fe/core/services/EnvironmentServiceFactory.js +4 -3
  212. package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +9 -5
  213. package/src/sap/fe/core/services/NavigationServiceFactory.js +406 -300
  214. package/src/sap/fe/core/services/NavigationServiceFactory.ts +316 -0
  215. package/src/sap/fe/core/services/ResourceModelServiceFactory.js +149 -81
  216. package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +80 -0
  217. package/src/sap/fe/core/services/RoutingServiceFactory.js +987 -1152
  218. package/src/sap/fe/core/services/RoutingServiceFactory.ts +898 -0
  219. package/src/sap/fe/core/services/ShellServicesFactory.js +31 -2
  220. package/src/sap/fe/core/services/ShellServicesFactory.ts +45 -11
  221. package/src/sap/fe/core/services/SideEffectsServiceFactory.js +42 -85
  222. package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +57 -100
  223. package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +461 -478
  224. package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +453 -0
  225. package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +10 -8
  226. package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +8 -0
  227. package/src/sap/fe/core/support/AnnotationIssue.support.js +15 -3
  228. package/src/sap/fe/core/support/AnnotationIssue.support.ts +16 -2
  229. package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.js +2 -2
  230. package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.ts +1 -1
  231. package/src/sap/fe/core/support/InvalidAnnotationColumnKey.support.js +38 -0
  232. package/src/sap/fe/core/support/InvalidAnnotationColumnKey.support.ts +18 -0
  233. package/src/sap/fe/core/templating/DataModelPathHelper.js +10 -48
  234. package/src/sap/fe/core/templating/DataModelPathHelper.ts +14 -46
  235. package/src/sap/fe/core/templating/DisplayModeFormatter.js +114 -0
  236. package/src/sap/fe/core/templating/DisplayModeFormatter.ts +86 -0
  237. package/src/sap/fe/core/templating/FieldControlHelper.js +8 -8
  238. package/src/sap/fe/core/templating/FieldControlHelper.ts +25 -7
  239. package/src/sap/fe/core/templating/FilterHelper.js +139 -70
  240. package/src/sap/fe/core/templating/FilterHelper.ts +140 -70
  241. package/src/sap/fe/core/templating/PropertyHelper.js +2 -2
  242. package/src/sap/fe/core/templating/PropertyHelper.ts +1 -1
  243. package/src/sap/fe/core/templating/UIFormatters.js +45 -110
  244. package/src/sap/fe/core/templating/UIFormatters.ts +39 -75
  245. package/src/sap/fe/core/type/Email.js +1 -1
  246. package/src/sap/fe/core/type/Email.ts +4 -6
  247. package/ui5.yaml +0 -3
  248. package/src/sap/fe/core/controls/filterbar.d.js +0 -8
  249. package/src/sap/fe/core/controls/filterbar.d.ts +0 -0
@@ -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,51 +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.String": {
106
- constraints: {
107
- "@com.sap.vocabularies.Common.v1.IsDigitSequence": "isDigitSequence",
108
- "$MaxLength": "maxLength",
109
- "$Nullable": "nullable"
110
- },
111
- type: "sap.ui.model.odata.type.String"
112
- },
113
- "Edm.TimeOfDay": {
114
- constraints: {
115
- "$Precision": "precision"
116
- },
117
- type: "sap.ui.model.odata.type.TimeOfDay"
118
- }
119
- };
120
-
121
87
  /**
122
88
  * Create the expression to generate an "editable" boolean value.
123
89
  *
@@ -289,34 +255,6 @@ export const ifUnitEditable = function(
289
255
  return compileBinding(ifElse(editableExpression, sEditableValue, sNonEditableValue));
290
256
  };
291
257
 
292
- export type DisplayMode = "Value" | "Description" | "DescriptionValue" | "ValueDescription";
293
- export const getDisplayMode = function(oPropertyPath: PropertyOrPath<Property>, oDataModelObjectPath?: DataModelObjectPath): DisplayMode {
294
- if (!oPropertyPath || typeof oPropertyPath === "string") {
295
- return "Value";
296
- }
297
- const oProperty = (isPathExpression(oPropertyPath) && oPropertyPath.$target) || (oPropertyPath as Property);
298
- const oEntityType = oDataModelObjectPath && oDataModelObjectPath.targetEntityType;
299
- const oTextAnnotation = oProperty.annotations?.Common?.Text;
300
- const oTextArrangementAnnotation =
301
- (typeof oTextAnnotation !== "string" && oTextAnnotation?.annotations?.UI?.TextArrangement?.toString()) ||
302
- oEntityType?.annotations?.UI?.TextArrangement?.toString();
303
-
304
- let sDisplayValue = oTextAnnotation ? "DescriptionValue" : "Value";
305
- if ((oTextAnnotation && oTextArrangementAnnotation) || oEntityType?.annotations?.UI?.TextArrangement?.toString()) {
306
- if (oTextArrangementAnnotation === "UI.TextArrangementType/TextOnly") {
307
- sDisplayValue = "Description";
308
- } else if (oTextArrangementAnnotation === "UI.TextArrangementType/TextLast") {
309
- sDisplayValue = "ValueDescription";
310
- } else if (oTextArrangementAnnotation === "UI.TextArrangementType/TextSeparate") {
311
- sDisplayValue = "Value";
312
- } else {
313
- //Default should be TextFirst if there is a Text annotation and neither TextOnly nor TextLast are set
314
- sDisplayValue = "DescriptionValue";
315
- }
316
- }
317
- return sDisplayValue as DisplayMode;
318
- };
319
-
320
258
  export const getFieldDisplay = function(
321
259
  oPropertyPath: PropertyOrPath<Property>,
322
260
  sTargetDisplayMode: string,
@@ -558,3 +496,29 @@ export const isCollectionField = function(oDataModelPath: DataModelObjectPath):
558
496
  }
559
497
  return false;
560
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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkVtYWlsLnRzIl0sIm5hbWVzIjpbImVtYWlsVzNDUmVnZXhwIiwiRW1haWxUeXBlIiwiT0RhdGFTdHJpbmdUeXBlIiwiZXh0ZW5kIiwidmFsaWRhdGVWYWx1ZSIsInNWYWx1ZSIsInRlc3QiLCJWYWxpZGF0ZUV4Y2VwdGlvbiIsInNhcCIsInVp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6IHN0cmluZykge1xuXHRcdGlmICghZW1haWxXM0NSZWdleHAudGVzdChzVmFsdWUpKSB7XG5cdFx0XHR0aHJvdyBuZXcgVmFsaWRhdGVFeGNlcHRpb24oXG5cdFx0XHRcdChzYXAudWkuZ2V0Q29yZSgpLmdldExpYnJhcnlSZXNvdXJjZUJ1bmRsZShcInNhcC5mZS5jb3JlXCIpIGFzIFJlc291cmNlQnVuZGxlKS5nZXRUZXh0KFwiVF9FTUFJTFRZUEVfSU5WQUxJRF9WQUxVRVwiKVxuXHRcdFx0KTtcblx0XHR9XG5cdFx0T0RhdGFTdHJpbmdUeXBlLnByb3RvdHlwZS52YWxpZGF0ZVZhbHVlLmFwcGx5KHRoaXMsIFtzVmFsdWVdKTtcblx0fVxufSk7XG5leHBvcnQgZGVmYXVsdCBFbWFpbFR5cGU7XG4iXX0=
@@ -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:
@@ -1,8 +0,0 @@
1
- /*!
2
- * SAP UI development toolkit for HTML5 (SAPUI5)
3
- * (c) Copyright 2009-2021 SAP SE. All rights reserved
4
- */
5
- sap.ui.define([], function () {
6
- "use strict";
7
- }, false);
8
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZpbHRlcmJhci5kLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiLiIsInNvdXJjZXNDb250ZW50IjpbIiJdfQ==
File without changes