@sapui5/sap.fe.templates 1.100.0 → 1.102.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/package.json +4 -5
  2. package/src/sap/fe/templates/.library +1 -2
  3. package/src/sap/fe/templates/AnalyticalListPage/Component.js +24 -12
  4. package/src/sap/fe/templates/AnalyticalListPage/Component.ts +6 -0
  5. package/src/sap/fe/templates/AnalyticalListPage/chart/FEChartDelegate.js +30 -32
  6. package/src/sap/fe/templates/AnalyticalListPage/chart/FEChartDelegate.ts +25 -0
  7. package/src/sap/fe/templates/Feedback.js +80 -0
  8. package/src/sap/fe/templates/Feedback.ts +67 -0
  9. package/src/sap/fe/templates/ListComponent.js +156 -118
  10. package/src/sap/fe/templates/ListComponent.ts +105 -0
  11. package/src/sap/fe/templates/ListReport/Component.js +82 -53
  12. package/src/sap/fe/templates/ListReport/Component.ts +39 -0
  13. package/src/sap/fe/templates/ListReport/ExtensionAPI.js +126 -112
  14. package/src/sap/fe/templates/ListReport/ExtensionAPI.ts +106 -0
  15. package/src/sap/fe/templates/ListReport/ListReport.view.xml +106 -58
  16. package/src/sap/fe/templates/ListReport/ListReportController.controller.js +1196 -1081
  17. package/src/sap/fe/templates/ListReport/ListReportController.controller.ts +1088 -0
  18. package/src/sap/fe/templates/ListReport/ListReportTemplating.js +45 -0
  19. package/src/sap/fe/templates/ListReport/ListReportTemplating.ts +30 -0
  20. package/src/sap/fe/templates/ListReport/overrides/IntentBasedNavigation.js +54 -53
  21. package/src/sap/fe/templates/ListReport/overrides/IntentBasedNavigation.ts +55 -0
  22. package/src/sap/fe/templates/ListReport/overrides/Share.js +137 -137
  23. package/src/sap/fe/templates/ListReport/overrides/Share.ts +135 -0
  24. package/src/sap/fe/templates/ListReport/overrides/ViewState.js +451 -428
  25. package/src/sap/fe/templates/ListReport/overrides/ViewState.ts +419 -0
  26. package/src/sap/fe/templates/ListReport/view/fragments/CollectionVisualization.fragment.xml +25 -25
  27. package/src/sap/fe/templates/ListReport/view/fragments/MultipleMode.fragment.js +72 -0
  28. package/src/sap/fe/templates/ListReport/view/fragments/MultipleMode.fragment.ts +62 -0
  29. package/src/sap/fe/templates/ListReport/view/fragments/{MultipleMode.fragment.xml → MultipleModeOld.fragment.xml} +24 -23
  30. package/src/sap/fe/templates/ObjectPage/Component.js +169 -138
  31. package/src/sap/fe/templates/ObjectPage/Component.ts +131 -0
  32. package/src/sap/fe/templates/ObjectPage/ExtensionAPI.js +140 -142
  33. package/src/sap/fe/templates/ObjectPage/ExtensionAPI.ts +116 -0
  34. package/src/sap/fe/templates/ObjectPage/ObjectPage.view.xml +162 -22
  35. package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.js +1534 -1447
  36. package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.ts +1454 -0
  37. package/src/sap/fe/templates/ObjectPage/ObjectPageTemplating.js +872 -0
  38. package/src/sap/fe/templates/ObjectPage/ObjectPageTemplating.ts +837 -0
  39. package/src/sap/fe/templates/ObjectPage/controls/StashableHBox.js +136 -101
  40. package/src/sap/fe/templates/ObjectPage/controls/StashableHBox.ts +84 -0
  41. package/src/sap/fe/templates/ObjectPage/controls/StashableVBox.js +24 -21
  42. package/src/sap/fe/templates/ObjectPage/controls/StashableVBox.ts +10 -0
  43. package/src/sap/fe/templates/ObjectPage/controls/SubSectionBlock.js +98 -53
  44. package/src/sap/fe/templates/ObjectPage/controls/SubSectionBlock.ts +50 -0
  45. package/src/sap/fe/templates/ObjectPage/designtime/FlexBox.designtime.js +20 -19
  46. package/src/sap/fe/templates/ObjectPage/designtime/FlexBox.designtime.ts +15 -0
  47. package/src/sap/fe/templates/ObjectPage/designtime/StashableHBox.designtime.js +50 -47
  48. package/src/sap/fe/templates/ObjectPage/designtime/StashableHBox.designtime.ts +47 -0
  49. package/src/sap/fe/templates/ObjectPage/designtime/StashableVBox.designtime.js +34 -34
  50. package/src/sap/fe/templates/ObjectPage/designtime/StashableVBox.designtime.ts +34 -0
  51. package/src/sap/fe/templates/ObjectPage/flexibility/StashableHBox.flexibility.js +15 -15
  52. package/src/sap/fe/templates/ObjectPage/flexibility/StashableHBox.flexibility.ts +13 -0
  53. package/src/sap/fe/templates/ObjectPage/flexibility/StashableVBox.flexibility.js +11 -11
  54. package/src/sap/fe/templates/ObjectPage/flexibility/StashableVBox.flexibility.ts +7 -0
  55. package/src/sap/fe/templates/ObjectPage/overrides/IntentBasedNavigation.js +55 -52
  56. package/src/sap/fe/templates/ObjectPage/overrides/IntentBasedNavigation.ts +57 -0
  57. package/src/sap/fe/templates/ObjectPage/overrides/InternalRouting.js +15 -17
  58. package/src/sap/fe/templates/ObjectPage/overrides/InternalRouting.ts +13 -0
  59. package/src/sap/fe/templates/ObjectPage/overrides/MessageHandler.js +13 -17
  60. package/src/sap/fe/templates/ObjectPage/overrides/MessageHandler.ts +14 -0
  61. package/src/sap/fe/templates/ObjectPage/overrides/Paginator.js +23 -21
  62. package/src/sap/fe/templates/ObjectPage/overrides/Paginator.ts +21 -0
  63. package/src/sap/fe/templates/ObjectPage/overrides/Share.js +310 -317
  64. package/src/sap/fe/templates/ObjectPage/overrides/Share.ts +316 -0
  65. package/src/sap/fe/templates/ObjectPage/overrides/ViewState.js +66 -57
  66. package/src/sap/fe/templates/ObjectPage/overrides/ViewState.ts +65 -0
  67. package/src/sap/fe/templates/ObjectPage/view/fragments/Actions.fragment.xml +26 -33
  68. package/src/sap/fe/templates/ObjectPage/view/fragments/CollaborationDraft.fragment.xml +11 -10
  69. package/src/sap/fe/templates/ObjectPage/view/fragments/EditableHeaderFacet.fragment.xml +15 -15
  70. package/src/sap/fe/templates/ObjectPage/view/fragments/FooterContent.fragment.xml +31 -27
  71. package/src/sap/fe/templates/ObjectPage/view/fragments/FormActionButtons.fragment.xml +15 -16
  72. package/src/sap/fe/templates/ObjectPage/view/fragments/FormActions.fragment.xml +1 -5
  73. package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderDataPoint.fragment.xml +1 -2
  74. package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderDataPointTitle.fragment.xml +1 -3
  75. package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderFacet.fragment.xml +3 -4
  76. package/src/sap/fe/templates/ObjectPage/view/fragments/Heading.fragment.xml +16 -17
  77. package/src/sap/fe/templates/ObjectPage/view/fragments/HeadingTitle.fragment.xml +3 -3
  78. package/src/sap/fe/templates/ObjectPage/view/fragments/ObjectPageHeaderForm.fragment.xml +3 -3
  79. package/src/sap/fe/templates/ObjectPage/view/fragments/RelatedApps.fragment.xml +7 -4
  80. package/src/sap/fe/templates/ObjectPage/view/fragments/Section.fragment.xml +71 -6
  81. package/src/sap/fe/templates/ObjectPage/view/fragments/SectionContent.fragment.xml +114 -94
  82. package/src/sap/fe/templates/ObjectPage/view/fragments/SectionContentLazyLoader.fragment.xml +127 -107
  83. package/src/sap/fe/templates/ObjectPage/view/fragments/SwitchDraftAndActiveObjectPopOver.fragment.xml +27 -0
  84. package/src/sap/fe/templates/RootContainer/controller/Fcl.controller.js +899 -817
  85. package/src/sap/fe/templates/RootContainer/controller/Fcl.controller.ts +833 -0
  86. package/src/sap/fe/templates/RootContainer/controller/NavContainer.controller.js +205 -189
  87. package/src/sap/fe/templates/RootContainer/controller/NavContainer.controller.ts +178 -0
  88. package/src/sap/fe/templates/RootContainer/controller/RootContainerBaseController.js +484 -459
  89. package/src/sap/fe/templates/RootContainer/controller/RootContainerBaseController.ts +438 -0
  90. package/src/sap/fe/templates/RootContainer/overrides/EditFlow.js +16 -14
  91. package/src/sap/fe/templates/RootContainer/overrides/EditFlow.ts +20 -0
  92. package/src/sap/fe/templates/TableScroller.js +45 -53
  93. package/src/sap/fe/templates/TableScroller.ts +48 -0
  94. package/src/sap/fe/templates/controls/Chart.fragment.xml +18 -17
  95. package/src/sap/fe/templates/controls/MacroChart.fragment.xml +23 -0
  96. package/src/sap/fe/templates/controls/Table.fragment.xml +3 -4
  97. package/src/sap/fe/templates/library.js +49 -63
  98. package/src/sap/fe/templates/library.ts +57 -0
  99. package/src/sap/fe/templates/messagebundle.properties +19 -7
  100. package/src/sap/fe/templates/messagebundle_ar.properties +12 -4
  101. package/src/sap/fe/templates/messagebundle_bg.properties +12 -4
  102. package/src/sap/fe/templates/messagebundle_ca.properties +12 -4
  103. package/src/sap/fe/templates/messagebundle_cs.properties +12 -4
  104. package/src/sap/fe/templates/messagebundle_cy.properties +12 -4
  105. package/src/sap/fe/templates/messagebundle_da.properties +12 -4
  106. package/src/sap/fe/templates/messagebundle_de.properties +12 -4
  107. package/src/sap/fe/templates/messagebundle_el.properties +12 -4
  108. package/src/sap/fe/templates/messagebundle_en.properties +12 -4
  109. package/src/sap/fe/templates/messagebundle_en_GB.properties +12 -4
  110. package/src/sap/fe/templates/messagebundle_en_US_sappsd.properties +13 -5
  111. package/src/sap/fe/templates/messagebundle_en_US_saprigi.properties +13 -5
  112. package/src/sap/fe/templates/messagebundle_en_US_saptrc.properties +13 -5
  113. package/src/sap/fe/templates/messagebundle_es.properties +12 -4
  114. package/src/sap/fe/templates/messagebundle_es_MX.properties +12 -4
  115. package/src/sap/fe/templates/messagebundle_et.properties +12 -4
  116. package/src/sap/fe/templates/messagebundle_fi.properties +12 -4
  117. package/src/sap/fe/templates/messagebundle_fr.properties +12 -4
  118. package/src/sap/fe/templates/messagebundle_fr_CA.properties +12 -4
  119. package/src/sap/fe/templates/messagebundle_hi.properties +12 -4
  120. package/src/sap/fe/templates/messagebundle_hr.properties +12 -4
  121. package/src/sap/fe/templates/messagebundle_hu.properties +12 -4
  122. package/src/sap/fe/templates/messagebundle_id.properties +12 -4
  123. package/src/sap/fe/templates/messagebundle_it.properties +12 -4
  124. package/src/sap/fe/templates/messagebundle_iw.properties +12 -4
  125. package/src/sap/fe/templates/messagebundle_ja.properties +12 -4
  126. package/src/sap/fe/templates/messagebundle_kk.properties +12 -4
  127. package/src/sap/fe/templates/messagebundle_ko.properties +12 -4
  128. package/src/sap/fe/templates/messagebundle_lt.properties +12 -4
  129. package/src/sap/fe/templates/messagebundle_lv.properties +12 -4
  130. package/src/sap/fe/templates/messagebundle_ms.properties +12 -4
  131. package/src/sap/fe/templates/messagebundle_nl.properties +12 -4
  132. package/src/sap/fe/templates/messagebundle_no.properties +12 -4
  133. package/src/sap/fe/templates/messagebundle_pl.properties +12 -4
  134. package/src/sap/fe/templates/messagebundle_pt.properties +13 -5
  135. package/src/sap/fe/templates/messagebundle_pt_PT.properties +12 -4
  136. package/src/sap/fe/templates/messagebundle_ro.properties +12 -4
  137. package/src/sap/fe/templates/messagebundle_ru.properties +12 -4
  138. package/src/sap/fe/templates/messagebundle_sh.properties +12 -4
  139. package/src/sap/fe/templates/messagebundle_sk.properties +12 -4
  140. package/src/sap/fe/templates/messagebundle_sl.properties +12 -4
  141. package/src/sap/fe/templates/messagebundle_sv.properties +12 -4
  142. package/src/sap/fe/templates/messagebundle_th.properties +12 -4
  143. package/src/sap/fe/templates/messagebundle_tr.properties +12 -4
  144. package/src/sap/fe/templates/messagebundle_uk.properties +12 -4
  145. package/src/sap/fe/templates/messagebundle_vi.properties +12 -4
  146. package/src/sap/fe/templates/messagebundle_zh_CN.properties +12 -4
  147. package/src/sap/fe/templates/messagebundle_zh_TW.properties +12 -4
  148. package/src/sap/fe/templates/ObjectPage/AnnotationHelper.js +0 -518
  149. package/src/sap/fe/templates/ObjectPage/templating/ObjectPageTemplating.js +0 -120
  150. package/src/sap/fe/templates/ObjectPage/templating/ObjectPageTemplating.ts +0 -138
