@sapui5/sap.suite.ui.generic.template 1.148.1 → 1.148.2

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 (74) 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 +6 -3
  6. package/src/sap/suite/ui/generic/template/ListReport/manifest.json +1 -1
  7. package/src/sap/suite/ui/generic/template/ObjectPage/manifest.json +1 -1
  8. package/src/sap/suite/ui/generic/template/QuickCreate/manifest.json +1 -1
  9. package/src/sap/suite/ui/generic/template/QuickView/manifest.json +1 -1
  10. package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/SmartFilterBarWrapper.js +20 -1
  11. package/src/sap/suite/ui/generic/template/lib/AppComponent.js +1 -1
  12. package/src/sap/suite/ui/generic/template/lib/CRUDManager.js +0 -7
  13. package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillAIOrchestrator.js +43 -12
  14. package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillApplyHandler.js +67 -218
  15. package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillDialogController.js +55 -8
  16. package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillFieldCollector.js +214 -35
  17. package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillFormRenderer.js +93 -18
  18. package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillHandler.js +426 -48
  19. package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillTableRenderer.js +512 -63
  20. package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/fragments/EasyFillDialog.fragment.xml +33 -22
  21. package/src/sap/suite/ui/generic/template/lib/ai/EasyFilterBarHandler.js +90 -73
  22. package/src/sap/suite/ui/generic/template/lib/i18n/i18n.properties +24 -0
  23. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ar.properties +15 -7
  24. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_bg.properties +15 -7
  25. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ca.properties +15 -7
  26. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_cnr.properties +15 -7
  27. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_cs.properties +15 -7
  28. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_cy.properties +15 -7
  29. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_da.properties +15 -7
  30. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_de.properties +19 -11
  31. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_el.properties +15 -7
  32. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en.properties +15 -7
  33. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en_GB.properties +15 -7
  34. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en_US_saprigi.properties +15 -7
  35. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_es.properties +15 -7
  36. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_es_MX.properties +15 -7
  37. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_et.properties +15 -7
  38. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_fi.properties +15 -7
  39. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_fr.properties +16 -8
  40. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_fr_CA.properties +16 -8
  41. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_hi.properties +15 -7
  42. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_hr.properties +16 -8
  43. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_hu.properties +15 -7
  44. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_id.properties +15 -7
  45. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_it.properties +15 -7
  46. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_iw.properties +15 -7
  47. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ja.properties +15 -7
  48. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_kk.properties +15 -7
  49. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ko.properties +15 -7
  50. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_lt.properties +15 -7
  51. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_lv.properties +15 -7
  52. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_mk.properties +15 -7
  53. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ms.properties +15 -7
  54. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_nl.properties +15 -7
  55. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_no.properties +15 -7
  56. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_pl.properties +15 -7
  57. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_pt.properties +15 -7
  58. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_pt_PT.properties +15 -7
  59. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ro.properties +15 -7
  60. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ru.properties +15 -7
  61. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sh.properties +15 -7
  62. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sk.properties +15 -7
  63. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sl.properties +15 -7
  64. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sr.properties +15 -7
  65. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sv.properties +15 -7
  66. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_th.properties +15 -7
  67. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_tr.properties +15 -7
  68. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_uk.properties +15 -7
  69. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_vi.properties +15 -7
  70. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_zh_CN.properties +15 -7
  71. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_zh_TW.properties +15 -7
  72. package/src/sap/suite/ui/generic/template/lib/navigation/NavigationController.js +1 -1
  73. package/src/sap/suite/ui/generic/template/library.js +1 -1
  74. package/src/sap/suite/ui/generic/template/themes/base/ObjectPage.less +22 -1
