@openui5/sap.ui.mdc 1.93.3 → 1.96.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 (237) hide show
  1. package/.reuse/dep5 +6 -11
  2. package/THIRDPARTY.txt +10 -16
  3. package/package.json +4 -4
  4. package/src/sap/ui/mdc/.library +1 -1
  5. package/src/sap/ui/mdc/ActionToolbar.js +236 -334
  6. package/src/sap/ui/mdc/AggregationBaseDelegate.js +2 -1
  7. package/src/sap/ui/mdc/Chart.js +150 -22
  8. package/src/sap/ui/mdc/ChartDelegateNew.js +15 -0
  9. package/src/sap/ui/mdc/ChartNew.js +107 -66
  10. package/src/sap/ui/mdc/Control.js +4 -3
  11. package/src/sap/ui/mdc/Element.js +5 -4
  12. package/src/sap/ui/mdc/Field.js +2 -2
  13. package/src/sap/ui/mdc/FilterBar.js +1 -10
  14. package/src/sap/ui/mdc/FilterField.js +28 -4
  15. package/src/sap/ui/mdc/Link.js +2 -2
  16. package/src/sap/ui/mdc/MultiValueField.js +1 -1
  17. package/src/sap/ui/mdc/Table.js +160 -79
  18. package/src/sap/ui/mdc/TableDelegate.js +20 -3
  19. package/src/sap/ui/mdc/ValueHelp.js +1474 -0
  20. package/src/sap/ui/mdc/ValueHelpDelegate.js +147 -0
  21. package/src/sap/ui/mdc/actiontoolbar/ActionToolbarAction.js +49 -104
  22. package/src/sap/ui/mdc/chart/DimensionItem.js +3 -3
  23. package/src/sap/ui/mdc/chart/Item.js +2 -3
  24. package/src/sap/ui/mdc/chart/MeasureItem.js +2 -2
  25. package/src/sap/ui/mdc/chart/SelectionDetailsActions.js +21 -2
  26. package/src/sap/ui/mdc/chart/ToolbarHandler.js +237 -225
  27. package/src/sap/ui/mdc/chartNew/ChartSelectionDetailsNew.js +1 -1
  28. package/src/sap/ui/mdc/chartNew/ChartToolbarNew.js +14 -10
  29. package/src/sap/ui/mdc/chartNew/ChartTypeButtonNew.js +1 -1
  30. package/src/sap/ui/mdc/chartNew/DrillStackHandlerNew.js +12 -10
  31. package/src/sap/ui/mdc/chartNew/ItemNew.js +0 -1
  32. package/src/sap/ui/mdc/chartNew/PropertyHelperNew.js +1 -1
  33. package/src/sap/ui/mdc/condition/Condition.js +2 -2
  34. package/src/sap/ui/mdc/condition/ConditionConverter.js +1 -1
  35. package/src/sap/ui/mdc/condition/ConditionModel.js +1 -1
  36. package/src/sap/ui/mdc/condition/FilterConverter.js +1 -1
  37. package/src/sap/ui/mdc/condition/FilterOperatorUtil.js +13 -7
  38. package/src/sap/ui/mdc/condition/Operator.js +4 -4
  39. package/src/sap/ui/mdc/condition/RangeOperator.js +1 -1
  40. package/src/sap/ui/mdc/designtime/actiontoolbar/ActionToolbar.designtime.js +43 -0
  41. package/src/sap/ui/mdc/designtime/chart/ChartNew.designtime.js +91 -0
  42. package/src/sap/ui/mdc/designtime/filterbar/FilterBar.designtime.js +20 -0
  43. package/src/sap/ui/mdc/designtime/filterbar/FilterBarBase.designtime.js +31 -0
  44. package/src/sap/ui/mdc/designtime/table/Table.designtime.js +5 -0
  45. package/src/sap/ui/mdc/enum/ContentMode.js +25 -4
  46. package/src/sap/ui/mdc/enum/SelectType.js +43 -0
  47. package/src/sap/ui/mdc/field/BoolFieldHelp.js +1 -1
  48. package/src/sap/ui/mdc/field/ConditionFieldHelp.js +1 -1
  49. package/src/sap/ui/mdc/field/ConditionType.js +19 -4
  50. package/src/sap/ui/mdc/field/ConditionsType.js +5 -4
  51. package/src/sap/ui/mdc/field/CustomFieldHelp.js +1 -1
  52. package/src/sap/ui/mdc/field/CustomFieldInfo.js +1 -1
  53. package/src/sap/ui/mdc/field/DefineConditionPanel.js +38 -14
  54. package/src/sap/ui/mdc/field/FieldBase.js +92 -41
  55. package/src/sap/ui/mdc/field/FieldBaseDelegate.js +9 -2
  56. package/src/sap/ui/mdc/field/FieldHelpBase.js +64 -4
  57. package/src/sap/ui/mdc/field/FieldInfoBase.js +9 -1
  58. package/src/sap/ui/mdc/field/FieldInput.js +1 -1
  59. package/src/sap/ui/mdc/field/FieldInputRenderUtil.js +1 -1
  60. package/src/sap/ui/mdc/field/FieldMultiInput.js +1 -1
  61. package/src/sap/ui/mdc/field/FieldValueHelp.js +7 -1
  62. package/src/sap/ui/mdc/field/FieldValueHelpContentWrapperBase.js +1 -1
  63. package/src/sap/ui/mdc/field/FieldValueHelpMTableWrapper.js +1 -1
  64. package/src/sap/ui/mdc/field/FieldValueHelpMdcTableWrapper.js +1 -1
  65. package/src/sap/ui/mdc/field/FieldValueHelpTableWrapperBase.js +2 -2
  66. package/src/sap/ui/mdc/field/FieldValueHelpUITableWrapper.js +1 -1
  67. package/src/sap/ui/mdc/field/InParameter.js +1 -1
  68. package/src/sap/ui/mdc/field/ListFieldHelp.js +3 -3
  69. package/src/sap/ui/mdc/field/ListFieldHelpItem.js +1 -1
  70. package/src/sap/ui/mdc/field/MultiValueFieldItem.js +1 -1
  71. package/src/sap/ui/mdc/field/OutParameter.js +1 -1
  72. package/src/sap/ui/mdc/field/ValueHelpPanel.js +1 -1
  73. package/src/sap/ui/mdc/field/content/BooleanContent.js +15 -3
  74. package/src/sap/ui/mdc/field/content/ContentFactory.js +16 -8
  75. package/src/sap/ui/mdc/field/content/DefaultContent.js +64 -23
  76. package/src/sap/ui/mdc/field/content/LinkContent.js +6 -0
  77. package/src/sap/ui/mdc/field/content/SearchContent.js +21 -3
  78. package/src/sap/ui/mdc/field/content/UnitContent.js +2 -2
  79. package/src/sap/ui/mdc/filterbar/FilterBarBase.js +105 -44
  80. package/src/sap/ui/mdc/filterbar/PropertyHelper.js +52 -0
  81. package/src/sap/ui/mdc/filterbar/p13n/AdaptationFilterBar.js +10 -51
  82. package/src/sap/ui/mdc/filterbar/vh/FilterBar.js +1 -1
  83. package/src/sap/ui/mdc/flexibility/ActionToolbar.flexibility.js +22 -0
  84. package/src/sap/ui/mdc/flexibility/ActionToolbarAction.flexibility.js +19 -0
  85. package/src/sap/ui/mdc/flexibility/Chart.flexibility.js +1 -1
  86. package/src/sap/ui/mdc/flexibility/ConditionFlex.js +57 -46
  87. package/src/sap/ui/mdc/flexibility/FilterBar.flexibility.js +1 -1
  88. package/src/sap/ui/mdc/flexibility/FilterItemFlex.js +1 -1
  89. package/src/sap/ui/mdc/flexibility/ItemBaseFlex.js +203 -197
  90. package/src/sap/ui/mdc/library.js +588 -8
  91. package/src/sap/ui/mdc/link/ContactDetails.js +1 -1
  92. package/src/sap/ui/mdc/link/ContactDetailsAddressItem.js +1 -1
  93. package/src/sap/ui/mdc/link/ContactDetailsEmailItem.js +1 -1
  94. package/src/sap/ui/mdc/link/ContactDetailsItem.js +1 -1
  95. package/src/sap/ui/mdc/link/ContactDetailsPhoneItem.js +1 -1
  96. package/src/sap/ui/mdc/link/Factory.js +1 -1
  97. package/src/sap/ui/mdc/link/FakeFlpConnector.js +1 -1
  98. package/src/sap/ui/mdc/link/LinkItem.js +1 -1
  99. package/src/sap/ui/mdc/link/Panel.js +1 -1
  100. package/src/sap/ui/mdc/link/PanelItem.js +1 -1
  101. package/src/sap/ui/mdc/link/PanelListItem.js +1 -1
  102. package/src/sap/ui/mdc/link/SelectionDialog.js +2 -2
  103. package/src/sap/ui/mdc/link/SelectionDialogItem.js +1 -1
  104. package/src/sap/ui/mdc/link/SemanticObjectMapping.js +1 -1
  105. package/src/sap/ui/mdc/link/SemanticObjectMappingItem.js +1 -1
  106. package/src/sap/ui/mdc/link/SemanticObjectUnavailableAction.js +1 -1
  107. package/src/sap/ui/mdc/messagebundle.properties +31 -5
  108. package/src/sap/ui/mdc/messagebundle_ar.properties +11 -4
  109. package/src/sap/ui/mdc/messagebundle_bg.properties +10 -3
  110. package/src/sap/ui/mdc/messagebundle_ca.properties +10 -3
  111. package/src/sap/ui/mdc/messagebundle_cs.properties +12 -5
  112. package/src/sap/ui/mdc/messagebundle_cy.properties +10 -3
  113. package/src/sap/ui/mdc/messagebundle_da.properties +10 -3
  114. package/src/sap/ui/mdc/messagebundle_de.properties +12 -5
  115. package/src/sap/ui/mdc/messagebundle_el.properties +11 -4
  116. package/src/sap/ui/mdc/messagebundle_en.properties +9 -2
  117. package/src/sap/ui/mdc/messagebundle_en_GB.properties +10 -3
  118. package/src/sap/ui/mdc/messagebundle_en_US_sappsd.properties +11 -3
  119. package/src/sap/ui/mdc/messagebundle_en_US_saprigi.properties +19 -3
  120. package/src/sap/ui/mdc/messagebundle_en_US_saptrc.properties +11 -2
  121. package/src/sap/ui/mdc/messagebundle_es.properties +35 -28
  122. package/src/sap/ui/mdc/messagebundle_es_MX.properties +10 -3
  123. package/src/sap/ui/mdc/messagebundle_et.properties +10 -3
  124. package/src/sap/ui/mdc/messagebundle_fi.properties +11 -4
  125. package/src/sap/ui/mdc/messagebundle_fr.properties +22 -15
  126. package/src/sap/ui/mdc/messagebundle_fr_CA.properties +10 -3
  127. package/src/sap/ui/mdc/messagebundle_hi.properties +10 -3
  128. package/src/sap/ui/mdc/messagebundle_hr.properties +10 -3
  129. package/src/sap/ui/mdc/messagebundle_hu.properties +11 -4
  130. package/src/sap/ui/mdc/messagebundle_id.properties +11 -4
  131. package/src/sap/ui/mdc/messagebundle_it.properties +33 -26
  132. package/src/sap/ui/mdc/messagebundle_iw.properties +10 -3
  133. package/src/sap/ui/mdc/messagebundle_ja.properties +13 -6
  134. package/src/sap/ui/mdc/messagebundle_kk.properties +10 -3
  135. package/src/sap/ui/mdc/messagebundle_ko.properties +10 -3
  136. package/src/sap/ui/mdc/messagebundle_lt.properties +10 -3
  137. package/src/sap/ui/mdc/messagebundle_lv.properties +10 -3
  138. package/src/sap/ui/mdc/messagebundle_ms.properties +10 -3
  139. package/src/sap/ui/mdc/messagebundle_nl.properties +11 -4
  140. package/src/sap/ui/mdc/messagebundle_no.properties +17 -10
  141. package/src/sap/ui/mdc/messagebundle_pl.properties +14 -7
  142. package/src/sap/ui/mdc/messagebundle_pt.properties +11 -4
  143. package/src/sap/ui/mdc/messagebundle_pt_PT.properties +10 -3
  144. package/src/sap/ui/mdc/messagebundle_ro.properties +13 -6
  145. package/src/sap/ui/mdc/messagebundle_ru.properties +10 -3
  146. package/src/sap/ui/mdc/messagebundle_sh.properties +10 -3
  147. package/src/sap/ui/mdc/messagebundle_sk.properties +11 -4
  148. package/src/sap/ui/mdc/messagebundle_sl.properties +10 -3
  149. package/src/sap/ui/mdc/messagebundle_sv.properties +11 -4
  150. package/src/sap/ui/mdc/messagebundle_th.properties +16 -9
  151. package/src/sap/ui/mdc/messagebundle_tr.properties +10 -3
  152. package/src/sap/ui/mdc/messagebundle_uk.properties +10 -3
  153. package/src/sap/ui/mdc/messagebundle_vi.properties +10 -3
  154. package/src/sap/ui/mdc/messagebundle_zh_CN.properties +10 -3
  155. package/src/sap/ui/mdc/messagebundle_zh_TW.properties +10 -3
  156. package/src/sap/ui/mdc/mixin/AdaptationMixin.js +1 -1
  157. package/src/sap/ui/mdc/mixin/DelegateMixin.js +2 -2
  158. package/src/sap/ui/mdc/mixin/FilterIntegrationMixin.js +3 -3
  159. package/src/sap/ui/mdc/mixin/PromiseMixin.js +94 -0
  160. package/src/sap/ui/mdc/odata/v4/ChartPropertyHelperNew.js +1 -1
  161. package/src/sap/ui/mdc/odata/v4/FilterBarDelegate.js +6 -6
  162. package/src/sap/ui/mdc/odata/v4/TableDelegate.js +37 -10
  163. package/src/sap/ui/mdc/odata/v4/ValueHelpDelegate.js +94 -0
  164. package/src/sap/ui/mdc/odata/v4/vizChart/ChartDelegateNew.js +492 -203
  165. package/src/sap/ui/mdc/p13n/DefaultProviderRegistry.js +1 -1
  166. package/src/sap/ui/mdc/p13n/Engine.js +3 -2
  167. package/src/sap/ui/mdc/p13n/P13nBuilder.js +6 -60
  168. package/src/sap/ui/mdc/p13n/PropertyHelper.js +1 -1
  169. package/src/sap/ui/mdc/p13n/UIManager.js +1 -1
  170. package/src/sap/ui/mdc/p13n/modification/ModificationHandler.js +22 -24
  171. package/src/sap/ui/mdc/p13n/panels/ActionToolbarPanel.js +59 -0
  172. package/src/sap/ui/mdc/p13n/panels/AdaptFiltersPanel.js +1 -2
  173. package/src/sap/ui/mdc/p13n/panels/BasePanel.js +17 -8
  174. package/src/sap/ui/mdc/p13n/panels/ChartItemPanel.js +1 -2
  175. package/src/sap/ui/mdc/p13n/panels/ChartItemPanelNew.js +1171 -0
  176. package/src/sap/ui/mdc/p13n/panels/GroupPanel.js +1 -1
  177. package/src/sap/ui/mdc/p13n/panels/GroupView.js +7 -11
  178. package/src/sap/ui/mdc/p13n/panels/ListView.js +5 -3
  179. package/src/sap/ui/mdc/p13n/panels/QueryPanel.js +16 -9
  180. package/src/sap/ui/mdc/p13n/panels/SelectionPanel.js +0 -1
  181. package/src/sap/ui/mdc/p13n/panels/SortPanel.js +0 -1
  182. package/src/sap/ui/mdc/p13n/panels/SortQueryPanel.js +1 -1
  183. package/src/sap/ui/mdc/p13n/panels/Wrapper.js +1 -1
  184. package/src/sap/ui/mdc/p13n/subcontroller/ActionToolbarController.js +89 -0
  185. package/src/sap/ui/mdc/p13n/subcontroller/BaseController.js +9 -6
  186. package/src/sap/ui/mdc/p13n/subcontroller/ChartItemController.js +33 -4
  187. package/src/sap/ui/mdc/p13n/subcontroller/ColumnController.js +9 -15
  188. package/src/sap/ui/mdc/p13n/subcontroller/FilterController.js +12 -0
  189. package/src/sap/ui/mdc/p13n/subcontroller/GroupController.js +5 -12
  190. package/src/sap/ui/mdc/p13n/subcontroller/SortController.js +19 -21
  191. package/src/sap/ui/mdc/table/Column.js +35 -9
  192. package/src/sap/ui/mdc/table/CreationRow.js +1 -1
  193. package/src/sap/ui/mdc/table/GridTableType.js +0 -1
  194. package/src/sap/ui/mdc/table/PropertyHelper.js +108 -5
  195. package/src/sap/ui/mdc/table/ResponsiveTableType.js +19 -3
  196. package/src/sap/ui/mdc/table/RowSettings.js +1 -1
  197. package/src/sap/ui/mdc/table/TableTypeBase.js +0 -1
  198. package/src/sap/ui/mdc/table/V4AnalyticsPropertyHelper.js +1 -1
  199. package/src/sap/ui/mdc/themes/base/FilterBar.less +2 -2
  200. package/src/sap/ui/mdc/themes/base/GroupView.less +2 -2
  201. package/src/sap/ui/mdc/themes/base/ListView.less +2 -2
  202. package/src/sap/ui/mdc/themes/base/ValueHelpDialog.less +56 -21
  203. package/src/sap/ui/mdc/ui/Container.js +2 -2
  204. package/src/sap/ui/mdc/ui/ContainerItem.js +2 -2
  205. package/src/sap/ui/mdc/util/Common.js +26 -0
  206. package/src/sap/ui/mdc/util/FilterUtil.js +12 -1
  207. package/src/sap/ui/mdc/util/IdentifierUtil.js +4 -0
  208. package/src/sap/ui/mdc/util/PromiseCache.js +266 -0
  209. package/src/sap/ui/mdc/util/PropertyHelper.js +22 -1
  210. package/src/sap/ui/mdc/valuehelp/Dialog.js +498 -0
  211. package/src/sap/ui/mdc/valuehelp/Popover.js +362 -0
  212. package/src/sap/ui/mdc/valuehelp/base/Container.js +642 -0
  213. package/src/sap/ui/mdc/valuehelp/base/Content.js +628 -0
  214. package/src/sap/ui/mdc/valuehelp/base/DialogTab.js +139 -0
  215. package/src/sap/ui/mdc/valuehelp/base/FilterableListContent.js +557 -0
  216. package/src/sap/ui/mdc/valuehelp/base/ListContent.js +133 -0
  217. package/src/sap/ui/mdc/valuehelp/content/Bool.js +318 -0
  218. package/src/sap/ui/mdc/valuehelp/content/Conditions.js +276 -0
  219. package/src/sap/ui/mdc/valuehelp/content/FixedList.js +532 -0
  220. package/src/sap/ui/mdc/valuehelp/content/MDCTable.js +638 -0
  221. package/src/sap/ui/mdc/valuehelp/content/MTable.js +916 -0
  222. package/test/sap/ui/mdc/testutils/opa/TestLibrary.js +3 -2
  223. package/test/sap/ui/mdc/testutils/opa/actions/OpenContextMenu.js +48 -0
  224. package/test/sap/ui/mdc/testutils/opa/chartNew/ActionsBase.js +310 -0
  225. package/test/sap/ui/mdc/testutils/opa/chartNew/ActionsViz.js +39 -0
  226. package/test/sap/ui/mdc/testutils/opa/chartNew/AssertionsBase.js +118 -0
  227. package/test/sap/ui/mdc/testutils/opa/chartNew/AssertionsViz.js +137 -0
  228. package/test/sap/ui/mdc/testutils/opa/chartNew/ChartNew.js +24 -0
  229. package/test/sap/ui/mdc/testutils/opa/chartNew/TestObjects.js +289 -0
  230. package/test/sap/ui/mdc/testutils/opa/filterbar/Actions.js +250 -0
  231. package/test/sap/ui/mdc/testutils/opa/filterbar/Assertions.js +91 -0
  232. package/test/sap/ui/mdc/testutils/opa/filterbar/TestObjects.js +137 -0
  233. package/test/sap/ui/mdc/testutils/opa/filterbar/Util.js +25 -0
  234. package/test/sap/ui/mdc/testutils/opa/p13n/Actions.js +401 -93
  235. package/test/sap/ui/mdc/testutils/opa/p13n/Util.js +4 -1
  236. package/test/sap/ui/mdc/testutils/opa/p13n/{waitForP13nButtonWithParentAndIcon.js → waitForP13nButtonWithMatchers.js} +5 -18
  237. package/test/sap/ui/mdc/testutils/opa/table/TestObjects.js +0 -1
