@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
@@ -0,0 +1,419 @@
1
+ import Log from "sap/base/Log";
2
+ import CommonUtils from "sap/fe/core/CommonUtils";
3
+ import ViewState from "sap/fe/core/controllerextensions/ViewState";
4
+ import KeepAliveHelper from "sap/fe/core/helpers/KeepAliveHelper";
5
+ import ModelHelper, { InternalModelContext } from "sap/fe/core/helpers/ModelHelper";
6
+ import CoreLibrary from "sap/fe/core/library";
7
+ import * as PropertyFormatters from "sap/fe/core/templating/PropertyFormatters";
8
+ import DelegateUtil from "sap/fe/macros/DelegateUtil";
9
+ import FilterUtils from "sap/fe/macros/filter/FilterUtils";
10
+ import NavLibrary from "sap/fe/navigation/library";
11
+ import ListReportController from "sap/fe/templates/ListReport/ListReportController.controller";
12
+ import { system } from "sap/ui/Device";
13
+ import ControlVariantApplyAPI from "sap/ui/fl/apply/api/ControlVariantApplyAPI";
14
+ import VariantManagement from "sap/ui/fl/variants/VariantManagement";
15
+ import ConditionValidated from "sap/ui/mdc/enum/ConditionValidated";
16
+ import StateUtil from "sap/ui/mdc/p13n/StateUtil";
17
+ import JSONModel from "sap/ui/model/json/JSONModel";
18
+
19
+ const NavType = NavLibrary.NavType,
20
+ VariantManagementType = CoreLibrary.VariantManagement,
21
+ TemplateContentView = CoreLibrary.TemplateContentView,
22
+ InitialLoadMode = CoreLibrary.InitialLoadMode;
23
+ const FilterRestrictions = CommonUtils.FilterRestrictions,
24
+ CONDITION_PATH_TO_PROPERTY_PATH_REGEX = /\+|\*/g;
25
+
26
+ const ViewStateOverride: any = {
27
+ _bSearchTriggered: false,
28
+ applyInitialStateOnly: function () {
29
+ return true;
30
+ },
31
+ onBeforeStateApplied: function (this: ViewState & typeof ViewStateOverride, aPromises: any) {
32
+ const oView = this.getView(),
33
+ oController = oView.getController() as ListReportController,
34
+ oFilterBar = oController._getFilterBarControl(),
35
+ aTables = oController._getControls("table");
36
+ if (oFilterBar) {
37
+ oFilterBar.setSuspendSelection(true);
38
+ aPromises.push((oFilterBar as any).waitForInitialization());
39
+ }
40
+ aTables.forEach(function (oTable: any) {
41
+ aPromises.push(oTable.initialized());
42
+ });
43
+
44
+ delete this._bSearchTriggered;
45
+ },
46
+ onAfterStateApplied: function (this: ViewState) {
47
+ const oController = this.getView().getController() as ListReportController;
48
+ const oFilterBar = oController._getFilterBarControl();
49
+ if (oFilterBar) {
50
+ oFilterBar.setSuspendSelection(false);
51
+ } else if (oController._isFilterBarHidden()) {
52
+ const oInternalModelContext = oController.getView().getBindingContext("internal") as InternalModelContext,
53
+ aControls = oController._getControls();
54
+ oInternalModelContext.setProperty("hasPendingFilters", false);
55
+ if (oController._isMultiMode()) {
56
+ oController._setCountsOutDated();
57
+ const sDisplayedControlId = oController._getCurrentControl().getId();
58
+ aControls.forEach(function (oControl: any) {
59
+ oControl.data("outdatedRows", oControl.getId() !== sDisplayedControlId);
60
+ });
61
+ }
62
+ }
63
+ },
64
+ adaptBindingRefreshControls: function (this: ViewState, aControls: any) {
65
+ const oView = this.getView(),
66
+ oController = oView.getController() as ListReportController,
67
+ aViewControls = oController._getControls(),
68
+ aControlsToRefresh = KeepAliveHelper.getControlsForRefresh(oView, aViewControls);
69
+
70
+ Array.prototype.push.apply(aControls, aControlsToRefresh);
71
+ },
72
+ adaptStateControls: function (this: ViewState & typeof ViewStateOverride, aStateControls: any) {
73
+ const oView = this.getView(),
74
+ oController = oView.getController() as ListReportController,
75
+ oViewData = oView.getViewData() as any,
76
+ bControlVM = oViewData.variantManagement === VariantManagementType.Control;
77
+
78
+ const oFilterBarVM = this._getFilterBarVM(oView);
79
+ if (oFilterBarVM) {
80
+ aStateControls.push(oFilterBarVM);
81
+ }
82
+ if (oController._isMultiMode()) {
83
+ aStateControls.push(oController._getMultiModeControl());
84
+ }
85
+ oController._getControls("table").forEach(function (oTable: any) {
86
+ const oQuickFilter = oTable.getQuickFilter();
87
+ if (oQuickFilter) {
88
+ aStateControls.push(oQuickFilter);
89
+ }
90
+ if (bControlVM) {
91
+ aStateControls.push(oTable.getVariant());
92
+ }
93
+ aStateControls.push(oTable);
94
+ });
95
+ if (oController._getControls("Chart")) {
96
+ oController._getControls("Chart").forEach(function (oChart: any) {
97
+ aStateControls.push(oChart);
98
+ });
99
+ }
100
+ if (oController._hasMultiVisualizations()) {
101
+ aStateControls.push(oController._getSegmentedButton(TemplateContentView.Chart));
102
+ aStateControls.push(oController._getSegmentedButton(TemplateContentView.Table));
103
+ }
104
+ const oFilterBar = oController._getFilterBarControl();
105
+ if (oFilterBar) {
106
+ aStateControls.push(oFilterBar);
107
+ }
108
+ aStateControls.push(oView.byId("fe::ListReport"));
109
+ },
110
+ retrieveAdditionalStates: function (this: ViewState & typeof ViewStateOverride, mAdditionalStates: any) {
111
+ const oView = this.getView(),
112
+ oController = oView.getController() as ListReportController,
113
+ bPendingFilter = (oView.getBindingContext("internal") as InternalModelContext).getProperty("hasPendingFilters");
114
+
115
+ mAdditionalStates.dataLoaded = !bPendingFilter || !!this._bSearchTriggered;
116
+ if (oController._hasMultiVisualizations()) {
117
+ const sAlpContentView = oView.getBindingContext("internal").getProperty("alpContentView");
118
+ mAdditionalStates.alpContentView = sAlpContentView;
119
+ }
120
+
121
+ delete this._bSearchTriggered;
122
+ },
123
+ applyAdditionalStates: function (this: ViewState & typeof ViewStateOverride, oAdditionalStates: any) {
124
+ const oView = this.getView(),
125
+ oController = oView.getController() as ListReportController,
126
+ oFilterBar = oController._getFilterBarControl();
127
+
128
+ if (oAdditionalStates) {
129
+ // explicit check for boolean values - 'undefined' should not alter the triggered search property
130
+ if (oAdditionalStates.dataLoaded === false && oFilterBar) {
131
+ // without this, the data is loaded on navigating back
132
+ (oFilterBar as any)._bSearchTriggered = false;
133
+ } else if (oAdditionalStates.dataLoaded === true) {
134
+ if (oFilterBar) {
135
+ oFilterBar.triggerSearch();
136
+ }
137
+ this._bSearchTriggered = true;
138
+ }
139
+ if (oController._hasMultiVisualizations()) {
140
+ const oInternalModelContext = oView.getBindingContext("internal") as InternalModelContext;
141
+ if (!system.desktop && oAdditionalStates.alpContentView == TemplateContentView.Hybrid) {
142
+ oAdditionalStates.alpContentView = TemplateContentView.Chart;
143
+ }
144
+ (oInternalModelContext.getModel() as JSONModel).setProperty(
145
+ oInternalModelContext.getPath() + "/alpContentView",
146
+ oAdditionalStates.alpContentView
147
+ );
148
+ }
149
+ }
150
+ },
151
+ applyNavigationParameters: function (this: ViewState & typeof ViewStateOverride, oNavigationParameter: any, aResults: any) {
152
+ const oView = this.getView();
153
+ const oController = oView.getController() as ListReportController;
154
+ const oAppComponent = oController.getAppComponent();
155
+ const oComponentData = oAppComponent.getComponentData();
156
+ const oStartupParameters = (oComponentData && oComponentData.startupParameters) || {};
157
+ const oVariantPromise = this.handleVariantIdPassedViaURLParams(oStartupParameters);
158
+ let bFilterVariantApplied: boolean;
159
+ aResults.push(
160
+ oVariantPromise
161
+ .then((aVariants: any[]) => {
162
+ if (aVariants && aVariants.length > 0) {
163
+ if (aVariants[0] === true || aVariants[1] === true) {
164
+ bFilterVariantApplied = true;
165
+ }
166
+ }
167
+ return this._applySelectionVariant(oView, oNavigationParameter, bFilterVariantApplied).then(() => {
168
+ const oDynamicPage = oView.byId("fe::ListReport");
169
+ let bPreventInitialSearch = false;
170
+ const oFilterBarVM = this._getFilterBarVM(oView);
171
+ const oFilterBarControl = oController._getFilterBarControl();
172
+ if (oFilterBarControl) {
173
+ if (
174
+ (oNavigationParameter.navigationType !== NavType.initial && oNavigationParameter.requiresStandardVariant) ||
175
+ (!oFilterBarVM && oView.getViewData().initialLoad === InitialLoadMode.Enabled) ||
176
+ oController._shouldAutoTriggerSearch(oFilterBarVM)
177
+ ) {
178
+ oFilterBarControl.triggerSearch();
179
+ } else {
180
+ bPreventInitialSearch = this._preventInitialSearch(oFilterBarVM);
181
+ }
182
+ // reset the suspend selection on filter bar to allow loading of data when needed (was set on LR Init)
183
+ oFilterBarControl.setSuspendSelection(false);
184
+ this._bSearchTriggered = !bPreventInitialSearch;
185
+ oDynamicPage.setHeaderExpanded(system.desktop || bPreventInitialSearch);
186
+ }
187
+ });
188
+ })
189
+ .catch(function () {
190
+ Log.error("Variant ID cannot be applied");
191
+ })
192
+ );
193
+ },
194
+
195
+ handleVariantIdPassedViaURLParams: function (this: ViewState & typeof ViewStateOverride, oUrlParams: any) {
196
+ const aPageVariantId = oUrlParams["sap-ui-fe-variant-id"],
197
+ aFilterBarVariantId = oUrlParams["sap-ui-fe-filterbar-variant-id"],
198
+ aTableVariantId = oUrlParams["sap-ui-fe-table-variant-id"];
199
+ let oVariant;
200
+ if (aPageVariantId || aFilterBarVariantId || aTableVariantId) {
201
+ oVariant = {
202
+ sPageVariantId: aPageVariantId && aPageVariantId[0],
203
+ sFilterBarVariantId: aFilterBarVariantId && aFilterBarVariantId[0],
204
+ sTableVariantId: aTableVariantId && aTableVariantId[0]
205
+ };
206
+ }
207
+ return this._handleControlVariantId(oVariant);
208
+ },
209
+
210
+ _handleControlVariantId: function (this: ViewState & typeof ViewStateOverride, oVariantIDs: any) {
211
+ let oVM: VariantManagement;
212
+ const oView = this.getView(),
213
+ aPromises: any[] = [];
214
+ const sVariantManagement = oView.getViewData().variantManagement;
215
+ if (oVariantIDs && oVariantIDs.sPageVariantId && sVariantManagement === "Page") {
216
+ oVM = oView.byId("fe::PageVariantManagement");
217
+ oVM.getVariants().forEach((oVariant: any) => {
218
+ if (oVariant.key === oVariantIDs.sPageVariantId) {
219
+ aPromises.push(this._applyControlVariant(oVM, oVariantIDs.sPageVariantId, true));
220
+ }
221
+ });
222
+ } else if (oVariantIDs && sVariantManagement === "Control") {
223
+ if (oVariantIDs.sFilterBarVariantId) {
224
+ oVM = oView.byId(oView.getContent()[0].data("filterBarVariantId"));
225
+ if (oVM) {
226
+ oVM.getVariants().forEach((oVariant: any) => {
227
+ if (oVariant.key === oVariantIDs.sFilterBarVariantId) {
228
+ aPromises.push(this._applyControlVariant(oVM, oVariantIDs.sFilterBarVariantId, true));
229
+ }
230
+ });
231
+ }
232
+ }
233
+ if (oVariantIDs.sTableVariantId) {
234
+ const oController = oView.getController(),
235
+ aTables = oController._getControls("table");
236
+ aTables.forEach((oTable: any) => {
237
+ const oTableVariant = oTable.getVariant();
238
+ if (oTable && oTableVariant) {
239
+ oTableVariant.getVariants().forEach((oVariant: any) => {
240
+ if (oVariant.key === oVariantIDs.sTableVariantId) {
241
+ aPromises.push(this._applyControlVariant(oTableVariant, oVariantIDs.sTableVariantId));
242
+ }
243
+ });
244
+ }
245
+ });
246
+ }
247
+ }
248
+ return Promise.all(aPromises);
249
+ },
250
+
251
+ _applyControlVariant: function (oVariant: any, sVariantID: any, bFilterVariantApplied: any) {
252
+ const sVariantReference = this._checkIfVariantIdIsAvailable(oVariant, sVariantID) ? sVariantID : oVariant.getStandardVariantKey();
253
+ const oVM = ControlVariantApplyAPI.activateVariant({
254
+ element: oVariant,
255
+ variantReference: sVariantReference
256
+ });
257
+ return oVM.then(function () {
258
+ return bFilterVariantApplied;
259
+ });
260
+ },
261
+ /************************************* private helper *****************************************/
262
+
263
+ _getFilterBarVM: function (oView: any) {
264
+ const oViewData = oView.getViewData();
265
+ switch (oViewData.variantManagement) {
266
+ case VariantManagementType.Page:
267
+ return oView.byId("fe::PageVariantManagement");
268
+ case VariantManagementType.Control:
269
+ return oView.byId(oView.getContent()[0].data("filterBarVariantId"));
270
+ case VariantManagementType.None:
271
+ return null;
272
+ default:
273
+ throw new Error("unhandled variant setting: " + oViewData.variantManagement);
274
+ }
275
+ },
276
+
277
+ _preventInitialSearch: function (oVariantManagement: any) {
278
+ if (!oVariantManagement) {
279
+ return true;
280
+ }
281
+ const aVariants = oVariantManagement.getVariants();
282
+ const oCurrentVariant = aVariants.find(function (oItem: any) {
283
+ return oItem.key === oVariantManagement.getCurrentVariantKey();
284
+ });
285
+ return !oCurrentVariant.executeOnSelect;
286
+ },
287
+
288
+ _applySelectionVariant: function (oView: any, oNavigationParameter: any, bFilterVariantApplied: any) {
289
+ const oFilterBar = oView.getController()._getFilterBarControl(),
290
+ oSelectionVariant = oNavigationParameter.selectionVariant,
291
+ oSelectionVariantDefaults = oNavigationParameter.selectionVariantDefaults;
292
+ if (!oFilterBar || !oSelectionVariant) {
293
+ return Promise.resolve();
294
+ }
295
+ let oConditions = {};
296
+ const oMetaModel = oView.getModel().getMetaModel();
297
+ const oViewData = oView.getViewData();
298
+ const sContextPath = oViewData.contextPath || "/" + oViewData.entitySet;
299
+ const aMandatoryFilterFields = CommonUtils.getMandatoryFilterFields(oMetaModel, sContextPath);
300
+ let oVariant;
301
+ const bRequiresStandardVariant = oNavigationParameter.requiresStandardVariant;
302
+
303
+ if (bFilterVariantApplied) {
304
+ oConditions = oFilterBar.getConditions();
305
+ }
306
+ CommonUtils.addDefaultDisplayCurrency(aMandatoryFilterFields, oSelectionVariant, oSelectionVariantDefaults);
307
+ CommonUtils.addSelectionVariantToConditions(oSelectionVariant, oConditions, oMetaModel, sContextPath);
308
+ switch (oViewData.variantManagement) {
309
+ case VariantManagementType.Page:
310
+ oVariant = oView.byId("fe::PageVariantManagement");
311
+ break;
312
+ case VariantManagementType.Control:
313
+ oVariant = oView.byId(oView.getContent()[0].data("filterBarVariantId"));
314
+ break;
315
+ case VariantManagementType.None:
316
+ default:
317
+ break;
318
+ }
319
+ return this._activateSelectionVariant(oFilterBar, oConditions, oVariant, bRequiresStandardVariant, bFilterVariantApplied);
320
+ },
321
+ _activateSelectionVariant: function (
322
+ oFilterBar: any,
323
+ oConditions: any,
324
+ oVariant: any,
325
+ bRequiresStandardVariant: any,
326
+ bFilterVariantApplied: any
327
+ ) {
328
+ let oPromise;
329
+
330
+ if (oVariant && !bFilterVariantApplied) {
331
+ let oVariantKey = bRequiresStandardVariant ? oVariant.getStandardVariantKey() : oVariant.getDefaultVariantKey();
332
+ if (oVariantKey === null) {
333
+ oVariantKey = oVariant.getId();
334
+ }
335
+ oPromise = ControlVariantApplyAPI.activateVariant({
336
+ element: oVariant,
337
+ variantReference: oVariantKey
338
+ }).then(function () {
339
+ return bRequiresStandardVariant || oVariant.getDefaultVariantKey() === oVariant.getStandardVariantKey();
340
+ });
341
+ } else {
342
+ oPromise = Promise.resolve(true);
343
+ }
344
+ return oPromise.then((bClearFilterAndReplaceWithAppState: any) => {
345
+ if (bClearFilterAndReplaceWithAppState) {
346
+ return this._fnApplyConditions(oFilterBar, oConditions);
347
+ }
348
+ });
349
+ },
350
+ _fnApplyConditions: function (oFilterBar: any, oConditions: any) {
351
+ const mFilter: any = {},
352
+ aItems: any[] = [],
353
+ fnAdjustValueHelpCondition = function (oCondition: any) {
354
+ // in case the condition is meant for a field having a VH, the format required by MDC differs
355
+ oCondition.validated = ConditionValidated.Validated;
356
+ if (oCondition.operator === "Empty") {
357
+ oCondition.operator = "EQ";
358
+ oCondition.values = [""];
359
+ } else if (oCondition.operator === "NotEmpty") {
360
+ oCondition.operator = "NE";
361
+ oCondition.values = [""];
362
+ }
363
+ delete oCondition.isEmpty;
364
+ };
365
+ const fnGetPropertyInfo = function (oFilterControl: any, sEntityTypePath: any) {
366
+ const sEntitySetPath = ModelHelper.getEntitySetPath(sEntityTypePath),
367
+ oMetaModel = oFilterControl.getModel().getMetaModel(),
368
+ oFR = CommonUtils.getFilterRestrictionsByPath(sEntitySetPath, oMetaModel),
369
+ aNonFilterableProps = oFR[FilterRestrictions.NON_FILTERABLE_PROPERTIES],
370
+ mFilterFields = FilterUtils.getConvertedFilterFields(oFilterControl, sEntityTypePath),
371
+ aPropertyInfo: any[] = [];
372
+ Object.keys(mFilterFields).forEach(function (sFilterFieldKey: string) {
373
+ const oConvertedProperty = mFilterFields[sFilterFieldKey];
374
+ const sPropertyPath = oConvertedProperty.conditionPath.replace(CONDITION_PATH_TO_PROPERTY_PATH_REGEX, "");
375
+ if (aNonFilterableProps.indexOf(sPropertyPath) === -1) {
376
+ const sAnnotationPath = oConvertedProperty.annotationPath;
377
+ const oPropertyContext = oMetaModel.createBindingContext(sAnnotationPath);
378
+ aPropertyInfo.push({
379
+ path: oConvertedProperty.conditionPath,
380
+ hiddenFilter: oConvertedProperty.availability === "Hidden",
381
+ hasValueHelp: !sAnnotationPath
382
+ ? false
383
+ : PropertyFormatters.hasValueHelp(oPropertyContext.getObject(), { context: oPropertyContext })
384
+ });
385
+ return;
386
+ }
387
+ });
388
+ return aPropertyInfo;
389
+ };
390
+ return oFilterBar.waitForInitialization().then(function () {
391
+ const sEntityTypePath = DelegateUtil.getCustomData(oFilterBar, "entityType");
392
+ const aPropertyInfo = fnGetPropertyInfo(oFilterBar, sEntityTypePath);
393
+ aPropertyInfo
394
+ .filter(function (oPropertyInfo: any) {
395
+ return oPropertyInfo.path !== "$editState" && oPropertyInfo.path !== "$search";
396
+ })
397
+ .forEach(function (oPropertyInfo: any) {
398
+ if (oPropertyInfo.path in oConditions) {
399
+ mFilter[oPropertyInfo.path] = oConditions[oPropertyInfo.path];
400
+ if (!oPropertyInfo.hiddenFilter) {
401
+ aItems.push({ name: oPropertyInfo.path });
402
+ }
403
+ if (oPropertyInfo.hasValueHelp) {
404
+ mFilter[oPropertyInfo.path].forEach(fnAdjustValueHelpCondition);
405
+ } else {
406
+ mFilter[oPropertyInfo.path].forEach(function (oCondition: any) {
407
+ oCondition.validated = ConditionValidated.NotValidated;
408
+ });
409
+ }
410
+ } else {
411
+ mFilter[oPropertyInfo.path] = [];
412
+ }
413
+ });
414
+ return StateUtil.applyExternalState(oFilterBar, { filter: mFilter, items: aItems });
415
+ });
416
+ }
417
+ };
418
+
419
+ export default ViewStateOverride;
@@ -4,37 +4,37 @@
4
4
  xmlns:core="sap.ui.core"
