@sapui5/sap.suite.ui.generic.template 1.142.6 → 1.142.8

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 (28) hide show
  1. package/package.json +1 -1
  2. package/src/sap/suite/ui/generic/template/.library +1 -1
  3. package/src/sap/suite/ui/generic/template/AnalyticalListPage/manifest.json +1 -1
  4. package/src/sap/suite/ui/generic/template/Canvas/manifest.json +1 -1
  5. package/src/sap/suite/ui/generic/template/ListReport/controller/ControllerImplementation.js +94 -11
  6. package/src/sap/suite/ui/generic/template/ListReport/controller/IappStateHandler.js +19 -8
  7. package/src/sap/suite/ui/generic/template/ListReport/manifest.json +1 -1
  8. package/src/sap/suite/ui/generic/template/ListReport/view/fragments/SmartChart.fragment.xml +2 -1
  9. package/src/sap/suite/ui/generic/template/ListReport/view/fragments/SmartTable.fragment.xml +3 -2
  10. package/src/sap/suite/ui/generic/template/ObjectPage/controller/ControllerImplementation.js +5 -2
  11. package/src/sap/suite/ui/generic/template/ObjectPage/manifest.json +1 -1
  12. package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/SmartChart.fragment.xml +3 -2
  13. package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/SmartTable.fragment.xml +3 -2
  14. package/src/sap/suite/ui/generic/template/QuickCreate/manifest.json +1 -1
  15. package/src/sap/suite/ui/generic/template/QuickView/manifest.json +1 -1
  16. package/src/sap/suite/ui/generic/template/genericUtilities/ControlStateWrapperFactory.js +108 -67
  17. package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/DynamicPageWrapper.js +19 -51
  18. package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/ObjectPageLayoutWrapper.js +10 -32
  19. package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/PreliminaryWrapper.js +151 -0
  20. package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/SearchFieldWrapper.js +8 -30
  21. package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/SmartFilterBarWrapper.js +49 -162
  22. package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/SmartTableChartCommon.js +100 -94
  23. package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/SmartTableWrapper.js +22 -3
  24. package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/SmartVariantManagementWrapper.js +90 -81
  25. package/src/sap/suite/ui/generic/template/lib/AppComponent.js +1 -1
  26. package/src/sap/suite/ui/generic/template/lib/ai/EasyFilterBarHandler.js +21 -8
  27. package/src/sap/suite/ui/generic/template/lib/navigation/NavigationController.js +1 -1
  28. package/src/sap/suite/ui/generic/template/library.js +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sapui5/sap.suite.ui.generic.template",
3
- "version": "1.142.6",
3
+ "version": "1.142.8",
4
4
  "description": "SAPUI5 Library sap.suite.ui.generic.template",
