@openui5/sap.ui.mdc 1.94.0 → 1.97.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 (243) hide show
  1. package/.reuse/dep5 +12 -12
  2. package/THIRDPARTY.txt +21 -17
  3. package/package.json +4 -4
  4. package/src/sap/ui/mdc/.library +1 -1
  5. package/src/sap/ui/mdc/ActionToolbar.js +231 -334
  6. package/src/sap/ui/mdc/Chart.js +148 -21
  7. package/src/sap/ui/mdc/ChartDelegateNew.js +15 -0
  8. package/src/sap/ui/mdc/ChartNew.js +83 -56
  9. package/src/sap/ui/mdc/ChartNewRenderer.js +2 -2
  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 +3 -2
  13. package/src/sap/ui/mdc/FilterBar.js +1 -10
  14. package/src/sap/ui/mdc/FilterField.js +42 -4
  15. package/src/sap/ui/mdc/Link.js +2 -2
  16. package/src/sap/ui/mdc/MultiValueField.js +2 -1
  17. package/src/sap/ui/mdc/Table.js +285 -186
  18. package/src/sap/ui/mdc/TableDelegate.js +13 -11
  19. package/src/sap/ui/mdc/ValueHelp.js +1500 -0
  20. package/src/sap/ui/mdc/ValueHelpDelegate.js +167 -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 -226
  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 +11 -9
  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 +6 -2
  38. package/src/sap/ui/mdc/condition/Operator.js +9 -9
  39. package/src/sap/ui/mdc/condition/OperatorDynamicDateOption.js +437 -0
  40. package/src/sap/ui/mdc/condition/RangeOperator.js +1 -1
  41. package/src/sap/ui/mdc/designtime/actiontoolbar/ActionToolbar.designtime.js +43 -0
  42. package/src/sap/ui/mdc/designtime/chart/ChartNew.designtime.js +91 -0
  43. package/src/sap/ui/mdc/designtime/field/Field.designtime.js +21 -0
  44. package/src/sap/ui/mdc/designtime/field/FieldBase.designtime.js +104 -0
  45. package/src/sap/ui/mdc/designtime/field/FilterField.designtime.js +22 -0
  46. package/src/sap/ui/mdc/designtime/field/MultiValueField.designtime.js +23 -0
  47. package/src/sap/ui/mdc/designtime/filterbar/FilterBar.designtime.js +19 -0
  48. package/src/sap/ui/mdc/designtime/filterbar/FilterBarBase.designtime.js +31 -0
  49. package/src/sap/ui/mdc/designtime/table/Table.designtime.js +5 -0
  50. package/src/sap/ui/mdc/enum/ContentMode.js +25 -4
  51. package/src/sap/ui/mdc/enum/SelectType.js +43 -0
  52. package/src/sap/ui/mdc/field/BoolFieldHelp.js +1 -1
  53. package/src/sap/ui/mdc/field/ConditionFieldHelp.js +1 -1
  54. package/src/sap/ui/mdc/field/ConditionType.js +67 -35
  55. package/src/sap/ui/mdc/field/ConditionsType.js +12 -10
  56. package/src/sap/ui/mdc/field/CustomFieldHelp.js +1 -1
  57. package/src/sap/ui/mdc/field/CustomFieldInfo.js +1 -1
  58. package/src/sap/ui/mdc/field/DefineConditionPanel.js +13 -2
  59. package/src/sap/ui/mdc/field/DynamicDateRangeConditionsType.js +311 -0
  60. package/src/sap/ui/mdc/field/FieldBase.js +143 -83
  61. package/src/sap/ui/mdc/field/FieldBaseDelegate.js +9 -2
  62. package/src/sap/ui/mdc/field/FieldHelpBase.js +64 -4
  63. package/src/sap/ui/mdc/field/FieldInfoBase.js +9 -1
  64. package/src/sap/ui/mdc/field/FieldInput.js +1 -1
  65. package/src/sap/ui/mdc/field/FieldInputRenderUtil.js +1 -1
  66. package/src/sap/ui/mdc/field/FieldMultiInput.js +1 -1
  67. package/src/sap/ui/mdc/field/FieldValueHelp.js +12 -6
  68. package/src/sap/ui/mdc/field/FieldValueHelpContentWrapperBase.js +1 -1
  69. package/src/sap/ui/mdc/field/FieldValueHelpDelegate.js +20 -0
  70. package/src/sap/ui/mdc/field/FieldValueHelpMTableWrapper.js +1 -1
  71. package/src/sap/ui/mdc/field/FieldValueHelpMdcTableWrapper.js +1 -1
  72. package/src/sap/ui/mdc/field/FieldValueHelpTableWrapperBase.js +2 -1
  73. package/src/sap/ui/mdc/field/FieldValueHelpUITableWrapper.js +1 -1
  74. package/src/sap/ui/mdc/field/InParameter.js +1 -1
  75. package/src/sap/ui/mdc/field/ListFieldHelp.js +1 -1
  76. package/src/sap/ui/mdc/field/ListFieldHelpItem.js +1 -1
  77. package/src/sap/ui/mdc/field/MultiValueFieldItem.js +1 -1
  78. package/src/sap/ui/mdc/field/OutParameter.js +1 -1
  79. package/src/sap/ui/mdc/field/ValueHelpPanel.js +2 -1
  80. package/src/sap/ui/mdc/field/content/BooleanContent.js +16 -4
  81. package/src/sap/ui/mdc/field/content/ContentFactory.js +34 -24
  82. package/src/sap/ui/mdc/field/content/DateContent.js +128 -2
  83. package/src/sap/ui/mdc/field/content/DateTimeContent.js +9 -1
  84. package/src/sap/ui/mdc/field/content/DefaultContent.js +65 -24
  85. package/src/sap/ui/mdc/field/content/LinkContent.js +6 -0
  86. package/src/sap/ui/mdc/field/content/SearchContent.js +21 -3
  87. package/src/sap/ui/mdc/field/content/TimeContent.js +8 -1
  88. package/src/sap/ui/mdc/field/content/UnitContent.js +25 -6
  89. package/src/sap/ui/mdc/filterbar/FilterBarBase.js +43 -24
  90. package/src/sap/ui/mdc/filterbar/PropertyHelper.js +1 -1
  91. package/src/sap/ui/mdc/filterbar/p13n/AdaptationFilterBar.js +1 -1
  92. package/src/sap/ui/mdc/filterbar/vh/FilterBar.js +1 -1
  93. package/src/sap/ui/mdc/flexibility/ActionToolbar.flexibility.js +22 -0
  94. package/src/sap/ui/mdc/flexibility/ActionToolbarAction.flexibility.js +19 -0
  95. package/src/sap/ui/mdc/flexibility/Chart.flexibility.js +1 -1
  96. package/src/sap/ui/mdc/flexibility/FilterBar.flexibility.js +1 -1
  97. package/src/sap/ui/mdc/flexibility/FilterItemFlex.js +1 -1
  98. package/src/sap/ui/mdc/flexibility/ItemBaseFlex.js +203 -197
  99. package/src/sap/ui/mdc/library.js +603 -5
  100. package/src/sap/ui/mdc/link/ContactDetails.js +1 -1
  101. package/src/sap/ui/mdc/link/ContactDetailsAddressItem.js +1 -1
  102. package/src/sap/ui/mdc/link/ContactDetailsEmailItem.js +1 -1
  103. package/src/sap/ui/mdc/link/ContactDetailsItem.js +1 -1
  104. package/src/sap/ui/mdc/link/ContactDetailsPhoneItem.js +1 -1
  105. package/src/sap/ui/mdc/link/Factory.js +1 -1
  106. package/src/sap/ui/mdc/link/FakeFlpConnector.js +1 -1
  107. package/src/sap/ui/mdc/link/LinkItem.js +1 -1
  108. package/src/sap/ui/mdc/link/Panel.js +1 -1
  109. package/src/sap/ui/mdc/link/PanelItem.js +1 -1
  110. package/src/sap/ui/mdc/link/PanelListItem.js +1 -1
  111. package/src/sap/ui/mdc/link/SelectionDialog.js +2 -2
  112. package/src/sap/ui/mdc/link/SelectionDialogItem.js +1 -1
  113. package/src/sap/ui/mdc/link/SemanticObjectMapping.js +1 -1
  114. package/src/sap/ui/mdc/link/SemanticObjectMappingItem.js +1 -1
  115. package/src/sap/ui/mdc/link/SemanticObjectUnavailableAction.js +1 -1
  116. package/src/sap/ui/mdc/messagebundle.properties +37 -3
  117. package/src/sap/ui/mdc/messagebundle_ar.properties +24 -3
  118. package/src/sap/ui/mdc/messagebundle_bg.properties +23 -2
  119. package/src/sap/ui/mdc/messagebundle_ca.properties +23 -2
  120. package/src/sap/ui/mdc/messagebundle_cs.properties +36 -15
  121. package/src/sap/ui/mdc/messagebundle_cy.properties +23 -2
  122. package/src/sap/ui/mdc/messagebundle_da.properties +23 -2
  123. package/src/sap/ui/mdc/messagebundle_de.properties +23 -2
  124. package/src/sap/ui/mdc/messagebundle_el.properties +24 -3
  125. package/src/sap/ui/mdc/messagebundle_en.properties +23 -2
  126. package/src/sap/ui/mdc/messagebundle_en_GB.properties +23 -2
  127. package/src/sap/ui/mdc/messagebundle_en_US_sappsd.properties +23 -2
  128. package/src/sap/ui/mdc/messagebundle_en_US_saptrc.properties +23 -2
  129. package/src/sap/ui/mdc/messagebundle_es.properties +48 -27
  130. package/src/sap/ui/mdc/messagebundle_es_MX.properties +23 -2
  131. package/src/sap/ui/mdc/messagebundle_et.properties +23 -2
  132. package/src/sap/ui/mdc/messagebundle_fi.properties +24 -3
  133. package/src/sap/ui/mdc/messagebundle_fr.properties +36 -15
  134. package/src/sap/ui/mdc/messagebundle_fr_CA.properties +23 -2
  135. package/src/sap/ui/mdc/messagebundle_hi.properties +23 -2
  136. package/src/sap/ui/mdc/messagebundle_hr.properties +23 -2
  137. package/src/sap/ui/mdc/messagebundle_hu.properties +24 -3
  138. package/src/sap/ui/mdc/messagebundle_id.properties +23 -2
  139. package/src/sap/ui/mdc/messagebundle_it.properties +46 -25
  140. package/src/sap/ui/mdc/messagebundle_iw.properties +23 -2
  141. package/src/sap/ui/mdc/messagebundle_ja.properties +30 -9
  142. package/src/sap/ui/mdc/messagebundle_kk.properties +23 -2
  143. package/src/sap/ui/mdc/messagebundle_ko.properties +23 -2
  144. package/src/sap/ui/mdc/messagebundle_lt.properties +23 -2
  145. package/src/sap/ui/mdc/messagebundle_lv.properties +23 -2
  146. package/src/sap/ui/mdc/messagebundle_ms.properties +23 -2
  147. package/src/sap/ui/mdc/messagebundle_nl.properties +24 -3
  148. package/src/sap/ui/mdc/messagebundle_no.properties +30 -9
  149. package/src/sap/ui/mdc/messagebundle_pl.properties +27 -6
  150. package/src/sap/ui/mdc/messagebundle_pt.properties +24 -3
  151. package/src/sap/ui/mdc/messagebundle_pt_PT.properties +23 -2
  152. package/src/sap/ui/mdc/messagebundle_ro.properties +26 -5
  153. package/src/sap/ui/mdc/messagebundle_ru.properties +23 -2
  154. package/src/sap/ui/mdc/messagebundle_sh.properties +23 -2
  155. package/src/sap/ui/mdc/messagebundle_sk.properties +24 -3
  156. package/src/sap/ui/mdc/messagebundle_sl.properties +23 -2
  157. package/src/sap/ui/mdc/messagebundle_sv.properties +24 -3
  158. package/src/sap/ui/mdc/messagebundle_th.properties +29 -8
  159. package/src/sap/ui/mdc/messagebundle_tr.properties +23 -2
  160. package/src/sap/ui/mdc/messagebundle_uk.properties +23 -2
  161. package/src/sap/ui/mdc/messagebundle_vi.properties +23 -2
  162. package/src/sap/ui/mdc/messagebundle_zh_CN.properties +23 -2
  163. package/src/sap/ui/mdc/messagebundle_zh_TW.properties +23 -2
  164. package/src/sap/ui/mdc/mixin/AdaptationMixin.js +1 -1
  165. package/src/sap/ui/mdc/mixin/DelegateMixin.js +1 -1
  166. package/src/sap/ui/mdc/mixin/FilterIntegrationMixin.js +3 -3
  167. package/src/sap/ui/mdc/mixin/PromiseMixin.js +94 -0
  168. package/src/sap/ui/mdc/odata/v4/ChartPropertyHelperNew.js +1 -1
  169. package/src/sap/ui/mdc/odata/v4/TableDelegate.js +65 -37
  170. package/src/sap/ui/mdc/odata/v4/ValueHelpDelegate.js +94 -0
  171. package/src/sap/ui/mdc/odata/v4/vizChart/ChartDelegateNew.js +221 -32
  172. package/src/sap/ui/mdc/p13n/Engine.js +34 -10
  173. package/src/sap/ui/mdc/p13n/P13nBuilder.js +2 -2
  174. package/src/sap/ui/mdc/p13n/PersistenceProvider.js +21 -10
  175. package/src/sap/ui/mdc/p13n/PropertyHelper.js +1 -1
  176. package/src/sap/ui/mdc/p13n/StateUtil.js +20 -0
  177. package/src/sap/ui/mdc/p13n/UIManager.js +11 -6
  178. package/src/sap/ui/mdc/p13n/{DefaultProviderRegistry.js → modules/DefaultProviderRegistry.js} +2 -2
  179. package/src/sap/ui/mdc/p13n/modules/StateHandlerRegistry.js +86 -0
  180. package/src/sap/ui/mdc/p13n/panels/ActionToolbarPanel.js +59 -0
  181. package/src/sap/ui/mdc/p13n/panels/AdaptFiltersPanel.js +20 -5
  182. package/src/sap/ui/mdc/p13n/panels/BasePanel.js +8 -8
  183. package/src/sap/ui/mdc/p13n/panels/ChartItemPanel.js +1 -2
  184. package/src/sap/ui/mdc/p13n/panels/ChartItemPanelNew.js +1179 -0
  185. package/src/sap/ui/mdc/p13n/panels/GroupView.js +1 -2
  186. package/src/sap/ui/mdc/p13n/panels/ListView.js +6 -4
  187. package/src/sap/ui/mdc/p13n/panels/SelectionPanel.js +0 -1
  188. package/src/sap/ui/mdc/p13n/panels/SortPanel.js +0 -1
  189. package/src/sap/ui/mdc/p13n/subcontroller/ActionToolbarController.js +89 -0
  190. package/src/sap/ui/mdc/p13n/subcontroller/AggregateController.js +1 -1
  191. package/src/sap/ui/mdc/p13n/subcontroller/BaseController.js +9 -6
  192. package/src/sap/ui/mdc/p13n/subcontroller/ChartItemController.js +33 -4
  193. package/src/sap/ui/mdc/p13n/subcontroller/ColumnController.js +9 -15
  194. package/src/sap/ui/mdc/p13n/subcontroller/GroupController.js +5 -12
  195. package/src/sap/ui/mdc/p13n/subcontroller/SortController.js +19 -21
  196. package/src/sap/ui/mdc/table/Column.js +67 -17
  197. package/src/sap/ui/mdc/table/CreationRow.js +14 -13
  198. package/src/sap/ui/mdc/table/GridTableType.js +11 -11
  199. package/src/sap/ui/mdc/table/PropertyHelper.js +120 -17
  200. package/src/sap/ui/mdc/table/ResponsiveTableType.js +35 -26
  201. package/src/sap/ui/mdc/table/RowSettings.js +8 -6
  202. package/src/sap/ui/mdc/table/TableTypeBase.js +4 -5
  203. package/src/sap/ui/mdc/table/V4AnalyticsPropertyHelper.js +15 -71
  204. package/src/sap/ui/mdc/themes/base/Chart.less +3 -0
  205. package/src/sap/ui/mdc/themes/base/ValueHelpDialog.less +51 -21
  206. package/src/sap/ui/mdc/themes/base/library.source.less +1 -0
  207. package/src/sap/ui/mdc/ui/Container.js +2 -2
  208. package/src/sap/ui/mdc/ui/ContainerItem.js +2 -2
  209. package/src/sap/ui/mdc/util/Common.js +26 -0
  210. package/src/sap/ui/mdc/util/PromiseCache.js +266 -0
  211. package/src/sap/ui/mdc/util/PropertyHelper.js +114 -304
  212. package/src/sap/ui/mdc/valuehelp/Dialog.js +499 -0
  213. package/src/sap/ui/mdc/valuehelp/Popover.js +373 -0
  214. package/src/sap/ui/mdc/valuehelp/base/Container.js +673 -0
  215. package/src/sap/ui/mdc/valuehelp/base/Content.js +658 -0
  216. package/src/sap/ui/mdc/valuehelp/base/DialogTab.js +139 -0
  217. package/src/sap/ui/mdc/valuehelp/base/FilterableListContent.js +584 -0
  218. package/src/sap/ui/mdc/valuehelp/base/ListContent.js +133 -0
  219. package/src/sap/ui/mdc/valuehelp/content/Bool.js +318 -0
  220. package/src/sap/ui/mdc/valuehelp/content/Conditions.js +270 -0
  221. package/src/sap/ui/mdc/valuehelp/content/FixedList.js +532 -0
  222. package/src/sap/ui/mdc/valuehelp/content/MDCTable.js +643 -0
  223. package/src/sap/ui/mdc/valuehelp/content/MTable.js +928 -0
  224. package/test/sap/ui/mdc/testutils/opa/TestLibrary.js +3 -2
  225. package/test/sap/ui/mdc/testutils/opa/actions/OpenContextMenu.js +48 -0
  226. package/test/sap/ui/mdc/testutils/opa/chartNew/ActionsBase.js +310 -0
  227. package/test/sap/ui/mdc/testutils/opa/chartNew/ActionsViz.js +39 -0
  228. package/test/sap/ui/mdc/testutils/opa/chartNew/AssertionsBase.js +118 -0
  229. package/test/sap/ui/mdc/testutils/opa/chartNew/AssertionsViz.js +137 -0
  230. package/test/sap/ui/mdc/testutils/opa/chartNew/ChartNew.js +24 -0
  231. package/test/sap/ui/mdc/testutils/opa/chartNew/TestObjects.js +289 -0
  232. package/test/sap/ui/mdc/testutils/opa/filterbar/Actions.js +250 -0
  233. package/test/sap/ui/mdc/testutils/opa/filterbar/Assertions.js +91 -0
  234. package/test/sap/ui/mdc/testutils/opa/filterbar/TestObjects.js +137 -0
  235. package/test/sap/ui/mdc/testutils/opa/filterbar/Util.js +25 -0
  236. package/test/sap/ui/mdc/testutils/opa/p13n/Actions.js +407 -93
  237. package/test/sap/ui/mdc/testutils/opa/p13n/Util.js +4 -1
  238. package/test/sap/ui/mdc/testutils/opa/p13n/{waitForP13nButtonWithParentAndIcon.js → waitForP13nButtonWithMatchers.js} +5 -18
  239. package/test/sap/ui/mdc/testutils/opa/table/TestObjects.js +0 -1
  240. package/src/sap/ui/mdc/p13n/panels/GroupPanel.js +0 -111
  241. package/src/sap/ui/mdc/p13n/panels/QueryPanel.js +0 -322
  242. package/src/sap/ui/mdc/p13n/panels/SortQueryPanel.js +0 -133
  243. package/src/sap/ui/mdc/p13n/panels/Wrapper.js +0 -203
