@sapui5/sap.fe.macros 1.95.0 → 1.96.4

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 (169) hide show
  1. package/package.json +1 -1
  2. package/src/sap/fe/macros/.library +1 -1
  3. package/src/sap/fe/macros/Chart.fragment.xml +107 -108
  4. package/src/sap/fe/macros/Chart.metadata.js +28 -11
  5. package/src/sap/fe/macros/ChartAPI.js +147 -0
  6. package/src/sap/fe/macros/ChartAPI.ts +79 -0
  7. package/src/sap/fe/macros/ChartDelegate.js +388 -455
  8. package/src/sap/fe/macros/CommonHelper.js +12 -8
  9. package/src/sap/fe/macros/Contact.designtime.js +1 -1
  10. package/src/sap/fe/macros/Contact.fragment.xml +0 -1
  11. package/src/sap/fe/macros/Contact.metadata.js +1 -1
  12. package/src/sap/fe/macros/ContactHelper.js +1 -1
  13. package/src/sap/fe/macros/DelegateUtil.js +24 -4
  14. package/src/sap/fe/macros/DraftIndicator.metadata.js +1 -1
  15. package/src/sap/fe/macros/DraftIndicatorRuntime.js +1 -1
  16. package/src/sap/fe/macros/FieldAPI.js +2 -2
  17. package/src/sap/fe/macros/FieldAPI.ts +10 -10
  18. package/src/sap/fe/macros/FieldValueHelpDelegate.js +1 -1
  19. package/src/sap/fe/macros/FilterBar.designtime.js +1 -1
  20. package/src/sap/fe/macros/FilterBar.fragment.xml +4 -4
  21. package/src/sap/fe/macros/FilterBar.metadata.js +27 -13
  22. package/src/sap/fe/macros/FilterBarAPI.js +9 -9
  23. package/src/sap/fe/macros/FilterBarAPI.ts +10 -9
  24. package/src/sap/fe/macros/FilterBarDelegate.js +2 -2
  25. package/src/sap/fe/macros/FilterBarHelper.js +1 -1
  26. package/src/sap/fe/macros/FilterField.designtime.js +1 -1
  27. package/src/sap/fe/macros/FilterField.metadata.js +1 -1
  28. package/src/sap/fe/macros/FlexibleColumnLayoutActions.fragment.xml +6 -15
  29. package/src/sap/fe/macros/FlexibleColumnLayoutActions.metadata.js +1 -1
  30. package/src/sap/fe/macros/Form.designtime.js +1 -1
  31. package/src/sap/fe/macros/Form.fragment.xml +21 -17
  32. package/src/sap/fe/macros/Form.metadata.js +9 -1
  33. package/src/sap/fe/macros/FormContainer.designtime.js +1 -1
  34. package/src/sap/fe/macros/FormContainer.metadata.js +1 -1
  35. package/src/sap/fe/macros/MacroMetadata.js +1 -1
  36. package/src/sap/fe/macros/MicroChart.designtime.js +1 -1
  37. package/src/sap/fe/macros/MicroChart.metadata.js +1 -1
  38. package/src/sap/fe/macros/ODataMetaModelUtil.js +1 -1
  39. package/src/sap/fe/macros/Paginator.metadata.js +4 -5
  40. package/src/sap/fe/macros/PhantomUtil.js +1 -1
  41. package/src/sap/fe/macros/QuickViewForm.designtime.js +1 -1
  42. package/src/sap/fe/macros/QuickViewForm.metadata.js +1 -1
  43. package/src/sap/fe/macros/ResourceModel.js +1 -1
  44. package/src/sap/fe/macros/Share.metadata.js +1 -1
  45. package/src/sap/fe/macros/SizeHelper.js +1 -1
  46. package/src/sap/fe/macros/Table.fragment.xml +3 -2
  47. package/src/sap/fe/macros/Table.metadata.js +23 -4
  48. package/src/sap/fe/macros/TableAPI.js +30 -23
  49. package/src/sap/fe/macros/TableAPI.ts +16 -8
  50. package/src/sap/fe/macros/TraceInfo.js +1 -1
  51. package/src/sap/fe/macros/ValueHelp.metadata.js +1 -1
  52. package/src/sap/fe/macros/VisualFilter.metadata.js +1 -1
  53. package/src/sap/fe/macros/chart/ChartHelper.js +8 -3
  54. package/src/sap/fe/macros/chart/ChartRuntime.js +5 -5
  55. package/src/sap/fe/macros/chart/ChartUtils.js +41 -36
  56. package/src/sap/fe/macros/field/FieldHelper.js +22 -2
  57. package/src/sap/fe/macros/field/FieldRuntime.js +70 -57
  58. package/src/sap/fe/macros/field/FieldTemplating.js +43 -9
  59. package/src/sap/fe/macros/field/FieldTemplating.ts +39 -11
  60. package/src/sap/fe/macros/field/QuickViewLinkDelegate.js +8 -19
  61. package/src/sap/fe/macros/field/QuickViewLinkWithFacets.fragment.xml +40 -18
  62. package/src/sap/fe/macros/filter/DraftEditState.js +21 -2
  63. package/src/sap/fe/macros/filter/FilterFieldHelper.js +1 -1
  64. package/src/sap/fe/macros/filter/FilterUtils.js +15 -3
  65. package/src/sap/fe/macros/filter/type/MultiValue.js +1 -1
  66. package/src/sap/fe/macros/filter/type/Range.js +1 -1
  67. package/src/sap/fe/macros/filter/type/Value.js +1 -1
  68. package/src/sap/fe/macros/flexibility/FormDelegate.js +1 -1
  69. package/src/sap/fe/macros/form/DataFieldCollection.fragment.xml +2 -2
  70. package/src/sap/fe/macros/form/FormHelper.js +1 -1
  71. package/src/sap/fe/macros/fpm/CustomFragment.metadata.js +1 -1
  72. package/src/sap/fe/macros/fpm/CustomSection.metadata.js +1 -1
  73. package/src/sap/fe/macros/fpm/fpm.js +1 -1
  74. package/src/sap/fe/macros/internal/CollectionField.metadata.js +71 -11
  75. package/src/sap/fe/macros/internal/CollectionField.metadata.ts +42 -13
  76. package/src/sap/fe/macros/internal/DataPoint.metadata.js +1 -1
  77. package/src/sap/fe/macros/internal/Field.designtime.js +1 -1
  78. package/src/sap/fe/macros/internal/Field.metadata.js +10 -1
  79. package/src/sap/fe/macros/internal/collectionField/MultiValueFieldDelegate.js +10 -18
  80. package/src/sap/fe/macros/internal/field/displayStyle/File.fragment.xml +13 -9
  81. package/src/sap/fe/macros/internal/field/displayStyle/SemanticKeyWithDraftIndicator.fragment.xml +1 -1
  82. package/src/sap/fe/macros/internal/field/editStyle/File.fragment.xml +2 -2
  83. package/src/sap/fe/macros/internal/field/editStyle/InputWithUnit.fragment.xml +1 -1
  84. package/src/sap/fe/macros/internal/helpers/DataPointTemplating.js +4 -13
  85. package/src/sap/fe/macros/internal/helpers/DataPointTemplating.ts +10 -10
  86. package/src/sap/fe/macros/internal/helpers/TableTemplating.js +32 -0
  87. package/src/sap/fe/macros/internal/helpers/TableTemplating.ts +14 -0
  88. package/src/sap/fe/macros/internal/valuehelp/TableDelegate.js +1 -1
  89. package/src/sap/fe/macros/internal/valuehelp/ValueHelp.designtime.js +1 -1
  90. package/src/sap/fe/macros/internal/valuehelp/ValueHelpTemplating.js +3 -2
  91. package/src/sap/fe/macros/internal/valuehelp/ValueHelpTemplating.ts +2 -2
  92. package/src/sap/fe/macros/internal/valuehelp/ValueListDialogTable.fragment.xml +1 -0
  93. package/src/sap/fe/macros/internal/valuehelp/ValueListHelper.js +102 -64
  94. package/src/sap/fe/macros/library.js +2 -2
  95. package/src/sap/fe/macros/macroLibrary.js +1 -1
  96. package/src/sap/fe/macros/massedit/MassEditHandler.js +21 -5
  97. package/src/sap/fe/macros/massedit/MassEditRuntime.js +8 -2
  98. package/src/sap/fe/macros/messagebundle.properties +5 -1
  99. package/src/sap/fe/macros/messagebundle_ar.properties +3 -0
  100. package/src/sap/fe/macros/messagebundle_bg.properties +3 -0
  101. package/src/sap/fe/macros/messagebundle_ca.properties +3 -0
  102. package/src/sap/fe/macros/messagebundle_cs.properties +3 -0
  103. package/src/sap/fe/macros/messagebundle_cy.properties +3 -0
  104. package/src/sap/fe/macros/messagebundle_da.properties +3 -0
  105. package/src/sap/fe/macros/messagebundle_de.properties +3 -0
  106. package/src/sap/fe/macros/messagebundle_el.properties +3 -0
  107. package/src/sap/fe/macros/messagebundle_en.properties +3 -0
  108. package/src/sap/fe/macros/messagebundle_en_GB.properties +4 -1
  109. package/src/sap/fe/macros/messagebundle_en_US_sappsd.properties +1 -1
  110. package/src/sap/fe/macros/messagebundle_en_US_saprigi.properties +23 -4
  111. package/src/sap/fe/macros/messagebundle_en_US_saptrc.properties +9 -2
  112. package/src/sap/fe/macros/messagebundle_es.properties +3 -0
  113. package/src/sap/fe/macros/messagebundle_es_MX.properties +3 -0
  114. package/src/sap/fe/macros/messagebundle_et.properties +3 -0
  115. package/src/sap/fe/macros/messagebundle_fi.properties +3 -0
  116. package/src/sap/fe/macros/messagebundle_fr.properties +3 -0
  117. package/src/sap/fe/macros/messagebundle_fr_CA.properties +3 -0
  118. package/src/sap/fe/macros/messagebundle_hi.properties +5 -2
  119. package/src/sap/fe/macros/messagebundle_hr.properties +5 -2
  120. package/src/sap/fe/macros/messagebundle_hu.properties +3 -0
  121. package/src/sap/fe/macros/messagebundle_id.properties +3 -0
  122. package/src/sap/fe/macros/messagebundle_it.properties +3 -0
  123. package/src/sap/fe/macros/messagebundle_iw.properties +3 -0
  124. package/src/sap/fe/macros/messagebundle_ja.properties +3 -0
  125. package/src/sap/fe/macros/messagebundle_kk.properties +3 -0
  126. package/src/sap/fe/macros/messagebundle_ko.properties +6 -3
  127. package/src/sap/fe/macros/messagebundle_lt.properties +3 -0
  128. package/src/sap/fe/macros/messagebundle_lv.properties +5 -2
  129. package/src/sap/fe/macros/messagebundle_ms.properties +3 -0
  130. package/src/sap/fe/macros/messagebundle_nl.properties +3 -0
  131. package/src/sap/fe/macros/messagebundle_no.properties +5 -2
  132. package/src/sap/fe/macros/messagebundle_pl.properties +5 -2
  133. package/src/sap/fe/macros/messagebundle_pt.properties +3 -0
  134. package/src/sap/fe/macros/messagebundle_pt_PT.properties +3 -0
  135. package/src/sap/fe/macros/messagebundle_ro.properties +3 -0
  136. package/src/sap/fe/macros/messagebundle_ru.properties +5 -2
  137. package/src/sap/fe/macros/messagebundle_sh.properties +3 -0
  138. package/src/sap/fe/macros/messagebundle_sk.properties +3 -0
  139. package/src/sap/fe/macros/messagebundle_sl.properties +3 -0
  140. package/src/sap/fe/macros/messagebundle_sv.properties +3 -0
  141. package/src/sap/fe/macros/messagebundle_th.properties +5 -2
  142. package/src/sap/fe/macros/messagebundle_tr.properties +3 -0
  143. package/src/sap/fe/macros/messagebundle_uk.properties +3 -0
  144. package/src/sap/fe/macros/messagebundle_vi.properties +6 -3
  145. package/src/sap/fe/macros/messagebundle_zh_CN.properties +6 -3
  146. package/src/sap/fe/macros/messagebundle_zh_TW.properties +3 -0
  147. package/src/sap/fe/macros/microchart/MicroChartContainer.js +3 -3
  148. package/src/sap/fe/macros/microchart/MicroChartHelper.js +1 -1
  149. package/src/sap/fe/macros/microchart/fragments/RadialMicroChart.fragment.xml +2 -1
  150. package/src/sap/fe/macros/table/Actions.fragment.xml +9 -13
  151. package/src/sap/fe/macros/table/BasicSearch.js +3 -3
  152. package/src/sap/fe/macros/table/Column.fragment.xml +0 -1
  153. package/src/sap/fe/macros/table/ColumnProperty.fragment.xml +0 -1
  154. package/src/sap/fe/macros/table/QuickFilterContainer.js +2 -2
  155. package/src/sap/fe/macros/table/TableFullScreenUtil.js +1 -1
  156. package/src/sap/fe/macros/table/TableHelper.js +3 -59
  157. package/src/sap/fe/macros/table/TableRuntime.js +5 -2
  158. package/src/sap/fe/macros/table/Utils.js +1 -1
  159. package/src/sap/fe/macros/table/delegates/ALPTableDelegate.js +1 -1
  160. package/src/sap/fe/macros/table/delegates/ALPTableDelegateBaseMixin.js +1 -1
  161. package/src/sap/fe/macros/table/delegates/AnalyticalALPTableDelegate.js +1 -1
  162. package/src/sap/fe/macros/table/delegates/AnalyticalTableDelegate.js +1 -1
  163. package/src/sap/fe/macros/table/delegates/TableDelegate.js +90 -82
  164. package/src/sap/fe/macros/valuehelp/ValueHelpFilterBar.designtime.js +1 -1
  165. package/src/sap/fe/macros/valuehelp/ValueHelpFilterBar.fragment.xml +1 -1
  166. package/src/sap/fe/macros/valuehelp/ValueHelpFilterBar.metadata.js +3 -3
  167. package/src/sap/fe/macros/visualfilters/InteractiveChartHelper.js +1 -1
  168. package/src/sap/fe/macros/visualfilters/VisualFilterRuntime.js +1 -1
  169. package/src/sap/fe/macros/FormWrapper.fragment.xml +0 -26
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sapui5/sap.fe.macros",
3
- "version": "1.95.0",
3
+ "version": "1.96.4",
4
4
  "description": "SAPUI5 Library sap.fe.macros",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "author": "SAP SE (https://www.sap.com)",