5
5
  "keywords": [
6
6
  "sapui5",
@@ -7,7 +7,7 @@
7
7
 
8
8
  (c) Copyright 2009-2015 SAP SE. All rights reserved
9
9
  </copyright>
10
- <version>1.142.6</version>
10
+ <version>1.142.8</version>
11
11
 
12
12
  <documentation>Library with generic Suite UI templates.</documentation>
13
13
 
@@ -8,7 +8,7 @@
8
8
  "i18n": "i18n/i18n.properties",
9
9
  "applicationVersion": {
10
10
  "__comment": "applicationVersion oder componentversion??",
11
- "version": "1.142.6"
11
+ "version": "1.142.8"
12
12
  },
13
13
  "title": "{{TITLE}}",
14
14
  "description": "{{DESCRIPTION}}",
@@ -8,7 +8,7 @@
8
8
  "i18n": "i18n/i18n.properties",
9
9
  "applicationVersion": {
10
10
  "__comment": "applicationVersion oder componentversion??",
11
- "version": "1.142.6"
11
+ "version": "1.142.8"
12
12
  },
13
13
  "title": "Canvas",
14
14
  "description": "Canvas Page",
@@ -1,5 +1,6 @@
1
1
  sap.ui.define([
2
2
  "sap/ui/model/Filter",
3
+ "sap/ui/model/FilterOperator",
3
4
  "sap/suite/ui/generic/template/ListReport/extensionAPI/ExtensionAPI",
4
5
  "sap/suite/ui/generic/template/listTemplates/listUtils",
5
6
  "sap/suite/ui/generic/template/listTemplates/controller/MessageStripHelper",
@@ -31,6 +32,7 @@ sap.ui.define([
31
32
  "sap/fe/controls/easyFilter/PXFeedback"
32
33
  ], function (
33
34
  Filter,
35
+ FilterOperator,
34
36
  ExtensionAPI,
35
37
  listUtils,
36
38
  MessageStripHelper,
@@ -464,7 +466,7 @@ sap.ui.define([
464
466
  /**
465
467
  * When no data message is displayed as illustration, SmartTable overrides the "illustrationType" to "NoEntries".
466
468
  * Here, we reset back to "BeforeSearch".
467
- *
469
+ *
468
470
  * TODO: Sync with table colleagues
469
471
  */
470
472
  function fnSetInitialNoDataMessageForTable (oSmartTable) {
@@ -590,10 +592,89 @@ sap.ui.define([
590
592
  return restoreFocusHelper;
591
593
  }
592
594
 
593
- // // Expose selected private functions to unit tests
594
- // var getDownloadUrl = testableHelper.testable(getDownloadUrl, "getDownloadUrl");
595
+ /**
596
+ * Helper function to get missing navigation properties from the current variant.
597
+ * This logic was moved from SmartFilterBarWrapper to avoid control-specific
598
+ * business logic in the wrapper layer.
599
+ * @param {object} oSmartFilterBar - The SmartFilterBar control
600
+ * @returns {Array} Array of missing navigation property filters
601
+ */
602
+ function fnGetMissingNavProperties(oSmartFilterBar) {
603
+ //Fetch the navigation properties
604
+ const oMetaModel = oSmartFilterBar.getModel().getMetaModel(),
605
+ sEntitySet = oSmartFilterBar.getEntitySet(),
606
+ oDataEntitySet = oMetaModel.getODataEntitySet(sEntitySet),
607
+ oDataEntityType = oMetaModel.getODataEntityType(oDataEntitySet.entityType),
608
+ aNavigationProperties = oDataEntityType['navigationProperty'];
609
+ //Fetch the added filters in the current variant
610
+ const sCurrentVariantID = oSmartFilterBar.getVariantManagement().getCurrentVariantId(),
611
+ oCurrentVariant = oSmartFilterBar.getVariantManagement().getAllVariants().find(function(variant) {
612
+ return variant.getId() === sCurrentVariantID;
613
+ });
614
+ if (!oCurrentVariant
615
+ || !oCurrentVariant.getContent()
616
+ || !oCurrentVariant.getContent().searchListReportVariant
617
+ || !oCurrentVariant.getContent().searchListReportVariant.filterBarVariant
618
+ || !aNavigationProperties
619
+ || !aNavigationProperties.length
620
+ ) {
621
+ return [];
622
+ }
623
+ const oManifestNavigationProperties = oSmartFilterBar.getNavigationProperties() ?
624
+ oSmartFilterBar.getNavigationProperties().split(",").reduce(function(accumulator, currentValue){
625
+ accumulator[currentValue] = true;
626
+ return accumulator;
627
+ }, {}) : {},
628
+ oNavigationProperties = aNavigationProperties.reduce(function(accumulator, currentValue){
629
+ accumulator[currentValue.name] = true;
630
+ return accumulator;
631
+ }, {}),
632
+ oSmartFilterBarVariant = JSON.parse(oCurrentVariant.getContent().searchListReportVariant.filterBarVariant),
633
+ aMissing = [];
634
+ delete oSmartFilterBarVariant["_CUSTOM"];
635
+
636
+ // Compare the filter source and navigation properties
637
+ // Take into account if parameter is already specified in page setting in manifest.json - settings->filterSettings->navigationProperties
638
+ // If parameter exist in navigationProperties -> SFB will handle specific parameter and code ignore it
639
+ for (const sFilterKey in oSmartFilterBarVariant) {
640
+ const sParamName = sFilterKey.split(".")[0]; // take first part from navigation parameter. Example: to_Currency.Currency_Code -> to_Currency
641
+ if (!oNavigationProperties[sParamName] || oManifestNavigationProperties[sParamName]
642
+ ) {
643
+ // Parameter is
644
+ // 1) not navigation property -> we don't process it
645
+ // 2) is defined in manifest.json - settings->filterSettings->navigationProperties -> value will be handled by SFB
646
+ continue;
647
+ }
648
+ if (oSmartFilterBarVariant[sFilterKey].items && oSmartFilterBarVariant[sFilterKey].items.length) {
649
+ aMissing.push(oSmartFilterBarVariant[sFilterKey].items.map(function(entry) {
650
+ return {
651
+ exclude: false,
652
+ field: sFilterKey,
653
+ operation: FilterOperator.EQ,
654
+ value1: entry.key
655
+ };
656
+ }));
657
+ continue;
658
+ }
659
+ if (oSmartFilterBarVariant[sFilterKey].ranges && oSmartFilterBarVariant[sFilterKey].ranges.length) {
660
+ aMissing.push(oSmartFilterBarVariant[sFilterKey].ranges.map(function(entry) {
661
+ return {
662
+ exclude: entry.exclude,
663
+ field: entry.keyField,
664
+ operation: entry.operation,
665
+ value1: entry.value1,
666
+ value2: entry.value2
667
+ };
668
+ }));
669
+ }
670
+ }
671
+ return aMissing;
672
+ }
673
+
674
+ // Expose selected private functions to unit tests
595
675
  /* eslint-enable */
596
676
  testableHelper.testableStatic(onShareListReportActionButtonPressImpl, "ControllerImplementation_onShareListReportActionButtonPressImpl");
677
+ testableHelper.testable(fnGetMissingNavProperties, "fnGetMissingNavProperties");
597
678
 
598
679
  // Generation of Event Handlers
599
680
  return {
@@ -751,8 +832,11 @@ sap.ui.define([
751
832
  onShareListReportActionButtonPressImpl(oMenuButton);
752
833
  });
753
834
  },
754
-
835
+
755
836
  handlers: {
837
+ onAfterVariantInitialise: function(oEvent) {
838
+ oTemplateUtils.oCommonUtils.getControlStateWrapper(oEvent.getSource()).onAfterVariantInitialise();
839
+ },
756
840
  addEntry: addEntry,
757
841
  addEntryWithFilters: addEntryWithFilters,
758
842
  deleteEntries: fnDeleteEntries,
@@ -798,6 +882,8 @@ sap.ui.define([
798
882
  onAfterSFBVariantLoad: function (oEvent) {
799
883
  oState.oIappStateHandler.onAfterSFBVariantLoad(oEvent);
800
884
  oState.oEasyFilterBarHandler && oState.oEasyFilterBarHandler.handleVariantLoad(oEvent);
885
+ // Cache missing navigation property filters for performance
886
+ oState.aMissingNavFilters = fnGetMissingNavProperties(oState.oSmartFilterbar);
801
887
  },
802
888
  onSmartListDataReceived: function (oEvent) {
803
889
  var oSmartList = oEvent.getSource();
@@ -850,11 +936,8 @@ sap.ui.define([
850
936
  // However, this connection is not there in the multi view multi table scenario which is the only case in which this snapshot
851
937
  // will be used later.
852
938
  var aFiltersFromRebindEvent = oBindingParams.filters.slice(0);
853
- // To get the missing navigation properties from the user variant
854
- var oSmartFilterBarId = oState.oSmartFilterbar.getId(),
855
- oSmartFilterBarWrapper = oTemplateUtils.oCommonUtils.getControlStateWrapperById(oSmartFilterBarId, "SmartFilterBar"),
856
- aMissingFilters = oSmartFilterBarWrapper.getMissingNavProperties();
857
- if (aMissingFilters.length) {
939
+ // To get the missing navigation properties from the user variant (cached from last variant load)
940
+ if (oState.aMissingNavFilters && oState.aMissingNavFilters.length) {
858
941
  // Display message to the user, which filters currently are not visible
859
942
  var sCurrentVariant = oState.oSmartFilterbar.getVariantManagement().getId(),
860
943
  sCurrentVariantId = oState.oSmartFilterbar.getCurrentVariantId(),
@@ -870,7 +953,7 @@ sap.ui.define([
870
953
  }
871
954
  return accumulator;
872
955
  }, {}),
873
- aMissingPropertyNames = aMissingFilters.reduce(function(accumulator, currentValue) {
956
+ aMissingPropertyNames = oState.aMissingNavFilters.reduce(function(accumulator, currentValue) {
874
957
  var sName = currentValue[0].field.split(".")[0];
875
958
  if (oMappedProperty[sName]) {
876
959
  accumulator.push(oMappedProperty[sName]);
@@ -888,7 +971,7 @@ sap.ui.define([
888
971
  // Generate filters and set them into binding parameters
889
972
  // use same logic as in sap.ui.comp.smartfilterbar.FilterProviderUtils, method generateFilters()
890
973
  var aFilters = [];
891
- aMissingFilters.forEach(function(oEntry) {
974
+ oState.aMissingNavFilters.forEach(function(oEntry) {
892
975
  var aIncludeFilters = [],
893
976
  aExcludeFilters = [];
894
977
  oEntry.forEach(function(oFilterEntry) {
@@ -214,12 +214,6 @@ sap.ui.define([
214
214
  // However, for iAppState case, SVM wrapper also needs to contain SFB wrapper (and not oCustomFiltersWrapper directly)
215
215
 
216
216
 
217
- // DynamicPage state: header pinned
218
- var oDynamicPage = oController.byId(StableIdHelper.getStableId({type: "ListReportPage", subType: "DynamicPage"}));
219
- // TODO: Discuss: should this state (header pinned) be part of variant (only page variant or SFB variant)? Assumption: no
220
- var oDynamicPageWrapper = oTemplateUtils.oCommonUtils.getControlStateWrapper(oDynamicPage);
221
- aControlStateWrappers.push(oDynamicPageWrapper);
222
-
223
217
  // SmartVariantManagement state: Selected Variant and whether it's dirty, including wrappers for managed controls (all controls, for which the corresponding state
224
218
  // information should be part of the variant)
225
219
  // Due to direct connection between SVM and SFB, also their wrappers need to each other directly. Remarks:
@@ -230,13 +224,19 @@ sap.ui.define([
230
224
  if (oSmartVariantManagement){
231
225
  var oSmartVariantManagementWrapper = oTemplateUtils.oCommonUtils.getControlStateWrapper(oSmartVariantManagement, {
232
226
  managedControlWrappers: aPageVariantControlStateWrappers.concat([oSmartFilterBarWrapper]),
233
- dynamicPageWrapper: oDynamicPageWrapper
227
+ smartFilterBarWrapper: oSmartFilterBarWrapper
234
228
  });
235
229
  aControlStateWrappers.push(oSmartVariantManagementWrapper);
236
230
  } else {
237
231
  aControlStateWrappers.push(oSmartFilterBarWrapper);
238
232
  }
239
233
 
234
+ // DynamicPage state: header pinned
235
+ var oDynamicPage = oController.byId(StableIdHelper.getStableId({type: "ListReportPage", subType: "DynamicPage"}));
236
+ // The DynamicPage state (header pinned) is intentionally stored only in iAppState and not included in any variant (neither page variant nor SFB variant).
237
+ var oDynamicPageWrapper = oTemplateUtils.oCommonUtils.getControlStateWrapper(oDynamicPage);
238
+ aControlStateWrappers.push(oDynamicPageWrapper);
239
+
240
240
 
241
241
  // Wrapper to control whether data is loaded
242
242
 
@@ -774,7 +774,8 @@ sap.ui.define([
774
774
  // For desktop devices, expand the header for Standard and Custom variants and for tablet and mobile devices,
775
775
  // collapse the header only if search is triggered.
776
776
  if (Device.system.desktop) {
777
- oTemplateUtils.oCommonUtils.getControlStateWrapper(oController.byId(StableIdHelper.getStableId({type: "ListReportPage", subType: "DynamicPage"}))).setHeaderState(oController, true);
777
+ var oTemplatePrivateModel = oTemplateUtils.oComponentUtils.getTemplatePrivateModel();
778
+ oTemplatePrivateModel.setProperty("/listReport/isHeaderExpanded", true);
778
779
  } else {
779
780
  collapseHeader();
780
781
  }
@@ -909,6 +910,16 @@ sap.ui.define([
909
910
  }
910
911
  sap.ui.getCore().getMessageManager().removeMessages(removedMessages);
911
912
  }
913
+
914
+ // Restore header collapse logic (originally removed in change 5641712)
915
+ // Collapse header when user manually selects a variant (context === undefined) that has executeOnSelect set to true
916
+ var oContext = oEvent.getParameter("context");
917
+ var bExecuteOnSelect = oEvent.getParameter("executeOnSelect");
918
+
919
+ if (oContext === undefined && bExecuteOnSelect) {
920
+ collapseHeader();
921
+ }
922
+
912
923
  fnRestoreExtendedFilterDataOnAfterSFBVariantLoad(oEvent);
913
924
  }
914
925
 
@@ -8,7 +8,7 @@
8
8
  "i18n": "i18n/i18n.properties",
9
9
  "applicationVersion": {
10
10
  "__comment": "applicationVersion oder componentversion??",
11
- "version": "1.142.6"
11
+ "version": "1.142.8"
12
12
  },
13
13
  "title": "{{TITLE}}",
14
14
  "description": "{{DESCRIPTION}}",
@@ -8,7 +8,8 @@
8
8
 
9
9
  <template:with path="entityType>com.sap.vocabularies.UI.v1.HeaderInfo" var="header">
10
10
  <smartChart:SmartChart
11
- id="listReport{= ${parameter>/settings/quickVariantSelectionX} ? ${path: 'tabItem>', formatter: 'AH.getSuffixFromIconTabFilterKey'} : ''}"
11
+ id="listReport{= ${parameter>/settings/quickVariantSelectionX} ? ${path: 'tabItem>', formatter: 'AH.getSuffixFromIconTabFilterKey'} : ''}"
12
+ afterVariantInitialise="._templateEventHandlers.onAfterVariantInitialise"
12
13
  visible="{path: 'tabItem>', formatter: 'AHMultipleViews.getVisibleForTableTabs'}"
13
14
  smartFilterId=""
14
15
  persistencyKey="listReportChart{= ${parameter>/settings/quickVariantSelectionX} ? ${path: 'tabItem>', formatter: 'AH.getSuffixFromIconTabFilterKey'} : ''}"
@@ -17,8 +17,9 @@
17
17
  <template:with path="tableAnnotationPath>" helper="AH.searchForFirstSemKey_Title_Description" var="targetColumn">
18
18
  <template:with path="parameter>/" helper="StableIdHelper.preparePathForStableId" var="smartControlId">
19
19
  <template:if test="{= ${smartControlId>}.buildStableId({type: 'ListReportTable', subType: 'SmartTable', sQuickVariantKey: ${tabItem>key}})}" />
20
- <smarttable:SmartTable id="{smartControlId>id}" useDateRangeType="{= ${parameter>/settings/filterSettings/dateSettings/useDateRange} }"
21
- smartFilterId="{= ${parameter>/settings/quickVariantSelectionX} ? '' : 'listReportFilter'}"
20
+ <smarttable:SmartTable id="{smartControlId>id}" useDateRangeType="{= ${parameter>/settings/filterSettings/dateSettings/useDateRange} }"
21
+ afterVariantInitialise="._templateEventHandlers.onAfterVariantInitialise"
22
+ smartFilterId="{= ${parameter>/settings/quickVariantSelectionX} ? '' : 'listReportFilter'}"
22
23
  visible="{path: 'tabItem>', formatter: 'AHMultipleViews.getVisibleForTableTabs'}"
23
24
  initialise="._templateEventHandlers.onTableInit"
24
25
  persistencyKey="{= ${path: 'parameter>/settings/routeConfig/', formatter: 'AH.getPersistencyKeyForSmartTable'} }{= ${parameter>/settings/quickVariantSelectionX} ? ${path: 'tabItem>', formatter: 'AH.getSuffixFromIconTabFilterKey'} : ''}"
@@ -2479,8 +2479,11 @@ sap.ui.define([
2479
2479
  });
2480
2480
  }
2481
2481
  },
2482
- handlers: {
2483
- onEditAndActiveToggle: function () { // Implementation of draft toggle for static header
2482
+ handlers: {
2483
+ onAfterVariantInitialise: function(oEvent) {
2484
+ oTemplateUtils.oCommonUtils.getControlStateWrapper(oEvent.getSource()).onAfterVariantInitialise();
2485
+ },
2486
+ onEditAndActiveToggle: function () { // Implementation of draft toggle for static header
2484
2487
  var oUIModel = oObjectPage.getModel("ui");
2485
2488
  var bIsEditable = oUIModel.getProperty("/editable");
2486
2489
 
@@ -6,7 +6,7 @@
6
6
  "type": "component",
7
7
  "i18n": "i18n/i18n.properties",
8
8
  "applicationVersion": {
9
- "version": "1.142.6"
9
+ "version": "1.142.8"
10
10
  },
11
11
  "title": "{{TITLE}}",
12
12
  "description": "{{DESCRIPTION}}",
@@ -11,8 +11,9 @@
11
11
  <template:if test="{:= ${smartChartId>}.set(AH.getStableIdPartFromFacet(${facet>}) + '::Chart') }"/>
12
12
  <!-- Header Level for Smart Chart is hardcoded here with "H5" for fallback scenarios, After Section Title hiding logic, if required the level is calculated on the class /ObjectPage/controller/SectionTitleHandler.js-->
13
13
  <!-- Header Style for Smart Chart is hardcoded here with "H5" for all Scenarios.-->
14
- <smartChart:SmartChart
15
- id="{smartChartId>value}"
14
+ <smartChart:SmartChart
15
+ id="{smartChartId>value}"
16
+ afterVariantInitialise="._templateEventHandlers.onAfterVariantInitialise"
16
17
  header="{chartAnnotation>Title/String}"
17
18
  initialized="._templateEventHandlers.onChartInit"
18
19
  requestAtLeastFields="{parts: [{path: 'chartAnnotation>'}, {path: 'entitySet>entityType'}], formatter: 'AH.getApplicablePathForChartToolbarActions'}"
@@ -16,8 +16,9 @@
16
16
  <template:if test="{= ${smartControlId>}.buildStableId({type: 'ObjectPageTable', subType: 'SmartTable', sFacet: ${facetId>id}})}" />
17
17
  <!-- Header Level for Smart Table is hardcoded here with "H5" for fallback scenarios, After Section Title hiding logic, if required the level is calculated on the class /ObjectPage/controller/SectionTitleHandler.js-->
18
18
  <!-- Header Style for Smart Table is hardcoded here with "H5" for all Scenarios.-->
19
- <st:SmartTable id="{smartControlId>id}"
20
- initialise="._templateEventHandlers.onTableInit($event, '{facetId>id}')"
19
+ <st:SmartTable id="{smartControlId>id}"
20
+ afterVariantInitialise="._templateEventHandlers.onAfterVariantInitialise"
21
+ initialise="._templateEventHandlers.onTableInit($event, '{facetId>id}')"
21
22
  persistencyKey="{parts: [{path: 'smartControlId>id'}, {path: 'objectPageTableSettings>value/persistencyKeyState'}], formatter: 'AH.getPersistencyKey'}"
22
23
  tableBindingPath="{= ${path: 'target>AnnotationPath'}.slice(0, ${path: 'target>AnnotationPath'}.lastIndexOf('/')) }"
23
24
  fitContainer="false"
@@ -6,7 +6,7 @@
6
6
  "type": "component",
7
7
  "i18n": "i18n/i18n.properties",
8
8
  "applicationVersion": {
9
- "version": "1.142.6"
9
+ "version": "1.142.8"
10
10
  },
11
11
  "title": "{{TITLE}}",
12
12
  "description": "{{DESCRIPTION}}",
@@ -6,7 +6,7 @@
6
6
  "type": "component",
7
7
  "i18n": "i18n/i18n.properties",
8
8
  "applicationVersion": {
9
- "version": "1.142.6"
9
+ "version": "1.142.8"
10
10
  },
11
11
  "title": "{{TITLE}}",
12
12
  "description": "{{DESCRIPTION}}",
@@ -8,18 +8,19 @@ sap.ui.define([
8
8
  "sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/DynamicPageWrapper",
9
9
  "sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/SmartVariantManagementWrapper",
10
10
  "sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/ObjectPageLayoutWrapper",
11
- "sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/SearchFieldWrapper"
11
+ "sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/SearchFieldWrapper",
12
+ "sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/PreliminaryWrapper"
12
13
  ], function (BaseObject, extend, controlHelper, SmartFilterBarWrapper, SmartTableWrapper, SmartChartWrapper,
13
- DynamicPageWrapper, SmartVariantManagementWrapper, ObjectPageLayoutWrapper, SearchFieldWrapper) {
14
+ DynamicPageWrapper, SmartVariantManagementWrapper, ObjectPageLayoutWrapper, SearchFieldWrapper, PreliminaryWrapper) {
14
15
  "use strict";
15
-
16
+
16
17
  /**
17
18
  * Dummy wrapper for not existing or not (yet) supported controls (either not carrying a state or to be added in future). Also used as interface description for wrapper classes.
18
19
  */
19
20
  var oDummyWrapper = {
20
21
  /**
21
22
  * Retrieve the current state of the control
22
- *
23
+ *
23
24
  * @return {object} serializable json object describing the current state of the control. Will be provided to setState exactly the same when restoring the state. Note: Structure of this object
24
25
  * is up to the wrapper, no one outside will rely on it - with one exception: legacyStateHandler translates legacy states (without clear separation per control) to this format. Open:
25
26
  * Should legacyStateHandler be responsible for providing most current version, or only first control specific version (i.e. first version using wrapper), and wrapper should be
@@ -28,7 +29,7 @@ sap.ui.define([
28
29
  getState: Function.prototype,
29
30
  /**
30
31
  * Restore the control to the given state
31
- *
32
+ *
32
33
  * @param {object} oState json object describing the state as provided by getState. Note: can also be undefined, if an old state is restored (from a release where the state of this control was
33
34
  * not stored), if a state is provided in the URL that cannot be read (anymore), or on OP in discovery mode, if the user navigates to a new object instance - in these cases, the
34
35
  * control has to be brought (back) into its initial state. Currently, expectation is the state to be restored synchronously. Planned:
@@ -40,13 +41,13 @@ sap.ui.define([
40
41
  * wrapper must provide an event to indicate a state change. Must be called whenever a user interacts with the control to change its state, but not when state is changed programmatically (e.g.
41
42
  * from setState, or when user interacts with a different control causing also this one to change (in that case, the event from the other control should be called) Function to register for that
42
43
  * event
43
- *
44
+ *
44
45
  * @param {function} fnHandler event handler function being attached
45
46
  */
46
47
  attachStateChanged: Function.prototype,
47
48
  /**
48
49
  * Function to deregister from event. Currently not used, but should be provided for symmetry reasons.
49
- *
50
+ *
50
51
  * @param {function} fnHandler event handler function being attached. Should only be deregistered, if provided exactly like in registration
51
52
  */
52
53
  detachStateChanged: Function.prototype,
@@ -57,7 +58,7 @@ sap.ui.define([
57
58
 
58
59
  /**
59
60
  * Returns true if the state provided as argument is same as the state applied.
60
- * @param {Object} oState State object which needs to be checked against the current
61
+ * @param {Object} oState State object which needs to be checked against the current
61
62
  * state of the wrapper.
62
63
  * @returns {boolean} True in case State object passed as argument match with current state else false.
63
64
  */
@@ -90,15 +91,66 @@ sap.ui.define([
90
91
  };
91
92
  return extend({}, oWrapper, oOverride);
92
93
  }
93
-
94
+
95
+ /**
96
+ * Private helper function to create the real wrapper based on type and control.
97
+ * This function is injected into PreliminaryWrapper and not exposed in the factory's public API.
98
+ * Parameters are ordered to allow using .bind() for partial application.
99
+ *
100
+ * @param {string} sType - The type of control (e.g., "SmartTable", "SmartChart")
101
+ * @param {object} [mParams] - Additional parameters passed to constructor of wrapper
102
+ * @param {sap.ui.core.Control} oControl - The control instance (last to enable .bind())
103
+ * @return {object} The real wrapper object for the control with helper methods attached
104
+ */
105
+ function fnCreateRealWrapper(sType, mParams, oControl) {
106
+ var oWrapper;
107
+ switch (sType) {
108
+ case "SmartFilterBar":
109
+ oWrapper = new SmartFilterBarWrapper(oControl, oFactory, mParams);
110
+ break;
111
+ case "SmartTable":
112
+ oWrapper = new SmartTableWrapper(oControl, oController, oFactory);
113
+ break;
114
+ case "SmartChart":
115
+ oWrapper = new SmartChartWrapper(oControl, oController, oFactory);
116
+ break;
117
+ case "DynamicPage":
118
+ oWrapper = new DynamicPageWrapper(oControl);
119
+ break;
120
+ case "SmartVariantManagement":
121
+ oWrapper = new SmartVariantManagementWrapper(oControl, oController, oFactory, mParams);
122
+ break;
123
+ case "ObjectPageLayout":
124
+ oWrapper = new ObjectPageLayoutWrapper(oControl);
125
+ break;
126
+ case "SearchField":
127
+ oWrapper = new SearchFieldWrapper(oControl);
128
+ break;
129
+ default:
130
+ // control not carrying a state or no wrapper built yet
131
+ oWrapper = oDummyWrapper;
132
+ }
133
+
134
+ // Add helper methods to the real wrapper
135
+ var sId = oController.getView().getLocalId(oControl.getId());
136
+ oWrapper.getLocalId = function() { return sId; };
137
+ oWrapper.isCurrentState = oWrapper.isCurrentState || function (oState) {
138
+ return JSON.stringify(oState) === JSON.stringify(oWrapper.getState());
139
+ };
140
+
141
+ return oWrapper;
142
+ }
143
+
94
144
  var oFactory = {
95
145
  getSuppressChangeEventWhenApplyingWrapper: getSuppressChangeEventWhenApplyingWrapper,
146
+
96
147
  /**
97
- * Factory function to generate control wrapper object based on control type
98
- *
148
+ * Factory function to generate control wrapper object based on control type.
149
+ * Always returns a PreliminaryWrapper, which delegates to the real wrapper internally.
150
+ *
99
151
  * @param {sap.ui.core.Control} oControl - control a wrapper should be provided for
100
152
  * @param {object} [mParams] - map with any additional parameters passed to constructor of wrapper
101
- * @return {object} wrapper object for the control
153
+ * @return {object} wrapper object for the control (always a PreliminaryWrapper)
102
154
  */
103
155
  getControlStateWrapper: function (oControl, mParams) {
104
156
  // checking for control here (instead of at all callers) allows simple use for optional controls
@@ -107,52 +159,66 @@ sap.ui.define([
107
159
  // no need to add the dummy to the map
108
160
  return oDummyWrapper;
109
161
  }
110
- var sId = oController.getView().getLocalId(oControl.getId());
162
+ var sId = oController.getView().getLocalId(oControl.getId());
163
+
111
164
  if (!mWrappers[sId]) {
112
- var oWrapper;
165
+ // Determine control type
166
+ var sType;
113
167
  switch (true) {
114
168
  case controlHelper.isSmartFilterBar(oControl):
115
- oWrapper = new SmartFilterBarWrapper(oControl, oFactory, mParams);
169
+ sType = "SmartFilterBar";
116
170
  break;
117
171
  case controlHelper.isSmartTable(oControl):
118
- oWrapper = new SmartTableWrapper(oControl, oController, oFactory);
172
+ sType = "SmartTable";
119
173
  break;
120
174
  case controlHelper.isSmartChart(oControl):
121
- oWrapper = new SmartChartWrapper(oControl, oController, oFactory);
175
+ sType = "SmartChart";
122
176
  break;
123
177
  case controlHelper.isDynamicPage(oControl):
124
- oWrapper = new DynamicPageWrapper(oControl);
178
+ sType = "DynamicPage";
125
179
  break;
126
180
  case controlHelper.isSmartVariantManagement(oControl):
127
- oWrapper = new SmartVariantManagementWrapper(oControl, oController, oFactory, mParams);
181
+ sType = "SmartVariantManagement";
128
182
  break;
129
183
  case controlHelper.isObjectObjectPageLayout(oControl):
130
- oWrapper = new ObjectPageLayoutWrapper(oControl);
184
+ sType = "ObjectPageLayout";
131
185
  break;
132
186
  case controlHelper.isSearchField(oControl):
133
- oWrapper = new SearchFieldWrapper(oControl);
187
+ sType = "SearchField";
134
188
  break;
135
189
  default:
136
- // control not carrying a state or no wrapper build yet
137
- oWrapper = oDummyWrapper;
190
+ // control not carrying a state or no wrapper built yet
191
+ return oDummyWrapper;
138
192
  }
139
- oWrapper.getLocalId = function() { return sId; };
140
- oWrapper.isCurrentState = oWrapper.isCurrentState || function (oState) {
141
- return JSON.stringify(oState) === JSON.stringify(oWrapper.getState());
142
- };
143
-
144
- mWrappers[sId] = oWrapper;
193
+
194
+ // Create bound function with type and params, leaving oControl to be provided later
195
+ var fnBoundCreator = fnCreateRealWrapper.bind(null, sType, mParams);
196
+
197
+ // Always create a PreliminaryWrapper
198
+ var oPreliminaryWrapper = new PreliminaryWrapper(sId, fnBoundCreator);
199
+
200
+ // Since control is available, immediately set it
201
+ oPreliminaryWrapper.setControl(oControl);
202
+
203
+ // Store the PreliminaryWrapper in map (not the real wrapper)
204
+ mWrappers[sId] = oPreliminaryWrapper;
205
+ } else if (mWrappers[sId].setControl) {
206
+ // PreliminaryWrapper already exists but control wasn't set yet - set it now
207
+ mWrappers[sId].setControl(oControl);
145
208
  }
209
+
146
210
  return mWrappers[sId];
147
211
  },
148
212
 
149
213
  /**
150
- * Factory function to generate control wrapper object based on control type
151
- *
152
- * @param {string} sId - Id of the control for which wrapper needs to be initiated
214
+ * Factory function to generate control wrapper object based on control ID and type.
215
+ * Creates a PreliminaryWrapper when the control doesn't exist yet (e.g., lazy loading).
216
+ * Always returns a PreliminaryWrapper, which delegates to the real wrapper internally.
217
+ *
218
+ * @param {string} sControlId - ID of the control for which wrapper needs to be initiated
153
219
  * @param {string} sControlType - Type of the control for which wrapper needs to be initiated
154
220
  * @param {object} [mParams] - map with any additional parameters passed to constructor of wrapper
155
- * @return {object} wrapper object for the control
221
+ * @return {object} wrapper object for the control (always a PreliminaryWrapper)
156
222
  */
157
223
  getControlStateWrapperById: function (sControlId, sControlType, mParams) {
158
224
  // checking for control here (instead of at all callers) allows simple use for optional controls
@@ -161,40 +227,15 @@ sap.ui.define([
161
227
  // no need to add the dummy to the map
162
228
  return oDummyWrapper;
163
229
  }
164
- var sId = oController.getView().getLocalId(sControlId);
230
+ var sId = oController.getView().getLocalId(sControlId);
165
231
  if (!mWrappers[sId]) {
166
- var oWrapper;
167
- switch (sControlType) {
168
- case "SmartFilterBar":
169
- oWrapper = new SmartFilterBarWrapper(sControlId, oFactory, mParams);
170
- break;
171
- case "SmartTable":
172
- oWrapper = new SmartTableWrapper(sControlId, oController, oFactory);
173
- break;
174
- case "SmartChart":
175
- oWrapper = new SmartChartWrapper(sControlId, oController, oFactory);
176
- break;
177
- case "DynamicPage":
178
- oWrapper = new DynamicPageWrapper();
179
- break;
180
- case "SmartVariantManagement":
181
- oWrapper = new SmartVariantManagementWrapper(sControlId, oController, oFactory, mParams);
182
- break;
183
- case "ObjectPageLayout":
184
- oWrapper = new ObjectPageLayoutWrapper(sControlId);
185
- break;
186
- case "SearchField":
187
- oWrapper = new SearchFieldWrapper(sControlId);
188
- break;
189
- default:
190
- // control not carrying a state or no wrapper build yet
191
- oWrapper = oDummyWrapper;
192
- }
193
- oWrapper.getLocalId = function() { return sId; };
194
- oWrapper.isCurrentState = oWrapper.isCurrentState || function (oState) {
195
- return JSON.stringify(oState) === JSON.stringify(oWrapper.getState());
196
- };
197
- mWrappers[sId] = oWrapper;
232
+ // Create bound function with type and params, leaving oControl to be provided later
233
+ var fnBoundCreator = fnCreateRealWrapper.bind(null, sControlType, mParams);
234
+
235
+ // Create a PreliminaryWrapper (control will be set later)
236
+ var oPreliminaryWrapper = new PreliminaryWrapper(sId, fnBoundCreator);
237
+
238
+ mWrappers[sId] = oPreliminaryWrapper;
198
239
  }
199
240
  return mWrappers[sId];
200
241
  }
@@ -207,4 +248,4 @@ sap.ui.define([
207
248
  extend(this, getMethods(oController));
208
249
  }
209
250
  });
210
- });
251
+ });