@openui5/sap.ui.mdc 1.96.5 → 1.99.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 (282) hide show
  1. package/.reuse/dep5 +26 -31
  2. package/THIRDPARTY.txt +15 -21
  3. package/package.json +4 -4
  4. package/src/sap/ui/mdc/.library +1 -1
  5. package/src/sap/ui/mdc/ActionToolbar.js +7 -9
  6. package/src/sap/ui/mdc/AggregationBaseDelegate.js +2 -2
  7. package/src/sap/ui/mdc/BaseDelegate.js +1 -1
  8. package/src/sap/ui/mdc/Chart.js +1100 -1796
  9. package/src/sap/ui/mdc/ChartDelegate.js +429 -270
  10. package/src/sap/ui/mdc/ChartRenderer.js +73 -77
  11. package/src/sap/ui/mdc/Control.js +1 -1
  12. package/src/sap/ui/mdc/Element.js +1 -1
  13. package/src/sap/ui/mdc/Field.js +3 -2
  14. package/src/sap/ui/mdc/FilterBar.js +3 -2
  15. package/src/sap/ui/mdc/FilterField.js +25 -8
  16. package/src/sap/ui/mdc/Link.js +23 -4
  17. package/src/sap/ui/mdc/LinkDelegate.js +3 -3
  18. package/src/sap/ui/mdc/MultiValueField.js +21 -6
  19. package/src/sap/ui/mdc/Table.js +204 -161
  20. package/src/sap/ui/mdc/TableDelegate.js +47 -17
  21. package/src/sap/ui/mdc/ValueHelp.js +51 -15
  22. package/src/sap/ui/mdc/ValueHelpDelegate.js +20 -0
  23. package/src/sap/ui/mdc/actiontoolbar/ActionToolbarAction.js +2 -2
  24. package/src/sap/ui/mdc/{chartNew/ChartSelectionDetailsNew.js → chart/ChartSelectionDetails.js} +8 -8
  25. package/src/sap/ui/mdc/{chartNew/ChartToolbarNew.js → chart/ChartToolbar.js} +49 -13
  26. package/src/sap/ui/mdc/chart/ChartTypeButton.js +55 -54
  27. package/src/sap/ui/mdc/{chartNew/DrillBreadcrumbsNew.js → chart/DrillBreadcrumbs.js} +3 -3
  28. package/src/sap/ui/mdc/chart/DrillStackHandler.js +38 -249
  29. package/src/sap/ui/mdc/chart/Item.js +62 -92
  30. package/src/sap/ui/mdc/{chartNew/PropertyHelperNew.js → chart/PropertyHelper.js} +3 -3
  31. package/src/sap/ui/mdc/chart/SelectionDetailsActions.js +17 -21
  32. package/src/sap/ui/mdc/condition/Condition.js +1 -1
  33. package/src/sap/ui/mdc/condition/ConditionConverter.js +1 -1
  34. package/src/sap/ui/mdc/condition/ConditionModel.js +1 -1
  35. package/src/sap/ui/mdc/condition/FilterConverter.js +1 -1
  36. package/src/sap/ui/mdc/condition/FilterOperatorUtil.js +261 -44
  37. package/src/sap/ui/mdc/condition/Operator.js +9 -9
  38. package/src/sap/ui/mdc/condition/OperatorDynamicDateOption.js +437 -0
  39. package/src/sap/ui/mdc/condition/RangeOperator.js +1 -1
  40. package/src/sap/ui/mdc/designtime/chart/Chart.designtime.js +80 -5
  41. package/src/sap/ui/mdc/designtime/field/Field.designtime.js +97 -0
  42. package/src/sap/ui/mdc/designtime/field/FieldBase.designtime.js +104 -0
  43. package/src/sap/ui/mdc/designtime/field/FilterField.designtime.js +22 -0
  44. package/src/sap/ui/mdc/designtime/field/MultiValueField.designtime.js +23 -0
  45. package/src/sap/ui/mdc/designtime/filterbar/FilterBarBase.designtime.js +3 -0
  46. package/src/sap/ui/mdc/designtime/table/Table.designtime.js +60 -20
  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 +9 -9
  50. package/src/sap/ui/mdc/field/ConditionsType.js +7 -7
  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 +75 -27
  54. package/src/sap/ui/mdc/field/DynamicDateRangeConditionsType.js +311 -0
  55. package/src/sap/ui/mdc/field/FieldBase.js +85 -52
  56. package/src/sap/ui/mdc/field/FieldBaseRenderer.js +0 -3
  57. package/src/sap/ui/mdc/field/FieldHelpBase.js +2 -2
  58. package/src/sap/ui/mdc/field/FieldInfoBase.js +23 -10
  59. package/src/sap/ui/mdc/field/FieldInput.js +1 -1
  60. package/src/sap/ui/mdc/field/FieldInputRenderUtil.js +1 -1
  61. package/src/sap/ui/mdc/field/FieldMultiInput.js +1 -1
  62. package/src/sap/ui/mdc/field/FieldValueHelp.js +7 -7
  63. package/src/sap/ui/mdc/field/FieldValueHelpContentWrapperBase.js +1 -1
  64. package/src/sap/ui/mdc/field/FieldValueHelpDelegate.js +20 -0
  65. package/src/sap/ui/mdc/field/FieldValueHelpMTableWrapper.js +1 -1
  66. package/src/sap/ui/mdc/field/FieldValueHelpMdcTableWrapper.js +2 -2
  67. package/src/sap/ui/mdc/field/FieldValueHelpTableWrapperBase.js +7 -3
  68. package/src/sap/ui/mdc/field/FieldValueHelpUITableWrapper.js +1 -1
  69. package/src/sap/ui/mdc/field/InParameter.js +1 -1
  70. package/src/sap/ui/mdc/field/ListFieldHelp.js +10 -2
  71. package/src/sap/ui/mdc/field/ListFieldHelpItem.js +1 -1
  72. package/src/sap/ui/mdc/field/MultiValueFieldItem.js +1 -1
  73. package/src/sap/ui/mdc/field/OutParameter.js +1 -1
  74. package/src/sap/ui/mdc/field/TokenDisplay.js +70 -0
  75. package/src/sap/ui/mdc/field/TokenDisplayRenderer.js +24 -0
  76. package/src/sap/ui/mdc/field/TokenizerDisplay.js +80 -0
  77. package/src/sap/ui/mdc/field/TokenizerDisplayRenderer.js +69 -0
  78. package/src/sap/ui/mdc/field/ValueHelpPanel.js +2 -1
  79. package/src/sap/ui/mdc/field/content/BooleanContent.js +1 -1
  80. package/src/sap/ui/mdc/field/content/ContentFactory.js +28 -26
  81. package/src/sap/ui/mdc/field/content/DateContent.js +128 -2
  82. package/src/sap/ui/mdc/field/content/DateTimeContent.js +9 -1
  83. package/src/sap/ui/mdc/field/content/DefaultContent.js +36 -14
  84. package/src/sap/ui/mdc/field/content/LinkContent.js +1 -1
  85. package/src/sap/ui/mdc/field/content/TimeContent.js +8 -1
  86. package/src/sap/ui/mdc/field/content/UnitContent.js +23 -4
  87. package/src/sap/ui/mdc/filterbar/FilterBarBase.js +359 -142
  88. package/src/sap/ui/mdc/filterbar/FilterBarBaseRenderer.js +1 -1
  89. package/src/sap/ui/mdc/filterbar/PropertyHelper.js +1 -1
  90. package/src/sap/ui/mdc/filterbar/p13n/AdaptationFilterBar.js +8 -2
  91. package/src/sap/ui/mdc/filterbar/vh/CollectiveSearchSelect.js +3 -1
  92. package/src/sap/ui/mdc/filterbar/vh/FilterBar.js +7 -1
  93. package/src/sap/ui/mdc/filterbar/vh/GenericFilterBarDelegate.js +6 -6
  94. package/src/sap/ui/mdc/flexibility/AggregateFlex.js +2 -2
  95. package/src/sap/ui/mdc/flexibility/Chart.flexibility.js +6 -4
  96. package/src/sap/ui/mdc/flexibility/ColumnFlex.js +1 -1
  97. package/src/sap/ui/mdc/flexibility/FilterBar.flexibility.js +4 -3
  98. package/src/sap/ui/mdc/flexibility/FilterItemFlex.js +1 -1
  99. package/src/sap/ui/mdc/flexibility/GroupFlex.js +1 -1
  100. package/src/sap/ui/mdc/flexibility/Panel.flexibility.js +9 -3
  101. package/src/sap/ui/mdc/flexibility/PropertyInfoFlex.js +110 -0
  102. package/src/sap/ui/mdc/flexibility/SortFlex.js +2 -2
  103. package/src/sap/ui/mdc/flp/FlpLinkDelegate.js +6 -6
  104. package/src/sap/ui/mdc/library.js +62 -43
  105. package/src/sap/ui/mdc/link/ContactDetails.js +1 -1
  106. package/src/sap/ui/mdc/link/ContactDetailsAddressItem.js +1 -1
  107. package/src/sap/ui/mdc/link/ContactDetailsEmailItem.js +1 -1
  108. package/src/sap/ui/mdc/link/ContactDetailsItem.js +1 -1
  109. package/src/sap/ui/mdc/link/ContactDetailsPhoneItem.js +1 -1
  110. package/src/sap/ui/mdc/link/Factory.js +2 -2
  111. package/src/sap/ui/mdc/link/FakeFlpConnector.js +1 -1
  112. package/src/sap/ui/mdc/link/LinkItem.js +1 -1
  113. package/src/sap/ui/mdc/link/Log.js +1 -1
  114. package/src/sap/ui/mdc/link/Panel.js +140 -177
  115. package/src/sap/ui/mdc/link/PanelItem.js +1 -1
  116. package/src/sap/ui/mdc/link/PanelListItem.js +1 -1
  117. package/src/sap/ui/mdc/link/SemanticObjectMapping.js +1 -1
  118. package/src/sap/ui/mdc/link/SemanticObjectMappingItem.js +1 -1
  119. package/src/sap/ui/mdc/link/SemanticObjectUnavailableAction.js +1 -1
  120. package/src/sap/ui/mdc/messagebundle.properties +68 -5
  121. package/src/sap/ui/mdc/messagebundle_ar.properties +47 -6
  122. package/src/sap/ui/mdc/messagebundle_bg.properties +61 -20
  123. package/src/sap/ui/mdc/messagebundle_ca.properties +45 -4
  124. package/src/sap/ui/mdc/messagebundle_cs.properties +60 -19
  125. package/src/sap/ui/mdc/messagebundle_cy.properties +45 -4
  126. package/src/sap/ui/mdc/messagebundle_da.properties +52 -11
  127. package/src/sap/ui/mdc/messagebundle_de.properties +45 -4
  128. package/src/sap/ui/mdc/messagebundle_el.properties +46 -5
  129. package/src/sap/ui/mdc/messagebundle_en.properties +45 -4
  130. package/src/sap/ui/mdc/messagebundle_en_GB.properties +45 -4
  131. package/src/sap/ui/mdc/messagebundle_en_US_sappsd.properties +51 -2
  132. package/src/sap/ui/mdc/messagebundle_en_US_saprigi.properties +45 -4
  133. package/src/sap/ui/mdc/messagebundle_en_US_saptrc.properties +51 -2
  134. package/src/sap/ui/mdc/messagebundle_es.properties +46 -5
  135. package/src/sap/ui/mdc/messagebundle_es_MX.properties +59 -18
  136. package/src/sap/ui/mdc/messagebundle_et.properties +45 -4
  137. package/src/sap/ui/mdc/messagebundle_fi.properties +51 -10
  138. package/src/sap/ui/mdc/messagebundle_fr.properties +50 -9
  139. package/src/sap/ui/mdc/messagebundle_fr_CA.properties +45 -4
  140. package/src/sap/ui/mdc/messagebundle_hi.properties +46 -5
  141. package/src/sap/ui/mdc/messagebundle_hr.properties +45 -4
  142. package/src/sap/ui/mdc/messagebundle_hu.properties +45 -4
  143. package/src/sap/ui/mdc/messagebundle_id.properties +45 -4
  144. package/src/sap/ui/mdc/messagebundle_it.properties +61 -20
  145. package/src/sap/ui/mdc/messagebundle_iw.properties +46 -5
  146. package/src/sap/ui/mdc/messagebundle_ja.properties +46 -5
  147. package/src/sap/ui/mdc/messagebundle_kk.properties +45 -4
  148. package/src/sap/ui/mdc/messagebundle_ko.properties +46 -5
  149. package/src/sap/ui/mdc/messagebundle_lt.properties +45 -4
  150. package/src/sap/ui/mdc/messagebundle_lv.properties +49 -8
  151. package/src/sap/ui/mdc/messagebundle_ms.properties +45 -4
  152. package/src/sap/ui/mdc/messagebundle_nl.properties +49 -8
  153. package/src/sap/ui/mdc/messagebundle_no.properties +53 -12
  154. package/src/sap/ui/mdc/messagebundle_pl.properties +46 -5
  155. package/src/sap/ui/mdc/messagebundle_pt.properties +52 -11
  156. package/src/sap/ui/mdc/messagebundle_pt_PT.properties +45 -4
  157. package/src/sap/ui/mdc/messagebundle_ro.properties +45 -4
  158. package/src/sap/ui/mdc/messagebundle_ru.properties +45 -4
  159. package/src/sap/ui/mdc/messagebundle_sh.properties +45 -4
  160. package/src/sap/ui/mdc/messagebundle_sk.properties +45 -4
  161. package/src/sap/ui/mdc/messagebundle_sl.properties +45 -4
  162. package/src/sap/ui/mdc/messagebundle_sv.properties +47 -6
  163. package/src/sap/ui/mdc/messagebundle_th.properties +48 -7
  164. package/src/sap/ui/mdc/messagebundle_tr.properties +45 -4
  165. package/src/sap/ui/mdc/messagebundle_uk.properties +49 -8
  166. package/src/sap/ui/mdc/messagebundle_vi.properties +45 -4
  167. package/src/sap/ui/mdc/messagebundle_zh_CN.properties +46 -5
  168. package/src/sap/ui/mdc/messagebundle_zh_TW.properties +45 -4
  169. package/src/sap/ui/mdc/mixin/AdaptationMixin.js +19 -5
  170. package/src/sap/ui/mdc/mixin/DelegateMixin.js +2 -2
  171. package/src/sap/ui/mdc/mixin/FilterIntegrationMixin.js +16 -11
  172. package/src/sap/ui/mdc/mixin/PromiseMixin.js +2 -3
  173. package/src/sap/ui/mdc/odata/TypeUtil.js +1 -1
  174. package/src/sap/ui/mdc/odata/v4/ChartDelegate.js +29 -483
  175. package/src/sap/ui/mdc/odata/v4/{ChartPropertyHelperNew.js → ChartPropertyHelper.js} +5 -5
  176. package/src/sap/ui/mdc/odata/v4/TableDelegate.js +160 -116
  177. package/src/sap/ui/mdc/odata/v4/TypeUtil.js +1 -1
  178. package/src/sap/ui/mdc/odata/v4/ValueHelpDelegate.js +1 -1
  179. package/src/sap/ui/mdc/odata/v4/util/DelegateUtil.js +1 -1
  180. package/src/sap/ui/mdc/odata/v4/vizChart/{ChartDelegateNew.js → ChartDelegate.js} +215 -116
  181. package/src/sap/ui/mdc/p13n/Engine.js +61 -20
  182. package/src/sap/ui/mdc/p13n/FlexUtil.js +11 -118
  183. package/src/sap/ui/mdc/p13n/P13nBuilder.js +8 -8
  184. package/src/sap/ui/mdc/p13n/PersistenceProvider.js +21 -10
  185. package/src/sap/ui/mdc/p13n/PropertyHelper.js +1 -1
  186. package/src/sap/ui/mdc/p13n/StateUtil.js +40 -6
  187. package/src/sap/ui/mdc/p13n/UIManager.js +15 -12
  188. package/src/sap/ui/mdc/p13n/modification/FlexModificationHandler.js +4 -1
  189. package/src/sap/ui/mdc/p13n/modification/ModificationHandler.js +9 -6
  190. package/src/sap/ui/mdc/p13n/{DefaultProviderRegistry.js → modules/DefaultProviderRegistry.js} +2 -2
  191. package/src/sap/ui/mdc/p13n/modules/StateHandlerRegistry.js +86 -0
  192. package/src/sap/ui/mdc/p13n/panels/AdaptFiltersPanel.js +19 -3
  193. package/src/sap/ui/mdc/p13n/panels/ChartItemPanel.js +1092 -48
  194. package/src/sap/ui/mdc/p13n/panels/LinkSelectionPanel.js +72 -0
  195. package/src/sap/ui/mdc/p13n/panels/ListView.js +6 -2
  196. package/src/sap/ui/mdc/p13n/subcontroller/AdaptFiltersController.js +6 -5
  197. package/src/sap/ui/mdc/p13n/subcontroller/AggregateController.js +1 -1
  198. package/src/sap/ui/mdc/p13n/subcontroller/BaseController.js +156 -11
  199. package/src/sap/ui/mdc/p13n/subcontroller/ChartItemController.js +15 -26
  200. package/src/sap/ui/mdc/p13n/subcontroller/ColumnController.js +6 -5
  201. package/src/sap/ui/mdc/p13n/subcontroller/FilterController.js +14 -7
  202. package/src/sap/ui/mdc/p13n/subcontroller/LinkPanelController.js +173 -0
  203. package/src/sap/ui/mdc/p13n/subcontroller/SortController.js +10 -17
  204. package/src/sap/ui/mdc/table/Column.js +35 -10
  205. package/src/sap/ui/mdc/table/CreationRow.js +14 -13
  206. package/src/sap/ui/mdc/table/GridTableType.js +13 -13
  207. package/src/sap/ui/mdc/table/PropertyHelper.js +64 -27
  208. package/src/sap/ui/mdc/table/ResponsiveTableType.js +26 -29
  209. package/src/sap/ui/mdc/table/RowSettings.js +7 -5
  210. package/src/sap/ui/mdc/table/TableTypeBase.js +6 -6
  211. package/src/sap/ui/mdc/table/V4AnalyticsPropertyHelper.js +15 -71
  212. package/src/sap/ui/mdc/themes/base/Chart.less +3 -0
  213. package/src/sap/ui/mdc/themes/base/FieldBase.less +0 -5
  214. package/src/sap/ui/mdc/themes/base/TokenDisplay.less +89 -0
  215. package/src/sap/ui/mdc/themes/base/TokenizerDisplay.less +90 -0
  216. package/src/sap/ui/mdc/themes/base/ValueHelpDialog.less +15 -4
  217. package/src/sap/ui/mdc/themes/base/library.source.less +3 -0
  218. package/src/sap/ui/mdc/ui/Container.js +2 -2
  219. package/src/sap/ui/mdc/ui/ContainerItem.js +2 -2
  220. package/src/sap/ui/mdc/util/Common.js +1 -1
  221. package/src/sap/ui/mdc/util/DateUtil.js +1 -1
  222. package/src/sap/ui/mdc/util/FilterUtil.js +1 -1
  223. package/src/sap/ui/mdc/util/FormatUtil.js +3 -3
  224. package/src/sap/ui/mdc/util/IdentifierUtil.js +6 -6
  225. package/src/sap/ui/mdc/util/PromiseCache.js +1 -1
  226. package/src/sap/ui/mdc/util/PropertyHelper.js +148 -325
  227. package/src/sap/ui/mdc/util/TypeUtil.js +5 -4
  228. package/src/sap/ui/mdc/valuehelp/Dialog.js +12 -8
  229. package/src/sap/ui/mdc/valuehelp/Popover.js +14 -2
  230. package/src/sap/ui/mdc/valuehelp/base/Container.js +33 -1
  231. package/src/sap/ui/mdc/valuehelp/base/Content.js +36 -5
  232. package/src/sap/ui/mdc/valuehelp/base/DialogTab.js +2 -1
  233. package/src/sap/ui/mdc/valuehelp/base/FilterableListContent.js +43 -15
  234. package/src/sap/ui/mdc/valuehelp/base/ListContent.js +2 -1
  235. package/src/sap/ui/mdc/valuehelp/content/Bool.js +2 -1
  236. package/src/sap/ui/mdc/valuehelp/content/Conditions.js +28 -32
  237. package/src/sap/ui/mdc/valuehelp/content/FixedList.js +11 -5
  238. package/src/sap/ui/mdc/valuehelp/content/MDCTable.js +50 -10
  239. package/src/sap/ui/mdc/valuehelp/content/MTable.js +57 -26
  240. package/test/sap/ui/mdc/testutils/opa/TestLibrary.js +3 -1
  241. package/test/sap/ui/mdc/testutils/opa/actions/OpenContextMenu.js +3 -3
  242. package/test/sap/ui/mdc/testutils/opa/{chartNew → chart}/ActionsBase.js +3 -3
  243. package/test/sap/ui/mdc/testutils/opa/{chartNew → chart}/ActionsViz.js +0 -0
  244. package/test/sap/ui/mdc/testutils/opa/{chartNew → chart}/AssertionsBase.js +1 -1
  245. package/test/sap/ui/mdc/testutils/opa/{chartNew → chart}/AssertionsViz.js +0 -0
  246. package/test/sap/ui/mdc/testutils/opa/{chartNew → chart}/ChartNew.js +0 -0
  247. package/test/sap/ui/mdc/testutils/opa/chart/TestObjects.js +289 -0
  248. package/test/sap/ui/mdc/testutils/opa/chartNew/TestObjects.js +7 -7
  249. package/test/sap/ui/mdc/testutils/opa/filterbar/TestObjects.js +9 -9
  250. package/test/sap/ui/mdc/testutils/opa/filterbar/Util.js +12 -11
  251. package/test/sap/ui/mdc/testutils/opa/link/Actions.js +85 -0
  252. package/test/sap/ui/mdc/testutils/opa/link/Assertions.js +79 -0
  253. package/test/sap/ui/mdc/testutils/opa/link/TestObjects.js +112 -0
  254. package/test/sap/ui/mdc/testutils/opa/link/waitForLink.js +50 -0
  255. package/test/sap/ui/mdc/testutils/opa/p13n/Actions.js +362 -233
  256. package/test/sap/ui/mdc/testutils/opa/p13n/Util.js +27 -26
  257. package/test/sap/ui/mdc/testutils/opa/valueHelp/Actions.js +54 -0
  258. package/test/sap/ui/mdc/testutils/opa/valueHelp/Assertions.js +5 -0
  259. package/test/sap/ui/mdc/testutils/opa/valueHelp/TestObjects.js +40 -0
  260. package/test/sap/ui/mdc/testutils/opa/valueHelp/Util.js +28 -0
  261. package/src/sap/ui/mdc/ChartDelegateNew.js +0 -395
  262. package/src/sap/ui/mdc/ChartNew.js +0 -1114
  263. package/src/sap/ui/mdc/ChartNewRenderer.js +0 -91
  264. package/src/sap/ui/mdc/chart/DimensionItem.js +0 -281
  265. package/src/sap/ui/mdc/chart/MeasureItem.js +0 -318
  266. package/src/sap/ui/mdc/chart/MetadataDelegate.js +0 -31
  267. package/src/sap/ui/mdc/chart/SelectionHandler.js +0 -127
  268. package/src/sap/ui/mdc/chart/ToolbarHandler.js +0 -328
  269. package/src/sap/ui/mdc/chartNew/ChartTypeButtonNew.js +0 -295
  270. package/src/sap/ui/mdc/chartNew/DrillStackHandlerNew.js +0 -212
  271. package/src/sap/ui/mdc/chartNew/ItemNew.js +0 -72
  272. package/src/sap/ui/mdc/chartNew/SelectionDetailsActionsNew.js +0 -34
  273. package/src/sap/ui/mdc/designtime/chart/ChartNew.designtime.js +0 -91
  274. package/src/sap/ui/mdc/link/SelectionDialog.control.xml +0 -66
  275. package/src/sap/ui/mdc/link/SelectionDialog.js +0 -213
  276. package/src/sap/ui/mdc/link/SelectionDialogItem.js +0 -86
  277. package/src/sap/ui/mdc/odata/v4/ChartDelegateNew.js +0 -35
  278. package/src/sap/ui/mdc/p13n/panels/ChartItemPanelNew.js +0 -1171
  279. package/src/sap/ui/mdc/p13n/panels/GroupPanel.js +0 -111
  280. package/src/sap/ui/mdc/p13n/panels/QueryPanel.js +0 -322
  281. package/src/sap/ui/mdc/p13n/panels/SortQueryPanel.js +0 -133
  282. package/src/sap/ui/mdc/p13n/panels/Wrapper.js +0 -203