@@ -6,7 +6,7 @@
6
6
  <copyright>SAP UI development toolkit for HTML5 (SAPUI5)
7
7
  (c) Copyright 2009-2021 SAP SE. All rights reserved
8
8
  </copyright>
9
- <version>1.95.0</version>
9
+ <version>1.96.4</version>
10
10
 
11
11
  <documentation>UI5 library: sap.fe.macros</documentation>
12
12
 
@@ -21,9 +21,10 @@
21
21
  xmlns:template="http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1"
22
22
  xmlns:unittest="http://schemas.sap.com/sapui5/preprocessorextension/sap.fe.unittesting/1"
23
23
  xmlns:mdc="sap.ui.mdc"
24
+ xmlns:chart="sap.ui.mdc.chartNew"
24
25
  xmlns:mdcat="sap.ui.mdc.actiontoolbar"
25
26
  xmlns:core="sap.ui.core"
26
- xmlns:chart="sap.ui.mdc.chart"
27
+ xmlns:macro="sap.fe.macros"
27
28
  xmlns:macrodata="http://schemas.sap.com/sapui5/extension/sap.ui.core.CustomData/1"
28
29
  template:require="{
29
30
  HELPER: 'sap/fe/macros/chart/ChartHelper',
@@ -36,127 +37,124 @@
36
37
  <template:with path="contextPath>" helper="COMMON.getTargetCollection" var="targetCollection">