@@ -0,0 +1,139 @@
1
+ /*
2
+ * ! OpenUI5
3
+ * (c) Copyright 2009-2021 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/core/Control'//,
9
+ //'sap/ui/base/ManagedObjectObserver'
10
+ ], function(
11
+ Control//,
12
+ //ManagedObjectObserver
13
+ ) {
14
+ "use strict";
15
+
16
+ /**
17
+ * Constructor for a new <code>DialogTab</code>.
18
+ *
19
+ * @param {string} [sId] ID for the new control, generated automatically if no ID is given
20
+ * @param {object} [mSettings] Initial settings for the new control
21
+ * @class Content for the <code>sap.ui.mdc.valuehelp.content.Dialog</code> element.
22
+ * @extends sap.ui.core.Control
23
+ * @version 1.96.1
24
+ * @constructor
25
+ * @abstract
26
+ * @private
27
+ * @ui5-restricted sap.ui.mdc
28
+ * @since 1.95.0
29
+ * @alias sap.ui.mdc.valuehelp.base.DialogTab
30
+ * @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel
31
+ */
32
+ var DialogTab = Control.extend("sap.ui.mdc.valuehelp.base.DialogTab", /** @lends sap.ui.mdc.valuehelp.base.DialogTab.prototype */
33
+ {
34
+ metadata: {
35
+ library: "sap.ui.mdc",
36
+ properties: {
37
+ /**
38
+ * Content control
39
+ */
40
+ content: {
41
+ type: "object" // as a Control can officially not be a property
42
+ }
43
+ },
44
+ // aggregations: {
45
+ // },
46
+ events: {
47
+ /**
48
+ * Fired if the selected condition changed.
49
+ */
50
+ select: {
51
+ parameters: {
52
+ /**
53
+ * Type of the selection change (add, remove)
54
+ */
55
+ type: { type: "sap.ui.mdc.enum.SelectType" },
56
+ /**
57
+ * Changed conditions
58
+ *
59
+ * <b>Note:</b> A condition must have the structure of {@link sap.ui.mdc.condition.ConditionObject ConditionObject}.
60
+ */
61
+ conditions: { type: "object[]" }
62
+ }
63
+ },
64
+ /**
65
+ * Fired if a change on the content is confirmed
66
+ */
67
+ confirm: {
68
+ parameters: {
69
+ /**
70
+ * True if the value help need to be closed
71
+ */
72
+ close: { type: "boolean" }
73
+ }
74
+ },
75
+ /**
76
+ * Fired if the change is cancelled.
77
+ */
78
+ cancel: {}
79
+ }
80
+ },
81
+ renderer: {
82
+ apiVersion: 2,
83
+ render: function(oRm, oControl) {
84
+ //oRm.openStart("div", oControl);
85
+ //oRm.openEnd();
86
+ // var oContent = oControl._displayContent;
87
+ var oContent = oControl.getContent();
88
+ if (oContent) {
89
+ oRm.renderControl(oContent);
90
+ }
91
+ //oRm.close("div");
92
+ }
93
+ }
94
+ });
95
+
96
+ DialogTab.prototype.init = function() {
97
+
98
+ Control.prototype.init.apply(this, arguments);
99
+
100
+ // this._oObserver = new ManagedObjectObserver(_observeChanges.bind(this));
101
+ //
102
+ // this._oObserver.observe(this, {
103
+ // properties: ["content"]
104
+ // });
105
+
106
+ };
107
+
108
+ DialogTab.prototype.exit = function () {
109
+ if (this._displayContent) {
110
+ this._displayContent = null;
111
+ }
112
+
113
+ // this._oObserver.disconnect();
114
+ // this._oObserver = undefined;
115
+
116
+ return Control.prototype.exit.apply(this, arguments);
117
+ };
118
+
119
+ // function _observeChanges(oChanges) {
120
+ //
121
+ // if (oChanges.name === "content") {
122
+ // if (oChanges.current) {
123
+ // Promise.resolve(oChanges.current.getContent()).then(function (oResolvedContent) {
124
+ // if (this._displayContent !== oResolvedContent) {
125
+ // this._displayContent = oResolvedContent;
126
+ // //this.invalidate(this);
127
+ // }
128
+ // }.bind(this));
129
+ // } else {
130
+ // this._displayContent = undefined;
131
+ // this.invalidate(this);
132
+ // }
133
+ // }
134
+ //
135
+ // }
136
+
137
+ return DialogTab;
138
+
139
+ });
@@ -0,0 +1,557 @@
1
+ /*
2
+ * ! OpenUI5
3
+ * (c) Copyright 2009-2021 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/mdc/util/loadModules',
9
+ 'sap/ui/mdc/valuehelp/base/ListContent',
10
+ 'sap/ui/mdc/condition/Condition',
11
+ 'sap/ui/mdc/condition/FilterConverter',
12
+ 'sap/ui/mdc/enum/ConditionValidated',
13
+ 'sap/base/util/deepEqual',
14
+ 'sap/ui/mdc/util/Common',
15
+ 'sap/ui/model/base/ManagedObjectModel',
16
+ 'sap/m/MessageToast'
17
+ ], function(
18
+ loadModules,
19
+ ListContent,
20
+ Condition,
21
+ FilterConverter,
22
+ ConditionValidated,
23
+ deepEqual,
24
+ Common,
25
+ ManagedObjectModel,
26
+ MessageToast
27
+ ) {
28
+ "use strict";
29
+
30
+ /**
31
+ * Constructor for a new <code>FilterableListContent</code>.
32
+ *
33
+ * @param {string} [sId] ID for the new control, generated automatically if no ID is given
34
+ * @param {object} [mSettings] Initial settings for the new control
35
+ * @class Content for the <code>sap.ui.mdc.valuehelp.base.Container</code> element.
36
+ * @extends sap.ui.mdc.valuehelp.base.ListContent
37
+ * @version 1.96.1
38
+ * @constructor
39
+ * @abstract
40
+ * @private
41
+ * @ui5-restricted sap.ui.mdc
42
+ * @since 1.95.0
43
+ * @alias sap.ui.mdc.valuehelp.base.FilterableListContent
44
+ * @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel
45
+ */
46
+ var FilterableListContent = ListContent.extend("sap.ui.mdc.valuehelp.base.FilterableListContent", /** @lends sap.ui.mdc.valuehelp.base.FilterableListContent.prototype */
47
+ {
48
+ metadata: {
49
+ library: "sap.ui.mdc",
50
+ properties: {
51
+ /**
52
+ * The fields based on which the table data is filtered. For filtering the value of the <code>filterValue</code> property is used.
53
+ *
54
+ * If set to <code>$search</code> and the used binding supports search requests, a $search request is used for filtering.
55
+ *
56
+ * If set to one or more properties, the filters for these properties are used for filtering.
57
+ * These filters are set on the <code>ListBinding</code> used.
58
+ * The properties need to be separated by commas and enclosed by "*" characters. (<code>"*Property1,Property2*"</code>)
59
+ *
60
+ * If it is empty, no suggestion is available.
61
+ */
62
+ filterFields: {
63
+ type: "string",
64
+ defaultValue: ""
65
+ },
66
+
67
+ /**
68
+ * The path of the key field in the content binding.
69
+ * If a table is used as content, this is the binding path of the key of the items.
70
+ *
71
+ * If not set, the FieldPath of the assigned field is used.
72
+ */
73
+ keyPath: {
74
+ type: "string",
75
+ defaultValue: ""
76
+ },
77
+
78
+ /**
79
+ * The path of the description field in the content binding.
80
+ * If a table is used as content, this is the binding path of the description of the items.
81
+ */
82
+ descriptionPath: {
83
+ type: "string",
84
+ defaultValue: ""
85
+ },
86
+ /**
87
+ * Internal property to allow to bind the conditions created by InParameters to content
88
+ */
89
+ inConditions: {
90
+ type: "object",
91
+ defaultValue: {},
92
+ byValue: true//,
93
+ //visibility: "hidden"
94
+ },
95
+ /**
96
+ * Internal property to allow to bind the paths used by OutParameters to content
97
+ */
98
+ outParameterNames: {
99
+ type: "string[]",
100
+ defaultValue: [],
101
+ byValue: true//,
102
+ //visibility: "hidden"
103
+ }
104
+ },
105
+ aggregations: {
106
+ /**
107
+ * Items used for collective search. If none assigned, no collective search is available.
108
+ */
109
+ collectiveSearchItems: {
110
+ type: "sap.ui.core.Item",
111
+ multiple: true,
112
+ singularName : "collectiveSearchItem"
113
+ },
114
+ /**
115
+ * FilterBar
116
+ */
117
+ filterBar: {
118
+ type: "sap.ui.mdc.filterbar.FilterBarBase",
119
+ multiple: false
120
+ },
121
+ /**
122
+ * Default FilterBar, ceated internally if none given.
123
+ */
124
+ _defaultFilterBar: {
125
+ type: "sap.ui.mdc.filterbar.FilterBarBase",
126
+ multiple: false,
127
+ visibility: "hidden"
128
+ }
129
+ },
130
+ events: {
131
+ }
132
+ }
133
+ });
134
+
135
+ FilterableListContent.prototype.init = function() {
136
+
137
+ ListContent.prototype.init.apply(this, arguments);
138
+
139
+ this._oResourceBundle = sap.ui.getCore().getLibraryResourceBundle("sap.ui.mdc");
140
+
141
+ this._oObserver.observe(this, {
142
+ aggregations: ["_defaultFilterBar", "filterBar"],
143
+ properties: ["inConditions"]
144
+ });
145
+
146
+ this.bindProperty("inConditions", { path: "/_inConditions", model: "$valueHelp"}); // inherit from ValueHelp
147
+ this.bindProperty("outParameterNames", { path: "/_outParameters", model: "$valueHelp"}); // inherit from ValueHelp
148
+ };
149
+
150
+ FilterableListContent.prototype._handleFilterValueUpdate = function (oChanges) {
151
+ _addFilterValueToFilterBar.call(this, this._getPriorityFilterBar(), oChanges.current);
152
+ this.applyFilters(oChanges.current);
153
+ };
154
+
155
+ FilterableListContent.prototype.applyFilters = function (sSearch) {
156
+
157
+ };
158
+
159
+
160
+ FilterableListContent.prototype._prettyPrintFilters = function (oFilter) {
161
+
162
+ var sRes;
163
+ if (!oFilter) {
164
+ return "";
165
+ }
166
+ if (Array.isArray(oFilter)) {
167
+ sRes = "";
168
+ oFilter.forEach(function(oFilter, iIndex, aFilters) {
169
+ sRes += this._prettyPrintFilters(oFilter);
170
+ if (aFilters.length - 1 != iIndex) {
171
+ sRes += " or ";
172
+ }
173
+ }, this);
174
+ return "(" + sRes + ")";
175
+ } else if (oFilter._bMultiFilter) {
176
+ sRes = "";
177
+ var bAnd = oFilter.bAnd;
178
+ oFilter.aFilters.forEach(function(oFilter, iIndex, aFilters) {
179
+ sRes += this._prettyPrintFilters(oFilter);
180
+ if (aFilters.length - 1 != iIndex) {
181
+ sRes += bAnd ? " and " : " or ";
182
+ }
183
+ }, this);
184
+ return "(" + sRes + ")";
185
+ } else {
186
+ sRes = oFilter.sPath + " " + oFilter.sOperator + " '" + oFilter.oValue1 + "'";
187
+ if (oFilter.sOperator === "BT") {
188
+ sRes += "...'" + oFilter.oValue2 + "'";
189
+ }
190
+ return sRes;
191
+ }
192
+ };
193
+
194
+ FilterableListContent.prototype._getItemFromContext = function (oBindingContext, oOptions) {
195
+
196
+ var sKeyPath = (oOptions && oOptions.keyPath) || this.getKeyPath();
197
+ var sDescriptionPath = (oOptions && oOptions.descriptionPath) || this.getDescriptionPath();
198
+ var vKey;
199
+ var sDescription;
200
+ var sPath;
201
+
202
+ if (!sKeyPath) {
203
+ throw new Error("KeyPath missing"); // as we cannot determine key without keyPath
204
+ }
205
+
206
+ var aInParameters = oOptions && oOptions.inParameters || [];
207
+ if (aInParameters.length === 0) {
208
+ for (sPath in this.getProperty("inConditions")) {
209
+ aInParameters.push(sPath);
210
+ }
211
+ }
212
+
213
+ var aOutParameters = oOptions && oOptions.outParameters || this.getProperty("outParameterNames");
214
+ var oInParameters = aInParameters.length > 0 ? {} : null;
215
+ var oOutParameters = aOutParameters.length > 0 ? {} : null;
216
+
217
+ if (oBindingContext) {
218
+ vKey = sKeyPath ? oBindingContext.getProperty(sKeyPath) : undefined;
219
+ sDescription = sDescriptionPath ? oBindingContext.getProperty(sDescriptionPath) : undefined;
220
+ var i = 0;
221
+ for (i = 0; i < aInParameters.length; i++) {
222
+ sPath = aInParameters[i];
223
+ oInParameters[sPath] = oBindingContext.getProperty(sPath);
224
+ }
225
+ for (i = 0; i < aOutParameters.length; i++) {
226
+ sPath = aOutParameters[i];
227
+ oOutParameters[sPath] = oBindingContext.getProperty(sPath);
228
+ }
229
+ }
230
+
231
+ if (vKey === null || vKey === undefined) {
232
+ return false;
233
+ }
234
+
235
+ return {key: vKey, description: sDescription, inParameters: oInParameters, outParameters: oOutParameters};
236
+ };
237
+
238
+ FilterableListContent.prototype._isItemSelected = function (oItem, aConditions) {
239
+
240
+ var oContext = oItem && oItem.getBindingContext();
241
+ var oItemData = this._getItemFromContext(oContext);
242
+
243
+ for (var i = 0; i < aConditions.length; i++) {
244
+ var oCondition = aConditions[i];
245
+ if (oCondition.validated === ConditionValidated.Validated && oItemData.key === oCondition.values[0]) { // TODO: check for specific EQ operator
246
+ //check for inParameters and outParameters
247
+ if (oCondition.inParameters && oItemData.inParameters && !deepEqual(oCondition.inParameters, oItemData.inParameters)) {
248
+ continue;
249
+ }
250
+ if (oCondition.outParameters && oItemData.outParameters && !deepEqual(oCondition.outParameters, oItemData.outParameters)) {
251
+ continue;
252
+ }
253
+ return true;
254
+ }
255
+ }
256
+
257
+ return false;
258
+
259
+ };
260
+
261
+ FilterableListContent.prototype._createDefaultFilterBar = function() {
262
+ return loadModules([
263
+ "sap/ui/mdc/filterbar/vh/FilterBar"
264
+ ]).then(function(aModules) {
265
+ var FilterBar = aModules[0];
266
+ var oFilterBar = new FilterBar(this.getId() + "-FB", {
267
+ liveMode: false, // !oWrapper.isSuspended(), // if suspended, no live search
268
+ showGoButton: false
269
+ });
270
+ this.setAggregation("_defaultFilterBar", oFilterBar, true);
271
+ return oFilterBar;
272
+ }.bind(this));
273
+ };
274
+
275
+ FilterableListContent.prototype._assignCollectiveSearch = function(bInitializeKey) {
276
+ bInitializeKey = typeof bInitializeKey !== "undefined" ? bInitializeKey : !this._oCollectiveSearchSelect;
277
+ _createCollectiveSearch.call(this, bInitializeKey).then(function(oCollectiveSearchSelect) {
278
+ var oFilterBar = this._getPriorityFilterBar();
279
+ if (oFilterBar.setCollectiveSearch) {
280
+ oFilterBar.setCollectiveSearch(oCollectiveSearchSelect);
281
+ }
282
+ }.bind(this));
283
+ };
284
+
285
+ function _createCollectiveSearch(bInitializeKey) {
286
+
287
+ return loadModules([
288
+ "sap/ui/mdc/filterbar/vh/CollectiveSearchSelect",
289
+ "sap/ui/core/Item"
290
+ ]).then(function(aModules) {
291
+ var CollectiveSearchSelect = aModules[0];
292
+ var Item = aModules[1];
293
+
294
+ _createCollectiveSearchSelect.call(this, CollectiveSearchSelect, Item);
295
+
296
+ var aCollectiveSearchItems = this.getCollectiveSearchItems();
297
+ if (aCollectiveSearchItems.length <= 1) {
298
+ return null;
299
+ } else {
300
+ if (bInitializeKey) {
301
+ this._oCollectiveSearchSelect.setSelectedItemKey(aCollectiveSearchItems[0].getKey());
302
+ }
303
+ return this._oCollectiveSearchSelect;
304
+ }
305
+ }.bind(this));
306
+
307
+ }
308
+
309
+ function _handleCollectiveSearchSelect(oEvent) {
310
+
311
+ var sKey = oEvent.getParameter("key");
312
+ MessageToast.show("ColSearch: " + sKey);
313
+
314
+ this.fireRequestDelegateContent();
315
+ }
316
+
317
+ function _createCollectiveSearchSelect(CollectiveSearchSelect, Item) {
318
+
319
+ if (!this._oCollectiveSearchSelect) {
320
+
321
+ this._oObserver.observe(this, {
322
+ properties: ["filterFields"],
323
+ aggregations: ["collectiveSearchItems"]
324
+ });
325
+
326
+ this._oManagedObjectModel = new ManagedObjectModel(this);
327
+ this.setModel(this._oManagedObjectModel, "$contenthelp");
328
+
329
+ var oItemTemplate = new Item(this.getId() + "-collSearchItem", {
330
+ key: "{$contenthelp>key}",
331
+ text: "{$contenthelp>text}",
332
+ enabled: "{$contenthelp>enabled}",
333
+ textDirection: "{$contenthelp>textDirection}"
334
+ });
335
+
336
+ this._oCollectiveSearchSelect = new CollectiveSearchSelect(this.getId() + "-collSearch", {
337
+ title: "{$i18n>COL_SEARCH_SEL_TITLE}",
338
+ items: {path: "$contenthelp>/collectiveSearchItems", template: oItemTemplate},
339
+ select: _handleCollectiveSearchSelect.bind(this)
340
+ });
341
+ }
342
+
343
+ return this._oCollectiveSearchSelect;
344
+
345
+ }
346
+
347
+ FilterableListContent.prototype.onShow = function () {
348
+ ListContent.prototype.onShow.apply(this, arguments);
349
+
350
+ var oListBinding = this._getListBinding();
351
+ var oListBindingInfo = this._getListBindingInfo();
352
+
353
+ var bBindingSuspended = oListBinding && oListBinding.isSuspended();
354
+ var bBindingWillBeSuspended = !oListBinding && oListBindingInfo && oListBindingInfo.suspended;
355
+
356
+ if ((bBindingSuspended || bBindingWillBeSuspended) && !this.isTypeahead()) {
357
+ return; // in dialog case do not resume suspended table on opening
358
+ }
359
+
360
+ this.applyFilters(this.getFilterValue());
361
+ };
362
+
363
+ FilterableListContent.prototype._formatConditions = function(aConditions) {
364
+ // map in/outParameters to help paths
365
+
366
+ var aInParameters = this.getModel("$valueHelp").getProperty("/inParameters");
367
+ var aOutParameters = this.getModel("$valueHelp").getProperty("/outParameters");
368
+
369
+ for (var i = 0; i < aConditions.length; i++) {
370
+ var oCondition = aConditions[i];
371
+ if (oCondition.inParameters) {
372
+ oCondition.inParameters = _mapParametersToHelp.call(this, oCondition.inParameters, aInParameters);
373
+ }
374
+ if (oCondition.outParameters) {
375
+ oCondition.outParameters = _mapParametersToHelp.call(this, oCondition.outParameters, aOutParameters);
376
+ }
377
+ }
378
+
379
+ return aConditions;
380
+
381
+ };
382
+
383
+ function _mapParametersToHelp(oParameters, aParameters) {
384
+
385
+ var oHelpParameters;
386
+
387
+ if (aParameters.length > 0) {
388
+ for (var sMyFieldPath in oParameters) {
389
+ for (var i = 0; i < aParameters.length; i++) {
390
+ var oParameter = aParameters[i];
391
+ var sHelpPath = oParameter.getHelpPath();
392
+ var sFieldPath = oParameter.getFieldPath();
393
+ if (sFieldPath && (sFieldPath === sMyFieldPath || sFieldPath === "conditions/" + sMyFieldPath) && sHelpPath) { // support also old saved conditions without "conditions/" in name
394
+ if (!oHelpParameters) {
395
+ oHelpParameters = {};
396
+ }
397
+ oHelpParameters[sHelpPath] = oParameters[sMyFieldPath];
398
+ }
399
+ }
400
+ }
401
+ }
402
+
403
+ return oHelpParameters;
404
+
405
+ }
406
+
407
+ FilterableListContent.prototype._getPriorityFilterBar = function () {
408
+ return this.getFilterBar() || this.getAggregation("_defaultFilterBar");
409
+ };
410
+
411
+ FilterableListContent.prototype._observeChanges = function (oChanges) {
412
+ if (oChanges.object == this) {
413
+
414
+ if (oChanges.name === "collectiveSearchItems") {
415
+ this._assignCollectiveSearch(true);
416
+ }
417
+ if (oChanges.name === "inConditions") {
418
+ _addInParameterToFilterBar.call(this, this._getPriorityFilterBar(), oChanges.current);
419
+ }
420
+
421
+ if (["_defaultFilterBar", "filterBar"].indexOf(oChanges.name) !== -1) {
422
+ var oFilterBar = oChanges.child;
423
+ if (oChanges.mutation === "insert") {
424
+ var sFilterFields = this.getFilterFields();
425
+ var oExistingBasicSearchField = oFilterBar.getBasicSearchField();
426
+ if (!oExistingBasicSearchField && sFilterFields) {
427
+ return loadModules([
428
+ "sap/ui/mdc/FilterField"
429
+ ]).then(function (aModules){
430
+ var FilterField = aModules[0];
431
+ oFilterBar.setBasicSearchField(new FilterField(this.getId() + "-search", {
432
+ conditions: "{$filters>/conditions/" + sFilterFields + "}",
433
+ placeholder:"{$i18n>filterbar.SEARCH}",
434
+ label:"{$i18n>filterbar.SEARCH}", // TODO: do we want a label?
435
+ maxConditions: 1,
436
+ width: "50%"
437
+ }));
438
+ }.bind(this));
439
+ } else if (oExistingBasicSearchField) {
440
+ oExistingBasicSearchField.setConditions([]);
441
+ }
442
+ this._assignCollectiveSearch();
443
+ _addInParameterToFilterBar.call(this, oFilterBar, this.getProperty("inConditions"));
444
+ _addFilterValueToFilterBar.call(this, oFilterBar, this.getFilterValue());
445
+ }
446
+ }
447
+ }
448
+ ListContent.prototype._observeChanges.apply(this, arguments);
449
+ };
450
+
451
+ FilterableListContent.prototype.exit = function () {
452
+
453
+ Common.cleanup(this, [
454
+ "_oCollectiveSearchSelect","_oManagedObjectModel"
455
+ ]);
456
+
457
+ ListContent.prototype.exit.apply(this, arguments);
458
+ };
459
+
460
+ FilterableListContent.prototype.getCollectiveSearchKey = function () {
461
+ return this._oCollectiveSearchSelect && this._oCollectiveSearchSelect.getSelectedItemKey();
462
+ };
463
+
464
+ FilterableListContent.prototype._getFiltersForFilterBar = function () {
465
+ var oFilterBar = this._getPriorityFilterBar();
466
+ var oCurrentFilterBarConditions = oFilterBar.getConditions();
467
+ var oConditionTypes = this._getTypesForConditions(oCurrentFilterBarConditions);
468
+ var oCreatedFBFilters = oCurrentFilterBarConditions && oConditionTypes && FilterConverter.createFilters(oCurrentFilterBarConditions, oConditionTypes, undefined, this.getCaseSensitive());
469
+ return oCreatedFBFilters ? [].concat(oCreatedFBFilters) : [];
470
+ };
471
+
472
+ FilterableListContent.prototype._getListBinding = function () {
473
+ throw new Error("FilterableListContent: Every filterable listcontent must implement this method.");
474
+ };
475
+
476
+ FilterableListContent.prototype._getListBindingInfo = function () {
477
+ throw new Error("FilterableListContent: Every filterable listcontent must implement this method.");
478
+ };
479
+
480
+ FilterableListContent.prototype._getTypesForConditions = function (oConditions) {
481
+
482
+ var oFilterBar = this._getPriorityFilterBar();
483
+ var aInParameters = this.getInParameters();
484
+ var oConditionTypes;
485
+ var sFieldPath;
486
+
487
+ if (oFilterBar) {
488
+ oConditionTypes = FilterConverter.createConditionTypesMapFromFilterBar( oConditions, oFilterBar);
489
+ } else {
490
+ // collect condition Fieldpaths here
491
+ oConditionTypes = {};
492
+ for (sFieldPath in oConditions) {
493
+ oConditionTypes[sFieldPath] = {type: null};
494
+ }
495
+ }
496
+
497
+ // try to find missing type from InParameter
498
+ for (sFieldPath in oConditionTypes) {
499
+ if (!oConditionTypes[sFieldPath].type) {
500
+ for (var i = 0; i < aInParameters.length; i++) {
501
+ var oInParameter = aInParameters[i];
502
+ if (oInParameter.getHelpPath() === sFieldPath) {
503
+ oConditionTypes[sFieldPath].type = oInParameter.getDataType();
504
+ break;
505
+ }
506
+ }
507
+ }
508
+ }
509
+
510
+ return oConditionTypes;
511
+
512
+ };
513
+
514
+ function _addInParameterToFilterBar(oFilterBar, oInConditions) {
515
+ if (oFilterBar) {
516
+ // add inParameters to FilterBar
517
+ var oConditions = oFilterBar.getInternalConditions();
518
+ for ( var sFilterPath in oInConditions) {
519
+ oConditions[sFilterPath] = oInConditions[sFilterPath];
520
+ }
521
+ oFilterBar.setInternalConditions(oConditions); // TODO: remove on hide?
522
+ }
523
+
524
+ }
525
+
526
+ function _addFilterValueToFilterBar(oFilterBar, sFilterValue) {
527
+ var sFilterFields = this.getFilterFields();
528
+
529
+ if (oFilterBar && sFilterFields) {
530
+ var oConditions = oFilterBar.getInternalConditions();
531
+ var oCondition = Condition.createCondition("StartsWith", [sFilterValue], undefined, undefined, ConditionValidated.NotValidated);
532
+ oConditions[sFilterFields] = [oCondition];
533
+ oFilterBar.setInternalConditions(oConditions);
534
+ }
535
+
536
+ }
537
+
538
+ FilterableListContent.prototype.getFormattedTitle = function(iCount) {
539
+ var sTitle = ListContent.prototype.getFormattedTitle.apply(this, arguments);
540
+ if (!sTitle) {
541
+ sTitle = this._oResourceBundle.getText(iCount ? "valuehelp.SELECTFROMLIST" : "valuehelp.SELECTFROMLISTNONUMBER", iCount);
542
+ }
543
+ return sTitle;
544
+ };
545
+
546
+ FilterableListContent.prototype.getFormattedShortTitle = function() {
547
+ var sShortTitle = this.getShortTitle();
548
+ if (!sShortTitle) {
549
+ sShortTitle = this._oResourceBundle.getText("valuehelp.SELECTFROMLIST.Shorttitle");
550
+ }
551
+ return sShortTitle;
552
+ };
553
+
554
+
555
+ return FilterableListContent;
556
+
557
+ });