@openui5/sap.ui.integration 1.99.0 → 1.100.1

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 (291) hide show
  1. package/THIRDPARTY.txt +2 -2
  2. package/package.json +3 -3
  3. package/src/sap/ui/integration/.library +1 -1
  4. package/src/sap/ui/integration/ActionDefinition.js +1 -1
  5. package/src/sap/ui/integration/Designtime.js +1 -1
  6. package/src/sap/ui/integration/Extension.js +1 -1
  7. package/src/sap/ui/integration/Host.js +17 -3
  8. package/src/sap/ui/integration/cards/AdaptiveContent.js +1 -1
  9. package/src/sap/ui/integration/cards/AnalyticalContent.js +13 -1
  10. package/src/sap/ui/integration/cards/AnalyticsCloudContent.js +1 -1
  11. package/src/sap/ui/integration/cards/BaseContent.js +1 -1
  12. package/src/sap/ui/integration/cards/BaseListContent.js +9 -4
  13. package/src/sap/ui/integration/cards/CalendarContent.js +8 -4
  14. package/src/sap/ui/integration/cards/ComponentContent.js +1 -1
  15. package/src/sap/ui/integration/cards/Footer.js +1 -1
  16. package/src/sap/ui/integration/cards/Header.js +1 -1
  17. package/src/sap/ui/integration/cards/ListContent.js +1 -1
  18. package/src/sap/ui/integration/cards/NumericHeader.js +1 -1
  19. package/src/sap/ui/integration/cards/ObjectContent.js +69 -4
  20. package/src/sap/ui/integration/cards/TableContent.js +1 -1
  21. package/src/sap/ui/integration/cards/TimelineContent.js +1 -1
  22. package/src/sap/ui/integration/cards/WebPageContent.js +1 -1
  23. package/src/sap/ui/integration/cards/actions/CardActions.js +15 -7
  24. package/src/sap/ui/integration/cards/actions/HideCardAction.js +36 -0
  25. package/src/sap/ui/integration/cards/actions/ShowCardAction.js +74 -0
  26. package/src/sap/ui/integration/cards/adaptivecards/elements/UI5InputChoiceSet.js +1 -1
  27. package/src/sap/ui/integration/cards/adaptivecards/elements/UI5InputDate.js +1 -1
  28. package/src/sap/ui/integration/cards/adaptivecards/elements/UI5InputNumber.js +1 -1
  29. package/src/sap/ui/integration/cards/adaptivecards/elements/UI5InputText.js +1 -1
  30. package/src/sap/ui/integration/cards/adaptivecards/elements/UI5InputToggle.js +1 -1
  31. package/src/sap/ui/integration/cards/filters/BaseFilter.js +1 -1
  32. package/src/sap/ui/integration/cards/filters/DateRangeFilter.js +3 -2
  33. package/src/sap/ui/integration/cards/filters/FilterBar.js +1 -1
  34. package/src/sap/ui/integration/cards/filters/FilterBarFactory.js +1 -1
  35. package/src/sap/ui/integration/cards/filters/SearchFilter.js +1 -1
  36. package/src/sap/ui/integration/cards/filters/SelectFilter.js +1 -1
  37. package/src/sap/ui/integration/controls/ActionsStrip.js +1 -1
  38. package/src/sap/ui/integration/controls/ActionsToolbar.js +4 -3
  39. package/src/sap/ui/integration/controls/ListContentItem.js +1 -1
  40. package/src/sap/ui/integration/controls/Microchart.js +1 -1
  41. package/src/sap/ui/integration/controls/MicrochartLegend.js +1 -1
  42. package/src/sap/ui/integration/controls/Paginator.js +4 -2
  43. package/src/sap/ui/integration/designtime/baseEditor/BaseEditor.js +6 -4
  44. package/src/sap/ui/integration/designtime/baseEditor/PropertyEditor.js +1 -1
  45. package/src/sap/ui/integration/designtime/baseEditor/PropertyEditors.js +1 -1
  46. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n.properties +11 -2
  47. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_ar.properties +7 -1
  48. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_bg.properties +7 -1
  49. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_ca.properties +7 -1
  50. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_cs.properties +7 -1
  51. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_cy.properties +7 -1
  52. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_da.properties +7 -1
  53. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_de.properties +7 -1
  54. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_el.properties +7 -1
  55. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_en.properties +7 -1
  56. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_en_GB.properties +7 -1
  57. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_en_US_sappsd.properties +7 -1
  58. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_en_US_saprigi.properties +25 -13
  59. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_en_US_saptrc.properties +7 -1
  60. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_es.properties +7 -1
  61. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_es_MX.properties +7 -1
  62. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_et.properties +7 -1
  63. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_fi.properties +7 -1
  64. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_fr.properties +7 -1
  65. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_fr_CA.properties +7 -1
  66. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_hi.properties +7 -1
  67. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_hr.properties +7 -1
  68. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_hu.properties +7 -1
  69. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_id.properties +7 -1
  70. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_it.properties +7 -1
  71. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_iw.properties +7 -1
  72. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_ja.properties +7 -1
  73. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_kk.properties +7 -1
  74. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_ko.properties +7 -1
  75. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_lt.properties +7 -1
  76. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_lv.properties +7 -1
  77. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_ms.properties +7 -1
  78. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_nl.properties +7 -1
  79. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_no.properties +7 -1
  80. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_pl.properties +7 -1
  81. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_pt.properties +7 -1
  82. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_pt_PT.properties +7 -1
  83. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_ro.properties +7 -1
  84. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_ru.properties +7 -1
  85. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_sh.properties +7 -1
  86. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_sk.properties +7 -1
  87. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_sl.properties +7 -1
  88. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_sv.properties +7 -1
  89. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_th.properties +7 -1
  90. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_tr.properties +7 -1
  91. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_uk.properties +7 -1
  92. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_vi.properties +7 -1
  93. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_zh_CN.properties +7 -1
  94. package/src/sap/ui/integration/designtime/baseEditor/i18n/i18n_zh_TW.properties +7 -1
  95. package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/BasePropertyEditor.js +1 -1
  96. package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/PropertyEditorFactory.js +1 -1
  97. package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/arrayEditor/ArrayEditor.js +1 -1
  98. package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/booleanEditor/BooleanEditor.js +1 -1
  99. package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/dateEditor/DateEditor.js +1 -1
  100. package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/dateTimeEditor/DateTimeEditor.js +1 -1
  101. package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/enumStringEditor/EnumStringEditor.js +1 -1
  102. package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/groupEditor/GroupEditor.js +1 -1
  103. package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/iconEditor/IconEditor.js +1 -1
  104. package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/iconEditor/IsInIconPool.validator.js +1 -1
  105. package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/integerEditor/IntegerEditor.js +1 -1
  106. package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/jsonEditor/JsonEditor.js +1 -1
  107. package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/listEditor/ListEditor.js +1 -1
  108. package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/mapEditor/MapEditor.js +11 -3
  109. package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/multiSelectEditor/MultiSelectEditor.js +1 -1
  110. package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/numberEditor/NumberEditor.js +1 -1
  111. package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/objectArrayEditor/ObjectArrayEditor.fragment.xml +14 -0
  112. package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/objectArrayEditor/ObjectArrayEditor.js +102 -0
  113. package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/selectEditor/SelectEditor.js +1 -1
  114. package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/separatorEditor/SeparatorEditor.js +1 -1
  115. package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/stringEditor/StringEditor.js +1 -1
  116. package/src/sap/ui/integration/designtime/baseEditor/propertyEditor/textAreaEditor/TextAreaEditor.js +5 -2
  117. package/src/sap/ui/integration/designtime/baseEditor/util/StylesheetManager.js +1 -1
  118. package/src/sap/ui/integration/designtime/baseEditor/util/binding/ObjectBinding.js +1 -1
  119. package/src/sap/ui/integration/designtime/baseEditor/util/createPromise.js +1 -1
  120. package/src/sap/ui/integration/designtime/baseEditor/util/unset.js +1 -1
  121. package/src/sap/ui/integration/designtime/baseEditor/validator/IsBoolean.js +1 -1
  122. package/src/sap/ui/integration/designtime/baseEditor/validator/IsDate.js +1 -1
  123. package/src/sap/ui/integration/designtime/baseEditor/validator/IsInteger.js +1 -1
  124. package/src/sap/ui/integration/designtime/baseEditor/validator/IsNumber.js +1 -1
  125. package/src/sap/ui/integration/designtime/baseEditor/validator/IsSelectedKey.js +1 -1
  126. package/src/sap/ui/integration/designtime/baseEditor/validator/IsStringList.js +1 -1
  127. package/src/sap/ui/integration/designtime/baseEditor/validator/IsUniqueKey.js +1 -1
  128. package/src/sap/ui/integration/designtime/baseEditor/validator/IsUniqueList.js +1 -1
  129. package/src/sap/ui/integration/designtime/baseEditor/validator/IsValidBinding.js +1 -1
  130. package/src/sap/ui/integration/designtime/baseEditor/validator/MaxLength.js +1 -1
  131. package/src/sap/ui/integration/designtime/baseEditor/validator/NotABinding.js +1 -1
  132. package/src/sap/ui/integration/designtime/baseEditor/validator/ValidatorRegistry.js +2 -2
  133. package/src/sap/ui/integration/designtime/cardEditor/BASEditor.js +22 -21
  134. package/src/sap/ui/integration/designtime/cardEditor/config/index.js +3 -1
  135. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n.properties +6 -0
  136. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_ar.properties +4 -0
  137. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_bg.properties +4 -0
  138. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_ca.properties +4 -0
  139. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_cs.properties +4 -0
  140. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_cy.properties +4 -0
  141. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_da.properties +4 -0
  142. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_de.properties +4 -0
  143. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_el.properties +4 -0
  144. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_en.properties +4 -0
  145. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_en_GB.properties +4 -0
  146. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_en_US_sappsd.properties +4 -0
  147. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_en_US_saprigi.properties +48 -0
  148. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_en_US_saptrc.properties +4 -0
  149. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_es.properties +4 -0
  150. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_es_MX.properties +4 -0
  151. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_et.properties +4 -0
  152. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_fi.properties +4 -0
  153. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_fr.properties +4 -0
  154. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_fr_CA.properties +4 -0
  155. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_hi.properties +4 -0
  156. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_hr.properties +4 -0
  157. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_hu.properties +4 -0
  158. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_id.properties +4 -0
  159. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_it.properties +4 -0
  160. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_iw.properties +4 -0
  161. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_ja.properties +4 -0
  162. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_kk.properties +4 -0
  163. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_ko.properties +4 -0
  164. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_lt.properties +4 -0
  165. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_lv.properties +4 -0
  166. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_ms.properties +4 -0
  167. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_nl.properties +4 -0
  168. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_no.properties +4 -0
  169. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_pl.properties +4 -0
  170. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_pt.properties +4 -0
  171. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_pt_PT.properties +4 -0
  172. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_ro.properties +4 -0
  173. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_ru.properties +4 -0
  174. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_sh.properties +4 -0
  175. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_sk.properties +4 -0
  176. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_sl.properties +4 -0
  177. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_sv.properties +4 -0
  178. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_th.properties +4 -0
  179. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_tr.properties +4 -0
  180. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_uk.properties +4 -0
  181. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_vi.properties +4 -0
  182. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_zh_CN.properties +4 -0
  183. package/src/sap/ui/integration/designtime/cardEditor/i18n/i18n_zh_TW.properties +4 -0
  184. package/src/sap/ui/integration/designtime/cardEditor/propertyEditor/complexMapEditor/ComplexMapEditor.js +1 -1
  185. package/src/sap/ui/integration/designtime/cardEditor/propertyEditor/destinationsEditor/DestinationsEditor.js +1 -1
  186. package/src/sap/ui/integration/designtime/cardEditor/propertyEditor/filtersEditor/FiltersEditor.js +1 -1
  187. package/src/sap/ui/integration/designtime/cardEditor/propertyEditor/iconEditor/IconEditor.js +1 -1
  188. package/src/sap/ui/integration/designtime/cardEditor/propertyEditor/parametersEditor/ParametersEditor.js +14 -3
  189. package/src/sap/ui/integration/designtime/editor/CardEditor.js +2 -2
  190. package/src/sap/ui/integration/designtime/editor/CardPreview.js +1 -1
  191. package/src/sap/ui/integration/editor/Editor.js +604 -219
  192. package/src/sap/ui/integration/editor/EditorResourceBundles.js +1 -1
  193. package/src/sap/ui/integration/editor/Extension.js +1 -1
  194. package/src/sap/ui/integration/editor/Manifest.js +1 -1
  195. package/src/sap/ui/integration/editor/Settings.js +1 -1
  196. package/src/sap/ui/integration/editor/css/Editor.css +97 -4
  197. package/src/sap/ui/integration/editor/fields/BaseField.js +1 -1
  198. package/src/sap/ui/integration/editor/fields/BooleanField.js +1 -1
  199. package/src/sap/ui/integration/editor/fields/DateField.js +1 -1
  200. package/src/sap/ui/integration/editor/fields/DateTimeField.js +1 -1
  201. package/src/sap/ui/integration/editor/fields/DestinationField.js +1 -1
  202. package/src/sap/ui/integration/editor/fields/IntegerField.js +16 -2
  203. package/src/sap/ui/integration/editor/fields/NumberField.js +1 -1
  204. package/src/sap/ui/integration/editor/fields/ObjectField.js +1239 -0
  205. package/src/sap/ui/integration/editor/fields/ObjectListField.js +360 -0
  206. package/src/sap/ui/integration/editor/fields/StringField.js +3 -1
  207. package/src/sap/ui/integration/editor/fields/{ListField.js → StringListField.js} +57 -57
  208. package/src/sap/ui/integration/editor/fields/viz/ColorSelect.js +1 -1
  209. package/src/sap/ui/integration/editor/fields/viz/IconSelect.js +1 -1
  210. package/src/sap/ui/integration/editor/fields/viz/ShapeSelect.js +1 -1
  211. package/src/sap/ui/integration/formatters/InitialsFormatter.js +38 -0
  212. package/src/sap/ui/integration/library.js +17 -3
  213. package/src/sap/ui/integration/messagebundle.properties +72 -0
  214. package/src/sap/ui/integration/messagebundle_ar.properties +48 -0
  215. package/src/sap/ui/integration/messagebundle_bg.properties +48 -0
  216. package/src/sap/ui/integration/messagebundle_ca.properties +48 -0
  217. package/src/sap/ui/integration/messagebundle_cs.properties +48 -0
  218. package/src/sap/ui/integration/messagebundle_cy.properties +48 -0
  219. package/src/sap/ui/integration/messagebundle_da.properties +48 -0
  220. package/src/sap/ui/integration/messagebundle_de.properties +48 -0
  221. package/src/sap/ui/integration/messagebundle_el.properties +48 -0
  222. package/src/sap/ui/integration/messagebundle_en.properties +48 -0
  223. package/src/sap/ui/integration/messagebundle_en_GB.properties +48 -0
  224. package/src/sap/ui/integration/messagebundle_en_US_sappsd.properties +48 -0
  225. package/src/sap/ui/integration/messagebundle_en_US_saprigi.properties +139 -55
  226. package/src/sap/ui/integration/messagebundle_en_US_saptrc.properties +48 -0
  227. package/src/sap/ui/integration/messagebundle_es.properties +48 -0
  228. package/src/sap/ui/integration/messagebundle_es_MX.properties +48 -0
  229. package/src/sap/ui/integration/messagebundle_et.properties +48 -0
  230. package/src/sap/ui/integration/messagebundle_fi.properties +48 -0
  231. package/src/sap/ui/integration/messagebundle_fr.properties +48 -0
  232. package/src/sap/ui/integration/messagebundle_fr_CA.properties +48 -0
  233. package/src/sap/ui/integration/messagebundle_hi.properties +48 -0
  234. package/src/sap/ui/integration/messagebundle_hr.properties +48 -0
  235. package/src/sap/ui/integration/messagebundle_hu.properties +48 -0
  236. package/src/sap/ui/integration/messagebundle_id.properties +48 -0
  237. package/src/sap/ui/integration/messagebundle_it.properties +48 -0
  238. package/src/sap/ui/integration/messagebundle_iw.properties +48 -0
  239. package/src/sap/ui/integration/messagebundle_ja.properties +48 -0
  240. package/src/sap/ui/integration/messagebundle_kk.properties +48 -0
  241. package/src/sap/ui/integration/messagebundle_ko.properties +48 -0
  242. package/src/sap/ui/integration/messagebundle_lt.properties +48 -0
  243. package/src/sap/ui/integration/messagebundle_lv.properties +48 -0
  244. package/src/sap/ui/integration/messagebundle_ms.properties +48 -0
  245. package/src/sap/ui/integration/messagebundle_nl.properties +48 -0
  246. package/src/sap/ui/integration/messagebundle_no.properties +48 -0
  247. package/src/sap/ui/integration/messagebundle_pl.properties +48 -0
  248. package/src/sap/ui/integration/messagebundle_pt.properties +48 -0
  249. package/src/sap/ui/integration/messagebundle_pt_PT.properties +48 -0
  250. package/src/sap/ui/integration/messagebundle_ro.properties +48 -0
  251. package/src/sap/ui/integration/messagebundle_ru.properties +48 -0
  252. package/src/sap/ui/integration/messagebundle_sh.properties +48 -0
  253. package/src/sap/ui/integration/messagebundle_sk.properties +48 -0
  254. package/src/sap/ui/integration/messagebundle_sl.properties +48 -0
  255. package/src/sap/ui/integration/messagebundle_sv.properties +48 -0
  256. package/src/sap/ui/integration/messagebundle_th.properties +48 -0
  257. package/src/sap/ui/integration/messagebundle_tr.properties +48 -0
  258. package/src/sap/ui/integration/messagebundle_uk.properties +48 -0
  259. package/src/sap/ui/integration/messagebundle_vi.properties +48 -0
  260. package/src/sap/ui/integration/messagebundle_zh_CN.properties +48 -0
  261. package/src/sap/ui/integration/messagebundle_zh_TW.properties +48 -0
  262. package/src/sap/ui/integration/model/ContextModel.js +1 -1
  263. package/src/sap/ui/integration/model/ObservableModel.js +1 -1
  264. package/src/sap/ui/integration/model/PagingModelListBinding.js +1 -1
  265. package/src/sap/ui/integration/sap-ui-integration-define-nojQuery.js +2 -1
  266. package/src/sap/ui/integration/schemas/sap-card.json +69 -9
  267. package/src/sap/ui/integration/themes/base/Footer.less +1 -0
  268. package/src/sap/ui/integration/themes/base/ObjectContent.less +16 -0
  269. package/src/sap/ui/integration/themes/base/Paginator.less +33 -11
  270. package/src/sap/ui/integration/util/BaseFactory.js +1 -1
  271. package/src/sap/ui/integration/util/BindingHelper.js +13 -6
  272. package/src/sap/ui/integration/util/BindingResolver.js +1 -1
  273. package/src/sap/ui/integration/util/CacheAndRequestDataProvider.js +4 -30
  274. package/src/sap/ui/integration/util/CardObserver.js +1 -1
  275. package/src/sap/ui/integration/util/ContentFactory.js +1 -1
  276. package/src/sap/ui/integration/util/CsrfTokenHandler.js +1 -1
  277. package/src/sap/ui/integration/util/DataProvider.js +1 -1
  278. package/src/sap/ui/integration/util/DataProviderFactory.js +8 -1
  279. package/src/sap/ui/integration/util/Destinations.js +4 -2
  280. package/src/sap/ui/integration/util/ExtensionDataProvider.js +1 -1
  281. package/src/sap/ui/integration/util/HeaderFactory.js +6 -1
  282. package/src/sap/ui/integration/util/JSONBindingHelper.js +1 -1
  283. package/src/sap/ui/integration/util/LoadingProvider.js +3 -3
  284. package/src/sap/ui/integration/util/Manifest.js +7 -3
  285. package/src/sap/ui/integration/util/ManifestResolver.js +0 -1
  286. package/src/sap/ui/integration/util/RequestDataProvider.js +31 -5
  287. package/src/sap/ui/integration/util/ServiceDataProvider.js +1 -1
  288. package/src/sap/ui/integration/util/ServiceManager.js +1 -1
  289. package/src/sap/ui/integration/util/SkeletonCard.js +1 -1
  290. package/src/sap/ui/integration/util/Utils.js +1 -1
  291. package/src/sap/ui/integration/widgets/Card.js +172 -36
