@openui5/sap.ui.core 1.128.0 → 1.130.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/THIRDPARTY.txt +2 -2
- package/package.json +1 -1
- package/src/jquery.sap.global.js +7 -7
- package/src/jquery.sap.properties.js +1 -1
- package/src/jquery.sap.resources.js +1 -1
- package/src/jquery.sap.script.js +1 -1
- package/src/jquery.sap.storage.js +3 -3
- package/src/jquery.sap.trace.js +18 -18
- package/src/sap/base/Event.js +1 -1
- package/src/sap/base/Eventing.js +1 -1
- package/src/sap/base/config.js +1 -1
- package/src/sap/base/future.js +10 -2
- package/src/sap/base/i18n/LanguageTag.js +1 -1
- package/src/sap/base/i18n/date/TimezoneUtils.js +1 -1
- package/src/sap/base/util/restricted/_CancelablePromise.js +1 -1
- package/src/sap/base/util/restricted/_castArray.js +1 -1
- package/src/sap/base/util/restricted/_compact.js +1 -1
- package/src/sap/base/util/restricted/_curry.js +1 -1
- package/src/sap/base/util/restricted/_debounce.js +1 -1
- package/src/sap/base/util/restricted/_difference.js +1 -1
- package/src/sap/base/util/restricted/_differenceBy.js +1 -1
- package/src/sap/base/util/restricted/_differenceWith.js +1 -1
- package/src/sap/base/util/restricted/_flatMap.js +1 -1
- package/src/sap/base/util/restricted/_flatMapDeep.js +1 -1
- package/src/sap/base/util/restricted/_flatMapDepth.js +1 -1
- package/src/sap/base/util/restricted/_flatten.js +1 -1
- package/src/sap/base/util/restricted/_flattenDeep.js +1 -1
- package/src/sap/base/util/restricted/_flattenDepth.js +1 -1
- package/src/sap/base/util/restricted/_intersection.js +1 -1
- package/src/sap/base/util/restricted/_intersectionBy.js +1 -1
- package/src/sap/base/util/restricted/_intersectionWith.js +1 -1
- package/src/sap/base/util/restricted/_isEqual.js +1 -1
- package/src/sap/base/util/restricted/_isEqualWith.js +1 -1
- package/src/sap/base/util/restricted/_isNil.js +1 -1
- package/src/sap/base/util/restricted/_max.js +1 -1
- package/src/sap/base/util/restricted/_merge.js +1 -1
- package/src/sap/base/util/restricted/_mergeWith.js +1 -1
- package/src/sap/base/util/restricted/_min.js +1 -1
- package/src/sap/base/util/restricted/_omit.js +1 -1
- package/src/sap/base/util/restricted/_pick.js +1 -1
- package/src/sap/base/util/restricted/_pickBy.js +1 -1
- package/src/sap/base/util/restricted/_throttle.js +1 -1
- package/src/sap/base/util/restricted/_toArray.js +1 -1
- package/src/sap/base/util/restricted/_union.js +1 -1
- package/src/sap/base/util/restricted/_unionBy.js +1 -1
- package/src/sap/base/util/restricted/_unionWith.js +1 -1
- package/src/sap/base/util/restricted/_uniq.js +1 -1
- package/src/sap/base/util/restricted/_uniqBy.js +1 -1
- package/src/sap/base/util/restricted/_uniqWith.js +1 -1
- package/src/sap/base/util/restricted/_without.js +1 -1
- package/src/sap/base/util/restricted/_xor.js +1 -1
- package/src/sap/base/util/restricted/_xorBy.js +1 -1
- package/src/sap/base/util/restricted/_xorWith.js +1 -1
- package/src/sap/base/util/restricted/_zipObject.js +1 -1
- package/src/sap/base/util/restricted/_zipObjectDeep.js +1 -1
- package/src/sap/ui/Device.js +3 -3
- package/src/sap/ui/Global.js +3 -3
- package/src/sap/ui/base/BindingParser.js +1 -3
- package/src/sap/ui/base/Event.js +1 -1
- package/src/sap/ui/base/EventProvider.js +1 -1
- package/src/sap/ui/base/Interface.js +1 -1
- package/src/sap/ui/base/ManagedObject.js +4 -9
- package/src/sap/ui/base/ManagedObjectMetadata.js +1 -1
- package/src/sap/ui/base/Metadata.js +1 -1
- package/src/sap/ui/base/Object.js +1 -1
- package/src/sap/ui/base/ObjectPool.js +1 -1
- package/src/sap/ui/core/.library +2 -2
- package/src/sap/ui/core/BusyIndicator.js +1 -1
- package/src/sap/ui/core/Component.js +46 -122
- package/src/sap/ui/core/ComponentContainer.js +2 -2
- package/src/sap/ui/core/ComponentHooks.js +174 -0
- package/src/sap/ui/core/ComponentMetadata.js +1 -1
- package/src/sap/ui/core/ComponentSupport.js +1 -1
- package/src/sap/ui/core/Configuration.js +1 -1
- package/src/sap/ui/core/Control.js +1 -1
- package/src/sap/ui/core/Core.js +8 -3
- package/src/sap/ui/core/CustomData.js +1 -1
- package/src/sap/ui/core/DeclarativeSupport.js +1 -1
- package/src/sap/ui/core/Element.js +6 -2
- package/src/sap/ui/core/ElementMetadata.js +1 -1
- package/src/sap/ui/core/EnabledPropagator.js +1 -1
- package/src/sap/ui/core/EventBus.js +1 -1
- package/src/sap/ui/core/Fragment.js +6 -5
- package/src/sap/ui/core/HTML.js +1 -1
- package/src/sap/ui/core/History.js +1 -1
- package/src/sap/ui/core/Icon.js +2 -2
- package/src/sap/ui/core/IndicationColorSupport.js +1 -1
- package/src/sap/ui/core/IntervalTrigger.js +1 -1
- package/src/sap/ui/core/InvisibleMessage.js +1 -1
- package/src/sap/ui/core/InvisibleRenderer.js +1 -1
- package/src/sap/ui/core/InvisibleText.js +1 -1
- package/src/sap/ui/core/Item.js +1 -1
- package/src/sap/ui/core/LabelEnablement.js +2 -15
- package/src/sap/ui/core/LayoutData.js +1 -1
- package/src/sap/ui/core/ListItem.js +1 -1
- package/src/sap/ui/core/LocalBusyIndicator.js +1 -1
- package/src/sap/ui/core/Locale.js +1 -1
- package/src/sap/ui/core/LocaleData.js +43 -37
- package/src/sap/ui/core/Manifest.js +2 -2
- package/src/sap/ui/core/Message.js +1 -1
- package/src/sap/ui/core/RenderManager.js +41 -32
- package/src/sap/ui/core/Renderer.js +1 -1
- package/src/sap/ui/core/ResizeHandler.js +1 -1
- package/src/sap/ui/core/ScrollBar.js +1 -1
- package/src/sap/ui/core/SeparatorItem.js +1 -1
- package/src/sap/ui/core/StaticArea.js +0 -1
- package/src/sap/ui/core/Title.js +1 -1
- package/src/sap/ui/core/TooltipBase.js +1 -1
- package/src/sap/ui/core/UIArea.js +1 -1
- package/src/sap/ui/core/UIComponent.js +3 -3
- package/src/sap/ui/core/UIComponentMetadata.js +1 -1
- package/src/sap/ui/core/ValueStateSupport.js +1 -1
- package/src/sap/ui/core/VariantLayoutData.js +1 -1
- package/src/sap/ui/core/XMLComposite.js +1 -1
- package/src/sap/ui/core/XMLCompositeMetadata.js +4 -4
- package/src/sap/ui/core/XMLTemplateProcessor.js +3 -3
- package/src/sap/ui/core/_IconRegistry.js +1 -1
- package/src/sap/ui/core/cldr/ar.json +5 -1
- package/src/sap/ui/core/cldr/ar_EG.json +5 -1
- package/src/sap/ui/core/cldr/ar_SA.json +5 -1
- package/src/sap/ui/core/cldr/bg.json +4 -0
- package/src/sap/ui/core/cldr/ca.json +4 -0
- package/src/sap/ui/core/cldr/cnr.json +4 -0
- package/src/sap/ui/core/cldr/cs.json +4 -0
- package/src/sap/ui/core/cldr/cy.json +4 -0
- package/src/sap/ui/core/cldr/da.json +4 -0
- package/src/sap/ui/core/cldr/de.json +4 -0
- package/src/sap/ui/core/cldr/de_AT.json +4 -0
- package/src/sap/ui/core/cldr/de_CH.json +4 -0
- package/src/sap/ui/core/cldr/el.json +4 -0
- package/src/sap/ui/core/cldr/el_CY.json +4 -0
- package/src/sap/ui/core/cldr/en.json +4 -0
- package/src/sap/ui/core/cldr/en_AU.json +4 -0
- package/src/sap/ui/core/cldr/en_GB.json +4 -0
- package/src/sap/ui/core/cldr/en_HK.json +5 -1
- package/src/sap/ui/core/cldr/en_IE.json +4 -0
- package/src/sap/ui/core/cldr/en_IN.json +5 -1
- package/src/sap/ui/core/cldr/en_NZ.json +4 -0
- package/src/sap/ui/core/cldr/en_PG.json +4 -0
- package/src/sap/ui/core/cldr/en_SG.json +5 -1
- package/src/sap/ui/core/cldr/en_ZA.json +4 -0
- package/src/sap/ui/core/cldr/es.json +4 -0
- package/src/sap/ui/core/cldr/es_AR.json +4 -0
- package/src/sap/ui/core/cldr/es_BO.json +4 -0
- package/src/sap/ui/core/cldr/es_CL.json +4 -0
- package/src/sap/ui/core/cldr/es_CO.json +4 -0
- package/src/sap/ui/core/cldr/es_MX.json +4 -0
- package/src/sap/ui/core/cldr/es_PE.json +4 -0
- package/src/sap/ui/core/cldr/es_UY.json +4 -0
- package/src/sap/ui/core/cldr/es_VE.json +4 -0
- package/src/sap/ui/core/cldr/et.json +4 -0
- package/src/sap/ui/core/cldr/fa.json +6 -3
- package/src/sap/ui/core/cldr/fi.json +4 -0
- package/src/sap/ui/core/cldr/fr.json +4 -0
- package/src/sap/ui/core/cldr/fr_BE.json +4 -0
- package/src/sap/ui/core/cldr/fr_CA.json +4 -0
- package/src/sap/ui/core/cldr/fr_CH.json +4 -0
- package/src/sap/ui/core/cldr/fr_LU.json +4 -0
- package/src/sap/ui/core/cldr/he.json +6 -3
- package/src/sap/ui/core/cldr/hi.json +5 -1
- package/src/sap/ui/core/cldr/hr.json +4 -0
- package/src/sap/ui/core/cldr/hu.json +4 -0
- package/src/sap/ui/core/cldr/id.json +5 -1
- package/src/sap/ui/core/cldr/it.json +4 -0
- package/src/sap/ui/core/cldr/it_CH.json +4 -0
- package/src/sap/ui/core/cldr/ja.json +5 -1
- package/src/sap/ui/core/cldr/kk.json +4 -0
- package/src/sap/ui/core/cldr/ko.json +5 -1
- package/src/sap/ui/core/cldr/lt.json +4 -0
- package/src/sap/ui/core/cldr/lv.json +4 -0
- package/src/sap/ui/core/cldr/mk.json +4 -0
- package/src/sap/ui/core/cldr/ms.json +5 -1
- package/src/sap/ui/core/cldr/nb.json +5 -2
- package/src/sap/ui/core/cldr/nl.json +4 -0
- package/src/sap/ui/core/cldr/nl_BE.json +4 -0
- package/src/sap/ui/core/cldr/pl.json +4 -0
- package/src/sap/ui/core/cldr/pt.json +4 -0
- package/src/sap/ui/core/cldr/pt_PT.json +4 -0
- package/src/sap/ui/core/cldr/ro.json +4 -0
- package/src/sap/ui/core/cldr/ru.json +4 -0
- package/src/sap/ui/core/cldr/ru_UA.json +4 -0
- package/src/sap/ui/core/cldr/sk.json +4 -0
- package/src/sap/ui/core/cldr/sl.json +4 -0
- package/src/sap/ui/core/cldr/sr.json +4 -0
- package/src/sap/ui/core/cldr/sr_Latn.json +6 -2
- package/src/sap/ui/core/cldr/sv.json +4 -0
- package/src/sap/ui/core/cldr/th.json +5 -1
- package/src/sap/ui/core/cldr/tr.json +5 -1
- package/src/sap/ui/core/cldr/uk.json +4 -0
- package/src/sap/ui/core/cldr/vi.json +4 -0
- package/src/sap/ui/core/cldr/zh_CN.json +5 -1
- package/src/sap/ui/core/cldr/zh_HK.json +6 -3
- package/src/sap/ui/core/cldr/zh_SG.json +6 -3
- package/src/sap/ui/core/cldr/zh_TW.json +5 -1
- package/src/sap/ui/core/date/UI5Date.js +1 -1
- package/src/sap/ui/core/delegate/ItemNavigation.js +1 -1
- package/src/sap/ui/core/delegate/ScrollEnablement.js +1 -1
- package/src/sap/ui/core/dnd/DragDropBase.js +1 -1
- package/src/sap/ui/core/dnd/DragDropInfo.js +1 -1
- package/src/sap/ui/core/dnd/DragInfo.js +1 -1
- package/src/sap/ui/core/dnd/DropInfo.js +1 -1
- package/src/sap/ui/core/fieldhelp/FieldHelp.js +8 -10
- package/src/sap/ui/core/fieldhelp/FieldHelpCustomData.js +88 -0
- package/src/sap/ui/core/fieldhelp/FieldHelpUtil.js +22 -26
- package/src/sap/ui/core/format/FormatUtils.js +1 -1
- package/src/sap/ui/core/format/NumberFormat.js +17 -24
- package/src/sap/ui/core/format/TimezoneUtil.js +1 -1
- package/src/sap/ui/core/getCompatibilityVersion.js +1 -1
- package/src/sap/ui/core/hyphenation/Hyphenation.js +1 -1
- package/src/sap/ui/core/library.js +5 -7
- package/src/sap/ui/core/library.support.js +10 -1
- package/src/sap/ui/core/message/ControlMessageProcessor.js +1 -1
- package/src/sap/ui/core/message/Message.js +1 -1
- package/src/sap/ui/core/message/MessageManager.js +1 -1
- package/src/sap/ui/core/message/MessageParser.js +1 -1
- package/src/sap/ui/core/message/MessageProcessor.js +1 -1
- package/src/sap/ui/core/messagebundle.properties +6 -12
- package/src/sap/ui/core/messagebundle_ar.properties +3 -6
- package/src/sap/ui/core/messagebundle_bg.properties +3 -6
- package/src/sap/ui/core/messagebundle_ca.properties +3 -6
- package/src/sap/ui/core/messagebundle_cnr.properties +3 -6
- package/src/sap/ui/core/messagebundle_cs.properties +3 -6
- package/src/sap/ui/core/messagebundle_cy.properties +3 -6
- package/src/sap/ui/core/messagebundle_da.properties +3 -6
- package/src/sap/ui/core/messagebundle_de.properties +3 -6
- package/src/sap/ui/core/messagebundle_el.properties +3 -6
- package/src/sap/ui/core/messagebundle_en.properties +3 -6
- package/src/sap/ui/core/messagebundle_en_GB.properties +3 -6
- package/src/sap/ui/core/messagebundle_en_US_saprigi.properties +3 -6
- package/src/sap/ui/core/messagebundle_es.properties +3 -6
- package/src/sap/ui/core/messagebundle_es_MX.properties +3 -6
- package/src/sap/ui/core/messagebundle_et.properties +3 -6
- package/src/sap/ui/core/messagebundle_fi.properties +3 -6
- package/src/sap/ui/core/messagebundle_fr.properties +3 -6
- package/src/sap/ui/core/messagebundle_fr_CA.properties +3 -6
- package/src/sap/ui/core/messagebundle_hi.properties +3 -6
- package/src/sap/ui/core/messagebundle_hr.properties +3 -6
- package/src/sap/ui/core/messagebundle_hu.properties +3 -6
- package/src/sap/ui/core/messagebundle_id.properties +3 -6
- package/src/sap/ui/core/messagebundle_it.properties +53 -56
- package/src/sap/ui/core/messagebundle_iw.properties +3 -6
- package/src/sap/ui/core/messagebundle_ja.properties +3 -6
- package/src/sap/ui/core/messagebundle_kk.properties +3 -6
- package/src/sap/ui/core/messagebundle_ko.properties +3 -6
- package/src/sap/ui/core/messagebundle_lt.properties +3 -6
- package/src/sap/ui/core/messagebundle_lv.properties +3 -6
- package/src/sap/ui/core/messagebundle_mk.properties +3 -6
- package/src/sap/ui/core/messagebundle_ms.properties +3 -6
- package/src/sap/ui/core/messagebundle_nl.properties +3 -6
- package/src/sap/ui/core/messagebundle_no.properties +4 -7
- package/src/sap/ui/core/messagebundle_pl.properties +3 -6
- package/src/sap/ui/core/messagebundle_pt.properties +3 -6
- package/src/sap/ui/core/messagebundle_pt_PT.properties +3 -6
- package/src/sap/ui/core/messagebundle_ro.properties +3 -6
- package/src/sap/ui/core/messagebundle_ru.properties +3 -6
- package/src/sap/ui/core/messagebundle_sh.properties +3 -6
- package/src/sap/ui/core/messagebundle_sk.properties +3 -6
- package/src/sap/ui/core/messagebundle_sl.properties +3 -6
- package/src/sap/ui/core/messagebundle_sr.properties +3 -6
- package/src/sap/ui/core/messagebundle_sv.properties +3 -6
- package/src/sap/ui/core/messagebundle_th.properties +3 -6
- package/src/sap/ui/core/messagebundle_tr.properties +3 -6
- package/src/sap/ui/core/messagebundle_uk.properties +3 -6
- package/src/sap/ui/core/messagebundle_vi.properties +3 -6
- package/src/sap/ui/core/messagebundle_zh_CN.properties +3 -6
- package/src/sap/ui/core/messagebundle_zh_TW.properties +3 -6
- package/src/sap/ui/core/mvc/Controller.js +2 -2
- package/src/sap/ui/core/mvc/HTMLView.js +1 -1
- package/src/sap/ui/core/mvc/JSONView.js +1 -1
- package/src/sap/ui/core/mvc/JSView.js +1 -1
- package/src/sap/ui/core/mvc/TemplateView.js +1 -1
- package/src/sap/ui/core/mvc/View.js +3 -3
- package/src/sap/ui/core/mvc/XMLView.js +2 -2
- package/src/sap/ui/core/plugin/DeclarativeSupport.js +1 -1
- package/src/sap/ui/core/plugin/LessSupport.js +1 -1
- package/src/sap/ui/core/plugin/TemplatingSupport.js +1 -1
- package/src/sap/ui/core/postmessage/Bus.js +1 -1
- package/src/sap/ui/core/postmessage/confirmationDialog.js +1 -1
- package/src/sap/ui/core/routing/Route.js +4 -4
- package/src/sap/ui/core/routing/Router.js +5 -5
- package/src/sap/ui/core/routing/Targets.js +3 -3
- package/src/sap/ui/core/routing/async/Target.js +1 -1
- package/src/sap/ui/core/routing/async/Targets.js +2 -2
- package/src/sap/ui/core/rules/App.support.js +13 -2
- package/src/sap/ui/core/search/OpenSearchProvider.js +1 -1
- package/src/sap/ui/core/search/SearchProvider.js +1 -1
- package/src/sap/ui/core/service/Service.js +1 -1
- package/src/sap/ui/core/service/ServiceFactory.js +1 -1
- package/src/sap/ui/core/service/ServiceFactoryRegistry.js +1 -1
- package/src/sap/ui/core/support/Plugin.js +1 -1
- package/src/sap/ui/core/support/Support.js +1 -1
- package/src/sap/ui/core/support/ToolsAPI.js +4 -2
- package/src/sap/ui/core/support/plugins/ControlTree.js +1 -1
- package/src/sap/ui/core/support/plugins/Interaction.js +1 -1
- package/src/sap/ui/core/support/plugins/LocalStorage.js +1 -1
- package/src/sap/ui/core/support/plugins/Performance.js +1 -1
- package/src/sap/ui/core/support/plugins/Selector.js +1 -1
- package/src/sap/ui/core/support/plugins/TechInfo.js +1 -1
- package/src/sap/ui/core/support/plugins/Trace.js +1 -1
- package/src/sap/ui/core/support/plugins/ViewInfo.js +1 -1
- package/src/sap/ui/core/themes/base/base.less +4238 -122
- package/src/sap/ui/core/themes/base/global.less +460 -7
- package/src/sap/ui/core/themes/base/skeleton.less +454 -3
- package/src/sap/ui/core/themes/sap_hcb/global.less +493 -40
- package/src/sap/ui/core/theming/Parameters.js +6 -6
- package/src/sap/ui/core/theming/ThemeHelper.js +16 -13
- package/src/sap/ui/core/theming/ThemeManager.js +1 -1
- package/src/sap/ui/core/tmpl/DOMAttribute.js +1 -1
- package/src/sap/ui/core/tmpl/DOMElement.js +1 -1
- package/src/sap/ui/core/tmpl/HandlebarsTemplate.js +1 -1
- package/src/sap/ui/core/tmpl/Template.js +1 -1
- package/src/sap/ui/core/tmpl/TemplateControl.js +1 -1
- package/src/sap/ui/core/util/AsyncHintsHelper.js +1 -1
- package/src/sap/ui/core/util/Export.js +1 -1
- package/src/sap/ui/core/util/ExportCell.js +1 -1
- package/src/sap/ui/core/util/ExportColumn.js +1 -1
- package/src/sap/ui/core/util/ExportRow.js +1 -1
- package/src/sap/ui/core/util/ExportType.js +1 -1
- package/src/sap/ui/core/util/ExportTypeCSV.js +1 -1
- package/src/sap/ui/core/util/File.js +1 -1
- package/src/sap/ui/core/util/LibraryInfo.js +1 -1
- package/src/sap/ui/core/util/MockServer.js +1 -1
- package/src/sap/ui/core/util/PasteHelper.js +1 -1
- package/src/sap/ui/core/util/reflection/BaseTreeModifier.js +134 -148
- package/src/sap/ui/core/util/reflection/JsControlTreeModifier.js +165 -202
- package/src/sap/ui/core/util/reflection/XmlTreeModifier.js +365 -468
- package/src/sap/ui/core/util/serializer/HTMLViewSerializer.js +1 -1
- package/src/sap/ui/core/util/serializer/Serializer.js +1 -1
- package/src/sap/ui/core/util/serializer/ViewSerializer.js +1 -1
- package/src/sap/ui/core/util/serializer/XMLViewSerializer.js +1 -1
- package/src/sap/ui/core/util/serializer/delegate/Delegate.js +1 -1
- package/src/sap/ui/core/util/serializer/delegate/HTML.js +1 -1
- package/src/sap/ui/core/util/serializer/delegate/XML.js +1 -1
- package/src/sap/ui/core/webc/WebComponent.js +1 -1
- package/src/sap/ui/core/webc/WebComponentMetadata.js +1 -1
- package/src/sap/ui/core/ws/ReadyState.js +1 -1
- package/src/sap/ui/core/ws/SapPcpWebSocket.js +1 -1
- package/src/sap/ui/core/ws/WebSocket.js +1 -1
- package/src/sap/ui/debug/ControlTree.js +1 -1
- package/src/sap/ui/debug/DebugEnv.js +1 -1
- package/src/sap/ui/debug/PropertyList.js +1 -1
- package/src/sap/ui/dom/findTabbable.js +13 -6
- package/src/sap/ui/model/ClientModel.js +1 -1
- package/src/sap/ui/model/CompositeDataState.js +11 -12
- package/src/sap/ui/model/CompositeType.js +1 -1
- package/src/sap/ui/model/Context.js +0 -2
- package/src/sap/ui/model/DataState.js +33 -5
- package/src/sap/ui/model/ListBinding.js +19 -0
- package/src/sap/ui/model/MetaModel.js +1 -1
- package/src/sap/ui/model/Model.js +1 -1
- package/src/sap/ui/model/SelectionModel.js +1 -1
- package/src/sap/ui/model/SimpleType.js +1 -1
- package/src/sap/ui/model/TreeAutoExpandMode.js +1 -1
- package/src/sap/ui/model/Type.js +1 -1
- package/src/sap/ui/model/_Helper.js +3 -1
- package/src/sap/ui/model/json/JSONModel.js +12 -1
- package/src/sap/ui/model/message/MessageModel.js +1 -1
- package/src/sap/ui/model/odata/ODataAnnotations.js +1 -1
- package/src/sap/ui/model/odata/ODataMessageParser.js +1 -1
- package/src/sap/ui/model/odata/ODataMetaModel.js +116 -35
- package/src/sap/ui/model/odata/ODataMetadata.js +1 -1
- package/src/sap/ui/model/odata/ODataModel.js +1 -1
- package/src/sap/ui/model/odata/ODataTreeBindingFlat.js +106 -19
- package/src/sap/ui/model/odata/type/Boolean.js +1 -1
- package/src/sap/ui/model/odata/type/Byte.js +1 -1
- package/src/sap/ui/model/odata/type/Currency.js +1 -1
- package/src/sap/ui/model/odata/type/Date.js +1 -1
- package/src/sap/ui/model/odata/type/DateTime.js +1 -1
- package/src/sap/ui/model/odata/type/DateTimeBase.js +1 -1
- package/src/sap/ui/model/odata/type/DateTimeOffset.js +1 -1
- package/src/sap/ui/model/odata/type/DateTimeWithTimezone.js +1 -1
- package/src/sap/ui/model/odata/type/Decimal.js +1 -1
- package/src/sap/ui/model/odata/type/Double.js +1 -1
- package/src/sap/ui/model/odata/type/Guid.js +1 -1
- package/src/sap/ui/model/odata/type/Int.js +1 -1
- package/src/sap/ui/model/odata/type/Int16.js +1 -1
- package/src/sap/ui/model/odata/type/Int32.js +1 -1
- package/src/sap/ui/model/odata/type/Int64.js +1 -1
- package/src/sap/ui/model/odata/type/ODataType.js +1 -1
- package/src/sap/ui/model/odata/type/Raw.js +1 -1
- package/src/sap/ui/model/odata/type/SByte.js +1 -1
- package/src/sap/ui/model/odata/type/Single.js +1 -1
- package/src/sap/ui/model/odata/type/Stream.js +1 -1
- package/src/sap/ui/model/odata/type/String.js +1 -1
- package/src/sap/ui/model/odata/type/Time.js +1 -1
- package/src/sap/ui/model/odata/type/TimeOfDay.js +1 -1
- package/src/sap/ui/model/odata/type/Unit.js +1 -1
- package/src/sap/ui/model/odata/type/UnitMixin.js +14 -9
- package/src/sap/ui/model/odata/v2/Context.js +1 -1
- package/src/sap/ui/model/odata/v2/ODataAnnotations.js +1 -1
- package/src/sap/ui/model/odata/v2/ODataListBinding.js +21 -6
- package/src/sap/ui/model/odata/v2/ODataModel.js +109 -8
- package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +1 -1
- package/src/sap/ui/model/odata/v4/Context.js +63 -14
- package/src/sap/ui/model/odata/v4/ODataBinding.js +10 -0
- package/src/sap/ui/model/odata/v4/ODataContextBinding.js +1 -1
- package/src/sap/ui/model/odata/v4/ODataListBinding.js +135 -98
- package/src/sap/ui/model/odata/v4/ODataMetaModel.js +20 -10
- package/src/sap/ui/model/odata/v4/ODataModel.js +62 -4
- package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +1 -1
- package/src/sap/ui/model/odata/v4/lib/_AggregationCache.js +141 -51
- package/src/sap/ui/model/odata/v4/lib/_AggregationHelper.js +53 -19
- package/src/sap/ui/model/odata/v4/lib/_Cache.js +152 -37
- package/src/sap/ui/model/odata/v4/lib/_Helper.js +70 -9
- package/src/sap/ui/model/odata/v4/lib/_Requestor.js +44 -7
- package/src/sap/ui/model/odata/v4/lib/_TreeState.js +57 -40
- package/src/sap/ui/model/resource/ResourceModel.js +1 -1
- package/src/sap/ui/model/type/Boolean.js +1 -1
- package/src/sap/ui/model/type/Currency.js +1 -1
- package/src/sap/ui/model/type/Date.js +3 -2
- package/src/sap/ui/model/type/DateInterval.js +3 -2
- package/src/sap/ui/model/type/DateTime.js +1 -1
- package/src/sap/ui/model/type/DateTimeInterval.js +1 -1
- package/src/sap/ui/model/type/FileSize.js +1 -1
- package/src/sap/ui/model/type/Float.js +1 -1
- package/src/sap/ui/model/type/Integer.js +1 -1
- package/src/sap/ui/model/type/String.js +1 -1
- package/src/sap/ui/model/type/Time.js +1 -1
- package/src/sap/ui/model/type/TimeInterval.js +1 -1
- package/src/sap/ui/model/type/Unit.js +1 -1
- package/src/sap/ui/model/xml/XMLModel.js +1 -1
- package/src/sap/ui/performance/trace/FESR.js +19 -10
- package/src/sap/ui/performance/trace/Interaction.js +45 -659
- package/src/sap/ui/performance/trace/_InteractionImpl.js +705 -0
- package/src/sap/ui/qunit/utils/ControlIterator.js +1 -1
- package/src/sap/ui/qunit/utils/MemoryLeakCheck.js +1 -1
- package/src/sap/ui/test/TestUtils.js +51 -24
- package/src/sap/ui/test/generic/TestBase.js +1 -1
- package/src/sap/ui/test/gherkin/opa5TestHarness.js +6 -2
- package/src/sap/ui/util/Storage.js +1 -1
- package/src/sap/ui/util/_enforceNoReturnValue.js +1 -1
- package/src/ui5loader.js +1 -1
|
@@ -7,62 +7,26 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
sap.ui.define([
|
|
10
|
-
"./BaseTreeModifier",
|
|
11
|
-
"sap/ui/base/ManagedObject",
|
|
12
|
-
"sap/ui/base/DataType",
|
|
13
|
-
"sap/base/util/merge",
|
|
14
|
-
"sap/ui/util/XMLHelper",
|
|
15
|
-
"sap/ui/core/mvc/EventHandlerResolver",
|
|
16
|
-
"sap/base/util/ObjectPath",
|
|
17
10
|
"sap/base/util/isPlainObject",
|
|
18
|
-
"sap/
|
|
11
|
+
"sap/base/util/merge",
|
|
12
|
+
"sap/ui/base/DataType",
|
|
13
|
+
"sap/ui/base/ManagedObject",
|
|
14
|
+
"sap/ui/core/util/reflection/BaseTreeModifier",
|
|
15
|
+
"sap/ui/core/Fragment",
|
|
16
|
+
"sap/ui/util/XMLHelper"
|
|
19
17
|
], function(
|
|
20
|
-
BaseTreeModifier,
|
|
21
|
-
ManagedObject,
|
|
22
|
-
DataType,
|
|
23
|
-
merge,
|
|
24
|
-
XMLHelper,
|
|
25
|
-
EventHandlerResolver,
|
|
26
|
-
ObjectPath,
|
|
27
18
|
isPlainObject,
|
|
28
|
-
|
|
19
|
+
merge,
|
|
20
|
+
DataType,
|
|
21
|
+
ManagedObject,
|
|
22
|
+
BaseTreeModifier,
|
|
23
|
+
Fragment,
|
|
24
|
+
XMLHelper
|
|
29
25
|
) {
|
|
30
26
|
|
|
31
27
|
"use strict";
|
|
32
28
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
async function insertAggregation(oParent, sName, oObject, iIndex, oView, bSkipAdjustIndex, oFoundAggregationNode) {
|
|
36
|
-
let oAggregationNode;
|
|
37
|
-
if (!oFoundAggregationNode) {
|
|
38
|
-
// named aggregation must have the same namespace as the parent
|
|
39
|
-
const sNamespaceURI = oParent.namespaceURI;
|
|
40
|
-
// no ids for aggregation nodes => no need to pass id or component
|
|
41
|
-
oAggregationNode = await this.createControl(sNamespaceURI + "." + sName, undefined, oView);
|
|
42
|
-
oParent.appendChild(oAggregationNode);
|
|
43
|
-
} else {
|
|
44
|
-
oAggregationNode = oFoundAggregationNode;
|
|
45
|
-
}
|
|
46
|
-
if (!bSkipAdjustIndex) {
|
|
47
|
-
const aChildren = oAggregationNode.children;
|
|
48
|
-
let iOffset = 0;
|
|
49
|
-
const iStopIndex = (iIndex < aChildren.length) ? iIndex : aChildren.length;
|
|
50
|
-
for (let i = 0; i < iStopIndex; i++) {
|
|
51
|
-
if (aChildren[i].namespaceURI === "sap.ui.core" && aChildren[i].tagName.includes("ExtensionPoint")) {
|
|
52
|
-
iOffset = iOffset + 1 - aChildren[i].children.length;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
iIndex = iIndex + iOffset;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (iIndex >= oAggregationNode.childElementCount) {
|
|
59
|
-
oAggregationNode.appendChild(oObject);
|
|
60
|
-
} else {
|
|
61
|
-
const aReferenceNodes = await this._getControlsInAggregation(oParent, oAggregationNode);
|
|
62
|
-
oAggregationNode.insertBefore(oObject, aReferenceNodes[iIndex]);
|
|
63
|
-
}
|
|
64
|
-
return undefined;
|
|
65
|
-
}
|
|
29
|
+
const CUSTOM_DATA_NS = "http://schemas.sap.com/sapui5/extension/sap.ui.core.CustomData/1";
|
|
66
30
|
|
|
67
31
|
/**
|
|
68
32
|
* Static utility class to access XMLNodes like ManagedObjects,
|
|
@@ -74,7 +38,7 @@ sap.ui.define([
|
|
|
74
38
|
* @ui5-restricted
|
|
75
39
|
* @since 1.56.0
|
|
76
40
|
*/
|
|
77
|
-
|
|
41
|
+
const XmlTreeModifier = merge(
|
|
78
42
|
{} /* target object, to avoid changing of original modifier */,
|
|
79
43
|
BaseTreeModifier,
|
|
80
44
|
/** @lends sap.ui.core.util.reflection.XmlTreeModifier */{
|
|
@@ -84,7 +48,7 @@ sap.ui.define([
|
|
|
84
48
|
/**
|
|
85
49
|
* @inheritDoc
|
|
86
50
|
*/
|
|
87
|
-
setVisible: function
|
|
51
|
+
setVisible: function(oControl, bVisible) {
|
|
88
52
|
if (bVisible) {
|
|
89
53
|
oControl.removeAttribute("visible");
|
|
90
54
|
} else {
|
|
@@ -95,14 +59,14 @@ sap.ui.define([
|
|
|
95
59
|
/**
|
|
96
60
|
* @inheritDoc
|
|
97
61
|
*/
|
|
98
|
-
getVisible: function
|
|
62
|
+
getVisible: function(oControl) {
|
|
99
63
|
return XmlTreeModifier.getProperty(oControl, "visible");
|
|
100
64
|
},
|
|
101
65
|
|
|
102
66
|
/**
|
|
103
67
|
* @inheritDoc
|
|
104
68
|
*/
|
|
105
|
-
setStashed: function
|
|
69
|
+
setStashed: function(oControl, bStashed) {
|
|
106
70
|
if (!bStashed) {
|
|
107
71
|
oControl.removeAttribute("stashed");
|
|
108
72
|
} else {
|
|
@@ -115,11 +79,11 @@ sap.ui.define([
|
|
|
115
79
|
/**
|
|
116
80
|
* @inheritDoc
|
|
117
81
|
*/
|
|
118
|
-
getStashed: function
|
|
82
|
+
getStashed: function(oControl) {
|
|
119
83
|
return Promise.all([
|
|
120
84
|
XmlTreeModifier.getProperty(oControl, "stashed"),
|
|
121
85
|
XmlTreeModifier.getProperty(oControl, "visible")
|
|
122
|
-
]).then(function
|
|
86
|
+
]).then(function(aProperties) {
|
|
123
87
|
return !!aProperties[0] || !aProperties[1];
|
|
124
88
|
});
|
|
125
89
|
},
|
|
@@ -127,20 +91,20 @@ sap.ui.define([
|
|
|
127
91
|
/**
|
|
128
92
|
* @inheritDoc
|
|
129
93
|
*/
|
|
130
|
-
bindProperty: function
|
|
94
|
+
bindProperty: function(oControl, sPropertyName, vBindingInfos) {
|
|
131
95
|
oControl.setAttribute(sPropertyName, "{" + vBindingInfos + "}");
|
|
132
96
|
},
|
|
133
97
|
|
|
134
98
|
/**
|
|
135
99
|
* @inheritDoc
|
|
136
100
|
*/
|
|
137
|
-
unbindProperty: function
|
|
101
|
+
unbindProperty: function(oControl, sPropertyName) {
|
|
138
102
|
//reset the property
|
|
139
103
|
oControl.removeAttribute(sPropertyName);
|
|
140
104
|
},
|
|
141
105
|
|
|
142
|
-
_setProperty: function
|
|
143
|
-
|
|
106
|
+
_setProperty: function(oControl, sPropertyName, vPropertyValue, bEscapeBindingStrings) {
|
|
107
|
+
let sValue = XmlTreeModifier._getSerializedValue(vPropertyValue);
|
|
144
108
|
if (bEscapeBindingStrings) {
|
|
145
109
|
sValue = XmlTreeModifier._escapeCurlyBracketsInString(sValue);
|
|
146
110
|
}
|
|
@@ -150,9 +114,9 @@ sap.ui.define([
|
|
|
150
114
|
/**
|
|
151
115
|
* @inheritDoc
|
|
152
116
|
*/
|
|
153
|
-
setProperty: function
|
|
117
|
+
setProperty: function(oControl, sPropertyName, vPropertyValue) {
|
|
154
118
|
// binding strings in properties needs always to be escaped, triggered by the last parameter.
|
|
155
|
-
// It is required to be
|
|
119
|
+
// It is required to be compliant with setProperty functionality in JS case. There could be
|
|
156
120
|
// properties provided as settings with existing bindings. Use the applySettings function in this case.
|
|
157
121
|
XmlTreeModifier._setProperty(oControl, sPropertyName, vPropertyValue, true);
|
|
158
122
|
},
|
|
@@ -160,64 +124,55 @@ sap.ui.define([
|
|
|
160
124
|
/**
|
|
161
125
|
* @inheritDoc
|
|
162
126
|
*/
|
|
163
|
-
getProperty: function
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
.then(function (oKeyProperty) {
|
|
178
|
-
if (oKeyProperty === "sap-ui-custom-settings") {
|
|
179
|
-
oType = DataType.getType("object");
|
|
180
|
-
}
|
|
181
|
-
});
|
|
182
|
-
}
|
|
127
|
+
getProperty: async function(oControl, sPropertyName) {
|
|
128
|
+
let oType;
|
|
129
|
+
let vPropertyValue = oControl.getAttribute(sPropertyName);
|
|
130
|
+
const oMetadata = await XmlTreeModifier.getControlMetadata(oControl);
|
|
131
|
+
const oPropertyInfo = oMetadata.getProperty(sPropertyName);
|
|
132
|
+
if (oPropertyInfo) { //not a property like aggregation
|
|
133
|
+
oType = oPropertyInfo.getType();
|
|
134
|
+
if (
|
|
135
|
+
sPropertyName === "value"
|
|
136
|
+
&& XmlTreeModifier.getControlType(oControl) === "sap.ui.core.CustomData"
|
|
137
|
+
) {
|
|
138
|
+
const oKeyProperty = await XmlTreeModifier.getProperty(oControl, "key");
|
|
139
|
+
if (oKeyProperty === "sap-ui-custom-settings") {
|
|
140
|
+
oType = DataType.getType("object");
|
|
183
141
|
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
if (vPropertyValue === null) {
|
|
145
|
+
vPropertyValue = oPropertyInfo.getDefaultValue() || oType.getDefaultValue();
|
|
146
|
+
} else {
|
|
147
|
+
// unescape binding like XMLTemplateProcessor
|
|
148
|
+
const vUnescaped = ManagedObject.bindingParser(vPropertyValue, undefined, true);
|
|
149
|
+
// if it is a binding, return undefined as it has to be handled differently
|
|
150
|
+
if (isPlainObject(vUnescaped)) {
|
|
151
|
+
if (vUnescaped.path || vUnescaped.parts) {
|
|
152
|
+
vPropertyValue = undefined;
|
|
190
153
|
} else {
|
|
191
|
-
|
|
192
|
-
var vUnescaped = ManagedObject.bindingParser(vPropertyValue, undefined, true);
|
|
193
|
-
// if it is a binding, return undefined as it has to be handled differently
|
|
194
|
-
if (isPlainObject(vUnescaped)) {
|
|
195
|
-
if (vUnescaped.path || vUnescaped.parts) {
|
|
196
|
-
vPropertyValue = undefined;
|
|
197
|
-
} else {
|
|
198
|
-
vPropertyValue = vUnescaped;
|
|
199
|
-
}
|
|
200
|
-
} else {
|
|
201
|
-
vPropertyValue = oType.parseValue(vUnescaped || vPropertyValue);
|
|
202
|
-
}
|
|
154
|
+
vPropertyValue = vUnescaped;
|
|
203
155
|
}
|
|
156
|
+
} else {
|
|
157
|
+
vPropertyValue = oType.parseValue(vUnescaped || vPropertyValue);
|
|
204
158
|
}
|
|
205
|
-
|
|
206
|
-
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return vPropertyValue;
|
|
207
162
|
},
|
|
208
163
|
|
|
209
164
|
/**
|
|
210
165
|
* @inheritDoc
|
|
211
166
|
*/
|
|
212
|
-
isPropertyInitial: function
|
|
213
|
-
|
|
167
|
+
isPropertyInitial: function(oControl, sPropertyName) {
|
|
168
|
+
const vPropertyValue = oControl.getAttribute(sPropertyName);
|
|
214
169
|
return (vPropertyValue == null);
|
|
215
170
|
},
|
|
216
171
|
|
|
217
172
|
/**
|
|
218
173
|
* @inheritDoc
|
|
219
174
|
*/
|
|
220
|
-
setPropertyBinding: function
|
|
175
|
+
setPropertyBinding: function(oControl, sPropertyName, sPropertyBinding) {
|
|
221
176
|
if (typeof sPropertyBinding !== "string") {
|
|
222
177
|
throw new Error("For XML, only strings are supported to be set as property binding.");
|
|
223
178
|
}
|
|
@@ -227,10 +182,10 @@ sap.ui.define([
|
|
|
227
182
|
/**
|
|
228
183
|
* @inheritDoc
|
|
229
184
|
*/
|
|
230
|
-
getPropertyBinding: function
|
|
231
|
-
|
|
185
|
+
getPropertyBinding: function(oControl, sPropertyName) {
|
|
186
|
+
const vPropertyValue = oControl.getAttribute(sPropertyName);
|
|
232
187
|
if (vPropertyValue) {
|
|
233
|
-
|
|
188
|
+
const vUnescaped = ManagedObject.bindingParser(vPropertyValue, undefined, true);
|
|
234
189
|
if (vUnescaped && (vUnescaped.path || vUnescaped.parts)) {
|
|
235
190
|
return vUnescaped;
|
|
236
191
|
}
|
|
@@ -250,7 +205,7 @@ sap.ui.define([
|
|
|
250
205
|
* @inheritDoc
|
|
251
206
|
*/
|
|
252
207
|
getCustomDataInfo: function(oControl, sCustomDataKey) {
|
|
253
|
-
|
|
208
|
+
const oCustomData = oControl.attributes["custom.data.via.modifier:" + sCustomDataKey];
|
|
254
209
|
if (oCustomData) {
|
|
255
210
|
return {
|
|
256
211
|
customData: oCustomData,
|
|
@@ -264,71 +219,62 @@ sap.ui.define([
|
|
|
264
219
|
/**
|
|
265
220
|
* @inheritDoc
|
|
266
221
|
*/
|
|
267
|
-
createControl: function
|
|
268
|
-
|
|
222
|
+
createControl: async function(sClassName, oAppComponent, oView, oSelector, mSettings, bAsync) {
|
|
223
|
+
const sId = XmlTreeModifier.getControlIdBySelector(oSelector, oAppComponent);
|
|
269
224
|
if (!XmlTreeModifier.bySelector(oSelector, oAppComponent, oView)) {
|
|
270
|
-
|
|
271
|
-
|
|
225
|
+
let sLocalName;
|
|
226
|
+
const aClassNameParts = sClassName.split('.');
|
|
227
|
+
let sNamespaceURI = "";
|
|
272
228
|
if (aClassNameParts.length > 1) {
|
|
273
229
|
sLocalName = aClassNameParts.pop();
|
|
274
230
|
sNamespaceURI = aClassNameParts.join('.');
|
|
275
231
|
}
|
|
276
232
|
|
|
277
|
-
|
|
233
|
+
const oNewElementNode = oView.ownerDocument.createElementNS(sNamespaceURI, sLocalName);
|
|
278
234
|
|
|
279
|
-
sId = XmlTreeModifier.getControlIdBySelector(oSelector, oAppComponent);
|
|
280
235
|
if (sId) {
|
|
281
236
|
oNewElementNode.setAttribute("id", sId);
|
|
282
237
|
}
|
|
283
|
-
|
|
284
|
-
.
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
}
|
|
288
|
-
return undefined;
|
|
289
|
-
})
|
|
290
|
-
.then(function () {
|
|
291
|
-
return Promise.resolve(oNewElementNode);
|
|
292
|
-
});
|
|
238
|
+
if (mSettings) {
|
|
239
|
+
await XmlTreeModifier.applySettings(oNewElementNode, mSettings);
|
|
240
|
+
}
|
|
241
|
+
return oNewElementNode;
|
|
293
242
|
} else {
|
|
294
|
-
|
|
295
|
-
return Promise.reject(oError);
|
|
243
|
+
throw new Error("Can't create a control with duplicated ID " + sId);
|
|
296
244
|
}
|
|
297
245
|
},
|
|
298
246
|
|
|
299
247
|
/**
|
|
300
248
|
* @inheritDoc
|
|
301
249
|
*/
|
|
302
|
-
applySettings: function(oControl, mSettings) {
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
});
|
|
325
|
-
});
|
|
250
|
+
applySettings: async function(oControl, mSettings) {
|
|
251
|
+
const oMetadata = await XmlTreeModifier.getControlMetadata(oControl);
|
|
252
|
+
const mMetadata = oMetadata.getJSONKeys();
|
|
253
|
+
Object.keys(mSettings).forEach(function(sKey) {
|
|
254
|
+
const oKeyInfo = mMetadata[sKey];
|
|
255
|
+
const vValue = mSettings[sKey];
|
|
256
|
+
switch (oKeyInfo._iKind) {
|
|
257
|
+
case 0: // PROPERTY
|
|
258
|
+
// Settings provided as property could have some bindings that needs to be resolved by the core
|
|
259
|
+
// and therefore they shouldn't be escaped by setProperty function. In opposite to the common
|
|
260
|
+
// setProperty functionality!
|
|
261
|
+
XmlTreeModifier._setProperty(oControl, sKey, vValue, false);
|
|
262
|
+
break;
|
|
263
|
+
// case 1: // SINGLE_AGGREGATION
|
|
264
|
+
// XmlTreeModifier.insertAggregation(oControl, sKey, vValue);
|
|
265
|
+
case 3: // SINGLE_ASSOCIATION
|
|
266
|
+
XmlTreeModifier.setAssociation(oControl, sKey, vValue);
|
|
267
|
+
break;
|
|
268
|
+
default:
|
|
269
|
+
throw new Error("Unsupported in applySettings on XMLTreeModifier: " + sKey);
|
|
270
|
+
}
|
|
271
|
+
});
|
|
326
272
|
},
|
|
327
273
|
|
|
328
274
|
/**
|
|
329
275
|
* @inheritDoc
|
|
330
276
|
*/
|
|
331
|
-
_byId: function
|
|
277
|
+
_byId: function(sId, oView) {
|
|
332
278
|
// If function defined and operational use getElementById(sId) of document or view to access control
|
|
333
279
|
// ... Note: oView.ownerDocument.getElementById(sId) may fail under IE 11 indicating "permission denied"
|
|
334
280
|
if (oView) {
|
|
@@ -343,18 +289,18 @@ sap.ui.define([
|
|
|
343
289
|
/**
|
|
344
290
|
* @inheritDoc
|
|
345
291
|
*/
|
|
346
|
-
getId: function
|
|
292
|
+
getId: function(oControl) {
|
|
347
293
|
return oControl.getAttribute("id");
|
|
348
294
|
},
|
|
349
295
|
|
|
350
296
|
/**
|
|
351
297
|
* @inheritDoc
|
|
352
298
|
*/
|
|
353
|
-
getParent: function
|
|
354
|
-
|
|
299
|
+
getParent: function(oControl) {
|
|
300
|
+
const oParent = oControl.parentNode;
|
|
355
301
|
if (oParent && !XmlTreeModifier.getId(oParent) && !XmlTreeModifier._isExtensionPoint(oParent)) {
|
|
356
302
|
//go to the real control, jump over aggregation node
|
|
357
|
-
|
|
303
|
+
return oParent.parentNode;
|
|
358
304
|
}
|
|
359
305
|
|
|
360
306
|
return oParent;
|
|
@@ -363,7 +309,7 @@ sap.ui.define([
|
|
|
363
309
|
/**
|
|
364
310
|
* @inheritDoc
|
|
365
311
|
*/
|
|
366
|
-
_getLocalName: function
|
|
312
|
+
_getLocalName: function(xmlElement) {
|
|
367
313
|
// localName for standard browsers, baseName for IE, nodeName in the absence of namespaces
|
|
368
314
|
return xmlElement.localName || xmlElement.baseName || xmlElement.nodeName;
|
|
369
315
|
},
|
|
@@ -371,14 +317,14 @@ sap.ui.define([
|
|
|
371
317
|
/**
|
|
372
318
|
* @inheritDoc
|
|
373
319
|
*/
|
|
374
|
-
getControlType: function
|
|
320
|
+
getControlType: function(oControl) {
|
|
375
321
|
return XmlTreeModifier._getControlTypeInXml(oControl);
|
|
376
322
|
},
|
|
377
323
|
|
|
378
324
|
/**
|
|
379
325
|
* @inheritDoc
|
|
380
326
|
*/
|
|
381
|
-
setAssociation: function
|
|
327
|
+
setAssociation: function(vParent, sName, sId) {
|
|
382
328
|
if (typeof sId !== "string"){
|
|
383
329
|
sId = XmlTreeModifier.getId(sId);
|
|
384
330
|
}
|
|
@@ -388,96 +334,82 @@ sap.ui.define([
|
|
|
388
334
|
/**
|
|
389
335
|
* @inheritDoc
|
|
390
336
|
*/
|
|
391
|
-
getAssociation: function
|
|
337
|
+
getAssociation: function(vParent, sName) {
|
|
392
338
|
return vParent.getAttribute(sName);
|
|
393
339
|
},
|
|
394
340
|
|
|
395
341
|
/**
|
|
396
342
|
* @inheritDoc
|
|
397
343
|
*/
|
|
398
|
-
getAllAggregations: function
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
return oControlMetadata.getAllAggregations();
|
|
402
|
-
});
|
|
344
|
+
getAllAggregations: async function(oControl) {
|
|
345
|
+
const oControlMetadata = await XmlTreeModifier.getControlMetadata(oControl);
|
|
346
|
+
return oControlMetadata.getAllAggregations();
|
|
403
347
|
},
|
|
404
348
|
|
|
405
349
|
/**
|
|
406
350
|
* @inheritDoc
|
|
407
351
|
*/
|
|
408
|
-
getAggregation: function
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
.
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
if (oAttribute.namespaceURI === CUSTOM_DATA_NS) {
|
|
441
|
-
var oNewCustomData = oParent.ownerDocument.createElementNS("sap.ui.core","CustomData");
|
|
442
|
-
oNewCustomData.setAttribute("key", sLocalName);
|
|
443
|
-
oNewCustomData.setAttribute("value", oAttribute.value);
|
|
444
|
-
aNamespacedCustomData.push(oNewCustomData);
|
|
445
|
-
} else if (oAttribute.namespaceURI && oAttribute.name.indexOf("xmlns:") !== 0 ) { // other, unknown namespace and not an xml namespace alias definition
|
|
446
|
-
if (!mCustomSettings) {
|
|
447
|
-
mCustomSettings = {};
|
|
448
|
-
}
|
|
449
|
-
if (!mCustomSettings.hasOwnProperty(oAttribute.namespaceURI)) {
|
|
450
|
-
mCustomSettings[oAttribute.namespaceURI] = {};
|
|
451
|
-
}
|
|
452
|
-
mCustomSettings[oAttribute.namespaceURI][sLocalName] = oAttribute.nodeValue;
|
|
453
|
-
}
|
|
454
|
-
return aNamespacedCustomData;
|
|
455
|
-
}, []);
|
|
456
|
-
aChildren = aChildren.concat(aNewCustomData);
|
|
457
|
-
//add custom settings as custom data "sap-ui-custom-settings"
|
|
458
|
-
if (mCustomSettings) {
|
|
459
|
-
var oNewCustomData = oParent.ownerDocument.createElementNS("sap.ui.core","CustomData");
|
|
460
|
-
oNewCustomData.setAttribute("key", "sap-ui-custom-settings");
|
|
461
|
-
XmlTreeModifier.setProperty(oNewCustomData, "value", mCustomSettings);
|
|
462
|
-
aChildren.push(oNewCustomData);
|
|
352
|
+
getAggregation: async function(oParent, sName) {
|
|
353
|
+
let aChildren = [];
|
|
354
|
+
const bSingleValueAggregation = await XmlTreeModifier._isSingleValueAggregation(oParent, sName);
|
|
355
|
+
const oAggregationNode = await XmlTreeModifier._findAggregationNode(oParent, sName);
|
|
356
|
+
if (oAggregationNode) {
|
|
357
|
+
const aChildrenLocal = await XmlTreeModifier._getControlsInAggregation(oParent, oAggregationNode);
|
|
358
|
+
aChildren = aChildrenLocal;
|
|
359
|
+
} else {
|
|
360
|
+
const bIsAltTypeAggregation = await XmlTreeModifier._isAltTypeAggregation(oParent, sName);
|
|
361
|
+
if (bIsAltTypeAggregation && bSingleValueAggregation) {
|
|
362
|
+
const oChild = await XmlTreeModifier.getProperty(oParent, sName);
|
|
363
|
+
aChildren.push(oChild);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
if (sName === "customData") {
|
|
369
|
+
//check namespaced attributes:
|
|
370
|
+
let mCustomSettings;
|
|
371
|
+
const aNewCustomData = Array.prototype.slice.call(oParent.attributes).reduce(function(aNamespacedCustomData, oAttribute) {
|
|
372
|
+
const sLocalName = XmlTreeModifier._getLocalName(oAttribute);
|
|
373
|
+
if (oAttribute.namespaceURI === CUSTOM_DATA_NS) {
|
|
374
|
+
const oNewCustomData = oParent.ownerDocument.createElementNS("sap.ui.core","CustomData");
|
|
375
|
+
oNewCustomData.setAttribute("key", sLocalName);
|
|
376
|
+
oNewCustomData.setAttribute("value", oAttribute.value);
|
|
377
|
+
aNamespacedCustomData.push(oNewCustomData);
|
|
378
|
+
} else if (oAttribute.namespaceURI && oAttribute.name.indexOf("xmlns:") !== 0 ) { // other, unknown namespace and not an xml namespace alias definition
|
|
379
|
+
if (!mCustomSettings) {
|
|
380
|
+
mCustomSettings = {};
|
|
381
|
+
}
|
|
382
|
+
if (!mCustomSettings.hasOwnProperty(oAttribute.namespaceURI)) {
|
|
383
|
+
mCustomSettings[oAttribute.namespaceURI] = {};
|
|
463
384
|
}
|
|
385
|
+
mCustomSettings[oAttribute.namespaceURI][sLocalName] = oAttribute.nodeValue;
|
|
464
386
|
}
|
|
465
|
-
return
|
|
466
|
-
});
|
|
387
|
+
return aNamespacedCustomData;
|
|
388
|
+
}, []);
|
|
389
|
+
aChildren = aChildren.concat(aNewCustomData);
|
|
390
|
+
//add custom settings as custom data "sap-ui-custom-settings"
|
|
391
|
+
if (mCustomSettings) {
|
|
392
|
+
const oNewCustomData = oParent.ownerDocument.createElementNS("sap.ui.core","CustomData");
|
|
393
|
+
oNewCustomData.setAttribute("key", "sap-ui-custom-settings");
|
|
394
|
+
XmlTreeModifier.setProperty(oNewCustomData, "value", mCustomSettings);
|
|
395
|
+
aChildren.push(oNewCustomData);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
return bSingleValueAggregation ? aChildren[0] : aChildren;
|
|
467
399
|
},
|
|
468
400
|
|
|
469
401
|
/**
|
|
470
402
|
* @inheritDoc
|
|
471
403
|
*/
|
|
472
|
-
insertAggregation: async function
|
|
404
|
+
insertAggregation: async function(oParent, sName, oObject, iIndex, oView, bSkipAdjustIndex) {
|
|
473
405
|
const oFoundAggregationNode = await XmlTreeModifier._findAggregationNode(oParent, sName);
|
|
474
|
-
return insertAggregation
|
|
406
|
+
return insertAggregation(oParent, sName, oObject, iIndex, oView, bSkipAdjustIndex, oFoundAggregationNode);
|
|
475
407
|
},
|
|
476
408
|
|
|
477
409
|
/**
|
|
478
410
|
* @inheritDoc
|
|
479
411
|
*/
|
|
480
|
-
removeAggregation: async function
|
|
412
|
+
removeAggregation: async function(oParent, sName, oObject) {
|
|
481
413
|
const oAggregationNode = await XmlTreeModifier._findAggregationNode(oParent, sName);
|
|
482
414
|
oAggregationNode.removeChild(oObject);
|
|
483
415
|
},
|
|
@@ -490,7 +422,7 @@ sap.ui.define([
|
|
|
490
422
|
const oTargetAggregationNode = await XmlTreeModifier._findAggregationNode(oTargetParent, sTargetAggregationName);
|
|
491
423
|
|
|
492
424
|
oSourceAggregationNode.removeChild(oObject);
|
|
493
|
-
await insertAggregation
|
|
425
|
+
await insertAggregation(oTargetParent, sTargetAggregationName, oObject, iIndex, oView, bSkipAdjustIndex, oTargetAggregationNode);
|
|
494
426
|
},
|
|
495
427
|
|
|
496
428
|
/**
|
|
@@ -510,98 +442,80 @@ sap.ui.define([
|
|
|
510
442
|
/**
|
|
511
443
|
* @inheritDoc
|
|
512
444
|
*/
|
|
513
|
-
removeAllAggregation: function
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
aChildControls.forEach(function(oChildControl) {
|
|
520
|
-
oControl.removeChild(oChildControl);
|
|
521
|
-
});
|
|
522
|
-
});
|
|
523
|
-
}
|
|
524
|
-
return oControl.removeChild(oAggregationNode);
|
|
445
|
+
removeAllAggregation: async function(oControl, sName) {
|
|
446
|
+
const oAggregationNode = await XmlTreeModifier._findAggregationNode(oControl, sName);
|
|
447
|
+
if (oControl === oAggregationNode) {
|
|
448
|
+
const aChildControls = await XmlTreeModifier._getControlsInAggregation(oControl, oControl);
|
|
449
|
+
aChildControls.forEach(function(oChildControl) {
|
|
450
|
+
oControl.removeChild(oChildControl);
|
|
525
451
|
});
|
|
452
|
+
} else {
|
|
453
|
+
return oControl.removeChild(oAggregationNode);
|
|
454
|
+
}
|
|
526
455
|
},
|
|
527
456
|
|
|
528
457
|
/**
|
|
529
458
|
* @private
|
|
530
459
|
*/
|
|
531
|
-
_findAggregationNode: function
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
for (
|
|
535
|
-
|
|
460
|
+
_findAggregationNode: async function(oParent, sName) {
|
|
461
|
+
let oAggregationNode;
|
|
462
|
+
const aChildren = XmlTreeModifier._children(oParent);
|
|
463
|
+
for (let i = 0; i < aChildren.length; i++) {
|
|
464
|
+
const oNode = aChildren[i];
|
|
536
465
|
if (oNode.localName === sName) {
|
|
537
466
|
oAggregationNode = oNode;
|
|
538
467
|
break;
|
|
539
468
|
}
|
|
540
469
|
}
|
|
541
|
-
var oPromise = Promise.resolve(oAggregationNode);
|
|
542
470
|
if (!oAggregationNode) {
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
return oParent;
|
|
548
|
-
}
|
|
549
|
-
return oAggregationNode;
|
|
550
|
-
});
|
|
471
|
+
const bIsDefaultAggregation = await XmlTreeModifier._isDefaultAggregation(oParent, sName);
|
|
472
|
+
if (bIsDefaultAggregation) {
|
|
473
|
+
return oParent;
|
|
474
|
+
}
|
|
551
475
|
}
|
|
552
|
-
return
|
|
476
|
+
return oAggregationNode;
|
|
553
477
|
},
|
|
554
478
|
|
|
555
479
|
/**
|
|
556
480
|
* @private
|
|
557
481
|
*/
|
|
558
|
-
_isDefaultAggregation: function(oParent, sAggregationName) {
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
return oDefaultAggregation && sAggregationName === oDefaultAggregation.name;
|
|
563
|
-
});
|
|
482
|
+
_isDefaultAggregation: async function(oParent, sAggregationName) {
|
|
483
|
+
const oControlMetadata = await XmlTreeModifier.getControlMetadata(oParent);
|
|
484
|
+
const oDefaultAggregation = oControlMetadata.getDefaultAggregation();
|
|
485
|
+
return oDefaultAggregation && sAggregationName === oDefaultAggregation.name;
|
|
564
486
|
},
|
|
565
487
|
|
|
566
488
|
/**
|
|
567
489
|
* @private
|
|
568
490
|
*/
|
|
569
|
-
_isNotNamedAggregationNode: function(oParent, oChildNode) {
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
return oParent.namespaceURI !== oChildNode.namespaceURI || !oAggregation; //same check as in XMLTemplateProcessor (handleChild)
|
|
574
|
-
});
|
|
491
|
+
_isNotNamedAggregationNode: async function(oParent, oChildNode) {
|
|
492
|
+
const mAllAggregationsMetadata = await XmlTreeModifier.getAllAggregations(oParent);
|
|
493
|
+
const oAggregation = mAllAggregationsMetadata[oChildNode.localName];
|
|
494
|
+
return oParent.namespaceURI !== oChildNode.namespaceURI || !oAggregation; //same check as in XMLTemplateProcessor (handleChild)
|
|
575
495
|
},
|
|
576
496
|
|
|
577
497
|
/**
|
|
578
498
|
* @private
|
|
579
499
|
*/
|
|
580
|
-
_isSingleValueAggregation: function(oParent, sAggregationName) {
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
return !oAggregationMetadata.multiple;
|
|
585
|
-
});
|
|
500
|
+
_isSingleValueAggregation: async function(oParent, sAggregationName) {
|
|
501
|
+
const mAllAggregationsMetadata = await XmlTreeModifier.getAllAggregations(oParent);
|
|
502
|
+
const oAggregationMetadata = mAllAggregationsMetadata[sAggregationName];
|
|
503
|
+
return !oAggregationMetadata.multiple;
|
|
586
504
|
},
|
|
587
505
|
|
|
588
506
|
/**
|
|
589
507
|
* @private
|
|
590
508
|
*/
|
|
591
|
-
_isAltTypeAggregation: function(oParent, sAggregationName) {
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
})
|
|
596
|
-
.then(function (oAggregationMetadata) {
|
|
597
|
-
return !!oAggregationMetadata.altTypes;
|
|
598
|
-
});
|
|
509
|
+
_isAltTypeAggregation: async function(oParent, sAggregationName) {
|
|
510
|
+
const oControlMetadata = await XmlTreeModifier.getControlMetadata(oParent);
|
|
511
|
+
const oAggregationMetadata = oControlMetadata.getAllAggregations()[sAggregationName];
|
|
512
|
+
return !!oAggregationMetadata.altTypes;
|
|
599
513
|
},
|
|
600
514
|
|
|
601
515
|
/**
|
|
602
516
|
* @private
|
|
603
517
|
*/
|
|
604
|
-
_isExtensionPoint: function
|
|
518
|
+
_isExtensionPoint: function(oControl) {
|
|
605
519
|
return XmlTreeModifier._getControlTypeInXml(oControl) === "sap.ui.core.ExtensionPoint";
|
|
606
520
|
},
|
|
607
521
|
|
|
@@ -615,30 +529,26 @@ sap.ui.define([
|
|
|
615
529
|
/**
|
|
616
530
|
* @private
|
|
617
531
|
*/
|
|
618
|
-
_getControlsInAggregation: function(oParent, oAggregationNode) {
|
|
619
|
-
//convert NodeList to Array
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
}))
|
|
627
|
-
.then(function (aChildren) {
|
|
628
|
-
return aChildren.filter(function (oChild) { return !!oChild; });
|
|
629
|
-
});
|
|
532
|
+
_getControlsInAggregation: async function(oParent, oAggregationNode) {
|
|
533
|
+
// //convert NodeList to Array
|
|
534
|
+
const aXmlChildren = [].slice.call(XmlTreeModifier._children(oAggregationNode));
|
|
535
|
+
const aChildren = await Promise.all(aXmlChildren.map(async (oChild) => {
|
|
536
|
+
const bIsNotNamedAggregationNode = await XmlTreeModifier._isNotNamedAggregationNode(oParent, oChild);
|
|
537
|
+
return bIsNotNamedAggregationNode ? oChild : undefined;
|
|
538
|
+
}));
|
|
539
|
+
return aChildren.filter((oChild) => !!oChild);
|
|
630
540
|
},
|
|
631
541
|
|
|
632
542
|
/**
|
|
633
543
|
* @private
|
|
634
544
|
*/
|
|
635
|
-
_children: function
|
|
545
|
+
_children: function(oParent) {
|
|
636
546
|
if (oParent.children) {
|
|
637
547
|
return oParent.children;
|
|
638
548
|
} else {
|
|
639
|
-
|
|
640
|
-
for (
|
|
641
|
-
|
|
549
|
+
const aChildren = [];
|
|
550
|
+
for (let i = 0; i < oParent.childNodes.length; i++) {
|
|
551
|
+
const oNode = oParent.childNodes[i];
|
|
642
552
|
if (oNode.nodeType === oNode.ELEMENT_NODE) {
|
|
643
553
|
aChildren.push(oNode);
|
|
644
554
|
}
|
|
@@ -650,193 +560,157 @@ sap.ui.define([
|
|
|
650
560
|
/**
|
|
651
561
|
* @inheritDoc
|
|
652
562
|
*/
|
|
653
|
-
getBindingTemplate: function
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
return undefined;
|
|
663
|
-
});
|
|
563
|
+
getBindingTemplate: async function(oControl, sAggregationName) {
|
|
564
|
+
const oAggregationNode = await XmlTreeModifier._findAggregationNode(oControl, sAggregationName);
|
|
565
|
+
if (oAggregationNode) {
|
|
566
|
+
const aChildren = XmlTreeModifier._children(oAggregationNode);
|
|
567
|
+
if (aChildren.length === 1){
|
|
568
|
+
return aChildren[0];
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
return undefined;
|
|
664
572
|
},
|
|
665
573
|
|
|
666
574
|
/**
|
|
667
575
|
* @inheritDoc
|
|
668
576
|
*/
|
|
669
|
-
updateAggregation: function
|
|
577
|
+
updateAggregation: function(oControl, sAggregationName) {
|
|
670
578
|
/*only needed in JS case to indicate binding (template) has changed, in XML case binding has not been created yet (see managed object)*/
|
|
671
579
|
},
|
|
672
580
|
|
|
673
581
|
/**
|
|
674
582
|
* @inheritDoc
|
|
675
583
|
*/
|
|
676
|
-
findIndexInParentAggregation: function
|
|
584
|
+
findIndexInParentAggregation: async function(oControl) {
|
|
677
585
|
// find the parent
|
|
678
|
-
|
|
586
|
+
const oParent = XmlTreeModifier.getParent(oControl);
|
|
679
587
|
|
|
680
588
|
if (!oParent) {
|
|
681
|
-
return
|
|
589
|
+
return -1;
|
|
682
590
|
}
|
|
683
591
|
|
|
684
592
|
// we need the aggregation name in order to find all control nodes in the parent
|
|
685
593
|
// which are relevant to this aggregation and skip all other possible nodes
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
if (
|
|
694
|
-
|
|
695
|
-
var aPromises = aControlsInAggregation.map(function (oControl) {
|
|
696
|
-
return Promise.resolve()
|
|
697
|
-
.then(function () {
|
|
698
|
-
if (XmlTreeModifier._isExtensionPoint(oControl)) {
|
|
699
|
-
return oControl;
|
|
700
|
-
}
|
|
701
|
-
return XmlTreeModifier.getProperty(oControl, "stashed")
|
|
702
|
-
.then(function (oProperty) {
|
|
703
|
-
return !oProperty ? oControl : undefined;
|
|
704
|
-
});
|
|
705
|
-
});
|
|
706
|
-
});
|
|
707
|
-
return Promise.all(aPromises)
|
|
708
|
-
.then(function (aControlsInAggregation) {
|
|
709
|
-
// find and return the correct index
|
|
710
|
-
return aControlsInAggregation.filter(function (oControl) {
|
|
711
|
-
return !!oControl;
|
|
712
|
-
}).indexOf(oControl);
|
|
713
|
-
});
|
|
714
|
-
} else {
|
|
715
|
-
// if aControlsInAggregation is not an array, then the aggregation is
|
|
716
|
-
// of type 0..1 and aControlsInAggregation is the oControl provided
|
|
717
|
-
// to the function initially, so its index is 0
|
|
718
|
-
return 0;
|
|
594
|
+
const sAggregationName = await XmlTreeModifier.getParentAggregationName(oControl, oParent);
|
|
595
|
+
// get the relevant controls from the aggregation node
|
|
596
|
+
let aControlsInAggregation = await XmlTreeModifier.getAggregation(oParent, sAggregationName);
|
|
597
|
+
// if the result from the above is array:
|
|
598
|
+
if (Array.isArray(aControlsInAggregation)) {
|
|
599
|
+
// to harmonize behavior with JSControlTree, where stashed controls are not added to the parent aggregation
|
|
600
|
+
const aPromises = aControlsInAggregation.map(async (oControl) => {
|
|
601
|
+
if (XmlTreeModifier._isExtensionPoint(oControl)) {
|
|
602
|
+
return oControl;
|
|
719
603
|
}
|
|
604
|
+
const oProperty = await XmlTreeModifier.getProperty(oControl, "stashed");
|
|
605
|
+
return !oProperty ? oControl : undefined;
|
|
720
606
|
});
|
|
607
|
+
aControlsInAggregation = await Promise.all(aPromises);
|
|
608
|
+
// find and return the correct index
|
|
609
|
+
return aControlsInAggregation.filter((oControl) => {
|
|
610
|
+
return !!oControl;
|
|
611
|
+
}).indexOf(oControl);
|
|
612
|
+
} else {
|
|
613
|
+
// if aControlsInAggregation is not an array, then the aggregation is
|
|
614
|
+
// of type 0..1 and aControlsInAggregation is the oControl provided
|
|
615
|
+
// to the function initially, so its index is 0
|
|
616
|
+
return 0;
|
|
617
|
+
}
|
|
721
618
|
},
|
|
722
619
|
|
|
723
620
|
/**
|
|
724
621
|
* @inheritDoc
|
|
725
622
|
*/
|
|
726
|
-
getParentAggregationName: function
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
if (bNotNamedAggregation) {
|
|
742
|
-
// the control is in the default aggregation of the parent
|
|
743
|
-
return XmlTreeModifier.getControlMetadata(oParent)
|
|
744
|
-
.then(function (oMetadata) {
|
|
745
|
-
return oMetadata.getDefaultAggregationName();
|
|
746
|
-
});
|
|
747
|
-
} else {
|
|
748
|
-
// the agregation name is provided and we can simply take it from the xml node
|
|
749
|
-
return XmlTreeModifier._getLocalName(oControl.parentNode);
|
|
750
|
-
}
|
|
751
|
-
});
|
|
623
|
+
getParentAggregationName: async function(oControl, oParent) {
|
|
624
|
+
// check if the control is in named aggregation node
|
|
625
|
+
// again check just in case
|
|
626
|
+
const bSameAsParentNode = oParent.isSameNode(oControl.parentNode);
|
|
627
|
+
const bNotNamedAggregation = await XmlTreeModifier._isNotNamedAggregationNode(oParent, oControl);
|
|
628
|
+
// check if the the control is in default aggregation
|
|
629
|
+
// and get the name of the aggregation
|
|
630
|
+
if (bNotNamedAggregation && bSameAsParentNode) {
|
|
631
|
+
// the control is in the default aggregation of the parent
|
|
632
|
+
const oMetadata = await XmlTreeModifier.getControlMetadata(oParent);
|
|
633
|
+
return oMetadata.getDefaultAggregationName();
|
|
634
|
+
} else {
|
|
635
|
+
// the aggregation name is provided and we can simply take it from the xml node
|
|
636
|
+
return XmlTreeModifier._getLocalName(oControl.parentNode);
|
|
637
|
+
}
|
|
752
638
|
},
|
|
753
639
|
|
|
754
640
|
/**
|
|
755
641
|
* @inheritDoc
|
|
756
642
|
*/
|
|
757
|
-
findAggregation: function(oControl, sAggregationName) {
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
return oAggregations[sAggregationName];
|
|
765
|
-
}
|
|
766
|
-
return undefined;
|
|
767
|
-
});
|
|
643
|
+
findAggregation: async function(oControl, sAggregationName) {
|
|
644
|
+
const oMetadata = await XmlTreeModifier.getControlMetadata(oControl);
|
|
645
|
+
const oAggregations = await oMetadata.getAllAggregations();
|
|
646
|
+
if (oAggregations) {
|
|
647
|
+
return oAggregations[sAggregationName];
|
|
648
|
+
}
|
|
649
|
+
return undefined;
|
|
768
650
|
},
|
|
769
651
|
|
|
770
652
|
/**
|
|
771
653
|
* @inheritDoc
|
|
772
654
|
*/
|
|
773
|
-
validateType: function(oControl, mAggregationMetadata, oParent, sFragment, iIndex) {
|
|
774
|
-
|
|
655
|
+
validateType: async function(oControl, mAggregationMetadata, oParent, sFragment, iIndex) {
|
|
656
|
+
const sTypeOrInterface = mAggregationMetadata.type;
|
|
775
657
|
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
aControls.forEach(function(oFragmentControl) {
|
|
791
|
-
oFragmentControl.destroy();
|
|
792
|
-
});
|
|
793
|
-
return bReturn;
|
|
794
|
-
});
|
|
658
|
+
const oAggregation = await XmlTreeModifier.getAggregation(oParent, mAggregationMetadata.name);
|
|
659
|
+
// if aggregation is not multiple and already has element inside, then it is not valid for element
|
|
660
|
+
if (mAggregationMetadata.multiple === false && oAggregation && oAggregation.length > 0) {
|
|
661
|
+
return false;
|
|
662
|
+
}
|
|
663
|
+
const vControls = await Fragment.load({
|
|
664
|
+
definition: sFragment
|
|
665
|
+
});
|
|
666
|
+
const aControls = !Array.isArray(vControls) ? [vControls] : vControls;
|
|
667
|
+
const bReturn = aControls[iIndex].isA(sTypeOrInterface);
|
|
668
|
+
aControls.forEach(function(oFragmentControl) {
|
|
669
|
+
oFragmentControl.destroy();
|
|
670
|
+
});
|
|
671
|
+
return bReturn;
|
|
795
672
|
},
|
|
796
673
|
|
|
797
674
|
/**
|
|
798
675
|
* @inheritDoc
|
|
799
676
|
*/
|
|
800
|
-
instantiateFragment: function(sFragment, sNamespace, oView) {
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
var aControls;
|
|
677
|
+
instantiateFragment: async function(sFragment, sNamespace, oView) {
|
|
678
|
+
const oInitialFragment = XMLHelper.parse(sFragment);
|
|
679
|
+
const oFragment = await XmlTreeModifier._checkAndPrefixIdsInFragment(oInitialFragment, sNamespace);
|
|
680
|
+
let aControls;
|
|
805
681
|
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
682
|
+
if (oFragment.localName === "FragmentDefinition") {
|
|
683
|
+
aControls = XmlTreeModifier._getElementNodeChildren(oFragment);
|
|
684
|
+
} else {
|
|
685
|
+
aControls = [oFragment];
|
|
686
|
+
}
|
|
811
687
|
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
688
|
+
// check if there is already a field with the same ID and throw error if so
|
|
689
|
+
aControls.forEach(function(oNode) {
|
|
690
|
+
if (XmlTreeModifier._byId(oNode.getAttribute("id"), oView)) {
|
|
691
|
+
throw Error("The following ID is already in the view: " + oNode.getAttribute("id"));
|
|
692
|
+
}
|
|
693
|
+
});
|
|
818
694
|
|
|
819
|
-
|
|
820
|
-
});
|
|
695
|
+
return aControls;
|
|
821
696
|
},
|
|
822
697
|
|
|
823
698
|
/**
|
|
824
699
|
* @inheritDoc
|
|
825
700
|
*/
|
|
826
|
-
templateControlFragment: function(sFragmentName, mPreprocessorSettings) {
|
|
827
|
-
|
|
701
|
+
templateControlFragment: async function(sFragmentName, mPreprocessorSettings) {
|
|
702
|
+
const oFragment = await BaseTreeModifier._templateFragment(
|
|
828
703
|
sFragmentName,
|
|
829
704
|
mPreprocessorSettings
|
|
830
|
-
)
|
|
831
|
-
|
|
832
|
-
});
|
|
705
|
+
);
|
|
706
|
+
return XmlTreeModifier._children(oFragment);
|
|
833
707
|
},
|
|
834
708
|
|
|
835
709
|
/**
|
|
836
710
|
* @inheritDoc
|
|
837
711
|
*/
|
|
838
712
|
destroy: function(oControl) {
|
|
839
|
-
|
|
713
|
+
const oParent = oControl.parentNode;
|
|
840
714
|
if (oParent) {
|
|
841
715
|
oParent.removeChild(oControl);
|
|
842
716
|
}
|
|
@@ -852,63 +726,86 @@ sap.ui.define([
|
|
|
852
726
|
/**
|
|
853
727
|
* @inheritDoc
|
|
854
728
|
*/
|
|
855
|
-
bindAggregation: function
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
XmlTreeModifier.bindProperty(oNode, sAggregationName, vBindingInfos.path);
|
|
859
|
-
return XmlTreeModifier.insertAggregation(oNode, sAggregationName, vBindingInfos.template, 0, oView);
|
|
860
|
-
});
|
|
729
|
+
bindAggregation: function(oNode, sAggregationName, vBindingInfos, oView) {
|
|
730
|
+
XmlTreeModifier.bindProperty(oNode, sAggregationName, vBindingInfos.path);
|
|
731
|
+
return XmlTreeModifier.insertAggregation(oNode, sAggregationName, vBindingInfos.template, 0, oView);
|
|
861
732
|
},
|
|
862
733
|
|
|
863
734
|
/**
|
|
864
735
|
* @inheritDoc
|
|
865
736
|
*/
|
|
866
|
-
unbindAggregation: function
|
|
867
|
-
|
|
868
|
-
.
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
}
|
|
873
|
-
return undefined;
|
|
874
|
-
});
|
|
737
|
+
unbindAggregation: function(oNode, sAggregationName) {
|
|
738
|
+
if (oNode.hasAttribute(sAggregationName)) {
|
|
739
|
+
oNode.removeAttribute(sAggregationName);
|
|
740
|
+
return XmlTreeModifier.removeAllAggregation(oNode, sAggregationName);
|
|
741
|
+
}
|
|
742
|
+
return Promise.resolve();
|
|
875
743
|
},
|
|
876
744
|
|
|
877
745
|
/**
|
|
878
746
|
* @inheritDoc
|
|
879
747
|
*/
|
|
880
|
-
getExtensionPointInfo: function(sExtensionPointName, oView) {
|
|
881
|
-
|
|
882
|
-
.
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
var aFilteredExtensionPoints = aExtensionPoints.filter(function(oExtPoint) {
|
|
886
|
-
return oExtPoint.getAttribute("name") === sExtensionPointName;
|
|
887
|
-
});
|
|
888
|
-
var oExtensionPoint = (aFilteredExtensionPoints.length === 1) ? aFilteredExtensionPoints[0] : undefined;
|
|
889
|
-
if (oExtensionPoint) {
|
|
890
|
-
var oParent = XmlTreeModifier.getParent(oExtensionPoint);
|
|
891
|
-
|
|
892
|
-
return Promise.all([
|
|
893
|
-
XmlTreeModifier.getParentAggregationName(oExtensionPoint, oParent),
|
|
894
|
-
XmlTreeModifier.findIndexInParentAggregation(oExtensionPoint)
|
|
895
|
-
]).then(function (aProperties) {
|
|
896
|
-
// increase the index by 1 to get the index behind the extension point for xml-case
|
|
897
|
-
var oExtensionPointInfo = {
|
|
898
|
-
parent: oParent,
|
|
899
|
-
aggregationName: aProperties[0],
|
|
900
|
-
index: aProperties[1] + 1,
|
|
901
|
-
defaultContent: Array.prototype.slice.call(XmlTreeModifier._children(oExtensionPoint))
|
|
902
|
-
};
|
|
903
|
-
return oExtensionPointInfo;
|
|
904
|
-
});
|
|
905
|
-
}
|
|
906
|
-
}
|
|
907
|
-
return undefined;
|
|
748
|
+
getExtensionPointInfo: async function(sExtensionPointName, oView) {
|
|
749
|
+
if (oView && sExtensionPointName) {
|
|
750
|
+
const aExtensionPoints = Array.prototype.slice.call(oView.getElementsByTagNameNS("sap.ui.core", "ExtensionPoint"));
|
|
751
|
+
const aFilteredExtensionPoints = aExtensionPoints.filter(function(oExtPoint) {
|
|
752
|
+
return oExtPoint.getAttribute("name") === sExtensionPointName;
|
|
908
753
|
});
|
|
754
|
+
const oExtensionPoint = (aFilteredExtensionPoints.length === 1) ? aFilteredExtensionPoints[0] : undefined;
|
|
755
|
+
if (oExtensionPoint) {
|
|
756
|
+
const oParent = XmlTreeModifier.getParent(oExtensionPoint);
|
|
757
|
+
|
|
758
|
+
const aProperties = await Promise.all([
|
|
759
|
+
XmlTreeModifier.getParentAggregationName(oExtensionPoint, oParent),
|
|
760
|
+
XmlTreeModifier.findIndexInParentAggregation(oExtensionPoint)
|
|
761
|
+
]);
|
|
762
|
+
// increase the index by 1 to get the index behind the extension point for xml-case
|
|
763
|
+
const oExtensionPointInfo = {
|
|
764
|
+
parent: oParent,
|
|
765
|
+
aggregationName: aProperties[0],
|
|
766
|
+
index: aProperties[1] + 1,
|
|
767
|
+
defaultContent: Array.prototype.slice.call(XmlTreeModifier._children(oExtensionPoint))
|
|
768
|
+
};
|
|
769
|
+
return oExtensionPointInfo;
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
return undefined;
|
|
909
773
|
}
|
|
910
774
|
});
|
|
911
775
|
|
|
776
|
+
async function insertAggregation(oParent, sName, oObject, iIndex, oView, bSkipAdjustIndex, oFoundAggregationNode) {
|
|
777
|
+
let oAggregationNode;
|
|
778
|
+
if (!oFoundAggregationNode) {
|
|
779
|
+
// named aggregation must have the same namespace as the parent
|
|
780
|
+
const sNamespaceURI = oParent.namespaceURI;
|
|
781
|
+
// no ids for aggregation nodes => no need to pass id or component
|
|
782
|
+
oAggregationNode = await XmlTreeModifier.createControl(sNamespaceURI + "." + sName, undefined, oView);
|
|
783
|
+
oParent.appendChild(oAggregationNode);
|
|
784
|
+
} else {
|
|
785
|
+
oAggregationNode = oFoundAggregationNode;
|
|
786
|
+
}
|
|
787
|
+
if (!bSkipAdjustIndex) {
|
|
788
|
+
const aChildren = oAggregationNode.children;
|
|
789
|
+
let iOffset = 0;
|
|
790
|
+
const iStopIndex = (iIndex < aChildren.length) ? iIndex : aChildren.length;
|
|
791
|
+
for (let i = 0; i < iStopIndex; i++) {
|
|
792
|
+
if (aChildren[i].namespaceURI === "sap.ui.core" && aChildren[i].tagName.includes("ExtensionPoint")) {
|
|
793
|
+
iOffset = iOffset + 1 - aChildren[i].children.length;
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
iIndex = iIndex + iOffset;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
if (iIndex >= oAggregationNode.childElementCount) {
|
|
800
|
+
oAggregationNode.appendChild(oObject);
|
|
801
|
+
} else {
|
|
802
|
+
const aReferenceNodes = await XmlTreeModifier._getControlsInAggregation(oParent, oAggregationNode);
|
|
803
|
+
oAggregationNode.insertBefore(oObject, aReferenceNodes[iIndex]);
|
|
804
|
+
}
|
|
805
|
+
return undefined;
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
|
|
912
809
|
return XmlTreeModifier;
|
|
913
810
|
},
|
|
914
811
|
/* bExport= */true);
|