@@ -4,7 +4,6 @@
4
4
  xmlns:template="http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1"
5
5
  xmlns:customData="http://schemas.sap.com/sapui5/extension/sap.ui.core.CustomData/1"
6
6
  >
7
-
8
7
  <IconTabBar
9
8
  expandable="false"
10
9
  headerMode="Inline"
@@ -13,37 +12,39 @@
13
12
  stretchContentHeight="true"
14
13
  customData:showCounts="{converterContext>showTabCounts}"
15
14
  >
16
- <items>
17
- <template:repeat list="{converterContext>views}" var="view">
18
-
19
- <template:with path="view>presentation" var="presentationContext">
20
- <IconTabFilter
15
+ <items>
16
+ <template:repeat list="{converterContext>views}" var="view">
17
+ <template:with path="view>presentation" var="presentationContext">
18
+ <IconTabFilter
21
19
  text="{view>title}"
22
20
  key="{= ${view>tableControlId} || ${view>customTabId} || ${view>chartControlId}}"
21
+ visible="{view>visible}"
23
22
  customData:selectionVariant="{view>selectionVariantPath}"
24
23
  >
25
- <content>
26
- <template:if test="{= ${view>type} === 'Custom'}">
27
- <template:then>
28
- <core:Fragment fragmentName="sap.fe.templates.ListReport.view.fragments.CustomView" type="XML" />
29
- </template:then>
30
- <template:else>
31
- <MessageStrip
24
+ <content>
25
+ <template:if test="{= ${view>type} === 'Custom'}">
26
+ <template:then>
27
+ <core:Fragment fragmentName="sap.fe.templates.ListReport.view.fragments.CustomView" type="XML" />
28
+ </template:then>
29
+ <template:else>
30
+ <MessageStrip
32
31
  text="{= '{= (${internal>tabs/ignoredFieldsTitle/' + (${view>tableControlId} || ${view>chartControlId}) + '} ) }' }"