@@ -0,0 +1,1239 @@
1
+ /*!
2
+ * OpenUI5
3
+ * (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
4
+ * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
+ */
6
+
7
+ sap.ui.define([
8
+ "sap/ui/integration/editor/fields/BaseField",
9
+ "sap/m/Text",
10
+ "sap/m/TextArea",
11
+ "sap/m/Title",
12
+ "sap/m/Input",
13
+ "sap/m/Popover",
14
+ "sap/m/OverflowToolbar",
15
+ "sap/m/ToolbarSpacer",
16
+ "sap/m/Button",
17
+ "sap/ui/core/Core",
18
+ "sap/ui/model/json/JSONModel",
19
+ "sap/ui/table/Table",
20
+ "sap/ui/table/Column",
21
+ "sap/m/Label",
22
+ "sap/m/HBox",
23
+ "sap/ui/model/Filter",
24
+ "sap/ui/model/FilterOperator",
25
+ "sap/base/util/deepEqual",
26
+ "sap/ui/core/Icon",
27
+ "sap/m/Switch",
28
+ "sap/m/CheckBox",
29
+ "sap/base/util/deepClone",
30
+ "sap/m/Link",
31
+ "sap/ui/layout/form/SimpleForm",
32
+ "sap/base/util/merge"
33
+ ], function (
34
+ BaseField,
35
+ Text,
36
+ TextArea,
37
+ Title,
38
+ Input,
39
+ Popover,
40
+ OverflowToolbar,
41
+ ToolbarSpacer,
42
+ Button,
43
+ Core,
44
+ JSONModel,
45
+ Table,
46
+ Column,
47
+ Label,
48
+ HBox,
49
+ Filter,
50
+ FilterOperator,
51
+ deepEqual,
52
+ Icon,
53
+ Switch,
54
+ CheckBox,
55
+ deepClone,
56
+ Link,
57
+ SimpleForm,
58
+ merge
59
+ ) {
60
+ "use strict";
61
+ var oResourceBundle = Core.getLibraryResourceBundle("sap.ui.integration");
62
+ var REGEXP_TRANSLATABLE = /\{\{(?!parameters.)(?!destinations.)([^\}\}]+)\}\}/g;
63
+
64
+ /**
65
+ * @class Object Field with object value such as {"key": "key1"}
66
+ * @extends sap.ui.integration.editor.fields.BaseField
67
+ * @alias sap.ui.integration.editor.fields.ObjectField
68
+ * @author SAP SE
69
+ * @since 1.100.0
70
+ * @version 1.100.1
71
+ * @private
72
+ * @experimental since 1.100.0
73
+ * @ui5-restricted
74
+ * @constructor
75
+ */
76
+ var ObjectField = BaseField.extend("sap.ui.integration.editor.fields.ObjectField", {
77
+ metadata: {
78
+ library: "sap.ui.integration"
79
+ },
80
+ renderer: BaseField.getMetadata().getRenderer()
81
+ });
82
+
83
+ ObjectField.prototype.initVisualization = function (oConfig) {
84
+ var that = this;
85
+ that._newObjectTemplate = {};
86
+ var oVisualization = oConfig.visualization;
87
+ if (!oVisualization) {
88
+ if (oConfig.value && !oConfig.properties && (!oConfig.values || (oConfig.values && !oConfig.values.metadata))) {
89
+ that.parseValueProperties();
90
+ }
91
+ if (oConfig.values) {
92
+ oVisualization = that.createTableVisualization(oConfig);
93
+ } else if (oConfig.properties) {
94
+ oVisualization = that.createSimpleFormVisualization(oConfig);
95
+ } else {
96
+ oVisualization = that.createTextAreaVisualization(oConfig);
97
+ }
98
+ oConfig.withLabel = true;
99
+ }
100
+ this._visualization = oVisualization;
101
+ this.attachAfterInit(this._afterInit);
102
+ };
103
+
104
+ ObjectField.prototype._afterInit = function () {
105
+ var that = this;
106
+ var oControl = this.getAggregation("_field");
107
+ if (oControl instanceof SimpleForm) {
108
+ oControl.addStyleClass("sapUiIntegrationEditorItemObjectFieldForm");
109
+ var oValue = deepClone(that.getConfiguration().value, 500) || {};
110
+ oControl.setModel(new JSONModel({
111
+ value: oValue,
112
+ editMode: "Properties" // "Properties", "Json"
113
+ }));
114
+ } else if (oControl instanceof Table) {
115
+ oControl.addStyleClass("sapUiIntegrationEditorItemObjectFieldTable");
116
+ }
117
+ };
118
+
119
+ ObjectField.prototype.parseValueProperties = function() {
120
+ var that = this;
121
+ var oConfig = that.getConfiguration();
122
+ if (typeof oConfig.value === "object" && !deepEqual(oConfig.value, {}) && !Array.isArray(oConfig.value) && !oConfig.properties) {
123
+ var oProperties = {};
124
+ for (var n in oConfig.value) {
125
+ var sType = typeof oConfig.value[n];
126
+ var oProperty = sType === "string" ? {} : {"type": sType};
127
+ oProperties[n] = oProperty;
128
+ }
129
+ if (!deepEqual(oProperties, {})) {
130
+ oConfig.properties = oProperties;
131
+ oConfig._propertiesParsedFromValue = true;
132
+ }
133
+ }
134
+ };
135
+
136
+ ObjectField.prototype.createTableVisualization = function(oConfig) {
137
+ var that = this;
138
+ var oTableToolbar = that.createTableToolbar(oConfig);
139
+ var columns = [];
140
+ var sPath = oConfig.values ? oConfig.values.data.path || "/" : "/value";
141
+ if (oConfig.values && oConfig.values.metadata) {
142
+ columns = {
143
+ path: 'meta>/' + oConfig.values.metadata.namespace + '.' + oConfig.values.metadata.entityTypeName,
144
+ filters: new Filter({
145
+ path: "$kind",
146
+ operator: FilterOperator.EQ,
147
+ value1: "Property"
148
+ }),
149
+ factory: that.columnFactory.bind(that)
150
+ };
151
+ } else {
152
+ columns = that.buildTableColumns();
153
+ }
154
+ var oVisualization = {
155
+ type: Table,
156
+ settings: {
157
+ rows: "{" + sPath + "}",
158
+ selectionMode: "MultiToggle",
159
+ enableSelectAll: that._bIsEnableSelectAllInTable === true,
160
+ visibleRowCount: 5,
161
+ busy: "{currentSettings>_loading}",
162
+ columns: columns,
163
+ rowSelectionChange: that.onSelectionChange.bind(that),
164
+ toolbar: oTableToolbar,
165
+ filter: that.onFilter.bind(that)
166
+ }
167
+ };
168
+ return oVisualization;
169
+ };
170
+
171
+ ObjectField.prototype.createSimpleFormVisualization = function(oConfig) {
172
+ var that = this;
173
+ var fnChange = function() {
174
+ var oModel = this.getAggregation("_field").getModel();
175
+ oModel.checkUpdate(true);
176
+ var oValue = oModel.getProperty("/value");
177
+ oValue = deepClone(oValue, 500);
178
+ this._setCurrentProperty("value", oValue);
179
+ }.bind(that);
180
+ var aObjectPropertyFormContents = that.createFormContents(fnChange, "/value/");
181
+ var oEditModeButton = new Button({
182
+ icon: {
183
+ path: '/editMode',
184
+ formatter: function(oEditMode) {
185
+ if (oEditMode === "Properties") {
186
+ return "sap-icon://syntax";
187
+ } else {
188
+ return "sap-icon://form";
189
+ }
190
+ }
191
+ },
192
+ tooltip: {
193
+ path: '/editMode',
194
+ formatter: function(oEditMode) {
195
+ if (oEditMode === "Properties") {
196
+ return oResourceBundle.getText("EDITOR_FIELD_OBJECT_FORM_EDITMODE_JSON");
197
+ } else {
198
+ return oResourceBundle.getText("EDITOR_FIELD_OBJECT_FORM_EDITMODE_PROPERTIES");
199
+ }
200
+ }
201
+ },
202
+ press: function() {
203
+ var oModel = that.getAggregation("_field").getModel();
204
+ var sEditMode = oModel.getProperty("/editMode");
205
+ if (sEditMode === "Properties") {//"Properties", "Json" {
206
+ oModel.setProperty("/editMode", "Json");
207
+ } else {
208
+ oModel.setProperty("/editMode", "Properties");
209
+ }
210
+ }
211
+ });
212
+ var oDeleteButon = new Button({
213
+ icon: "sap-icon://delete",
214
+ tooltip: oResourceBundle.getText("EDITOR_FIELD_OBJECT_DELETE"),
215
+ visible: oConfig.enabled,
216
+ enabled: {
217
+ path: 'currentSettings>value',
218
+ formatter: function(vValue) {
219
+ if (!vValue || vValue === "") {
220
+ return false;
221
+ }
222
+ return true;
223
+ }
224
+ },
225
+ press: function (oEvent) {
226
+ that._setCurrentProperty("value", undefined);
227
+ var oModel = that.getAggregation("_field").getModel();
228
+ oModel.setProperty("/value", {});
229
+ oModel.checkUpdate(true);
230
+ }
231
+ });
232
+ var oVisualization = {
233
+ type: SimpleForm,
234
+ settings: {
235
+ layout: "ResponsiveGridLayout",
236
+ visible: oConfig.visible,
237
+ labelSpanXL: 2,
238
+ labelSpanL: 2,
239
+ labelSpanM: 2,
240
+ //labelSpanS: "{= ${/editMode} === 'Properties' ? 2 : 12}",
241
+ labelSpanS: 12,
242
+ emptySpanXL: 1,
243
+ emptySpanL: 1,
244
+ emptySpanM: 1,
245
+ emptySpanS: 0,
246
+ columnsXL: 1,
247
+ columnsL: 1,
248
+ columnsM: 1,
249
+ toolbar: new OverflowToolbar({
250
+ content: [
251
+ new ToolbarSpacer(),
252
+ oEditModeButton,
253
+ oDeleteButon
254
+ ]
255
+ }).addStyleClass("sapMTB"),
256
+ content: aObjectPropertyFormContents
257
+ }
258
+ };
259
+ return oVisualization;
260
+ };
261
+
262
+ ObjectField.prototype.createTextAreaVisualization = function(oConfig) {
263
+ var that = this;
264
+ var oVisualization = {
265
+ type: TextArea,
266
+ settings: {
267
+ value: {
268
+ path: 'currentSettings>value',
269
+ formatter: function(vValue) {
270
+ if (!vValue || vValue === "") {
271
+ return undefined;
272
+ }
273
+ vValue = JSON.stringify(vValue, null, "\t");
274
+ if (typeof vValue === "object" && !vValue.length) {
275
+ vValue = vValue.replace(/\"\$\$([a-zA-Z]*)\$\$\"/g, function (s) {
276
+ return s.substring(3, s.length - 3);
277
+ });
278
+ }
279
+ return vValue;
280
+ }
281
+ },
282
+ editable: "{config/editable}",
283
+ width: "100%",
284
+ enabled: "{config/enabled}",
285
+ placeholder: "{config/placeholder}",
286
+ visible: oConfig.visible,
287
+ change: this.onChangeOfTextArea.bind(that),
288
+ rows: 7
289
+ }
290
+ };
291
+ return oVisualization;
292
+ };
293
+
294
+ ObjectField.prototype.buildTableColumns = function() {
295
+ var that = this;
296
+ var oConfig = that.getConfiguration();
297
+ var aColumns = [];
298
+ var oCardResourceBundle = that.getModel("i18n").getResourceBundle();
299
+ for (var n in oConfig.properties) {
300
+ var oProperty = oConfig.properties[n];
301
+ var sDefaultLabel = oProperty.label || n;
302
+ var sDefaultValue = "{" + n + "}";
303
+ if (oProperty.defaultValue) {
304
+ that._newObjectTemplate[n] = oProperty.defaultValue;
305
+ }
306
+ var oColumnSettings = {
307
+ "width": "7rem",
308
+ "label": sDefaultLabel
309
+ };
310
+ if (oProperty.column) {
311
+ oColumnSettings = merge(oColumnSettings, oProperty.column);
312
+ }
313
+ // change translate syntax {{KEY}} to {i18n>KEY}
314
+ if (oColumnSettings.label.match(REGEXP_TRANSLATABLE)) {
315
+ oColumnSettings.label = "{i18n>" + oColumnSettings.label.substring(2, oColumnSettings.label.length - 1);
316
+ }
317
+ oColumnSettings.tooltip = oColumnSettings.label;
318
+
319
+ var sCellType = oProperty.cell && oProperty.cell.type ? oProperty.cell.type : oProperty.type || "Text";
320
+ var oCellTemplate;
321
+ var oCellSettings;
322
+ var oCell = deepClone(oProperty.cell) || {};
323
+ delete oCell.type;
324
+ switch (sCellType) {
325
+ case "int":
326
+ case "number":
327
+ oCellSettings = {
328
+ text: sDefaultValue,
329
+ wrapping: false
330
+ };
331
+ oCellSettings = merge(oCellSettings, oCell);
332
+ oCellTemplate = new Text(oCellSettings);
333
+ break;
334
+ case "string":
335
+ case "Text":
336
+ oCellSettings = {
337
+ text: sDefaultValue,
338
+ tooltip: sDefaultValue,
339
+ wrapping: false
340
+ };
341
+ oCellSettings = merge(oCellSettings, oCell);
342
+ var oText = oCellSettings.text;
343
+ if (typeof oText === "string") {
344
+ if (oText.match(REGEXP_TRANSLATABLE)) {
345
+ // check the text property, if it match syntax {{KEY}}, translate it
346
+ oCellSettings.text = oCardResourceBundle.getText(oText.substring(2, oText.length - 2));
347
+ } else if (oText.startsWith("{i18n>") && oText.endsWith('}')) {
348
+ // check the text property, if it match syntax {i18n>KEY}, translate it
349
+ oCellSettings.text = oCardResourceBundle.getText(oText.substring(6, oText.length - 1));
350
+ } else if (oText.startsWith('{') && oText.endsWith('}')) {
351
+ oCellSettings.text = {
352
+ path: oText.substring(1, oText.length - 1),
353
+ formatter: function(oValue) {
354
+ if (!oValue) {
355
+ return undefined;
356
+ } else if (oValue.match(REGEXP_TRANSLATABLE)) {
357
+ // check the text property, if it match syntax {{KEY}}, translate it
358
+ return oCardResourceBundle.getText(oValue.substring(2, oValue.length - 2));
359
+ } else if (oValue.startsWith("{i18n>") && oValue.endsWith('}')) {
360
+ // check the text property, if it match syntax {i18n>KEY}, translate it
361
+ return oCardResourceBundle.getText(oValue.substring(6, oValue.length - 1));
362
+ }
363
+ return oValue;
364
+ }
365
+ };
366
+ }
367
+ }
368
+ oCellTemplate = new Text(oCellSettings);
369
+ break;
370
+ case "Icon":
371
+ oCellSettings = {
372
+ src: sDefaultValue
373
+ };
374
+ oCellSettings = merge(oCellSettings, oCell);
375
+ oCellTemplate = new Icon(oCellSettings);
376
+ break;
377
+ case "boolean":
378
+ oCellSettings = {
379
+ selected: sDefaultValue,
380
+ enabled: false
381
+ };
382
+ oCellSettings = merge(oCellSettings, oCell);
383
+ oCellTemplate = new CheckBox(oCellSettings);
384
+ break;
385
+ case "Switch":
386
+ oCellSettings = {
387
+ state: sDefaultValue,
388
+ enabled: false
389
+ };
390
+ oCellSettings = merge(oCellSettings, oCell);
391
+ oCellTemplate = new Switch(oCellSettings);
392
+ break;
393
+ case "Link":
394
+ oCellSettings = {
395
+ text: sDefaultValue,
396
+ target: "_blank",
397
+ href: sDefaultValue
398
+ };
399
+ oCellSettings = merge(oCellSettings, oCell);
400
+ oCellTemplate = new Link(oCellSettings);
401
+ break;
402
+ default:
403
+ oCellTemplate = new Text({
404
+ text: sDefaultValue,
405
+ wrapping: false
406
+ });
407
+ break;
408
+ }
409
+ oColumnSettings.template = oCellTemplate;
410
+ var oColumn = new Column(oColumnSettings);
411
+ aColumns.push(oColumn);
412
+ }
413
+ var oActionColumn = that.createActionColumn();
414
+ aColumns.push(oActionColumn);
415
+ return aColumns;
416
+ };
417
+
418
+ ObjectField.prototype.checkHasFilter = function(oConfig) {
419
+ var bHasFilterDefined = true;
420
+ if (oConfig._propertiesParsedFromValue === true) {
421
+ bHasFilterDefined = false;
422
+ } else {
423
+ var sPropertiesString = JSON.stringify(oConfig.properties, null, "\t");
424
+ bHasFilterDefined = sPropertiesString.indexOf("filterProperty") > -1 ? true : false;
425
+ }
426
+ return bHasFilterDefined;
427
+ };
428
+
429
+ ObjectField.prototype.createTableToolbar = function(oConfig) {
430
+ var that = this;
431
+ // check if has filterProperty defined in each column of config.properties
432
+ var bHasFilterDefined = that.checkHasFilter(oConfig);
433
+ var bAddButtonVisible = oConfig.enabled !== false;
434
+ if (bAddButtonVisible && oConfig.values) {
435
+ bAddButtonVisible = oConfig.values.allowCreateNew === true;
436
+ }
437
+ return new OverflowToolbar({
438
+ content: [
439
+ new ToolbarSpacer(),
440
+ new Button({
441
+ icon: "sap-icon://add",
442
+ visible: bAddButtonVisible,
443
+ tooltip: oResourceBundle.getText("EDITOR_FIELD_OBJECT_TABLE_BUTTON_ADD_TOOLTIP"),
444
+ press: that.createNewObject.bind(that)
445
+ }),
446
+ new Button({
447
+ icon: "sap-icon://clear-filter",
448
+ visible: bHasFilterDefined,
449
+ tooltip: oResourceBundle.getText("EDITOR_FIELD_OBJECT_TABLE_BUTTON_CLEAR_ALL_FILTERS_TOOLTIP"),
450
+ press: that.clearAllFilters.bind(that)
451
+ })
452
+ ]
453
+ });
454
+ };
455
+
456
+ ObjectField.prototype.onDelete = function(oEvent) {
457
+ var that = this;
458
+ var oControl = oEvent.getSource();
459
+ var oRow = oControl.getParent().getParent();
460
+ var oTable = oRow.getParent();
461
+ var iRowIndex = oRow.getIndex();
462
+
463
+ // get the real index via path since the rows may be filtered
464
+ var oRowContexts = oTable.getBinding("rows").getContexts();
465
+ var sDeletedObjectPath = oRowContexts[iRowIndex].getPath();
466
+ var iRealIndex = sDeletedObjectPath.substring(sDeletedObjectPath.lastIndexOf("/") + 1);
467
+
468
+ var oParameter;
469
+ var bHasBeforeValue = that.checkHasValue();
470
+ oParameter = {
471
+ selectedIndex: oTable.getSelectedIndex(),
472
+ selectedIndices: oTable.getSelectedIndices(),
473
+ rowIndex: iRowIndex,
474
+ realIndex: iRealIndex
475
+ };
476
+
477
+ // delete object in value model
478
+ var oModel = oTable.getModel();
479
+ var sPath = oTable.getBinding("rows").getPath();
480
+ var oData = oModel.getProperty(sPath);
481
+ oData.splice(iRealIndex, 1);
482
+ oModel.checkUpdate(true);
483
+
484
+ // restore the selections since the selections are lost, BCP: 2280048930, JIRA: CPOUIFTEAMB-252
485
+ if (bHasBeforeValue) {
486
+ that.applyBeforeValueAndSelections("delete", oParameter);
487
+ }
488
+ };
489
+
490
+ ObjectField.prototype.onEditOrViewDetail = function(oEvent) {
491
+ var that = this;
492
+ var oControl = oEvent.getSource();
493
+ var oItem = oControl.getBindingContext().getObject();
494
+ that.openObjectDetailsPopover(oItem, oControl, oItem._editable !== false ? "update" : "view");
495
+ };
496
+
497
+ ObjectField.prototype.onFilter = function(oEvent) {
498
+ var that = this;
499
+ var oControl = oEvent.getSource();
500
+ // restore the selections since the selections are lost, BCP: 2280048930, JIRA: CPOUIFTEAMB-252
501
+ if (that.checkHasValue()) {
502
+ var oParameter = {
503
+ selectedIndex: oControl.getSelectedIndex(),
504
+ selectedIndices: oControl.getSelectedIndices(),
505
+ column: oEvent.getParameter("column")
506
+ };
507
+ that.applyBeforeValueAndSelections("filter", oParameter);
508
+ }
509
+ };
510
+
511
+ ObjectField.prototype.createActionColumn = function() {
512
+ var that = this;
513
+ var oConfig = that.getConfiguration();
514
+ return new Column({
515
+ width: "5rem",
516
+ hAlign: "Center",
517
+ label: new Label({
518
+ text: "Actions",
519
+ tooltip: "Actions"
520
+ }),
521
+ template: new HBox({
522
+ items: [
523
+ new Button({
524
+ type: "Transparent",
525
+ icon: {
526
+ path: '_editable',
527
+ formatter: function(bEditable) {
528
+ if (bEditable === false) {
529
+ return "sap-icon://display";
530
+ } else {
531
+ return "sap-icon://edit";
532
+ }
533
+ }
534
+ },
535
+ tooltip: {
536
+ path: '_editable',
537
+ formatter: function(bEditable) {
538
+ if (bEditable === false) {
539
+ return oResourceBundle.getText("EDITOR_FIELD_OBJECT_TABLE_BUTTON_DISPLAY_TOOLTIP");
540
+ } else {
541
+ return oResourceBundle.getText("EDITOR_FIELD_OBJECT_TABLE_BUTTON_EDIT_TOOLTIP");
542
+ }
543
+ }
544
+ },
545
+ press: that.onEditOrViewDetail.bind(that)
546
+ }),
547
+ new Button({
548
+ type: "Transparent",
549
+ icon: "sap-icon://delete",
550
+ visible: oConfig.editable === false ? false : "{= ${_editable} !== false}",
551
+ tooltip: oResourceBundle.getText("EDITOR_FIELD_OBJECT_DELETE"),
552
+ press: that.onDelete.bind(that)
553
+ })
554
+ ]
555
+ })
556
+ });
557
+ };
558
+
559
+ ObjectField.prototype.columnFactory = function(sId, oContext) {
560
+ var that = this;
561
+ var sPath = oContext.getPath();
562
+ var sName = sPath.substring(oContext.getPath().lastIndexOf("/") + 1);
563
+ var sType = oContext.getProperty("$Type");
564
+ if (sType === "Actions") {
565
+ return that.createActionColumn();
566
+ }
567
+ var iLen = oContext.getProperty("$MaxLength");
568
+ var sColumnWidth = "7rem";
569
+
570
+ iLen = iLen ? parseInt(iLen) : 10;
571
+ iLen = iLen < 7 ? 7 : iLen;
572
+
573
+ if (iLen > 50) {
574
+ sColumnWidth = "15rem";
575
+ } else if (iLen > 9) {
576
+ sColumnWidth = "10rem";
577
+ }
578
+
579
+ return new Column(sId, {
580
+ visible: true,
581
+ filterProperty: sType && sType.indexOf("String") >= 0 ? sName : null,
582
+ width: sColumnWidth,
583
+ label: new Label({text: sName}),
584
+ hAlign: sType && sType.indexOf("Decimal") >= 0 ? "End" : "Begin",
585
+ template: new Text({text: {path: sName}, wrapping: false})
586
+ });
587
+ };
588
+
589
+ ObjectField.prototype.onSelectionChange = function (oEvent) {
590
+ var that = this;
591
+ var oControl = oEvent.getSource();
592
+ var bUserInteraction = oEvent.getParameter("userInteraction") || false;
593
+ // only update data models if is user interaction
594
+ if (bUserInteraction) {
595
+ var oObject,
596
+ oContext;
597
+ var iSelectedIndex = oControl.getSelectedIndex();
598
+ var aSelectedIndices = oControl.getSelectedIndices();
599
+ if (aSelectedIndices.length >= 1) {
600
+ oControl.setSelectedIndex(iSelectedIndex);
601
+ oContext = oControl.getContextByIndex(iSelectedIndex);
602
+ oObject = oContext.getObject();
603
+ oControl._sPathOfFilteredOut = null;
604
+ } else if (oControl._sPathOfFilteredOut) {
605
+ oObject = oControl.getModel().getProperty(oControl._sPathOfFilteredOut);
606
+ }
607
+ that._setCurrentProperty("value", oObject);
608
+ }
609
+ };
610
+
611
+ ObjectField.prototype.createNewObject = function (oEvent) {
612
+ var that = this;
613
+ var oControl = oEvent.getSource();
614
+ that.openObjectDetailsPopover(that._newObjectTemplate, oControl, "create");
615
+ };
616
+
617
+ ObjectField.prototype.mergeValueWithRequestResult = function (tResult) {
618
+ var that = this;
619
+ var oConfig = that.getConfiguration();
620
+ var oTable = that.getAggregation("_field");
621
+ if (oConfig.value && (typeof oConfig.value === "object") && !deepEqual(oConfig.value, {})) {
622
+ var oValue;
623
+ if (Array.isArray(tResult) && tResult.length > 0) {
624
+ if (oConfig.value._editable === false) {
625
+ var iSelectedIndex = -1;
626
+ for (var i = 0; i < tResult.length; i++) {
627
+ oValue = tResult[i];
628
+ if (deepEqual(oValue, oConfig.value)) {
629
+ iSelectedIndex = i;
630
+ break;
631
+ }
632
+ }
633
+ oTable.setSelectedIndex(iSelectedIndex);
634
+ } else {
635
+ tResult.unshift(oConfig.value);
636
+ oTable.getModel().checkUpdate();
637
+ oTable.setSelectedIndex(0);
638
+ }
639
+ } else {
640
+ oValue = deepClone(oConfig.value, 500);
641
+ tResult = [oValue];
642
+ oTable.getModel().checkUpdate();
643
+ oTable.setSelectedIndex(0);
644
+ }
645
+ }
646
+ return tResult;
647
+ };
648
+
649
+ ObjectField.prototype.onChangeOfTextArea = function (oEvent) {
650
+ var that = this;
651
+ var oTextArea = oEvent.getSource();
652
+ var sValue = oTextArea.getValue();
653
+ if (!sValue || sValue === "") {
654
+ that.saveValue(undefined, oTextArea);
655
+ } else {
656
+ try {
657
+ var oValue = JSON.parse(sValue);
658
+ if (oValue instanceof Array) {
659
+ oTextArea.setValueState("Error");
660
+ oTextArea.setValueStateText(oResourceBundle.getText("EDITOR_VAL_NOT_A_SINGLE_JSONOBJECT"));
661
+ return;
662
+ }
663
+ that.saveValue(oValue, oTextArea);
664
+ } catch (e) {
665
+ oTextArea.setValueState("Error");
666
+ oTextArea.setValueStateText(oResourceBundle.getText("EDITOR_VAL_NOT_A_JSONOBJECT"));
667
+ }
668
+ }
669
+ };
670
+
671
+ ObjectField.prototype.onChangeOfTextAreaInPopover = function (oEvent) {
672
+ var that = this;
673
+ var oTextArea = oEvent.getSource();
674
+ var sValue = oTextArea.getValue();
675
+ if (!sValue || sValue === "") {
676
+ that.saveValue(undefined, oTextArea, true);
677
+ } else {
678
+ try {
679
+ var oValue = JSON.parse(sValue);
680
+ if (oValue instanceof Array) {
681
+ oTextArea.setValueState("Error");
682
+ oTextArea.setValueStateText(oResourceBundle.getText("EDITOR_VAL_NOT_A_SINGLE_JSONOBJECT"));
683
+ return;
684
+ }
685
+ that.saveValue(oValue, oTextArea, true);
686
+ } catch (e) {
687
+ oTextArea.setValueState("Error");
688
+ oTextArea.setValueStateText(oResourceBundle.getText("EDITOR_VAL_NOT_A_JSONOBJECT"));
689
+ }
690
+ }
691
+ };
692
+
693
+ ObjectField.prototype.createFormContents = function (fnChange, sPathPrefix, bIsInPopover) {
694
+ var that = this;
695
+ var oConfig = that.getConfiguration();
696
+ var aContentList = that.createPropertyContents(fnChange, sPathPrefix);
697
+ aContentList.push(new Label({
698
+ visible: false
699
+ }).addStyleClass("sapFormLabel"));
700
+ aContentList.push(new TextArea({
701
+ value: {
702
+ path: sPathPrefix,
703
+ formatter: function(vValue) {
704
+ if (!vValue || vValue === "") {
705
+ return undefined;
706
+ }
707
+ if (deepEqual(vValue, {}) && !bIsInPopover && !that._getCurrentProperty("value")) {
708
+ return undefined;
709
+ }
710
+ vValue = JSON.stringify(vValue, null, "\t");
711
+ if (typeof vValue === "object" && !vValue.length) {
712
+ vValue = vValue.replace(/\"\$\$([a-zA-Z]*)\$\$\"/g, function (s) {
713
+ return s.substring(3, s.length - 3);
714
+ });
715
+ }
716
+ return vValue;
717
+ }
718
+ },
719
+ editable: oConfig.editable === false ? false : "{= ${" + sPathPrefix + "_editable} !== false}",
720
+ width: "100%",
721
+ placeholder: "{config/placeholder}",
722
+ visible: "{= ${/editMode} === 'Json'}",
723
+ change: bIsInPopover === true ? this.onChangeOfTextAreaInPopover.bind(that) : this.onChangeOfTextArea.bind(that),
724
+ rows: bIsInPopover === true ? 15 : 7
725
+ }));
726
+ return aContentList;
727
+ };
728
+
729
+ ObjectField.prototype.createPropertyContents = function (fnChange, sPathPrefix) {
730
+ var that = this;
731
+ var oConfig = that.getConfiguration();
732
+ var aPropertyContentList = [];
733
+ if (!sPathPrefix) {
734
+ sPathPrefix = "currentSettings>value/";
735
+ }
736
+ var oProperties = {};
737
+ if (oConfig.values && oConfig.values.metadata) {
738
+ var oMetaModel = that.getModel("meta");
739
+ var sPath = "/" + oConfig.values.metadata.namespace + '.' + oConfig.values.metadata.entityTypeName;
740
+ var oEntityType = oMetaModel.getProperty(sPath);
741
+
742
+ for (var m in oEntityType) {
743
+ var oEntityProperty = oEntityType[m];
744
+ var sType = oEntityProperty['$Type'];
745
+ if (oEntityProperty['$kind'] === "Property" && sType) {
746
+ if (sType.indexOf("Int") >= 0) {
747
+ oProperties[m] = {
748
+ type: "int"
749
+ };
750
+ } else if (sType.indexOf("Boolean") >= 0) {
751
+ oProperties[m] = {
752
+ type: "boolean"
753
+ };
754
+ } else if (sType.indexOf("Decimal") >= 0) {
755
+ oProperties[m] = {
756
+ type: "number"
757
+ };
758
+ } else if (sType !== "Actions") {
759
+ oProperties[m] = {
760
+ type: "string"
761
+ };
762
+ }
763
+ }
764
+ }
765
+ }
766
+ if (deepEqual(oProperties, {})) {
767
+ oProperties = oConfig.properties;
768
+ }
769
+ for (var n in oProperties) {
770
+ var oProperty = oProperties[n];
771
+ var sLabelText = oProperty.label || n;
772
+ // change translate syntax {{KEY}} to {i18n>KEY}
773
+ if (sLabelText.match(REGEXP_TRANSLATABLE)) {
774
+ var sLabelKey = sLabelText.substring(2, sLabelText.length - 2);
775
+ sLabelText = "{i18n>" + sLabelKey + "}";
776
+ }
777
+ var oLable = new Label({
778
+ text: sLabelText,
779
+ visible: "{= ${/editMode} === 'Properties'}",
780
+ required: oProperty.required || false
781
+ //wrapping: false
782
+ });
783
+ aPropertyContentList.push(oLable);
784
+ var oValueControl;
785
+ switch (oProperty.type) {
786
+ case "boolean":
787
+ if (oProperty.cell && oProperty.cell.type === "Switch") {
788
+ var oSettings = {
789
+ state: "{" + sPathPrefix + n + "}",
790
+ visible: "{= ${/editMode} === 'Properties'}",
791
+ enabled: oConfig.editable === false ? false : "{= ${" + sPathPrefix + "_editable} !== false}",
792
+ change: fnChange
793
+ };
794
+ if (oProperty.cell.customTextOn) {
795
+ oSettings.customTextOn = oProperty.cell.customTextOn;
796
+ }
797
+ if (oProperty.cell.customTextOff) {
798
+ oSettings.customTextOff = oProperty.cell.customTextOff;
799
+ }
800
+ oValueControl = new Switch(oSettings);
801
+ } else {
802
+ oValueControl = new CheckBox({
803
+ selected: "{" + sPathPrefix + n + "}",
804
+ visible: "{= ${/editMode} === 'Properties'}",
805
+ enabled: oConfig.editable === false ? false : "{= ${" + sPathPrefix + "_editable} !== false}",
806
+ select: fnChange
807
+ });
808
+ }
809
+ break;
810
+ case "int":
811
+ case "integer":
812
+ oValueControl = new Input({
813
+ value: {
814
+ path: sPathPrefix + n,
815
+ type: "sap.ui.model.type.Integer",
816
+ formatOptions: oProperty.formatter
817
+ },
818
+ visible: "{= ${/editMode} === 'Properties'}",
819
+ editable: oConfig.editable === false ? false : "{= ${" + sPathPrefix + "_editable} !== false}",
820
+ type: "Number",
821
+ change: fnChange
822
+ });
823
+ break;
824
+ case "number":
825
+ oValueControl = new Input({
826
+ value: {
827
+ path: sPathPrefix + n,
828
+ type: "sap.ui.model.type.Float",
829
+ formatOptions: oProperty.formatter
830
+ },
831
+ visible: "{= ${/editMode} === 'Properties'}",
832
+ editable: oConfig.editable === false ? false : "{= ${" + sPathPrefix + "_editable} !== false}",
833
+ type: "Number",
834
+ change: fnChange
835
+ });
836
+ break;
837
+ case "object":
838
+ oValueControl = new TextArea({
839
+ value: {
840
+ path: sPathPrefix + n,
841
+ formatter: function(vValue) {
842
+ if (!vValue || vValue === "") {
843
+ return undefined;
844
+ }
845
+ vValue = JSON.stringify(vValue, null, "\t");
846
+ if (typeof vValue === "object" && !vValue.length) {
847
+ vValue = vValue.replace(/\"\$\$([a-zA-Z]*)\$\$\"/g, function (s) {
848
+ return s.substring(3, s.length - 3);
849
+ });
850
+ }
851
+ return vValue;
852
+ }
853
+ },
854
+ visible: "{= ${/editMode} === 'Properties'}",
855
+ editable: oConfig.editable === false ? false : "{= ${" + sPathPrefix + "_editable} !== false}",
856
+ change: fnChange,
857
+ rows: 3
858
+ });
859
+ break;
860
+ default:
861
+ oValueControl = new Input({
862
+ value: "{" + sPathPrefix + n + "}",
863
+ visible: "{= ${/editMode} === 'Properties'}",
864
+ editable: oConfig.editable === false ? false : "{= ${" + sPathPrefix + "_editable} !== false}",
865
+ change: fnChange
866
+ });
867
+ }
868
+ aPropertyContentList.push(oValueControl);
869
+ }
870
+ return aPropertyContentList;
871
+ };
872
+
873
+ ObjectField.prototype.saveValue = function (oValue, oTextArea, bIsInDetailsPopover) {
874
+ var that = this;
875
+ var oValueModel;
876
+ if (!bIsInDetailsPopover) {
877
+ that._setCurrentProperty("value", oValue);
878
+ oValueModel = that.getAggregation("_field").getModel();
879
+ if (oValueModel) {
880
+ oValue = deepClone(oValue, 500);
881
+ oValueModel.setProperty("/value", oValue || {});
882
+ }
883
+ oTextArea.setValueState("None");
884
+ oTextArea.setValueStateText("");
885
+ if (that.getConfiguration()._propertiesParsedFromValue) {
886
+ that.refreshSimpleForm();
887
+ }
888
+ } else {
889
+ oValueModel = oTextArea.getModel();
890
+ oValueModel.setProperty("/value", oValue);
891
+ oTextArea.setValueState("None");
892
+ oTextArea.setValueStateText("");
893
+ }
894
+ };
895
+
896
+ ObjectField.prototype.refreshSimpleForm = function() {
897
+ var that = this;
898
+ var oConfig = that.getConfiguration();
899
+ var oControl = that.getAggregation("_field");
900
+ var aContents = oControl.removeAllContent().slice(-2);
901
+ delete oConfig.properties;
902
+ that.parseValueProperties();
903
+ var fnChange = function() {
904
+ var oModel = oControl.getModel();
905
+ oModel.checkUpdate(true);
906
+ var oValue = oModel.getProperty("/value");
907
+ oValue = deepClone(oValue, 500);
908
+ that._setCurrentProperty("value", oValue);
909
+ };
910
+ var aPropertyContents = that.createPropertyContents(fnChange, "/value/");
911
+ aPropertyContents = aPropertyContents.concat(aContents);
912
+ aPropertyContents.forEach(function(oContent) {
913
+ oControl.addContent(oContent);
914
+ });
915
+ };
916
+
917
+ ObjectField.prototype.openObjectDetailsPopover = function (oItem, oControl, sMode) {
918
+ var that = this;
919
+ var oField = that.getAggregation("_field");
920
+ var oItemCloned = deepClone(oItem, 500);
921
+ var oModel;
922
+ if (!that._oObjectDetailsPopover) {
923
+ var oCreateButton = new Button({
924
+ text: oResourceBundle.getText("EDITOR_FIELD_OBJECT_DETAILS_POPOVER_BUTTON_CREATE"),
925
+ visible: sMode === "create",
926
+ enabled: {
927
+ path: '/value',
928
+ formatter: function(vValue) {
929
+ if (!vValue || vValue === "" || deepEqual(vValue, {})) {
930
+ return false;
931
+ }
932
+ return true;
933
+ }
934
+ },
935
+ press: that.onCreate.bind(that)
936
+ });
937
+ var oUpdateButton = new Button({
938
+ text: oResourceBundle.getText("EDITOR_FIELD_OBJECT_DETAILS_POPOVER_BUTTON_UPDATE"),
939
+ visible: sMode === "update",
940
+ enabled: {
941
+ path: '/value',
942
+ formatter: function(vValue) {
943
+ if (!vValue || vValue === "" || deepEqual(vValue, {})) {
944
+ return false;
945
+ }
946
+ return true;
947
+ }
948
+ },
949
+ press: that.onUpdate.bind(that)
950
+ });
951
+ oModel = new JSONModel({
952
+ "value": oItemCloned,
953
+ "editMode": "Properties"
954
+ });
955
+ var aObjectPropertyFormContents;
956
+ var fnChangeWithDataSave = function(oEvent) {
957
+ var oModel = that._oObjectDetailsPopover.getModel();
958
+ oModel.checkUpdate(true);
959
+ var oNewObject = oModel.getProperty("/value");
960
+ if (oNewObject && oNewObject !== "" && typeof oNewObject === "object" && !deepEqual(oNewObject, {})) {
961
+ oCreateButton.setEnabled(true);
962
+ } else {
963
+ oCreateButton.setEnabled(false);
964
+ }
965
+ };
966
+ var fnChange = function() {};
967
+ if (oItem._editable !== false) {
968
+ aObjectPropertyFormContents = that.createFormContents(fnChangeWithDataSave, "/value/", true);
969
+ } else {
970
+ aObjectPropertyFormContents = that.createFormContents(fnChange, "/value/", true);
971
+ }
972
+ var oEditModeButton = new Button({
973
+ icon: {
974
+ path: '/editMode',
975
+ formatter: function(oEditMode) {
976
+ if (oEditMode === "Properties") {
977
+ return "sap-icon://syntax";
978
+ } else {
979
+ return "sap-icon://form";
980
+ }
981
+ }
982
+ },
983
+ tooltip: {
984
+ path: '/editMode',
985
+ formatter: function(oEditMode) {
986
+ if (oEditMode === "Properties") {
987
+ return oResourceBundle.getText("EDITOR_FIELD_OBJECT_FORM_EDITMODE_JSON");
988
+ } else {
989
+ return oResourceBundle.getText("EDITOR_FIELD_OBJECT_FORM_EDITMODE_PROPERTIES");
990
+ }
991
+ }
992
+ },
993
+ press: function(oEvent) {
994
+ var oControl = oEvent.getSource();
995
+ var oModel = oControl.getModel();
996
+ var sEditMode = oModel.getProperty("/editMode");
997
+ if (sEditMode === "Properties") {//"Properties", "Json" {
998
+ oModel.setProperty("/editMode", "Json");
999
+ } else {
1000
+ oModel.setProperty("/editMode", "Properties");
1001
+ }
1002
+ }
1003
+ });
1004
+ var oForm = new SimpleForm({
1005
+ layout: "ResponsiveGridLayout",
1006
+ labelSpanXL: 4,
1007
+ labelSpanL: 4,
1008
+ labelSpanM: 4,
1009
+ //labelSpanS: "{= ${/editMode} === 'Properties' ? 4 : 12}",
1010
+ labelSpanS: 12,
1011
+ emptySpanXL: 1,
1012
+ emptySpanL: 1,
1013
+ emptySpanM: 1,
1014
+ emptySpanS: 0,
1015
+ columnsXL: 1,
1016
+ columnsL: 1,
1017
+ columnsM: 1,
1018
+ content: aObjectPropertyFormContents
1019
+ });
1020
+ var sPlacement = oField._previewPostion === "right" ? "Right" : "Left";
1021
+ that._oObjectDetailsPopover = new Popover({
1022
+ placement: sPlacement,
1023
+ contentWidth: "300px",
1024
+ contentHeight: "345px",
1025
+ content: oForm,
1026
+ customHeader: new OverflowToolbar({
1027
+ content: [
1028
+ new Title({
1029
+ text: oResourceBundle.getText("EDITOR_FIELD_OBJECT_DETAILS_POPOVER_TITLE")
1030
+ }),
1031
+ new ToolbarSpacer(),
1032
+ oEditModeButton
1033
+ ]
1034
+ }),
1035
+ footer: new OverflowToolbar({
1036
+ content: [
1037
+ new ToolbarSpacer(),
1038
+ oCreateButton,
1039
+ oUpdateButton,
1040
+ new Button({
1041
+ text: oResourceBundle.getText("EDITOR_FIELD_OBJECT_DETAILS_POPOVER_BUTTON_CLOSE"),
1042
+ press: function () {
1043
+ that._oObjectDetailsPopover.close();
1044
+ }
1045
+ })
1046
+ ]
1047
+ })
1048
+ }).addStyleClass("sapUiIntegrationEditorItemObjectFieldDetailsPopover");
1049
+ that._oObjectDetailsPopover.setModel(oModel);
1050
+ that._oObjectDetailsPopover.setModel(that.getModel("i18n"), "i18n");
1051
+ that._oObjectDetailsPopover._oCreateButton = oCreateButton;
1052
+ that._oObjectDetailsPopover._oUpdateButton = oUpdateButton;
1053
+ that._oObjectDetailsPopover._openBy = oControl;
1054
+ } else {
1055
+ oModel = that._oObjectDetailsPopover.getModel();
1056
+ oModel.setProperty("/value", oItemCloned);
1057
+ if (sMode === "create") {
1058
+ that._oObjectDetailsPopover._oCreateButton.setVisible(true);
1059
+ that._oObjectDetailsPopover._oUpdateButton.setVisible(false);
1060
+ } else if (sMode === "update") {
1061
+ that._oObjectDetailsPopover._oCreateButton.setVisible(false);
1062
+ that._oObjectDetailsPopover._oUpdateButton.setVisible(true);
1063
+ } else {
1064
+ that._oObjectDetailsPopover._oCreateButton.setVisible(false);
1065
+ that._oObjectDetailsPopover._oUpdateButton.setVisible(false);
1066
+ }
1067
+ that._oObjectDetailsPopover._openBy = oControl;
1068
+ }
1069
+ that._oObjectDetailsPopover.openBy(oControl);
1070
+ };
1071
+
1072
+ ObjectField.prototype.onCreate = function(oEvent) {
1073
+ var that = this;
1074
+ var oControl = that.getAggregation("_field");
1075
+ var oParameter;
1076
+ var bHasBeforeValue = that.checkHasValue();
1077
+ if (bHasBeforeValue) {
1078
+ oParameter = {
1079
+ selectedIndex: oControl.getSelectedIndex(),
1080
+ selectedIndices: oControl.getSelectedIndices()
1081
+ };
1082
+ }
1083
+ var oNewObject = that._oObjectDetailsPopover.getModel().getProperty("/value");
1084
+ var sPath = oControl.getBinding("rows").getPath();
1085
+ var oData = oControl.getModel().getProperty(sPath);
1086
+ oData.push(oNewObject);
1087
+ oControl.getModel().checkUpdate();
1088
+ that._oObjectDetailsPopover.close();
1089
+
1090
+ // restore the selections since the selections are lost, BCP: 2280048930, JIRA: CPOUIFTEAMB-252
1091
+ if (bHasBeforeValue) {
1092
+ that.applyBeforeValueAndSelections("create", oParameter);
1093
+ }
1094
+ };
1095
+
1096
+ ObjectField.prototype.onUpdate = function (oEvent) {
1097
+ var that = this;
1098
+ var oControl = that.getAggregation("_field");
1099
+ var oObject = that._oObjectDetailsPopover.getModel().getProperty("/value");
1100
+ var oModel = oControl.getModel();
1101
+ var oRow = that._oObjectDetailsPopover._openBy.getParent().getParent();
1102
+ var iRowIndex = oRow.getIndex();
1103
+
1104
+ // get the real index via path since the rows may be filtered
1105
+ var oRowContexts = oControl.getBinding("rows").getContexts();
1106
+ var sPath = oRowContexts[iRowIndex].getPath();
1107
+
1108
+ var oParameter;
1109
+ var bHasBeforeValue = that.checkHasValue();
1110
+ if (bHasBeforeValue) {
1111
+ var aRowContexts = oControl.getBinding("rows").getContexts();
1112
+ oParameter = {
1113
+ updatedObject: oObject,
1114
+ rowIndex: iRowIndex,
1115
+ path: sPath,
1116
+ selectedIndex: oControl.getSelectedIndex(),
1117
+ selectedIndices: oControl.getSelectedIndices(),
1118
+ rowNumber: aRowContexts ? aRowContexts.length : 0
1119
+ };
1120
+ }
1121
+
1122
+ // update the object in control value model
1123
+ oModel.setProperty(sPath, deepClone(oObject, 500));
1124
+ oModel.checkUpdate();
1125
+
1126
+ that._oObjectDetailsPopover.close();
1127
+
1128
+ // restore the selections since the selections are lost, BCP: 2280048930, JIRA: CPOUIFTEAMB-252
1129
+ if (bHasBeforeValue) {
1130
+ that.applyBeforeValueAndSelections("update", oParameter);
1131
+ }
1132
+ };
1133
+
1134
+ ObjectField.prototype.clearAllFilters = function(oEvent) {
1135
+ var that = this;
1136
+ var oTable = that.getAggregation("_field");
1137
+
1138
+ var aColumns = oTable.getColumns();
1139
+ for (var i = 0; i < aColumns.length; i++) {
1140
+ var oColumn = aColumns[i];
1141
+ if ( i < aColumns.length - 1) {
1142
+ oColumn._applySelection = false;
1143
+ }
1144
+ oTable.filter(oColumn, undefined);
1145
+ }
1146
+ };
1147
+
1148
+ ObjectField.prototype.checkHasValue = function() {
1149
+ var that = this;
1150
+ var oValue = that._getCurrentProperty("value");
1151
+ if (typeof oValue === "object" && !deepEqual(oValue, {})) {
1152
+ return true;
1153
+ }
1154
+ return false;
1155
+ };
1156
+
1157
+ // restore the selections since the selections are lost, BCP: 2280048930, JIRA: CPOUIFTEAMB-252
1158
+ ObjectField.prototype.applyBeforeValueAndSelections = function(sMode, oParameter) {
1159
+ var that = this;
1160
+ var oControl = that.getAggregation("_field");
1161
+ var iSelectedIndex = oParameter.selectedIndex;
1162
+ var iRowNumber = oParameter.rowNumber;
1163
+ var aRowContexts = oControl.getBinding("rows").getContexts();
1164
+ var iNewRowNumber = aRowContexts.length;
1165
+ var iRowIndex = oParameter.rowIndex;
1166
+ var sPath = oControl.getBinding("rows").getPath();
1167
+ var iRealIndexOfFilteredOut;
1168
+ switch (sMode) {
1169
+ case "create":
1170
+ if (iSelectedIndex > -1) {
1171
+ oControl.setSelectedIndex(iSelectedIndex);
1172
+ oControl._sPathOfFilteredOut = null;
1173
+ }
1174
+ break;
1175
+ case "update":
1176
+ //update object in field value if it is selected
1177
+ if (iRowIndex === iSelectedIndex) {
1178
+ that._setCurrentProperty("value", oParameter.updatedObject);
1179
+ // update the selections when row number changed which means the update may cause it filter out
1180
+ if (iRowNumber !== iNewRowNumber) {
1181
+ oControl._sPathOfFilteredOut = oParameter.path;
1182
+ }
1183
+ } else if (iRowNumber !== iNewRowNumber) {
1184
+ // update the selections when row number changed which means the update may cause it filter out
1185
+ if (iSelectedIndex > iRowIndex) {
1186
+ iSelectedIndex--;
1187
+ }
1188
+ oControl.setSelectedIndex(iSelectedIndex);
1189
+ }
1190
+ break;
1191
+ case "delete":
1192
+ if (iSelectedIndex === iRowIndex) {
1193
+ that._setCurrentProperty("value", undefined);
1194
+ } else if (iSelectedIndex > iRowIndex) {
1195
+ oControl.setSelectedIndex(iSelectedIndex - 1);
1196
+ } else {
1197
+ oControl.setSelectedIndex(iSelectedIndex);
1198
+ }
1199
+ // update the Paths in oControl._sPathOfFilteredOut
1200
+ if (oControl._sPathOfFilteredOut) {
1201
+ iRealIndexOfFilteredOut = oControl._sPathOfFilteredOut.substring(oControl._sPathOfFilteredOut.lastIndexOf("/") + 1);
1202
+ if (iRealIndexOfFilteredOut > oParameter.realIndex) {
1203
+ iRealIndexOfFilteredOut--;
1204
+ oControl._sPathOfFilteredOut = sPath + "/" + iRealIndexOfFilteredOut;
1205
+ }
1206
+ }
1207
+ break;
1208
+ case "filter":
1209
+ var oColumn = oParameter.column;
1210
+ if (iSelectedIndex > -1) {
1211
+ oControl._sPathOfFilteredOut = aRowContexts && aRowContexts[iSelectedIndex].getPath();
1212
+ }
1213
+ if (oColumn._applySelection !== false && oControl._sPathOfFilteredOut) {
1214
+ oControl.attachEventOnce("rowsUpdated", function() {
1215
+ var aFilteredRowContexts = oControl.getBinding("rows").getContexts() || [];
1216
+ var sNewIndex = -1;
1217
+ if (aFilteredRowContexts.length > 0 && oControl._sPathOfFilteredOut) {
1218
+ for (var i = 0; i < aFilteredRowContexts.length; i++) {
1219
+ var oContext = aFilteredRowContexts[i];
1220
+ if (oContext.getPath() === oControl._sPathOfFilteredOut) {
1221
+ sNewIndex = i;
1222
+ oControl._sPathOfFilteredOut = undefined;
1223
+ break;
1224
+ }
1225
+ }
1226
+ }
1227
+ if (sNewIndex > -1) {
1228
+ oControl.setSelectedIndex(sNewIndex);
1229
+ }
1230
+ });
1231
+ }
1232
+ delete oColumn._applySelection;
1233
+ break;
1234
+ default:
1235
+ }
1236
+ };
1237
+
1238
+ return ObjectField;
1239
+ });