@sapui5/sap.fe.macros 1.141.2 → 1.143.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 (257) hide show
  1. package/package.json +1 -1
  2. package/src/sap/fe/macros/.library +1 -1
  3. package/src/sap/fe/macros/Breadcrumbs.js +4 -10
  4. package/src/sap/fe/macros/Breadcrumbs.tsx +2 -8
  5. package/src/sap/fe/macros/Chart.js +34 -23
  6. package/src/sap/fe/macros/Chart.tsx +25 -11
  7. package/src/sap/fe/macros/CollaborativeDraftHandler.js +47 -36
  8. package/src/sap/fe/macros/CollaborativeDraftHandler.tsx +50 -31
  9. package/src/sap/fe/macros/CollectionBindingInfo.js +8 -2
  10. package/src/sap/fe/macros/CollectionBindingInfo.ts +11 -6
  11. package/src/sap/fe/macros/CommonHelper.js +14 -24
  12. package/src/sap/fe/macros/CommonHelper.ts +18 -25
  13. package/src/sap/fe/macros/ConditionalSwitch.js +1 -2
  14. package/src/sap/fe/macros/ConditionalSwitch.tsx +0 -1
  15. package/src/sap/fe/macros/ConditionalSwitchProperty.js +1 -3
  16. package/src/sap/fe/macros/ConditionalSwitchProperty.tsx +0 -2
  17. package/src/sap/fe/macros/Field.js +34 -17
  18. package/src/sap/fe/macros/Field.ts +64 -32
  19. package/src/sap/fe/macros/FooterContent.js +7 -3
  20. package/src/sap/fe/macros/FooterContent.tsx +8 -13
  21. package/src/sap/fe/macros/KPITag.js +6 -6
  22. package/src/sap/fe/macros/KPITag.tsx +8 -6
  23. package/src/sap/fe/macros/MacroAPI.js +4 -3
  24. package/src/sap/fe/macros/MacroAPI.ts +3 -3
  25. package/src/sap/fe/macros/MessageButton.js +4 -3
  26. package/src/sap/fe/macros/MessageButton.tsx +7 -3
  27. package/src/sap/fe/macros/MicroChart.js +12 -7
  28. package/src/sap/fe/macros/MicroChart.tsx +9 -3
  29. package/src/sap/fe/macros/MultiValueField.js +22 -36
  30. package/src/sap/fe/macros/MultiValueField.tsx +34 -66
  31. package/src/sap/fe/macros/RichTextEditor.js +3 -4
  32. package/src/sap/fe/macros/RichTextEditor.tsx +2 -3
  33. package/src/sap/fe/macros/Share.js +7 -7
  34. package/src/sap/fe/macros/Share.tsx +9 -6
  35. package/src/sap/fe/macros/Status.js +39 -11
  36. package/src/sap/fe/macros/Status.tsx +25 -5
  37. package/src/sap/fe/macros/ValueHelp.js +5 -2
  38. package/src/sap/fe/macros/ValueHelp.tsx +5 -0
  39. package/src/sap/fe/macros/ai/EasyFillDialog.js +2 -1
  40. package/src/sap/fe/macros/ai/EasyFillDialog.tsx +1 -0
  41. package/src/sap/fe/macros/ai/EasyFilterBar.js +7 -34
  42. package/src/sap/fe/macros/ai/EasyFilterBar.tsx +6 -35
  43. package/src/sap/fe/macros/ai/EasyFilterDataFetcher.js +31 -7
  44. package/src/sap/fe/macros/ai/EasyFilterDataFetcher.ts +33 -6
  45. package/src/sap/fe/macros/ai/SummarizationButton.js +6 -4
  46. package/src/sap/fe/macros/ai/SummarizationButton.tsx +5 -3
  47. package/src/sap/fe/macros/chart/Action.js +25 -2
  48. package/src/sap/fe/macros/chart/Action.ts +13 -0
  49. package/src/sap/fe/macros/chart/ActionGroup.js +25 -2
  50. package/src/sap/fe/macros/chart/ActionGroup.ts +13 -0
  51. package/src/sap/fe/macros/chart/ChartDelegate.js +29 -8
  52. package/src/sap/fe/macros/chart/ChartDelegate.ts +46 -14
  53. package/src/sap/fe/macros/chart/MdcChartTemplate.js +58 -12
  54. package/src/sap/fe/macros/chart/MdcChartTemplate.tsx +75 -13
  55. package/src/sap/fe/macros/chart/OverflowGroup.js +62 -0
  56. package/src/sap/fe/macros/chart/OverflowGroup.ts +22 -0
  57. package/src/sap/fe/macros/controls/BuildingBlockObjectProperty.js +7 -7
  58. package/src/sap/fe/macros/controls/BuildingBlockObjectProperty.ts +3 -2
  59. package/src/sap/fe/macros/controls/FileWrapper.js +11 -5
  60. package/src/sap/fe/macros/controls/FileWrapper.ts +10 -4
  61. package/src/sap/fe/macros/controls/FilterBar.js +39 -3
  62. package/src/sap/fe/macros/controls/FilterBar.ts +42 -1
  63. package/src/sap/fe/macros/controls/NumberWithUnitOrCurrency.js +3 -1
  64. package/src/sap/fe/macros/controls/NumberWithUnitOrCurrency.tsx +2 -0
  65. package/src/sap/fe/macros/controls/RadioButtons.js +18 -5
  66. package/src/sap/fe/macros/controls/RadioButtons.tsx +10 -1
  67. package/src/sap/fe/macros/coreUI/CreateDialog.js +3 -3
  68. package/src/sap/fe/macros/coreUI/CreateDialog.tsx +2 -2
  69. package/src/sap/fe/macros/coreUI/OperationParameterDialog.js +40 -12
  70. package/src/sap/fe/macros/coreUI/OperationParameterDialog.tsx +48 -9
  71. package/src/sap/fe/macros/draftIndicator/DraftIndicator.js +4 -2
  72. package/src/sap/fe/macros/draftIndicator/DraftIndicator.tsx +3 -1
  73. package/src/sap/fe/macros/field/FieldFormatOptions.js +4 -4
  74. package/src/sap/fe/macros/field/FieldFormatOptions.ts +2 -2
  75. package/src/sap/fe/macros/field/FieldHelper.js +4 -3
  76. package/src/sap/fe/macros/field/FieldHelper.ts +7 -1
  77. package/src/sap/fe/macros/field/FieldRuntime.js +44 -9
  78. package/src/sap/fe/macros/field/FieldRuntime.ts +72 -8
  79. package/src/sap/fe/macros/field/FieldRuntimeHelper.js +3 -34
  80. package/src/sap/fe/macros/field/FieldRuntimeHelper.ts +28 -53
  81. package/src/sap/fe/macros/field/FieldTemplating.js +5 -4
  82. package/src/sap/fe/macros/field/FieldTemplating.ts +6 -4
  83. package/src/sap/fe/macros/filter/FilterFieldHelper.js +6 -4
  84. package/src/sap/fe/macros/filter/FilterFieldHelper.ts +7 -2
  85. package/src/sap/fe/macros/filter/FilterUtils.js +130 -40
  86. package/src/sap/fe/macros/filter/FilterUtils.ts +167 -45
  87. package/src/sap/fe/macros/filterBar/ExtendedSemanticDateOperators.js +2 -2
  88. package/src/sap/fe/macros/filterBar/ExtendedSemanticDateOperators.ts +1 -1
  89. package/src/sap/fe/macros/filterBar/FilterBar.block.js +4 -3
  90. package/src/sap/fe/macros/filterBar/FilterBar.block.tsx +19 -8
  91. package/src/sap/fe/macros/filterBar/FilterBarAPI.js +15 -9
  92. package/src/sap/fe/macros/filterBar/FilterBarAPI.ts +36 -17
  93. package/src/sap/fe/macros/filterBar/FilterBarDelegate.js +21 -10
  94. package/src/sap/fe/macros/filterBar/FilterBarDelegate.ts +81 -63
  95. package/src/sap/fe/macros/filterBar/UOMValidationDelegate.js +376 -0
  96. package/src/sap/fe/macros/filterBar/UOMValidationDelegate.ts +463 -0
  97. package/src/sap/fe/macros/filterBar/mixin/FilterBarAPIStateHandler.js +4 -3
  98. package/src/sap/fe/macros/filterBar/mixin/FilterBarAPIStateHandler.ts +3 -2
  99. package/src/sap/fe/macros/form/Form.block.js +27 -2
  100. package/src/sap/fe/macros/form/Form.block.ts +31 -11
  101. package/src/sap/fe/macros/form/FormActionButtons.fragment.xml +13 -3
  102. package/src/sap/fe/macros/form/FormContainer.block.js +110 -63
  103. package/src/sap/fe/macros/form/FormContainer.block.ts +121 -64
  104. package/src/sap/fe/macros/formatters/TableFormatter.js +13 -10
  105. package/src/sap/fe/macros/formatters/TableFormatter.ts +11 -9
  106. package/src/sap/fe/macros/formatters/VisualFilterFormatter.js +6 -4
  107. package/src/sap/fe/macros/formatters/VisualFilterFormatter.ts +5 -5
  108. package/src/sap/fe/macros/inlineEdit/InlineEdit.js +5 -5
  109. package/src/sap/fe/macros/inlineEdit/InlineEdit.ts +4 -4
  110. package/src/sap/fe/macros/insights/InsightsService.js +3 -2
  111. package/src/sap/fe/macros/insights/InsightsService.ts +2 -1
  112. package/src/sap/fe/macros/internal/DataPoint.js +7 -8
  113. package/src/sap/fe/macros/internal/DataPoint.tsx +6 -9
  114. package/src/sap/fe/macros/internal/field/DisplayStyle.js +8 -6
  115. package/src/sap/fe/macros/internal/field/DisplayStyle.tsx +7 -8
  116. package/src/sap/fe/macros/internal/field/EditStyle.js +9 -20
  117. package/src/sap/fe/macros/internal/field/EditStyle.tsx +17 -41
  118. package/src/sap/fe/macros/internal/field/FieldBlockStructure.js +2 -2
  119. package/src/sap/fe/macros/internal/field/FieldBlockStructure.tsx +1 -1
  120. package/src/sap/fe/macros/internal/field/FieldStructure.js +1 -2
  121. package/src/sap/fe/macros/internal/field/FieldStructure.tsx +0 -2
  122. package/src/sap/fe/macros/internal/field/FieldStructureHelper.js +7 -7
  123. package/src/sap/fe/macros/internal/field/FieldStructureHelper.ts +17 -11
  124. package/src/sap/fe/macros/internal/helpers/DataPointTemplating.js +6 -2
  125. package/src/sap/fe/macros/internal/helpers/DataPointTemplating.ts +5 -1
  126. package/src/sap/fe/macros/internal/valuehelp/AdditionalValueFormatter.js +9 -6
  127. package/src/sap/fe/macros/internal/valuehelp/AdditionalValueFormatter.ts +7 -5
  128. package/src/sap/fe/macros/internal/valuehelp/TableDelegate.js +4 -4
  129. package/src/sap/fe/macros/internal/valuehelp/TableDelegate.ts +6 -6
  130. package/src/sap/fe/macros/internal/valuehelp/ValueListDialogTable.fragment.xml +5 -2
  131. package/src/sap/fe/macros/internal/valuehelp/ValueListHelper.js +2 -2
  132. package/src/sap/fe/macros/internal/valuehelp/ValueListHelper.ts +2 -1
  133. package/src/sap/fe/macros/library.js +5 -6
  134. package/src/sap/fe/macros/{library.ts → library.tsx} +3 -1
  135. package/src/sap/fe/macros/mdc/adapter/StateHelper.js +15 -5
  136. package/src/sap/fe/macros/mdc/adapter/StateHelper.ts +21 -5
  137. package/src/sap/fe/macros/messagebundle.properties +13 -5
  138. package/src/sap/fe/macros/messagebundle_ar.properties +12 -3
  139. package/src/sap/fe/macros/messagebundle_bg.properties +13 -4
  140. package/src/sap/fe/macros/messagebundle_ca.properties +12 -3
  141. package/src/sap/fe/macros/messagebundle_cnr.properties +12 -3
  142. package/src/sap/fe/macros/messagebundle_cs.properties +11 -2
  143. package/src/sap/fe/macros/messagebundle_cy.properties +12 -3
  144. package/src/sap/fe/macros/messagebundle_da.properties +12 -3
  145. package/src/sap/fe/macros/messagebundle_de.properties +16 -7
  146. package/src/sap/fe/macros/messagebundle_el.properties +13 -4
  147. package/src/sap/fe/macros/messagebundle_en.properties +13 -4
  148. package/src/sap/fe/macros/messagebundle_en_GB.properties +13 -4
  149. package/src/sap/fe/macros/messagebundle_en_US_saprigi.properties +13 -4
  150. package/src/sap/fe/macros/messagebundle_es.properties +12 -3
  151. package/src/sap/fe/macros/messagebundle_es_MX.properties +12 -3
  152. package/src/sap/fe/macros/messagebundle_et.properties +12 -3
  153. package/src/sap/fe/macros/messagebundle_fi.properties +12 -3
  154. package/src/sap/fe/macros/messagebundle_fr.properties +12 -3
  155. package/src/sap/fe/macros/messagebundle_fr_CA.properties +12 -3
  156. package/src/sap/fe/macros/messagebundle_hi.properties +12 -3
  157. package/src/sap/fe/macros/messagebundle_hr.properties +13 -4
  158. package/src/sap/fe/macros/messagebundle_hu.properties +12 -3
  159. package/src/sap/fe/macros/messagebundle_id.properties +18 -9
  160. package/src/sap/fe/macros/messagebundle_it.properties +12 -3
  161. package/src/sap/fe/macros/messagebundle_iw.properties +12 -3
  162. package/src/sap/fe/macros/messagebundle_ja.properties +12 -3
  163. package/src/sap/fe/macros/messagebundle_kk.properties +11 -2
  164. package/src/sap/fe/macros/messagebundle_ko.properties +13 -4
  165. package/src/sap/fe/macros/messagebundle_lt.properties +12 -3
  166. package/src/sap/fe/macros/messagebundle_lv.properties +12 -3
  167. package/src/sap/fe/macros/messagebundle_mk.properties +12 -3
  168. package/src/sap/fe/macros/messagebundle_ms.properties +12 -3
  169. package/src/sap/fe/macros/messagebundle_nl.properties +12 -3
  170. package/src/sap/fe/macros/messagebundle_no.properties +12 -3
  171. package/src/sap/fe/macros/messagebundle_pl.properties +12 -3
  172. package/src/sap/fe/macros/messagebundle_pt.properties +12 -3
  173. package/src/sap/fe/macros/messagebundle_pt_PT.properties +12 -3
  174. package/src/sap/fe/macros/messagebundle_ro.properties +13 -4
  175. package/src/sap/fe/macros/messagebundle_ru.properties +12 -3
  176. package/src/sap/fe/macros/messagebundle_sh.properties +12 -3
  177. package/src/sap/fe/macros/messagebundle_sk.properties +12 -3
  178. package/src/sap/fe/macros/messagebundle_sl.properties +13 -4
  179. package/src/sap/fe/macros/messagebundle_sr.properties +12 -3
  180. package/src/sap/fe/macros/messagebundle_sv.properties +12 -3
  181. package/src/sap/fe/macros/messagebundle_th.properties +11 -2
  182. package/src/sap/fe/macros/messagebundle_tr.properties +12 -3
  183. package/src/sap/fe/macros/messagebundle_uk.properties +12 -3
  184. package/src/sap/fe/macros/messagebundle_vi.properties +13 -4
  185. package/src/sap/fe/macros/messagebundle_zh_CN.properties +12 -3
  186. package/src/sap/fe/macros/messagebundle_zh_TW.properties +12 -3
  187. package/src/sap/fe/macros/messages/MessageButton.js +21 -12
  188. package/src/sap/fe/macros/messages/MessageButton.ts +21 -11
  189. package/src/sap/fe/macros/multivaluefield/MultiValueFieldDelegate.js +7 -3
  190. package/src/sap/fe/macros/multivaluefield/MultiValueFieldDelegate.ts +8 -2
  191. package/src/sap/fe/macros/quickView/QuickView.js +5 -4
  192. package/src/sap/fe/macros/quickView/QuickView.tsx +10 -3
  193. package/src/sap/fe/macros/richtexteditor/ButtonGroup.js +2 -2
  194. package/src/sap/fe/macros/richtexteditor/ButtonGroup.ts +2 -2
  195. package/src/sap/fe/macros/table/Action.js +21 -5
  196. package/src/sap/fe/macros/table/Action.ts +14 -4
  197. package/src/sap/fe/macros/table/ActionGroup.js +15 -2
  198. package/src/sap/fe/macros/table/ActionGroup.ts +8 -0
  199. package/src/sap/fe/macros/table/ActionGroupOverride.js +14 -2
  200. package/src/sap/fe/macros/table/ActionGroupOverride.ts +7 -0
  201. package/src/sap/fe/macros/table/ActionOverride.js +14 -2
  202. package/src/sap/fe/macros/table/ActionOverride.ts +7 -0
  203. package/src/sap/fe/macros/table/ActionsTemplating.js +16 -2
  204. package/src/sap/fe/macros/table/ActionsTemplating.tsx +15 -0
  205. package/src/sap/fe/macros/table/Column.js +3 -2
  206. package/src/sap/fe/macros/table/Column.ts +1 -1
  207. package/src/sap/fe/macros/table/MdcTableTemplate.js +96 -18
  208. package/src/sap/fe/macros/table/MdcTableTemplate.tsx +136 -17
  209. package/src/sap/fe/macros/table/OverflowGroups.js +59 -0
  210. package/src/sap/fe/macros/table/OverflowGroups.ts +27 -0
  211. package/src/sap/fe/macros/table/Table.block.js +74 -30
  212. package/src/sap/fe/macros/table/Table.block.tsx +77 -14
  213. package/src/sap/fe/macros/table/TableAPI.js +175 -132
  214. package/src/sap/fe/macros/table/TableAPI.ts +67 -30
  215. package/src/sap/fe/macros/table/TableDefinition.js +20 -3
  216. package/src/sap/fe/macros/table/TableDefinition.ts +18 -2
  217. package/src/sap/fe/macros/table/TableEventHandlerProvider.js +6 -3
  218. package/src/sap/fe/macros/table/TableEventHandlerProvider.ts +12 -9
  219. package/src/sap/fe/macros/table/TableHelper.js +5 -2
  220. package/src/sap/fe/macros/table/TableHelper.ts +5 -2
  221. package/src/sap/fe/macros/table/TableRuntime.js +25 -13
  222. package/src/sap/fe/macros/table/TableRuntime.ts +31 -17
  223. package/src/sap/fe/macros/table/TableSizeHelper.js +4 -4
  224. package/src/sap/fe/macros/table/TableSizeHelper.ts +6 -11
  225. package/src/sap/fe/macros/table/Utils.js +9 -3
  226. package/src/sap/fe/macros/table/Utils.ts +14 -8
  227. package/src/sap/fe/macros/table/delegates/TableDelegate.js +72 -29
  228. package/src/sap/fe/macros/table/delegates/TableDelegate.ts +114 -123
  229. package/src/sap/fe/macros/table/massEdit/MassEditDialog.js +41 -15
  230. package/src/sap/fe/macros/table/massEdit/MassEditDialog.tsx +41 -22
  231. package/src/sap/fe/macros/table/massEdit/MassEditDialogHelper.js +15 -6
  232. package/src/sap/fe/macros/table/massEdit/MassEditDialogHelper.tsx +14 -5
  233. package/src/sap/fe/macros/table/massEdit/MassEditField.js +1 -1
  234. package/src/sap/fe/macros/table/massEdit/MassEditField.tsx +3 -6
  235. package/src/sap/fe/macros/table/mixin/ContextMenuHandler.js +2 -3
  236. package/src/sap/fe/macros/table/mixin/ContextMenuHandler.ts +3 -2
  237. package/src/sap/fe/macros/table/mixin/EmptyRowsHandler.js +42 -14
  238. package/src/sap/fe/macros/table/mixin/EmptyRowsHandler.ts +49 -19
  239. package/src/sap/fe/macros/table/mixin/TableAPIStateHandler.js +7 -9
  240. package/src/sap/fe/macros/table/mixin/TableAPIStateHandler.ts +7 -8
  241. package/src/sap/fe/macros/table/mixin/TableExport.js +1 -1
  242. package/src/sap/fe/macros/table/mixin/TableExport.ts +3 -3
  243. package/src/sap/fe/macros/table/mixin/TableHierarchy.js +3 -4
  244. package/src/sap/fe/macros/table/mixin/TableHierarchy.ts +2 -3
  245. package/src/sap/fe/macros/table/uploadTable/UploadTableRuntime.js +5 -4
  246. package/src/sap/fe/macros/table/uploadTable/UploadTableRuntime.ts +6 -3
  247. package/src/sap/fe/macros/valuehelp/ValueHelpDelegate.js +17 -10
  248. package/src/sap/fe/macros/valuehelp/ValueHelpDelegate.ts +24 -9
  249. package/src/sap/fe/macros/visualfilters/InteractiveChartHelper.js +4 -4
  250. package/src/sap/fe/macros/visualfilters/InteractiveChartHelper.ts +3 -3
  251. package/src/sap/fe/macros/visualfilters/VisualFilter.js +20 -2
  252. package/src/sap/fe/macros/visualfilters/VisualFilter.tsx +28 -6
  253. package/src/sap/fe/macros/visualfilters/VisualFilterRuntime.js +6 -3
  254. package/src/sap/fe/macros/visualfilters/VisualFilterRuntime.ts +4 -3
  255. package/src/sap/fe/macros/visualfilters/fragments/InteractiveCharts.js +3 -3
  256. package/src/sap/fe/macros/visualfilters/fragments/InteractiveCharts.tsx +10 -4
  257. package/src/sap/fe/macros/visualfilters/fragments/InteractiveDonutChart.fragment.xml +1 -1