37
38
  <template:with path="metaPath>" helper="COMMON.createPresentationPathContext" var="presentationPath">
38
39
  <template:with path="metaPath>" helper="HELPER.getUiChart" var="chart">
39
- <mdc:Chart
40
- binding="{= '{internal>controls/' + ${this>id} + '}' }"
41
- unittest:id="ChartMacroFragment"
42
- id="{this>id}"
43
- data="{= '{path: \'' + (${contextPath>$kind} === 'EntitySet' ? '/' : '') + ${contextPath>@sapui.name} + '\', parameters:{$$groupId:\'$auto.Workers\'}}'}"
44
- chartType="{= ${this>chartType} || HELPER.formatChartType(${chart>ChartType})}"
45
- sortConditions="{= COMMON.getSortConditions(${metaPath>}, ${presentationPath>})}"
46
- header="{= ${this>header} || ${chart>Title} }"
47
- height="{this>height}"
48
- width="{this>width}"
49
- selectionMode="{this>selectionMode}"
50
- vizProperties="{this>vizProperties}"
51
- p13nMode="{this>personalization}"
52
- filter="{this>filter}"
53
- noDataText="{this>noDataText}"
54
- autoBindOnInit="{this>autoBindOnInit}"
55
- delegate="{= ${this>chartDelegate} || '{name:\'sap/fe/macros/ChartDelegate\', payload: {contextPath: \'\/' + ${targetCollection>$@sapui.name} + '\'}}'}"
56
- selectionDetailsActionPressed="HELPER.onSelectionDetailsActionPressed"
57
- dataPointsSelected="{this>dataPointsSelected}"
58
- macrodata:targetCollectionPath="{contextPath>@@COMMON.getContextPath}"
59
- macrodata:entityType="{= ${contextPath>@@COMMON.getContextPath} + '/' }"
60
- macrodata:operationAvailableMap="{= COMMON.stringifyCustomData(${chart>@@HELPER.getOperationAvailableMap})}"
61
- macrodata:multiSelectDisabledActions="{= '' + ${chart>@@HELPER.getMultiSelectDisabledActions} + ''}"
62
- macrodata:segmentedButtonId="{= ID.generate([${this>id}, 'SegmentedButton', 'TemplateContentView']) }"
63
- macrodata:customAgg="{=COMMON.stringifyCustomData(${chartDefinition>customAgg})}"
64
- macrodata:transAgg="{=COMMON.stringifyCustomData(${chartDefinition>transAgg})}"
65
- macrodata:applySupported="{=COMMON.stringifyCustomData(${chartDefinition>applySupported})}"
66
- visible="{this>visible}"
67
- >
40
+ <macro:ChartAPI id="{this>_apiId}" selectionChange="{this>selectionChange}">
41
+ <mdc:ChartNew
42
+ core:require="{API: 'sap/fe/macros/ChartAPI'}"
43
+ binding="{= '{internal>controls/' + ${this>id} + '}' }"
44
+ unittest:id="ChartMacroFragment"
45
+ id="{this>_contentId}"
46
+ chartType="{= HELPER.formatChartType(${chart>ChartType})}"
47
+ sortConditions="{= COMMON.getSortConditions(${metaPath>}, ${presentationPath>})}"
48
+ header="{= ${chart>Title} }"
49
+ height="{this>height}"
50
+ width="{this>width}"
51
+ p13nMode="{this>personalization}"
52
+ filter="{this>filter}"
53
+ noDataText="{this>noDataText}"
54
+ autoBindOnInit="{this>autoBindOnInit}"
55
+ delegate="{= ${this>chartDelegate} || '{name:\'sap/fe/macros/ChartDelegate\', payload: {contextPath: \'' + ${contextPath>$@sapui.name} + '\', parameters:{$$groupId:\'$auto.Workers\'}, selectionMode: \'' + ${this>selectionMode} + '\'}}'}"
56
+ macrodata:targetCollectionPath="{contextPath>@@COMMON.getContextPath}"
57
+ macrodata:entitySet="{= ${targetCollection>$@sapui.name} }"
58
+ macrodata:entityType="{= ${contextPath>@@COMMON.getContextPath} + '/' }"
59
+ macrodata:operationAvailableMap="{= COMMON.stringifyCustomData(${chart>@@HELPER.getOperationAvailableMap})}"
60
+ macrodata:multiSelectDisabledActions="{= '' + ${chart>@@HELPER.getMultiSelectDisabledActions} + ''}"
61
+ macrodata:segmentedButtonId="{= ID.generate([${this>id}, 'SegmentedButton', 'TemplateContentView']) }"
62
+ macrodata:customAgg="{=COMMON.stringifyCustomData(${chartDefinition>customAgg})}"
63
+ macrodata:transAgg="{=COMMON.stringifyCustomData(${chartDefinition>transAgg})}"
64
+ macrodata:applySupported="{=COMMON.stringifyCustomData(${chartDefinition>applySupported})}"
65
+ macrodata:vizProperties="{this>vizProperties}"
66
+ visible="{this>visible}"
67
+ >
68
68
  <mdc:items>
