@sapui5/sap.fe.templates 1.98.0 → 1.101.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 (144) hide show
  1. package/package.json +9 -6
  2. package/src/sap/fe/templates/.library +1 -2
  3. package/src/sap/fe/templates/AnalyticalListPage/Component.js +25 -12
  4. package/src/sap/fe/templates/AnalyticalListPage/Component.ts +6 -0
  5. package/src/sap/fe/templates/AnalyticalListPage/chart/FEChartDelegate.js +31 -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 +157 -118
  10. package/src/sap/fe/templates/ListComponent.ts +105 -0
  11. package/src/sap/fe/templates/ListReport/Component.js +83 -39
  12. package/src/sap/fe/templates/ListReport/Component.ts +39 -0
  13. package/src/sap/fe/templates/ListReport/ExtensionAPI.js +124 -107
  14. package/src/sap/fe/templates/ListReport/ExtensionAPI.ts +100 -0
  15. package/src/sap/fe/templates/ListReport/ListReport.view.xml +34 -27
  16. package/src/sap/fe/templates/ListReport/ListReportController.controller.js +1112 -1001
  17. package/src/sap/fe/templates/ListReport/ListReportController.controller.ts +1009 -0
  18. package/src/sap/fe/templates/ListReport/overrides/IntentBasedNavigation.js +55 -53
  19. package/src/sap/fe/templates/ListReport/overrides/IntentBasedNavigation.ts +55 -0
  20. package/src/sap/fe/templates/ListReport/overrides/Share.js +135 -136
  21. package/src/sap/fe/templates/ListReport/overrides/Share.ts +134 -0
  22. package/src/sap/fe/templates/ListReport/overrides/ViewState.js +444 -406
  23. package/src/sap/fe/templates/ListReport/overrides/ViewState.ts +413 -0
  24. package/src/sap/fe/templates/ListReport/view/fragments/CollectionVisualization.fragment.xml +31 -23
  25. package/src/sap/fe/templates/ListReport/view/fragments/MultipleMode.fragment.js +72 -0
  26. package/src/sap/fe/templates/ListReport/view/fragments/MultipleMode.fragment.ts +62 -0
  27. package/src/sap/fe/templates/ListReport/view/fragments/MultipleModeOld.fragment.xml +50 -0
  28. package/src/sap/fe/templates/ObjectPage/AnnotationHelper.js +479 -473
  29. package/src/sap/fe/templates/ObjectPage/AnnotationHelper.ts +511 -0
  30. package/src/sap/fe/templates/ObjectPage/Component.js +170 -149
  31. package/src/sap/fe/templates/ObjectPage/Component.ts +131 -0
  32. package/src/sap/fe/templates/ObjectPage/ExtensionAPI.js +141 -142
  33. package/src/sap/fe/templates/ObjectPage/ExtensionAPI.ts +116 -0
  34. package/src/sap/fe/templates/ObjectPage/ObjectPage.view.xml +14 -53
  35. package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.js +1531 -1464
  36. package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.ts +1442 -0
  37. package/src/sap/fe/templates/ObjectPage/controls/StashableHBox.js +137 -95
  38. package/src/sap/fe/templates/ObjectPage/controls/StashableHBox.ts +84 -0
  39. package/src/sap/fe/templates/ObjectPage/controls/StashableVBox.js +25 -21
  40. package/src/sap/fe/templates/ObjectPage/controls/StashableVBox.ts +10 -0
  41. package/src/sap/fe/templates/ObjectPage/controls/SubSectionBlock.js +99 -53
  42. package/src/sap/fe/templates/ObjectPage/controls/SubSectionBlock.ts +50 -0
  43. package/src/sap/fe/templates/ObjectPage/designtime/FlexBox.designtime.js +21 -16
  44. package/src/sap/fe/templates/ObjectPage/designtime/FlexBox.designtime.ts +15 -0
  45. package/src/sap/fe/templates/ObjectPage/designtime/StashableHBox.designtime.js +51 -47
  46. package/src/sap/fe/templates/ObjectPage/designtime/StashableHBox.designtime.ts +47 -0
  47. package/src/sap/fe/templates/ObjectPage/designtime/StashableVBox.designtime.js +35 -34
  48. package/src/sap/fe/templates/ObjectPage/designtime/StashableVBox.designtime.ts +34 -0
  49. package/src/sap/fe/templates/ObjectPage/flexibility/StashableHBox.flexibility.js +16 -15
  50. package/src/sap/fe/templates/ObjectPage/flexibility/StashableHBox.flexibility.ts +13 -0
  51. package/src/sap/fe/templates/ObjectPage/flexibility/StashableVBox.flexibility.js +12 -11
  52. package/src/sap/fe/templates/ObjectPage/flexibility/StashableVBox.flexibility.ts +7 -0
  53. package/src/sap/fe/templates/ObjectPage/overrides/IntentBasedNavigation.js +56 -52
  54. package/src/sap/fe/templates/ObjectPage/overrides/IntentBasedNavigation.ts +57 -0
  55. package/src/sap/fe/templates/ObjectPage/overrides/InternalRouting.js +16 -17
  56. package/src/sap/fe/templates/ObjectPage/overrides/InternalRouting.ts +13 -0
  57. package/src/sap/fe/templates/ObjectPage/overrides/MessageHandler.js +14 -17
  58. package/src/sap/fe/templates/ObjectPage/overrides/MessageHandler.ts +14 -0
  59. package/src/sap/fe/templates/ObjectPage/overrides/Paginator.js +24 -21
  60. package/src/sap/fe/templates/ObjectPage/overrides/Paginator.ts +21 -0
  61. package/src/sap/fe/templates/ObjectPage/overrides/Share.js +311 -317
  62. package/src/sap/fe/templates/ObjectPage/overrides/Share.ts +316 -0
  63. package/src/sap/fe/templates/ObjectPage/overrides/ViewState.js +67 -57
  64. package/src/sap/fe/templates/ObjectPage/overrides/ViewState.ts +65 -0
  65. package/src/sap/fe/templates/ObjectPage/templating/ObjectPageTemplating.js +1 -1
  66. package/src/sap/fe/templates/ObjectPage/templating/ObjectPageTemplating.ts +3 -3
  67. package/src/sap/fe/templates/ObjectPage/view/fragments/Actions.fragment.xml +18 -24
  68. package/src/sap/fe/templates/ObjectPage/view/fragments/CollaborationDraft.fragment.xml +38 -0
  69. package/src/sap/fe/templates/ObjectPage/view/fragments/EditableHeaderFacet.fragment.xml +1 -1
  70. package/src/sap/fe/templates/ObjectPage/view/fragments/FooterContent.fragment.xml +9 -5
  71. package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderFacet.fragment.xml +1 -0
  72. package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderFacetCustomContainer.fragment.xml +1 -0
  73. package/src/sap/fe/templates/ObjectPage/view/fragments/Heading.fragment.xml +33 -0
  74. package/src/sap/fe/templates/ObjectPage/view/fragments/HeadingAvatar.fragment.xml +17 -0
  75. package/src/sap/fe/templates/ObjectPage/view/fragments/HeadingTitle.fragment.xml +18 -0
  76. package/src/sap/fe/templates/ObjectPage/view/fragments/SectionFormContent.fragment.xml +3 -3
  77. package/src/sap/fe/templates/ObjectPage/view/fragments/SectionMoreFormContent.fragment.xml +3 -3
  78. package/src/sap/fe/templates/ObjectPage/view/fragments/SwitchDraftAndActiveObjectPopOver.fragment.xml +27 -0
  79. package/src/sap/fe/templates/RootContainer/controller/Fcl.controller.js +852 -815
  80. package/src/sap/fe/templates/RootContainer/controller/Fcl.controller.ts +795 -0
  81. package/src/sap/fe/templates/RootContainer/controller/NavContainer.controller.js +206 -187
  82. package/src/sap/fe/templates/RootContainer/controller/NavContainer.controller.ts +178 -0
  83. package/src/sap/fe/templates/RootContainer/controller/RootContainerBaseController.js +485 -459
  84. package/src/sap/fe/templates/RootContainer/controller/RootContainerBaseController.ts +438 -0
  85. package/src/sap/fe/templates/RootContainer/overrides/EditFlow.js +17 -14
  86. package/src/sap/fe/templates/RootContainer/overrides/EditFlow.ts +20 -0
  87. package/src/sap/fe/templates/TableScroller.js +46 -53
  88. package/src/sap/fe/templates/TableScroller.ts +48 -0
  89. package/src/sap/fe/templates/controls/Chart.fragment.xml +18 -17
  90. package/src/sap/fe/templates/controls/MacroChart.fragment.xml +22 -0
  91. package/src/sap/fe/templates/library.js +50 -63
  92. package/src/sap/fe/templates/library.ts +57 -0
  93. package/src/sap/fe/templates/messagebundle.properties +32 -36
  94. package/src/sap/fe/templates/messagebundle_ar.properties +15 -8
  95. package/src/sap/fe/templates/messagebundle_bg.properties +15 -8
  96. package/src/sap/fe/templates/messagebundle_ca.properties +15 -8
  97. package/src/sap/fe/templates/messagebundle_cs.properties +15 -8
  98. package/src/sap/fe/templates/messagebundle_cy.properties +15 -8
  99. package/src/sap/fe/templates/messagebundle_da.properties +15 -8
  100. package/src/sap/fe/templates/messagebundle_de.properties +15 -8
  101. package/src/sap/fe/templates/messagebundle_el.properties +16 -9
  102. package/src/sap/fe/templates/messagebundle_en.properties +15 -8
  103. package/src/sap/fe/templates/messagebundle_en_GB.properties +15 -8
  104. package/src/sap/fe/templates/messagebundle_en_US_sappsd.properties +9 -6
  105. package/src/sap/fe/templates/messagebundle_en_US_saprigi.properties +15 -8
  106. package/src/sap/fe/templates/messagebundle_en_US_saptrc.properties +15 -8
  107. package/src/sap/fe/templates/messagebundle_es.properties +15 -8
  108. package/src/sap/fe/templates/messagebundle_es_MX.properties +15 -8
  109. package/src/sap/fe/templates/messagebundle_et.properties +15 -8
  110. package/src/sap/fe/templates/messagebundle_fi.properties +15 -8
  111. package/src/sap/fe/templates/messagebundle_fr.properties +15 -8
  112. package/src/sap/fe/templates/messagebundle_fr_CA.properties +15 -8
  113. package/src/sap/fe/templates/messagebundle_hi.properties +15 -8
  114. package/src/sap/fe/templates/messagebundle_hr.properties +16 -9
  115. package/src/sap/fe/templates/messagebundle_hu.properties +15 -8
  116. package/src/sap/fe/templates/messagebundle_id.properties +17 -10
  117. package/src/sap/fe/templates/messagebundle_it.properties +15 -8
  118. package/src/sap/fe/templates/messagebundle_iw.properties +15 -8
  119. package/src/sap/fe/templates/messagebundle_ja.properties +15 -8
  120. package/src/sap/fe/templates/messagebundle_kk.properties +15 -8
  121. package/src/sap/fe/templates/messagebundle_ko.properties +15 -8
  122. package/src/sap/fe/templates/messagebundle_lt.properties +15 -8
  123. package/src/sap/fe/templates/messagebundle_lv.properties +15 -8
  124. package/src/sap/fe/templates/messagebundle_ms.properties +15 -8
  125. package/src/sap/fe/templates/messagebundle_nl.properties +15 -8
  126. package/src/sap/fe/templates/messagebundle_no.properties +15 -8
  127. package/src/sap/fe/templates/messagebundle_pl.properties +15 -8
  128. package/src/sap/fe/templates/messagebundle_pt.properties +18 -11
  129. package/src/sap/fe/templates/messagebundle_pt_PT.properties +16 -9
  130. package/src/sap/fe/templates/messagebundle_ro.properties +15 -8
  131. package/src/sap/fe/templates/messagebundle_ru.properties +15 -8
  132. package/src/sap/fe/templates/messagebundle_sh.properties +15 -8
  133. package/src/sap/fe/templates/messagebundle_sk.properties +15 -8
  134. package/src/sap/fe/templates/messagebundle_sl.properties +15 -8
  135. package/src/sap/fe/templates/messagebundle_sv.properties +16 -9
  136. package/src/sap/fe/templates/messagebundle_th.properties +15 -8
  137. package/src/sap/fe/templates/messagebundle_tr.properties +15 -8
  138. package/src/sap/fe/templates/messagebundle_uk.properties +16 -9
  139. package/src/sap/fe/templates/messagebundle_vi.properties +15 -8
  140. package/src/sap/fe/templates/messagebundle_zh_CN.properties +15 -8
  141. package/src/sap/fe/templates/messagebundle_zh_TW.properties +15 -8
  142. package/ui5.yaml +0 -3
  143. package/src/sap/fe/templates/ListReport/overrides/MassEdit.js +0 -95
  144. package/src/sap/fe/templates/ListReport/view/fragments/MultipleMode.fragment.xml +0 -49