@@ -18,6 +18,8 @@ import type { BaseTreeModifier, PreprocessorSettings } from "sap/fe/core/CommonU
18
18
  import CommonUtils from "sap/fe/core/CommonUtils";
19
19
  import TemplateModel from "sap/fe/core/TemplateModel";
20
20
  import { getInvolvedDataModelObjects } from "sap/fe/core/converters/MetaModelConverter";
21
+ import type { PageContextPathTarget } from "sap/fe/core/converters/TemplateConverter";
22
+ import FilterRestrictions from "sap/fe/core/converters/controls/Common/filter/FilterRestrictions";
21
23
  import type {
22
24
  PropertyInfo as FEPropertyInfo,
23
25
  FilterField,
@@ -29,6 +31,7 @@ import { isPropertyFilterable } from "sap/fe/core/helpers/MetaModelFunction";
29
31
  import ModelHelper from "sap/fe/core/helpers/ModelHelper";
30
32
  import { getLocalizedText, getResourceModel } from "sap/fe/core/helpers/ResourceModelHelper";
31
33
  import { generate } from "sap/fe/core/helpers/StableIdHelper";
34
+ import type { DataModelObjectPath } from "sap/fe/core/templating/DataModelPathHelper";
32
35
  import { hasValueHelp } from "sap/fe/core/templating/PropertyFormatters";
33
36
  import { getModelType } from "sap/fe/core/type/EDM";
34
37
  import CommonHelper from "sap/fe/macros/CommonHelper";
@@ -36,6 +39,7 @@ import DelegateUtil from "sap/fe/macros/DelegateUtil";
36
39
  import FieldHelper from "sap/fe/macros/field/FieldHelper";
37
40
  import type { IFilterControl } from "sap/fe/macros/filter/FilterUtils";
38
41
  import FilterUtils from "sap/fe/macros/filter/FilterUtils";
42
+ import UOMValidationDelegate from "sap/fe/macros/filterBar/UOMValidationDelegate";
39
43
  import type { PropertyInfo } from "sap/fe/macros/internal/PropertyInfo";
40
44
  import { getValueHelpTemplate } from "sap/fe/macros/internal/valuehelp/ValueHelpTemplating";
41
45
  import type { ControlPropertyInfo } from "sap/fe/macros/mdc/adapter/StateHelper";
@@ -57,61 +61,62 @@ import type MacroAPI from "../MacroAPI";
57
61
 
58
62
  type ModifierElement = UI5Element | UI5Element[] | Element | Element[];
59
63
  type NullableModifierElement = void | ModifierElement | null;
60
- const ODataFilterBarDelegate = Object.assign({}, FilterBarDelegate) as typeof FilterBarDelegate & {
61
- apiVersion: number;
62
- _isFilterInSelectionFields(selectionFields: SelectionFields, filterFieldInfo: FilterField): boolean;
63
- _findSelectionField(aSelectionFields: FilterField[], sFlexName: string): FilterField | undefined;
64
- clearFilters(oFilterControl: FilterBar): Promise<void>;
65
- getTypeMap(): typeof TypeMap;
66
- fetchFilterProperties(filterBar: IFilterControl): Promise<ControlPropertyInfo[] | PropertyInfoExternal[]>;
67
- fetchProperties(filterBar: FilterBar): Promise<PropertyInfoExternal[]>;
68
- _isFilterAdaptable(
69
- filterFieldInfo: FilterField,
70
- propertyAnnotations: Property,
71
- selectionFields?: SelectionFields,
72
- filterFacets?: FilterFacets
73
- ): boolean;
74
- fetchPropertiesForEntity(sEntityTypePath: string, oMetaModel: ODataMetaModel, oFilterControl: IFilterControl): PropertyInfo[];
75
- _templateCustomFilter(
76
- oFilterBar: IFilterControl,
77
- sIdPrefix: string,
78
- oSelectionFieldInfo: FilterField,
79
- oMetaModel: ODataMetaModel,
80
- oModifier: BaseTreeModifier
81
- ): Promise<ModifierElement>;
82
- _addP13nItem(sPropertyInfoName: string, oParentControl: FilterBar): Promise<NullableModifierElement>;
83
- _addFlexItem(
84
- sFlexPropertyName: string,
85
- oParentControl: FilterBar,
86
- oMetaModel: ODataMetaModel,
87
- oModifier: BaseTreeModifier | undefined,
88
- oAppComponent?: AppComponent,
89
- view?: View
90
- ): Promise<NullableModifierElement>;
91
- addItem(
92
- oParentControl: FilterBar,
93
- sPropertyInfoName: string,
94
- mPropertyBag?: { modifier: BaseTreeModifier; appComponent: AppComponent }
95
- ): Promise<NullableModifierElement>;
96
- addCondition(
97
- oParentControl: FilterBar,
98
- sPropertyInfoName: string,
99
- mPropertyBag: { appComponent: AppComponent; modifier: BaseTreeModifier }
100
- ): Promise<void | null>;
101
- removeItem(
102
- oParentControl: FilterBar,
103
- oFilterFieldProperty: UI5Element | Element,
104
- mPropertyBag: { appComponent: AppComponent; modifier: BaseTreeModifier }
105
- ): Promise<boolean | null>;
106
- removeCondition(
107
- oParentControl: FilterBar,
108
- sPropertyInfoName: string,
109
- mPropertyBag: {
110
- appComponent: AppComponent;
111
- modifier: BaseTreeModifier;
112
- }
113
- ): Promise<void | null>;
114
- };
64
+ const ODataFilterBarDelegate = Object.assign({}, FilterBarDelegate, UOMValidationDelegate) as typeof FilterBarDelegate &
65
+ typeof UOMValidationDelegate & {
66
+ apiVersion: number;
67
+ _isFilterInSelectionFields(selectionFields: SelectionFields, filterFieldInfo: FilterField): boolean;
68
+ _findSelectionField(aSelectionFields: FilterField[], sFlexName: string): FilterField | undefined;
69
+ clearFilters(oFilterControl: FilterBar): Promise<void>;
70
+ getTypeMap(): typeof TypeMap;
71
+ fetchFilterProperties(filterBar: IFilterControl): Promise<ControlPropertyInfo[] | PropertyInfoExternal[]>;
72
+ fetchProperties(filterBar: FilterBar): Promise<PropertyInfoExternal[]>;
73
+ _isFilterAdaptable(
74
+ filterFieldInfo: FilterField,
75
+ propertyAnnotations: Property,
76
+ selectionFields?: SelectionFields,
77
+ filterFacets?: FilterFacets
78
+ ): boolean;
79
+ fetchPropertiesForEntity(sEntityTypePath: string, oMetaModel: ODataMetaModel, oFilterControl: IFilterControl): PropertyInfo[];
80
+ _templateCustomFilter(
81
+ oFilterBar: IFilterControl,
82
+ sIdPrefix: string,
83
+ oSelectionFieldInfo: FilterField,
84
+ oMetaModel: ODataMetaModel,
85
+ oModifier: BaseTreeModifier
86
+ ): Promise<ModifierElement>;
87
+ _addP13nItem(sPropertyInfoName: string, oParentControl: FilterBar): Promise<NullableModifierElement>;
88
+ _addFlexItem(
89
+ sFlexPropertyName: string,
90
+ oParentControl: FilterBar,
91
+ oMetaModel: ODataMetaModel,
92
+ oModifier: BaseTreeModifier | undefined,
93
+ oAppComponent?: AppComponent,
94
+ view?: View
95
+ ): Promise<NullableModifierElement>;
96
+ addItem(
97
+ oParentControl: FilterBar,
98
+ sPropertyInfoName: string,
99
+ mPropertyBag?: { modifier: BaseTreeModifier; appComponent: AppComponent }
100
+ ): Promise<NullableModifierElement>;
101
+ addCondition(
102
+ oParentControl: FilterBar,
103
+ sPropertyInfoName: string,
104
+ mPropertyBag: { appComponent: AppComponent; modifier: BaseTreeModifier }
105
+ ): Promise<void | null>;
106
+ removeItem(
107
+ oParentControl: FilterBar,
108
+ oFilterFieldProperty: UI5Element | Element,
109
+ mPropertyBag: { appComponent: AppComponent; modifier: BaseTreeModifier }
110
+ ): Promise<boolean | null>;
111
+ removeCondition(
112
+ oParentControl: FilterBar,
113
+ sPropertyInfoName: string,
114
+ mPropertyBag: {
115
+ appComponent: AppComponent;
116
+ modifier: BaseTreeModifier;
117
+ }
118
+ ): Promise<void | null>;
119
+ };
115
120
  ODataFilterBarDelegate.apiVersion = 2;
116
121
  const EDIT_STATE_PROPERTY_NAME = "$editState",
117
122
  SEARCH_PROPERTY_NAME = "$search",
@@ -417,8 +422,9 @@ async function _addPropertyInfo(
417
422
 
418
423
  const delegate = await mPropertyBag.modifier.getProperty<FilterBarDelegate>(oParentControl, "delegate");
419
424
  const aPropertyInfo = await mPropertyBag.modifier.getProperty<FEPropertyInfo[]>(oParentControl, "propertyInfo");
425
+ const propertyInfoExists = await FilterUtils._checkIfPropertyInfoExists(oParentControl, mPropertyBag.modifier, sPropertyInfoName);
420
426
  //We do not get propertyInfo in case of table filters
421
- if (aPropertyInfo) {
427
+ if (aPropertyInfo && !propertyInfoExists) {
422
428
  const hasPropertyInfo = aPropertyInfo.some(function (prop: FEPropertyInfo) {
423
429
  return prop.key === sPropertyInfoKey || prop.name === sPropertyInfoKey;
424
430
  });
@@ -476,12 +482,13 @@ async function _updatePropertyInfo(
476
482
  propertyBag.modifier.setProperty(parentControl, "propertyInfo", _propertyInfo);
477
483
  }
478
484
  /**
479
- * Method responsible for creating filter field in standalone mode / in the personalization settings of the filter bar.
485
+ * Method responsible for creating the filter field in standalone mode and in the personalization settings of the filter bar.
480
486
  * @param oParentControl Parent control instance to which the filter field is added
481
487
  * @param sPropertyInfoName Name of the property being added as the filter field
482
488
  * @param mPropertyBag Instance of the property bag from Flex API
483
489
  * @param mPropertyBag.appComponent AppComponent
484
490
  * @param mPropertyBag.modifier Modifier from Flex API
491
+ * @param mPropertyBag.view Instance of the view
485
492
  * @returns Once resolved, a filter field definition is returned
486
493
  */
487
494
  ODataFilterBarDelegate.addItem = async function (
@@ -500,7 +507,8 @@ ODataFilterBarDelegate.addItem = async function (
500
507
  return Promise.resolve(null);
501
508
  }
502
509
  const isXML = modifier && modifier.targets === "xmlTree";
503
- if (isXML) {
510
+ const propertyInfoExists = isXML ? await FilterUtils._checkIfPropertyInfoExists(oParentControl, modifier, sPropertyInfoName) : true;
511
+ if (isXML && !propertyInfoExists) {
504
512
  await _addPropertyInfo(oParentControl, mPropertyBag, oMetaModel, sPropertyInfoName);
505
513
  }
506
514
  return ODataFilterBarDelegate._addFlexItem(
@@ -537,6 +545,7 @@ ODataFilterBarDelegate.removeItem = async function (
537
545
  return Promise.resolve(null);
538
546
  }
539
547
  const filterFieldProperty = await mPropertyBag.modifier.getProperty(oFilterFieldProperty, "propertyKey");
548
+
540
549
  await _addPropertyInfo(oParentControl, mPropertyBag, oMetaModel, filterFieldProperty as string);
541
550
  }
542
551
  if (
@@ -704,8 +713,8 @@ ODataFilterBarDelegate.fetchPropertiesForEntity = function (
704
713
  aFetchedProperties = aFetchedProperties.filter(function (oProp: FEPropertyInfo) {
705
714
  return processedFieldsKeys.includes(oProp.key!);
706
715
  });
707
-
708
- const oFR = CommonUtils.getFilterRestrictionsByPath(sEntitySetPath, oMetaModel),
716
+ const dataModel = getInvolvedDataModelObjects(oMetaModel.getContext(sEntitySetPath));
717
+ const oFR = FilterRestrictions.getFilterRestrictionsByDataModel(dataModel as DataModelObjectPath<PageContextPathTarget>),
709
718
  mAllowedExpressions = oFR.FilterAllowedExpressions;
710
719
  //Object.keys(processedFields).forEach(function (sFilterFieldKey: string) {
711
720
  processedFields.forEach(function (oProp, iFilterFieldIndex: number) {
@@ -861,6 +870,14 @@ ODataFilterBarDelegate._addFlexItem = async function (
861
870
  oAppComponent: AppComponent | undefined,
862
871
  view?: View | undefined
863
872
  ): Promise<NullableModifierElement> {
873
+ let propertyInfosFromFilterBar: PropertyInfo[] = [];
874
+ const bIsXML = !!oModifier && oModifier.targets === "xmlTree";
875
+ if (bIsXML) {
876
+ const customDataValue = await DelegateUtil.getCustomDataWithModifier<string>(oParentControl, "feFilterInfo", oModifier);
877
+ if (customDataValue) {
878
+ propertyInfosFromFilterBar = JSON.parse(customDataValue) as PropertyInfo[]; // retrieve pre-fetched filter info from custom data, required during templating
879
+ }
880
+ }
864
881
  const sFilterBarId = oModifier ? oModifier.getId(oParentControl) : oParentControl.getId(),
865
882
  sIdPrefix = oModifier ? "" : "Adaptation",
866
883
  aSelectionFields = FilterUtils.getConvertedFilterFields(
@@ -870,11 +887,12 @@ ODataFilterBarDelegate._addFlexItem = async function (
870
887
  oMetaModel,
871
888
  oAppComponent,
872
889
  oModifier,
873
- oModifier ? undefined : getLineItemQualifierFromTable(oParentControl.getParent()!, oMetaModel)
890
+ oModifier ? undefined : getLineItemQualifierFromTable(oParentControl.getParent()!, oMetaModel),
891
+ propertyInfosFromFilterBar
874
892
  ),
875
893
  oSelectionField = ODataFilterBarDelegate._findSelectionField(aSelectionFields, sFlexPropertyName),
876
- sPropertyPath = _getPropertyPath(sFlexPropertyName),
877
- bIsXML = !!oModifier && oModifier.targets === "xmlTree";
894
+ sPropertyPath = _getPropertyPath(sFlexPropertyName);
895
+
878
896
  if (sFlexPropertyName === EDIT_STATE_PROPERTY_NAME) {
879
897
  return _templateEditState(_generateIdPrefix(sFilterBarId, `${sIdPrefix}FilterField`), oMetaModel, oModifier);
880
898
  } else if (sFlexPropertyName === SEARCH_PROPERTY_NAME) {