@sapui5/sap.fe.core 1.97.0 → 1.100.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 +7 -4
- package/src/sap/fe/core/.library +1 -1
- package/src/sap/fe/core/AnnotationHelper.js +309 -405
- package/src/sap/fe/core/AnnotationHelper.ts +315 -0
- package/src/sap/fe/core/AppComponent.js +389 -397
- package/src/sap/fe/core/AppComponent.ts +403 -0
- package/src/sap/fe/core/AppStateHandler.js +198 -181
- package/src/sap/fe/core/AppStateHandler.ts +171 -0
- package/src/sap/fe/core/BaseController.js +83 -58
- package/src/sap/fe/core/BaseController.ts +68 -0
- 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 +2164 -2379
- package/src/sap/fe/core/CommonUtils.ts +2177 -0
- package/src/sap/fe/core/ExtensionAPI.js +279 -266
- package/src/sap/fe/core/ExtensionAPI.ts +250 -0
- package/src/sap/fe/core/PageController.js +218 -125
- package/src/sap/fe/core/PageController.ts +129 -0
- package/src/sap/fe/core/RouterProxy.js +924 -807
- package/src/sap/fe/core/RouterProxy.ts +840 -0
- package/src/sap/fe/core/Synchronization.js +41 -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 +173 -0
- package/src/sap/fe/core/TemplateModel.js +79 -54
- package/src/sap/fe/core/TemplateModel.ts +63 -0
- package/src/sap/fe/core/TransactionHelper.js +1560 -1579
- package/src/sap/fe/core/TransactionHelper.ts +1717 -0
- package/src/sap/fe/core/actions/collaboration/ActivitySync.js +392 -0
- package/src/sap/fe/core/actions/collaboration/ActivitySync.ts +355 -0
- package/src/sap/fe/core/actions/collaboration/CollaborationCommon.js +136 -0
- package/src/sap/fe/core/actions/collaboration/CollaborationCommon.ts +119 -0
- package/src/sap/fe/core/actions/collaboration/Manage.js +262 -0
- package/src/sap/fe/core/actions/collaboration/Manage.ts +244 -0
- package/src/sap/fe/core/actions/collaboration/ManageDialog.fragment.xml +103 -0
- package/src/sap/fe/core/actions/collaboration/UserDetails.fragment.xml +13 -0
- package/src/sap/fe/core/actions/draft.js +521 -581
- package/src/sap/fe/core/actions/draft.ts +566 -0
- package/src/sap/fe/core/actions/messageHandling.js +564 -511
- package/src/sap/fe/core/actions/messageHandling.ts +552 -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 +1093 -1211
- package/src/sap/fe/core/actions/operations.ts +1192 -0
- package/src/sap/fe/core/actions/sticky.js +114 -104
- package/src/sap/fe/core/actions/sticky.ts +119 -0
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +70 -66
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.ts +65 -0
- package/src/sap/fe/core/controllerextensions/EditFlow.js +1594 -1701
- package/src/sap/fe/core/controllerextensions/EditFlow.ts +1672 -0
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +80 -54
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +61 -0
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +719 -505
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +783 -0
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +797 -813
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +803 -0
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +1005 -973
- package/src/sap/fe/core/controllerextensions/InternalRouting.ts +978 -0
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +530 -476
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +137 -46
- package/src/sap/fe/core/controllerextensions/MassEdit.js +144 -0
- package/src/sap/fe/core/controllerextensions/MassEdit.ts +156 -0
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +234 -232
- package/src/sap/fe/core/controllerextensions/MessageHandler.ts +225 -0
- package/src/sap/fe/core/controllerextensions/PageReady.js +302 -337
- package/src/sap/fe/core/controllerextensions/PageReady.ts +23 -17
- package/src/sap/fe/core/controllerextensions/Paginator.js +189 -148
- package/src/sap/fe/core/controllerextensions/Paginator.ts +163 -0
- package/src/sap/fe/core/controllerextensions/Placeholder.js +158 -146
- package/src/sap/fe/core/controllerextensions/Placeholder.ts +151 -0
- package/src/sap/fe/core/controllerextensions/Routing.js +145 -106
- package/src/sap/fe/core/controllerextensions/Routing.ts +132 -0
- package/src/sap/fe/core/controllerextensions/RoutingListener.js +8 -6
- package/src/sap/fe/core/controllerextensions/RoutingListener.ts +3 -0
- package/src/sap/fe/core/controllerextensions/Share.js +220 -244
- package/src/sap/fe/core/controllerextensions/Share.ts +231 -0
- package/src/sap/fe/core/controllerextensions/SideEffects.js +593 -634
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +29 -27
- package/src/sap/fe/core/controllerextensions/ViewState.js +789 -806
- package/src/sap/fe/core/controllerextensions/ViewState.ts +805 -0
- package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +4 -3
- package/src/sap/fe/core/controls/ActionPartial.fragment.xml +2 -2
- package/src/sap/fe/core/controls/CommandExecution.js +68 -66
- package/src/sap/fe/core/controls/CommandExecution.ts +72 -0
- package/src/sap/fe/core/controls/ConditionalWrapper.js +91 -75
- package/src/sap/fe/core/controls/ConditionalWrapper.ts +83 -0
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +131 -125
- package/src/sap/fe/core/controls/CustomQuickViewPage.ts +126 -0
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +105 -110
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +101 -0
- package/src/sap/fe/core/controls/FieldWrapper.js +122 -140
- package/src/sap/fe/core/controls/FieldWrapper.ts +115 -0
- package/src/sap/fe/core/controls/FilterBar.js +163 -159
- package/src/sap/fe/core/controls/FilterBar.ts +143 -0
- package/src/sap/fe/core/controls/FormElementWrapper.js +46 -44
- package/src/sap/fe/core/controls/FormElementWrapper.ts +40 -0
- package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +38 -42
- package/src/sap/fe/core/controls/MultiValueParameterDelegate.ts +31 -0
- package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +2 -1
- package/src/sap/fe/core/controls/filterbar/FilterContainer.js +127 -116
- package/src/sap/fe/core/controls/filterbar/FilterContainer.ts +98 -0
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +242 -255
- package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +245 -0
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +151 -141
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +125 -0
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +336 -322
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +337 -0
- 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/controls/massEdit/MassEditHandlers.ts +70 -0
- package/src/sap/fe/core/converters/ConverterContext.js +348 -367
- package/src/sap/fe/core/converters/ConverterContext.ts +33 -19
- package/src/sap/fe/core/converters/ManifestSettings.js +12 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +16 -1
- package/src/sap/fe/core/converters/ManifestWrapper.js +354 -354
- package/src/sap/fe/core/converters/ManifestWrapper.ts +34 -6
- package/src/sap/fe/core/converters/MetaModelConverter.js +72 -9
- package/src/sap/fe/core/converters/MetaModelConverter.ts +75 -16
- package/src/sap/fe/core/converters/TemplateConverter.js +1 -1
- package/src/sap/fe/core/converters/TemplateConverter.ts +4 -3
- package/src/sap/fe/core/converters/annotations/DataField.js +28 -14
- package/src/sap/fe/core/converters/annotations/DataField.ts +38 -14
- package/src/sap/fe/core/converters/common/AnnotationConverter.js +33 -21
- package/src/sap/fe/core/converters/controls/Common/Action.js +11 -2
- package/src/sap/fe/core/converters/controls/Common/Action.ts +8 -2
- 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 +21 -11
- package/src/sap/fe/core/converters/controls/Common/Form.ts +28 -6
- package/src/sap/fe/core/converters/controls/Common/KPI.js +69 -4
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +75 -2
- package/src/sap/fe/core/converters/controls/Common/Table.js +507 -408
- package/src/sap/fe/core/converters/controls/Common/Table.ts +618 -500
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +592 -0
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +718 -0
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +465 -59
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +462 -72
- 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 +17 -9
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +24 -9
- package/src/sap/fe/core/converters/helpers/Aggregation.js +118 -121
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +28 -5
- package/src/sap/fe/core/converters/helpers/BindingHelper.js +20 -6
- package/src/sap/fe/core/converters/helpers/BindingHelper.ts +16 -4
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +12 -1
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +11 -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/helpers/Key.js +42 -57
- package/src/sap/fe/core/converters/helpers/Key.ts +1 -1
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +28 -7
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +23 -6
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +20 -7
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +36 -14
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +7 -5
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +5 -1
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +93 -90
- package/src/sap/fe/core/designtime/AppComponent.designtime.ts +91 -0
- package/src/sap/fe/core/formatters/CollaborationFormatter.js +104 -0
- package/src/sap/fe/core/formatters/CollaborationFormatter.ts +60 -0
- 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 +91 -29
- package/src/sap/fe/core/formatters/TableFormatter.ts +94 -28
- 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 +51 -54
- package/src/sap/fe/core/fpm/Component.ts +48 -0
- package/src/sap/fe/core/helpers/AppStartupHelper.js +373 -0
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +417 -0
- package/src/sap/fe/core/helpers/BindingExpression.js +489 -442
- package/src/sap/fe/core/helpers/BindingExpression.ts +486 -469
- package/src/sap/fe/core/helpers/ClassSupport.js +212 -76
- package/src/sap/fe/core/helpers/ClassSupport.ts +198 -71
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +64 -59
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +52 -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 +4 -5
- package/src/sap/fe/core/helpers/KeepAliveHelper.ts +10 -10
- package/src/sap/fe/core/helpers/MassEditHelper.js +604 -0
- package/src/sap/fe/core/helpers/MassEditHelper.ts +699 -0
- package/src/sap/fe/core/helpers/ModelHelper.js +253 -225
- package/src/sap/fe/core/helpers/ModelHelper.ts +250 -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 +336 -313
- package/src/sap/fe/core/helpers/SemanticDateOperators.ts +334 -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 +427 -425
- package/src/sap/fe/core/library.support.js +23 -27
- package/src/sap/fe/core/library.support.ts +23 -0
- package/src/sap/fe/core/library.ts +420 -0
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +64 -0
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +69 -0
- package/src/sap/fe/core/messagebundle.properties +78 -13
- package/src/sap/fe/core/messagebundle_ar.properties +58 -7
- package/src/sap/fe/core/messagebundle_bg.properties +58 -7
- package/src/sap/fe/core/messagebundle_ca.properties +58 -7
- package/src/sap/fe/core/messagebundle_cs.properties +59 -8
- package/src/sap/fe/core/messagebundle_cy.properties +58 -7
- package/src/sap/fe/core/messagebundle_da.properties +58 -7
- package/src/sap/fe/core/messagebundle_de.properties +58 -7
- package/src/sap/fe/core/messagebundle_el.properties +58 -7
- package/src/sap/fe/core/messagebundle_en.properties +57 -6
- package/src/sap/fe/core/messagebundle_en_GB.properties +57 -6
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +61 -6
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +58 -7
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +58 -7
- package/src/sap/fe/core/messagebundle_es.properties +58 -7
- package/src/sap/fe/core/messagebundle_es_MX.properties +58 -7
- package/src/sap/fe/core/messagebundle_et.properties +58 -7
- package/src/sap/fe/core/messagebundle_fi.properties +60 -9
- package/src/sap/fe/core/messagebundle_fr.properties +64 -13
- package/src/sap/fe/core/messagebundle_fr_CA.properties +59 -8
- package/src/sap/fe/core/messagebundle_hi.properties +58 -7
- package/src/sap/fe/core/messagebundle_hr.properties +58 -7
- package/src/sap/fe/core/messagebundle_hu.properties +59 -8
- package/src/sap/fe/core/messagebundle_id.properties +61 -10
- package/src/sap/fe/core/messagebundle_it.properties +58 -7
- package/src/sap/fe/core/messagebundle_iw.properties +58 -7
- package/src/sap/fe/core/messagebundle_ja.properties +58 -7
- package/src/sap/fe/core/messagebundle_kk.properties +58 -7
- package/src/sap/fe/core/messagebundle_ko.properties +58 -7
- package/src/sap/fe/core/messagebundle_lt.properties +58 -7
- package/src/sap/fe/core/messagebundle_lv.properties +59 -8
- package/src/sap/fe/core/messagebundle_ms.properties +58 -7
- package/src/sap/fe/core/messagebundle_nl.properties +58 -7
- package/src/sap/fe/core/messagebundle_no.properties +58 -7
- package/src/sap/fe/core/messagebundle_pl.properties +58 -7
- package/src/sap/fe/core/messagebundle_pt.properties +59 -8
- package/src/sap/fe/core/messagebundle_pt_PT.properties +58 -7
- package/src/sap/fe/core/messagebundle_ro.properties +58 -7
- package/src/sap/fe/core/messagebundle_ru.properties +58 -7
- package/src/sap/fe/core/messagebundle_sh.properties +58 -7
- package/src/sap/fe/core/messagebundle_sk.properties +58 -7
- package/src/sap/fe/core/messagebundle_sl.properties +58 -7
- package/src/sap/fe/core/messagebundle_sv.properties +59 -8
- package/src/sap/fe/core/messagebundle_th.properties +58 -7
- package/src/sap/fe/core/messagebundle_tr.properties +60 -9
- package/src/sap/fe/core/messagebundle_uk.properties +58 -7
- package/src/sap/fe/core/messagebundle_vi.properties +58 -7
- package/src/sap/fe/core/messagebundle_zh_CN.properties +58 -7
- package/src/sap/fe/core/messagebundle_zh_TW.properties +58 -7
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +45 -71
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +3 -1
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +231 -202
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +212 -0
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +67 -92
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +10 -6
- package/src/sap/fe/core/services/NavigationServiceFactory.js +351 -300
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +313 -0
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +114 -81
- package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +83 -0
- package/src/sap/fe/core/services/RoutingServiceFactory.js +927 -1152
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +898 -0
- package/src/sap/fe/core/services/ShellServicesFactory.js +649 -707
- package/src/sap/fe/core/services/ShellServicesFactory.ts +52 -15
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +569 -637
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +78 -102
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +429 -478
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +460 -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/CommonHelper.js +1 -1
- package/src/sap/fe/core/support/CommonHelper.ts +1 -1
- package/src/sap/fe/core/support/Diagnostics.js +36 -48
- 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 +97 -127
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +112 -135
- 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/FieldControlHelper.js +8 -8
- package/src/sap/fe/core/templating/FieldControlHelper.ts +25 -7
- package/src/sap/fe/core/templating/FilterHelper.js +140 -78
- package/src/sap/fe/core/templating/FilterHelper.ts +149 -78
- package/src/sap/fe/core/templating/PropertyHelper.js +3 -3
- package/src/sap/fe/core/templating/PropertyHelper.ts +2 -2
- package/src/sap/fe/core/templating/UIFormatters.js +76 -135
- package/src/sap/fe/core/templating/UIFormatters.ts +76 -99
- 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
- package/src/sap/fe/core/controls/filterbar.d.js +0 -8
- package/src/sap/fe/core/controls/filterbar.d.ts +0 -0
|
@@ -1,20 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import OverrideExecution from "sap/ui/core/mvc/OverrideExecution";
|
|
2
|
+
import ObjectPath from "sap/base/util/ObjectPath";
|
|
3
|
+
import ElementMetadata from "sap/ui/core/ElementMetadata";
|
|
4
|
+
import RenderManager from "sap/ui/core/RenderManager";
|
|
5
|
+
import Metadata from "sap/ui/base/Metadata";
|
|
6
|
+
import ControllerExtensionMetadata from "sap/fe/core/controllerextensions/ControllerExtensionMetadata";
|
|
7
|
+
import ControllerMetadata from "sap/ui/core/mvc/ControllerMetadata";
|
|
8
|
+
import uid from "sap/base/util/uid";
|
|
9
|
+
import merge from "sap/base/util/merge";
|
|
10
|
+
import UI5Event from "sap/ui/base/Event";
|
|
4
11
|
|
|
5
12
|
const ensureMetadata = function(target: any) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
target.metadata = merge(
|
|
14
|
+
{
|
|
15
|
+
controllerExtensions: {},
|
|
16
|
+
properties: {},
|
|
17
|
+
macroContexts: {},
|
|
18
|
+
aggregations: {},
|
|
19
|
+
associations: {},
|
|
20
|
+
methods: {},
|
|
21
|
+
events: {}
|
|
22
|
+
},
|
|
23
|
+
target.metadata || {}
|
|
24
|
+
);
|
|
18
25
|
return target.metadata;
|
|
19
26
|
};
|
|
20
27
|
export function Override(sTarget?: string) {
|
|
@@ -44,22 +51,25 @@ export function Extensible(oOverrideExecution?: OverrideExecution) {
|
|
|
44
51
|
metadata.methods[propertyKey].overrideExecution = oOverrideExecution;
|
|
45
52
|
};
|
|
46
53
|
}
|
|
47
|
-
export function Public(target: any, propertyKey: string) {
|
|
54
|
+
export function Public(target: any, propertyKey: string, descriptor: any): any {
|
|
48
55
|
const metadata = ensureMetadata(target);
|
|
56
|
+
descriptor.enumerable = true;
|
|
49
57
|
if (!metadata.methods[propertyKey]) {
|
|
50
58
|
metadata.methods[propertyKey] = {};
|
|
51
59
|
}
|
|
52
60
|
metadata.methods[propertyKey].public = true;
|
|
53
61
|
}
|
|
54
|
-
export function Private(target: any, propertyKey: string) {
|
|
62
|
+
export function Private(target: any, propertyKey: string, descriptor: any) {
|
|
55
63
|
const metadata = ensureMetadata(target);
|
|
64
|
+
descriptor.enumerable = true;
|
|
56
65
|
if (!metadata.methods[propertyKey]) {
|
|
57
66
|
metadata.methods[propertyKey] = {};
|
|
58
67
|
}
|
|
59
68
|
metadata.methods[propertyKey].public = false;
|
|
60
69
|
}
|
|
61
|
-
export function Final(target: any, propertyKey: string) {
|
|
70
|
+
export function Final(target: any, propertyKey: string, descriptor: any) {
|
|
62
71
|
const metadata = ensureMetadata(target);
|
|
72
|
+
descriptor.enumerable = true;
|
|
63
73
|
if (!metadata.methods[propertyKey]) {
|
|
64
74
|
metadata.methods[propertyKey] = {};
|
|
65
75
|
}
|
|
@@ -84,6 +94,14 @@ export function MacroContext(bMetaModelObject: boolean = false): any {
|
|
|
84
94
|
return Property({ type: "sap.ui.model.Context", macroContext: true, metaModelObject: bMetaModelObject });
|
|
85
95
|
}
|
|
86
96
|
|
|
97
|
+
export function UsingExtension(extensionClass: any): any {
|
|
98
|
+
return function(target: any, propertyKey: string, propertyDescriptor: PropertyDescriptor): any {
|
|
99
|
+
const metadata = ensureMetadata(target);
|
|
100
|
+
delete (propertyDescriptor as any).initializer;
|
|
101
|
+
metadata.controllerExtensions[propertyKey] = extensionClass;
|
|
102
|
+
return propertyDescriptor;
|
|
103
|
+
};
|
|
104
|
+
}
|
|
87
105
|
export function Property(oPropertyParams: any): any {
|
|
88
106
|
return function(target: any, propertyKey: string, propertyDescriptor: PropertyDescriptor): any {
|
|
89
107
|
const metadata = ensureMetadata(target);
|
|
@@ -97,12 +115,12 @@ export function Property(oPropertyParams: any): any {
|
|
|
97
115
|
}
|
|
98
116
|
delete propertyDescriptor.writable;
|
|
99
117
|
delete (propertyDescriptor as any).initializer;
|
|
100
|
-
(propertyDescriptor as any).set = function(v: any) {
|
|
101
|
-
|
|
102
|
-
};
|
|
103
|
-
(propertyDescriptor as any).get = function() {
|
|
104
|
-
|
|
105
|
-
};
|
|
118
|
+
// (propertyDescriptor as any).set = function(v: any) {
|
|
119
|
+
// return this.setProperty(propertyKey, v);
|
|
120
|
+
// };
|
|
121
|
+
// (propertyDescriptor as any).get = function() {
|
|
122
|
+
// return this.getProperty(propertyKey);
|
|
123
|
+
// };
|
|
106
124
|
|
|
107
125
|
return propertyDescriptor;
|
|
108
126
|
};
|
|
@@ -119,12 +137,12 @@ export function Aggregation(oAggregationDescriptor?: any): any {
|
|
|
119
137
|
}
|
|
120
138
|
delete propertyDescriptor.writable;
|
|
121
139
|
delete (propertyDescriptor as any).initializer;
|
|
122
|
-
(propertyDescriptor as any).set = function(v: any) {
|
|
123
|
-
|
|
124
|
-
};
|
|
125
|
-
(propertyDescriptor as any).get = function() {
|
|
126
|
-
|
|
127
|
-
};
|
|
140
|
+
// (propertyDescriptor as any).set = function(v: any) {
|
|
141
|
+
// return this.setAggregation(propertyKey, v);
|
|
142
|
+
// };
|
|
143
|
+
// (propertyDescriptor as any).get = function() {
|
|
144
|
+
// return this.getAggregation(propertyKey);
|
|
145
|
+
// };
|
|
128
146
|
|
|
129
147
|
return propertyDescriptor;
|
|
130
148
|
};
|
|
@@ -138,12 +156,12 @@ export function Association(oAssociationDescription?: any): any {
|
|
|
138
156
|
}
|
|
139
157
|
delete propertyDescriptor.writable;
|
|
140
158
|
delete (propertyDescriptor as any).initializer;
|
|
141
|
-
(propertyDescriptor as any).set = function(v: any) {
|
|
142
|
-
|
|
143
|
-
};
|
|
144
|
-
(propertyDescriptor as any).get = function() {
|
|
145
|
-
|
|
146
|
-
};
|
|
159
|
+
// (propertyDescriptor as any).set = function(v: any) {
|
|
160
|
+
// return this.setAggregation(propertyKey, v);
|
|
161
|
+
// };
|
|
162
|
+
// (propertyDescriptor as any).get = function() {
|
|
163
|
+
// return this.getAggregation(propertyKey);
|
|
164
|
+
// };
|
|
147
165
|
|
|
148
166
|
return propertyDescriptor;
|
|
149
167
|
};
|
|
@@ -151,9 +169,16 @@ export function Association(oAssociationDescription?: any): any {
|
|
|
151
169
|
type ControlPropertyNames<T> = {
|
|
152
170
|
[K in keyof T]: T[K] extends Function ? never : K;
|
|
153
171
|
}[keyof T];
|
|
154
|
-
export type PropertiesOf<T> = Partial<Pick<T, ControlPropertyNames<T
|
|
172
|
+
export type PropertiesOf<T> = Partial<Pick<T, ControlPropertyNames<T>>>;
|
|
155
173
|
|
|
156
|
-
|
|
174
|
+
/**
|
|
175
|
+
* Decorator to provide a new API class to be used in the macros.
|
|
176
|
+
*
|
|
177
|
+
* @param sTarget The fully qualified name of the macro API
|
|
178
|
+
* @param isDependentBound Whether this API will be used as a dependent or not
|
|
179
|
+
* @class
|
|
180
|
+
*/
|
|
181
|
+
export function APIClass(sTarget: string, isDependentBound = false) {
|
|
157
182
|
return function(constructor: Function) {
|
|
158
183
|
if (!constructor.prototype.metadata) {
|
|
159
184
|
constructor.prototype.metadata = {};
|
|
@@ -163,7 +188,7 @@ export function APIClass(sTarget: string) {
|
|
|
163
188
|
constructor.prototype.metadata.interfaces = [];
|
|
164
189
|
}
|
|
165
190
|
constructor.prototype.metadata.interfaces.push("sap.ui.core.IFormContent");
|
|
166
|
-
|
|
191
|
+
(constructor as any).isDependentBound = isDependentBound;
|
|
167
192
|
if (!constructor.prototype.renderer) {
|
|
168
193
|
constructor.prototype.renderer = {
|
|
169
194
|
apiVersion: 2,
|
|
@@ -176,22 +201,29 @@ export function APIClass(sTarget: string) {
|
|
|
176
201
|
describe(constructor, sTarget, constructor.prototype, ElementMetadata);
|
|
177
202
|
};
|
|
178
203
|
}
|
|
179
|
-
export function UI5Class(sTarget: string, metadataClass?: any, metadataDefinition?: any) {
|
|
204
|
+
export function UI5Class(sTarget: string, metadataClass?: any, metadataDefinition?: any, useExtend: boolean = true) {
|
|
180
205
|
return function(constructor: Function) {
|
|
181
206
|
if (!constructor.prototype.metadata) {
|
|
182
207
|
constructor.prototype.metadata = {};
|
|
183
208
|
}
|
|
184
|
-
if (metadataDefinition
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
constructor.prototype.metadata.events = metadataDefinition.events;
|
|
209
|
+
if (metadataDefinition) {
|
|
210
|
+
Object.keys(metadataDefinition).forEach(key => {
|
|
211
|
+
constructor.prototype.metadata[key] = metadataDefinition[key];
|
|
212
|
+
});
|
|
189
213
|
}
|
|
190
|
-
describe(constructor, sTarget, constructor.prototype, metadataClass);
|
|
214
|
+
return describe(constructor, sTarget, constructor.prototype, metadataClass, useExtend);
|
|
191
215
|
};
|
|
192
216
|
}
|
|
193
|
-
|
|
194
|
-
|
|
217
|
+
function describe(clazz: any, name: string, inObj: any, metadataClass?: any, useExtend: boolean = true) {
|
|
218
|
+
if (metadataClass === ControllerExtensionMetadata) {
|
|
219
|
+
Object.getOwnPropertyNames(inObj).forEach(objName => {
|
|
220
|
+
const descriptor = Object.getOwnPropertyDescriptor(inObj, objName);
|
|
221
|
+
if (descriptor && !descriptor.enumerable) {
|
|
222
|
+
descriptor.enumerable = true;
|
|
223
|
+
// Log.error(`Property ${objName} from ${name} should be decorated as public`);
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
}
|
|
195
227
|
const obj: any = {};
|
|
196
228
|
obj.metadata = inObj.metadata || {};
|
|
197
229
|
obj.override = inObj.override;
|
|
@@ -199,34 +231,129 @@ function describe(clazz: any, name: string, inObj: any, metadataClass?: any) {
|
|
|
199
231
|
obj.metadata.baseType = Object.getPrototypeOf(clazz.prototype)
|
|
200
232
|
.getMetadata()
|
|
201
233
|
.getName();
|
|
202
|
-
|
|
234
|
+
|
|
235
|
+
const rendererDefinition = inObj.renderer || clazz.renderer;
|
|
236
|
+
obj.renderer = { apiVersion: 2 };
|
|
237
|
+
if (typeof rendererDefinition === "function") {
|
|
238
|
+
obj.renderer.render = rendererDefinition;
|
|
239
|
+
} else if (rendererDefinition != undefined) {
|
|
240
|
+
obj.renderer = rendererDefinition;
|
|
241
|
+
}
|
|
203
242
|
obj.metadata.interfaces = inObj.metadata?.interfaces || clazz.metadata?.interfaces;
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
243
|
+
if (useExtend) {
|
|
244
|
+
Object.keys(clazz.prototype).forEach(key => {
|
|
245
|
+
if (key !== "metadata") {
|
|
246
|
+
try {
|
|
247
|
+
obj[key] = clazz.prototype[key];
|
|
248
|
+
} catch (e) {
|
|
249
|
+
//console.log(e);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
if (obj.metadata?.controllerExtensions && Object.keys(obj.metadata.controllerExtensions).length > 0) {
|
|
255
|
+
for (const cExtName in obj.metadata.controllerExtensions) {
|
|
256
|
+
obj[cExtName] = obj.metadata.controllerExtensions[cExtName];
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
let output = clazz;
|
|
260
|
+
if (useExtend) {
|
|
261
|
+
output = clazz.extend(name, obj, metadataClass);
|
|
262
|
+
const fnInit = output.prototype.init;
|
|
263
|
+
output.prototype.init = function(...args: any[]) {
|
|
264
|
+
fnInit && fnInit.apply(this, args);
|
|
265
|
+
this.metadata = obj.metadata;
|
|
266
|
+
|
|
267
|
+
if (obj.metadata.properties) {
|
|
268
|
+
const aPropertyKeys = Object.keys(obj.metadata.properties);
|
|
269
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
270
|
+
const that = this;
|
|
271
|
+
aPropertyKeys.forEach(propertyKey => {
|
|
272
|
+
Object.defineProperty(that, propertyKey, {
|
|
273
|
+
configurable: true,
|
|
274
|
+
set: (v: any) => {
|
|
275
|
+
return that.setProperty(propertyKey, v);
|
|
276
|
+
},
|
|
277
|
+
get: () => {
|
|
278
|
+
return that.getProperty(propertyKey);
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
});
|
|
282
|
+
const aAggregationKeys = Object.keys(obj.metadata.aggregations);
|
|
283
|
+
aAggregationKeys.forEach(aggregationKey => {
|
|
284
|
+
Object.defineProperty(that, aggregationKey, {
|
|
285
|
+
configurable: true,
|
|
286
|
+
set: (v: any) => {
|
|
287
|
+
return that.setAggregation(aggregationKey, v);
|
|
288
|
+
},
|
|
289
|
+
get: () => {
|
|
290
|
+
return that.getAggregation(aggregationKey);
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
};
|
|
207
296
|
} else {
|
|
208
|
-
metadata
|
|
297
|
+
let metadata: any;
|
|
298
|
+
if (metadataClass) {
|
|
299
|
+
metadata = new metadataClass(name, obj);
|
|
300
|
+
} else {
|
|
301
|
+
metadata = new ElementMetadata(name, obj);
|
|
302
|
+
}
|
|
303
|
+
clazz.getMetadata = clazz.prototype.getMetadata = function() {
|
|
304
|
+
return metadata;
|
|
305
|
+
};
|
|
306
|
+
if (!clazz.getMetadata().isFinal()) {
|
|
307
|
+
clazz.extend = function(sSCName: string, oSCClassInfo: any, fnSCMetaImpl: Function) {
|
|
308
|
+
// the default constructor created by ui5 does not return the value which is problematic with TS
|
|
309
|
+
oSCClassInfo.constructor = function(...args: any[]) {
|
|
310
|
+
return clazz.apply(this, args);
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
const fnClass = (Metadata as any).createClass(
|
|
314
|
+
clazz,
|
|
315
|
+
sSCName,
|
|
316
|
+
oSCClassInfo,
|
|
317
|
+
fnSCMetaImpl || metadataClass || ElementMetadata
|
|
318
|
+
);
|
|
319
|
+
// fnClass.prototype.constructor = function(...args: any[]) {
|
|
320
|
+
// return clazz.apply(this, ...args);
|
|
321
|
+
// };
|
|
322
|
+
return fnClass;
|
|
323
|
+
};
|
|
324
|
+
}
|
|
209
325
|
}
|
|
210
|
-
clazz.
|
|
211
|
-
|
|
326
|
+
clazz.override = function(oExtension: any) {
|
|
327
|
+
const pol = {};
|
|
328
|
+
(pol as any).constructor = function(...args: any[]) {
|
|
329
|
+
return clazz.apply(this, args as any);
|
|
330
|
+
};
|
|
331
|
+
const oClass = (Metadata as any).createClass(clazz, "anonymousExtension~" + uid(), pol, ControllerMetadata);
|
|
332
|
+
oClass.getMetadata()._staticOverride = oExtension;
|
|
333
|
+
oClass.getMetadata()._override = (clazz.getMetadata() as any)._override;
|
|
334
|
+
return oClass;
|
|
212
335
|
};
|
|
336
|
+
|
|
213
337
|
const fnInit = clazz.prototype.init;
|
|
214
|
-
|
|
215
|
-
fnInit.apply(this, args);
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
338
|
+
output.prototype.init = function(...args: any[]) {
|
|
339
|
+
fnInit && fnInit.apply(this, args);
|
|
340
|
+
if (obj.metadata.properties) {
|
|
341
|
+
const aPropertyKeys = Object.keys(obj.metadata.properties);
|
|
342
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
343
|
+
const that = this;
|
|
344
|
+
aPropertyKeys.forEach(propertyKey => {
|
|
345
|
+
Object.defineProperty(that, propertyKey, {
|
|
346
|
+
configurable: true,
|
|
347
|
+
set: (v: any) => {
|
|
348
|
+
return that.setProperty(propertyKey, v);
|
|
349
|
+
},
|
|
350
|
+
get: () => {
|
|
351
|
+
return that.getProperty(propertyKey);
|
|
352
|
+
}
|
|
353
|
+
});
|
|
228
354
|
});
|
|
229
|
-
}
|
|
355
|
+
}
|
|
230
356
|
};
|
|
231
|
-
ObjectPath.set(name,
|
|
357
|
+
ObjectPath.set(name, output);
|
|
358
|
+
return output;
|
|
232
359
|
}
|
|
@@ -1,61 +1,66 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* SAPUI5
|
|
3
|
-
*
|
|
2
|
+
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
|
+
* (c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
4
4
|
*/
|
|
5
|
-
sap.ui.define(["sap/ui/base/BindingParser"], function(BindingParser) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
5
|
+
sap.ui.define(["sap/ui/base/BindingParser"], function (BindingParser) {
|
|
6
|
+
"use strict";
|
|
7
|
+
|
|
8
|
+
var _exports = {};
|
|
9
|
+
|
|
10
|
+
function getObject(oObject, sPath) {
|
|
11
|
+
if (!oObject) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
var sPathSplit = sPath.split("/");
|
|
16
|
+
|
|
17
|
+
if (sPathSplit.length === 1) {
|
|
18
|
+
return oObject[sPath];
|
|
19
|
+
} else {
|
|
20
|
+
return getObject(oObject[sPathSplit[0]], sPathSplit.splice(1).join("/"));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Resolve a dynamic annotation path down to a standard annotation path.
|
|
25
|
+
*
|
|
26
|
+
* @param sAnnotationPath
|
|
27
|
+
* @param oMetaModel
|
|
28
|
+
* @returns {string} The non dynamic version of the annotation path
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
function resolveDynamicExpression(sAnnotationPath, oMetaModel) {
|
|
33
|
+
if (sAnnotationPath.indexOf("[") !== -1) {
|
|
34
|
+
var firstBracket = sAnnotationPath.indexOf("[");
|
|
35
|
+
var sStableBracket = sAnnotationPath.substr(0, firstBracket);
|
|
36
|
+
var sRest = sAnnotationPath.substr(firstBracket + 1);
|
|
37
|
+
var lastBracket = sRest.indexOf("]");
|
|
38
|
+
var aValue = oMetaModel.getObject(sStableBracket);
|
|
39
|
+
var oExpression = BindingParser.parseExpression(sRest.substr(0, lastBracket));
|
|
40
|
+
|
|
41
|
+
if (Array.isArray(aValue) && oExpression && oExpression.result && oExpression.result.parts && oExpression.result.parts[0] && oExpression.result.parts[0].path) {
|
|
42
|
+
var i;
|
|
43
|
+
var bFound = false;
|
|
44
|
+
|
|
45
|
+
for (i = 0; i < aValue.length && !bFound; i++) {
|
|
46
|
+
var oObjectValue = getObject(aValue[i], oExpression.result.parts[0].path);
|
|
47
|
+
var bResult = oExpression.result.formatter(oObjectValue);
|
|
48
|
+
|
|
49
|
+
if (bResult) {
|
|
50
|
+
bFound = true;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (bFound) {
|
|
55
|
+
sAnnotationPath = resolveDynamicExpression(sStableBracket + (i - 1) + sRest.substr(lastBracket + 1), oMetaModel);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return sAnnotationPath;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
_exports.resolveDynamicExpression = resolveDynamicExpression;
|
|
64
|
+
return _exports;
|
|
65
|
+
}, false);
|
|
66
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkR5bmFtaWNBbm5vdGF0aW9uUGF0aEhlbHBlci50cyJdLCJuYW1lcyI6WyJnZXRPYmplY3QiLCJvT2J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7XG59XG4iXX0=
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import BindingParser from "sap/ui/base/BindingParser";
|
|
2
|
+
|
|
3
|
+
function getObject(oObject: any, sPath: any): any {
|
|
4
|
+
if (!oObject) {
|
|
5
|
+
return null;
|
|
6
|
+
}
|
|
7
|
+
const sPathSplit = sPath.split("/");
|
|
8
|
+
if (sPathSplit.length === 1) {
|
|
9
|
+
return oObject[sPath];
|
|
10
|
+
} else {
|
|
11
|
+
return getObject(oObject[sPathSplit[0]], sPathSplit.splice(1).join("/"));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Resolve a dynamic annotation path down to a standard annotation path.
|
|
16
|
+
*
|
|
17
|
+
* @param sAnnotationPath
|
|
18
|
+
* @param oMetaModel
|
|
19
|
+
* @returns {string} The non dynamic version of the annotation path
|
|
20
|
+
*/
|
|
21
|
+
export function resolveDynamicExpression(sAnnotationPath: any, oMetaModel: any) {
|
|
22
|
+
if (sAnnotationPath.indexOf("[") !== -1) {
|
|
23
|
+
const firstBracket = sAnnotationPath.indexOf("[");
|
|
24
|
+
const sStableBracket = sAnnotationPath.substr(0, firstBracket);
|
|
25
|
+
const sRest = sAnnotationPath.substr(firstBracket + 1);
|
|
26
|
+
const lastBracket = sRest.indexOf("]");
|
|
27
|
+
const aValue = oMetaModel.getObject(sStableBracket);
|
|
28
|
+
const oExpression = BindingParser.parseExpression(sRest.substr(0, lastBracket));
|
|
29
|
+
if (
|
|
30
|
+
Array.isArray(aValue) &&
|
|
31
|
+
oExpression &&
|
|
32
|
+
oExpression.result &&
|
|
33
|
+
oExpression.result.parts &&
|
|
34
|
+
oExpression.result.parts[0] &&
|
|
35
|
+
oExpression.result.parts[0].path
|
|
36
|
+
) {
|
|
37
|
+
let i;
|
|
38
|
+
let bFound = false;
|
|
39
|
+
for (i = 0; i < aValue.length && !bFound; i++) {
|
|
40
|
+
const oObjectValue = getObject(aValue[i], oExpression.result.parts[0].path);
|
|
41
|
+
const bResult = oExpression.result.formatter(oObjectValue);
|
|
42
|
+
if (bResult) {
|
|
43
|
+
bFound = true;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (bFound) {
|
|
47
|
+
sAnnotationPath = resolveDynamicExpression(sStableBracket + (i - 1) + sRest.substr(lastBracket + 1), oMetaModel);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return sAnnotationPath;
|
|
52
|
+
}
|