@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 +1 -1
- package/src/sap/suite/ui/generic/template/.library +1 -1
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/Canvas/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/controller/IappStateHandler.js +2 -1
- package/src/sap/suite/ui/generic/template/ListReport/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/QuickCreate/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/QuickView/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/genericUtilities/ControlStateWrapperFactory.js +12 -5
- package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/PreliminaryWrapper.js +83 -76
- package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/SmartVariantManagementWrapper.js +9 -7
- package/src/sap/suite/ui/generic/template/lib/AppComponent.js +1 -1
- package/src/sap/suite/ui/generic/template/lib/navigation/NavigationController.js +1 -1
- package/src/sap/suite/ui/generic/template/library.js +1 -1
package/package.json
CHANGED
|
@@ -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 {
|
|
@@ -93,15 +93,16 @@ sap.ui.define([
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
/**
|
|
96
|
-
* Private helper function to create the real wrapper based on
|
|
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(
|
|
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,
|
|
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,
|
|
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
|
-
|
|
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 {
|
|
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,
|
|
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
|
-
|
|
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
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
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
|
-
*
|
|
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.
|
|
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.
|
|
3216
|
+
* @version 1.142.8
|
|
3217
3217
|
* @since 1.30.0
|
|
3218
3218
|
* @alias sap.suite.ui.generic.template.lib.NavigationController
|
|
3219
3219
|
*/
|