@sapui5/sap.fe.templates 1.100.0 → 1.102.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 +4 -5
- package/src/sap/fe/templates/.library +1 -2
- package/src/sap/fe/templates/AnalyticalListPage/Component.js +24 -12
- package/src/sap/fe/templates/AnalyticalListPage/Component.ts +6 -0
- package/src/sap/fe/templates/AnalyticalListPage/chart/FEChartDelegate.js +30 -32
- package/src/sap/fe/templates/AnalyticalListPage/chart/FEChartDelegate.ts +25 -0
- package/src/sap/fe/templates/Feedback.js +80 -0
- package/src/sap/fe/templates/Feedback.ts +67 -0
- package/src/sap/fe/templates/ListComponent.js +156 -118
- package/src/sap/fe/templates/ListComponent.ts +105 -0
- package/src/sap/fe/templates/ListReport/Component.js +82 -53
- package/src/sap/fe/templates/ListReport/Component.ts +39 -0
- package/src/sap/fe/templates/ListReport/ExtensionAPI.js +126 -112
- package/src/sap/fe/templates/ListReport/ExtensionAPI.ts +106 -0
- package/src/sap/fe/templates/ListReport/ListReport.view.xml +106 -58
- package/src/sap/fe/templates/ListReport/ListReportController.controller.js +1196 -1081
- package/src/sap/fe/templates/ListReport/ListReportController.controller.ts +1088 -0
- package/src/sap/fe/templates/ListReport/ListReportTemplating.js +45 -0
- package/src/sap/fe/templates/ListReport/ListReportTemplating.ts +30 -0
- package/src/sap/fe/templates/ListReport/overrides/IntentBasedNavigation.js +54 -53
- package/src/sap/fe/templates/ListReport/overrides/IntentBasedNavigation.ts +55 -0
- package/src/sap/fe/templates/ListReport/overrides/Share.js +137 -137
- package/src/sap/fe/templates/ListReport/overrides/Share.ts +135 -0
- package/src/sap/fe/templates/ListReport/overrides/ViewState.js +451 -428
- package/src/sap/fe/templates/ListReport/overrides/ViewState.ts +419 -0
- package/src/sap/fe/templates/ListReport/view/fragments/CollectionVisualization.fragment.xml +25 -25
- package/src/sap/fe/templates/ListReport/view/fragments/MultipleMode.fragment.js +72 -0
- package/src/sap/fe/templates/ListReport/view/fragments/MultipleMode.fragment.ts +62 -0
- package/src/sap/fe/templates/ListReport/view/fragments/{MultipleMode.fragment.xml → MultipleModeOld.fragment.xml} +24 -23
- package/src/sap/fe/templates/ObjectPage/Component.js +169 -138
- package/src/sap/fe/templates/ObjectPage/Component.ts +131 -0
- package/src/sap/fe/templates/ObjectPage/ExtensionAPI.js +140 -142
- package/src/sap/fe/templates/ObjectPage/ExtensionAPI.ts +116 -0
- package/src/sap/fe/templates/ObjectPage/ObjectPage.view.xml +162 -22
- package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.js +1534 -1447
- package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.ts +1454 -0
- package/src/sap/fe/templates/ObjectPage/ObjectPageTemplating.js +872 -0
- package/src/sap/fe/templates/ObjectPage/ObjectPageTemplating.ts +837 -0
- package/src/sap/fe/templates/ObjectPage/controls/StashableHBox.js +136 -101
- package/src/sap/fe/templates/ObjectPage/controls/StashableHBox.ts +84 -0
- package/src/sap/fe/templates/ObjectPage/controls/StashableVBox.js +24 -21
- package/src/sap/fe/templates/ObjectPage/controls/StashableVBox.ts +10 -0
- package/src/sap/fe/templates/ObjectPage/controls/SubSectionBlock.js +98 -53
- package/src/sap/fe/templates/ObjectPage/controls/SubSectionBlock.ts +50 -0
- package/src/sap/fe/templates/ObjectPage/designtime/FlexBox.designtime.js +20 -19
- package/src/sap/fe/templates/ObjectPage/designtime/FlexBox.designtime.ts +15 -0
- package/src/sap/fe/templates/ObjectPage/designtime/StashableHBox.designtime.js +50 -47
- package/src/sap/fe/templates/ObjectPage/designtime/StashableHBox.designtime.ts +47 -0
- package/src/sap/fe/templates/ObjectPage/designtime/StashableVBox.designtime.js +34 -34
- package/src/sap/fe/templates/ObjectPage/designtime/StashableVBox.designtime.ts +34 -0
- package/src/sap/fe/templates/ObjectPage/flexibility/StashableHBox.flexibility.js +15 -15
- package/src/sap/fe/templates/ObjectPage/flexibility/StashableHBox.flexibility.ts +13 -0
- package/src/sap/fe/templates/ObjectPage/flexibility/StashableVBox.flexibility.js +11 -11
- package/src/sap/fe/templates/ObjectPage/flexibility/StashableVBox.flexibility.ts +7 -0
- package/src/sap/fe/templates/ObjectPage/overrides/IntentBasedNavigation.js +55 -52
- package/src/sap/fe/templates/ObjectPage/overrides/IntentBasedNavigation.ts +57 -0
- package/src/sap/fe/templates/ObjectPage/overrides/InternalRouting.js +15 -17
- package/src/sap/fe/templates/ObjectPage/overrides/InternalRouting.ts +13 -0
- package/src/sap/fe/templates/ObjectPage/overrides/MessageHandler.js +13 -17
- package/src/sap/fe/templates/ObjectPage/overrides/MessageHandler.ts +14 -0
- package/src/sap/fe/templates/ObjectPage/overrides/Paginator.js +23 -21
- package/src/sap/fe/templates/ObjectPage/overrides/Paginator.ts +21 -0
- package/src/sap/fe/templates/ObjectPage/overrides/Share.js +310 -317
- package/src/sap/fe/templates/ObjectPage/overrides/Share.ts +316 -0
- package/src/sap/fe/templates/ObjectPage/overrides/ViewState.js +66 -57
- package/src/sap/fe/templates/ObjectPage/overrides/ViewState.ts +65 -0
- package/src/sap/fe/templates/ObjectPage/view/fragments/Actions.fragment.xml +26 -33
- package/src/sap/fe/templates/ObjectPage/view/fragments/CollaborationDraft.fragment.xml +11 -10
- package/src/sap/fe/templates/ObjectPage/view/fragments/EditableHeaderFacet.fragment.xml +15 -15
- package/src/sap/fe/templates/ObjectPage/view/fragments/FooterContent.fragment.xml +31 -27
- package/src/sap/fe/templates/ObjectPage/view/fragments/FormActionButtons.fragment.xml +15 -16
- package/src/sap/fe/templates/ObjectPage/view/fragments/FormActions.fragment.xml +1 -5
- package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderDataPoint.fragment.xml +1 -2
- package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderDataPointTitle.fragment.xml +1 -3
- package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderFacet.fragment.xml +3 -4
- package/src/sap/fe/templates/ObjectPage/view/fragments/Heading.fragment.xml +16 -17
- package/src/sap/fe/templates/ObjectPage/view/fragments/HeadingTitle.fragment.xml +3 -3
- package/src/sap/fe/templates/ObjectPage/view/fragments/ObjectPageHeaderForm.fragment.xml +3 -3
- package/src/sap/fe/templates/ObjectPage/view/fragments/RelatedApps.fragment.xml +7 -4
- package/src/sap/fe/templates/ObjectPage/view/fragments/Section.fragment.xml +71 -6
- package/src/sap/fe/templates/ObjectPage/view/fragments/SectionContent.fragment.xml +114 -94
- package/src/sap/fe/templates/ObjectPage/view/fragments/SectionContentLazyLoader.fragment.xml +127 -107
- package/src/sap/fe/templates/ObjectPage/view/fragments/SwitchDraftAndActiveObjectPopOver.fragment.xml +27 -0
- package/src/sap/fe/templates/RootContainer/controller/Fcl.controller.js +899 -817
- package/src/sap/fe/templates/RootContainer/controller/Fcl.controller.ts +833 -0
- package/src/sap/fe/templates/RootContainer/controller/NavContainer.controller.js +205 -189
- package/src/sap/fe/templates/RootContainer/controller/NavContainer.controller.ts +178 -0
- package/src/sap/fe/templates/RootContainer/controller/RootContainerBaseController.js +484 -459
- package/src/sap/fe/templates/RootContainer/controller/RootContainerBaseController.ts +438 -0
- package/src/sap/fe/templates/RootContainer/overrides/EditFlow.js +16 -14
- package/src/sap/fe/templates/RootContainer/overrides/EditFlow.ts +20 -0
- package/src/sap/fe/templates/TableScroller.js +45 -53
- package/src/sap/fe/templates/TableScroller.ts +48 -0
- package/src/sap/fe/templates/controls/Chart.fragment.xml +18 -17
- package/src/sap/fe/templates/controls/MacroChart.fragment.xml +23 -0
- package/src/sap/fe/templates/controls/Table.fragment.xml +3 -4
- package/src/sap/fe/templates/library.js +49 -63
- package/src/sap/fe/templates/library.ts +57 -0
- package/src/sap/fe/templates/messagebundle.properties +19 -7
- package/src/sap/fe/templates/messagebundle_ar.properties +12 -4
- package/src/sap/fe/templates/messagebundle_bg.properties +12 -4
- package/src/sap/fe/templates/messagebundle_ca.properties +12 -4
- package/src/sap/fe/templates/messagebundle_cs.properties +12 -4
- package/src/sap/fe/templates/messagebundle_cy.properties +12 -4
- package/src/sap/fe/templates/messagebundle_da.properties +12 -4
- package/src/sap/fe/templates/messagebundle_de.properties +12 -4
- package/src/sap/fe/templates/messagebundle_el.properties +12 -4
- package/src/sap/fe/templates/messagebundle_en.properties +12 -4
- package/src/sap/fe/templates/messagebundle_en_GB.properties +12 -4
- package/src/sap/fe/templates/messagebundle_en_US_sappsd.properties +13 -5
- package/src/sap/fe/templates/messagebundle_en_US_saprigi.properties +13 -5
- package/src/sap/fe/templates/messagebundle_en_US_saptrc.properties +13 -5
- package/src/sap/fe/templates/messagebundle_es.properties +12 -4
- package/src/sap/fe/templates/messagebundle_es_MX.properties +12 -4
- package/src/sap/fe/templates/messagebundle_et.properties +12 -4
- package/src/sap/fe/templates/messagebundle_fi.properties +12 -4
- package/src/sap/fe/templates/messagebundle_fr.properties +12 -4
- package/src/sap/fe/templates/messagebundle_fr_CA.properties +12 -4
- package/src/sap/fe/templates/messagebundle_hi.properties +12 -4
- package/src/sap/fe/templates/messagebundle_hr.properties +12 -4
- package/src/sap/fe/templates/messagebundle_hu.properties +12 -4
- package/src/sap/fe/templates/messagebundle_id.properties +12 -4
- package/src/sap/fe/templates/messagebundle_it.properties +12 -4
- package/src/sap/fe/templates/messagebundle_iw.properties +12 -4
- package/src/sap/fe/templates/messagebundle_ja.properties +12 -4
- package/src/sap/fe/templates/messagebundle_kk.properties +12 -4
- package/src/sap/fe/templates/messagebundle_ko.properties +12 -4
- package/src/sap/fe/templates/messagebundle_lt.properties +12 -4
- package/src/sap/fe/templates/messagebundle_lv.properties +12 -4
- package/src/sap/fe/templates/messagebundle_ms.properties +12 -4
- package/src/sap/fe/templates/messagebundle_nl.properties +12 -4
- package/src/sap/fe/templates/messagebundle_no.properties +12 -4
- package/src/sap/fe/templates/messagebundle_pl.properties +12 -4
- package/src/sap/fe/templates/messagebundle_pt.properties +13 -5
- package/src/sap/fe/templates/messagebundle_pt_PT.properties +12 -4
- package/src/sap/fe/templates/messagebundle_ro.properties +12 -4
- package/src/sap/fe/templates/messagebundle_ru.properties +12 -4
- package/src/sap/fe/templates/messagebundle_sh.properties +12 -4
- package/src/sap/fe/templates/messagebundle_sk.properties +12 -4
- package/src/sap/fe/templates/messagebundle_sl.properties +12 -4
- package/src/sap/fe/templates/messagebundle_sv.properties +12 -4
- package/src/sap/fe/templates/messagebundle_th.properties +12 -4
- package/src/sap/fe/templates/messagebundle_tr.properties +12 -4
- package/src/sap/fe/templates/messagebundle_uk.properties +12 -4
- package/src/sap/fe/templates/messagebundle_vi.properties +12 -4
- package/src/sap/fe/templates/messagebundle_zh_CN.properties +12 -4
- package/src/sap/fe/templates/messagebundle_zh_TW.properties +12 -4
- package/src/sap/fe/templates/ObjectPage/AnnotationHelper.js +0 -518
- package/src/sap/fe/templates/ObjectPage/templating/ObjectPageTemplating.js +0 -120
- package/src/sap/fe/templates/ObjectPage/templating/ObjectPageTemplating.ts +0 -138
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { defineUI5Class, property } from "sap/fe/core/helpers/ClassSupport";
|
|
2
|
+
import CoreLibrary from "sap/fe/core/library";
|
|
3
|
+
import TemplateComponent from "sap/fe/core/TemplateComponent";
|
|
4
|
+
const VariantManagement = CoreLibrary.VariantManagement,
|
|
5
|
+
InitialLoadMode = CoreLibrary.InitialLoadMode;
|
|
6
|
+
|
|
7
|
+
@defineUI5Class("sap.fe.templates.ListComponent", {
|
|
8
|
+
manifest: {
|
|
9
|
+
"sap.ui": {
|
|
10
|
+
"technology": "UI5",
|
|
11
|
+
"deviceTypes": {
|
|
12
|
+
"desktop": true,
|
|
13
|
+
"tablet": true,
|
|
14
|
+
"phone": true
|
|
15
|
+
},
|
|
16
|
+
"supportedThemes": ["sap_fiori_3", "sap_hcb", "sap_bluecrystal", "sap_belize", "sap_belize_plus", "sap_belize_hcw"]
|
|
17
|
+
},
|
|
18
|
+
"sap.ui5": {
|
|
19
|
+
"services": {
|
|
20
|
+
"templatedViewService": {
|
|
21
|
+
"factoryName": "sap.fe.core.services.TemplatedViewService",
|
|
22
|
+
"startup": "waitFor",
|
|
23
|
+
"settings": {
|
|
24
|
+
"viewName": "sap.fe.templates.ListReport.ListReport",
|
|
25
|
+
"converterType": "ListReport",
|
|
26
|
+
"errorViewName": "sap.fe.core.services.view.TemplatingErrorPage"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"asyncComponentService": {
|
|
30
|
+
"factoryName": "sap.fe.core.services.AsyncComponentService",
|
|
31
|
+
"startup": "waitFor"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"commands": {
|
|
35
|
+
"Create": {
|
|
36
|
+
"name": "Create",
|
|
37
|
+
"shortcut": "Ctrl+Enter"
|
|
38
|
+
},
|
|
39
|
+
"DeleteEntry": {
|
|
40
|
+
"name": "DeleteEntry",
|
|
41
|
+
"shortcut": "Ctrl+D"
|
|
42
|
+
},
|
|
43
|
+
"TableSettings": {
|
|
44
|
+
"name": "TableSettings",
|
|
45
|
+
"shortcut": "Ctrl+,"
|
|
46
|
+
},
|
|
47
|
+
"Share": {
|
|
48
|
+
"name": "Share",
|
|
49
|
+
"shortcut": "Shift+Ctrl+S"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"handleValidation": true,
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"minUI5Version": "${sap.ui5.core.version}",
|
|
55
|
+
"libs": {
|
|
56
|
+
"sap.f": {},
|
|
57
|
+
"sap.fe.macros": {
|
|
58
|
+
"lazy": true
|
|
59
|
+
},
|
|
60
|
+
"sap.m": {},
|
|
61
|
+
"sap.suite.ui.microchart": {
|
|
62
|
+
"lazy": true
|
|
63
|
+
},
|
|
64
|
+
"sap.ui.core": {},
|
|
65
|
+
"sap.ui.layout": {},
|
|
66
|
+
"sap.ui.mdc": {},
|
|
67
|
+
"sap.ushell": {
|
|
68
|
+
"lazy": true
|
|
69
|
+
},
|
|
70
|
+
"sap.ui.fl": {}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"contentDensities": {
|
|
74
|
+
"compact": true,
|
|
75
|
+
"cozy": true
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
library: "sap.fe.templates"
|
|
80
|
+
})
|
|
81
|
+
class ListBasedComponent extends TemplateComponent {
|
|
82
|
+
@property({
|
|
83
|
+
type: "sap.fe.core.InitialLoadMode",
|
|
84
|
+
defaultValue: InitialLoadMode.Auto
|
|
85
|
+
})
|
|
86
|
+
initialLoad!: typeof InitialLoadMode;
|
|
87
|
+
|
|
88
|
+
@property({
|
|
89
|
+
type: "sap.fe.core.VariantManagement",
|
|
90
|
+
defaultValue: VariantManagement.Page
|
|
91
|
+
})
|
|
92
|
+
variantManagement!: typeof VariantManagement;
|
|
93
|
+
@property({
|
|
94
|
+
type: "string",
|
|
95
|
+
defaultValue: undefined
|
|
96
|
+
})
|
|
97
|
+
defaultTemplateAnnotationPath!: string;
|
|
98
|
+
@property({
|
|
99
|
+
type: "boolean",
|
|
100
|
+
defaultValue: false
|
|
101
|
+
})
|
|
102
|
+
liveMode!: boolean;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export default ListBasedComponent;
|
|
@@ -1,56 +1,85 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
* (c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
5
4
|
*/
|
|
6
|
-
sap.ui.define(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
5
|
+
sap.ui.define(["sap/fe/core/helpers/ClassSupport", "sap/fe/templates/ListComponent"], function (ClassSupport, ListComponent) {
|
|
6
|
+
"use strict";
|
|
7
|
+
|
|
8
|
+
var _dec, _dec2, _dec3, _dec4, _dec5, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4;
|
|
9
|
+
|
|
10
|
+
var property = ClassSupport.property;
|
|
11
|
+
var defineUI5Class = ClassSupport.defineUI5Class;
|
|
12
|
+
|
|
13
|
+
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 }); }
|
|
14
|
+
|
|
15
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
16
|
+
|
|
17
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
|
|
18
|
+
|
|
19
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
20
|
+
|
|
21
|
+
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; }
|
|
22
|
+
|
|
23
|
+
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.'); }
|
|
24
|
+
|
|
25
|
+
var ListReportComponent = (_dec = defineUI5Class("sap.fe.templates.ListReport.Component", {
|
|
26
|
+
library: "sap.fe.templates",
|
|
27
|
+
manifest: "json"
|
|
28
|
+
}), _dec2 = property({
|
|
29
|
+
type: "object"
|
|
30
|
+
}), _dec3 = property({
|
|
31
|
+
type: "boolean",
|
|
32
|
+
defaultValue: true
|
|
33
|
+
}), _dec4 = property({
|
|
34
|
+
type: "object"
|
|
35
|
+
}), _dec5 = property({
|
|
36
|
+
type: "boolean",
|
|
37
|
+
defaultValue: false
|
|
38
|
+
}), _dec(_class = (_class2 = /*#__PURE__*/function (_ListComponent) {
|
|
39
|
+
_inheritsLoose(ListReportComponent, _ListComponent);
|
|
40
|
+
|
|
41
|
+
function ListReportComponent() {
|
|
42
|
+
var _this;
|
|
43
|
+
|
|
44
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
45
|
+
args[_key] = arguments[_key];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
_this = _ListComponent.call.apply(_ListComponent, [this].concat(args)) || this;
|
|
49
|
+
|
|
50
|
+
_initializerDefineProperty(_this, "views", _descriptor, _assertThisInitialized(_this));
|
|
51
|
+
|
|
52
|
+
_initializerDefineProperty(_this, "stickyMultiTabHeader", _descriptor2, _assertThisInitialized(_this));
|
|
53
|
+
|
|
54
|
+
_initializerDefineProperty(_this, "keyPerformanceIndicators", _descriptor3, _assertThisInitialized(_this));
|
|
55
|
+
|
|
56
|
+
_initializerDefineProperty(_this, "hideFilterBar", _descriptor4, _assertThisInitialized(_this));
|
|
57
|
+
|
|
58
|
+
return _this;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return ListReportComponent;
|
|
62
|
+
}(ListComponent), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "views", [_dec2], {
|
|
63
|
+
configurable: true,
|
|
64
|
+
enumerable: true,
|
|
65
|
+
writable: true,
|
|
66
|
+
initializer: null
|
|
67
|
+
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "stickyMultiTabHeader", [_dec3], {
|
|
68
|
+
configurable: true,
|
|
69
|
+
enumerable: true,
|
|
70
|
+
writable: true,
|
|
71
|
+
initializer: null
|
|
72
|
+
}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "keyPerformanceIndicators", [_dec4], {
|
|
73
|
+
configurable: true,
|
|
74
|
+
enumerable: true,
|
|
75
|
+
writable: true,
|
|
76
|
+
initializer: null
|
|
77
|
+
}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "hideFilterBar", [_dec5], {
|
|
78
|
+
configurable: true,
|
|
79
|
+
enumerable: true,
|
|
80
|
+
writable: true,
|
|
81
|
+
initializer: null
|
|
82
|
+
})), _class2)) || _class);
|
|
83
|
+
return ListReportComponent;
|
|
84
|
+
}, false);
|
|
85
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNvbXBvbmVudC50cyJdLCJuYW1lcyI6WyJMaXN0UmVwb3J0Q29tcG9uZW50IiwiZGVmaW5lVUk1Q2xhc3MiLCJsaWJyYXJ5IiwibWFuaWZlc3QiLCJwcm9wZXJ0eSIsInR5cGUiLCJkZWZhdWx0VmFsdWUiLCJMaXN0Q29tcG9uZW50Il0sIm1hcHBpbmdzIjoiO0FBQUE7QUFDQTtBQUNBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7TUFJTUEsbUI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mluZSBkaWZmZXJlbnQgUGFnZSB2aWV3cyB0byBkaXNwbGF5XG5cdCAqL1xuXHRAcHJvcGVydHkoeyB0eXBlOiBcIm9iamVjdFwiIH0pXG5cdHZpZXdzOiBhbnk7XG5cdC8qKlxuXHQgKiAgRmxhZyB0byBkZXRlcm1pbmUgd2hldGhlciB0aGUgaWNvblRhYkJhciBpcyBpbiBzdGlja3kgbW9kZVxuXHQgKi9cblx0QHByb3BlcnR5KHtcblx0XHR0eXBlOiBcImJvb2xlYW5cIixcblx0XHRkZWZhdWx0VmFsdWU6IHRydWVcblx0fSlcblx0c3RpY2t5TXVsdGlUYWJIZWFkZXIhOiBib29sZWFuO1xuXHQvKipcblx0ICogS1BJcyB0byBkaXNwbGF5XG5cdCAqL1xuXHRAcHJvcGVydHkoe1xuXHRcdHR5cGU6IFwib2JqZWN0XCJcblx0fSlcblx0a2V5UGVyZm9ybWFuY2VJbmRpY2F0b3JzOiBhbnk7XG5cblx0LyoqXG5cdCAqIEZsYWcgdG8gZGV0ZXJtaW5lIHdoZXRoZXIgdGhlIHRlbXBsYXRlIHNob3VsZCBoaWRlIHRoZSBmaWx0ZXIgYmFyXG5cdCAqL1xuXHRAcHJvcGVydHkoe1xuXHRcdHR5cGU6IFwiYm9vbGVhblwiLFxuXHRcdGRlZmF1bHRWYWx1ZTogZmFsc2Vcblx0fSlcblx0aGlkZUZpbHRlckJhciE6IGJvb2xlYW47XG59XG5cbmV4cG9ydCBkZWZhdWx0IExpc3RSZXBvcnRDb21wb25lbnQ7XG4iXX0=
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { defineUI5Class, property } from "sap/fe/core/helpers/ClassSupport";
|
|
2
|
+
import ListComponent from "sap/fe/templates/ListComponent";
|
|
3
|
+
@defineUI5Class("sap.fe.templates.ListReport.Component", {
|
|
4
|
+
library: "sap.fe.templates",
|
|
5
|
+
manifest: "json"
|
|
6
|
+
})
|
|
7
|
+
class ListReportComponent extends ListComponent {
|
|
8
|
+
/**
|
|
9
|
+
* Define different Page views to display
|
|
10
|
+
*/
|
|
11
|
+
@property({ type: "object" })
|
|
12
|
+
views: any;
|
|
13
|
+
/**
|
|
14
|
+
* Flag to determine whether the iconTabBar is in sticky mode
|
|
15
|
+
*/
|
|
16
|
+
@property({
|
|
17
|
+
type: "boolean",
|
|
18
|
+
defaultValue: true
|
|
19
|
+
})
|
|
20
|
+
stickyMultiTabHeader!: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* KPIs to display
|
|
23
|
+
*/
|
|
24
|
+
@property({
|
|
25
|
+
type: "object"
|
|
26
|
+
})
|
|
27
|
+
keyPerformanceIndicators: any;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Flag to determine whether the template should hide the filter bar
|
|
31
|
+
*/
|
|
32
|
+
@property({
|
|
33
|
+
type: "boolean",
|
|
34
|
+
defaultValue: false
|
|
35
|
+
})
|
|
36
|
+
hideFilterBar!: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export default ListReportComponent;
|
|
@@ -1,115 +1,129 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
* (c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
5
4
|
*/
|
|
6
|
-
sap.ui.define(["sap/fe/core/ExtensionAPI", "sap/fe/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
5
|
+
sap.ui.define(["sap/fe/core/ExtensionAPI", "sap/fe/core/helpers/ClassSupport", "sap/fe/macros/chart/ChartUtils", "sap/fe/macros/filter/FilterUtils"], function (ExtensionAPI, ClassSupport, ChartUtils, FilterUtils) {
|
|
6
|
+
"use strict";
|
|
7
|
+
|
|
8
|
+
var _dec, _class;
|
|
9
|
+
|
|
10
|
+
var defineUI5Class = ClassSupport.defineUI5Class;
|
|
11
|
+
|
|
12
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
|
|
13
|
+
|
|
14
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Extension API for list reports on SAP Fiori elements for OData V4.
|
|
18
|
+
*
|
|
19
|
+
* @alias sap.fe.templates.ListReport.ExtensionAPI
|
|
20
|
+
* @public
|
|
21
|
+
* @hideconstructor
|
|
22
|
+
* @final
|
|
23
|
+
* @since 1.79.0
|
|
24
|
+
*/
|
|
25
|
+
var ListReportExtensionAPI = (_dec = defineUI5Class("sap.fe.templates.ListReport.ExtensionAPI"), _dec(_class = /*#__PURE__*/function (_ExtensionAPI) {
|
|
26
|
+
_inheritsLoose(ListReportExtensionAPI, _ExtensionAPI);
|
|
27
|
+
|
|
28
|
+
function ListReportExtensionAPI() {
|
|
29
|
+
return _ExtensionAPI.apply(this, arguments) || this;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
var _proto = ListReportExtensionAPI.prototype;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Refreshes the List Report.
|
|
36
|
+
* This method currently only supports triggering the search (by clicking on the GO button)
|
|
37
|
+
* in the List Report Filter Bar. It can be used to request the initial load or to refresh the
|
|
38
|
+
* currently shown data based on the filters entered by the user.
|
|
39
|
+
* Please note: The Promise is resolved once the search is triggered and not once the data is returned.
|
|
40
|
+
*
|
|
41
|
+
* @alias sap.fe.templates.ListReport.ExtensionAPI#refresh
|
|
42
|
+
* @returns {Promise} Resolved once the data is refreshed or rejected if the request failed
|
|
43
|
+
*
|
|
44
|
+
* @public
|
|
45
|
+
*/
|
|
46
|
+
_proto.refresh = function refresh() {
|
|
47
|
+
var oFilterBar = this._controller._getFilterBarControl();
|
|
48
|
+
|
|
49
|
+
if (oFilterBar) {
|
|
50
|
+
return oFilterBar.waitForInitialization().then(function () {
|
|
51
|
+
oFilterBar.triggerSearch();
|
|
52
|
+
});
|
|
53
|
+
} else {
|
|
54
|
+
// TODO: if there is no filter bar, make refresh work
|
|
55
|
+
return Promise.resolve();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Gets the list entries currently selected for the displayed control.
|
|
60
|
+
*
|
|
61
|
+
* @alias sap.fe.templates.ListReport.ExtensionAPI#getSelectedContexts
|
|
62
|
+
* @returns {sap.ui.model.odata.v4.Context[]} Array containing the selected contexts
|
|
63
|
+
*
|
|
64
|
+
* @public
|
|
65
|
+
*/
|
|
66
|
+
;
|
|
67
|
+
|
|
68
|
+
_proto.getSelectedContexts = function getSelectedContexts() {
|
|
69
|
+
var oControl = this._controller._isMultiMode() && this._controller._getCurrentControl() || this._controller._getTable();
|
|
70
|
+
|
|
71
|
+
if (oControl.isA("sap.ui.mdc.Chart")) {
|
|
72
|
+
var aSelectedContexts = [];
|
|
73
|
+
|
|
74
|
+
if (oControl && oControl.get_chart()) {
|
|
75
|
+
var aSelectedDataPoints = ChartUtils.getChartSelectedData(oControl.get_chart());
|
|
76
|
+
|
|
77
|
+
for (var i = 0; i < aSelectedDataPoints.length; i++) {
|
|
78
|
+
aSelectedContexts.push(aSelectedDataPoints[i].context);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return aSelectedContexts;
|
|
83
|
+
} else {
|
|
84
|
+
return oControl && oControl.getSelectedContexts() || [];
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Set the filter values for the given property in the filter bar.
|
|
89
|
+
* The filter values can be either a single value or an array of values.
|
|
90
|
+
* Each filter value must be represented as a primitive value.
|
|
91
|
+
*
|
|
92
|
+
* @param {string} sConditionPath The path to the property as a condition path
|
|
93
|
+
* @param {string} [sOperator] The operator to be used (optional) - if not set, the default operator (EQ) will be used
|
|
94
|
+
* @param {undefined | string | number | boolean | string[] | number[] | boolean[]} vValues The values to be applied
|
|
95
|
+
* @alias sap.fe.templates.ListReport.ExtensionAPI#setFilterValues
|
|
96
|
+
* @returns {Promise} A promise for asynchronous handling
|
|
97
|
+
* @public
|
|
98
|
+
*/
|
|
99
|
+
;
|
|
100
|
+
|
|
101
|
+
_proto.setFilterValues = function setFilterValues(sConditionPath, sOperator, vValues) {
|
|
102
|
+
// The List Report has two filter bars: The filter bar in the header and the filter bar in the "Adapt Filter" dialog;
|
|
103
|
+
// when the dialog is opened, the user is working with that active control: Pass it to the setFilterValues method!
|
|
104
|
+
var filterBar = this._controller._getAdaptationFilterBarControl() || this._controller._getFilterBarControl();
|
|
105
|
+
|
|
106
|
+
return FilterUtils.setFilterValues(filterBar, sConditionPath, sOperator, vValues);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* This method converts filter conditions to filters.
|
|
110
|
+
*
|
|
111
|
+
* @param {map} mFilterConditions Map containing the filter conditions of the FilterBar.
|
|
112
|
+
*
|
|
113
|
+
* @alias sap.fe.templates.ListReport.ExtensionAPI#createFiltersFromFilterConditions
|
|
114
|
+
* @returns {object} Object containing the converted FilterBar filters.
|
|
115
|
+
* @public
|
|
116
|
+
*/
|
|
117
|
+
;
|
|
118
|
+
|
|
119
|
+
_proto.createFiltersFromFilterConditions = function createFiltersFromFilterConditions(mFilterConditions) {
|
|
120
|
+
var oFilterBar = this._controller._getFilterBarControl();
|
|
121
|
+
|
|
122
|
+
return FilterUtils.getFilterInfo(oFilterBar, undefined, mFilterConditions);
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
return ListReportExtensionAPI;
|
|
126
|
+
}(ExtensionAPI)) || _class);
|
|
127
|
+
return ListReportExtensionAPI;
|
|
128
|
+
}, false);
|
|
129
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkV4dGVuc2lvbkFQSS50cyJdLCJuYW1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250YWluaW5nIHRoZSBmaWx0ZXIgY29uZGl0aW9ucyBvZiB0aGUgRmlsdGVyQmFyLlxuXHQgKlxuXHQgKiBAYWxpYXMgc2FwLmZlLnRlbXBsYXRlcy5MaXN0UmVwb3J0LkV4dGVuc2lvbkFQSSNjcmVhdGVGaWx0ZXJzRnJvbUZpbHRlckNvbmRpdGlvbnNcblx0ICogQHJldHVybnMge29iamVjdH0gT2JqZWN0IGNvbnRhaW5pbmcgdGhlIGNvbnZlcnRlZCBGaWx0ZXJCYXIgZmlsdGVycy5cblx0ICogQHB1YmxpY1xuXHQgKi9cblx0Y3JlYXRlRmlsdGVyc0Zyb21GaWx0ZXJDb25kaXRpb25zKG1GaWx0ZXJDb25kaXRpb25zOiBhbnkpIHtcblx0XHRjb25zdCBvRmlsdGVyQmFyID0gdGhpcy5fY29udHJvbGxlci5fZ2V0RmlsdGVyQmFyQ29udHJvbCgpO1xuXHRcdHJldHVybiBGaWx0ZXJVdGlscy5nZXRGaWx0ZXJJbmZvKG9GaWx0ZXJCYXIsIHVuZGVmaW5lZCwgbUZpbHRlckNvbmRpdGlvbnMpO1xuXHR9XG59XG5cbmV4cG9ydCBkZWZhdWx0IExpc3RSZXBvcnRFeHRlbnNpb25BUEk7XG4iXX0=
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import ExtensionAPI from "sap/fe/core/ExtensionAPI";
|
|
2
|
+
import { defineUI5Class } from "sap/fe/core/helpers/ClassSupport";
|
|
3
|
+
import ChartUtils from "sap/fe/macros/chart/ChartUtils";
|
|
4
|
+
import FilterUtils from "sap/fe/macros/filter/FilterUtils";
|
|
5
|
+
import ListReportController from "sap/fe/templates/ListReport/ListReportController.controller";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Extension API for list reports on SAP Fiori elements for OData V4.
|
|
9
|
+
*
|
|
10
|
+
* @alias sap.fe.templates.ListReport.ExtensionAPI
|
|
11
|
+
* @public
|
|
12
|
+
* @hideconstructor
|
|
13
|
+
* @final
|
|
14
|
+
* @since 1.79.0
|
|
15
|
+
*/
|
|
16
|
+
@defineUI5Class("sap.fe.templates.ListReport.ExtensionAPI")
|
|
17
|
+
class ListReportExtensionAPI extends ExtensionAPI {
|
|
18
|
+
protected _controller!: ListReportController;
|
|
19
|
+
/**
|
|
20
|
+
* Refreshes the List Report.
|
|
21
|
+
* This method currently only supports triggering the search (by clicking on the GO button)
|
|
22
|
+
* in the List Report Filter Bar. It can be used to request the initial load or to refresh the
|
|
23
|
+
* currently shown data based on the filters entered by the user.
|
|
24
|
+
* Please note: The Promise is resolved once the search is triggered and not once the data is returned.
|
|
25
|
+
*
|
|
26
|
+
* @alias sap.fe.templates.ListReport.ExtensionAPI#refresh
|
|
27
|
+
* @returns {Promise} Resolved once the data is refreshed or rejected if the request failed
|
|
28
|
+
*
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
refresh() {
|
|
32
|
+
const oFilterBar = this._controller._getFilterBarControl() as any;
|
|
33
|
+
if (oFilterBar) {
|
|
34
|
+
return oFilterBar.waitForInitialization().then(function () {
|
|
35
|
+
oFilterBar.triggerSearch();
|
|
36
|
+
});
|
|
37
|
+
} else {
|
|
38
|
+
// TODO: if there is no filter bar, make refresh work
|
|
39
|
+
return Promise.resolve();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Gets the list entries currently selected for the displayed control.
|
|
45
|
+
*
|
|
46
|
+
* @alias sap.fe.templates.ListReport.ExtensionAPI#getSelectedContexts
|
|
47
|
+
* @returns {sap.ui.model.odata.v4.Context[]} Array containing the selected contexts
|
|
48
|
+
*
|
|
49
|
+
* @public
|
|
50
|
+
*/
|
|
51
|
+
getSelectedContexts() {
|
|
52
|
+
const oControl = ((this._controller._isMultiMode() && this._controller._getCurrentControl()) ||
|
|
53
|
+
this._controller._getTable()) as any;
|
|
54
|
+
if (oControl.isA("sap.ui.mdc.Chart")) {
|
|
55
|
+
const aSelectedContexts = [];
|
|
56
|
+
if (oControl && oControl.get_chart()) {
|
|
57
|
+
const aSelectedDataPoints = ChartUtils.getChartSelectedData(oControl.get_chart());
|
|
58
|
+
for (let i = 0; i < aSelectedDataPoints.length; i++) {
|
|
59
|
+
aSelectedContexts.push(aSelectedDataPoints[i].context);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return aSelectedContexts;
|
|
63
|
+
} else {
|
|
64
|
+
return (oControl && oControl.getSelectedContexts()) || [];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Set the filter values for the given property in the filter bar.
|
|
70
|
+
* The filter values can be either a single value or an array of values.
|
|
71
|
+
* Each filter value must be represented as a primitive value.
|
|
72
|
+
*
|
|
73
|
+
* @param {string} sConditionPath The path to the property as a condition path
|
|
74
|
+
* @param {string} [sOperator] The operator to be used (optional) - if not set, the default operator (EQ) will be used
|
|
75
|
+
* @param {undefined | string | number | boolean | string[] | number[] | boolean[]} vValues The values to be applied
|
|
76
|
+
* @alias sap.fe.templates.ListReport.ExtensionAPI#setFilterValues
|
|
77
|
+
* @returns {Promise} A promise for asynchronous handling
|
|
78
|
+
* @public
|
|
79
|
+
*/
|
|
80
|
+
setFilterValues(
|
|
81
|
+
sConditionPath: string,
|
|
82
|
+
sOperator: string | undefined,
|
|
83
|
+
vValues: undefined | string | number | boolean | string[] | number[] | boolean[]
|
|
84
|
+
) {
|
|
85
|
+
// The List Report has two filter bars: The filter bar in the header and the filter bar in the "Adapt Filter" dialog;
|
|
86
|
+
// when the dialog is opened, the user is working with that active control: Pass it to the setFilterValues method!
|
|
87
|
+
const filterBar = this._controller._getAdaptationFilterBarControl() || this._controller._getFilterBarControl();
|
|
88
|
+
return FilterUtils.setFilterValues(filterBar, sConditionPath, sOperator, vValues);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* This method converts filter conditions to filters.
|
|
93
|
+
*
|
|
94
|
+
* @param {map} mFilterConditions Map containing the filter conditions of the FilterBar.
|
|
95
|
+
*
|
|
96
|
+
* @alias sap.fe.templates.ListReport.ExtensionAPI#createFiltersFromFilterConditions
|
|
97
|
+
* @returns {object} Object containing the converted FilterBar filters.
|
|
98
|
+
* @public
|
|
99
|
+
*/
|
|
100
|
+
createFiltersFromFilterConditions(mFilterConditions: any) {
|
|
101
|
+
const oFilterBar = this._controller._getFilterBarControl();
|
|
102
|
+
return FilterUtils.getFilterInfo(oFilterBar, undefined, mFilterConditions);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export default ListReportExtensionAPI;
|