@@ -0,0 +1,532 @@
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/valuehelp/base/ListContent",
9
+ "sap/ui/mdc/util/loadModules",
10
+ "sap/ui/mdc/enum/ConditionValidated",
11
+ "sap/ui/model/ParseException",
12
+ "sap/ui/mdc/enum/SelectType"
13
+ ], function(
14
+ ListContent,
15
+ loadModules,
16
+ ConditionValidated,
17
+ ParseException,
18
+ SelectType
19
+ ) {
20
+ "use strict";
21
+
22
+ /**
23
+ * Constructor for a new <code>FixedList</code> content.
24
+ *
25
+ * @param {string} [sId] ID for the new control, generated automatically if no ID is given
26
+ * @param {object} [mSettings] Initial settings for the new control
27
+ * @class Content for the <code>sap.ui.mdc.valuehelp.base.Container</code> element showing a list with fix values.
28
+ * @extends sap.ui.mdc.valuehelp.base.Content
29
+ * @version 1.97.0
30
+ * @constructor
31
+ * @abstract
32
+ * @private
33
+ * @ui5-restricted sap.ui.mdc
34
+ * @since 1.95.0
35
+ * @alias sap.ui.mdc.valuehelp.content.FixedList
36
+ * @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel
37
+ */
38
+ var FixedList = ListContent.extend("sap.ui.mdc.valuehelp.content.FixedList", /** @lends sap.ui.mdc.valuehelp.content.FixedList.prototype */
39
+ {
40
+ metadata: {
41
+ library: "sap.ui.mdc",
42
+ interfaces: [
43
+ "sap.ui.mdc.valuehelp.ITypeaheadContent",
44
+ "sap.ui.mdc.valuehelp.IDialogContent"
45
+ ],
46
+ properties: {
47
+ /**
48
+ * If set, the items of the list can be grouped
49
+ */
50
+ groupable: {
51
+ type: "boolean",
52
+ group: "Appearance",
53
+ defaultValue : false
54
+ },
55
+ /**
56
+ * If set, the items of the list are filtered based on <code>filterValue</code>.
57
+ *
58
+ * If a type-ahead behavior for the connected field is wanted, this property must be set to <code>true</code>.
59
+ * For small lists all values are meant to be shown, independent of the typing in the connected field.
60
+ * In this case this property must be set to <code>false</code>.
61
+ *
62
+ * If not set, the list opens if the user clicks into the connected field.
63
+ */
64
+ filterList: {
65
+ type: "boolean",
66
+ group: "Appearance",
67
+ defaultValue: true
68
+ }
69
+ },
70
+ aggregations: {
71
+ /**
72
+ * Items of the field help.
73
+ *
74
+ * The <code>key</code> of the items is not shown in the list, but is used as a value of the connected field.
75
+ *
76
+ * If the <code>additionalText</code> for all the items is not used, the column will not be displayed.
77
+ *
78
+ * <b>Note:</b> At the moment, icons are not supported.
79
+ *
80
+ */
81
+ items: {
82
+ type: "sap.ui.mdc.field.ListFieldHelpItem",
83
+ multiple: true,
84
+ singularName : "item"
85
+ }
86
+ },
87
+ defaultAggregation: "items",
88
+ events: {
89
+
90
+ }
91
+ }
92
+ });
93
+
94
+ FixedList.prototype.init = function() {
95
+
96
+ ListContent.prototype.init.apply(this, arguments);
97
+
98
+ this._oResourceBundle = sap.ui.getCore().getLibraryResourceBundle("sap.ui.mdc");
99
+
100
+ };
101
+
102
+ FixedList.prototype.exit = function() {
103
+
104
+ if (this._oManagedObjectModel) {
105
+ this._oManagedObjectModel.destroy();
106
+ delete this._oManagedObjectModel;
107
+ }
108
+
109
+ ListContent.prototype.exit.apply(this, arguments);
110
+ };
111
+
112
+ FixedList.prototype.getContent = function () {
113
+ return this._retrievePromise("content", function () {
114
+ return loadModules([
115
+ "sap/m/List",
116
+ "sap/m/DisplayListItem",
117
+ "sap/m/library",
118
+ "sap/ui/model/Filter",
119
+ "sap/ui/model/Sorter",
120
+ "sap/ui/model/base/ManagedObjectModel"
121
+ ]).then(function (aModules) {
122
+ var List = aModules[0];
123
+ var DisplayListItem = aModules[1];
124
+ var mLibrary = aModules[2];
125
+ var Filter = aModules[3];
126
+ var Sorter = aModules[4];
127
+ var ManagedObjectModel = aModules[5];
128
+
129
+ this._oManagedObjectModel = new ManagedObjectModel(this);
130
+
131
+ var oItemTemplate = new DisplayListItem(this.getId() + "-item", {
132
+ type: mLibrary.ListType.Active,
133
+ label: "{$help>text}",
134
+ value: "{$help>additionalText}",
135
+ valueTextDirection: "{$help>textDirection}"
136
+ }).addStyleClass("sapMComboBoxNonInteractiveItem"); // to add focus outline to selected items
137
+
138
+ var oFilter = new Filter({path: "text", test: _suggestFilter.bind(this), caseSensitive: true}); // caseSensitive at it is checked in filter-function
139
+
140
+ // add sorter only if supported
141
+ var oSorter;
142
+ if (this.getGroupable()) {
143
+ oSorter = new Sorter("groupKey", false, _suggestGrouping.bind(this));
144
+ }
145
+
146
+ var oList = new List(this.getId() + "-List", {
147
+ width: "100%",
148
+ showNoData: false,
149
+ mode: mLibrary.ListMode.SingleSelectMaster,
150
+ rememberSelections: false,
151
+ items: {path: "$help>/items", template: oItemTemplate, filters: oFilter, sorter: oSorter, templateShareable: false},
152
+ itemPress: _handleItemPress.bind(this) // as selected item can be pressed
153
+ }).addStyleClass("sapMComboBoxBaseList").addStyleClass("sapMComboBoxList");
154
+
155
+ oList.setModel(this._oManagedObjectModel, "$help");
156
+ // oList.bindElement({ path: "/", model: "$help" });
157
+ this.setAggregation("displayContent", oList, true); // to have in control tree
158
+
159
+ return oList;
160
+ }.bind(this));
161
+ }.bind(this));
162
+ };
163
+
164
+ function _getList() {
165
+
166
+ return this.getAggregation("displayContent");
167
+
168
+ }
169
+
170
+ function _handleItemPress(oEvent) {
171
+
172
+ var oItem = oEvent.getParameter("listItem");
173
+ var bSelected = oItem.getSelected();
174
+
175
+ if (bSelected) {
176
+ var oOriginalItem = _getOriginalItem.call(this, oItem);
177
+ var vKey = _getKey.call(this, oOriginalItem);
178
+ // this.fireRemoveConditions({conditions: this.getConditions()});
179
+ _setConditions.call(this, vKey, oItem.getLabel());
180
+ // this.fireAddConditions({conditions: this.getConditions()});
181
+ this.fireSelect({type: SelectType.Set, conditions: this.getConditions()});
182
+ this.fireConfirm();
183
+ }
184
+
185
+ }
186
+
187
+ function _setConditions(vKey, sValue) {
188
+
189
+ var oCondition = this._createCondition(vKey, sValue);
190
+ this.setProperty("conditions", [oCondition], true);
191
+
192
+ return oCondition;
193
+
194
+ }
195
+
196
+ function _suggestFilter(sText) {
197
+
198
+ var bFilterList = this.getFilterList();
199
+
200
+ return !bFilterList || _filterText.call(this, sText, this.getFilterValue());
201
+
202
+ }
203
+
204
+ function _filterText(sText, sFilterValue) {
205
+
206
+ return !sFilterValue || (typeof sFilterValue === "string" && (this.getCaseSensitive() ? sText.startsWith(sFilterValue) : sText.toLowerCase().startsWith(sFilterValue.toLowerCase())));
207
+
208
+ }
209
+
210
+ function _updateFilter() {
211
+
212
+ var oList = _getList.call(this);
213
+ if (oList) {
214
+ var oBinding = oList.getBinding("items");
215
+ oBinding.update();
216
+ oList.updateItems();
217
+ oList.invalidate();
218
+ _updateSelection.call(this); // to update selection
219
+ }
220
+
221
+ }
222
+
223
+ function _suggestGrouping(oContext) {
224
+
225
+ var vKey = oContext.getProperty('groupKey');
226
+ var sText = oContext.getProperty('groupText');
227
+ return {key: vKey, text: sText};
228
+
229
+ }
230
+
231
+ function _updateSelection() {
232
+
233
+ var oList = _getList.call(this);
234
+ if (oList) {
235
+ var aConditions = this.getConditions();
236
+ var vSelectedKey;
237
+ var sFilterValue = this.getFilterValue();
238
+ var bUseFirstMatch = this.getUseFirstMatch();
239
+ var bFistFilterItemSelected = false;
240
+ // var oOperator = this._getOperator();
241
+
242
+ if (aConditions.length > 0 && (aConditions[0].validated === ConditionValidated.Validated || aConditions[0].operator === "EQ"/*oOperator.name*/)) {
243
+ vSelectedKey = aConditions[0].values[0];
244
+ }
245
+
246
+ var aItems = oList.getItems();
247
+ for (var i = 0; i < aItems.length; i++) {
248
+ var oItem = aItems[i];
249
+ if (oItem.isA("sap.m.DisplayListItem")) { // not for group headers
250
+ var oOriginalItem = _getOriginalItem.call(this, oItem);
251
+ if (aConditions.length > 0 && _getKey.call(this, oOriginalItem) === vSelectedKey) {
252
+ // conditions given -> use them to show selected items
253
+ oItem.setSelected(true);
254
+ } else if (aConditions.length === 0 && bUseFirstMatch && sFilterValue && !bFistFilterItemSelected && _filterText.call(this, oItem.getLabel(), sFilterValue)) {
255
+ // filter value used -> show first match as selected
256
+ oItem.setSelected(true);
257
+ bFistFilterItemSelected = true;
258
+ } else if (this.hasOwnProperty("_iNavigateIndex") && i === this._iNavigateIndex) { // TODO: better solution
259
+ // let navigated item be selected
260
+ oItem.setSelected(true);
261
+ } else {
262
+ oItem.setSelected(false);
263
+ }
264
+ }
265
+ }
266
+ }
267
+ }
268
+
269
+ // returns ListFieldHelp item for inner list item
270
+ function _getOriginalItem(oItem) {
271
+
272
+ var sPath = oItem.getBindingContextPath();
273
+ return this._oManagedObjectModel.getProperty(sPath);
274
+
275
+ }
276
+
277
+ function _getKey(oItem) {
278
+
279
+ // as key could have internally another type - use initial value of binding
280
+ // TODO: better logic?
281
+ var oBinding = oItem.getBinding("key");
282
+ if (oBinding) {
283
+ return oBinding.getInternalValue();
284
+ } else {
285
+ return oItem.getKey();
286
+ }
287
+
288
+ }
289
+
290
+ FixedList.prototype.getItemForValue = function (oConfig) {
291
+
292
+ return Promise.resolve().then(function() {
293
+ if (oConfig.value === null || oConfig.value === undefined) {
294
+ return null;
295
+ } else if (!oConfig.value && oConfig.checkDescription) {
296
+ return null; // no check for empty description
297
+ }
298
+
299
+ var aItems = this.getItems();
300
+ var oItem;
301
+ var i = 0;
302
+ var vKey;
303
+ var sText;
304
+
305
+ for (i = 0; i < aItems.length; i++) {
306
+ oItem = aItems[i];
307
+ vKey = _getKey.call(this, oItem);
308
+ sText = oItem.getText();
309
+ if ((oConfig.checkKey && vKey === oConfig.parsedValue) || (oConfig.checkDescription && (sText === oConfig.value || vKey == oConfig.value))) {
310
+ return {key: vKey, description: oItem.getText()};
311
+ }
312
+ }
313
+
314
+ if (oConfig.checkKey && oConfig.value === "") {
315
+ // empty key and no item with empty key
316
+ return null;
317
+ }
318
+
319
+ if (oConfig.checkDescription && this.getUseFirstMatch()) {
320
+ for (i = 0; i < aItems.length; i++) {
321
+ oItem = aItems[i];
322
+ sText = oItem.getText();
323
+ if (_filterText.call(this, sText, oConfig.value)) {
324
+ vKey = _getKey.call(this, oItem);
325
+ return {key: vKey, description: sText};
326
+ }
327
+ }
328
+ }
329
+
330
+ var sError = this._oResourceBundle.getText("valuehelp.VALUE_NOT_EXIST", [oConfig.value]);
331
+ var Exception = oConfig.exception || ParseException;
332
+ throw new Exception(sError);
333
+
334
+ }.bind(this));
335
+
336
+ };
337
+
338
+ FixedList.prototype.isValidationSupported = function(oConfig) {
339
+ return true;
340
+ };
341
+
342
+ FixedList.prototype._handleConditionsUpdate = function(oChanges) {
343
+ _updateSelection.call(this);
344
+ };
345
+
346
+ FixedList.prototype._handleFilterValueUpdate = function(oChanges) {
347
+ _updateFilter.call(this);
348
+ };
349
+
350
+ FixedList.prototype.removeFocus = function() {
351
+
352
+ var oList = _getList.call(this);
353
+ if (oList) {
354
+ oList.removeStyleClass("sapMListFocus");
355
+ }
356
+
357
+ };
358
+
359
+ FixedList.prototype.navigate = function(iStep) {
360
+
361
+ var oList = _getList.call(this);
362
+
363
+ if (!oList) {
364
+ return; // TODO: should not happen? Create List?
365
+ }
366
+
367
+ oList.addStyleClass("sapMListFocus"); // to show focus outline on navigated item
368
+
369
+ var oSelectedItem = oList.getSelectedItem();
370
+ var aItems = oList.getItems();
371
+ var iItems = aItems.length;
372
+ var iSelectedIndex = 0;
373
+ var bFilterList = this.getFilterList();
374
+ var sFilterValue = this.getFilterValue();
375
+ var bLeaveFocus = false;
376
+
377
+ if (!bFilterList && !oSelectedItem) {
378
+ // try to find item that matches Filter
379
+ var i = 0;
380
+ if (iStep >= 0) {
381
+ for (i = 0; i < aItems.length; i++) {
382
+ if (!aItems[i].isA("sap.m.GroupHeaderListItem") && _filterText.call(this, aItems[i].getLabel(), sFilterValue)) {
383
+ iSelectedIndex = i;
384
+ break;
385
+ }
386
+ }
387
+ } else {
388
+ for (i = aItems.length - 1; i >= 0; i--) {
389
+ if (!aItems[i].isA("sap.m.GroupHeaderListItem") && _filterText.call(this, aItems[i].getLabel(), sFilterValue)) {
390
+ iSelectedIndex = i;
391
+ break;
392
+ }
393
+ }
394
+ }
395
+ } else if (oSelectedItem) {
396
+ iSelectedIndex = oList.indexOfItem(oSelectedItem);
397
+ iSelectedIndex = iSelectedIndex + iStep;
398
+ } else if (iStep >= 0){
399
+ iSelectedIndex = iStep - 1;
400
+ } else {
401
+ iSelectedIndex = iItems + iStep;
402
+ }
403
+
404
+ var bSearchForNext;
405
+ if (iSelectedIndex < 0) {
406
+ iSelectedIndex = 0;
407
+ bSearchForNext = true;
408
+ bLeaveFocus = true;
409
+ } else if (iSelectedIndex >= iItems - 1) {
410
+ iSelectedIndex = iItems - 1;
411
+ bSearchForNext = false;
412
+ } else {
413
+ bSearchForNext = iStep >= 0;
414
+ }
415
+
416
+ while (aItems[iSelectedIndex] && aItems[iSelectedIndex].isA("sap.m.GroupHeaderListItem")) { // ignore group headers
417
+ if (bSearchForNext) {
418
+ iSelectedIndex++;
419
+ } else {
420
+ iSelectedIndex--;
421
+ }
422
+ }
423
+ if (iSelectedIndex < 0 || iSelectedIndex > iItems - 1) {
424
+ // find last not groupable item
425
+ bSearchForNext = !bSearchForNext;
426
+ bLeaveFocus = iSelectedIndex < 0;
427
+ iSelectedIndex = iSelectedIndex < 0 ? 0 : iItems - 1;
428
+ while (aItems[iSelectedIndex] && aItems[iSelectedIndex].isA("sap.m.GroupHeaderListItem")) { // ignore group headers
429
+ if (bSearchForNext) {
430
+ iSelectedIndex++;
431
+ } else {
432
+ iSelectedIndex--;
433
+ }
434
+ }
435
+ }
436
+
437
+ var oItem = aItems[iSelectedIndex];
438
+ if (oItem) {
439
+ if (oItem !== oSelectedItem) {
440
+ var oOriginalItem = _getOriginalItem.call(this, oItem);
441
+ var vKey = _getKey.call(this, oOriginalItem);
442
+
443
+ if (this.getParent().isOpen()) {
444
+ oList.scrollToIndex(iSelectedIndex); // only possible if open
445
+ } else {
446
+ this._iNavigateIndex = iSelectedIndex; // TODO: better solution
447
+ }
448
+
449
+ oItem.setSelected(true);
450
+ var oCondition = _setConditions.call(this, vKey, oItem.getLabel());
451
+ this.fireNavigated({condition: oCondition, itemId: oItem.getId(), leaveFocus: false});
452
+ } else if (bLeaveFocus) {
453
+ this.fireNavigated({condition: undefined, itemId: undefined, leaveFocus: bLeaveFocus});
454
+ }
455
+ }
456
+
457
+ };
458
+
459
+ FixedList.prototype.onShow = function () { // TODO: name
460
+
461
+ ListContent.prototype.onShow.apply(this, arguments);
462
+
463
+ // scroll to selected item
464
+ var oList = _getList.call(this);
465
+
466
+ if (!oList) {
467
+ return; // TODO: should not happen? Create List?
468
+ }
469
+
470
+ var oSelectedItem = oList.getSelectedItem();
471
+ if (oSelectedItem) {
472
+ var iSelectedIndex = oList.indexOfItem(oSelectedItem);
473
+ oList.scrollToIndex(iSelectedIndex);
474
+ }
475
+
476
+ if (this.hasOwnProperty("_iNavigateIndex")) { // initialize after opening
477
+ delete this._iNavigateIndex;
478
+ }
479
+ };
480
+
481
+ FixedList.prototype.onHide = function () {
482
+
483
+ this.removeFocus();
484
+
485
+ };
486
+
487
+ FixedList.prototype.getValueHelpIcon = function() {
488
+
489
+ if (this.getUseAsValueHelp()) {
490
+ return "sap-icon://slim-arrow-down";
491
+ } else {
492
+ return null;
493
+ }
494
+
495
+ };
496
+
497
+ FixedList.prototype.getAriaAttributes = function(iMaxConditions) {
498
+
499
+ return { // return default values, but needs to be implemented by specific content
500
+ contentId: this.getId() + "-List", // as list might be created async, use fix ID
501
+ ariaHasPopup: "listbox",
502
+ roleDescription: null // no multi-selection
503
+ };
504
+
505
+ };
506
+
507
+ FixedList.prototype.shouldOpenOnClick = function() {
508
+
509
+ return !this.getFilterList(); // TODO: own property, maybe general at content?
510
+
511
+ };
512
+
513
+ FixedList.prototype.isFocusInHelp = function() {
514
+
515
+ return false; // focus should stay in field, even if opened as valueHelp
516
+
517
+ };
518
+
519
+ FixedList.prototype._isSingleSelect = function (oEvent) {
520
+
521
+ return true;
522
+
523
+ };
524
+
525
+ FixedList.prototype.shouldOpenOnNavigate = function() {
526
+
527
+ return !ListContent.prototype._isSingleSelect.apply(this);
528
+
529
+ };
530
+
531
+ return FixedList;
532
+ });