69
69
  <template:if test="{= ${chart>Dimensions} }">
70
70
  <template:with path="chart>" helper="HELPER.formatDimensions" var="dimensions">
71
71
  <template:repeat list="{dimensions>}" var="dimension">
72
- <chart:DimensionItem
73
- id="{= ID.generate([${this>id}, 'dimension', ${dimension>key}]) }"
74
- key="{dimension>key}"
75
- textProperty="{dimension>textPath}"
76
- label="{dimension>label}"
77
- role="{dimension>role}"
78
- criticality="{dimension>criticality}"
79
- />
72
+ <chart:ItemNew
73
+ id="{= ID.generate([${this>id}, 'dimension', ${dimension>key}]) }"
74
+ name="{dimension>key}"
75
+ type="groupable"
76
+ label="{dimension>label}"
77
+ role="{dimension>role}"
78
+ />
80
79
  </template:repeat>
81
80
  </template:with>
82
81
  </template:if>
83
82
  <template:with path="chart>" helper="HELPER.formatMeasures" var="measures">
84
83
  <template:repeat list="{measures>}" var="measure">
85
- <chart:MeasureItem
86
- id="{= ID.generate([${this>id},'measure', ${measure>key}]) }"
87
- key="{measure>key}"
88
- propertyPath="{measure>propertyPath}"
89
- label="{measure>label}"
90
- role="{measure>role}"
91
- aggregationMethod="{measure>aggregationMethod}"
92
- dataPoint="{measure>dataPoint}"
93
- />
84
+ <chart:ItemNew
85
+ id="{= ID.generate([${this>id},'measure', ${measure>key}]) }"
86
+ name="{measure>key}"
87
+ type="aggregatable"
88
+ label="{measure>label}"
89
+ role="{measure>role}"
90
+ dataPoint="{measure>dataPoint}"
91
+ />
94
92
  </template:repeat>
95
93
  </template:with>
96
94
  </mdc:items>