5
5
  xmlns:template="http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1"
6
6
  >
7
- <template:if test="{= ${converterContext>hasMultiVisualizations} }">
8
- <template:then>
9
- <m:VBox fitContainer="true" alignItems="Stretch" alignContent="Stretch" justifyContent="Start" renderType="Div">
10
- <template:repeat list="{converterContext>views}" var="view">
11
- <template:with path="view>primaryVisualization" var="presentationContext">
12
- <template:repeat list="{presentationContext>visualizations}" var="visualizationDefinition">
13
- <m:MessageStrip
14
- text="{= '{path:\'internal>controls/ignoredFields' + (${visualizationDefinition>collection}) + (${visualizationDefinition>type}) + '\', formatter: \'.formatters.setChartMessageStrip\'}'}"
7
+ <template:if test="{= ${converterContext>hasMultiVisualizations} }">
8
+ <template:then>
9
+ <m:VBox fitContainer="true" alignItems="Stretch" alignContent="Stretch" justifyContent="Start" renderType="Div">
10
+ <template:repeat list="{converterContext>views}" var="view">
11
+ <template:with path="view>primaryVisualization" var="presentationContext">
12
+ <template:repeat list="{presentationContext>visualizations}" var="visualizationDefinition">
13
+ <m:MessageStrip
14
+ text="{= '{parts:[{path:\'internal>controls/ignoredFields' + (${visualizationDefinition>collection}) + (${visualizationDefinition>type}) + '\'},{value: \'\'}, {value: \'' + (${visualizationDefinition>type} === 'Chart') + '\'}, {value: ' + (${visualizationDefinition>type} === 'Chart' ? JSON.stringify(${visualizationDefinition>applySupported}) : '\'\'') + '}], formatter: \'.formatters.setTabMessageStrip\'}'}"
15
15
  type="Information"
