@sapui5/sap.suite.ui.generic.template 1.146.0 → 1.147.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 (167) 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/controller/ControllerImplementation.js +3 -3
  4. package/src/sap/suite/ui/generic/template/AnalyticalListPage/controllerFrameworkExtensions.js +15 -2
  5. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_ar.properties +8 -0
  6. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_bg.properties +8 -0
  7. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_ca.properties +8 -0
  8. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_cnr.properties +8 -0
  9. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_cs.properties +8 -0
  10. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_cy.properties +8 -0
  11. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_da.properties +8 -0
  12. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_de.properties +8 -0
  13. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_el.properties +8 -0
  14. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_en.properties +8 -0
  15. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_en_GB.properties +8 -0
  16. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_en_US_saprigi.properties +8 -0
  17. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_es.properties +8 -0
  18. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_es_MX.properties +8 -0
  19. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_et.properties +8 -0
  20. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_fi.properties +8 -0
  21. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_fr.properties +8 -0
  22. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_fr_CA.properties +8 -0
  23. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_hi.properties +8 -0
  24. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_hr.properties +8 -0
  25. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_hu.properties +8 -0
  26. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_id.properties +8 -0
  27. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_it.properties +9 -1
  28. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_iw.properties +8 -0
  29. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_ja.properties +8 -0
  30. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_kk.properties +8 -0
  31. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_ko.properties +8 -0
  32. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_lt.properties +8 -0
  33. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_lv.properties +8 -0
  34. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_mk.properties +8 -0
  35. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_ms.properties +8 -0
  36. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_nl.properties +8 -0
  37. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_no.properties +8 -0
  38. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_pl.properties +8 -0
  39. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_pt.properties +8 -0
  40. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_pt_PT.properties +8 -0
  41. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_ro.properties +8 -0
  42. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_ru.properties +8 -0
  43. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_sh.properties +8 -0
  44. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_sk.properties +8 -0
  45. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_sl.properties +8 -0
  46. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_sr.properties +8 -0
  47. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_sv.properties +8 -0
  48. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_th.properties +8 -0
  49. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_tr.properties +8 -0
  50. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_uk.properties +8 -0
  51. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_vi.properties +8 -0
  52. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_zh_CN.properties +8 -0
  53. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_zh_TW.properties +8 -0
  54. package/src/sap/suite/ui/generic/template/AnalyticalListPage/manifest.json +1 -1
  55. package/src/sap/suite/ui/generic/template/Canvas/manifest.json +1 -1
  56. package/src/sap/suite/ui/generic/template/ListReport/controller/ControllerImplementation.js +97 -7
  57. package/src/sap/suite/ui/generic/template/ListReport/controller/IappStateHandler.js +19 -8
  58. package/src/sap/suite/ui/generic/template/ListReport/controllerFrameworkExtensions.js +16 -2
  59. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_fr.properties +1 -1
  60. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_fr_CA.properties +1 -1
  61. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_sk.properties +1 -1
  62. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_uk.properties +1 -1
  63. package/src/sap/suite/ui/generic/template/ListReport/manifest.json +1 -1
  64. package/src/sap/suite/ui/generic/template/ListReport/view/fragments/DeleteConfirmation.fragment.xml +2 -2
  65. package/src/sap/suite/ui/generic/template/ListReport/view/fragments/SmartChart.fragment.xml +1 -0
  66. package/src/sap/suite/ui/generic/template/ListReport/view/fragments/SmartTable.fragment.xml +3 -2
  67. package/src/sap/suite/ui/generic/template/ObjectPage/controller/ControllerImplementation.js +5 -2
  68. package/src/sap/suite/ui/generic/template/ObjectPage/controllerFrameworkExtensions.js +16 -2
  69. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_cnr.properties +1 -1
  70. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_mk.properties +1 -1
  71. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_sh.properties +1 -1
  72. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_sl.properties +3 -3
  73. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_sr.properties +1 -1
  74. package/src/sap/suite/ui/generic/template/ObjectPage/manifest.json +1 -1
  75. package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/DraftConfirmationPopup.fragment.xml +2 -2
  76. package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/DraftResumeDialog.fragment.xml +3 -3
  77. package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/RelatedAppsSheet.fragment.xml +1 -1
  78. package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/SmartChart.fragment.xml +3 -2
  79. package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/SmartTable.fragment.xml +3 -2
  80. package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/SwitchDraftAndActiveObjectPopOver.fragment.xml +1 -1
  81. package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/TableDeleteConfirmation.fragment.xml +2 -2
  82. package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/UnsavedChangesDialog.fragment.xml +2 -2
  83. package/src/sap/suite/ui/generic/template/QuickCreate/manifest.json +1 -1
  84. package/src/sap/suite/ui/generic/template/QuickCreate/view/QuickCreate.view.xml +7 -7
  85. package/src/sap/suite/ui/generic/template/QuickView/manifest.json +1 -1
  86. package/src/sap/suite/ui/generic/template/QuickView/view/QuickView.view.xml +6 -6
  87. package/src/sap/suite/ui/generic/template/detailTemplates/detailUtils.js +18 -1
  88. package/src/sap/suite/ui/generic/template/fragments/AINotice.fragment.xml +1 -1
  89. package/src/sap/suite/ui/generic/template/fragments/ActionConfirmation.fragment.xml +3 -3
  90. package/src/sap/suite/ui/generic/template/fragments/ContactDetails.fragment.xml +5 -5
  91. package/src/sap/suite/ui/generic/template/fragments/DataLoss.fragment.xml +2 -2
  92. package/src/sap/suite/ui/generic/template/fragments/DataLossTechnicalError.fragment.xml +3 -3
  93. package/src/sap/suite/ui/generic/template/fragments/DiscardEditPopover.fragment.xml +3 -3
  94. package/src/sap/suite/ui/generic/template/fragments/DraftAdminDataPopover.fragment.xml +1 -1
  95. package/src/sap/suite/ui/generic/template/fragments/MessageDialog.fragment.xml +7 -7
  96. package/src/sap/suite/ui/generic/template/fragments/MessageInfluencingCRUDAction.fragment.xml +7 -7
  97. package/src/sap/suite/ui/generic/template/fragments/MessagePopover.fragment.xml +2 -2
  98. package/src/sap/suite/ui/generic/template/fragments/ShareSheet.fragment.xml +3 -3
  99. package/src/sap/suite/ui/generic/template/genericUtilities/ControlStateWrapperFactory.js +108 -67
  100. package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/DynamicPageWrapper.js +19 -51
  101. package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/ObjectPageLayoutWrapper.js +10 -32
  102. package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/PreliminaryWrapper.js +151 -0
  103. package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/SearchFieldWrapper.js +8 -30
  104. package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/SmartFilterBarWrapper.js +68 -174
  105. package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/SmartTableChartCommon.js +100 -94
  106. package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/SmartTableWrapper.js +22 -3
  107. package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/SmartVariantManagementWrapper.js +90 -81
  108. package/src/sap/suite/ui/generic/template/genericUtilities/metadataAnalyser.js +5 -5
  109. package/src/sap/suite/ui/generic/template/lib/AppComponent.js +5 -1
  110. package/src/sap/suite/ui/generic/template/lib/CommonEventHandlers.js +76 -7
  111. package/src/sap/suite/ui/generic/template/lib/ContextMenuHandler.js +27 -21
  112. package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillHandler.js +5 -1
  113. package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/fragments/EasyFillDialog.fragment.xml +12 -11
  114. package/src/sap/suite/ui/generic/template/lib/ai/EasyFilterBarHandler.js +9 -5
  115. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ar.properties +16 -0
  116. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_bg.properties +16 -0
  117. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ca.properties +16 -0
  118. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_cnr.properties +16 -0
  119. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_cs.properties +16 -0
  120. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_cy.properties +16 -0
  121. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_da.properties +16 -0
  122. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_de.properties +16 -0
  123. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_el.properties +16 -0
  124. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en.properties +16 -0
  125. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en_GB.properties +16 -0
  126. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en_US_saprigi.properties +16 -0
  127. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_es.properties +17 -1
  128. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_es_MX.properties +16 -0
  129. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_et.properties +16 -0
  130. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_fi.properties +18 -2
  131. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_fr.properties +18 -2
  132. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_fr_CA.properties +18 -2
  133. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_hi.properties +16 -0
  134. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_hr.properties +16 -0
  135. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_hu.properties +16 -0
  136. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_id.properties +16 -0
  137. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_it.properties +16 -0
  138. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_iw.properties +16 -0
  139. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ja.properties +20 -4
  140. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_kk.properties +16 -0
  141. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ko.properties +16 -0
  142. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_lt.properties +16 -0
  143. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_lv.properties +16 -0
  144. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_mk.properties +17 -1
  145. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ms.properties +16 -0
  146. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_nl.properties +17 -1
  147. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_no.properties +16 -0
  148. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_pl.properties +16 -0
  149. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_pt.properties +16 -0
  150. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_pt_PT.properties +16 -0
  151. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ro.properties +16 -0
  152. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ru.properties +21 -5
  153. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sh.properties +16 -0
  154. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sk.properties +16 -0
  155. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sl.properties +18 -2
  156. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sr.properties +16 -0
  157. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sv.properties +16 -0
  158. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_th.properties +16 -0
  159. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_tr.properties +16 -0
  160. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_uk.properties +18 -2
  161. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_vi.properties +16 -0
  162. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_zh_CN.properties +20 -4
  163. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_zh_TW.properties +20 -4
  164. package/src/sap/suite/ui/generic/template/lib/insights/InsightsFECardProvider.js +7 -1
  165. package/src/sap/suite/ui/generic/template/lib/navigation/NavigationController.js +1 -1
  166. package/src/sap/suite/ui/generic/template/library.js +1 -1
  167. package/src/sap/suite/ui/generic/template/listTemplates/fragments/MessagesOnRetrieval.fragment.xml +5 -5