97
- <template:if test="{this>actions}">
98
- <mdc:actions>
99
- <!-- TODO: This should be moved out of macros and should be added as a macro aggregation to macro chart-->
100
- <template:repeat list="{actions>}" var="action">
101
- <template:with path="action>annotationPath" var="dataField">
102
- <template:if test="{= ${action>type} === 'ForNavigation'}">
103
- <template:then>
104
- <mdcat:ActionToolbarAction>
105
- <Button
106
- unittest:id="DataFieldForIntentBasedNavigationButtonAction"
107
- text="{dataField>Label}"
108
- press="{= COMMON.getPressHandlerForDataFieldForIBN(${dataField>}, '${internal>selectedContexts}')}"
109
- enabled="{= ${action>enabled} !== undefined ? ${action>enabled} : ${dataField>RequiresContext} ? '{= %{internal>numberOfSelectedContexts} >= 1}' : undefined }"
110
- visible="{= ${dataField>./@com.sap.vocabularies.UI.v1.Hidden} ? (${dataField>./@com.sap.vocabularies.UI.v1.Hidden/$Path} ? ${dataField>./@com.sap.vocabularies.UI.v1.Hidden/$Path@@HELPER.getHiddenPathExpressionForTableActionsAndIBN} : !${dataField>./@com.sap.vocabularies.UI.v1.Hidden}) : true}"
111
- />
112
- </mdcat:ActionToolbarAction>
113
- </template:then>
114
- <template:elseif test="{= ${action>type} === 'ForAction'}">
115
- <template:with path="dataField>Action" helper="COMMON.getActionContext" var="actionContext">
116
- <template:with path="dataField>Action" helper="COMMON.getPathToBoundActionOverload" var="isBound">
117
- <template:if test="{= ${isBound>$IsBound} !== true || ${actionContext>@Org.OData.Core.V1.OperationAvailable} !== false }">
95
+ <template:if test="{this>actions}">
96
+ <mdc:actions>
97
+ <!-- TODO: This should be moved out of macros and should be added as a macro aggregation to macro chart-->
98
+ <template:repeat list="{actions>}" var="action">
99
+ <template:with path="action>annotationPath" var="dataField">
100
+ <template:if test="{= ${action>type} === 'ForNavigation'}">
101
+ <template:then>
118
102
  <mdcat:ActionToolbarAction>
119
103
  <Button
120
- unittest:id="DataFieldForActionButtonAction"
121
- id="{= ID.generate([${this>id}, ${dataField>}])}"
122
- text="{dataField>Label}"
123
- ariaHasPopup="{actionContext>@@COMMON.isDialog}"
124
- press="{= HELPER.getPressEventForDataFieldForActionButton(${this>id},${dataField>},${chart>@@HELPER.getOperationAvailableMap})}"
125
- enabled="{= ${action>enabled} !== undefined ? ${action>enabled} : HELPER.isDataFieldForActionButtonEnabled(${isBound>$IsBound},${dataField>Action},${this>contextPath},${chart>@@HELPER.getOperationAvailableMap}, ${action>enableOnSelect}) }"
126
- visible="{= ${dataField>./@com.sap.vocabularies.UI.v1.Hidden} ? (${dataField>./@com.sap.vocabularies.UI.v1.Hidden/$Path} ? ${dataField>./@com.sap.vocabularies.UI.v1.Hidden/$Path@@HELPER.getHiddenPathExpressionForTableActionsAndIBN} : !${dataField>./@com.sap.vocabularies.UI.v1.Hidden}) : true}"
127
- />
104
+ unittest:id="DataFieldForIntentBasedNavigationButtonAction"
105
+ text="{dataField>Label}"
106
+ press="{= COMMON.getPressHandlerForDataFieldForIBN(${dataField>}, '${internal>selectedContexts}')}"
107
+ enabled="{= ${action>enabled} !== undefined ? ${action>enabled} : ${dataField>RequiresContext} ? '{= %{internal>numberOfSelectedContexts} >= 1}' : undefined }"
108
+ visible="{= ${dataField>./@com.sap.vocabularies.UI.v1.Hidden} ? (${dataField>./@com.sap.vocabularies.UI.v1.Hidden/$Path} ? ${dataField>./@com.sap.vocabularies.UI.v1.Hidden/$Path@@HELPER.getHiddenPathExpressionForTableActionsAndIBN} : !${dataField>./@com.sap.vocabularies.UI.v1.Hidden}) : true}"
109
+ />
128
110
  </mdcat:ActionToolbarAction>
129
- </template:if>
130
- </template:with>
111
+ </template:then>
112
+ <template:elseif test="{= ${action>type} === 'ForAction'}">
113
+ <template:with path="dataField>Action" helper="COMMON.getActionContext" var="actionContext">
114
+ <template:with path="dataField>Action" helper="COMMON.getPathToBoundActionOverload" var="isBound">
115
+ <template:if test="{= ${isBound>$IsBound} !== true || ${actionContext>@Org.OData.Core.V1.OperationAvailable} !== false }">
116
+ <mdcat:ActionToolbarAction>
117
+ <Button
118
+ unittest:id="DataFieldForActionButtonAction"
119
+ id="{= ID.generate([${this>id}, ${dataField>}])}"
120
+ text="{dataField>Label}"
121
+ ariaHasPopup="{actionContext>@@COMMON.isDialog}"
122
+ press="{= HELPER.getPressEventForDataFieldForActionButton(${this>id},${dataField>},${chart>@@HELPER.getOperationAvailableMap})}"
123
+ enabled="{= ${action>enabled} !== undefined ? ${action>enabled} : HELPER.isDataFieldForActionButtonEnabled(${isBound>$IsBound},${dataField>Action},${this>contextPath},${chart>@@HELPER.getOperationAvailableMap}, ${action>enableOnSelect}) }"
124
+ visible="{= ${dataField>./@com.sap.vocabularies.UI.v1.Hidden} ? (${dataField>./@com.sap.vocabularies.UI.v1.Hidden/$Path} ? ${dataField>./@com.sap.vocabularies.UI.v1.Hidden/$Path@@HELPER.getHiddenPathExpressionForTableActionsAndIBN} : !${dataField>./@com.sap.vocabularies.UI.v1.Hidden}) : true}"
125
+ />
126
+ </mdcat:ActionToolbarAction>
127
+ </template:if>
128
+ </template:with>
129
+ </template:with>
130
+ </template:elseif>
131
+ </template:if>
131
132
  </template:with>