16
16
  showIcon="true"
17
17
  showCloseButton="true"
18
18
  class="sapUiSmallMargin"
19
19
  visible="{= '{= (${internal>controls/ignoredFields' + (${visualizationDefinition>collection}) + (${visualizationDefinition>type}) + '} || []).length>0 &amp;&amp; ${pageInternal>alpContentView} !== \'Table\'}' }"
20
20
  />
21
+ <core:Fragment fragmentName="sap.fe.templates.controls.{visualizationDefinition>type}" type="XML" />
22
+ </template:repeat>
23
+ </template:with>
24
+ <template:with path="view>secondaryVisualization" var="presentationContext">
25
+ <template:repeat list="{presentationContext>visualizations}" var="visualizationDefinition">
26
+ <m:HBox height="100%" width="100%">
21
27
  <core:Fragment fragmentName="sap.fe.templates.controls.{visualizationDefinition>type}" type="XML" />
22
- </template:repeat>
23
- </template:with>
24
- <template:with path="view>secondaryVisualization" var="presentationContext">
25
- <template:repeat list="{presentationContext>visualizations}" var="visualizationDefinition">
26
- <m:HBox height="100%" width="100%">
27
- <core:Fragment fragmentName="sap.fe.templates.controls.{visualizationDefinition>type}" type="XML" />
28
- </m:HBox>
29
- </template:repeat>
30
- </template:with>
31
- </template:repeat>
32
- </m:VBox>
33
- </template:then>
34
- <template:else>
35
- <template:repeat list="{presentationContext>visualizations}" var="visualizationDefinition">
36
- <core:Fragment fragmentName="sap.fe.templates.controls.{visualizationDefinition>type}" type="XML" />
28
+ </m:HBox>
29
+ </template:repeat>
30
+ </template:with>
37
31
  </template:repeat>