33
32
  type="Information"
34
33
  showIcon="true"
35
34
  showCloseButton="true"
36
35
  class="sapUiSmallMargin"
37
36
  visible="{= '{= (${internal>tabs/ignoredFields/' + (${view>tableControlId} || ${view>chartControlId}) + '} || []).length>0 }' }"
38
- >
39
- </MessageStrip>
40
- <core:Fragment fragmentName="sap.fe.templates.ListReport.view.fragments.CollectionVisualization" type="XML" />
41
- </template:else>
42
- </template:if>
43
- </content>
44
- </IconTabFilter>
45
- </template:with>
46
- </template:repeat>
47
- </items>
37
+ />
38
+ <core:Fragment
39
+ fragmentName="sap.fe.templates.ListReport.view.fragments.CollectionVisualization"
40
+ type="XML"
41
+ />
42
+ </template:else>
43
+ </template:if>
44
+ </content>
45
+ </IconTabFilter>
46
+ </template:with>
47
+ </template:repeat>
48
+ </items>
48
49
  </IconTabBar>
49
50
  </core:FragmentDefinition>
@@ -1,141 +1,172 @@
1
1
  /*!
2
2
  * SAP UI development toolkit for HTML5 (SAPUI5)
3
- (c) Copyright 2009-2021 SAP SE. All rights reserved
4
-
3
+ * (c) Copyright 2009-2021 SAP SE. All rights reserved
5
4
  */
