@sapui5/sap.fe.macros 1.95.0 → 1.98.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.
- package/package.json +6 -5
- package/src/sap/fe/macros/.library +1 -1
- package/src/sap/fe/macros/Chart.fragment.xml +106 -107
- package/src/sap/fe/macros/Chart.metadata.js +28 -13
- package/src/sap/fe/macros/ChartAPI.js +147 -0
- package/src/sap/fe/macros/ChartAPI.ts +79 -0
- package/src/sap/fe/macros/ChartDelegate.js +398 -455
- package/src/sap/fe/macros/CommonHelper.js +36 -30
- package/src/sap/fe/macros/Contact.designtime.js +1 -1
- package/src/sap/fe/macros/Contact.fragment.xml +0 -1
- package/src/sap/fe/macros/Contact.metadata.js +1 -1
- package/src/sap/fe/macros/ContactHelper.js +1 -1
- package/src/sap/fe/macros/DelegateUtil.js +51 -12
- package/src/sap/fe/macros/DraftIndicator.metadata.js +1 -1
- package/src/sap/fe/macros/DraftIndicatorRuntime.js +1 -1
- package/src/sap/fe/macros/FieldAPI.js +4 -6
- package/src/sap/fe/macros/FieldAPI.ts +8 -10
- package/src/sap/fe/macros/FieldBaseDelegate.js +89 -0
- package/src/sap/fe/macros/FieldValueHelpDelegate.js +18 -4
- package/src/sap/fe/macros/FilterBar.designtime.js +1 -1
- package/src/sap/fe/macros/FilterBar.fragment.xml +11 -10
- package/src/sap/fe/macros/FilterBar.metadata.js +88 -19
- package/src/sap/fe/macros/FilterBarAPI.js +50 -12
- package/src/sap/fe/macros/FilterBarAPI.ts +85 -10
- package/src/sap/fe/macros/FilterBarDelegate.js +54 -11
- package/src/sap/fe/macros/FilterField.designtime.js +2 -2
- package/src/sap/fe/macros/FlexibleColumnLayoutActions.fragment.xml +6 -15
- package/src/sap/fe/macros/FlexibleColumnLayoutActions.metadata.js +1 -1
- package/src/sap/fe/macros/Form.designtime.js +1 -1
- package/src/sap/fe/macros/Form.fragment.xml +21 -17
- package/src/sap/fe/macros/Form.metadata.js +9 -1
- package/src/sap/fe/macros/FormContainer.designtime.js +1 -1
- package/src/sap/fe/macros/FormContainer.fragment.xml +14 -12
- package/src/sap/fe/macros/FormContainer.metadata.js +1 -1
- package/src/sap/fe/macros/MacroAPI.js +2 -2
- package/src/sap/fe/macros/MacroMetadata.js +3 -3
- package/src/sap/fe/macros/MicroChart.designtime.js +1 -1
- package/src/sap/fe/macros/MicroChart.metadata.js +1 -1
- package/src/sap/fe/macros/ODataMetaModelUtil.js +1 -1
- package/src/sap/fe/macros/Paginator.metadata.js +4 -5
- package/src/sap/fe/macros/PhantomUtil.js +10 -5
- package/src/sap/fe/macros/QuickViewForm.designtime.js +1 -1
- package/src/sap/fe/macros/QuickViewForm.metadata.js +3 -2
- package/src/sap/fe/macros/ResourceModel.js +1 -1
- package/src/sap/fe/macros/Share.metadata.js +12 -9
- package/src/sap/fe/macros/SizeHelper.js +169 -36
- package/src/sap/fe/macros/Table.fragment.xml +111 -111
- package/src/sap/fe/macros/Table.metadata.js +85 -69
- package/src/sap/fe/macros/TableAPI.js +44 -25
- package/src/sap/fe/macros/TableAPI.ts +29 -8
- package/src/sap/fe/macros/TraceInfo.js +1 -1
- package/src/sap/fe/macros/ValueHelp.metadata.js +1 -1
- package/src/sap/fe/macros/VisualFilter.metadata.js +1 -1
- package/src/sap/fe/macros/chart/ChartHelper.js +9 -4
- package/src/sap/fe/macros/chart/ChartRuntime.js +5 -5
- package/src/sap/fe/macros/chart/ChartUtils.js +43 -37
- package/src/sap/fe/macros/field/FieldHelper.js +203 -26
- package/src/sap/fe/macros/field/FieldRuntime.js +335 -110
- package/src/sap/fe/macros/field/FieldTemplating.js +173 -43
- package/src/sap/fe/macros/field/FieldTemplating.ts +153 -31
- package/src/sap/fe/macros/field/QuickViewLinkContactContent.fragment.xml +12 -11
- package/src/sap/fe/macros/field/QuickViewLinkDelegate.js +76 -104
- package/src/sap/fe/macros/field/QuickViewLinkForContact.fragment.xml +1 -1
- package/src/sap/fe/macros/field/QuickViewLinkWithFacets.fragment.xml +40 -18
- package/src/sap/fe/macros/filter/CustomFilter.fragment.xml +5 -0
- package/src/sap/fe/macros/filter/DraftEditState.js +21 -2
- package/src/sap/fe/macros/filter/FilterFieldHelper.js +1 -1
- package/src/sap/fe/macros/filter/FilterUtils.js +13 -1
- package/src/sap/fe/macros/filter/type/MultiValue.js +1 -1
- package/src/sap/fe/macros/filter/type/Range.js +1 -1
- package/src/sap/fe/macros/filter/type/Value.js +1 -1
- package/src/sap/fe/macros/flexibility/FormDelegate.js +1 -1
- package/src/sap/fe/macros/form/DataFieldCollection.fragment.xml +2 -2
- package/src/sap/fe/macros/form/FormHelper.js +1 -1
- package/src/sap/fe/macros/formcontainer/FormContainerRuntime.js +45 -0
- package/src/sap/fe/macros/fpm/CustomFormElement.fragment.xml +5 -1
- package/src/sap/fe/macros/fpm/CustomFragment.metadata.js +1 -1
- package/src/sap/fe/macros/fpm/CustomSection.metadata.js +1 -1
- package/src/sap/fe/macros/fpm/fpm.js +1 -1
- package/src/sap/fe/macros/internal/CollectionField.metadata.js +72 -12
- package/src/sap/fe/macros/internal/CollectionField.metadata.ts +43 -14
- package/src/sap/fe/macros/internal/DataPoint.fragment.xml +13 -2
- package/src/sap/fe/macros/internal/DataPoint.metadata.js +56 -9
- package/src/sap/fe/macros/internal/Field.designtime.js +1 -1
- package/src/sap/fe/macros/internal/Field.fragment.xml +15 -8
- package/src/sap/fe/macros/internal/Field.metadata.js +48 -66
- package/src/sap/fe/macros/{FilterField.fragment.xml → internal/FilterField.fragment.xml} +2 -2
- package/src/sap/fe/macros/{FilterField.metadata.js → internal/FilterField.metadata.js} +6 -6
- package/src/sap/fe/macros/internal/SituationsIndicator.js +96 -0
- package/src/sap/fe/macros/internal/SituationsIndicator.ts +116 -0
- package/src/sap/fe/macros/internal/collectionField/MultiValueFieldDelegate.js +10 -18
- package/src/sap/fe/macros/internal/field/FieldStructure.fragment.xml +26 -17
- package/src/sap/fe/macros/internal/field/displayStyle/AmountWithCurrency.fragment.xml +5 -1
- package/src/sap/fe/macros/internal/field/displayStyle/DataPoint.fragment.xml +5 -1
- package/src/sap/fe/macros/internal/field/displayStyle/ExpandableText.fragment.xml +1 -0
- package/src/sap/fe/macros/internal/field/displayStyle/File.fragment.xml +14 -10
- package/src/sap/fe/macros/internal/field/displayStyle/LabelSemanticKey.fragment.xml +5 -3
- package/src/sap/fe/macros/internal/field/displayStyle/Link.fragment.xml +11 -3
- package/src/sap/fe/macros/internal/field/displayStyle/LinkWithQuickViewForm.fragment.xml +1 -0
- package/src/sap/fe/macros/internal/field/displayStyle/LinkWrapper.fragment.xml +5 -4
- package/src/sap/fe/macros/internal/field/displayStyle/MdcFieldWithValueHelp.fragment.xml +48 -0
- package/src/sap/fe/macros/internal/field/displayStyle/ObjectIdentifier.fragment.xml +140 -18
- package/src/sap/fe/macros/internal/field/displayStyle/ObjectStatus.fragment.xml +1 -0
- package/src/sap/fe/macros/internal/field/displayStyle/SemanticKeyWithDraftIndicator.fragment.xml +2 -2
- package/src/sap/fe/macros/internal/field/displayStyle/Text.fragment.xml +6 -3
- package/src/sap/fe/macros/internal/field/editStyle/CheckBox.fragment.xml +1 -1
- package/src/sap/fe/macros/internal/field/editStyle/DatePicker.fragment.xml +1 -1
- package/src/sap/fe/macros/internal/field/editStyle/DateTimePicker.fragment.xml +1 -1
- package/src/sap/fe/macros/internal/field/editStyle/File.fragment.xml +15 -4
- package/src/sap/fe/macros/internal/field/editStyle/Input.fragment.xml +1 -1
- package/src/sap/fe/macros/internal/field/editStyle/InputWithUnit.fragment.xml +4 -4
- package/src/sap/fe/macros/internal/field/editStyle/InputWithValueHelp.fragment.xml +2 -2
- package/src/sap/fe/macros/internal/field/editStyle/TextArea.fragment.xml +1 -1
- package/src/sap/fe/macros/internal/field/editStyle/TimePicker.fragment.xml +1 -1
- package/src/sap/fe/macros/internal/helpers/DataPointTemplating.js +28 -21
- package/src/sap/fe/macros/internal/helpers/DataPointTemplating.ts +40 -26
- package/src/sap/fe/macros/internal/helpers/TableTemplating.js +32 -0
- package/src/sap/fe/macros/internal/helpers/TableTemplating.ts +14 -0
- package/src/sap/fe/macros/internal/situations/Formatter.js +154 -0
- package/src/sap/fe/macros/internal/situations/Formatter.ts +146 -0
- package/src/sap/fe/macros/internal/situations/Runtime.js +204 -0
- package/src/sap/fe/macros/internal/situations/Runtime.ts +215 -0
- package/src/sap/fe/macros/internal/valuehelp/TableDelegate.js +35 -12
- package/src/sap/fe/macros/internal/valuehelp/ValueHelp.designtime.js +2 -2
- package/src/sap/fe/macros/internal/valuehelp/ValueHelpContent.fragment.xml +0 -10
- package/src/sap/fe/macros/internal/valuehelp/ValueHelpTemplating.js +3 -2
- package/src/sap/fe/macros/internal/valuehelp/ValueHelpTemplating.ts +2 -2
- package/src/sap/fe/macros/internal/valuehelp/ValueListDialogTable.fragment.xml +2 -1
- package/src/sap/fe/macros/internal/valuehelp/ValueListHelper.js +240 -143
- package/src/sap/fe/macros/library.js +2 -2
- package/src/sap/fe/macros/macroLibrary.js +8 -5
- package/src/sap/fe/macros/messagebundle.properties +46 -11
- package/src/sap/fe/macros/messagebundle_ar.properties +16 -1
- package/src/sap/fe/macros/messagebundle_bg.properties +16 -1
- package/src/sap/fe/macros/messagebundle_ca.properties +16 -1
- package/src/sap/fe/macros/messagebundle_cs.properties +16 -1
- package/src/sap/fe/macros/messagebundle_cy.properties +16 -1
- package/src/sap/fe/macros/messagebundle_da.properties +16 -1
- package/src/sap/fe/macros/messagebundle_de.properties +16 -1
- package/src/sap/fe/macros/messagebundle_el.properties +17 -2
- package/src/sap/fe/macros/messagebundle_en.properties +16 -1
- package/src/sap/fe/macros/messagebundle_en_GB.properties +17 -2
- package/src/sap/fe/macros/messagebundle_en_US_sappsd.properties +16 -1
- package/src/sap/fe/macros/messagebundle_en_US_saprigi.properties +35 -4
- package/src/sap/fe/macros/messagebundle_en_US_saptrc.properties +21 -2
- package/src/sap/fe/macros/messagebundle_es.properties +16 -1
- package/src/sap/fe/macros/messagebundle_es_MX.properties +16 -1
- package/src/sap/fe/macros/messagebundle_et.properties +16 -1
- package/src/sap/fe/macros/messagebundle_fi.properties +16 -1
- package/src/sap/fe/macros/messagebundle_fr.properties +16 -1
- package/src/sap/fe/macros/messagebundle_fr_CA.properties +16 -1
- package/src/sap/fe/macros/messagebundle_hi.properties +18 -3
- package/src/sap/fe/macros/messagebundle_hr.properties +18 -3
- package/src/sap/fe/macros/messagebundle_hu.properties +16 -1
- package/src/sap/fe/macros/messagebundle_id.properties +18 -3
- package/src/sap/fe/macros/messagebundle_it.properties +16 -1
- package/src/sap/fe/macros/messagebundle_iw.properties +16 -1
- package/src/sap/fe/macros/messagebundle_ja.properties +17 -2
- package/src/sap/fe/macros/messagebundle_kk.properties +16 -1
- package/src/sap/fe/macros/messagebundle_ko.properties +19 -4
- package/src/sap/fe/macros/messagebundle_lt.properties +16 -1
- package/src/sap/fe/macros/messagebundle_lv.properties +18 -3
- package/src/sap/fe/macros/messagebundle_ms.properties +16 -1
- package/src/sap/fe/macros/messagebundle_nl.properties +16 -1
- package/src/sap/fe/macros/messagebundle_no.properties +18 -3
- package/src/sap/fe/macros/messagebundle_pl.properties +18 -3
- package/src/sap/fe/macros/messagebundle_pt.properties +17 -2
- package/src/sap/fe/macros/messagebundle_pt_PT.properties +16 -1
- package/src/sap/fe/macros/messagebundle_ro.properties +16 -1
- package/src/sap/fe/macros/messagebundle_ru.properties +18 -3
- package/src/sap/fe/macros/messagebundle_sh.properties +16 -1
- package/src/sap/fe/macros/messagebundle_sk.properties +16 -1
- package/src/sap/fe/macros/messagebundle_sl.properties +16 -1
- package/src/sap/fe/macros/messagebundle_sv.properties +17 -2
- package/src/sap/fe/macros/messagebundle_th.properties +18 -3
- package/src/sap/fe/macros/messagebundle_tr.properties +16 -1
- package/src/sap/fe/macros/messagebundle_uk.properties +16 -1
- package/src/sap/fe/macros/messagebundle_vi.properties +19 -4
- package/src/sap/fe/macros/messagebundle_zh_CN.properties +20 -5
- package/src/sap/fe/macros/messagebundle_zh_TW.properties +16 -1
- package/src/sap/fe/macros/microchart/MicroChartContainer.js +3 -3
- package/src/sap/fe/macros/microchart/MicroChartHelper.js +1 -1
- package/src/sap/fe/macros/microchart/fragments/MicroChartTitle.fragment.xml +21 -11
- package/src/sap/fe/macros/microchart/fragments/RadialMicroChart.fragment.xml +2 -1
- package/src/sap/fe/macros/table/Actions.fragment.xml +51 -56
- package/src/sap/fe/macros/table/BasicSearch.js +3 -3
- package/src/sap/fe/macros/table/Column.fragment.xml +1 -1
- package/src/sap/fe/macros/table/ColumnContent.fragment.xml +76 -29
- package/src/sap/fe/macros/table/ColumnProperty.fragment.xml +0 -1
- package/src/sap/fe/macros/table/QuickFilterContainer.js +14 -5
- package/src/sap/fe/macros/table/TableFullScreenUtil.js +1 -1
- package/src/sap/fe/macros/table/TableHelper.js +71 -184
- package/src/sap/fe/macros/table/TableRuntime.js +5 -2
- package/src/sap/fe/macros/table/Utils.js +11 -6
- package/src/sap/fe/macros/table/delegates/ALPTableDelegate.js +1 -1
- package/src/sap/fe/macros/table/delegates/ALPTableDelegateBaseMixin.js +4 -4
- package/src/sap/fe/macros/table/delegates/AnalyticalALPTableDelegate.js +1 -1
- package/src/sap/fe/macros/table/delegates/AnalyticalTableDelegate.js +1 -1
- package/src/sap/fe/macros/table/delegates/TableDelegate.js +276 -151
- package/src/sap/fe/macros/valuehelp/ValueHelpFilterBar.designtime.js +1 -1
- package/src/sap/fe/macros/valuehelp/ValueHelpFilterBar.fragment.xml +5 -5
- package/src/sap/fe/macros/valuehelp/ValueHelpFilterBar.metadata.js +3 -3
- package/src/sap/fe/macros/visualfilters/InteractiveChartHelper.js +1 -1
- package/src/sap/fe/macros/visualfilters/VisualFilterRuntime.js +1 -1
- package/src/sap/fe/macros/FilterBarHelper.js +0 -47
- package/src/sap/fe/macros/FormWrapper.fragment.xml +0 -26
- package/src/sap/fe/macros/massedit/MassEditDialog.fragment.xml +0 -106
- package/src/sap/fe/macros/massedit/MassEditHandler.js +0 -701
- package/src/sap/fe/macros/massedit/MassEditRuntime.js +0 -72
package/package.json
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sapui5/sap.fe.macros",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.98.0",
|
|
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)",
|
|
7
7
|
"homepage": "https://sap.github.io/ui5-tooling/pages/SAPUI5/",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"build": "tsc -v && tsc --project tsconfig-build.json",
|
|
10
|
+
"lint": "eslint --rulesdir ../../eslint/lib/rules --ext .js,.ts --quiet --fix src",
|
|
10
11
|
"prepare-npm-sources": "babel target/npm-sources/src --out-dir target/npm-sources/src --extensions \".ts\" --config-file ../../.babelrc",
|
|
11
12
|
"prepare-ts-class-doc": "ts-node ../../docbuilder/prepareTSClassDoc sap.fe.macros",
|
|
12
|
-
"test": "jest --
|
|
13
|
-
"test-refs": "jest --
|
|
14
|
-
"test-updateSnapshots": "jest --
|
|
13
|
+
"test": "jest --runInBand",
|
|
14
|
+
"test-refs": "jest --runInBand --config jest.config-refs.js",
|
|
15
|
+
"test-updateSnapshots": "jest --runInBand --forceExit -u"
|
|
15
16
|
},
|
|
16
17
|
"keywords": [
|
|
17
18
|
"sapui5",
|
|
@@ -20,6 +21,6 @@
|
|
|
20
21
|
"devDependencies": {
|
|
21
22
|
"ts-node": "^9.1.1",
|
|
22
23
|
"@babel/cli": "^7.14.8",
|
|
23
|
-
"@ui5/cli": "^2.
|
|
24
|
+
"@ui5/cli": "^2.14.0"
|
|
24
25
|
}
|
|
25
26
|
}
|
|
@@ -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.chart"
|
|
24
25
|
xmlns:mdcat="sap.ui.mdc.actiontoolbar"
|
|
25
26
|
xmlns:core="sap.ui.core"
|
|
26
|
-
xmlns:
|
|
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">
|
|
40
|
+
<macro:ChartAPI id="{this>_apiId}" selectionChange="{this>selectionChange}">
|
|
39
41
|
<mdc:Chart
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
visible="{this>visible}"
|
|
67
|
-
>
|
|
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:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
/>
|
|
72
|
+
<chart:Item
|
|
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:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
/>
|
|
84
|
+
<chart:Item
|
|
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
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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:
|
|
130
|
-
|
|
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:
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
</
|
|
155
|
-
</
|
|
156
|
-
|
|
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
|
-
|
|
172
|
-
</
|
|
169
|
+
</mdc:Chart>
|
|
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-
|
|
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
|
-
* @
|
|
23
|
-
* @experimental
|
|
24
|
-
* @since 1.94.0
|
|
22
|
+
* @private
|
|
23
|
+
* @experimental
|
|
25
24
|
*/
|
|
26
25
|
var Chart = MacroMetadata.extend("sap.fe.macros.Chart", {
|
|
27
26
|
/**
|
|
@@ -60,12 +59,19 @@ 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
|
*/
|
|
66
73
|
metaPath: {
|
|
67
74
|
type: "sap.ui.model.Context",
|
|
68
|
-
required: true,
|
|
69
75
|
isPublic: true
|
|
70
76
|
},
|
|
71
77
|
/**
|
|
@@ -73,7 +79,6 @@ sap.ui.define(
|
|
|
73
79
|
*/
|
|
74
80
|
contextPath: {
|
|
75
81
|
type: "sap.ui.model.Context",
|
|
76
|
-
required: true,
|
|
77
82
|
isPublic: true
|
|
78
83
|
},
|
|
79
84
|
/**
|
|
@@ -129,13 +134,6 @@ sap.ui.define(
|
|
|
129
134
|
vizProperties: {
|
|
130
135
|
type: "string"
|
|
131
136
|
},
|
|
132
|
-
/**
|
|
133
|
-
* Parameter which sets the event handler on a chart selection
|
|
134
|
-
*/
|
|
135
|
-
dataPointsSelected: {
|
|
136
|
-
type: "function",
|
|
137
|
-
isPublic: true
|
|
138
|
-
},
|
|
139
137
|
/**
|
|
140
138
|
* The actions to be shown in the action area of the chart
|
|
141
139
|
*/
|
|
@@ -152,6 +150,14 @@ sap.ui.define(
|
|
|
152
150
|
events: {
|
|
153
151
|
onSegmentedButtonPressed: {
|
|
154
152
|
type: "function"
|
|
153
|
+
},
|
|
154
|
+
/**
|
|
155
|
+
* An event triggered when chart selections are changed. The event contains information about the data selected/deselected and
|
|
156
|
+
* boolean flag that indicates whether data is selected or deselected
|
|
157
|
+
*/
|
|
158
|
+
selectionChange: {
|
|
159
|
+
type: "Function",
|
|
160
|
+
isPublic: true
|
|
155
161
|
}
|
|
156
162
|
}
|
|
157
163
|
},
|
|
@@ -193,6 +199,15 @@ sap.ui.define(
|
|
|
193
199
|
}
|
|
194
200
|
this.setDefaultValue(oProps, "onSegmentedButtonPressed", oChartDefinition.onSegmentedButtonPressed);
|
|
195
201
|
this.setDefaultValue(oProps, "visible", oChartDefinition.visible);
|
|
202
|
+
|
|
203
|
+
if (oProps._applyIdToContent) {
|
|
204
|
+
oProps._apiId = oProps.id + "::Chart";
|
|
205
|
+
oProps._contentId = oProps.id;
|
|
206
|
+
} else {
|
|
207
|
+
oProps._apiId = oProps.id;
|
|
208
|
+
oProps._contentId = oProps.id + "-content";
|
|
209
|
+
}
|
|
210
|
+
|
|
196
211
|
return oProps;
|
|
197
212
|
}
|
|
198
213
|
});
|
|
@@ -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; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } 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
|
+
* <macro:Chart id="Mychart" contextPath="/RootEntity" metaPath="@com.sap.vocabularies.UI.v1.Chart" />
|
|
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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNoYXJ0QVBJLnRzIl0sIm5hbWVzIjpbIkNoYXJ0QVBJIiwiQVBJQ2xhc3MiLCJQcm9wZXJ0eSIsInR5cGUiLCJyZXF1aXJlZCIsImRlZmF1bHRWYWx1ZSIsIm9FdmVudCIsImFEYXRhIiwiZ2V0UGFyYW1ldGVyIiwiYlNlbGVjdGVkIiwiZmlyZVNlbGVjdGlvbkNoYW5nZSIsIm1lcmdlIiwiZGF0YSIsInNlbGVjdGVkIiwiTWFjcm9BUEkiLCJFdmVudCIsIkV2ZW50SGFuZGxlciJdLCJtYXBwaW5ncyI6IjtBQUFBO0FBQ0E7QUFDQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtNQUVNQSxRLFdBRExDLFFBQVEsQ0FBQyx3QkFBRCxDLFVBUVBDLFFBQVEsQ0FBQztBQUFFQyxJQUFBQSxJQUFJLEVBQUU7QUFBUixHQUFELEMsVUFRUkQsUUFBUSxDQUFDO0FBQUVDLElBQUFBLElBQUksRUFBRSxzQkFBUjtBQUFnQ0MsSUFBQUEsUUFBUSxFQUFFO0FBQTFDLEdBQUQsQyxVQVFSRixRQUFRLENBQUM7QUFBRUMsSUFBQUEsSUFBSSxFQUFFLHNCQUFSO0FBQWdDQyxJQUFBQSxRQUFRLEVBQUU7QUFBMUMs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ldGVyKFwiZGF0YVwiKTtcblx0XHRjb25zdCBiU2VsZWN0ZWQgPSBvRXZlbnQuZ2V0UGFyYW1ldGVyKFwibmFtZVwiKSA9PT0gXCJzZWxlY3REYXRhXCI7XG5cdFx0KHRoaXMgYXMgYW55KS5maXJlU2VsZWN0aW9uQ2hhbmdlKG1lcmdlKHt9LCB7IGRhdGE6IGFEYXRhLCBzZWxlY3RlZDogYlNlbGVjdGVkIH0pKTtcblx0fVxufVxuXG5leHBvcnQgZGVmYXVsdCBDaGFydEFQSTtcbiJdfQ==
|
|
@@ -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
|
+
* <macro:Chart id="Mychart" contextPath="/RootEntity" metaPath="@com.sap.vocabularies.UI.v1.Chart" />
|
|
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;
|