@@ -47,23 +47,40 @@ sap.ui.define([
47
47
  * @param {object} oLLMData - flat map of { fieldName: aiValue } from the LLM response
48
48
  * @returns {boolean} always returns true (used as a formatter return value in XML)
49
49
  */
50
- populateSmartFields: function(sId, aFields, sEasyFillMode, oController, oTransientContextForEasyFill, oObjectPageContext, mUpdatableLookupMap, oLLMData) {
50
+ populateSmartFields: function(sId, aFields, sEasyFillMode, oController, oTransientContextForEasyFill, oObjectPageContext, mUpdatableLookupMap, oLLMData, fnOnFieldChange) {
51
51
  var oObjectPageLayout = oController.byId("EasyFillObjectPageLayout");
52
52
  if (!oObjectPageLayout || !Array.isArray(aFields) || aFields.length === 0) {
53
53
  return true;
54
54
  }
55
55
 
56
+ var sPreviouslyLabel = oController.getView().getModel("i18n").getResourceBundle().getText("EASY_FILL_PREVIOUSLY_LABEL");
57
+
56
58
  // Defer injection until after the SmartForm has rendered into the DOM
57
59
  setTimeout(function() {
58
60
  var oTargetGroup = null;
59
61
 
60
62
  // Walk the ObjectPageLayout section hierarchy to find the group
61
- // matching the given CustomData "id" value
63
+ // matching the given CustomData "id" value.
64
+ // In condensed mode the SmartForm may be nested inside a wrapper VBox
65
+ // (used to prevent BlockLayout from placing the table side-by-side with
66
+ // the SmartForm on resize). We therefore check one level deeper when the
67
+ // direct block is not a SmartForm.
62
68
  oObjectPageLayout.getSections().forEach(function(oSection) {
63
69
  oSection.getSubSections().forEach(function(oSubSection) {
64
70
  oSubSection.getBlocks().forEach(function(oBlock) {
71
+ var aSmartFormCandidates = [];
65
72
  if (oBlock.isA("sap.ui.comp.smartform.SmartForm")) {
66
- oBlock.getGroups().forEach(function(oGroup) {
73
+ aSmartFormCandidates.push(oBlock);
74
+ } else if (typeof oBlock.getItems === "function") {
75
+ // Look one level inside (e.g. condensed-mode wrapper VBox)
76
+ oBlock.getItems().forEach(function(oItem) {
77
+ if (oItem.isA("sap.ui.comp.smartform.SmartForm")) {
78
+ aSmartFormCandidates.push(oItem);
79
+ }
80
+ });
81
+ }
82
+ aSmartFormCandidates.forEach(function(oSmartForm) {
83
+ oSmartForm.getGroups().forEach(function(oGroup) {
67
84
  var oMatchedCustomData = oGroup.getCustomData().find(function(oData) {
68
85
  return oData.getKey() === "id" && oData.getValue() === sId;
69
86
  });
@@ -71,7 +88,7 @@ sap.ui.define([
71
88
  oTargetGroup = oGroup;
72
89
  }
73
90
  });
74
- }
91
+ });
75
92
  });
76
93
  });
77
94
  });
@@ -85,7 +102,7 @@ sap.ui.define([
85
102
  oTargetGroup.destroyGroupElements();
86
103
 
87
104
  aFields.forEach(function(sKey) {
88
- var bIsEditable = mUpdatableLookupMap && !!mUpdatableLookupMap[sKey];
105
+ var bIsEditable = Object.prototype.hasOwnProperty.call(mUpdatableLookupMap || {}, sKey);
89
106
 
90
107
  var oGroupElement = new GroupElement({
91
108
  useHorizontalLayout: false
@@ -114,6 +131,56 @@ sap.ui.define([
114
131
  }
115
132
  });
116
133
 
134
+ if (!bIsEditable) {
135
+ // Keep read-only behavior, but render like an input field (v4-like visual parity)
136
+ oSmartField.addStyleClass("sapUiEasyFillReadOnlyInputLike sapMInputBaseContentWrapper");
137
+ }
138
+
139
+ // Notify on user edits so SmartForm validity can re-gate the Confirm button.
140
+ if (bIsEditable && typeof fnOnFieldChange === "function") {
141
+ oSmartField.attachChange(fnOnFieldChange);
142
+
143
+ // Validate AI-seeded values on initial load — mirrors ObjectPage behaviour.
144
+ //
145
+ // In the OP, validation triggers because when a user TYPES a value the browser
146
+ // fires a change event which causes UI5 to call setExternalValue() on the inner
147
+ // control's binding. setExternalValue() has no fast-path: it always calls
148
+ // parseValue → validateValue → OData value-list lookup. If the lookup fails the
149
+ // binding calls setInvalidValue() + checkDataState() → ManagedObject fires
150
+ // validationError → inner control gets valueState="Error" (red mark).
151
+ //
152
+ // SmartForm.check() / SmartField.checkValuesValidity() do NOT work for
153
+ // AI-seeded values because SmartField._checkErrors() contains a fast-path:
154
+ // if (!isControlDirty() && formattedModelValue === displayedValue) → skip
155
+ // AI values always satisfy this (model = display = AI value, user never typed),
156
+ // so _checkErrors() short-circuits to "valid" without the OData lookup.
157
+ //
158
+ // Fix: after innerControlsCreated, call setExternalValue() on the inner
159
+ // control's own binding with the currently displayed value. This is exactly
160
+ // the same path the OP uses when the user types. For async types (TextArrangement
161
+ // with ValueList) the call starts the OData lookup:
162
+ // valid value → resolves quietly, no red mark
163
+ // invalid value → rejects → setInvalidValue + checkDataState → red mark
164
+ // Non-async types fall through to a plain fnOnFieldChange call because
165
+ // SmartForm.check() already handles them correctly (no fast-path for sync).
166
+ oSmartField.attachInnerControlsCreated(function() {
167
+ var oInnerControl = oSmartField.getFirstInnerControl();
168
+ if (oInnerControl && typeof oInnerControl.getValue === "function") {
169
+ var oBinding = oInnerControl.getBinding("value");
170
+ var oType = oBinding && typeof oBinding.getType === "function" && oBinding.getType();
171
+ if (oType && oType.async && typeof oBinding.setExternalValue === "function") {
172
+ // setExternalValue replicates the "user typed this value" path:
173
+ // parseValue → validateValue → OData lookup → validationError/Success
174
+ Promise.resolve(oBinding.setExternalValue(oInnerControl.getValue()))
175
+ .catch(Function.prototype)
176
+ .finally(fnOnFieldChange);
177
+ return;
178
+ }
179
+ }
180
+ fnOnFieldChange();
181
+ });
182
+ }
183
+
117
184
  /**
118
185
  * "Previously:" SmartField (read-only):
119
186
  * - Only shown for editable fields to display the current OP value for comparison
@@ -125,10 +192,9 @@ sap.ui.define([
125
192
  enabled: false,
126
193
  contextEditable: false,
127
194
  showLabel: false,
128
- visible: bIsEditable,
129
195
  layoutData: new ColumnElementData({
130
196
  cellsSmall: 9,
131
- cellsLarge: 10
197
+ cellsLarge: 9
132
198
  }),
133
199
  editableChanged: function(oEvent) {
134
200
  // Always keep the "previously" field read-only
@@ -138,33 +204,42 @@ sap.ui.define([
138
204
  }
139
205
  });
140
206
 
141
- if (bIsEditable) {
142
- // Editable fields: primary field uses transient context (AI value),
143
- // preview field uses original OP context (current value)
207
+ if (oTransientContextForEasyFill) {
208
+ // Primary field always uses transient context to show AI-proposed value.
209
+ // Field editability is controlled by bIsEditable.
144
210
  oSmartField.setBindingContext(oTransientContextForEasyFill);
145
- oSmartFieldPrev.setBindingContext(oObjectPageContext);
146
211
 
147
- // Set the AI-suggested value on the transient context for this field
148
- oTransientContextForEasyFill.setProperty(sKey, oLLMData[sKey]);
212
+ // Only seed the transient context with the AI-suggested value on the first
213
+ // population. On subsequent calls (e.g. mode switch), the transient context
214
+ // already holds the current value — overwriting it would discard user edits.
215
+ if (oTransientContextForEasyFill.getProperty(sKey) === undefined) {
216
+ oTransientContextForEasyFill.setProperty(sKey, oLLMData[sKey]);
217
+ }
149
218
  } else {
150
- // Non-editable fields: bound to the original OP context, display only
219
+ // Fallback: without transient context, bind to original OP context.
151
220
  oSmartField.setBindingContext(oObjectPageContext);
152
221
  }
153
222
 
223
+ // Previous value is always shown from the original ObjectPage context.
224
+ oSmartFieldPrev.setBindingContext(oObjectPageContext);
225
+
154
226
  // Build the GroupElement: [label+primary SmartField] [Previously: label] [preview SmartField]
155
227
  oGroupElement.addElement(oSmartField); // SmartField provides the label
156
228
  oGroupElement.addElement(new Text({
157
- text: "Previously:",
158
- visible: bIsEditable,
229
+ text: sPreviouslyLabel,
159
230
  layoutData: new ColumnElementData({
160
231
  cellsSmall: 3,
161
- cellsLarge: 2
232
+ cellsLarge: 3
162
233
  })
163
- }));
234
+ }).addStyleClass("sapEasyFillPreviouslyLabel"));
164
235
  oGroupElement.addElement(oSmartFieldPrev);
165
236
  oTargetGroup.addGroupElement(oGroupElement);
166
237
  });
167
238
 
239
+ // Trigger initial SmartForm validation now that all SmartFields are rendered
240
+ if (typeof fnOnFieldChange === "function") {
241
+ fnOnFieldChange();
242
+ }
168
243
  oLogger.debug("populateSmartFields: populated " + aFields.length + " fields for group '" + sId + "'");
169
244
  }, 0);
170
245