@@ -0,0 +1,151 @@
1
+ sap.ui.define([
2
+ "sap/base/util/extend"
3
+ ], function(extend) {
4
+ "use strict";
5
+
6
+ /**
7
+ * PreliminaryWrapper - Acts as a proxy wrapper before the real control is available.
8
+ *
9
+ * This wrapper is created when a control state wrapper is requested by ID and type,
10
+ * but the actual control instance doesn't exist yet (e.g., due to lazy loading on ObjectPage).
11
+ * It stores state operations and event handler registrations, then transfers them to the
12
+ * real wrapper once the control is assigned via setControl().
13
+ *
14
+ * @param {string} sId - The local ID of the control
15
+ * @param {function} fnCreateRealWrapper - Function to create the real wrapper, bound with type and params
16
+ * @returns {object} Preliminary wrapper object that will delegate to real wrapper once control is set
17
+ */
18
+ function PreliminaryWrapper(sId, fnCreateRealWrapper) {
19
+ var oLatestState;
20
+ var oRealWrapper;
21
+ var fnResolveRealWrapperReady;
22
+ var oRealWrapperReadyPromise = new Promise(function(resolve) {
23
+ fnResolveRealWrapperReady = resolve;
24
+ });
25
+
26
+ var oPublicInterface = {
27
+ /**
28
+ * Get the current state. Returns stored state before control is set,
29
+ * delegates to real wrapper afterwards.
30
+ * @returns {object} The current state
31
+ */
32
+ getState: function() {
33
+ return oRealWrapper ? oRealWrapper.getState() : oLatestState;
34
+ },
35
+
36
+ /**
37
+ * Set the state. Stores state before control is set,
38
+ * delegates to real wrapper afterwards.
39
+ * @param {object} oState - The state to set
40
+ */
41
+ setState: function(oState) {
42
+ if (oRealWrapper) {
43
+ oRealWrapper.setState(oState);
44
+ } else {
45
+ oLatestState = oState;
46
+ }
47
+ },
48
+
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
+ },
94
+
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
+ },
105
+
106
+ /**
107
+ * Get the local ID of the control.
108
+ * @returns {string} The local ID
109
+ */
110
+ getLocalId: function() {
111
+ return sId;
112
+ },
113
+
114
+ /**
115
+ * Check if the provided state matches the current state.
116
+ * @param {object} oState - The state to compare
117
+ * @returns {boolean} True if states match
118
+ */
119
+ isCurrentState: function(oState) {
120
+ return oRealWrapper ? oRealWrapper.isCurrentState(oState) :
121
+ JSON.stringify(oState) === JSON.stringify(oLatestState);
122
+ },
123
+
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
+ })
145
+ };
146
+
147
+ return oPublicInterface;
148
+ }
149
+
150
+ return PreliminaryWrapper;
151
+ });
@@ -2,54 +2,32 @@ sap.ui.define([
2
2
  ], function() {
3
3
  "use strict";
4
4
 
5
- function SearchFieldWrapper(vTarget) {
6
- var oSearchField, oControlAssignedResolve, oPreliminaryState;
7
- var oControlAssignedPromise = new Promise(function(resolve) {
8
- oControlAssignedResolve = resolve;
9
- });
10
-
11
- if (typeof vTarget !== "string") {
12
- fnSetControl(vTarget);
13
- }
5
+ function SearchFieldWrapper(oControl) {
6
+ var oSearchField = oControl;
14
7
 
15
8
  function fnGetState() {
16
- if (!oSearchField) {
17
- return oPreliminaryState;
18
- }
19
-
20
9
  return {
21
10
  searchString: oSearchField.getValue()
22
11
  };
23
12
  }
24
13
 
25
14
  function fnSetState(oState) {
26
- oPreliminaryState = oState;
27
- oControlAssignedPromise.then(function() {
28
- oSearchField.setValue(oState.searchString);
29
- // original implementation also called fireSearch. Seems to be superfluous (would fire the search event, on which worklisthandler is registered and finally calls rebindTable
30
- // when restoring from an appState of a worklist, always data should be shown at time of saving the state and thus automatically search would be triggered again
31
- // oSearchField.fireSearch();
32
- });
15
+ oSearchField.setValue(oState.searchString);
16
+ // original implementation also called fireSearch. Seems to be superfluous (would fire the search event, on which worklisthandler is registered and finally calls rebindTable
17
+ // when restoring from an appState of a worklist, always data should be shown at time of saving the state and thus automatically search would be triggered again
18
+ // oSearchField.fireSearch();
33
19
  }
34
20
 
35
21
  function fnAttachStateChanged(fnHandler) {
36
- oControlAssignedPromise.then(function() {
37
- oSearchField.attachLiveChange(fnHandler);
38
- });
22
+ oSearchField.attachLiveChange(fnHandler);
39
23
  }
40
24
 
41
- function fnSetControl(oControl) {
42
- oSearchField = oControl;
43
- oControlAssignedResolve(oSearchField);
44
- }
45
-
46
25
  return {
47
26
  getState: fnGetState,
48
27
  setState: fnSetState,
49
- setControl: fnSetControl,
50
28
  attachStateChanged: fnAttachStateChanged
51
29
  };
52
30
  }
53
31
 
54
32
  return SearchFieldWrapper;
55
- });
33
+ });
@@ -1,6 +1,5 @@
1
1
  sap.ui.define([
2
- "sap/ui/model/FilterOperator"
3
- ], function (FilterOperator) {
2
+ ], function () {
4
3
  "use strict";
5
4
 
6
5
 
@@ -23,29 +22,24 @@ sap.ui.define([
23
22
  * @returns {object}
24
23
  * @alias sap.suite.ui.generic.template.genericUtilities.controlStateWrapperFactory.SmartFilterBarWrapper
25
24
  */
26
- function SmartFilterBarWrapper(vTarget, oFactory, mParams) {
25
+ function SmartFilterBarWrapper(oControl, oFactory, mParams) {
27
26
  var bIsApplying = false;
28
27
  var aBasicFilters = [];
29
- var aMissingNavFilters = [];
30
- var oSmartFilterBar, oControlAssignedResolve, oPreliminaryState;
31
- var oControlAssignedPromise = new Promise(function (resolve) {
32
- oControlAssignedResolve = resolve;
33
- });
28
+ var oSmartFilterBar = oControl;
34
29
 
35
- function fnInitialize() {
36
- if (typeof vTarget !== "string") {
37
- fnSetControl(vTarget);
38
- }
30
+ var oVariantManagementInitializedPromise;
39
31
 
32
+ function fnInitialize() {
40
33
  // Filters visible initially (after initialization). Stored here to be
41
34
  // able to compare with currently visible ones to identify added and
42
35
  // removed ones without need to instantiate all possible filter items
43
36
  // (which would harm performance). Can only be retrieved in initialized event.
44
- oControlAssignedPromise.then(function () {
45
- oSmartFilterBar.getInitializedPromise().then(function () {
46
- aBasicFilters = oSmartFilterBar.getAllFilterItems(true);
47
- });
37
+ oSmartFilterBar.getInitializedPromise().then(function () {
38
+ aBasicFilters = oSmartFilterBar.getAllFilterItems(true);
48
39
  });
40
+
41
+ // Initialize variant management promise
42
+ oVariantManagementInitializedPromise = oSmartFilterBar.getInitializedPromise();
49
43
  }
50
44
 
51
45
  // Attach to variantFetch and variantLoad events to be able to store and restore also custom filters and state of other controls (in case of page VM) with variant.
@@ -69,7 +63,7 @@ sap.ui.define([
69
63
  // in SFB instead of SVM where it would make more sense.
70
64
  // Here the event is afterVariantLoad, as the variant content known to SVM/SFB has first to be applied to the SFB, which will also pass the custom data accordingly. Only
71
65
  // after this has happened, we can get the custom data from SFB.
72
- oSmartFilterBar.attachAfterVariantLoad(function(oEvent){
66
+ oSmartFilterBar.attachAfterVariantLoad(function(){
73
67
  var oCustomData = oSmartFilterBar.getCustomFilterData();
74
68
  // variant stored with 1.103 or later: all customFilter data stored in property customFilters
75
69
  // legacy variant stored with 1.102 or earlier: customFilters (from storing point of view) separated according to their origin
@@ -81,91 +75,11 @@ sap.ui.define([
81
75
  aBasicFilters = oSmartFilterBar.getAllFilterItems(true);
82
76
  mParams.oCustomFiltersWrapper.setState(oCustomFiltersState);
83
77
  oSVMWrapperCallbacks.setManagedControlStates(oCustomData[dataPropertyNameGeneric]);
84
- /* SFB header state of a variant (standard or custom) gets determined by the Apply Automatically checkbox's value of the corresponding
85
- variant i.e. if the checkbox is checked, then the header should be collapsed and vice versa. */
86
- oSVMWrapperCallbacks.setHeaderState(!oEvent.getParameter("executeOnSelect"));
87
- aMissingNavFilters = fnGetNavigationProperties();
88
78
  });
89
79
 
90
80
  }
91
81
 
92
- function fnGetNavigationProperties() {
93
- //Fetch the navigation properties
94
- const oMetaModel = oSmartFilterBar.getModel().getMetaModel(),
95
- sEntitySet = oSmartFilterBar.getEntitySet(),
96
- oDataEntitySet = oMetaModel.getODataEntitySet(sEntitySet),
97
- oDataEntityType = oMetaModel.getODataEntityType(oDataEntitySet.entityType),
98
- aNavigationProperties = oDataEntityType['navigationProperty'];
99
- //Fetch the added filters in the current variant
100
- const sCurrentVariantID = oSmartFilterBar.getVariantManagement().getCurrentVariantId(),
101
- oCurrentVariant = oSmartFilterBar.getVariantManagement().getAllVariants().find(function(variant) {
102
- return variant.getId() === sCurrentVariantID;
103
- });
104
- if (!oCurrentVariant
105
- || !oCurrentVariant.getContent()
106
- || !oCurrentVariant.getContent().searchListReportVariant
107
- || !oCurrentVariant.getContent().searchListReportVariant.filterBarVariant
108
- || !aNavigationProperties
109
- || !aNavigationProperties.length
110
- ) {
111
- return [];
112
- }
113
- const oManifestNavigationProperties = oSmartFilterBar.getNavigationProperties() ?
114
- oSmartFilterBar.getNavigationProperties().split(",").reduce(function(accumulator, currentValue){
115
- accumulator[currentValue] = true;
116
- return accumulator;
117
- }, {}) : {},
118
- oNavigationProperties = aNavigationProperties.reduce(function(accumulator, currentValue){
119
- accumulator[currentValue.name] = true;
120
- return accumulator;
121
- }, {}),
122
- oSmartFilterBarVariant = JSON.parse(oCurrentVariant.getContent().searchListReportVariant.filterBarVariant),
123
- aMissing = [];
124
- delete oSmartFilterBarVariant["_CUSTOM"];
125
-
126
- // Compare the filter source and navigation properties
127
- // Take into account if parameter is already specified in page setting in manifest.json - settings->filterSettings->navigationProperties
128
- // If parameter exist in navigationProperties -> SFB will handle specific parameter and code ignore it
129
- for (const sFilterKey in oSmartFilterBarVariant) {
130
- const sParamName = sFilterKey.split(".")[0]; // take first part from navigation parameter. Example: to_Currency.Currency_Code -> to_Currency
131
- if (!oNavigationProperties[sParamName] || oManifestNavigationProperties[sParamName]
132
- ) {
133
- // Parameter is
134
- // 1) not navigation property -> we don't process it
135
- // 2) is defined in manifest.json - settings->filterSettings->navigationProperties -> value will be handled by SFB
136
- continue;
137
- }
138
- if (oSmartFilterBarVariant[sFilterKey].items && oSmartFilterBarVariant[sFilterKey].items.length) {
139
- aMissing.push(oSmartFilterBarVariant[sFilterKey].items.map(function(entry) {
140
- return {
141
- exclude: false,
142
- field: sFilterKey,
143
- operation: FilterOperator.EQ,
144
- value1: entry.key
145
- };
146
- }));
147
- continue;
148
- }
149
- if (oSmartFilterBarVariant[sFilterKey].ranges && oSmartFilterBarVariant[sFilterKey].ranges.length) {
150
- aMissing.push(oSmartFilterBarVariant[sFilterKey].ranges.map(function(entry) {
151
- return {
152
- exclude: entry.exclude,
153
- field: entry.keyField,
154
- operation: entry.operation,
155
- value1: entry.value1,
156
- value2: entry.value2
157
- };
158
- }));
159
- }
160
- }
161
- return aMissing;
162
- }
163
-
164
82
  function fnGetState() {
165
- if (!oSmartFilterBar) {
166
- return oPreliminaryState;
167
- }
168
-
169
83
  var oUiState = oSmartFilterBar.getUiState();
170
84
  // UiState is not Serializable, but a managed object, containing information only partly relevant
171
85
  // relevant information are
@@ -189,18 +103,22 @@ sap.ui.define([
189
103
  // Note: beforeVariantFetch is even called on initial startup, i.e. without explicetly removing it, the superfluous select option would always be there.
190
104
  oSelectOptions = oSelectOptions && oSelectOptions.filter(function(oSelectOption){
191
105
  return oSelectOption.PropertyName !== dataPropertyNameGeneric;
192
- });
193
- const oVariantManagement = oSmartFilterBar.getVariantManagement?.();
194
- // Cache getAllFilterItems call to avoid multiple expensive operations
195
- const aAllFilterItems = oSmartFilterBar.getAllFilterItems(true);
196
- const aCurrentVisibleFilters = aAllFilterItems.filter(oFilterItem => oFilterItem.getVisibleInFilterBar()).map(oFilterItem => oFilterItem.getName());
197
- const aStandardItems = oVariantManagement?.getStandardVariant(oSmartFilterBar)?.filterbar ?? [];
198
- const aRemovedFromStandard = aStandardItems.filter(oItem => !aCurrentVisibleFilters.includes(oItem.name)).map(oItem => oItem.name);
199
- return {
200
- selectOptions: oSelectOptions,
201
- parameters: oUiState.getSelectionVariant().Parameters,
202
- semanticDates: oUiState.getSemanticDates(),
203
- addedFilterItems: aAllFilterItems.filter(function(oFilterItem){
106
+ });
107
+ const oVariantManagement = oSmartFilterBar.getVariantManagement?.();
108
+ // Cache getAllFilterItems call to avoid multiple expensive operations
109
+ const aAllFilterItems = oSmartFilterBar.getAllFilterItems(true);
110
+ const aCurrentVisibleFilters = aAllFilterItems.filter(oFilterItem => oFilterItem.getVisibleInFilterBar()).map(oFilterItem => oFilterItem.getName());
111
+ const aStandardItems = oVariantManagement?.getStandardVariant(oSmartFilterBar)?.filterbar ?? [];
112
+ const aRemovedFromStandard = aStandardItems.filter(oItem => !aCurrentVisibleFilters.includes(oItem.name)).map(oItem => oItem.name);
113
+ // Extract orderedItems from UiState
114
+ // orderedItems contains filter field sequence: {[{ group: string, name: string }]}
115
+ var oOrderedItems = oUiState.getOrderedItems();
116
+ return {
117
+ selectOptions: oSelectOptions,
118
+ parameters: oUiState.getSelectionVariant().Parameters,
119
+ semanticDates: oUiState.getSemanticDates(),
120
+ orderedItems: oOrderedItems, // Filter field sequence from SFB
121
+ addedFilterItems: aAllFilterItems.filter(function(oFilterItem){
204
122
  // Remark: getAllFilterItems(true) returns also items not visible, but with value set (in adapt filters dialog) => need to check visibility ourselves
205
123
  return oFilterItem.getGroupName() !== sap.ui.comp.filterbar.FilterBar.INTERNAL_GROUP && oFilterItem.getVisibleInFilterBar();
206
124
  }).map(function(oFilterItem){
@@ -224,43 +142,43 @@ sap.ui.define([
224
142
  }
225
143
 
226
144
  bIsApplying = true;
227
- oPreliminaryState = oState;
228
-
229
- oControlAssignedPromise.then(function() {
230
- // SFB expects a UIState object - not serializable, but a managed object, actually containing also information not belonging to SFBs state
231
- // => get current UIState object from SFB, replace only relevant information, and set it again
232
- var oUiState = oSmartFilterBar.getUiState(),
233
- oSmartVariant = oSmartFilterBar.getSmartVariant(),
234
- bIsCurrentVariantModifiedBeforeSetState = oSmartVariant.currentVariantGetModified();
235
145
 
236
- oUiState.getSelectionVariant().SelectOptions = oPreliminaryState && oPreliminaryState.selectOptions;
237
- oUiState.getSelectionVariant().Parameters = oPreliminaryState && oPreliminaryState.parameters;
238
- oUiState.setSemanticDates(oPreliminaryState && oPreliminaryState.semanticDates);
239
- // setState is meant to set the state absolutely, no merge needed => replace and strictMode can be set to true.
240
- // (replace=false can be used to set additional selectOptions but keeping the existing ones. strictMode=false is used to map filters to parameters. Both might make sense in navigation
241
- // scenarios (navigation parameter to be merged with defaults, property used in source app as filter but in target as parameter), but not when just restoring to a state (provided from the
242
- // same control))
243
- oSmartFilterBar.setUiState(oUiState, {replace: true, strictMode: true});
244
-
245
- mParams.oCustomFiltersWrapper.setState(oPreliminaryState && oPreliminaryState.customFilters);
246
-
247
- // set visibility
248
- // TODO:
249
- // - How to deal with old states (not containing all information about visibility) -> legacy state handler?
250
- // - restoring from old state when annotation has changed (new selection fields)?
251
- oSmartFilterBar.getAllFilterItems().forEach(function(oFilterItem){
252
- if (oPreliminaryState && oPreliminaryState.addedFilterItems && oPreliminaryState.addedFilterItems.includes(oFilterItem.getName())){
253
- oFilterItem.setVisibleInFilterBar();
254
- }
255
- if (oPreliminaryState && oPreliminaryState.removedFilterItems && oPreliminaryState.removedFilterItems.includes(oFilterItem.getName())){
256
- oFilterItem.setVisibleInFilterBar(false);
257
- }
258
- });
259
-
260
- // Retaining the old value of "modified" flag in the smart variant
261
- oSmartVariant.currentVariantSetModified(bIsCurrentVariantModifiedBeforeSetState);
146
+ // SFB expects a UIState object - not serializable, but a managed object, actually containing also information not belonging to SFBs state
147
+ // => get current UIState object from SFB, replace only relevant information, and set it again
148
+ var oUiState = oSmartFilterBar.getUiState(),
149
+ oSmartVariant = oSmartFilterBar.getSmartVariant(),
150
+ bIsCurrentVariantModifiedBeforeSetState = oSmartVariant.currentVariantGetModified();
151
+
152
+ oUiState.getSelectionVariant().SelectOptions = oState && oState.selectOptions;
153
+ oUiState.getSelectionVariant().Parameters = oState && oState.parameters;
154
+ oUiState.setSemanticDates(oState && oState.semanticDates);
155
+ // Restore orderedItems (filter field sequence) from state
156
+ // This ensures the filter fields appear in the same order as when the state was saved
157
+ oUiState.setOrderedItems(oState && oState.orderedItems);
158
+ // setState is meant to set the state absolutely, no merge needed => replace and strictMode can be set to true.
159
+ // (replace=false can be used to set additional selectOptions but keeping the existing ones. strictMode=false is used to map filters to parameters. Both might make sense in navigation
160
+ // scenarios (navigation parameter to be merged with defaults, property used in source app as filter but in target as parameter), but not when just restoring to a state (provided from the
161
+ // same control))
162
+ oSmartFilterBar.setUiState(oUiState, {replace: true, strictMode: true});
163
+
164
+ mParams.oCustomFiltersWrapper.setState(oState && oState.customFilters);
165
+
166
+ // set visibility
167
+ // TODO:
168
+ // - How to deal with old states (not containing all information about visibility) -> legacy state handler?
169
+ // - restoring from old state when annotation has changed (new selection fields)?
170
+ oSmartFilterBar.getAllFilterItems().forEach(function(oFilterItem){
171
+ if (oState && oState.addedFilterItems && oState.addedFilterItems.includes(oFilterItem.getName())){
172
+ oFilterItem.setVisibleInFilterBar();
173
+ }
174
+ if (oState && oState.removedFilterItems && oState.removedFilterItems.includes(oFilterItem.getName())){
175
+ oFilterItem.setVisibleInFilterBar(false);
176
+ }
262
177
  });
263
178
 
179
+ // Retaining the old value of "modified" flag in the smart variant
180
+ oSmartVariant.currentVariantSetModified(bIsCurrentVariantModifiedBeforeSetState);
181
+
264
182
  // Apparently, SFB does not always correctly adapt the adapt filters count automatically. The following method has been provided espacially to trigger the same.
265
183
  // TODO: Verify, whether this is really needed (or was rather an artifact of old structure) - if yes, this API should be made public, if no, we should remove the call.
266
184
  oSmartFilterBar.refreshFiltersCount();
@@ -275,25 +193,11 @@ sap.ui.define([
275
193
  }
276
194
  }
277
195
 
278
- oControlAssignedPromise.then(function () {
279
- oSmartFilterBar.attachFilterChange(function () {
280
- // Don't forward filter change event while dialog is open - changes should only be registered when dialog is closed
281
- if (!oSmartFilterBar.isDialogOpen()) {
282
- handleStateChanged();
283
- }
284
- });
285
- // unclear, whether this is needed, or filterChange event is anyway raised again (after dialog is closed)
286
- oSmartFilterBar.attachFiltersDialogClosed(handleStateChanged);
287
-
288
- // do we need to provide and handle change events from custom filters?
289
- // contra:
290
- // - SFB raises filteChange event also for custom filters
291
- // - maybe also needed to be suppressed while dialog is open
292
- // pro:
293
- // - cleaner from architectural perspective
294
- // - SFB cannot deal correctly with unknown custom controls
295
- // - existing method in extensionAPI (onCustomAppStateChange)
296
- mParams.oCustomFiltersWrapper.attachStateChanged(handleStateChanged);
196
+ oSmartFilterBar.attachFilterChange(function () {
197
+ // Don't forward filter change event while dialog is open - changes should only be registered when dialog is closed
198
+ if (!oSmartFilterBar.isDialogOpen()) {
199
+ handleStateChanged();
200
+ }
297
201
  });
298
202
  // unclear, whether this is needed, or filterChange event is anyway raised again (after dialog is closed)
299
203
  oSmartFilterBar.attachFiltersDialogClosed(handleStateChanged);
@@ -321,15 +225,6 @@ sap.ui.define([
321
225
  });
322
226
  }
323
227
 
324
- function fnSetControl(oControl) {
325
- oSmartFilterBar = oControl;
326
- oControlAssignedResolve(oSmartFilterBar);
327
- }
328
-
329
- function fnGetMissingNavProperties() {
330
- return aMissingNavFilters;
331
- }
332
-
333
228
  // check waiting for initialization (like in SmartTableWrapper/SmartChartWrapper)
334
229
  // currently, whole appState restoring is waiting for initialized event from sfb - but probably it would be enough to wait for it here
335
230
  fnInitialize();
@@ -338,15 +233,14 @@ sap.ui.define([
338
233
  // generic properties (provided by all state wrappers)
339
234
  getState: fnGetState,
340
235
  setState: fnSetState,
341
- setControl: fnSetControl,
342
236
  attachStateChanged: fnAttachStateChanged,
343
237
  // specific properties (needed to workaround direct connection between SFB and SVM)
344
238
  setSVMWrapperCallbacks: setSVMWrapperCallbacks,
345
239
  bVMConnection: oSmartFilterBar.getSmartVariant(),
346
240
  suppressSelection: oSmartFilterBar.setSuppressSelection.bind(oSmartFilterBar), // if multiple reasons for suppressing overlap, a counter (to avoid to early resume) could be implemented here
347
- getMissingNavProperties: fnGetMissingNavProperties
241
+ oVariantManagementInitializedPromise: oVariantManagementInitializedPromise
348
242
  };
349
243
  }
350
244
 
351
245
  return SmartFilterBarWrapper;
352
- });
246
+ });