132
- </template:elseif>
133
- </template:if>
134
- </template:with>
135
- </template:repeat>
136
- <template:if test="{this>onSegmentedButtonPressed}">
137
- <mdcat:ActionToolbarAction layoutInformation="{
138
- aggregationName: 'end',
139
- alignment: 'End'
140
- }">
141
- <SegmentedButton
142
- id="{= ID.generate([${this>id}, 'SegmentedButton', 'TemplateContentView']) }"
143
- select="{this>onSegmentedButtonPressed}"
144
- visible="{= ${pageInternal>alpContentView} !== 'Table' }"
145
- selectedKey="{pageInternal>alpContentView}"
146
- >
147
- <items>
148
- <template:if test="{= COMMON.isDesktop() }">
149
- <SegmentedButtonItem tooltip="{this.i18n>M_COMMON_HYBRID_SEGMENTED_BUTTON_ITEM_TOOLTIP}" key="Hybrid" icon="sap-icon://chart-table-view" />
150
- </template:if>
151
- <SegmentedButtonItem tooltip="{this.i18n>M_COMMON_CHART_SEGMENTED_BUTTON_ITEM_TOOLTIP}" key="Chart" icon="sap-icon://bar-chart" />
152
- <SegmentedButtonItem tooltip="{this.i18n>M_COMMON_TABLE_SEGMENTED_BUTTON_ITEM_TOOLTIP}" key="Table" icon="sap-icon://table-view" />
153
- </items>
154
- </SegmentedButton>
155
- </mdcat:ActionToolbarAction>
156
- </template:if>
157
- </mdc:actions>
158
- </template:if>
159
- <!-- <mdc:selectionDetailsActions>
133
+ </template:repeat>
134
+ <template:if test="{this>onSegmentedButtonPressed}">
135
+ <mdcat:ActionToolbarAction layoutInformation="{
136
+ aggregationName: 'end',
137
+ alignment: 'End'
138
+ }">
139
+ <SegmentedButton
140
+ id="{= ID.generate([${this>id}, 'SegmentedButton', 'TemplateContentView']) }"
141
+ select="{this>onSegmentedButtonPressed}"
142
+ visible="{= ${pageInternal>alpContentView} !== 'Table' }"
143
+ selectedKey="{pageInternal>alpContentView}"
144
+ >
145
+ <items>
146
+ <template:if test="{= COMMON.isDesktop() }">
147
+ <SegmentedButtonItem tooltip="{this.i18n>M_COMMON_HYBRID_SEGMENTED_BUTTON_ITEM_TOOLTIP}" key="Hybrid" icon="sap-icon://chart-table-view" />
148
+ </template:if>
149
+ <SegmentedButtonItem tooltip="{this.i18n>M_COMMON_CHART_SEGMENTED_BUTTON_ITEM_TOOLTIP}" key="Chart" icon="sap-icon://bar-chart" />
150
+ <SegmentedButtonItem tooltip="{this.i18n>M_COMMON_TABLE_SEGMENTED_BUTTON_ITEM_TOOLTIP}" key="Table" icon="sap-icon://table-view" />
151
+ </items>
152
+ </SegmentedButton>
153
+ </mdcat:ActionToolbarAction>
154
+ </template:if>
155
+ </mdc:actions>
156
+ </template:if>
157
+ <!-- <mdc:selectionDetailsActions>
160
158
  <chart:SelectionDetailsActions>
161
159
  <chart:detailsItemActions>
162
160
  <template:repeat list="{path: 'actions>',
@@ -168,8 +166,9 @@
168
166
  </chart:detailsItemActions>
169
167
  </chart:SelectionDetailsActions>
170
168
  </mdc:selectionDetailsActions> -->
171
- </mdc:Chart>
172
- </template:with>
169
+ </mdc:ChartNew>
170
+ </macro:ChartAPI>
171
+ </template:with>
173
172
  </template:with>
174
173
  </template:with>
175
174
  </core:FragmentDefinition>
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * SAPUI5
3
- * (c) Copyright 2009-2021 SAP SE. All rights reserved.
3
+ * (c) Copyright 2009-2022 SAP SE. All rights reserved.
4
4
  */
5
5
 