@@ -0,0 +1,413 @@
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
+
96
+ if (oController._hasMultiVisualizations()) {
97
+ aStateControls.push(oController._getSegmentedButton(TemplateContentView.Chart));
98
+ aStateControls.push(oController._getSegmentedButton(TemplateContentView.Table));
99
+ }
100
+ const oFilterBar = oController._getFilterBarControl();
101
+ if (oFilterBar) {
102
+ aStateControls.push(oFilterBar);
103
+ }
104
+ aStateControls.push(oView.byId("fe::ListReport"));
105
+ },
106
+ retrieveAdditionalStates: function (this: ViewState & typeof ViewStateOverride, mAdditionalStates: any) {
107
+ const oView = this.getView(),
108
+ oController = oView.getController() as ListReportController,
109
+ bPendingFilter = (oView.getBindingContext("internal") as InternalModelContext).getProperty("hasPendingFilters");
110
+
111
+ mAdditionalStates.dataLoaded = !bPendingFilter || !!this._bSearchTriggered;
112
+ if (oController._hasMultiVisualizations()) {
113
+ const sAlpContentView = oView.getBindingContext("internal").getProperty("alpContentView");
114
+ mAdditionalStates.alpContentView = sAlpContentView;
115
+ }
116
+
117
+ delete this._bSearchTriggered;
118
+ },
119
+ applyAdditionalStates: function (this: ViewState & typeof ViewStateOverride, oAdditionalStates: any) {
120
+ const oView = this.getView(),
121
+ oController = oView.getController() as ListReportController,
122
+ oFilterBar = oController._getFilterBarControl();
123
+
124
+ if (oAdditionalStates) {
125
+ // explicit check for boolean values - 'undefined' should not alter the triggered search property
126
+ if (oAdditionalStates.dataLoaded === false && oFilterBar) {
127
+ // without this, the data is loaded on navigating back
128
+ (oFilterBar as any)._bSearchTriggered = false;
129
+ } else if (oAdditionalStates.dataLoaded === true) {
130
+ if (oFilterBar) {
131
+ oFilterBar.triggerSearch();
132
+ }
133
+ this._bSearchTriggered = true;
134
+ }
135
+ if (oController._hasMultiVisualizations()) {
136
+ const oInternalModelContext = oView.getBindingContext("internal") as InternalModelContext;
137
+ if (!system.desktop && oAdditionalStates.alpContentView == TemplateContentView.Hybrid) {
138
+ oAdditionalStates.alpContentView = TemplateContentView.Chart;
139
+ }
140
+ (oInternalModelContext.getModel() as JSONModel).setProperty(
141
+ oInternalModelContext.getPath() + "/alpContentView",
142
+ oAdditionalStates.alpContentView
143
+ );
144
+ }
145
+ }
146
+ },
147
+ applyNavigationParameters: function (this: ViewState & typeof ViewStateOverride, oNavigationParameter: any, aResults: any) {
148
+ const oView = this.getView();
149
+ const oController = oView.getController() as ListReportController;
150
+ const oAppComponent = oController.getAppComponent();
151
+ const oComponentData = oAppComponent.getComponentData();
152
+ const oStartupParameters = (oComponentData && oComponentData.startupParameters) || {};
153
+ const oVariantPromise = this.handleVariantIdPassedViaURLParams(oStartupParameters);
154
+ let bFilterVariantApplied: boolean;
155
+ aResults.push(
156
+ oVariantPromise
157
+ .then((aVariants: any[]) => {
158
+ if (aVariants && aVariants.length > 0) {
159
+ if (aVariants[0] === true || aVariants[1] === true) {
160
+ bFilterVariantApplied = true;
161
+ }
162
+ }
163
+ return this._applySelectionVariant(oView, oNavigationParameter, bFilterVariantApplied).then(() => {
164
+ const oDynamicPage = oView.byId("fe::ListReport");
165
+ let bPreventInitialSearch = false;
166
+ const oFilterBarVM = this._getFilterBarVM(oView);
167
+ const oFilterBarControl = oController._getFilterBarControl();
168
+ if (oFilterBarControl) {
169
+ if (
170
+ (oNavigationParameter.navigationType !== NavType.initial && oNavigationParameter.requiresStandardVariant) ||
171
+ (!oFilterBarVM && oView.getViewData().initialLoad === InitialLoadMode.Enabled) ||
172
+ oController._shouldAutoTriggerSearch(oFilterBarVM)
173
+ ) {
174
+ oFilterBarControl.triggerSearch();
175
+ } else {
176
+ bPreventInitialSearch = this._preventInitialSearch(oFilterBarVM);
177
+ }
178
+ this._bSearchTriggered = !bPreventInitialSearch;
179
+ oDynamicPage.setHeaderExpanded(system.desktop || bPreventInitialSearch);
180
+ }
181
+ });
182
+ })
183
+ .catch(function () {
184
+ Log.error("Variant ID cannot be applied");
185
+ })
186
+ );
187
+ },
188
+
189
+ handleVariantIdPassedViaURLParams: function (this: ViewState & typeof ViewStateOverride, oUrlParams: any) {
190
+ const aPageVariantId = oUrlParams["sap-ui-fe-variant-id"],
191
+ aFilterBarVariantId = oUrlParams["sap-ui-fe-filterbar-variant-id"],
192
+ aTableVariantId = oUrlParams["sap-ui-fe-table-variant-id"];
193
+ let oVariant;
194
+ if (aPageVariantId || aFilterBarVariantId || aTableVariantId) {
195
+ oVariant = {
196
+ sPageVariantId: aPageVariantId && aPageVariantId[0],
197
+ sFilterBarVariantId: aFilterBarVariantId && aFilterBarVariantId[0],
198
+ sTableVariantId: aTableVariantId && aTableVariantId[0]
199
+ };
200
+ }
201
+ return this._handleControlVariantId(oVariant);
202
+ },
203
+
204
+ _handleControlVariantId: function (this: ViewState & typeof ViewStateOverride, oVariantIDs: any) {
205
+ let oVM: VariantManagement;
206
+ const oView = this.getView(),
207
+ aPromises: any[] = [];
208
+ const sVariantManagement = oView.getViewData().variantManagement;
209
+ if (oVariantIDs && oVariantIDs.sPageVariantId && sVariantManagement === "Page") {
210
+ oVM = oView.byId("fe::PageVariantManagement");
211
+ oVM.getVariants().forEach((oVariant: any) => {
212
+ if (oVariant.key === oVariantIDs.sPageVariantId) {
213
+ aPromises.push(this._applyControlVariant(oVM, oVariantIDs.sPageVariantId, true));
214
+ }
215
+ });
216
+ } else if (oVariantIDs && sVariantManagement === "Control") {
217
+ if (oVariantIDs.sFilterBarVariantId) {
218
+ oVM = oView.byId(oView.getContent()[0].data("filterBarVariantId"));
219
+ if (oVM) {
220
+ oVM.getVariants().forEach((oVariant: any) => {
221
+ if (oVariant.key === oVariantIDs.sFilterBarVariantId) {
222
+ aPromises.push(this._applyControlVariant(oVM, oVariantIDs.sFilterBarVariantId, true));
223
+ }
224
+ });
225
+ }
226
+ }
227
+ if (oVariantIDs.sTableVariantId) {
228
+ const oController = oView.getController(),
229
+ aTables = oController._getControls("table");
230
+ aTables.forEach((oTable: any) => {
231
+ const oTableVariant = oTable.getVariant();
232
+ if (oTable && oTableVariant) {
233
+ oTableVariant.getVariants().forEach((oVariant: any) => {
234
+ if (oVariant.key === oVariantIDs.sTableVariantId) {
235
+ aPromises.push(this._applyControlVariant(oTableVariant, oVariantIDs.sTableVariantId));
236
+ }
237
+ });
238
+ }
239
+ });
240
+ }
241
+ }
242
+ return Promise.all(aPromises);
243
+ },
244
+
245
+ _applyControlVariant: function (oVariant: any, sVariantID: any, bFilterVariantApplied: any) {
246
+ const sVariantReference = this._checkIfVariantIdIsAvailable(oVariant, sVariantID) ? sVariantID : oVariant.getStandardVariantKey();
247
+ const oVM = ControlVariantApplyAPI.activateVariant({
248
+ element: oVariant,
249
+ variantReference: sVariantReference
250
+ });
251
+ return oVM.then(function () {
252
+ return bFilterVariantApplied;
253
+ });
254
+ },
255
+ /************************************* private helper *****************************************/
256
+
257
+ _getFilterBarVM: function (oView: any) {
258
+ const oViewData = oView.getViewData();
259
+ switch (oViewData.variantManagement) {
260
+ case VariantManagementType.Page:
261
+ return oView.byId("fe::PageVariantManagement");
262
+ case VariantManagementType.Control:
263
+ return oView.byId(oView.getContent()[0].data("filterBarVariantId"));
264
+ case VariantManagementType.None:
265
+ return null;
266
+ default:
267
+ throw new Error("unhandled variant setting: " + oViewData.variantManagement);
268
+ }
269
+ },
270
+
271
+ _preventInitialSearch: function (oVariantManagement: any) {
272
+ if (!oVariantManagement) {
273
+ return true;
274
+ }
275
+ const aVariants = oVariantManagement.getVariants();
276
+ const oCurrentVariant = aVariants.find(function (oItem: any) {
277
+ return oItem.key === oVariantManagement.getCurrentVariantKey();
278
+ });
279
+ return !oCurrentVariant.executeOnSelect;
280
+ },
281
+
282
+ _applySelectionVariant: function (oView: any, oNavigationParameter: any, bFilterVariantApplied: any) {
283
+ const oFilterBar = oView.getController()._getFilterBarControl(),
284
+ oSelectionVariant = oNavigationParameter.selectionVariant,
285
+ oSelectionVariantDefaults = oNavigationParameter.selectionVariantDefaults;
286
+ if (!oFilterBar || !oSelectionVariant) {
287
+ return Promise.resolve();
288
+ }
289
+ let oConditions = {};
290
+ const oMetaModel = oView.getModel().getMetaModel();
291
+ const oViewData = oView.getViewData();
292
+ const sContextPath = oViewData.contextPath || "/" + oViewData.entitySet;
293
+ const aMandatoryFilterFields = CommonUtils.getMandatoryFilterFields(oMetaModel, sContextPath);
294
+ let oVariant;
295
+ const bRequiresStandardVariant = oNavigationParameter.requiresStandardVariant;
296
+
297
+ if (bFilterVariantApplied) {
298
+ oConditions = oFilterBar.getConditions();
299
+ }
300
+ CommonUtils.addDefaultDisplayCurrency(aMandatoryFilterFields, oSelectionVariant, oSelectionVariantDefaults);
301
+ CommonUtils.addSelectionVariantToConditions(oSelectionVariant, oConditions, oMetaModel, sContextPath);
302
+ switch (oViewData.variantManagement) {
303
+ case VariantManagementType.Page:
304
+ oVariant = oView.byId("fe::PageVariantManagement");
305
+ break;
306
+ case VariantManagementType.Control:
307
+ oVariant = oView.byId(oView.getContent()[0].data("filterBarVariantId"));
308
+ break;
309
+ case VariantManagementType.None:
310
+ default:
311
+ break;
312
+ }
313
+ return this._activateSelectionVariant(oFilterBar, oConditions, oVariant, bRequiresStandardVariant, bFilterVariantApplied);
314
+ },
315
+ _activateSelectionVariant: function (
316
+ oFilterBar: any,
317
+ oConditions: any,
318
+ oVariant: any,
319
+ bRequiresStandardVariant: any,
320
+ bFilterVariantApplied: any
321
+ ) {
322
+ let oPromise;
323
+
324
+ if (oVariant && !bFilterVariantApplied) {
325
+ let oVariantKey = bRequiresStandardVariant ? oVariant.getStandardVariantKey() : oVariant.getDefaultVariantKey();
326
+ if (oVariantKey === null) {
327
+ oVariantKey = oVariant.getId();
328
+ }
329
+ oPromise = ControlVariantApplyAPI.activateVariant({
330
+ element: oVariant,
331
+ variantReference: oVariantKey
332
+ }).then(function () {
333
+ return bRequiresStandardVariant || oVariant.getDefaultVariantKey() === oVariant.getStandardVariantKey();
334
+ });
335
+ } else {
336
+ oPromise = Promise.resolve(true);
337
+ }
338
+ return oPromise.then((bClearFilterAndReplaceWithAppState: any) => {
339
+ if (bClearFilterAndReplaceWithAppState) {
340
+ return this._fnApplyConditions(oFilterBar, oConditions);
341
+ }
342
+ });
343
+ },
344
+ _fnApplyConditions: function (oFilterBar: any, oConditions: any) {
345
+ const mFilter: any = {},
346
+ aItems: any[] = [],
347
+ fnAdjustValueHelpCondition = function (oCondition: any) {
348
+ // in case the condition is meant for a field having a VH, the format required by MDC differs
349
+ oCondition.validated = ConditionValidated.Validated;
350
+ if (oCondition.operator === "Empty") {
351
+ oCondition.operator = "EQ";
352
+ oCondition.values = [""];
353
+ } else if (oCondition.operator === "NotEmpty") {
354
+ oCondition.operator = "NE";
355
+ oCondition.values = [""];
356
+ }
357
+ delete oCondition.isEmpty;
358
+ };
359
+ const fnGetPropertyInfo = function (oFilterControl: any, sEntityTypePath: any) {
360
+ const sEntitySetPath = ModelHelper.getEntitySetPath(sEntityTypePath),
361
+ oMetaModel = oFilterControl.getModel().getMetaModel(),
362
+ oFR = CommonUtils.getFilterRestrictionsByPath(sEntitySetPath, oMetaModel),
363
+ aNonFilterableProps = oFR[FilterRestrictions.NON_FILTERABLE_PROPERTIES],
364
+ mFilterFields = FilterUtils.getConvertedFilterFields(oFilterControl, sEntityTypePath),
365
+ aPropertyInfo: any[] = [];
366
+ Object.keys(mFilterFields).forEach(function (sFilterFieldKey: string) {
367
+ const oConvertedProperty = mFilterFields[sFilterFieldKey];
368
+ const sPropertyPath = oConvertedProperty.conditionPath.replace(CONDITION_PATH_TO_PROPERTY_PATH_REGEX, "");
369
+ if (aNonFilterableProps.indexOf(sPropertyPath) === -1) {
370
+ const sAnnotationPath = oConvertedProperty.annotationPath;
371
+ const oPropertyContext = oMetaModel.createBindingContext(sAnnotationPath);
372
+ aPropertyInfo.push({
373
+ path: oConvertedProperty.conditionPath,
374
+ hiddenFilter: oConvertedProperty.availability === "Hidden",
375
+ hasValueHelp: !sAnnotationPath
376
+ ? false
377
+ : PropertyFormatters.hasValueHelp(oPropertyContext.getObject(), { context: oPropertyContext })
378
+ });
379
+ return;
380
+ }
381
+ });
382
+ return aPropertyInfo;
383
+ };
384
+ return oFilterBar.waitForInitialization().then(function () {
385
+ const sEntityTypePath = DelegateUtil.getCustomData(oFilterBar, "entityType");
386
+ const aPropertyInfo = fnGetPropertyInfo(oFilterBar, sEntityTypePath);
387
+ aPropertyInfo
388
+ .filter(function (oPropertyInfo: any) {
389
+ return oPropertyInfo.path !== "$editState" && oPropertyInfo.path !== "$search";
390
+ })
391
+ .forEach(function (oPropertyInfo: any) {
392
+ if (oPropertyInfo.path in oConditions) {
393
+ mFilter[oPropertyInfo.path] = oConditions[oPropertyInfo.path];
394
+ if (!oPropertyInfo.hiddenFilter) {
395
+ aItems.push({ name: oPropertyInfo.path });
396
+ }
397
+ if (oPropertyInfo.hasValueHelp) {
398
+ mFilter[oPropertyInfo.path].forEach(fnAdjustValueHelpCondition);
399
+ } else {
400
+ mFilter[oPropertyInfo.path].forEach(function (oCondition: any) {
401
+ oCondition.validated = ConditionValidated.NotValidated;
402
+ });
403
+ }
404
+ } else {
405
+ mFilter[oPropertyInfo.path] = [];
406
+ }
407
+ });
408
+ return StateUtil.applyExternalState(oFilterBar, { filter: mFilter, items: aItems });
409
+ });
410
+ }
411
+ };
412
+
413
+ export default ViewStateOverride;
@@ -4,29 +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">
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
+ type="Information"
16
+ showIcon="true"
17
+ showCloseButton="true"
18
+ class="sapUiSmallMargin"
19
+ visible="{= '{= (${internal>controls/ignoredFields' + (${visualizationDefinition>collection}) + (${visualizationDefinition>type}) + '} || []).length>0 &amp;&amp; ${pageInternal>alpContentView} !== \'Table\'}' }"
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%">
13
27
  <core:Fragment fragmentName="sap.fe.templates.controls.{visualizationDefinition>type}" type="XML" />
14
- </template:repeat>
15
- </template:with>
16
- <template:with path="view>secondaryVisualization" var="presentationContext">
17
- <template:repeat list="{presentationContext>visualizations}" var="visualizationDefinition">
18
- <m:HBox height="100%" width="100%">
19
- <core:Fragment fragmentName="sap.fe.templates.controls.{visualizationDefinition>type}" type="XML" />
20
- </m:HBox>
21
- </template:repeat>
22
- </template:with>
23
- </template:repeat>
24
- </m:VBox>
25
- </template:then>
26
- <template:else>
27
- <template:repeat list="{presentationContext>visualizations}" var="visualizationDefinition">
28
- <core:Fragment fragmentName="sap.fe.templates.controls.{visualizationDefinition>type}" type="XML" />
28
+ </m:HBox>
29
+ </template:repeat>
30
+ </template:with>
29
31
  </template:repeat>
30
- </template:else>
31
- </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>
32
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
+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Fx0LmpvaW4oXCJcIil9XG5cdFx0XHRcdDwvaXRlbXM+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
+ }