@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.
- package/package.json +6 -5
- package/src/sap/fe/core/.library +1 -1
- package/src/sap/fe/core/AnnotationHelper.js +377 -405
- package/src/sap/fe/core/AnnotationHelper.ts +385 -0
- package/src/sap/fe/core/AppComponent.js +5 -3
- package/src/sap/fe/core/AppStateHandler.js +229 -195
- package/src/sap/fe/core/AppStateHandler.ts +171 -0
- package/src/sap/fe/core/BaseController.js +3 -2
- package/src/sap/fe/core/BusyLocker.js +105 -121
- package/src/sap/fe/core/BusyLocker.ts +98 -0
- package/src/sap/fe/core/CommonUtils.js +2073 -2606
- package/src/sap/fe/core/CommonUtils.ts +2078 -0
- package/src/sap/fe/core/ExtensionAPI.js +16 -7
- package/src/sap/fe/core/PageController.js +84 -119
- package/src/sap/fe/core/PageController.ts +101 -0
- package/src/sap/fe/core/RouterProxy.js +986 -809
- package/src/sap/fe/core/RouterProxy.ts +838 -0
- package/src/sap/fe/core/Synchronization.js +51 -35
- package/src/sap/fe/core/Synchronization.ts +29 -0
- package/src/sap/fe/core/TemplateComponent.js +173 -155
- package/src/sap/fe/core/TemplateComponent.ts +166 -0
- package/src/sap/fe/core/TemplateModel.js +97 -54
- package/src/sap/fe/core/TemplateModel.ts +63 -0
- package/src/sap/fe/core/TransactionHelper.js +1576 -1627
- package/src/sap/fe/core/TransactionHelper.ts +1706 -0
- package/src/sap/fe/core/actions/draft.js +559 -581
- package/src/sap/fe/core/actions/draft.ts +593 -0
- package/src/sap/fe/core/actions/messageHandling.js +545 -435
- package/src/sap/fe/core/actions/messageHandling.ts +532 -0
- package/src/sap/fe/core/actions/nonDraft.js +17 -19
- package/src/sap/fe/core/actions/nonDraft.ts +12 -0
- package/src/sap/fe/core/actions/operations.js +1074 -1192
- package/src/sap/fe/core/actions/operations.ts +1162 -0
- package/src/sap/fe/core/actions/sticky.js +102 -105
- package/src/sap/fe/core/actions/sticky.ts +102 -0
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +3 -2
- package/src/sap/fe/core/controllerextensions/EditFlow.js +235 -264
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +3 -2
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +288 -13
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +35 -25
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +79 -46
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +86 -10
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +109 -31
- package/src/sap/fe/core/controllerextensions/MassEdit.js +172 -0
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +237 -104
- package/src/sap/fe/core/controllerextensions/PageReady.js +3 -3
- package/src/sap/fe/core/controllerextensions/PageReady.ts +12 -8
- package/src/sap/fe/core/controllerextensions/Paginator.js +37 -9
- package/src/sap/fe/core/controllerextensions/Placeholder.js +8 -4
- package/src/sap/fe/core/controllerextensions/Routing.js +25 -5
- package/src/sap/fe/core/controllerextensions/RoutingListener.js +3 -2
- package/src/sap/fe/core/controllerextensions/Share.js +3 -2
- package/src/sap/fe/core/controllerextensions/SideEffects.js +9 -9
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +22 -21
- package/src/sap/fe/core/controllerextensions/ViewState.js +36 -8
- package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +2 -1
- package/src/sap/fe/core/controls/CommandExecution.js +3 -2
- package/src/sap/fe/core/controls/ConditionalWrapper.js +3 -2
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +112 -113
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +9 -5
- package/src/sap/fe/core/controls/FieldWrapper.js +18 -23
- package/src/sap/fe/core/controls/FilterBar.js +3 -2
- package/src/sap/fe/core/controls/FormElementWrapper.js +3 -7
- package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +3 -2
- package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +2 -1
- package/src/sap/fe/core/controls/filterbar/FilterContainer.js +3 -2
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +5 -4
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +3 -2
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +3 -2
- package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +106 -0
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +79 -0
- package/src/sap/fe/core/converters/ConverterContext.js +14 -2
- package/src/sap/fe/core/converters/ConverterContext.ts +14 -3
- package/src/sap/fe/core/converters/ManifestSettings.js +2 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +8 -1
- package/src/sap/fe/core/converters/ManifestWrapper.js +56 -32
- package/src/sap/fe/core/converters/ManifestWrapper.ts +24 -6
- package/src/sap/fe/core/converters/MetaModelConverter.js +76 -6
- package/src/sap/fe/core/converters/MetaModelConverter.ts +79 -15
- package/src/sap/fe/core/converters/TemplateConverter.js +1 -1
- package/src/sap/fe/core/converters/TemplateConverter.ts +2 -2
- package/src/sap/fe/core/converters/annotations/DataField.js +3 -3
- package/src/sap/fe/core/converters/annotations/DataField.ts +1 -1
- package/src/sap/fe/core/converters/common/AnnotationConverter.js +85 -46
- package/src/sap/fe/core/converters/controls/Common/Action.js +16 -4
- package/src/sap/fe/core/converters/controls/Common/Action.ts +14 -5
- package/src/sap/fe/core/converters/controls/Common/Chart.js +5 -3
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +11 -3
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +3 -3
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +2 -2
- package/src/sap/fe/core/converters/controls/Common/Form.js +60 -19
- package/src/sap/fe/core/converters/controls/Common/Form.ts +66 -14
- package/src/sap/fe/core/converters/controls/Common/KPI.js +69 -4
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +72 -0
- package/src/sap/fe/core/converters/controls/Common/Table.js +503 -399
- package/src/sap/fe/core/converters/controls/Common/Table.ts +615 -480
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +527 -0
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +655 -0
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +489 -37
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +506 -58
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +2 -2
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +1 -1
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +6 -6
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +9 -15
- package/src/sap/fe/core/converters/helpers/Aggregation.js +18 -3
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +28 -5
- package/src/sap/fe/core/converters/helpers/ID.js +9 -1
- package/src/sap/fe/core/converters/helpers/ID.ts +4 -0
- package/src/sap/fe/core/converters/helpers/IssueManager.js +7 -1
- package/src/sap/fe/core/converters/helpers/IssueManager.ts +6 -0
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +4 -4
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +3 -3
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +29 -11
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +36 -20
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +13 -3
- package/src/sap/fe/core/formatters/CriticalityFormatter.js +1 -1
- package/src/sap/fe/core/formatters/CriticalityFormatter.ts +1 -1
- package/src/sap/fe/core/formatters/FPMFormatter.js +1 -1
- package/src/sap/fe/core/formatters/FPMFormatter.ts +4 -10
- package/src/sap/fe/core/formatters/KPIFormatter.js +1 -1
- package/src/sap/fe/core/formatters/KPIFormatter.ts +3 -1
- package/src/sap/fe/core/formatters/TableFormatter.js +65 -31
- package/src/sap/fe/core/formatters/TableFormatter.ts +62 -30
- package/src/sap/fe/core/formatters/ValueFormatter.js +30 -5
- package/src/sap/fe/core/formatters/ValueFormatter.ts +30 -7
- package/src/sap/fe/core/fpm/Component.js +3 -2
- package/src/sap/fe/core/helpers/AppStartupHelper.js +359 -0
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +391 -0
- package/src/sap/fe/core/helpers/BindingExpression.js +479 -464
- package/src/sap/fe/core/helpers/BindingExpression.ts +477 -483
- package/src/sap/fe/core/helpers/ClassSupport.js +27 -15
- package/src/sap/fe/core/helpers/ClassSupport.ts +31 -20
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +63 -59
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +56 -0
- package/src/sap/fe/core/helpers/EditState.js +81 -84
- package/src/sap/fe/core/helpers/EditState.ts +81 -0
- package/src/sap/fe/core/helpers/ExcelFormatHelper.js +62 -48
- package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +49 -0
- package/src/sap/fe/core/helpers/FPMHelper.js +52 -56
- package/src/sap/fe/core/helpers/FPMHelper.ts +62 -0
- package/src/sap/fe/core/helpers/KeepAliveHelper.js +210 -0
- package/src/sap/fe/core/helpers/KeepAliveHelper.ts +202 -0
- package/src/sap/fe/core/helpers/KeepAliveRefreshTypes.js +32 -0
- package/src/sap/fe/core/helpers/KeepAliveRefreshTypes.ts +36 -0
- package/src/sap/fe/core/helpers/MassEditHelper.js +687 -0
- package/src/sap/fe/core/helpers/ModelHelper.js +229 -174
- package/src/sap/fe/core/helpers/ModelHelper.ts +227 -0
- package/src/sap/fe/core/helpers/PasteHelper.js +210 -132
- package/src/sap/fe/core/helpers/PasteHelper.ts +196 -0
- package/src/sap/fe/core/helpers/SemanticDateOperators.js +332 -313
- package/src/sap/fe/core/helpers/SemanticDateOperators.ts +330 -0
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js +66 -67
- package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +73 -0
- package/src/sap/fe/core/helpers/StableIdHelper.js +4 -7
- package/src/sap/fe/core/helpers/StableIdHelper.ts +2 -6
- package/src/sap/fe/core/jsx-runtime/jsx.js +1 -1
- package/src/sap/fe/core/jsx-runtime/jsx.ts +1 -1
- package/src/sap/fe/core/library.js +30 -3
- package/src/sap/fe/core/library.support.js +12 -5
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +62 -0
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +66 -0
- package/src/sap/fe/core/messagebundle.properties +72 -10
- package/src/sap/fe/core/messagebundle_ar.properties +41 -0
- package/src/sap/fe/core/messagebundle_bg.properties +41 -0
- package/src/sap/fe/core/messagebundle_ca.properties +41 -0
- package/src/sap/fe/core/messagebundle_cs.properties +42 -1
- package/src/sap/fe/core/messagebundle_cy.properties +41 -0
- package/src/sap/fe/core/messagebundle_da.properties +41 -0
- package/src/sap/fe/core/messagebundle_de.properties +41 -0
- package/src/sap/fe/core/messagebundle_el.properties +41 -0
- package/src/sap/fe/core/messagebundle_en.properties +41 -0
- package/src/sap/fe/core/messagebundle_en_GB.properties +41 -0
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +41 -0
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +35 -0
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +41 -0
- package/src/sap/fe/core/messagebundle_es.properties +41 -0
- package/src/sap/fe/core/messagebundle_es_MX.properties +41 -0
- package/src/sap/fe/core/messagebundle_et.properties +41 -0
- package/src/sap/fe/core/messagebundle_fi.properties +41 -0
- package/src/sap/fe/core/messagebundle_fr.properties +46 -5
- package/src/sap/fe/core/messagebundle_fr_CA.properties +41 -0
- package/src/sap/fe/core/messagebundle_hi.properties +41 -0
- package/src/sap/fe/core/messagebundle_hr.properties +41 -0
- package/src/sap/fe/core/messagebundle_hu.properties +42 -1
- package/src/sap/fe/core/messagebundle_id.properties +45 -4
- package/src/sap/fe/core/messagebundle_it.properties +41 -0
- package/src/sap/fe/core/messagebundle_iw.properties +41 -0
- package/src/sap/fe/core/messagebundle_ja.properties +50 -9
- package/src/sap/fe/core/messagebundle_kk.properties +41 -0
- package/src/sap/fe/core/messagebundle_ko.properties +41 -0
- package/src/sap/fe/core/messagebundle_lt.properties +41 -0
- package/src/sap/fe/core/messagebundle_lv.properties +41 -0
- package/src/sap/fe/core/messagebundle_ms.properties +41 -0
- package/src/sap/fe/core/messagebundle_nl.properties +41 -0
- package/src/sap/fe/core/messagebundle_no.properties +41 -0
- package/src/sap/fe/core/messagebundle_pl.properties +41 -0
- package/src/sap/fe/core/messagebundle_pt.properties +43 -2
- package/src/sap/fe/core/messagebundle_pt_PT.properties +41 -0
- package/src/sap/fe/core/messagebundle_ro.properties +41 -0
- package/src/sap/fe/core/messagebundle_ru.properties +41 -0
- package/src/sap/fe/core/messagebundle_sh.properties +41 -0
- package/src/sap/fe/core/messagebundle_sk.properties +41 -0
- package/src/sap/fe/core/messagebundle_sl.properties +41 -0
- package/src/sap/fe/core/messagebundle_sv.properties +42 -1
- package/src/sap/fe/core/messagebundle_th.properties +41 -0
- package/src/sap/fe/core/messagebundle_tr.properties +41 -0
- package/src/sap/fe/core/messagebundle_uk.properties +41 -0
- package/src/sap/fe/core/messagebundle_vi.properties +41 -0
- package/src/sap/fe/core/messagebundle_zh_CN.properties +41 -0
- package/src/sap/fe/core/messagebundle_zh_TW.properties +41 -0
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +2 -2
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +3 -1
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +269 -202
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +212 -0
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +4 -3
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +9 -5
- package/src/sap/fe/core/services/NavigationServiceFactory.js +406 -300
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +316 -0
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +149 -81
- package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +80 -0
- package/src/sap/fe/core/services/RoutingServiceFactory.js +987 -1166
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +898 -0
- package/src/sap/fe/core/services/ShellServicesFactory.js +31 -2
- package/src/sap/fe/core/services/ShellServicesFactory.ts +45 -11
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +41 -84
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +56 -99
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +461 -478
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +453 -0
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +10 -8
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +8 -0
- package/src/sap/fe/core/support/AnnotationIssue.support.js +15 -3
- package/src/sap/fe/core/support/AnnotationIssue.support.ts +16 -2
- package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.js +2 -2
- package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.ts +1 -1
- package/src/sap/fe/core/support/InvalidAnnotationColumnKey.support.js +38 -0
- package/src/sap/fe/core/support/InvalidAnnotationColumnKey.support.ts +18 -0
- package/src/sap/fe/core/templating/DataModelPathHelper.js +6 -24
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +10 -23
- package/src/sap/fe/core/templating/DisplayModeFormatter.js +114 -0
- package/src/sap/fe/core/templating/DisplayModeFormatter.ts +86 -0
- package/src/sap/fe/core/templating/EntitySetHelper.js +80 -7
- package/src/sap/fe/core/templating/EntitySetHelper.ts +42 -2
- package/src/sap/fe/core/templating/FieldControlHelper.js +8 -8
- package/src/sap/fe/core/templating/FieldControlHelper.ts +25 -7
- package/src/sap/fe/core/templating/FilterHelper.js +139 -70
- package/src/sap/fe/core/templating/FilterHelper.ts +140 -70
- package/src/sap/fe/core/templating/PropertyHelper.js +2 -2
- package/src/sap/fe/core/templating/PropertyHelper.ts +1 -1
- package/src/sap/fe/core/templating/UIFormatters.js +45 -113
- package/src/sap/fe/core/templating/UIFormatters.ts +39 -76
- package/src/sap/fe/core/type/Email.js +1 -1
- package/src/sap/fe/core/type/Email.ts +4 -6
- package/ui5.yaml +0 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
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 {
|
|
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,
|
|
20
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkVtYWlsLnRzIl0sIm5hbWVzIjpbImVtYWlsVzNDUmVnZXhwIiwiRW1haWxUeXBlIiwiT0RhdGFTdHJpbmdUeXBlIiwiZXh0ZW5kIiwidmFsaWRhdGVWYWx1ZSIsInNWYWx1ZSIsInRlc3QiLCJWYWxpZGF0ZUV4Y2VwdGlvbiIsInNhcCIsInVpIiwiZ2V0Q29yZSIsImdldExpYnJhcnlSZXNvdXJjZUJ1bmRsZSIsImdldFRleHQiLCJwcm90b3R5cGUiLCJhcHBseSJdLCJtYXBwaW5ncyI6IjtBQUFBO0FBQ0E7QUFDQTs7OztBQUVBLE1BQU1BLGNBQWMsR0FBRyxxRUFBdkI7QUFDQSxNQUFNQyxTQUFTLEdBQUdDLGVBQWUsQ0FBQ0MsTUFBaEIsQ0FBdUIsd0JBQXZCLEVBQWlEO0FBQ2xFQyxJQUFBQSxhQURrRSxZQUNwREMsTUFEb0QsRUFDcEM7QUFDN0IsVUFBSSxDQUFDTCxjQUFjLENBQUNNLElBQWYsQ0FBb0JELE1BQXBCLENBQUwsRUFBa0M7QUFDakMsY0FBTSxJQUFJRSxpQkFBSixDQUNKQyxHQUFHLENBQUNDLEVBQUosQ0FBT0MsT0FBUCxHQUFpQkMsd0JBQWpCLENBQTBDLGFBQTFDLENBQUQsQ0FBNkVDLE9BQTdFLENBQXFGLDJCQUFyRixDQURLLENBQU47QUFHQTs7QUFDRFYsTUFBQUEsZUFBZSxDQUFDVyxTQUFoQixDQUEwQlQsYUFBMUIsQ0FBd0NVLEtBQXhDLENBQThDLElBQTlDLEVBQW9ELENBQUNULE1BQUQsQ0FBcEQ7QUFDQTtBQVJpRSxHQUFqRCxDQUFsQjtTQVVlSixTIiwic291cmNlUm9vdCI6Ii4iLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVzb3VyY2VCdW5kbGUgZnJvbSBcInNhcC9iYXNlL2kxOG4vUmVzb3VyY2VCdW5kbGVcIjtcbmltcG9ydCBPRGF0YVN0cmluZ1R5cGUgZnJvbSBcInNhcC91aS9tb2RlbC9vZGF0YS90eXBlL1N0cmluZ1wiO1xuaW1wb3J0IFZhbGlkYXRlRXhjZXB0aW9uIGZyb20gXCJzYXAvdWkvbW9kZWwvVmFsaWRhdGVFeGNlcHRpb25cIjtcblxuY29uc3QgZW1haWxXM0NSZWdleHAgPSAvXlthLXpBLVowLTkuISMkJSbigJkqKy89P15fYHt8fX4tXStAW2EtekEtWjAtOS1dKyg/Oi5bYS16QS1aMC05LV0rKSokLztcbmNvbnN0IEVtYWlsVHlwZSA9IE9EYXRhU3RyaW5nVHlwZS5leHRlbmQoXCJzYXAuZmUuY29yZS50eXBlLkVtYWlsXCIsIHtcblx0dmFsaWRhdGVWYWx1ZShzVmFsdWU6IHN0cmluZykge1xuXHRcdGlmICghZW1haWxXM0NSZWdleHAudGVzdChzVmFsdWUpKSB7XG5cdFx0XHR0aHJvdyBuZXcgVmFsaWRhdGVFeGNlcHRpb24oXG5cdFx0XHRcdChzYXAudWkuZ2V0Q29yZSgpLmdldExpYnJhcnlSZXNvdXJjZUJ1bmRsZShcInNhcC5mZS5jb3JlXCIpIGFzIFJlc291cmNlQnVuZGxlKS5nZXRUZXh0KFwiVF9FTUFJTFRZUEVfSU5WQUxJRF9WQUxVRVwiKVxuXHRcdFx0KTtcblx0XHR9XG5cdFx0T0RhdGFTdHJpbmdUeXBlLnByb3RvdHlwZS52YWxpZGF0ZVZhbHVlLmFwcGx5KHRoaXMsIFtzVmFsdWVdKTtcblx0fVxufSk7XG5leHBvcnQgZGVmYXVsdCBFbWFpbFR5cGU7XG4iXX0=
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
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]);
|