38
- </template:else>
39
- </template:if>
32
+ </m:VBox>
33
+ </template:then>
34
+ <template:else>
35
+ <template:repeat list="{presentationContext>visualizations}" var="visualizationDefinition">
36
+ <core:Fragment fragmentName="sap.fe.templates.controls.{visualizationDefinition>type}" type="XML" />
37
+ </template:repeat>
38
+ </template:else>
39
+ </template:if>
40
40
  </core:FragmentDefinition>
@@ -0,0 +1,72 @@
1
+ /*!
2
+ * SAP UI development toolkit for HTML5 (SAPUI5)
3
+ * (c) Copyright 2009-2021 SAP SE. All rights reserved
4
+ */
5
+ sap.ui.define(["sap/fe/core/buildingBlocks/BuildingBlock", "sap/fe/core/buildingBlocks/BuildingBlockRuntime"], function (BuildingBlock, BuildingBlockRuntime) {
6
+ "use strict";
7
+
8
+ var _dec, _dec2, _class, _class2, _descriptor, _templateObject;
9
+
10
+ var _exports = {};
11
+ var xml = BuildingBlockRuntime.xml;
12
+ var xmlAttribute = BuildingBlock.xmlAttribute;
13
+ var defineBuildingBlock = BuildingBlock.defineBuildingBlock;
14
+ var BuildingBlockBase = BuildingBlock.BuildingBlockBase;
15
+
16
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
17
+
18
+ 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 }); }
19
+
20
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
21
+
22
+ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
23
+
24
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
25
+
26
+ 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; }
27
+
28
+ 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.'); }
29
+
30
+ var MultipleMode = (_dec = defineBuildingBlock({
31
+ name: "MultipleMode",
32
+ namespace: "sap.fe.templates.ListReport.view.fragments",
33
+ isOpen: true
34
+ }), _dec2 = xmlAttribute({
35
+ type: "sap.ui.model.Context"
36
+ }), _dec(_class = (_class2 = /*#__PURE__*/function (_BuildingBlockBase) {
37
+ _inheritsLoose(MultipleMode, _BuildingBlockBase);
38
+
39
+ function MultipleMode() {
40
+ var _this;
41
+
42
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
43
+ args[_key] = arguments[_key];
44
+ }
45
+
46
+ _this = _BuildingBlockBase.call.apply(_BuildingBlockBase, [this].concat(args)) || this;
47
+
48
+ _initializerDefineProperty(_this, "converterContext", _descriptor, _assertThisInitialized(_this));
49
+
50
+ return _this;
51
+ }
52
+
53
+ _exports = MultipleMode;
54
+ var _proto = MultipleMode.prototype;
55
+
56
+ _proto.getTemplate = function getTemplate() {
57
+ return xml(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t\t\t<IconTabBar\n\t\t\t\txmlns=\"sap.m\"\n\n\t\t\t\txmlns:customData=\"http://schemas.sap.com/sapui5/extension/sap.ui.core.CustomData/1\"\n\t\t\t\texpandable=\"false\"\n\t\t\t\theaderMode=\"Inline\"\n\t\t\t\tid=\"", "\"\n\t\t\t\tselect=\".handlers.onTabMultiModeChange\"\n\t\t\t\tstretchContentHeight=\"true\"\n\t\t\t\tcustomData:showCounts=\"", "\"\n\t\t\t>\n\t\t\t\t<items>\n\t\t\t\t", "\n\t\t\t\t</items>\n\t\t\t</IconTabBar>"])), this.converterContext.iconTabBarId, this.converterContext.showTabCounts, this.converterContext.views.map(function (view, viewIdx) {
58
+ return "<template:with path=\"converterContext>views/".concat(viewIdx, "/\" var=\"view\"\n\t\t\t\t\t\t\t\t\txmlns:core=\"sap.ui.core\"\n\t\t\t\t\t\t\t\t\txmlns:template=\"http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1\">\n\t\t\t\t\t\t\t<template:with path=\"view>presentation\" var=\"presentationContext\">\n\t\t\t\t\t\t\t<IconTabFilter\n\t\t\t\t\t\t\t\ttext=\"").concat(view.title, "\"\n\t\t\t\t\t\t\t\tkey=\"{= ${view>tableControlId} || ${view>customTabId} || ${view>chartControlId}}\"\n\t\t\t\t\t\t\t\tcustomData:selectionVariant=\"{view>selectionVariantPath}\"\n\t\t\t\t\t\t\t\tvisible=\"{view>visible}\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<content>\n\t\t\t\t\t\t\t\t\t<template:if test=\"{= ${view>type} === 'Custom'}\">\n\t\t\t\t\t\t\t\t\t\t<template:then>\n\t\t\t\t\t\t\t\t\t\t\t<core:Fragment fragmentName=\"sap.fe.templates.ListReport.view.fragments.CustomView\" type=\"XML\" />\n\t\t\t\t\t\t\t\t\t\t</template:then>\n\t\t\t\t\t\t\t\t\t\t<template:else>\n\t\t\t\t\t\t\t\t\t\t\t<MessageStrip\n\t\t\t\t\t\t\t\t\t\t text=\"{= '{= (${internal>tabs/ignoredFieldsTitle/' + (${view>tableControlId} || ${view>chartControlId}) + '} ) }' }\"\n\t\t\t\t\t\t\t\t\t\t\t\ttype=\"Information\"\n\t\t\t\t\t\t\t\t\t\t\t\tshowIcon=\"true\"\n\t\t\t\t\t\t\t\t\t\t\t\tshowCloseButton=\"true\"\n\t\t\t\t\t\t\t\t\t\t\t\tclass=\"sapUiSmallMargin\"\n\t\t\t\t\t\t\t\t\t\t\t\tvisible=\"{= '{= (${internal>tabs/ignoredFields/' +(${view>tableControlId} || ${view>chartControlId}) + '} || []).length>0 }' }\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t</MessageStrip>\n\t\t\t\t\t\t\t\t\t\t\t<core:Fragment fragmentName=\"sap.fe.templates.ListReport.view.fragments.CollectionVisualization\" type=\"XML\" />\n\t\t\t\t\t\t\t\t\t\t</template:else>\n\t\t\t\t\t\t\t\t\t</template:if>\n\t\t\t\t\t\t\t\t</content>\n\t\t\t\t\t\t\t</IconTabFilter>\n\t\t\t\t\t\t</template:with></template:with>");
59
+ }).join(""));
60
+ };
61
+
62
+ return MultipleMode;
63
+ }(BuildingBlockBase), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "converterContext", [_dec2], {
64
+ configurable: true,
65
+ enumerable: true,
66
+ writable: true,
67
+ initializer: null
68
+ })), _class2)) || _class);
69
+ _exports = MultipleMode;
70
+ return _exports;
71
+ }, false);
72
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIk11bHRpcGxlTW9kZS5mcmFnbWVudC50cyJdLCJuYW1lcyI6WyJNdWx0aXBsZU1vZGUiLCJkZWZpbmVCdWlsZGluZ0Jsb2NrIiwibmFtZSIsIm5hbWVzcGFjZSIsImlzT3BlbiIsInhtbEF0dHJpYnV0ZSIsInR5cGUiLCJnZXRUZW1wbGF0ZSIsInhtbCIsImNvbnZlcnRlckNvbnRleHQiLCJpY29uVGFiQmFySWQiLCJzaG93VGFiQ291bnRzIiwidmlld3MiLCJtYXAiLCJ2aWV3Iiwidmlld0lkeCIsInRpdGxlIiwiam9pbiIsIkJ1aWxkaW5nQmxvY2tCYXNlIl0sIm1hcHBpbmdzIjoiO0FBQUE7QUFDQTtBQUNBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7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Z3RoPjAgfScgfVwiXG5cdFx0XHRcdFx0XHRcdFx0XHRcdFx0PlxuXHRcdFx0XHRcdFx0XHRcdFx0XHRcdDwvTWVzc2FnZVN0cmlwPlxuXHRcdFx0XHRcdFx0XHRcdFx0XHRcdDxjb3JlOkZyYWdtZW50IGZyYWdtZW50TmFtZT1cInNhcC5mZS50ZW1wbGF0ZXMuTGlzdFJlcG9ydC52aWV3LmZyYWdtZW50cy5Db2xsZWN0aW9uVmlzdWFsaXphdGlvblwiIHR5cGU9XCJYTUxcIiAvPlxuXHRcdFx0XHRcdFx0XHRcdFx0XHQ8L3RlbXBsYXRlOmVsc2U+XG5cdFx0XHRcdFx0XHRcdFx0XHQ8L3RlbXBsYXRlOmlmPlxuXHRcdFx0XHRcdFx0XHRcdDwvY29udGVudD5cblx0XHRcdFx0XHRcdFx0PC9JY29uVGFiRmlsdGVyPlxuXHRcdFx0XHRcdFx0PC90ZW1wbGF0ZTp3aXRoPjwvdGVtcGxhdGU6d2l0aD5gO1xuXHRcdFx0XHRcdH0pXG5cdFx0XHRcdFx0LmpvaW4oXCJcIil9XG5cdFx0XHRcdDwvaXRlbXM+XG5cdFx0XHQ8L0ljb25UYWJCYXI+YDtcblx0fVxufVxuIl19
@@ -0,0 +1,62 @@
1
+ import { BuildingBlockBase, defineBuildingBlock, xmlAttribute } from "sap/fe/core/buildingBlocks/BuildingBlock";
2
+ import { xml } from "sap/fe/core/buildingBlocks/BuildingBlockRuntime";
3
+ import { ListReportDefinition } from "sap/fe/core/converters/templates/ListReportConverter";
4
+
5
+ @defineBuildingBlock({ name: "MultipleMode", namespace: "sap.fe.templates.ListReport.view.fragments", isOpen: true })
6
+ export default class MultipleMode extends BuildingBlockBase {
7
+ @xmlAttribute({ type: "sap.ui.model.Context" })
8
+ converterContext!: ListReportDefinition;
9
+
10
+ getTemplate() {
11
+ return xml`
12
+ <IconTabBar
13
+ xmlns="sap.m"
14
+
15
+ xmlns:customData="http://schemas.sap.com/sapui5/extension/sap.ui.core.CustomData/1"
16
+ expandable="false"
17
+ headerMode="Inline"
18
+ id="${this.converterContext.iconTabBarId}"
19
+ select=".handlers.onTabMultiModeChange"
20
+ stretchContentHeight="true"
21
+ customData:showCounts="${this.converterContext.showTabCounts}"
22
+ >
23
+ <items>
24
+ ${this.converterContext.views
25
+ .map((view, viewIdx) => {
26
+ return `<template:with path="converterContext>views/${viewIdx}/" var="view"
27
+ xmlns:core="sap.ui.core"
28
+ xmlns:template="http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1">
29
+ <template:with path="view>presentation" var="presentationContext">
30
+ <IconTabFilter
31
+ text="${view.title}"
32
+ key="{= \${view>tableControlId} || \${view>customTabId} || \${view>chartControlId}}"
33
+ customData:selectionVariant="{view>selectionVariantPath}"
34
+ visible="{view>visible}"
35
+ >
36
+ <content>
37
+ <template:if test="{= \${view>type} === 'Custom'}">
38
+ <template:then>
39
+ <core:Fragment fragmentName="sap.fe.templates.ListReport.view.fragments.CustomView" type="XML" />
40
+ </template:then>
41
+ <template:else>
42
+ <MessageStrip
43
+ text="{= '{= (\${internal>tabs/ignoredFieldsTitle/' + (\${view>tableControlId} || \${view>chartControlId}) + '} ) }' }"
44
+ type="Information"
45
+ showIcon="true"
46
+ showCloseButton="true"
47
+ class="sapUiSmallMargin"
48
+ visible="{= '{= (\${internal>tabs/ignoredFields/' +(\${view>tableControlId} || \${view>chartControlId}) + '} || []).length>0 }' }"
49
+ >
50
+ </MessageStrip>
51
+ <core:Fragment fragmentName="sap.fe.templates.ListReport.view.fragments.CollectionVisualization" type="XML" />
52
+ </template:else>
53
+ </template:if>
54
+ </content>
55
+ </IconTabFilter>
56
+ </template:with></template:with>`;
57
+ })
58
+ .join("")}
59
+ </items>
60
+ </IconTabBar>`;
61
+ }
62
+ }