@sapui5/sap.suite.ui.generic.template 1.142.7 → 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sapui5/sap.suite.ui.generic.template",
3
- "version": "1.142.7",
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.7</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.7"
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.7"
11
+ "version": "1.142.8"
12
12
  },
13
13
  "title": "Canvas",
14
14
  "description": "Canvas Page",
@@ -223,7 +223,8 @@ sap.ui.define([
223
223
  var oSmartVariantManagement = oState.oSmartFilterbar.getSmartVariant();
224
224
  if (oSmartVariantManagement){
225
225
  var oSmartVariantManagementWrapper = oTemplateUtils.oCommonUtils.getControlStateWrapper(oSmartVariantManagement, {
226
- managedControlWrappers: aPageVariantControlStateWrappers.concat([oSmartFilterBarWrapper])
226
+ managedControlWrappers: aPageVariantControlStateWrappers.concat([oSmartFilterBarWrapper]),
227
+ smartFilterBarWrapper: oSmartFilterBarWrapper
227
228
  });
228
229
  aControlStateWrappers.push(oSmartVariantManagementWrapper);
229
230
  } else {
@@ -8,7 +8,7 @@
8
8
  "i18n": "i18n/i18n.properties",
9
9
  "applicationVersion": {
10
10
  "__comment": "applicationVersion oder componentversion??",
11
- "version": "1.142.7"
11
+ "version": "1.142.8"
12
12
  },
13
13
  "title": "{{TITLE}}",
14
14
  "description": "{{DESCRIPTION}}",
@@ -6,7 +6,7 @@
6
6
  "type": "component",
7
7
  "i18n": "i18n/i18n.properties",
8
8
  "applicationVersion": {
9
- "version": "1.142.7"
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.7"
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.7"
9
+ "version": "1.142.8"
10
10
  },
11
11
  "title": "{{TITLE}}",
12
12
  "description": "{{DESCRIPTION}}",
@@ -93,15 +93,16 @@ sap.ui.define([
93
93
  }
94
94
 
95
95
  /**
96
- * Private helper function to create the real wrapper based on control and type.
96
+ * Private helper function to create the real wrapper based on type and control.
97
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.
98
99
  *
99
- * @param {sap.ui.core.Control} oControl - The control instance
100
100
  * @param {string} sType - The type of control (e.g., "SmartTable", "SmartChart")
101
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())
102
103
  * @return {object} The real wrapper object for the control with helper methods attached
103
104
  */
104
- function fnCreateRealWrapper(oControl, sType, mParams) {
105
+ function fnCreateRealWrapper(sType, mParams, oControl) {
105
106
  var oWrapper;
106
107
  switch (sType) {
107
108
  case "SmartFilterBar":
@@ -190,8 +191,11 @@ sap.ui.define([
190
191
  return oDummyWrapper;
191
192
  }
192
193
 
194
+ // Create bound function with type and params, leaving oControl to be provided later
195
+ var fnBoundCreator = fnCreateRealWrapper.bind(null, sType, mParams);
196
+
193
197
  // Always create a PreliminaryWrapper
194
- var oPreliminaryWrapper = new PreliminaryWrapper(sId, sType, fnCreateRealWrapper, oController, mParams);
198
+ var oPreliminaryWrapper = new PreliminaryWrapper(sId, fnBoundCreator);
195
199
 
196
200
  // Since control is available, immediately set it
197
201
  oPreliminaryWrapper.setControl(oControl);
@@ -225,8 +229,11 @@ sap.ui.define([
225
229
  }
226
230
  var sId = oController.getView().getLocalId(sControlId);
227
231
  if (!mWrappers[sId]) {
232
+ // Create bound function with type and params, leaving oControl to be provided later
233
+ var fnBoundCreator = fnCreateRealWrapper.bind(null, sControlType, mParams);
234
+
228
235
  // Create a PreliminaryWrapper (control will be set later)
229
- var oPreliminaryWrapper = new PreliminaryWrapper(sId, sControlType, fnCreateRealWrapper, oController, mParams);
236
+ var oPreliminaryWrapper = new PreliminaryWrapper(sId, fnBoundCreator);
230
237
 
231
238
  mWrappers[sId] = oPreliminaryWrapper;
232
239
  }
@@ -1,5 +1,6 @@
1
1
  sap.ui.define([
2
- ], function() {
2
+ "sap/base/util/extend"
3
+ ], function(extend) {
3
4
  "use strict";
4
5
 
5
6
  /**
@@ -11,13 +12,10 @@ sap.ui.define([
11
12
  * real wrapper once the control is assigned via setControl().
12
13
  *
13
14
  * @param {string} sId - The local ID of the control
14
- * @param {string} sType - The type of the control (e.g., "SmartTable", "SmartChart")
15
- * @param {function} fnCreateRealWrapper - Function to create the real wrapper, injected by factory
16
- * @param {object} oController - The controller instance
17
- * @param {object} mParams - Additional parameters to pass to the real wrapper constructor
15
+ * @param {function} fnCreateRealWrapper - Function to create the real wrapper, bound with type and params
18
16
  * @returns {object} Preliminary wrapper object that will delegate to real wrapper once control is set
19
17
  */
20
- function PreliminaryWrapper(sId, sType, fnCreateRealWrapper, oController, mParams) {
18
+ function PreliminaryWrapper(sId, fnCreateRealWrapper) {
21
19
  var oLatestState;
22
20
  var oRealWrapper;
23
21
  var fnResolveRealWrapperReady;
@@ -25,7 +23,7 @@ sap.ui.define([
25
23
  fnResolveRealWrapperReady = resolve;
26
24
  });
27
25
 
28
- return {
26
+ var oPublicInterface = {
29
27
  /**
30
28
  * Get the current state. Returns stored state before control is set,
31
29
  * delegates to real wrapper afterwards.
@@ -48,55 +46,62 @@ sap.ui.define([
48
46
  }
49
47
  },
50
48
 
51
- /**
52
- * Assign the actual control and create the real wrapper.
53
- * This triggers the creation of the real wrapper, applies any stored state,
54
- * and resolves the promise that queues event handler attachments.
55
- * @param {sap.ui.core.Control} oControl - The control instance
56
- */
57
- setControl: function(oControl) {
58
- // Create the real wrapper using injected function
59
- var oCreatedWrapper = fnCreateRealWrapper(oControl, sType, mParams);
60
-
61
- // Check if wrapper needs time to initialize
62
- var oWrapperReadyPromise = oCreatedWrapper.oReadyPromise || Promise.resolve();
63
-
64
- // Wait for wrapper to be ready before setting oRealWrapper
65
- oWrapperReadyPromise.then(function() {
66
- oRealWrapper = oCreatedWrapper;
67
-
68
- // Apply stored state if any
69
- if (oLatestState !== undefined) {
70
- oRealWrapper.setState(oLatestState);
71
- }
49
+ /**
50
+ * Assign the actual control and create the real wrapper.
51
+ * This triggers the creation of the real wrapper, applies any stored state,
52
+ * extends the preliminary wrapper with all methods from the real wrapper,
53
+ * and resolves the promise that queues event handler attachments.
54
+ * @param {sap.ui.core.Control} oControl - The control instance
55
+ */
56
+ setControl: function(oControl) {
57
+ // Create the real wrapper using bound function (already has type and params bound)
58
+ var oCreatedWrapper = fnCreateRealWrapper(oControl);
59
+
60
+ // Check if wrapper needs time to initialize
61
+ var oWrapperReadyPromise = oCreatedWrapper.oReadyPromise || Promise.resolve();
62
+
63
+ // Wait for wrapper to be ready before setting oRealWrapper
64
+ oWrapperReadyPromise.then(function() {
65
+ oRealWrapper = oCreatedWrapper;
66
+
67
+ // Apply stored state if any
68
+ if (oLatestState !== undefined) {
69
+ oRealWrapper.setState(oLatestState);
70
+ }
71
+
72
+ // Extend the preliminary wrapper with all properties from the real wrapper
73
+ // This makes any additional methods (like setSVMWrapperCallbacks) available
74
+ // The nested extend ensures we keep our proxy methods (getState, setState, etc.)
75
+ // while adding new methods from the real wrapper
76
+ extend(oPublicInterface, extend({}, oRealWrapper, oPublicInterface));
77
+
78
+ // Resolve the promise - this triggers all queued attachStateChanged calls
79
+ fnResolveRealWrapperReady(oRealWrapper);
80
+ });
81
+ },
82
+
83
+ /**
84
+ * Attach a state change handler. Uses promise to queue attachment
85
+ * until the real wrapper is available and ready.
86
+ * @param {function} fnHandler - The event handler function
87
+ */
88
+ attachStateChanged: function(fnHandler) {
89
+ // Use promise to defer attachment until real wrapper is available and ready
90
+ oRealWrapperReadyPromise.then(function(oWrapper) {
91
+ oWrapper.attachStateChanged(fnHandler);
92
+ });
93
+ },
72
94
 
73
- // Resolve the promise - this triggers all queued attachStateChanged calls
74
- fnResolveRealWrapperReady(oRealWrapper);
75
- });
76
- },
77
-
78
- /**
79
- * Attach a state change handler. Uses promise to queue attachment
80
- * until the real wrapper is available and ready.
81
- * @param {function} fnHandler - The event handler function
82
- */
83
- attachStateChanged: function(fnHandler) {
84
- // Use promise to defer attachment until real wrapper is available and ready
85
- oRealWrapperReadyPromise.then(function(oWrapper) {
86
- oWrapper.attachStateChanged(fnHandler);
87
- });
88
- },
89
-
90
- /**
91
- * Detach a state change handler. Forwards to real wrapper once available and ready.
92
- * @param {function} fnHandler - The event handler function to detach
93
- */
94
- detachStateChanged: function(fnHandler) {
95
- // Forward to real wrapper once available and ready
96
- oRealWrapperReadyPromise.then(function(oWrapper) {
97
- oWrapper.detachStateChanged(fnHandler);
98
- });
99
- },
95
+ /**
96
+ * Detach a state change handler. Forwards to real wrapper once available and ready.
97
+ * @param {function} fnHandler - The event handler function to detach
98
+ */
99
+ detachStateChanged: function(fnHandler) {
100
+ // Forward to real wrapper once available and ready
101
+ oRealWrapperReadyPromise.then(function(oWrapper) {
102
+ oWrapper.detachStateChanged(fnHandler);
103
+ });
104
+ },
100
105
 
101
106
  /**
102
107
  * Get the local ID of the control.
@@ -116,28 +121,30 @@ sap.ui.define([
116
121
  JSON.stringify(oState) === JSON.stringify(oLatestState);
117
122
  },
118
123
 
119
- /**
120
- * Called after variant is initialized (for SmartTable/SmartChart wrappers).
121
- * Delegates to real wrapper once control is set and ready.
122
- * Note: When this is called, the control always exists (event fired by control),
123
- * so the promise will already be resolved.
124
- */
125
- onAfterVariantInitialise: function() {
126
- oRealWrapperReadyPromise.then(function(oWrapper) {
127
- if (oWrapper.onAfterVariantInitialise) {
128
- oWrapper.onAfterVariantInitialise();
129
- }
130
- });
131
- },
132
-
133
- /**
134
- * Promise that resolves to the bVMConnection flag value once the real wrapper is ready.
135
- * This indicates whether the control is connected to page-wide variant management.
136
- */
137
- oVMConnectionPromise: oRealWrapperReadyPromise.then(function(oWrapper) {
138
- return oWrapper.bVMConnection;
139
- })
124
+ /**
125
+ * Called after variant is initialized (for SmartTable/SmartChart wrappers).
126
+ * Delegates to real wrapper once control is set and ready.
127
+ * Note: When this is called, the control always exists (event fired by control),
128
+ * so the promise will already be resolved.
129
+ */
130
+ onAfterVariantInitialise: function() {
131
+ oRealWrapperReadyPromise.then(function(oWrapper) {
132
+ if (oWrapper.onAfterVariantInitialise) {
133
+ oWrapper.onAfterVariantInitialise();
134
+ }
135
+ });
136
+ },
137
+
138
+ /**
139
+ * Promise that resolves to the bVMConnection flag value once the real wrapper is ready.
140
+ * This indicates whether the control is connected to page-wide variant management.
141
+ */
142
+ oVMConnectionPromise: oRealWrapperReadyPromise.then(function(oWrapper) {
143
+ return oWrapper.bVMConnection;
144
+ })
140
145
  };
146
+
147
+ return oPublicInterface;
141
148
  }
142
149
 
143
150
  return PreliminaryWrapper;
@@ -9,7 +9,7 @@ sap.ui.define([
9
9
  * @param {object} oFactory - the controlStateWrapperFactory
10
10
  * @param {object} mParams
11
11
  * @param {array} mParams.managedControlWrappers - array of controlStateWrappers for controls handled by the SVM
12
- * (currently also including SFB wrapper - to be removed)
12
+ * @param {object} mParams.smartFilterBarWrapper - explicit reference to SmartFilterBarWrapper for special handling
13
13
  * @returns {object}
14
14
  */
15
15
 
@@ -53,13 +53,15 @@ sap.ui.define([
53
53
  });
54
54
  });
55
55
 
56
+ // Get SmartFilterBarWrapper explicitly from params.
57
+ // This connection is needed because SmartFilterBar provides special callbacks to store/restore state
58
+ // for controls that don't have a direct variant management connection (bVMConnection = false), such as:
59
+ // - Extension filters (custom filters added via app or adaptation extensions)
60
+ // - Multiple views state (selected tab in multi-table/chart scenarios)
61
+ // These controls need their state saved/restored with variants via the SFB's beforeVariantFetch/afterVariantLoad events.
62
+ var oSmartFilterBarWrapper = mParams.smartFilterBarWrapper;
56
63
 
57
-
58
- var oSmartFilterBarWrapper = mParams.managedControlWrappers.find(function(oWrapper){
59
- return oWrapper.setSVMWrapperCallbacks;
60
- });
61
-
62
- // provide callbacks needed for SFB wrapper to store/restore extension state with variant
64
+ // Provide callbacks needed for SFB wrapper to store/restore extension state with variant
63
65
  if (oSmartFilterBarWrapper){
64
66
  // Build array with wrapper + bVMConnection info once all wrappers are ready
65
67
  Promise.all(mParams.managedControlWrappers.map(function(oWrapper){
@@ -959,7 +959,7 @@ sap.ui.define([
959
959
  * @public
960
960
  * @extends sap.ui.core.UIComponent
961
961
  * @author SAP SE
962
- * @version 1.142.7
962
+ * @version 1.142.8
963
963
  * @name sap.suite.ui.generic.template.lib.AppComponent
964
964
  */
965
965
  var oAppComponent = UIComponent.extend("sap.suite.ui.generic.template.lib.AppComponent", {
@@ -3213,7 +3213,7 @@ sap.ui.define(["sap/ui/base/Object",
3213
3213
  * @param {sap.suite.ui.generic.template.lib.AppComponent} oAppComponent The AppComponent instance
3214
3214
  * @public
3215
3215
  * @extends sap.ui.base.Object
3216
- * @version 1.142.7
3216
+ * @version 1.142.8
3217
3217
  * @since 1.30.0
3218
3218
  * @alias sap.suite.ui.generic.template.lib.NavigationController
3219
3219
  */
@@ -66,7 +66,7 @@ sap.ui.define([
66
66
  interfaces: [],
67
67
  controls: [],
68
68
  elements: [],
69
- version: "1.142.7",
69
+ version: "1.142.8",
70
70
  extensions: {
71
71
  //Configuration used for rule loading of Support Assistant
72
72
  "sap.ui.support": {