6
6
  sap.ui.define(
@@ -19,9 +19,8 @@ sap.ui.define(
19
19
  *
20
20
  * @class sap.fe.macros.Chart
21
21
  * @hideconstructor
22
- * @ui5-restricted
23
- * @experimental As of version 1.94.0
24
- * @since 1.94.0
22
+ * @private
23
+ * @experimental
25
24
  */
26
25
  var Chart = MacroMetadata.extend("sap.fe.macros.Chart", {
27
26
  /**
@@ -60,6 +59,14 @@ sap.ui.define(
60
59
  type: "string",
61
60
  isPublic: true
62
61
  },
62
+ /**
63
+ * If specificed as true the ID is applied to the inner content of the building block
64
+ * This is only a private property to be used by sap.fe (Fiori Elements)
65
+ */
66
+ _applyIdToContent: {
67
+ type: "boolean",
68
+ defaultValue: false
69
+ },
63
70
  /**
64
71
  * Metadata path to the presentation (UI.Chart w or w/o qualifier)
65
72
  */
@@ -129,13 +136,6 @@ sap.ui.define(
129
136
  vizProperties: {
130
137
  type: "string"
131
138
  },
132
- /**
133
- * Parameter which sets the event handler on a chart selection
134
- */
135
- dataPointsSelected: {
136
- type: "function",
137
- isPublic: true
138
- },
139
139
  /**
140
140
  * The actions to be shown in the action area of the chart
141
141
  */
@@ -152,6 +152,14 @@ sap.ui.define(
152
152
  events: {
153
153
  onSegmentedButtonPressed: {
154
154
  type: "function"
155
+ },
156
+ /**
157
+ * An event triggered when chart selections are changed. The event contains information about the data selected/deselected and
158
+ * boolean flag that indicates whether data is selected or deselected
159
+ */
160
+ selectionChange: {
161
+ type: "Function",
162
+ isPublic: true
155
163
  }
156
164
  }
157
165
  },
@@ -193,6 +201,15 @@ sap.ui.define(
193
201
  }
194
202
  this.setDefaultValue(oProps, "onSegmentedButtonPressed", oChartDefinition.onSegmentedButtonPressed);
195
203
  this.setDefaultValue(oProps, "visible", oChartDefinition.visible);
204
+
205
+ if (oProps._applyIdToContent) {
206
+ oProps._apiId = oProps.id + "::Chart";
207
+ oProps._contentId = oProps.id;
208
+ } else {
209
+ oProps._apiId = oProps.id;
210
+ oProps._contentId = oProps.id + "-content";
211
+ }
212
+
196
213
  return oProps;
197
214
  }
198
215
  });
@@ -0,0 +1,147 @@
1
+ /*!
2
+ * SAP UI development toolkit for HTML5 (SAPUI5)
3
+ * (c) Copyright 2009-2021 SAP SE. All rights reserved
4
+ */
5
+ sap.ui.define(["sap/fe/core/helpers/ClassSupport", "./MacroAPI", "sap/base/util/merge"], function (ClassSupport, MacroAPI, merge) {
6
+ "use strict";
7
+
8
+ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6;
9
+
10
+ var Event = ClassSupport.Event;
11
+ var EventHandler = ClassSupport.EventHandler;
12
+ var Property = ClassSupport.Property;
13
+ var APIClass = ClassSupport.APIClass;
14
+
15
+ function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
16
+
17
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
18
+
19
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
20
+
21
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
22
+
23
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
24
+
25
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
26
+
27
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
28
+
29
+ function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
30
+
31
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
32
+
33
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
34
+
35
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
36
+
37
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
38
+
39
+ function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
40
+
41
+ function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); }
42
+
43
+ /**
44
+ * Building block used to create a chart based on the metadata provided by OData V4.
45
+ * <br>
46
+ * Usually, a contextPath and metaPath is expected.
47
+ *
48
+ *
49
+ * Usage example:
50
+ * <pre>
51
+ * &lt;macro:Chart id="Mychart" contextPath="/RootEntity" metaPath="@com.sap.vocabularies.UI.v1.Chart" /&gt;
52
+ * </pre>
53
+ *
54
+ * @alias sap.fe.macros.Chart
55
+ * @public
56
+ */
57
+ var ChartAPI = (_dec = APIClass("sap.fe.macros.ChartAPI"), _dec2 = Property({
58
+ type: "string"
59
+ }), _dec3 = Property({
60
+ type: "sap.ui.model.Context",
61
+ required: true
62
+ }), _dec4 = Property({
63
+ type: "sap.ui.model.Context",
64
+ required: true
65
+ }), _dec5 = Property({
66
+ type: "string",
67
+ defaultValue: "MULTIPLE"
68
+ }), _dec6 = Property({
69
+ type: "boolean|string"
70
+ }), _dec(_class = (_class2 = /*#__PURE__*/function (_MacroAPI) {
71
+ _inherits(ChartAPI, _MacroAPI);
72
+
73
+ var _super = _createSuper(ChartAPI);
74
+
75
+ function ChartAPI() {
76
+ var _this;
77
+
78
+ _classCallCheck(this, ChartAPI);
79
+
80
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
81
+ args[_key] = arguments[_key];
82
+ }
83
+
84
+ _this = _super.call.apply(_super, [this].concat(args));
85
+
86
+ _initializerDefineProperty(_assertThisInitialized(_this), "id", _descriptor, _assertThisInitialized(_this));
87
+
88
+ _initializerDefineProperty(_assertThisInitialized(_this), "metaPath", _descriptor2, _assertThisInitialized(_this));
89
+
90
+ _initializerDefineProperty(_assertThisInitialized(_this), "contextPath", _descriptor3, _assertThisInitialized(_this));
91
+
92
+ _initializerDefineProperty(_assertThisInitialized(_this), "selectionMode", _descriptor4, _assertThisInitialized(_this));
93
+
94
+ _initializerDefineProperty(_assertThisInitialized(_this), "personalization", _descriptor5, _assertThisInitialized(_this));
95
+
96
+ _initializerDefineProperty(_assertThisInitialized(_this), "selectionChange", _descriptor6, _assertThisInitialized(_this));
97
+
98
+ return _this;
99
+ }
100
+
101
+ _createClass(ChartAPI, [{
102
+ key: "handleSelectionChange",
103
+ value: function handleSelectionChange(oEvent) {
104
+ var aData = oEvent.getParameter("data");
105
+ var bSelected = oEvent.getParameter("name") === "selectData";
106
+ this.fireSelectionChange(merge({}, {
107
+ data: aData,
108
+ selected: bSelected
109
+ }));
110
+ }
111
+ }]);
112
+
113
+ return ChartAPI;
114
+ }(MacroAPI), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "id", [_dec2], {
115
+ configurable: true,
116
+ enumerable: true,
117
+ writable: true,
118
+ initializer: null
119
+ }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "metaPath", [_dec3], {
120
+ configurable: true,
121
+ enumerable: true,
122
+ writable: true,
123
+ initializer: null
124
+ }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "contextPath", [_dec4], {
125
+ configurable: true,
126
+ enumerable: true,
127
+ writable: true,
128
+ initializer: null
129
+ }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "selectionMode", [_dec5], {
130
+ configurable: true,
131
+ enumerable: true,
132
+ writable: true,
133
+ initializer: null
134
+ }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "personalization", [_dec6], {
135
+ configurable: true,
136
+ enumerable: true,
137
+ writable: true,
138
+ initializer: null
139
+ }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "selectionChange", [Event], {
140
+ configurable: true,
141
+ enumerable: true,
142
+ writable: true,
143
+ initializer: null
144
+ }), _applyDecoratedDescriptor(_class2.prototype, "handleSelectionChange", [EventHandler], Object.getOwnPropertyDescriptor(_class2.prototype, "handleSelectionChange"), _class2.prototype)), _class2)) || _class);
145
+ return ChartAPI;
146
+ }, false);
147
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNoYXJ0QVBJLnRzIl0sIm5hbWVzIjpbIkNoYXJ0QVBJIiwiQVBJQ2xhc3MiLCJQcm9wZXJ0eSIsInR5cGUiLCJyZXF1aXJlZCIsImRlZmF1bHRWYWx1ZSIsIm9FdmVudCIsImFEYXRhIiwiZ2V0UGFyYW1ldGVyIiwiYlNlbGVjdGVkIiwiZmlyZVNlbGVjdGlvbkNoYW5nZSIsIm1lcmdlIiwiZGF0YSIsInNlbGVjdGVkIiwiTWFjcm9BUEkiLCJFdmVudCIsIkV2ZW50SGFuZGxlciJdLCJtYXBwaW5ncyI6IjtBQUFBO0FBQ0E7QUFDQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtNQUVNQSxRLFdBRExDLFFBQVEsQ0FBQyx3QkFBRCxDLFVBUVBDLFFBQVEsQ0FBQztBQUFFQyxJQUFBQSxJQUFJLEVBQUU7QUFBUixHQUFELEMsVUFRUkQsUUFBU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ovXG5cdEBFdmVudFxuXHRzZWxlY3Rpb25DaGFuZ2UhOiBGdW5jdGlvbjtcblxuXHRARXZlbnRIYW5kbGVyXG5cdGhhbmRsZVNlbGVjdGlvbkNoYW5nZShvRXZlbnQ6IFVJNUV2ZW50KSB7XG5cdFx0Y29uc3QgYURhdGEgPSBvRXZlbnQuZ2V0UGFyYW1ldGVyKFwiZGF0YVwiKTtcblx0XHRjb25zdCBiU2VsZWN0ZWQgPSBvRXZlbnQuZ2V0UGFyYW1ldGVyKFwibmFtZVwiKSA9PT0gXCJzZWxlY3REYXRhXCI7XG5cdFx0KHRoaXMgYXMgYW55KS5maXJlU2VsZWN0aW9uQ2hhbmdlKG1lcmdlKHt9LCB7IGRhdGE6IGFEYXRhLCBzZWxlY3RlZDogYlNlbGVjdGVkIH0pKTtcblx0fVxufVxuXG5leHBvcnQgZGVmYXVsdCBDaGFydEFQSTtcbiJdfQ==
@@ -0,0 +1,79 @@
1
+ import { APIClass, Property, EventHandler, Event } from "sap/fe/core/helpers/ClassSupport";
2
+ import MacroAPI from "./MacroAPI";
3
+ import { merge } from "sap/base/util";
4
+
5
+ /**
6
+ * Building block used to create a chart based on the metadata provided by OData V4.
7
+ * <br>
8
+ * Usually, a contextPath and metaPath is expected.
9
+ *
10
+ *
11
+ * Usage example:
12
+ * <pre>
13
+ * &lt;macro:Chart id="Mychart" contextPath="/RootEntity" metaPath="@com.sap.vocabularies.UI.v1.Chart" /&gt;
14
+ * </pre>
15
+ *
16
+ * @alias sap.fe.macros.Chart
17
+ * @public
18
+ */
19
+ @APIClass("sap.fe.macros.ChartAPI")
20
+ class ChartAPI extends MacroAPI {
21
+ /**
22
+ *
23
+ * ID of the chart
24
+ *
25
+ * @public
26
+ */
27
+ @Property({ type: "string" })
28
+ id!: string;
29
+
30
+ /**
31
+ * Metadata path to the presentation (UI.Chart w or w/o qualifier)
32
+ *
33
+ * @public
34
+ */
35
+ @Property({ type: "sap.ui.model.Context", required: true })
36
+ metaPath!: string;
37
+
38
+ /**
39
+ * Metadata path to the entitySet or navigationProperty
40
+ *
41
+ * @public
42
+ */
43
+ @Property({ type: "sap.ui.model.Context", required: true })
44
+ contextPath!: string;
45
+
46
+ /**
47
+ * Specifies the selection mode
48
+ *
49
+ * @public
50
+ */
51
+ @Property({ type: "string", defaultValue: "MULTIPLE" })
52
+ selectionMode!: string;
53
+
54
+ /**
55
+ * Parameter which sets the personalization of the MDC chart
56
+ *
57
+ * @public
58
+ */
59
+ @Property({ type: "boolean|string" })
60
+ personalization!: boolean | string;
61
+
62
+ /**
63
+ * An event triggered when chart selections are changed. The event contains information about the data selected/deselected and
64
+ * boolean flag that indicates whether data is selected or deselected.
65
+ *
66
+ * @public
67
+ */
68
+ @Event
69
+ selectionChange!: Function;
70
+
71
+ @EventHandler
72
+ handleSelectionChange(oEvent: UI5Event) {
73
+ const aData = oEvent.getParameter("data");
74
+ const bSelected = oEvent.getParameter("name") === "selectData";
75
+ (this as any).fireSelectionChange(merge({}, { data: aData, selected: bSelected }));
76
+ }
77
+ }
78
+
79
+ export default ChartAPI;