6
- sap.ui.define(
7
- [
8
- "sap/fe/core/TemplateComponent",
9
- "sap/ui/model/odata/v4/ODataListBinding",
10
- "sap/fe/core/CommonUtils",
11
- "sap/base/Log",
12
- "sap/fe/core/library",
13
- "sap/fe/templates/ObjectPage/SectionLayout"
14
- ],
15
- function(TemplateComponent, ODataListBinding, CommonUtils, Log, CoreLibrary, SectionLayout) {
16
- "use strict";
17
-
18
- var VariantManagement = CoreLibrary.VariantManagement,
19
- CreationMode = CoreLibrary.CreationMode,
20
- ObjectPageComponent = TemplateComponent.extend("sap.fe.templates.ObjectPage.Component", {
21
- metadata: {
22
- properties: {
23
- /**
24
- * Defines if and on which level variants can be configured:
25
- * None: no variant configuration at all
26
- * Page: one variant configuration for the whole page
27
- * Control: variant configuration on control level
28
- */
29
- variantManagement: {
30
- type: "sap.fe.core.VariantManagement",
31
- defaultValue: VariantManagement.None
32
- },
33
- /**
34
- * Defines how the sections are rendered
35
- * Page: all sections are shown on one page
36
- * Tabs: each top-level section is shown in an own tab
37
- */
38
- sectionLayout: {
39
- type: "sap.fe.templates.ObjectPage.SectionLayout",
40
- defaultValue: SectionLayout.Page
41
- },
42
- /**
43
- * Enables the related apps features
44
- */
45
- showRelatedApps: {
46
- type: "boolean",
47
- defaultValue: false
48
- },
49
-
50
- additionalSemanticObjects: {
51
- type: "object"
52
- },
53
- /**
54
- * Enables the editable object page header
55
- */
56
- editableHeaderContent: {
57
- type: "boolean",
58
- defaultValue: true
59
- },
60
- /**
61
- * Enables the BreadCrumbs features
62
- */
63
- showBreadCrumbs: {
64
- type: "boolean",
65
- defaultValue: true
66
- },
67
- /**
68
- * Defines the properties which can be used for inbound Navigation
69
- */
70
- inboundParameters: {
71
- type: "object"
72
- }
73
- },
74
- library: "sap.fe.templates",
75
- manifest: "json"
76
- },
77
-
78
- isContextExpected: function() {
79
- return true;
80
- },
81
-
82
- // TODO: this should be ideally be handled by the editflow/routing without the need to have this method in the
83
- // object page - for now keep it here
84
- createDeferredContext: function(sPath, oListBinding, bActionCreate) {
85
- if (!this.DeferredContextCreated) {
86
- this.DeferredContextCreated = true;
87
- var that = this,
88
- oParamters = {
89
- "$$groupId": "$auto.Heroes",
90
- "$$updateGroupId": "$auto"
91
- };
92
- if (!oListBinding || oListBinding.isRelative() === false) {
93
- oListBinding = new ODataListBinding(
94
- this.getModel(),
95
- sPath.replace("(...)", ""),
96
- undefined,
97
- undefined,
98
- undefined,
99
- oParamters
100
- );
101
- } else {
102
- oListBinding.mParameters = oParamters;
103
- }
104
- var oStartUpParams =
105
- this.oAppComponent &&
106
- this.oAppComponent.getComponentData() &&
107
- this.oAppComponent.getComponentData().startupParameters,
108
- oInboundParameters = this.getViewData().inboundParameters,
109
- createParams;
110
- if (oStartUpParams && oStartUpParams.preferredMode && oStartUpParams.preferredMode[0].indexOf("create") !== -1) {
111
- createParams = CommonUtils.getAdditionalParamsForCreate(oStartUpParams, oInboundParameters);
112
- }
113
-
114
- // for now wait until the view and the controller is created
115
- that.getRootControl()
116
- .getController()
117
- .editFlow.createDocument(oListBinding, {
118
- creationMode: CreationMode.Sync,
119
- createAction: bActionCreate,
120
- data: createParams
121
- })
122
- .finally(function() {
123
- that.DeferredContextCreated = false;
124
- })
125
- .catch(function() {});
126
- }
127
- },
128
-
129
- setVariantManagement: function(sVariantManagement) {
130
- if (sVariantManagement === VariantManagement.Page) {
131
- Log.error("ObjectPage does not support Page-level variant management yet");
132
- sVariantManagement = VariantManagement.None;
133
- }
134
-
135
- this.setProperty("variantManagement", sVariantManagement);
136
- }
137
- });
138
- return ObjectPageComponent;
139
- },
140
- /* bExport= */ true
141
- );
5
+ sap.ui.define(["sap/base/Log", "sap/fe/core/CommonUtils", "sap/fe/core/helpers/ClassSupport", "sap/fe/core/library", "sap/fe/core/TemplateComponent", "sap/fe/templates/library", "sap/ui/model/odata/v4/ODataListBinding"], function (Log, CommonUtils, ClassSupport, CoreLibrary, TemplateComponent, templateLib, ODataListBinding) {
6
+ "use strict";
7
+
8
+ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7;
9
+
10
+ var property = ClassSupport.property;
11
+ var defineUI5Class = ClassSupport.defineUI5Class;
12
+
13
+ function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
14
+
15
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
16
+
17
+ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
18
+
19
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
20
+
21
+ function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
22
+
23
+ function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); }
24
+
25
+ var VariantManagement = CoreLibrary.VariantManagement,
26
+ CreationMode = CoreLibrary.CreationMode;
27
+ var SectionLayout = templateLib.ObjectPage.SectionLayout;
28
+ var ObjectPageComponent = (_dec = defineUI5Class("sap.fe.templates.ObjectPage.Component", {
29
+ library: "sap.fe.templates",
30
+ manifest: "json"
31
+ }), _dec2 = property({
32
+ type: "sap.fe.core.VariantManagement",
33
+ defaultValue: VariantManagement.None
34
+ }), _dec3 = property({
35
+ type: "sap.fe.templates.ObjectPage.SectionLayout",
36
+ defaultValue: SectionLayout.Page
37
+ }), _dec4 = property({
38
+ type: "boolean",
39
+ defaultValue: false
40
+ }), _dec5 = property({
41
+ type: "object"
42
+ }), _dec6 = property({
43
+ type: "boolean",
44
+ defaultValue: true
45
+ }), _dec7 = property({
46
+ type: "boolean",
47
+ defaultValue: true
48
+ }), _dec8 = property({
49
+ type: "object"
50
+ }), _dec(_class = (_class2 = /*#__PURE__*/function (_TemplateComponent) {
51
+ _inheritsLoose(ObjectPageComponent, _TemplateComponent);
52
+
53
+ function ObjectPageComponent() {
54
+ var _this;
55
+
56
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
57
+ args[_key] = arguments[_key];
58
+ }
59
+
60
+ _this = _TemplateComponent.call.apply(_TemplateComponent, [this].concat(args)) || this;
61
+
62
+ _initializerDefineProperty(_this, "variantManagement", _descriptor, _assertThisInitialized(_this));
63
+
64
+ _initializerDefineProperty(_this, "sectionLayout", _descriptor2, _assertThisInitialized(_this));
65
+
66
+ _initializerDefineProperty(_this, "showRelatedApps", _descriptor3, _assertThisInitialized(_this));
67
+
68
+ _initializerDefineProperty(_this, "additionalSemanticObjects", _descriptor4, _assertThisInitialized(_this));
69
+
70
+ _initializerDefineProperty(_this, "editableHeaderContent", _descriptor5, _assertThisInitialized(_this));
71
+
72
+ _initializerDefineProperty(_this, "showBreadCrumbs", _descriptor6, _assertThisInitialized(_this));
73
+
74
+ _initializerDefineProperty(_this, "inboundParameters", _descriptor7, _assertThisInitialized(_this));
75
+
76
+ _this.DeferredContextCreated = false;
77
+ return _this;
78
+ }
79
+
80
+ var _proto = ObjectPageComponent.prototype;
81
+
82
+ _proto.isContextExpected = function isContextExpected() {
83
+ return true;
84
+ } // TODO: this should be ideally be handled by the editflow/routing without the need to have this method in the
85
+ // object page - for now keep it here
86
+ ;
87
+
88
+ _proto.createDeferredContext = function createDeferredContext(sPath, oListBinding, bActionCreate) {
89
+ var _this2 = this;
90
+
91
+ if (!this.DeferredContextCreated) {
92
+ this.DeferredContextCreated = true;
93
+ var oParamters = {
94
+ "$$groupId": "$auto.Heroes",
95
+ "$$updateGroupId": "$auto"
96
+ };
97
+
98
+ if (!oListBinding || oListBinding.isRelative() === false) {
99
+ oListBinding = new ODataListBinding(this.getModel(), sPath.replace("(...)", ""), undefined, undefined, undefined, oParamters);
100
+ } else {
101
+ oListBinding.mParameters = oParamters;
102
+ }
103
+
104
+ var oStartUpParams = this.oAppComponent && this.oAppComponent.getComponentData() && this.oAppComponent.getComponentData().startupParameters,
105
+ oInboundParameters = this.getViewData().inboundParameters;
106
+ var createParams;
107
+
108
+ if (oStartUpParams && oStartUpParams.preferredMode && oStartUpParams.preferredMode[0].indexOf("create") !== -1) {
109
+ createParams = CommonUtils.getAdditionalParamsForCreate(oStartUpParams, oInboundParameters);
110
+ } // for now wait until the view and the controller is created
111
+
112
+
113
+ this.getRootControl().getController().editFlow.createDocument(oListBinding, {
114
+ creationMode: CreationMode.Sync,
115
+ createAction: bActionCreate,
116
+ data: createParams
117
+ }).finally(function () {
118
+ _this2.DeferredContextCreated = false;
119
+ }).catch(function () {// Do Nothing ?
120
+ });
121
+ }
122
+ };
123
+
124
+ _proto.setVariantManagement = function setVariantManagement(sVariantManagement) {
125
+ if (sVariantManagement === VariantManagement.Page) {
126
+ Log.error("ObjectPage does not support Page-level variant management yet");
127
+ sVariantManagement = VariantManagement.None;
128
+ }
129
+
130
+ this.setProperty("variantManagement", sVariantManagement);
131
+ };
132
+
133
+ return ObjectPageComponent;
134
+ }(TemplateComponent), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "variantManagement", [_dec2], {
135
+ configurable: true,
136
+ enumerable: true,
137
+ writable: true,
138
+ initializer: null
139
+ }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "sectionLayout", [_dec3], {
140
+ configurable: true,
141
+ enumerable: true,
142
+ writable: true,
143
+ initializer: null
144
+ }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "showRelatedApps", [_dec4], {
145
+ configurable: true,
146
+ enumerable: true,
147
+ writable: true,
148
+ initializer: null
149
+ }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "additionalSemanticObjects", [_dec5], {
150
+ configurable: true,
151
+ enumerable: true,
152
+ writable: true,
153
+ initializer: null
154
+ }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "editableHeaderContent", [_dec6], {
155
+ configurable: true,
156
+ enumerable: true,
157
+ writable: true,
158
+ initializer: null
159
+ }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "showBreadCrumbs", [_dec7], {
160
+ configurable: true,
161
+ enumerable: true,
162
+ writable: true,
163
+ initializer: null
164
+ }), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "inboundParameters", [_dec8], {
165
+ configurable: true,
166
+ enumerable: true,
167
+ writable: true,
168
+ initializer: null
169
+ })), _class2)) || _class);
170
+ return ObjectPageComponent;
171
+ }, false);
172
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNvbXBvbmVudC50cyJdLCJuYW1lcyI6WyJWYXJpYW50TWFuYWdlbWVudCIsIkNvcmVMaWJyYXJ5IiwiQ3JlYXRpb25Nb2RlIiwiU2VjdGlvbkxheW91dCIsInRlbXBsYXRlTGliIiwiT2JqZWN0UGFnZSIsIk9iamVjdFBhZ2VDb21wb25lbnQiLCJkZWZpbmVVSTVDbGFzcyIsImxpYnJhcnkiLCJtYW5pZmVzdCIsInByb3BlcnR5IiwidHlwZSIsImRlZmF1bHRWYWx1ZSIsIk5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WVudChzVmFyaWFudE1hbmFnZW1lbnQ6IGFueSkge1xuXHRcdGlmIChzVmFyaWFudE1hbmFnZW1lbnQgPT09IFZhcmlhbnRNYW5hZ2VtZW50LlBhZ2UpIHtcblx0XHRcdExvZy5lcnJvcihcIk9iamVjdFBhZ2UgZG9lcyBub3Qgc3VwcG9ydCBQYWdlLWxldmVsIHZhcmlhbnQgbWFuYWdlbWVudCB5ZXRcIik7XG5cdFx0XHRzVmFyaWFudE1hbmFnZW1lbnQgPSBWYXJpYW50TWFuYWdlbWVudC5Ob25lO1xuXHRcdH1cblxuXHRcdHRoaXMuc2V0UHJvcGVydHkoXCJ2YXJpYW50TWFuYWdlbWVudFwiLCBzVmFyaWFudE1hbmFnZW1lbnQpO1xuXHR9XG59XG5cbmV4cG9ydCBkZWZhdWx0IE9iamVjdFBhZ2VDb21wb25lbnQ7XG4iXX0=
@@ -0,0 +1,131 @@
1
+ import Log from "sap/base/Log";
2
+ import CommonUtils from "sap/fe/core/CommonUtils";
3
+ import { defineUI5Class, property } from "sap/fe/core/helpers/ClassSupport";
4
+ import CoreLibrary from "sap/fe/core/library";
5
+ import TemplateComponent from "sap/fe/core/TemplateComponent";
6
+ import templateLib from "sap/fe/templates/library";
7
+ import ODataListBinding from "sap/ui/model/odata/v4/ODataListBinding";
8
+
9
+ const VariantManagement = CoreLibrary.VariantManagement,
10
+ CreationMode = CoreLibrary.CreationMode;
11
+ const SectionLayout = templateLib.ObjectPage.SectionLayout;
12
+ @defineUI5Class("sap.fe.templates.ObjectPage.Component", { library: "sap.fe.templates", manifest: "json" })
13
+ class ObjectPageComponent extends TemplateComponent {
14
+ /**
15
+ * Defines if and on which level variants can be configured:
16
+ * None: no variant configuration at all
17
+ * Page: one variant configuration for the whole page
18
+ * Control: variant configuration on control level
19
+ */
20
+ @property({
21
+ type: "sap.fe.core.VariantManagement",
22
+ defaultValue: VariantManagement.None
23
+ })
24
+ variantManagement: typeof VariantManagement;
25
+ /**
26
+ * Defines how the sections are rendered
27
+ * Page: all sections are shown on one page
28
+ * Tabs: each top-level section is shown in an own tab
29
+ */
30
+ @property({
31
+ type: "sap.fe.templates.ObjectPage.SectionLayout",
32
+ defaultValue: SectionLayout.Page
33
+ })
34
+ sectionLayout: typeof SectionLayout;
35
+ /**
36
+ * Enables the related apps features
37
+ */
38
+ @property({
39
+ type: "boolean",
40
+ defaultValue: false
41
+ })
42
+ showRelatedApps!: boolean;
43
+
44
+ @property({ type: "object" })
45
+ additionalSemanticObjects: any;
46
+ /**
47
+ * Enables the editable object page header
48
+ */
49
+ @property({
50
+ type: "boolean",
51
+ defaultValue: true
52
+ })
53
+ editableHeaderContent!: boolean;
54
+ /**
55
+ * Enables the BreadCrumbs features
56
+ */
57
+ @property({
58
+ type: "boolean",
59
+ defaultValue: true
60
+ })
61
+ showBreadCrumbs!: boolean;
62
+ /**
63
+ * Defines the properties which can be used for inbound Navigation
64
+ */
65
+ @property({
66
+ type: "object"
67
+ })
68
+ inboundParameters: any;
69
+ private DeferredContextCreated: Boolean = false;
70
+
71
+ isContextExpected() {
72
+ return true;
73
+ }
74
+
75
+ // TODO: this should be ideally be handled by the editflow/routing without the need to have this method in the
76
+ // object page - for now keep it here
77
+ createDeferredContext(sPath: any, oListBinding: any, bActionCreate: any) {
78
+ if (!this.DeferredContextCreated) {
79
+ this.DeferredContextCreated = true;
80
+ const oParamters = {
81
+ "$$groupId": "$auto.Heroes",
82
+ "$$updateGroupId": "$auto"
83
+ };
84
+ if (!oListBinding || oListBinding.isRelative() === false) {
85
+ oListBinding = new (ODataListBinding as any)(
86
+ this.getModel(),
87
+ sPath.replace("(...)", ""),
88
+ undefined,
89
+ undefined,
90
+ undefined,
91
+ oParamters
92
+ );
93
+ } else {
94
+ oListBinding.mParameters = oParamters;
95
+ }
96
+ const oStartUpParams =
97
+ this.oAppComponent && this.oAppComponent.getComponentData() && this.oAppComponent.getComponentData().startupParameters,
98
+ oInboundParameters = this.getViewData().inboundParameters;
99
+ let createParams;
100
+ if (oStartUpParams && oStartUpParams.preferredMode && oStartUpParams.preferredMode[0].indexOf("create") !== -1) {
101
+ createParams = CommonUtils.getAdditionalParamsForCreate(oStartUpParams, oInboundParameters);
102
+ }
103
+
104
+ // for now wait until the view and the controller is created
105
+ (this.getRootControl() as any)
106
+ .getController()
107
+ .editFlow.createDocument(oListBinding, {
108
+ creationMode: CreationMode.Sync,
109
+ createAction: bActionCreate,
110
+ data: createParams
111
+ })
112
+ .finally(() => {
113
+ this.DeferredContextCreated = false;
114
+ })
115
+ .catch(function () {
116
+ // Do Nothing ?
117
+ });
118
+ }
119
+ }
120
+
121
+ setVariantManagement(sVariantManagement: any) {
122
+ if (sVariantManagement === VariantManagement.Page) {
123
+ Log.error("ObjectPage does not support Page-level variant management yet");
124
+ sVariantManagement = VariantManagement.None;
125
+ }
126
+
127
+ this.setProperty("variantManagement", sVariantManagement);
128
+ }
129
+ }
130
+
131
+ export default ObjectPageComponent;