@sapui5/sap.fe.core 1.100.0 → 1.102.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 +4 -4
- package/src/sap/fe/core/.library +2 -3
- package/src/sap/fe/core/AppComponent.js +23 -30
- package/src/sap/fe/core/AppComponent.ts +35 -40
- package/src/sap/fe/core/AppStateHandler.js +8 -8
- package/src/sap/fe/core/AppStateHandler.ts +11 -11
- package/src/sap/fe/core/BaseController.js +9 -9
- package/src/sap/fe/core/BaseController.ts +3 -4
- package/src/sap/fe/core/CommonUtils.js +122 -101
- package/src/sap/fe/core/CommonUtils.ts +239 -193
- package/src/sap/fe/core/ExtensionAPI.js +12 -13
- package/src/sap/fe/core/ExtensionAPI.ts +21 -31
- package/src/sap/fe/core/PageController.js +19 -13
- package/src/sap/fe/core/PageController.ts +40 -34
- package/src/sap/fe/core/TemplateComponent.js +198 -123
- package/src/sap/fe/core/TemplateComponent.ts +109 -121
- package/src/sap/fe/core/TemplateModel.js +7 -9
- package/src/sap/fe/core/TemplateModel.ts +3 -3
- package/src/sap/fe/core/buildingBlocks/AttributeModel.js +60 -0
- package/src/sap/fe/core/buildingBlocks/AttributeModel.ts +37 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.js +165 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.ts +178 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js +935 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.ts +837 -0
- package/src/sap/fe/core/buildingBlocks/TraceInfo.js +436 -0
- package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +431 -0
- package/src/sap/fe/core/{BusyLocker.js → controllerextensions/BusyLocker.js} +1 -1
- package/src/sap/fe/core/{BusyLocker.ts → controllerextensions/BusyLocker.ts} +7 -7
- package/src/sap/fe/core/controllerextensions/EditFlow.js +660 -288
- package/src/sap/fe/core/controllerextensions/EditFlow.ts +513 -331
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +11 -11
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +6 -7
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +43 -25
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +132 -103
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +16 -16
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +64 -55
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +166 -99
- package/src/sap/fe/core/controllerextensions/InternalRouting.ts +187 -149
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +14 -14
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +12 -11
- package/src/sap/fe/core/controllerextensions/MassEdit.js +13 -12
- package/src/sap/fe/core/controllerextensions/MassEdit.ts +22 -22
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +14 -26
- package/src/sap/fe/core/controllerextensions/MessageHandler.ts +20 -30
- package/src/sap/fe/core/controllerextensions/PageReady.js +25 -23
- package/src/sap/fe/core/controllerextensions/PageReady.ts +49 -47
- package/src/sap/fe/core/controllerextensions/Paginator.js +24 -15
- package/src/sap/fe/core/controllerextensions/Paginator.ts +35 -20
- package/src/sap/fe/core/controllerextensions/Placeholder.js +10 -10
- package/src/sap/fe/core/controllerextensions/Placeholder.ts +12 -14
- package/src/sap/fe/core/controllerextensions/Routing.js +11 -11
- package/src/sap/fe/core/controllerextensions/Routing.ts +12 -13
- package/src/sap/fe/core/controllerextensions/Share.js +34 -16
- package/src/sap/fe/core/controllerextensions/Share.ts +50 -32
- package/src/sap/fe/core/controllerextensions/SideEffects.js +15 -15
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +64 -65
- package/src/sap/fe/core/controllerextensions/ViewState.js +27 -31
- package/src/sap/fe/core/controllerextensions/ViewState.ts +103 -102
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.js +105 -0
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.ts +98 -0
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.js +360 -0
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/ActivitySync.ts +90 -132
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.js +146 -0
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/CollaborationCommon.ts +18 -8
- package/src/sap/fe/core/controllerextensions/collaboration/Manage.js +264 -0
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/Manage.ts +35 -33
- package/src/sap/fe/core/controllerextensions/collaboration/ManageDialog.fragment.xml +100 -0
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/UserDetails.fragment.xml +5 -7
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js +1584 -0
- package/src/sap/fe/core/{TransactionHelper.ts → controllerextensions/editFlow/TransactionHelper.ts} +190 -159
- package/src/sap/fe/core/controllerextensions/editFlow/draft.js +780 -0
- package/src/sap/fe/core/{actions → controllerextensions/editFlow}/draft.ts +329 -76
- package/src/sap/fe/core/controllerextensions/editFlow/operations.js +1149 -0
- package/src/sap/fe/core/{actions → controllerextensions/editFlow}/operations.ts +169 -97
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.js +190 -0
- package/src/sap/fe/core/{actions → controllerextensions/editFlow}/sticky.ts +76 -12
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js +592 -0
- package/src/sap/fe/core/{actions → controllerextensions/messageHandler}/messageHandling.ts +83 -60
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js +940 -0
- package/src/sap/fe/core/{RouterProxy.ts → controllerextensions/routing/RouterProxy.ts} +52 -36
- package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +21 -18
- package/src/sap/fe/core/controls/Any.js +28 -0
- package/src/sap/fe/core/controls/Any.ts +30 -0
- package/src/sap/fe/core/controls/CommandExecution.js +50 -16
- package/src/sap/fe/core/controls/CommandExecution.ts +31 -22
- package/src/sap/fe/core/controls/ConditionalWrapper.js +136 -65
- package/src/sap/fe/core/controls/ConditionalWrapper.ts +49 -58
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +371 -0
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +282 -0
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +74 -36
- package/src/sap/fe/core/controls/CustomQuickViewPage.ts +23 -32
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossDraft.fragment.xml +52 -5
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +127 -67
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +127 -67
- package/src/sap/fe/core/controls/FieldWrapper.js +171 -87
- package/src/sap/fe/core/controls/FieldWrapper.ts +69 -80
- package/src/sap/fe/core/controls/FileWrapper.js +360 -0
- package/src/sap/fe/core/controls/FileWrapper.ts +202 -0
- package/src/sap/fe/core/controls/FilterBar.js +154 -119
- package/src/sap/fe/core/controls/FilterBar.ts +128 -123
- package/src/sap/fe/core/controls/FormElementWrapper.js +102 -37
- package/src/sap/fe/core/controls/FormElementWrapper.ts +43 -35
- package/src/sap/fe/core/controls/MassEditSelect.js +33 -0
- package/src/sap/fe/core/controls/MassEditSelect.ts +45 -0
- package/src/sap/fe/core/controls/filterbar/FilterContainer.js +111 -89
- package/src/sap/fe/core/controls/filterbar/FilterContainer.ts +86 -82
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +242 -193
- package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +211 -204
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +152 -116
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +105 -105
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +2 -2
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +23 -28
- package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +41 -81
- package/src/sap/fe/core/controls/massEdit/MassEditField.fragment.xml +107 -0
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +550 -35
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +604 -35
- package/src/sap/fe/core/converters/ManifestSettings.js +3 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +9 -2
- package/src/sap/fe/core/converters/MetaModelConverter.js +11 -40
- package/src/sap/fe/core/converters/MetaModelConverter.ts +56 -84
- package/src/sap/fe/core/converters/annotations/DataField.js +20 -5
- package/src/sap/fe/core/converters/annotations/DataField.ts +27 -6
- package/src/sap/fe/core/converters/controls/Common/Action.js +14 -21
- package/src/sap/fe/core/converters/controls/Common/Action.ts +23 -28
- package/src/sap/fe/core/converters/controls/Common/Chart.js +17 -10
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +20 -14
- package/src/sap/fe/core/converters/controls/Common/Form.js +16 -18
- package/src/sap/fe/core/converters/controls/Common/Form.ts +20 -20
- package/src/sap/fe/core/converters/controls/Common/KPI.js +1 -1
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +2 -3
- package/src/sap/fe/core/converters/controls/Common/Table.js +389 -173
- package/src/sap/fe/core/converters/controls/Common/Table.ts +440 -244
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +26 -16
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +27 -19
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +78 -47
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +146 -107
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +6 -6
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +20 -18
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +30 -25
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +39 -34
- package/src/sap/fe/core/converters/helpers/Aggregation.js +10 -2
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +18 -13
- package/src/sap/fe/core/converters/helpers/BindingHelper.js +3 -2
- package/src/sap/fe/core/converters/helpers/BindingHelper.ts +6 -5
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.js +1 -1
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.ts +0 -4
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +27 -24
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +49 -40
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +33 -22
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +77 -62
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +28 -28
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +38 -45
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +3 -3
- package/src/sap/fe/core/designtime/AppComponent.designtime.ts +8 -6
- package/src/sap/fe/core/formatters/KPIFormatter.js +3 -12
- package/src/sap/fe/core/formatters/KPIFormatter.ts +3 -2
- package/src/sap/fe/core/formatters/TableFormatter.js +74 -13
- package/src/sap/fe/core/formatters/TableFormatter.ts +71 -16
- package/src/sap/fe/core/formatters/ValueFormatter.js +4 -4
- package/src/sap/fe/core/formatters/ValueFormatter.ts +4 -7
- package/src/sap/fe/core/fpm/Component.js +46 -17
- package/src/sap/fe/core/fpm/Component.ts +11 -16
- package/src/sap/fe/core/helpers/AppStartupHelper.js +4 -4
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +3 -3
- package/src/sap/fe/core/helpers/BindingExpression.js +10 -7
- package/src/sap/fe/core/helpers/BindingExpression.ts +37 -35
- package/src/sap/fe/core/helpers/ClassSupport.js +273 -256
- package/src/sap/fe/core/helpers/ClassSupport.ts +315 -237
- package/src/sap/fe/core/helpers/FPMHelper.js +3 -2
- package/src/sap/fe/core/helpers/FPMHelper.ts +9 -8
- package/src/sap/fe/core/helpers/MassEditHelper.js +522 -147
- package/src/sap/fe/core/helpers/MassEditHelper.ts +563 -236
- package/src/sap/fe/core/helpers/ModelHelper.js +29 -1
- package/src/sap/fe/core/helpers/ModelHelper.ts +39 -26
- package/src/sap/fe/core/helpers/PasteHelper.js +4 -4
- package/src/sap/fe/core/helpers/PasteHelper.ts +4 -3
- package/src/sap/fe/core/helpers/SemanticDateOperators.js +3 -3
- package/src/sap/fe/core/helpers/SemanticDateOperators.ts +3 -1
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js +1 -1
- package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +1 -1
- package/src/sap/fe/core/helpers/StableIdHelper.js +5 -7
- package/src/sap/fe/core/helpers/StableIdHelper.ts +8 -8
- package/src/sap/fe/core/{Synchronization.js → helpers/Synchronization.js} +1 -1
- package/src/sap/fe/core/{Synchronization.ts → helpers/Synchronization.ts} +1 -1
- package/src/sap/fe/core/jsx-runtime/jsx.js +35 -5
- package/src/sap/fe/core/jsx-runtime/jsx.ts +22 -8
- package/src/sap/fe/core/library.js +13 -5
- package/src/sap/fe/core/library.ts +26 -17
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +1 -1
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +0 -3
- package/src/sap/fe/core/messagebundle.properties +135 -180
- package/src/sap/fe/core/messagebundle_ar.properties +31 -64
- package/src/sap/fe/core/messagebundle_bg.properties +31 -64
- package/src/sap/fe/core/messagebundle_ca.properties +31 -64
- package/src/sap/fe/core/messagebundle_cs.properties +31 -64
- package/src/sap/fe/core/messagebundle_cy.properties +32 -65
- package/src/sap/fe/core/messagebundle_da.properties +31 -64
- package/src/sap/fe/core/messagebundle_de.properties +29 -62
- package/src/sap/fe/core/messagebundle_el.properties +32 -65
- package/src/sap/fe/core/messagebundle_en.properties +32 -65
- package/src/sap/fe/core/messagebundle_en_GB.properties +29 -62
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +41 -74
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +32 -65
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +20 -6
- package/src/sap/fe/core/messagebundle_es.properties +31 -64
- package/src/sap/fe/core/messagebundle_es_MX.properties +31 -64
- package/src/sap/fe/core/messagebundle_et.properties +31 -64
- package/src/sap/fe/core/messagebundle_fi.properties +29 -62
- package/src/sap/fe/core/messagebundle_fr.properties +36 -69
- package/src/sap/fe/core/messagebundle_fr_CA.properties +33 -66
- package/src/sap/fe/core/messagebundle_hi.properties +29 -62
- package/src/sap/fe/core/messagebundle_hr.properties +32 -65
- package/src/sap/fe/core/messagebundle_hu.properties +30 -63
- package/src/sap/fe/core/messagebundle_id.properties +32 -65
- package/src/sap/fe/core/messagebundle_it.properties +31 -64
- package/src/sap/fe/core/messagebundle_iw.properties +31 -64
- package/src/sap/fe/core/messagebundle_ja.properties +29 -62
- package/src/sap/fe/core/messagebundle_kk.properties +31 -64
- package/src/sap/fe/core/messagebundle_ko.properties +31 -64
- package/src/sap/fe/core/messagebundle_lt.properties +31 -64
- package/src/sap/fe/core/messagebundle_lv.properties +32 -65
- package/src/sap/fe/core/messagebundle_ms.properties +31 -64
- package/src/sap/fe/core/messagebundle_nl.properties +31 -64
- package/src/sap/fe/core/messagebundle_no.properties +31 -64
- package/src/sap/fe/core/messagebundle_pl.properties +34 -67
- package/src/sap/fe/core/messagebundle_pt.properties +32 -65
- package/src/sap/fe/core/messagebundle_pt_PT.properties +31 -64
- package/src/sap/fe/core/messagebundle_ro.properties +33 -66
- package/src/sap/fe/core/messagebundle_ru.properties +33 -66
- package/src/sap/fe/core/messagebundle_sh.properties +31 -64
- package/src/sap/fe/core/messagebundle_sk.properties +31 -64
- package/src/sap/fe/core/messagebundle_sl.properties +29 -62
- package/src/sap/fe/core/messagebundle_sv.properties +30 -63
- package/src/sap/fe/core/messagebundle_th.properties +31 -64
- package/src/sap/fe/core/messagebundle_tr.properties +31 -64
- package/src/sap/fe/core/messagebundle_uk.properties +32 -65
- package/src/sap/fe/core/messagebundle_vi.properties +31 -64
- package/src/sap/fe/core/messagebundle_zh_CN.properties +32 -65
- package/src/sap/fe/core/messagebundle_zh_TW.properties +34 -67
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +4 -4
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +1 -1
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +5 -5
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +1 -2
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +11 -8
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +15 -13
- package/src/sap/fe/core/services/NavigationServiceFactory.js +5 -5
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +9 -5
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +4 -4
- package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +1 -1
- package/src/sap/fe/core/services/RoutingServiceFactory.js +105 -66
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +59 -49
- package/src/sap/fe/core/services/ShellServicesFactory.js +104 -29
- package/src/sap/fe/core/services/ShellServicesFactory.ts +64 -30
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +4 -4
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +1 -1
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +11 -10
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +38 -51
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +43 -5
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +6 -3
- package/src/sap/fe/core/support/CommonHelper.js +1 -1
- package/src/sap/fe/core/support/CommonHelper.ts +0 -3
- package/src/sap/fe/core/templating/DataModelPathHelper.js +2 -9
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +32 -38
- package/src/sap/fe/core/templating/DisplayModeFormatter.js +23 -3
- package/src/sap/fe/core/templating/DisplayModeFormatter.ts +27 -6
- package/src/sap/fe/core/templating/EntitySetHelper.js +1 -9
- package/src/sap/fe/core/templating/EntitySetHelper.ts +11 -13
- package/src/sap/fe/core/templating/FilterHelper.js +4 -4
- package/src/sap/fe/core/templating/FilterHelper.ts +6 -5
- package/src/sap/fe/core/templating/PropertyHelper.js +70 -33
- package/src/sap/fe/core/templating/PropertyHelper.ts +49 -27
- package/src/sap/fe/core/templating/UIFormatters.js +133 -22
- package/src/sap/fe/core/templating/UIFormatters.ts +144 -50
- package/src/sap/fe/core/type/DateTimeWithTimezone.js +47 -0
- package/src/sap/fe/core/type/DateTimeWithTimezone.ts +23 -0
- package/src/sap/fe/core/type/Email.js +26 -8
- package/src/sap/fe/core/type/Email.ts +8 -7
- package/src/sap/fe/core/AnnotationHelper.js +0 -312
- package/src/sap/fe/core/AnnotationHelper.ts +0 -315
- package/src/sap/fe/core/RouterProxy.js +0 -926
- package/src/sap/fe/core/TransactionHelper.js +0 -1562
- package/src/sap/fe/core/actions/collaboration/ActivitySync.js +0 -392
- package/src/sap/fe/core/actions/collaboration/CollaborationCommon.js +0 -136
- package/src/sap/fe/core/actions/collaboration/Manage.js +0 -262
- package/src/sap/fe/core/actions/collaboration/ManageDialog.fragment.xml +0 -103
- package/src/sap/fe/core/actions/draft.js +0 -523
- package/src/sap/fe/core/actions/messageHandling.js +0 -567
- package/src/sap/fe/core/actions/nonDraft.js +0 -20
- package/src/sap/fe/core/actions/nonDraft.ts +0 -12
- package/src/sap/fe/core/actions/operations.js +0 -1096
- package/src/sap/fe/core/actions/sticky.js +0 -130
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +0 -78
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.ts +0 -65
- package/src/sap/fe/core/formatters/CriticalityFormatter.js +0 -77
- package/src/sap/fe/core/formatters/CriticalityFormatter.ts +0 -58
|
@@ -1,126 +1,111 @@
|
|
|
1
|
-
import
|
|
1
|
+
import AppComponent from "sap/fe/core/AppComponent";
|
|
2
2
|
import CommonUtils from "sap/fe/core/CommonUtils";
|
|
3
|
-
import
|
|
3
|
+
import { defineUI5Class, event, implementInterface, property } from "sap/fe/core/helpers/ClassSupport";
|
|
4
|
+
import PageController from "sap/fe/core/PageController";
|
|
4
5
|
import ComponentContainer from "sap/ui/core/ComponentContainer";
|
|
5
|
-
import
|
|
6
|
+
import { IAsyncContentCreation } from "sap/ui/core/library";
|
|
6
7
|
import View from "sap/ui/core/mvc/View";
|
|
7
|
-
import
|
|
8
|
+
import UIComponent from "sap/ui/core/UIComponent";
|
|
9
|
+
import StateUtil from "sap/ui/mdc/p13n/StateUtil";
|
|
10
|
+
import ODataListBinding from "sap/ui/model/odata/v4/ODataListBinding";
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
},
|
|
52
|
-
/**
|
|
53
|
-
* Enhance the i18n bundle used for this page with one or more app specific i18n resource bundles or resource models
|
|
54
|
-
* or a combination of both. The last resource bundle/model is given highest priority
|
|
55
|
-
*/
|
|
56
|
-
enhanceI18n: {
|
|
57
|
-
type: "string[]"
|
|
58
|
-
},
|
|
59
|
-
/**
|
|
60
|
-
* Define control related configuration settings
|
|
61
|
-
*/
|
|
62
|
-
controlConfiguration: {
|
|
63
|
-
type: "object"
|
|
64
|
-
},
|
|
65
|
-
/**
|
|
66
|
-
* Adjusts the template content
|
|
67
|
-
*/
|
|
68
|
-
content: {
|
|
69
|
-
type: "object"
|
|
70
|
-
},
|
|
71
|
-
/**
|
|
72
|
-
* Whether or not you can reach this page directly through semantic bookmarks
|
|
73
|
-
*/
|
|
74
|
-
allowDeepLinking: {
|
|
75
|
-
type: "boolean"
|
|
76
|
-
},
|
|
77
|
-
/**
|
|
78
|
-
* Defines the context path on the component that is refreshed when the app is restored using keep alive mode
|
|
79
|
-
*/
|
|
80
|
-
refreshStrategyOnAppRestore: {
|
|
81
|
-
type: "object"
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
events: {
|
|
85
|
-
containerDefined: {
|
|
86
|
-
container: { type: "sap.ui.base.ManagedObject" }
|
|
87
|
-
},
|
|
88
|
-
heroesBatchReceived: {
|
|
89
|
-
element: { type: "sap.ui.base.ManagedObject" }
|
|
90
|
-
},
|
|
91
|
-
workersBatchReceived: {
|
|
92
|
-
element: { type: "sap.ui.base.ManagedObject" }
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
library: "sap.fe.core"
|
|
96
|
-
},
|
|
12
|
+
@defineUI5Class("sap.fe.core.TemplateComponent")
|
|
13
|
+
class TemplateComponent extends UIComponent implements IAsyncContentCreation {
|
|
14
|
+
@implementInterface("sap.ui.core.IAsyncContentCreation")
|
|
15
|
+
__implements__sap_ui_core_IAsyncContentCreation: boolean = true;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Name of the OData entity set
|
|
19
|
+
*/
|
|
20
|
+
@property({ type: "string", defaultValue: null })
|
|
21
|
+
entitySet: string | null = null;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Context Path for rendering the template
|
|
25
|
+
*/
|
|
26
|
+
@property({ type: "string", defaultValue: null })
|
|
27
|
+
contextPath: string | null = null;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The pattern for the binding context to be create based on the parameters from the navigation
|
|
31
|
+
* If not provided we'll default to what was passed in the URL
|
|
32
|
+
*/
|
|
33
|
+
@property({ type: "string" })
|
|
34
|
+
bindingContextPattern!: string;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Map of used OData navigations and its routing targets
|
|
38
|
+
*/
|
|
39
|
+
@property({ type: "object" })
|
|
40
|
+
navigation: any;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Enhance the i18n bundle used for this page with one or more app specific i18n resource bundles or resource models
|
|
44
|
+
* or a combination of both. The last resource bundle/model is given highest priority
|
|
45
|
+
*/
|
|
46
|
+
@property({ type: "string[]" })
|
|
47
|
+
enhanceI18n!: string[];
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Define control related configuration settings
|
|
51
|
+
*/
|
|
52
|
+
@property({ type: "object" })
|
|
53
|
+
controlConfiguration: any;
|
|
97
54
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
55
|
+
/**
|
|
56
|
+
* Adjusts the template content
|
|
57
|
+
*/
|
|
58
|
+
@property({ type: "object" })
|
|
59
|
+
content: any;
|
|
103
60
|
|
|
104
|
-
|
|
61
|
+
/**
|
|
62
|
+
* Whether or not you can reach this page directly through semantic bookmarks
|
|
63
|
+
*/
|
|
64
|
+
@property({ type: "boolean" })
|
|
65
|
+
allowDeepLinking!: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Defines the context path on the component that is refreshed when the app is restored using keep alive mode
|
|
68
|
+
*/
|
|
69
|
+
@property({ type: "object" })
|
|
70
|
+
refreshStrategyOnAppRestore: any;
|
|
71
|
+
|
|
72
|
+
@event()
|
|
73
|
+
containerDefined!: Function;
|
|
74
|
+
|
|
75
|
+
@event()
|
|
76
|
+
heroesBatchReceived!: Function;
|
|
77
|
+
|
|
78
|
+
@event()
|
|
79
|
+
workersBatchReceived!: Function;
|
|
80
|
+
|
|
81
|
+
protected oAppComponent!: AppComponent;
|
|
82
|
+
|
|
83
|
+
setContainer(oContainer: ComponentContainer): this {
|
|
84
|
+
super.setContainer(oContainer);
|
|
85
|
+
this.fireEvent("containerDefined", { container: oContainer });
|
|
86
|
+
return this;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
init() {
|
|
105
90
|
this.oAppComponent = CommonUtils.getAppComponent(this);
|
|
106
|
-
|
|
107
|
-
const
|
|
91
|
+
super.init();
|
|
92
|
+
const oStateChangeHandler = function (oEvent: any) {
|
|
108
93
|
const oControl = oEvent.getParameter("control");
|
|
109
|
-
if (oControl.isA("sap.ui.mdc.Table") || oControl.isA("sap.ui.mdc.FilterBar")) {
|
|
94
|
+
if (oControl.isA("sap.ui.mdc.Table") || oControl.isA("sap.ui.mdc.FilterBar") || oControl.isA("sap.ui.mdc.Chart")) {
|
|
110
95
|
const oMacroAPI = oControl.getParent();
|
|
111
|
-
oMacroAPI.
|
|
96
|
+
oMacroAPI.fireStateChange();
|
|
112
97
|
}
|
|
113
98
|
};
|
|
114
|
-
StateUtil.detachStateChange(
|
|
115
|
-
StateUtil.attachStateChange(
|
|
116
|
-
}
|
|
99
|
+
StateUtil.detachStateChange(oStateChangeHandler);
|
|
100
|
+
StateUtil.attachStateChange(oStateChangeHandler);
|
|
101
|
+
}
|
|
117
102
|
|
|
118
103
|
// This method is called by UI5 core to access to the component containing the customizing configuration.
|
|
119
104
|
// as controller extensions are defined in the manifest for the app component and not for the
|
|
120
105
|
// template component we return the app component.
|
|
121
|
-
getExtensionComponent
|
|
106
|
+
getExtensionComponent(): AppComponent {
|
|
122
107
|
return this.oAppComponent;
|
|
123
|
-
}
|
|
108
|
+
}
|
|
124
109
|
|
|
125
110
|
getRootController(): any | undefined {
|
|
126
111
|
const rootControl: View = this.getRootControl() as View;
|
|
@@ -129,21 +114,21 @@ const TemplateComponent = UIComponent.extend("sap.fe.core.TemplateComponent", {
|
|
|
129
114
|
rootController = rootControl.getController() as PageController;
|
|
130
115
|
}
|
|
131
116
|
return rootController;
|
|
132
|
-
}
|
|
117
|
+
}
|
|
133
118
|
|
|
134
|
-
onPageReady
|
|
119
|
+
onPageReady(mParameters: any) {
|
|
135
120
|
const rootController = this.getRootController();
|
|
136
121
|
if (rootController && rootController.onPageReady) {
|
|
137
122
|
rootController.onPageReady(mParameters);
|
|
138
123
|
}
|
|
139
|
-
}
|
|
124
|
+
}
|
|
140
125
|
|
|
141
|
-
getNavigationConfiguration
|
|
142
|
-
const mNavigation = this.
|
|
126
|
+
getNavigationConfiguration(sTargetPath: string): any {
|
|
127
|
+
const mNavigation = this.navigation;
|
|
143
128
|
return mNavigation[sTargetPath];
|
|
144
|
-
}
|
|
129
|
+
}
|
|
145
130
|
|
|
146
|
-
getViewData
|
|
131
|
+
getViewData() {
|
|
147
132
|
const mProperties = this.getMetadata().getAllProperties();
|
|
148
133
|
const oViewData = Object.keys(mProperties).reduce((mViewData: any, sPropertyName: any) => {
|
|
149
134
|
mViewData[sPropertyName] = (mProperties[sPropertyName] as any).get(this);
|
|
@@ -154,20 +139,23 @@ const TemplateComponent = UIComponent.extend("sap.fe.core.TemplateComponent", {
|
|
|
154
139
|
oViewData.fclEnabled = this.oAppComponent._isFclEnabled();
|
|
155
140
|
|
|
156
141
|
return oViewData;
|
|
157
|
-
}
|
|
142
|
+
}
|
|
158
143
|
|
|
159
|
-
_getPageTitleInformation
|
|
144
|
+
_getPageTitleInformation() {
|
|
160
145
|
const rootControl = this.getRootControl() as View;
|
|
161
146
|
if (rootControl && rootControl.getController() && (rootControl.getController() as any)._getPageTitleInformation) {
|
|
162
147
|
return (rootControl.getController() as any)._getPageTitleInformation();
|
|
163
148
|
} else {
|
|
164
149
|
return {};
|
|
165
150
|
}
|
|
166
|
-
}
|
|
151
|
+
}
|
|
167
152
|
|
|
168
|
-
getExtensionAPI
|
|
153
|
+
getExtensionAPI() {
|
|
169
154
|
return ((this.getRootControl() as View).getController() as any).getExtensionAPI();
|
|
170
155
|
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
|
|
156
|
+
}
|
|
157
|
+
interface TemplateComponent {
|
|
158
|
+
// TODO: this should be ideally be handled by the editflow/routing without the need to have this method in the object page - for now keep it here
|
|
159
|
+
createDeferredContext?(sPath: string, oListBinding: ODataListBinding, bActionCreate: boolean): void;
|
|
160
|
+
}
|
|
161
|
+
export default TemplateComponent;
|
|
@@ -2,23 +2,21 @@
|
|
|
2
2
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
3
|
* (c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
4
4
|
*/
|
|
5
|
-
sap.ui.define(["sap/
|
|
5
|
+
sap.ui.define(["sap/fe/core/helpers/ClassSupport", "sap/ui/base/Object", "sap/ui/model/json/JSONModel"], function (ClassSupport, BaseObject, JSONModel) {
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
8
|
var _dec, _class;
|
|
9
9
|
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
10
|
+
var defineUI5Class = ClassSupport.defineUI5Class;
|
|
13
11
|
|
|
14
12
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
15
13
|
|
|
16
|
-
function
|
|
14
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
|
|
17
15
|
|
|
18
16
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
19
17
|
|
|
20
|
-
var TemplateModel = (_dec =
|
|
21
|
-
|
|
18
|
+
var TemplateModel = (_dec = defineUI5Class("sap.fe.core.TemplateModel"), _dec(_class = /*#__PURE__*/function (_BaseObject) {
|
|
19
|
+
_inheritsLoose(TemplateModel, _BaseObject);
|
|
22
20
|
|
|
23
21
|
function TemplateModel(pageConfig, oMetaModel) {
|
|
24
22
|
var _this;
|
|
@@ -51,7 +49,7 @@ sap.ui.define(["sap/ui/base/Object", "sap/ui/model/json/JSONModel", "sap/fe/core
|
|
|
51
49
|
_this.fnCreateMetaBindingContext = _this.oMetaModel.createBindingContext.bind(_this.oMetaModel);
|
|
52
50
|
_this.fnCreateConfigBindingContext = _this.oConfigModel.createBindingContext.bind(_this.oConfigModel);
|
|
53
51
|
_this.oConfigModel.createBindingContext = _this.createBindingContext.bind(_assertThisInitialized(_this));
|
|
54
|
-
return
|
|
52
|
+
return _this.oConfigModel || _assertThisInitialized(_this);
|
|
55
53
|
}
|
|
56
54
|
|
|
57
55
|
var _proto = TemplateModel.prototype;
|
|
@@ -78,4 +76,4 @@ sap.ui.define(["sap/ui/base/Object", "sap/ui/model/json/JSONModel", "sap/fe/core
|
|
|
78
76
|
}(BaseObject)) || _class);
|
|
79
77
|
return TemplateModel;
|
|
80
78
|
}, false);
|
|
81
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
79
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlRlbXBsYXRlTW9kZWwudHMiXSwibmFtZXMiOlsiVGVtcGxhdGVNb2RlbCIsImRlZmluZVVJNUNsYXNzIiwicGFnZUNvbmZpZyIsIm9NZXRhTW9kZWwiLCJvQ29uZmlnTW9kZWwiLCJKU09OTW9kZWwiLCJzZXRTaXplTGltaXQiLCJOdW1iZXIiLCJNQVhfVkFMVUUiLCJiQ29uZmlnTG9hZGVkIiwidGhhdCIsImZuR2V0T2JqZWN0IiwiX2dldE9iamVjdCIsImJpbmQiLCJzUGF0aCIsIm9Db250ZXh0Iiwic2V0RGF0YSIsImZuQ3JlYXRlTWV0YUJpbmRpbmdDb250ZXh0IiwiY3JlYXRlQmluZGluZ0NvbnRleHQiLCJmbkNyZWF0ZUNvbmZpZ0JpbmRpbmdDb250ZXh0IiwibVBhcmFtZXRlcnMiLCJmbkNhbGxCYWNrIiwib0JpbmRpbmdDb250ZXh0IiwiYk5vUmVzb2x2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FsbEJhY2spO1xuXHRcdH1cblxuXHRcdHJldHVybiBvQmluZGluZ0NvbnRleHQ7XG5cdH1cblxuXHRkZXN0cm95KCkge1xuXHRcdHRoaXMub0NvbmZpZ01vZGVsLmRlc3Ryb3koKTtcblx0XHRKU09OTW9kZWwucHJvdG90eXBlLmRlc3Ryb3kuYXBwbHkodGhpcyk7XG5cdH1cbn1cblxuZXhwb3J0IGRlZmF1bHQgVGVtcGxhdGVNb2RlbDtcbiJdfQ==
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { defineUI5Class } from "sap/fe/core/helpers/ClassSupport";
|
|
1
2
|
import BaseObject from "sap/ui/base/Object";
|
|
2
3
|
import JSONModel from "sap/ui/model/json/JSONModel";
|
|
3
|
-
import { UI5Class } from "sap/fe/core/helpers/ClassSupport";
|
|
4
4
|
import ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
|
|
5
5
|
|
|
6
|
-
@
|
|
6
|
+
@defineUI5Class("sap.fe.core.TemplateModel")
|
|
7
7
|
class TemplateModel extends BaseObject {
|
|
8
8
|
public oMetaModel: ODataMetaModel;
|
|
9
9
|
public oConfigModel: any;
|
|
@@ -23,7 +23,7 @@ class TemplateModel extends BaseObject {
|
|
|
23
23
|
|
|
24
24
|
if (typeof pageConfig === "function") {
|
|
25
25
|
const fnGetObject = this.oConfigModel._getObject.bind(this.oConfigModel);
|
|
26
|
-
this.oConfigModel._getObject = function(sPath: any, oContext: any) {
|
|
26
|
+
this.oConfigModel._getObject = function (sPath: any, oContext: any) {
|
|
27
27
|
if (!that.bConfigLoaded) {
|
|
28
28
|
this.setData(pageConfig());
|
|
29
29
|
that.bConfigLoaded = true;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
|
+
* (c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
4
|
+
*/
|
|
5
|
+
sap.ui.define(["sap/base/Log", "sap/base/util/ObjectPath", "sap/ui/model/json/JSONModel"], function (Log, ObjectPath, JSONModel) {
|
|
6
|
+
"use strict";
|
|
7
|
+
|
|
8
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
9
|
+
|
|
10
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
|
|
11
|
+
|
|
12
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
13
|
+
|
|
14
|
+
var AttributeModel = /*#__PURE__*/function (_JSONModel) {
|
|
15
|
+
_inheritsLoose(AttributeModel, _JSONModel);
|
|
16
|
+
|
|
17
|
+
function AttributeModel(oNode, oProps, buildingBlockDefinition) {
|
|
18
|
+
var _this;
|
|
19
|
+
|
|
20
|
+
_this = _JSONModel.call(this) || this;
|
|
21
|
+
_this.oNode = oNode;
|
|
22
|
+
_this.oProps = oProps;
|
|
23
|
+
_this.buildingBlockDefinition = buildingBlockDefinition;
|
|
24
|
+
_assertThisInitialized(_this).$$valueAsPromise = true;
|
|
25
|
+
return _this;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
var _proto = AttributeModel.prototype;
|
|
29
|
+
|
|
30
|
+
_proto._getObject = function _getObject(sPath) {
|
|
31
|
+
if ((sPath === undefined || sPath === "") && this.oProps) {
|
|
32
|
+
return this.oProps;
|
|
33
|
+
} // just return the attribute - we can't validate them and we don't support aggregations for now
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
var oValue = ObjectPath.get(sPath.replace(/\//g, "."), this.oProps);
|
|
37
|
+
|
|
38
|
+
if (oValue !== undefined) {
|
|
39
|
+
return oValue;
|
|
40
|
+
} // Deal with undefined properties
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
if (this.oProps && this.oProps.hasOwnProperty(sPath)) {
|
|
44
|
+
return this.oProps[sPath];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (sPath.indexOf(":") === -1 && sPath.indexOf("/") === -1) {
|
|
48
|
+
// Gloves are off, if you have this error you forgot to define your property on your metadata but are still using it in the underlying code
|
|
49
|
+
Log.error("Missing property ".concat(sPath, " on macro metadata ").concat(this.buildingBlockDefinition.name)); //throw new Error(`Missing property ${sPath} on macro metadata ${this.buildingBlockDefinition.name}`);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return this.oNode.getAttribute(sPath);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
return AttributeModel;
|
|
56
|
+
}(JSONModel);
|
|
57
|
+
|
|
58
|
+
return AttributeModel;
|
|
59
|
+
}, false);
|
|
60
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkF0dHJpYnV0ZU1vZGVsLnRzIl0sIm5hbWVzIjpbIkF0dHJpYnV0ZU1vZGVsIiwib05vZGUiLCJvUHJvcHMiLCJidWlsZGluZ0Jsb2NrRGVmaW5pdGlvbiIsIiQkdmFsdWVBc1Byb21pc2UiLCJfZ2V0T2JqZWN0Iiwic1BhdGgiLCJ1bmRlZmluZWQiLCJvVmFsdWUiLCJPYmplY3RQYXRoIiwiZ2V0IiwicmVwbGFjZSIsImhhc093blByb3BlcnR5IiwiaW5kZXhPZiIsIkxvZyIsImVycm9yIiwibmFtZSIsImdldEF0dHJpYnV0ZSIsIkpTT05Nb2RlbCJdLCJtYXBwaW5ncyI6IjtBQUFBO0FBQ0E7QUFDQTs7Ozs7Ozs7OztNQUdNQSxjOzs7QUFDTCw0QkFDa0JDLEtBRGxCLEVBRWtCQyxNQUZsQixFQUdrQkMsdUJBSGxCLEVBSUU7QUFBQTs7QUFDRDtBQURDLFlBSGdCRixLQUdoQixHQUhnQkEsS0FHaEI7QUFBQSxZQUZnQkMsTUFFaEIsR0FGZ0JBLE1BR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G5cdH1cbn1cblxuZXhwb3J0IGRlZmF1bHQgQXR0cmlidXRlTW9kZWw7XG4iXX0=
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import Log from "sap/base/Log";
|
|
2
|
+
import ObjectPath from "sap/base/util/ObjectPath";
|
|
3
|
+
import { BuildingBlockDefinition } from "sap/fe/core/buildingBlocks/BuildingBlock";
|
|
4
|
+
import JSONModel from "sap/ui/model/json/JSONModel";
|
|
5
|
+
|
|
6
|
+
class AttributeModel extends JSONModel {
|
|
7
|
+
constructor(
|
|
8
|
+
private readonly oNode: Element,
|
|
9
|
+
private readonly oProps: any,
|
|
10
|
+
private readonly buildingBlockDefinition: BuildingBlockDefinition
|
|
11
|
+
) {
|
|
12
|
+
super();
|
|
13
|
+
(this as any).$$valueAsPromise = true;
|
|
14
|
+
}
|
|
15
|
+
_getObject(sPath: any /*oContext: any*/) {
|
|
16
|
+
if ((sPath === undefined || sPath === "") && this.oProps) {
|
|
17
|
+
return this.oProps;
|
|
18
|
+
}
|
|
19
|
+
// just return the attribute - we can't validate them and we don't support aggregations for now
|
|
20
|
+
const oValue = ObjectPath.get(sPath.replace(/\//g, "."), this.oProps);
|
|
21
|
+
if (oValue !== undefined) {
|
|
22
|
+
return oValue;
|
|
23
|
+
}
|
|
24
|
+
// Deal with undefined properties
|
|
25
|
+
if (this.oProps && this.oProps.hasOwnProperty(sPath)) {
|
|
26
|
+
return this.oProps[sPath];
|
|
27
|
+
}
|
|
28
|
+
if (sPath.indexOf(":") === -1 && sPath.indexOf("/") === -1) {
|
|
29
|
+
// Gloves are off, if you have this error you forgot to define your property on your metadata but are still using it in the underlying code
|
|
30
|
+
Log.error(`Missing property ${sPath} on macro metadata ${this.buildingBlockDefinition.name}`);
|
|
31
|
+
//throw new Error(`Missing property ${sPath} on macro metadata ${this.buildingBlockDefinition.name}`);
|
|
32
|
+
}
|
|
33
|
+
return this.oNode.getAttribute(sPath);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export default AttributeModel;
|