@@ -1,1114 +0,0 @@
1
- /*!
2
- * OpenUI5
3
- * (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
4
- * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
- */
6
-
7
- sap.ui.define([
8
- "sap/ui/core/Core",
9
- "sap/ui/mdc/Control",
10
- "./chart/ChartSettings",
11
- "sap/ui/mdc/util/loadModules",
12
- "./ChartNewRenderer",
13
- "sap/ui/mdc/library",
14
- "sap/m/Text",
15
- "sap/m/VBox",
16
- "sap/base/Log",
17
- "./chartNew/ChartToolbarNew",
18
- "./chartNew/PropertyHelperNew",
19
- "sap/ui/mdc/mixin/FilterIntegrationMixin",
20
- "sap/ui/model/base/ManagedObjectModel",
21
- "sap/ui/mdc/p13n/subcontroller/ChartItemController",
22
- "sap/ui/mdc/p13n/subcontroller/SortController",
23
- "sap/ui/base/ManagedObjectObserver",
24
- "sap/ui/mdc/chartNew/DrillBreadcrumbsNew",
25
- "sap/ui/mdc/actiontoolbar/ActionToolbarAction"
26
- ],
27
- function (
28
- Core,
29
- Control,
30
- ChartSettings,
31
- loadModules,
32
- ChartRenderer,
33
- MDCLib,
34
- Text,
35
- VBox,
36
- Log,
37
- ChartToolbar,
38
- PropertyHelper,
39
- FilterIntegrationMixin,
40
- ManagedObjectModel,
41
- ChartItemController,
42
- SortController,
43
- ManagedObjectObserver,
44
- Breadcrumbs,
45
- ActionToolbarAction
46
- ) {
47
- "use strict";
48
-
49
- var FILTER_INTERFACE = "sap.ui.mdc.IFilter";
50
-
51
- var DrillStackHandler;
52
-
53
- /**
54
- /**
55
- * Constructor for a new Chart.
56
- *
57
- * @param {string} [sId] id for the new control, generated automatically if no id is given
58
- * @param {object} [mSettings] initial settings for the new control
59
- * @class The Chart control creates a chart based on metadata and the configuration specified.
60
- * @extends sap.ui.mdc.Control
61
- * @author SAP SE
62
- * @version 1.96.5
63
- * @constructor
64
- * @experimental As of version ...
65
- * @private
66
- * @since 1.88
67
- * @alias sap.ui.mdc.ChartNew
68
- * @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel
69
- */
70
- var Chart = Control.extend("sap.ui.mdc.ChartNew", /** @lends sap.ui.mdc.ChartNew.prototype */ {
71
- metadata: {
72
- library: "sap.ui.mdc",
73
- designtime: "sap/ui/mdc/designtime/chart/ChartNew.designtime",
74
- interfaces: [
75
- "sap.ui.mdc.IxState"
76
- ],
77
- defaultAggregation: "items",
78
- properties: {
79
- /**
80
- * Defines the width of the chart.
81
- */
82
- width: {
83
- type: "sap.ui.core.CSSSize",
84
- group: "Dimension",
85
- defaultValue: "100%",
86
- invalidate: true
87
- },
88
- /**
89
- * Defines the height of the chart.
90
- */
91
- height: {
92
- type: "sap.ui.core.CSSSize",
93
- group: "Dimension",
94
- defaultValue: "100%",
95
- invalidate: true
96
- },
97
- /**
98
- * Defines the module path of the metadata delegate.
99
- */
100
- delegate: {
101
- type: "object",
102
- group: "Data",
103
- defaultValue: {
104
- name: "sap/ui/mdc/ChartDelegateNew"
105
- }
106
- },
107
- /**
108
- * Specifies header text that is shown in chart
109
- */
110
- header: {
111
- type: "string",
112
- group: "Misc",
113
- defaultValue: null
114
- },
115
- /**
116
- * Defines the no data text shown in the chart.
117
- * @since 1.88
118
- */
119
- noDataText: {
120
- type: "string",
121
- defaultValue: "No data"
122
- },
123
- /**
124
- * Specifies the personalization options available for the chart.<br>
125
- * <b>Note:</b> The order of the provided options does not influence the arrangement of the icons on the UI.
126
- *
127
- * @since 1.88
128
- */
129
- p13nMode: {
130
- type: "sap.ui.mdc.ChartP13nMode[]"
131
- },
132
-
133
- /**
134
- * Set chart's legend properties.
135
- *
136
- * @since 1.88
137
- */
138
- legendVisible: {
139
- type: "boolean",
140
- group: "Misc",
141
- defaultValue: true
142
- },
143
- /**
144
- * Specifies which actions should not be available in the chart's toolbar.
145
- *
146
- * @since 1.88
147
- */
148
- ignoreToolbarActions: {
149
- type: "sap.ui.mdc.ChartToolbarActionType[]",
150
- defaultValue: []
151
- },
152
- //TODO: Do we really need this? Should be avoided.
153
- /**
154
- * The minimal width
155
- */
156
- minWidth: {
157
- type: "sap.ui.core.CSSSize",
158
- group: "Dimension",
159
- defaultValue: "240px",
160
- invalidate: true
161
- },
162
- //TODO: Do we really need this? Should be avoided.
163
- /**
164
- * The minimal height
165
- */
166
- minHeight: {
167
- type: "sap.ui.core.CSSSize",
168
- group: "Dimension",
169
- defaultValue: "400px",
170
- invalidate: true
171
- },
172
- /**
173
- * Defines the sort conditions.
174
- *
175
- * <b>Note:</b> This property is exclusively used for handling flexibility changes. Do not use it for anything else.
176
- *
177
- * @since 1.88
178
- */
179
- sortConditions: {
180
- type: "object"
181
- },
182
- /**
183
- * Controls the visibility of the chart tooltip. If set to <code>true </code>, an instance of sap.viz.ui5.controls.VizTooltip will
184
- * be created and shown when hovering over a data point.
185
- *
186
- * @since 1.88
187
- */
188
- showChartTooltip: {
189
- type: "boolean",
190
- group: "Misc",
191
- defaultValue: true
192
- },
193
- /**
194
- * Binds the chart automatically after the initial creation of the chart
195
- */
196
- autoBindOnInit: {
197
- type: "boolean",
198
- group: "Misc",
199
- defaultValue: true
200
- },
201
-
202
- /**
203
- * Specifies the type of chart to be created by the SmartChart control.
204
- */
205
- chartType: {
206
- type: "string",
207
- group: "Misc",
208
- defaultValue: "column"
209
- },
210
- showSelectionDetails: {
211
- type: "boolean",
212
- group: "Misc",
213
- defaultValue: true
214
- }
215
- },
216
- aggregations: {
217
- items: {
218
- type: "sap.ui.mdc.chartNew.ItemNew",
219
- multiple: true
220
- },
221
- actions: {
222
- type: "sap.ui.core.Control",
223
- multiple: true,
224
- forwarding: {
225
- getter: "_getToolbar",
226
- aggregation: "actions"
227
- }
228
- },
229
- _toolbar: {
230
- type: "sap.ui.mdc.chartNew.ChartToolbarNew",
231
- multiple: false
232
- },
233
- _breadcrumbs: {
234
- type: "sap.m.Breadcrumbs",
235
- multiple: false
236
- },
237
- _innerChart: {
238
- type: "sap.ui.core.Control",
239
- multiple: false
240
- },
241
- selectionDetailsActions: {
242
- type: "sap.ui.mdc.chartNew.SelectionDetailsActionsNew",
243
- multiple: false
244
- }
245
- },
246
- associations: {
247
- /**
248
- * Control or object which enables the chart to do filtering, such as {@link sap.ui.mdc.FilterBar}.
249
- * Also see {@link sap.ui.mdc.IFilter}.
250
- *
251
- * @since 1.88
252
- */
253
- filter: {
254
- type: FILTER_INTERFACE,
255
- multiple: false
256
- }
257
- },
258
- events: {
259
- selectionDetailsActionPressed: {
260
- parameters: {
261
-
262
- /**
263
- * The action that has to be processed once the action has been pressed
264
- */
265
- action: {
266
- type: "sap.ui.core.Item"
267
- },
268
-
269
- /**
270
- * If the action is pressed on one of the {@link sap.m.SelectionDetailsItem items}, the parameter contains the
271
- * {@link sap.ui.model.Context context} of the pressed {@link sap.m.SelectionDetailsItem item}. If a custom action or action
272
- * group of the SelectionDetails popover is pressed, this parameter contains all {@link sap.ui.model.Context contexts} of the
273
- * {@link sap.m.SelectionDetailsItem items}.
274
- */
275
- itemContexts: {
276
- type: "sap.ui.model.Context"
277
- },
278
-
279
- /**
280
- * The action level of action buttons. The available levels are Item, List and Group
281
- */
282
- level: {
283
- type: "sap.m.SelectionDetailsActionLevel"
284
- }
285
- }
286
- },
287
- dataPointsSelected: {
288
- parameters: {
289
- /**
290
- * The context of selected / deselected data points
291
- */
292
- dataContext: {
293
- type: "object"
294
- }
295
- }
296
- },
297
- innerChartLoadedData: {
298
- parameters: {
299
- innerChart: {
300
- type: "sap.core.Control"
301
- }
302
- }
303
- }
304
- }
305
- },
306
-
307
- renderer: ChartRenderer
308
- });
309
-
310
- FilterIntegrationMixin.call(Chart.prototype);
311
-
312
- /**
313
- * Initialises the MDC Chart
314
- *
315
- * @experimental
316
- * @private
317
- * @ui5-restricted sap.ui.mdc
318
- */
319
- Chart.prototype.init = function () {
320
- this._oManagedObjectModel = new ManagedObjectModel(this);
321
- this.setModel(this._oManagedObjectModel, "$mdcChart");
322
- this._bNewP13n = true;//TODO: remove with migration
323
- Control.prototype.init.apply(this, arguments);
324
- };
325
-
326
- Chart.prototype.setP13nMode = function(aMode) {
327
- var aSortedKeys = null;
328
- if (aMode && aMode.length >= 1){
329
- aSortedKeys = [];
330
- var mKeys = aMode.reduce(function(mMap, sKey, iIndex){
331
- mMap[sKey] = true;
332
- return mMap;
333
- }, {});
334
-
335
- //as the p13nMode has no strict order we need to ensure the order of tabs here
336
- if (mKeys.Item) {
337
- aSortedKeys.push("Item");
338
- }
339
- if (mKeys.Sort) {
340
- aSortedKeys.push("Sort");
341
- }
342
- if (mKeys.Type) {
343
- this._typeBtnActive = true;
344
- } else {
345
- this._typeBtnActive = false;
346
- }
347
- } else {
348
- aSortedKeys = aMode;
349
- }
350
-
351
- this.setProperty("p13nMode", aSortedKeys, true);
352
-
353
- this._updateAdaptation(this.getP13nMode());
354
-
355
- return this;
356
- };
357
-
358
- Chart.prototype._updateAdaptation = function(aMode) {
359
- var oRegisterConfig = {
360
- controller: {}
361
- };
362
-
363
- var mRegistryOptions = {
364
- Item: ChartItemController,
365
- Sort: SortController
366
- };
367
-
368
- if (aMode && aMode.length > 0) {
369
- aMode.forEach(function(sMode){
370
- var sKey = sMode;
371
- var oController = mRegistryOptions[sMode];
372
- if (oController) {
373
- oRegisterConfig.controller[sKey] = oController;
374
- }
375
- });
376
-
377
- this.getEngine().registerAdaptation(this, oRegisterConfig);
378
- }
379
-
380
- };
381
-
382
- /**
383
- * Applies given settings onto the MDC Chart, loads the delegate and initializes the MDC Chart
384
- *
385
- * @param {*} mSettings settings to apply
386
- *
387
- * @experimental
388
- * @private
389
- * @ui5-restricted sap.ui.mdc
390
- */
391
- Chart.prototype.applySettings = function (mSettings, oScope) {
392
- Control.prototype.applySettings.apply(this, arguments);
393
-
394
- this.initializedPromise = new Promise(function (resolve, reject) {
395
- this._fnResolveInitialized = resolve;
396
- this._fnRejectInitialized = reject;
397
- }.bind(this));
398
-
399
- this.innerChartBoundPromise = new Promise(function (resolve, reject) {
400
- this._fnResolveInnerChartBound = resolve;
401
- this._fnRejectInnerChartBound = reject;
402
- }.bind(this));
403
-
404
- //load required modules before init of inner controls
405
- this._loadDelegate().then(function (oDelegate) {
406
- this.initControlDelegate(oDelegate).then(function () {
407
- this._initInnerControls();
408
-
409
-
410
- }.bind(this)).catch(function (error) {
411
- this._fnRejectInitialized(error);
412
- }.bind(this));
413
- }.bind(this)).catch(function (error) {
414
- this._fnRejectInitialized(error);
415
- }.bind(this));
416
-
417
-
418
- };
419
-
420
- /**
421
- * Initializes the inner controls of the MDC Chart (toolbar, inner chart)
422
- * Inner chart is initialized via the delegate
423
- */
424
- Chart.prototype._initInnerControls = function () {
425
- this.getControlDelegate().initializeInnerChart(this).then(function (oInnerChart) {
426
-
427
- this.setBusyIndicatorDelay(0);
428
-
429
- this.getControlDelegate().createInitialChartContent(this);
430
- this._renderOverlay(true);
431
-
432
- if (this.getAutoBindOnInit()) {
433
- this.setBusy(true);
434
- this._createContentfromPropertyInfos();
435
- }
436
-
437
- this.setAggregation("_innerChart", oInnerChart);
438
-
439
- this._bInnerChartReady = true;
440
-
441
- this._fnResolveInitialized();
442
- // eslint-disable-next-line no-empty
443
- this.invalidate();
444
- }.bind(this)).catch(function (error) {
445
- this._fnRejectInitialized(error);
446
- }.bind(this));
447
-
448
- //independent from fetchProperties
449
- this._getToolbar().createToolbarContent(this);
450
- };
451
-
452
- /**
453
- * Creates the content for the inner chart from properties.
454
- * The properties are given via the PropertyHelper which is initialized here.
455
- * The rest of the creation of the content for the inner chart is done in the delegate.
456
- * Also creates the breadcrumbs.
457
- *
458
- * Is called during init when autoBindOnInit = "true", if "false" then this is called by rebind()
459
- */
460
- Chart.prototype._createContentfromPropertyInfos = function () {
461
- this.initPropertyHelper(PropertyHelper).then(function () {
462
- //Create content on inner chart instance
463
- this.getControlDelegate().createInnerChartContent(this, this._innerChartDataLoadComplete.bind(this));
464
-
465
- this._createBreadcrumbs();
466
- //From now on, listen to changes on Items Aggregation and sync them with inner chart
467
- this._oObserver = new ManagedObjectObserver(this._propagateItemChangeToInnerChart.bind(this));
468
- this._oObserver.observe(this, {
469
- aggregations: [
470
- "items"
471
- ]
472
- });
473
-
474
- //Sync MDC Chart properties with inner chart
475
- this._propagatePropertiesToInnerChart();
476
-
477
- this._fnResolveInnerChartBound();
478
-
479
- }.bind(this));
480
-
481
- };
482
-
483
- Chart.prototype.setHeight = function(iHeight) {
484
- try {
485
- this.getControlDelegate().adjustChartHeight(this);
486
- } catch (oError) {
487
- //No need to do anything as correct height will be calculated anyways once inner chart is ready
488
- }
489
-
490
- this.setProperty("height", iHeight);
491
-
492
- return this;
493
- };
494
-
495
- Chart.prototype._createBreadcrumbs = function () {
496
- this._oBreadcrumbs = new Breadcrumbs(this.getId() + "--breadcrumbs");
497
- this._oBreadcrumbs.updateDrillBreadcrumbs(this, this.getControlDelegate().getDrillableItems(this));
498
- this.setAggregation("_breadcrumbs", this._oBreadcrumbs);
499
-
500
- this._oBreadcrumbs.addEventDelegate({
501
- onAfterRendering: function() {
502
- this.getControlDelegate().adjustChartHeight(this);
503
- }.bind(this)
504
- });
505
- };
506
-
507
- /**
508
- * Loads the delegate for the MDC Chart
509
- * @returns {Promise} resolved when delegate is loaded
510
- */
511
- Chart.prototype._loadDelegate = function () {
512
-
513
- return new Promise(function (resolve) {
514
- var aNotLoadedModulePaths = [this.getDelegate().name];
515
-
516
- function onModulesLoadedSuccess(oDelegate) {
517
- resolve(oDelegate);
518
- }
519
-
520
- sap.ui.require(aNotLoadedModulePaths, onModulesLoadedSuccess);
521
- }.bind(this));
522
-
523
- };
524
- /**
525
- * Gets whether filtering is enabled for p13n
526
- *
527
- * @experimental
528
- * @private
529
- * @ui5-restricted Fiori Elements
530
- */
531
- Chart.prototype.isFilteringEnabled = function () {
532
-
533
- };
534
-
535
- /**
536
- * Gets the adaption UI for the p13n dialog
537
- * @returns {Prmoise} promise that resolves with UI
538
- */
539
- Chart.prototype.getAdaptationUI = function () {
540
- return this.getControlDelegate().getAdaptionUI(this);
541
- };
542
-
543
- /**
544
- * Propagates a change on the "item" aggregation to the inner chart via the delegate
545
- * The delegate must then update the inner chart accordingly
546
- *
547
- * @param {object} oChange the change object from the ManagedObjectModel observer
548
- */
549
- Chart.prototype._propagateItemChangeToInnerChart = function (oChange) {
550
-
551
- if (this._bIsDestroyed){
552
- return; //Don't propagate changes when CHart is destroyed
553
- }
554
-
555
- this.setBusy(true);
556
- switch (oChange.mutation) {
557
-
558
- case "insert":
559
- var iIndex;
560
-
561
- if (oChange.child && oChange.child.getType()) {
562
- iIndex = this.getItems().filter(function(oItem){return oItem.getType() === oChange.child.getType();}).indexOf(oChange.child);
563
- } else {
564
- iIndex = this.getItems().indexOf(oChange.child);
565
- }
566
-
567
- this.getControlDelegate().insertItemToInnerChart(this, oChange.child, iIndex);
568
- break;
569
- case "remove":
570
- this.getControlDelegate().removeItemFromInnerChart(this, oChange.child);
571
- break;
572
- default:
573
- Log.error("Unknown mutation on MDC Chart Item Aggregation. This will not sync to inner chart!");
574
- break;
575
- }
576
-
577
- //Needed to apply current sorters when sorted measure/dimension was not selected yet
578
- //However, since this gets called multiple times when the aggregation adds/removes multiple properties, the binding seems to break
579
- this.rebind();
580
-
581
- //Update the breadcrumbs after an MDC Item change
582
- this._oBreadcrumbs.updateDrillBreadcrumbs(this, this.getControlDelegate().getDrillableItems(this));
583
- };
584
-
585
- /**
586
- * Rebinds the inner chart instance by calling oDelegate.rebindChart
587
- */
588
- Chart.prototype.rebind = function () {
589
-
590
- if (!this._bInnerChartReady) {
591
- //TODO: This can lead to a race conditition when the "Go" button is pressed while the inner chart still intializes
592
- //TODO: Check whether we really need this since we insantiate the inner chart right away
593
- //this._initInnerControls();
594
-
595
- //Wait with rebind until inner chart is ready
596
- this.initialized().then(function () {
597
- this.rebind();
598
- }.bind(this));
599
- return;
600
- }
601
-
602
- this.setBusy(true);
603
-
604
- if (!this.getControlDelegate().getInnerChartBound(this)) {
605
- this._createContentfromPropertyInfos();
606
- return;
607
- }
608
-
609
- var oBindingInfo = this.getControlDelegate()._getBindingInfo(this);
610
-
611
- if (oBindingInfo) {
612
- oBindingInfo.sorter = this._getSorters();
613
- }
614
-
615
- this.getControlDelegate().updateBindingInfo(this, oBindingInfo); //Applies filters
616
- this.getControlDelegate().rebindChart(this, oBindingInfo);
617
- };
618
-
619
- /**
620
- * Creates a new instance of ChartToolbar
621
- *
622
- * @private
623
- */
624
- Chart.prototype._getToolbar = function () {
625
- if (this.getAggregation("_toolbar")) {
626
- return this.getAggregation("_toolbar");
627
- } else {
628
- var oToolbar = new ChartToolbar(this.getId() + "--toolbar", {
629
- design: "Transparent"
630
- });
631
-
632
- this.setAggregation("_toolbar", oToolbar);
633
- return oToolbar;
634
- }
635
- };
636
-
637
- /**
638
- * Calls the update function on the toolbar, if toolbar exists
639
- *
640
- * @private
641
- */
642
- Chart.prototype._updateToolbar = function () {
643
- if (this.getAggregation("_toolbar")) {
644
- this.getAggregation("_toolbar").updateToolbar(this);
645
- } else {
646
- Log.warning("Trying to uipdate Chart Toolbar, but toolbar is not yet initialized. This will not work!");
647
- }
648
- };
649
-
650
- /**
651
- * Returns the instance of the inner chart from the delegate
652
- * @returns {sap.core.Control} the instance of the inner chart
653
- *
654
- * @private
655
- */
656
- Chart.prototype._getInnerChart = function () {
657
- if (this._bInnerChartReady) {
658
- return this.getControlDelegate().getInnerChart(this);
659
- } else {
660
- Log.error("Trying to acces inner chart while inner chart is not yet initialized!");
661
- }
662
- };
663
-
664
- //TODO: Think of a good name
665
- Chart.prototype._addItems = function () {
666
-
667
- };
668
-
669
- /**
670
- * Gets the collection model from the binding information
671
- * @returns {object} Object containing the binding information
672
- *
673
- * @experimental
674
- * @private
675
- * @ui5-restricted Fiori Elements
676
- */
677
- Chart.prototype.getCollectionModel = function () {
678
- var oBindingInfo = this.getBindingInfo("data");
679
- return oBindingInfo ? this.getModel(oBindingInfo.model) : null;
680
- };
681
-
682
-
683
- /**
684
- * Can be used to check whether the chart is initialized
685
- * After initialization the delegate should be loaded and (in case of autoBindOnInit=true) the inner chart has been created
686
- * This does not include the inner chart to be bound. Use <code>innerChartBound</code> for it.
687
- * @returns {Promise} Promise that resolves once MDC Chart is initialized. Contains reference to MDC Chart
688
- *
689
- * @experimental
690
- * @private
691
- * @ui5-restricted sap.ui.mdc, sap.fe
692
- */
693
- Chart.prototype.initialized = function () {
694
- return this.initializedPromise;
695
- };
696
-
697
- /**
698
- * Can be used to check whether the inner chart is initialized and bound
699
- * @returns {Promise} Promise that resolves once MDC Chart is bound
700
- *
701
- * @experimental
702
- * @private
703
- * @ui5-restricted sap.ui.mdc, sap.fe
704
- */
705
- Chart.prototype.innerChartBound = function () {
706
- return this.innerChartBoundPromise;
707
- };
708
-
709
- /**
710
- * Zooms in the inner chart
711
- * @param {int} iValue how much steps should be zoomed in
712
- *
713
- * @experimental
714
- * @private
715
- * @ui5-restricted sap.ui.mdc, sap.fe
716
- */
717
- Chart.prototype.zoomIn = function (iValue) {
718
- if (!iValue) {
719
- iValue = 10;
720
- }
721
-
722
- this.getControlDelegate().zoomIn(this, iValue);
723
- };
724
-
725
- /**
726
- * Zooms out the inner chart
727
- * @param {int} iValue how much steps should be zoomed out
728
- *
729
- * @experimental
730
- * @private
731
- * @ui5-restricted sap.ui.mdc, sap.fe
732
- */
733
- Chart.prototype.zoomOut = function (iValue) {
734
- if (iValue) {
735
- iValue = 10;
736
- }
737
-
738
- this.getControlDelegate().zoomOut(this, iValue);
739
- };
740
-
741
- /**
742
- * Returns the current zoom information as an object
743
- * {
744
- * "enabled":true,
745
- * "currentZoomLevel":0.16
746
- * }
747
- *
748
- * @returns {Object} current Zoom Information
749
- *
750
- * @experimental
751
- * @private
752
- * @ui5-restricted sap.ui.mdc, sap.fe
753
- */
754
- Chart.prototype.getZoomState = function () {
755
- return this.getControlDelegate().getZoomState(this);
756
- };
757
-
758
- Chart.prototype.getSelectionHandler = function () {
759
- return this.getControlDelegate().getInnerChartSelectionHandler(this);
760
- };
761
-
762
- Chart.prototype.getChartTypeLayoutConfig = function() {
763
- return this.getControlDelegate().getChartTypeLayoutConfig();
764
- };
765
-
766
- Chart.prototype.getAllowedRolesForKinds = function() {
767
- return this.getControlDelegate().getAllowedRolesForKinds();
768
- };
769
-
770
- /**
771
- * Sets the visibility of the legend
772
- * Calls the Delegates <code>setLegendVisible</code>. Never call the delegates function directly as it would not update the Chart Toolbar!
773
- * @param {boolean} bVisible true to show legend, false to hide
774
- *
775
- * @experimental
776
- * @private
777
- * @ui5-restricted Fiori Elements, sap.ui.mdc
778
- */
779
- Chart.prototype.setLegendVisible = function (bVisible) {
780
- this.setProperty("legendVisible", bVisible);
781
-
782
- //Skip if no control delegate; gets propagated by _propagatePropertiesToInnerChart after init
783
- try {
784
- this.getControlDelegate().setLegendVisible(this, bVisible);
785
- } catch (e) {
786
- Log.info("Trying to set legend visiblity for Chart before delegate was initialized");
787
- }
788
-
789
-
790
- return this;
791
- };
792
-
793
- /**
794
- * Sets the ShowChartTooltip Property
795
- * @param {boolean} bValue true for visible; false for invisible
796
- * @returns {sap.ui.mdc.ChartNew} the MDC Chart
797
- */
798
- Chart.prototype.setShowChartTooltip = function (bValue) {
799
- this.setProperty("showChartTooltip", bValue);
800
-
801
- //Skip if no control delegate; gets propagated by _propagatePropertiesToInnerChart after init
802
- try {
803
- this.getControlDelegate().setChartTooltipVisibility(this, bValue);
804
- } catch (e) {
805
- Log.info("Trying to set tooltip visibility before delegate was initialized");
806
- }
807
-
808
- return this;
809
- };
810
-
811
- Chart.prototype.destroy = function() {
812
- this._bIsDestroyed = true;
813
-
814
- Control.prototype.destroy.apply(this, arguments);
815
- };
816
-
817
- /**
818
- * shows the drill-down popover for selection a dimension to drill down to.
819
- * @param {sap.m.Button} oDrillBtn reference to the drill down button for loacation of the popover
820
- *
821
- * @experimental
822
- * @private
823
- * @ui5-restricted sap.ui.mdc
824
- */
825
- Chart.prototype._showDrillDown = function (oDrillBtn) {
826
- if (DrillStackHandler) {
827
-
828
- DrillStackHandler.createDrillDownPopover(this);
829
- return DrillStackHandler.showDrillDownPopover(this, oDrillBtn);
830
- }
831
-
832
- return new Promise(function (resolve, reject) {
833
- sap.ui.require([
834
- "sap/ui/mdc/chartNew/DrillStackHandlerNew"
835
- ], function (DrillStackHandlerLoaded) {
836
- DrillStackHandler = DrillStackHandlerLoaded;
837
- DrillStackHandler.createDrillDownPopover(this);
838
- DrillStackHandler.showDrillDownPopover(this, oDrillBtn)
839
- .then(function (oDrillDownPopover) {
840
- resolve(oDrillDownPopover);
841
- });
842
- }.bind(this));
843
- }.bind(this));
844
- };
845
-
846
- /**
847
- * If some properties are set on the MDC Chart while the inner chart is not yet initialized, they need to eb set after initialaization.
848
- * This methods gets called after inner chart is ready and takes care of that
849
- *
850
- * @private
851
- */
852
- Chart.prototype._propagatePropertiesToInnerChart = function () {
853
- //TODO: Can this be set by constructor of inner chart?
854
- this.setLegendVisible(this.getLegendVisible());
855
- this.setShowChartTooltip(this.getShowChartTooltip());
856
- this.setChartType(this.getChartType());
857
- };
858
-
859
- /**
860
- * Gets information about the current chart type.
861
- *
862
- * @returns {sap.ui.mdc.Chart.ChartTypeInfo} Object containing information about the chart type
863
- *
864
- * @experimental
865
- * @private
866
- * @ui5-restricted Fiori Elements
867
- *
868
- */
869
- Chart.prototype.getChartTypeInfo = function () {
870
- var mInfo;
871
-
872
- try {
873
- mInfo = this.getControlDelegate().getChartTypeInfo(this);
874
- } catch (error) {
875
- //Inner chart is not yet ready
876
- if (!mInfo) {
877
- mInfo = {
878
- icon: "sap-icon://vertical-bar-chart",
879
- text: "Selected Chart Type: Bar Chart"
880
- };
881
- }
882
- }
883
-
884
- return mInfo;
885
- };
886
-
887
- /**
888
- * Gets the available chart types for the current state of the inner chart
889
- *
890
- * @returns {array} Array containing the available chart types
891
- *
892
- * @experimental
893
- * @private
894
- * @ui5-restricted Fiori Elements
895
- */
896
- Chart.prototype.getAvailableChartTypes = function () {
897
- return this.getControlDelegate().getAvailableChartTypes(this);
898
- };
899
-
900
-
901
- /**
902
- * Sets the MDC Chart to a specific chart type
903
- * @param {string} sChartType the name of the new chart type
904
- * @returns {sap.ui.mdc.chartNew} reference to <code>this</code> for method chaining
905
- */
906
- Chart.prototype.setChartType = function (sChartType) {
907
- this.setProperty("chartType", sChartType);
908
-
909
- try {
910
- this.getControlDelegate().setChartType(this, sChartType);
911
- } catch (e) {
912
- Log.info("Trying to set chart type for Chart before delegate was initialized");
913
- }
914
-
915
- return this;
916
- };
917
-
918
- /**
919
- * Gets the managed object model.
920
- * @returns {sap.ui.model.base.ManagedObjectModel} the managed object model
921
- *
922
- * @experimental
923
- * @private
924
- * @ui5-restricted Fiori Elements
925
- */
926
- Chart.prototype.getManagedObjectModel = function () {
927
- return this._oManagedObjectModel;
928
- };
929
-
930
- /**
931
- * This is a callback function which is called from the delegate once the inner chart finished loading data
932
- * Updates the Toolbar
933
- * Fires the innerChartLoadedData event
934
- *
935
- * @private
936
- */
937
- Chart.prototype._innerChartDataLoadComplete = function (mArguments) {
938
- this.setBusy(false);
939
- this._renderOverlay(false);
940
-
941
- this.getControlDelegate().requestToolbarUpdate(this);
942
-
943
- this.fireEvent("innerChartLoadedData ", {
944
- innerChart: this.getControlDelegate().getInnerChart(this)
945
- });
946
- };
947
-
948
- /**
949
- * Fetches the current state of the chart (as a JSON)
950
- * Needed for P13n to fetch current state
951
- *
952
- * @experimental
953
- * @private
954
- * @returns {Object} Current state of the chart
955
- * @ui5-restricted sap.ui.mdc
956
- */
957
- Chart.prototype.getCurrentState = function () {
958
- var oState = {};
959
- var aP13nMode = this.getP13nMode();
960
-
961
- if (aP13nMode) {
962
- if (aP13nMode.indexOf("Item") > -1) {
963
- oState.items = this._getVisibleProperties();
964
- }
965
-
966
- if (aP13nMode.indexOf("Sort") > -1) {
967
- oState.sorters = this._getSortedProperties();
968
- }
969
- }
970
-
971
- return oState;
972
- };
973
-
974
- /**
975
- * Returns the currently visible Properties
976
- * Needed for P13n
977
- * @returns {array} Array containing the currently visible properties
978
- *
979
- * @private
980
- */
981
- Chart.prototype._getVisibleProperties = function () {
982
- var aProperties = [];
983
- this.getItems().forEach(function (oItem) {
984
- aProperties.push({
985
- name: oItem.getName(),
986
- role: oItem.getRole()
987
- });
988
-
989
- });
990
- return aProperties;
991
- };
992
-
993
- /**
994
- * Returns the currently sorted Properties
995
- * Needed for P13n
996
- * @returns {array} Array containing the currently sorted properties
997
- *
998
- * @private
999
- */
1000
- Chart.prototype._getSortedProperties = function () {
1001
- return this.getSortConditions() ? this.getSortConditions().sorters : [];
1002
- };
1003
-
1004
- /**
1005
- * Returns sorters available for the data
1006
- *
1007
- * @returns {array} Array containing available sorters
1008
- *
1009
- * @experimental
1010
- * @private
1011
- * @ui5-restricted sap.ui.mdc
1012
- */
1013
- Chart.prototype._getSorters = function () {
1014
- var aSorters;
1015
- var aSorterProperties = this.getSortConditions() ? this.getSortConditions().sorters : [];
1016
-
1017
- aSorterProperties.forEach(function (oSortProp) {
1018
-
1019
- var oMDCItem = this.getItems().find(function (oProp) {
1020
- return oProp.getName() === oSortProp.name;
1021
- });
1022
-
1023
- //Ignore not visible Items
1024
- if (!oMDCItem) {
1025
- return;
1026
- }
1027
-
1028
- //TODO: Check for inResultDimensions
1029
- var oSorter = this.getControlDelegate().getSorterForItem(oMDCItem, oSortProp);
1030
-
1031
- if (aSorters) {
1032
- aSorters.push(oSorter);
1033
- } else {
1034
- aSorters = [
1035
- oSorter
1036
- ];//[] has special meaning in sorting
1037
- }
1038
- }.bind(this));
1039
-
1040
- return aSorters;
1041
-
1042
- };
1043
-
1044
- /**
1045
- * Returns the fetched properties from the delegate
1046
- *
1047
- * @private
1048
- */
1049
- Chart.prototype._getPropertyData = function () {
1050
-
1051
- if (!this.aFetchedProperties) {
1052
- //retrieve the data
1053
- this.aFetchedProperties = this.getControlDelegate().fetchProperties(this);
1054
- } else {
1055
- //take the already instantiated data
1056
- return this.aFetchedProperties;
1057
- }
1058
-
1059
- };
1060
-
1061
- Chart.prototype._getTypeBtnActive = function(){
1062
- return !!this._typeBtnActive;
1063
- };
1064
-
1065
- /**
1066
- * Callback for when fuilters changed
1067
- * Activates the overlay on the MDC Chart
1068
- *
1069
- * @param oEvent filter changed event
1070
- *
1071
- * @experimental
1072
- * @private
1073
- * @ui5-restricted Fiori Elements, sap.ui.mdc
1074
- */
1075
- Chart.prototype._onFiltersChanged = function(oEvent) {
1076
- if (this._bInnerChartReady && this.getControlDelegate() && this.getControlDelegate().getInnerChartBound(this) && oEvent.getParameter("conditionsBased")) {
1077
- this._renderOverlay(true);
1078
- }
1079
- };
1080
-
1081
- /**
1082
- * Adds/Removes the overlay shown above the inner chart
1083
- * @param {boolean} bShow true to show overlay, false to hide
1084
- *
1085
- * @experimental
1086
- * @private
1087
- * @ui5-restricted Fiori Elements, sap.ui.mdc
1088
- */
1089
- Chart.prototype._renderOverlay = function(bShow) {
1090
-
1091
- if (this.getControlDelegate().getInnerChart(this)) {
1092
-
1093
- var $this = this.getControlDelegate().getInnerChart(this).$(), $overlay = $this.find(".sapUiMdcChartOverlay");
1094
- if (bShow && $overlay.length === 0) {
1095
- $overlay = jQuery("<div>").addClass("sapUiOverlay sapUiMdcChartOverlay").css("z-index", "1");
1096
- $this.append($overlay);
1097
- } else if (!bShow) {
1098
- $overlay.remove();
1099
- }
1100
- }
1101
- };
1102
-
1103
- Chart.prototype.addAction = function(oControl) {
1104
- if (oControl.getMetadata().getName() !== "sap.ui.mdc.actiontoolbar.ActionToolbarAction") {
1105
- oControl = new ActionToolbarAction(oControl.getId() + "-action", {
1106
- action: oControl
1107
- });
1108
- }
1109
-
1110
- return Control.prototype.addAggregation.apply(this, ["actions", oControl]);
1111
- };
1112
-
1113
- return Chart;
1114
- }, true);