@sapui5/sap.fe.core 1.100.0 → 1.101.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 -4
- package/src/sap/fe/core/.library +2 -3
- package/src/sap/fe/core/AnnotationHelper.js +43 -24
- package/src/sap/fe/core/AnnotationHelper.ts +43 -37
- package/src/sap/fe/core/AppComponent.js +20 -27
- package/src/sap/fe/core/AppComponent.ts +19 -25
- package/src/sap/fe/core/AppStateHandler.js +5 -5
- package/src/sap/fe/core/AppStateHandler.ts +2 -2
- package/src/sap/fe/core/BaseController.js +9 -9
- package/src/sap/fe/core/BaseController.ts +3 -4
- package/src/sap/fe/core/CommonUtils.js +74 -17
- package/src/sap/fe/core/CommonUtils.ts +181 -110
- package/src/sap/fe/core/ExtensionAPI.js +11 -10
- package/src/sap/fe/core/ExtensionAPI.ts +22 -30
- package/src/sap/fe/core/PageController.js +12 -11
- package/src/sap/fe/core/PageController.ts +34 -34
- package/src/sap/fe/core/RouterProxy.js +36 -24
- package/src/sap/fe/core/RouterProxy.ts +36 -22
- package/src/sap/fe/core/TemplateComponent.js +193 -118
- package/src/sap/fe/core/TemplateComponent.ts +105 -117
- package/src/sap/fe/core/TemplateModel.js +6 -8
- package/src/sap/fe/core/TemplateModel.ts +2 -2
- package/src/sap/fe/core/TransactionHelper.js +33 -18
- package/src/sap/fe/core/TransactionHelper.ts +172 -153
- package/src/sap/fe/core/actions/collaboration/ActivitySync.js +31 -17
- package/src/sap/fe/core/actions/collaboration/ActivitySync.ts +52 -45
- package/src/sap/fe/core/actions/collaboration/CollaborationCommon.js +16 -6
- package/src/sap/fe/core/actions/collaboration/CollaborationCommon.ts +13 -3
- package/src/sap/fe/core/actions/collaboration/Manage.js +9 -7
- package/src/sap/fe/core/actions/collaboration/Manage.ts +33 -31
- package/src/sap/fe/core/actions/collaboration/ManageDialog.fragment.xml +53 -56
- package/src/sap/fe/core/actions/draft.js +308 -166
- package/src/sap/fe/core/actions/draft.ts +177 -74
- package/src/sap/fe/core/actions/messageHandling.js +25 -13
- package/src/sap/fe/core/actions/messageHandling.ts +49 -39
- package/src/sap/fe/core/actions/operations.js +4 -4
- package/src/sap/fe/core/actions/operations.ts +3 -2
- package/src/sap/fe/core/buildingBlocks/AttributeModel.js +60 -0
- package/src/sap/fe/core/buildingBlocks/AttributeModel.ts +37 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.js +165 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.ts +178 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js +707 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.ts +628 -0
- package/src/sap/fe/core/buildingBlocks/TraceInfo.js +436 -0
- package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +431 -0
- package/src/sap/fe/core/controllerextensions/EditFlow.js +506 -245
- package/src/sap/fe/core/controllerextensions/EditFlow.ts +395 -275
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +11 -11
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +6 -7
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +15 -17
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +98 -96
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +15 -15
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +60 -53
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +94 -42
- package/src/sap/fe/core/controllerextensions/InternalRouting.ts +114 -91
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +14 -14
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +12 -11
- package/src/sap/fe/core/controllerextensions/MassEdit.js +12 -12
- package/src/sap/fe/core/controllerextensions/MassEdit.ts +8 -9
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +13 -25
- package/src/sap/fe/core/controllerextensions/MessageHandler.ts +18 -28
- package/src/sap/fe/core/controllerextensions/PageReady.js +25 -23
- package/src/sap/fe/core/controllerextensions/PageReady.ts +49 -47
- package/src/sap/fe/core/controllerextensions/Paginator.js +13 -13
- package/src/sap/fe/core/controllerextensions/Paginator.ts +24 -18
- package/src/sap/fe/core/controllerextensions/Placeholder.js +10 -10
- package/src/sap/fe/core/controllerextensions/Placeholder.ts +12 -14
- package/src/sap/fe/core/controllerextensions/Routing.js +11 -11
- package/src/sap/fe/core/controllerextensions/Routing.ts +12 -13
- package/src/sap/fe/core/controllerextensions/Share.js +16 -16
- package/src/sap/fe/core/controllerextensions/Share.ts +32 -32
- package/src/sap/fe/core/controllerextensions/SideEffects.js +14 -14
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +62 -63
- package/src/sap/fe/core/controllerextensions/ViewState.js +17 -31
- package/src/sap/fe/core/controllerextensions/ViewState.ts +93 -102
- package/src/sap/fe/core/controls/Any.js +28 -0
- package/src/sap/fe/core/controls/Any.ts +30 -0
- package/src/sap/fe/core/controls/CommandExecution.js +38 -15
- package/src/sap/fe/core/controls/CommandExecution.ts +20 -20
- package/src/sap/fe/core/controls/ConditionalWrapper.js +136 -65
- package/src/sap/fe/core/controls/ConditionalWrapper.ts +49 -58
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +366 -0
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +278 -0
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +73 -36
- package/src/sap/fe/core/controls/CustomQuickViewPage.ts +22 -32
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossDraft.fragment.xml +44 -5
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +116 -66
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +121 -67
- package/src/sap/fe/core/controls/FieldWrapper.js +171 -87
- package/src/sap/fe/core/controls/FieldWrapper.ts +69 -80
- package/src/sap/fe/core/controls/FileWrapper.js +313 -0
- package/src/sap/fe/core/controls/FileWrapper.ts +169 -0
- package/src/sap/fe/core/controls/FilterBar.js +154 -119
- package/src/sap/fe/core/controls/FilterBar.ts +128 -123
- package/src/sap/fe/core/controls/FormElementWrapper.js +92 -37
- package/src/sap/fe/core/controls/FormElementWrapper.ts +32 -35
- package/src/sap/fe/core/controls/filterbar/FilterContainer.js +111 -89
- package/src/sap/fe/core/controls/filterbar/FilterContainer.ts +86 -82
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +242 -193
- package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +211 -204
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +152 -116
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +105 -105
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +1 -1
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +2 -2
- package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +37 -42
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +7 -6
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +15 -14
- package/src/sap/fe/core/converters/ManifestSettings.js +2 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +5 -1
- package/src/sap/fe/core/converters/annotations/DataField.js +1 -2
- package/src/sap/fe/core/converters/annotations/DataField.ts +3 -4
- package/src/sap/fe/core/converters/controls/Common/Action.js +10 -10
- package/src/sap/fe/core/converters/controls/Common/Action.ts +20 -19
- package/src/sap/fe/core/converters/controls/Common/Chart.js +8 -8
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +12 -11
- package/src/sap/fe/core/converters/controls/Common/Form.js +5 -5
- package/src/sap/fe/core/converters/controls/Common/Form.ts +3 -1
- package/src/sap/fe/core/converters/controls/Common/KPI.js +1 -1
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +2 -3
- package/src/sap/fe/core/converters/controls/Common/Table.js +245 -112
- package/src/sap/fe/core/converters/controls/Common/Table.ts +305 -193
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +5 -5
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +4 -7
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +72 -43
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +134 -100
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +6 -6
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +20 -18
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +5 -2
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +4 -1
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.js +1 -1
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.ts +0 -4
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +27 -24
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +49 -40
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +33 -22
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +77 -62
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +5 -5
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +3 -7
- package/src/sap/fe/core/formatters/KPIFormatter.js +3 -12
- package/src/sap/fe/core/formatters/KPIFormatter.ts +3 -2
- package/src/sap/fe/core/formatters/TableFormatter.js +2 -2
- package/src/sap/fe/core/formatters/TableFormatter.ts +1 -1
- package/src/sap/fe/core/formatters/ValueFormatter.js +4 -4
- package/src/sap/fe/core/formatters/ValueFormatter.ts +4 -7
- package/src/sap/fe/core/fpm/Component.js +46 -17
- package/src/sap/fe/core/fpm/Component.ts +11 -16
- package/src/sap/fe/core/helpers/AppStartupHelper.js +4 -4
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +3 -3
- package/src/sap/fe/core/helpers/ClassSupport.js +273 -256
- package/src/sap/fe/core/helpers/ClassSupport.ts +314 -237
- package/src/sap/fe/core/helpers/MassEditHelper.js +173 -39
- package/src/sap/fe/core/helpers/MassEditHelper.ts +236 -132
- package/src/sap/fe/core/helpers/ModelHelper.js +29 -1
- package/src/sap/fe/core/helpers/ModelHelper.ts +23 -0
- package/src/sap/fe/core/helpers/PasteHelper.js +4 -4
- package/src/sap/fe/core/helpers/PasteHelper.ts +4 -3
- package/src/sap/fe/core/helpers/SemanticDateOperators.js +3 -3
- package/src/sap/fe/core/helpers/SemanticDateOperators.ts +3 -1
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js +1 -1
- package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +1 -1
- package/src/sap/fe/core/helpers/StableIdHelper.js +1 -7
- package/src/sap/fe/core/helpers/StableIdHelper.ts +0 -4
- package/src/sap/fe/core/jsx-runtime/jsx.js +35 -5
- package/src/sap/fe/core/jsx-runtime/jsx.ts +22 -8
- package/src/sap/fe/core/library.js +4 -5
- package/src/sap/fe/core/library.ts +17 -17
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +1 -1
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +0 -3
- package/src/sap/fe/core/messagebundle.properties +23 -8
- package/src/sap/fe/core/messagebundle_ar.properties +2 -0
- package/src/sap/fe/core/messagebundle_bg.properties +2 -0
- package/src/sap/fe/core/messagebundle_ca.properties +2 -0
- package/src/sap/fe/core/messagebundle_cs.properties +2 -0
- package/src/sap/fe/core/messagebundle_cy.properties +5 -3
- package/src/sap/fe/core/messagebundle_da.properties +2 -0
- package/src/sap/fe/core/messagebundle_de.properties +2 -0
- package/src/sap/fe/core/messagebundle_el.properties +2 -0
- package/src/sap/fe/core/messagebundle_en.properties +2 -0
- package/src/sap/fe/core/messagebundle_en_GB.properties +2 -0
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +2 -0
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +2 -0
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +2 -0
- package/src/sap/fe/core/messagebundle_es.properties +2 -0
- package/src/sap/fe/core/messagebundle_es_MX.properties +2 -0
- package/src/sap/fe/core/messagebundle_et.properties +2 -0
- package/src/sap/fe/core/messagebundle_fi.properties +2 -0
- package/src/sap/fe/core/messagebundle_fr.properties +4 -2
- package/src/sap/fe/core/messagebundle_fr_CA.properties +5 -3
- package/src/sap/fe/core/messagebundle_hi.properties +2 -0
- package/src/sap/fe/core/messagebundle_hr.properties +5 -3
- package/src/sap/fe/core/messagebundle_hu.properties +2 -0
- package/src/sap/fe/core/messagebundle_id.properties +2 -0
- package/src/sap/fe/core/messagebundle_it.properties +2 -0
- package/src/sap/fe/core/messagebundle_iw.properties +2 -0
- package/src/sap/fe/core/messagebundle_ja.properties +2 -0
- package/src/sap/fe/core/messagebundle_kk.properties +2 -0
- package/src/sap/fe/core/messagebundle_ko.properties +2 -0
- package/src/sap/fe/core/messagebundle_lt.properties +2 -0
- package/src/sap/fe/core/messagebundle_lv.properties +5 -3
- package/src/sap/fe/core/messagebundle_ms.properties +2 -0
- package/src/sap/fe/core/messagebundle_nl.properties +2 -0
- package/src/sap/fe/core/messagebundle_no.properties +2 -0
- package/src/sap/fe/core/messagebundle_pl.properties +5 -3
- package/src/sap/fe/core/messagebundle_pt.properties +2 -0
- package/src/sap/fe/core/messagebundle_pt_PT.properties +2 -0
- package/src/sap/fe/core/messagebundle_ro.properties +5 -3
- package/src/sap/fe/core/messagebundle_ru.properties +5 -3
- package/src/sap/fe/core/messagebundle_sh.properties +2 -0
- package/src/sap/fe/core/messagebundle_sk.properties +2 -0
- package/src/sap/fe/core/messagebundle_sl.properties +2 -0
- package/src/sap/fe/core/messagebundle_sv.properties +3 -1
- package/src/sap/fe/core/messagebundle_th.properties +2 -0
- package/src/sap/fe/core/messagebundle_tr.properties +2 -0
- package/src/sap/fe/core/messagebundle_uk.properties +2 -0
- package/src/sap/fe/core/messagebundle_vi.properties +2 -0
- package/src/sap/fe/core/messagebundle_zh_CN.properties +5 -3
- package/src/sap/fe/core/messagebundle_zh_TW.properties +5 -3
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +4 -4
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +1 -1
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +5 -5
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +1 -2
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +7 -7
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +6 -5
- package/src/sap/fe/core/services/NavigationServiceFactory.js +4 -4
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +1 -1
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +4 -4
- package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +1 -1
- package/src/sap/fe/core/services/RoutingServiceFactory.js +98 -62
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +51 -42
- package/src/sap/fe/core/services/ShellServicesFactory.js +69 -29
- package/src/sap/fe/core/services/ShellServicesFactory.ts +26 -29
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +4 -4
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +1 -1
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +8 -8
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +6 -17
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +43 -5
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +6 -3
- package/src/sap/fe/core/support/CommonHelper.js +1 -1
- package/src/sap/fe/core/support/CommonHelper.ts +0 -3
- package/src/sap/fe/core/templating/DataModelPathHelper.js +2 -9
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +32 -38
- package/src/sap/fe/core/templating/DisplayModeFormatter.js +23 -3
- package/src/sap/fe/core/templating/DisplayModeFormatter.ts +26 -5
- package/src/sap/fe/core/templating/PropertyHelper.js +15 -1
- package/src/sap/fe/core/templating/PropertyHelper.ts +30 -23
- package/src/sap/fe/core/templating/UIFormatters.js +121 -21
- package/src/sap/fe/core/templating/UIFormatters.ts +134 -49
- package/src/sap/fe/core/type/Email.js +26 -8
- package/src/sap/fe/core/type/Email.ts +8 -7
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +0 -78
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.ts +0 -65
|
@@ -2,142 +2,147 @@ import MdcFilterBar from "sap/ui/mdc/FilterBar";
|
|
|
2
2
|
import FilterItemLayout from "sap/ui/mdc/filterbar/aligned/FilterItemLayout";
|
|
3
3
|
import VisualFilterContainer from "sap/fe/core/controls/filterbar/VisualFilterContainer";
|
|
4
4
|
import FilterContainer from "sap/fe/core/controls/filterbar/FilterContainer";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
5
|
+
import Core from "sap/ui/core/Core";
|
|
6
|
+
import { association, defineUI5Class, property } from "sap/fe/core/helpers/ClassSupport";
|
|
7
|
+
import SegmentedButton from "sap/m/SegmentedButton";
|
|
8
|
+
@defineUI5Class("sap.fe.core.controls.FilterBar")
|
|
9
|
+
class FilterBar extends MdcFilterBar {
|
|
10
|
+
@property({ type: "string", defaultValue: "compact" })
|
|
11
|
+
initialLayout!: string;
|
|
12
|
+
/**
|
|
13
|
+
* Control which allows for switching between visual and normal filter layouts
|
|
14
|
+
*/
|
|
15
|
+
@association({
|
|
16
|
+
type: "sap.m.SegmentedButton",
|
|
17
|
+
multiple: false
|
|
18
|
+
})
|
|
19
|
+
toggleControl!: SegmentedButton;
|
|
20
|
+
private _oSegmentedButton?: SegmentedButton;
|
|
21
|
+
private _oSecondaryFilterBarLayout: any;
|
|
22
|
+
private _oFilterBarLayout: any;
|
|
23
|
+
private _cLayoutItem: any;
|
|
24
|
+
|
|
25
|
+
setToggleControl(vToggle: string | SegmentedButton) {
|
|
26
|
+
if (typeof vToggle === "string") {
|
|
27
|
+
this._oSegmentedButton = Core.byId(vToggle) as SegmentedButton;
|
|
28
|
+
} else {
|
|
29
|
+
this._oSegmentedButton = vToggle;
|
|
21
30
|
}
|
|
22
|
-
},
|
|
23
|
-
renderer: {
|
|
24
|
-
apiVersion: 2
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
FilterBar.prototype.setToggleControl = function(vToggle: any) {
|
|
28
|
-
if (typeof vToggle === "string") {
|
|
29
|
-
this._oSegmentedButton = sap.ui.getCore().byId(vToggle);
|
|
30
|
-
} else {
|
|
31
|
-
this._oSegmentedButton = vToggle;
|
|
32
|
-
}
|
|
33
31
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
};
|
|
42
|
-
FilterBar.prototype._toggleLayout = function() {
|
|
43
|
-
// Since primary layout is always compact
|
|
44
|
-
// hence set the secondary layout as visual filter only for the first time only
|
|
45
|
-
if (!this._oSecondaryFilterBarLayout) {
|
|
46
|
-
this._oSecondaryFilterBarLayout = new VisualFilterContainer();
|
|
32
|
+
if (this.toggleControl && this._oSegmentedButton) {
|
|
33
|
+
this._oSegmentedButton.detachEvent("select", this._toggleLayout.bind(this));
|
|
34
|
+
}
|
|
35
|
+
if (this._oSegmentedButton) {
|
|
36
|
+
this._oSegmentedButton.attachEvent("select", this._toggleLayout.bind(this));
|
|
37
|
+
}
|
|
38
|
+
this.setAssociation("toggleControl", vToggle, true);
|
|
47
39
|
}
|
|
48
40
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
41
|
+
_toggleLayout() {
|
|
42
|
+
// Since primary layout is always compact
|
|
43
|
+
// hence set the secondary layout as visual filter only for the first time only
|
|
44
|
+
if (!this._oSecondaryFilterBarLayout) {
|
|
45
|
+
this._oSecondaryFilterBarLayout = new VisualFilterContainer();
|
|
46
|
+
}
|
|
55
47
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const aVisualFilterFields = oCurrentFilterBarLayout.getAllVisualFilterFields && oCurrentFilterBarLayout.getAllVisualFilterFields();
|
|
63
|
-
if (this._oSecondaryFilterBarLayout.isA("sap.fe.core.controls.filterbar.VisualFilterContainer")) {
|
|
64
|
-
this._oSecondaryFilterBarLayout.setAllFilterFields(aSortedFilterFields, aVisualFilterFields);
|
|
65
|
-
}
|
|
66
|
-
// use secondary filter bar layout as new layout
|
|
67
|
-
this._oFilterBarLayout = this._oSecondaryFilterBarLayout;
|
|
48
|
+
// do not show Adapt Filters Button for visual layout
|
|
49
|
+
if (this._oSecondaryFilterBarLayout.isA("sap.fe.core.controls.filterbar.VisualFilterContainer")) {
|
|
50
|
+
this.setShowAdaptFiltersButton(false);
|
|
51
|
+
} else {
|
|
52
|
+
this.setShowAdaptFiltersButton(true);
|
|
53
|
+
}
|
|
68
54
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
55
|
+
// get all filter fields and button of the current layout
|
|
56
|
+
const oCurrentFilterBarLayout = this._oFilterBarLayout;
|
|
57
|
+
const oFilterItems = this.getFilterItems();
|
|
58
|
+
const aFilterFields = oCurrentFilterBarLayout.getAllFilterFields();
|
|
59
|
+
const aSortedFilterFields = this.getSortedFilterFields(oFilterItems, aFilterFields);
|
|
60
|
+
const aButtons = oCurrentFilterBarLayout.getAllButtons();
|
|
61
|
+
const aVisualFilterFields = oCurrentFilterBarLayout.getAllVisualFilterFields && oCurrentFilterBarLayout.getAllVisualFilterFields();
|
|
62
|
+
if (this._oSecondaryFilterBarLayout.isA("sap.fe.core.controls.filterbar.VisualFilterContainer")) {
|
|
63
|
+
this._oSecondaryFilterBarLayout.setAllFilterFields(aSortedFilterFields, aVisualFilterFields);
|
|
64
|
+
}
|
|
65
|
+
// use secondary filter bar layout as new layout
|
|
66
|
+
this._oFilterBarLayout = this._oSecondaryFilterBarLayout;
|
|
79
67
|
|
|
80
|
-
|
|
81
|
-
|
|
68
|
+
// insert all filter fields from current layout to new layout
|
|
69
|
+
aFilterFields.forEach((oFilterField: any, iIndex: any) => {
|
|
70
|
+
oCurrentFilterBarLayout.removeFilterField(oFilterField);
|
|
71
|
+
this._oFilterBarLayout.insertFilterField(oFilterField, iIndex);
|
|
72
|
+
});
|
|
73
|
+
// insert all buttons from the current layout to the new layout
|
|
74
|
+
aButtons.forEach((oButton: any) => {
|
|
75
|
+
oCurrentFilterBarLayout.removeButton(oButton);
|
|
76
|
+
this._oFilterBarLayout.addButton(oButton);
|
|
77
|
+
});
|
|
82
78
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
if (oInnerControl.isA("sap.ui.mdc.FilterField")) {
|
|
96
|
-
sFirstItemVFId = oInnerControl.getId();
|
|
97
|
-
}
|
|
79
|
+
// set the current filter bar layout to the secondary one
|
|
80
|
+
this._oSecondaryFilterBarLayout = oCurrentFilterBarLayout;
|
|
81
|
+
|
|
82
|
+
// update the layout aggregation of the filter bar and rerender the same.
|
|
83
|
+
this.setAggregation("layout", this._oFilterBarLayout, true);
|
|
84
|
+
this._oFilterBarLayout.rerender();
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
getSortedFilterFields(aFilterItems: any, aFilterFields: any) {
|
|
88
|
+
const aFilterIds: any[] = [];
|
|
89
|
+
aFilterItems.forEach(function(oFilterItem: any) {
|
|
90
|
+
aFilterIds.push(oFilterItem.getId());
|
|
98
91
|
});
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
92
|
+
aFilterFields.sort(function(aFirstItem: any, aSecondItem: any) {
|
|
93
|
+
let sFirstItemVFId, sSecondItemVFId;
|
|
94
|
+
aFirstItem.getContent().forEach(function(oInnerControl: any) {
|
|
95
|
+
if (oInnerControl.isA("sap.ui.mdc.FilterField")) {
|
|
96
|
+
sFirstItemVFId = oInnerControl.getId();
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
aSecondItem.getContent().forEach(function(oInnerControl: any) {
|
|
100
|
+
if (oInnerControl.isA("sap.ui.mdc.FilterField")) {
|
|
101
|
+
sSecondItemVFId = oInnerControl.getId();
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
return aFilterIds.indexOf(sFirstItemVFId) - aFilterIds.indexOf(sSecondItemVFId);
|
|
103
105
|
});
|
|
104
|
-
return
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
this._addButtons();
|
|
106
|
+
return aFilterFields;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
_createInnerLayout() {
|
|
110
|
+
this._oFilterBarLayout = new FilterContainer();
|
|
111
|
+
this._cLayoutItem = FilterItemLayout;
|
|
112
|
+
this._oFilterBarLayout.getInner().addStyleClass("sapUiMdcFilterBarBaseAFLayout");
|
|
113
|
+
this._addButtons();
|
|
113
114
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
115
|
+
// TODO: Check with MDC if there is a better way to load visual filter on the basis of control property
|
|
116
|
+
// _createInnerLayout is called on Init by the filter bar base.
|
|
117
|
+
// This mean that we do not have access to the control properties yet
|
|
118
|
+
// and hence we cannot decide on the basis of control properties whether initial layout should be compact or visual
|
|
119
|
+
// As a result we have to do this workaround to always load the compact layout by default
|
|
120
|
+
// And toogle the same in case the initialLayout was supposed to be visual filters.
|
|
121
|
+
const oInnerLayout = this._oFilterBarLayout.getInner();
|
|
122
|
+
const oFilterContainerInnerLayoutEventDelegate = {
|
|
123
|
+
onBeforeRendering: () => {
|
|
124
|
+
if (this.initialLayout === "visual") {
|
|
125
|
+
this._toggleLayout();
|
|
126
|
+
}
|
|
127
|
+
oInnerLayout.removeEventDelegate(oFilterContainerInnerLayoutEventDelegate);
|
|
125
128
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
};
|
|
129
|
-
oInnerLayout.addEventDelegate(oFilterContainerInnerLayoutEventDelegate);
|
|
129
|
+
};
|
|
130
|
+
oInnerLayout.addEventDelegate(oFilterContainerInnerLayoutEventDelegate);
|
|
130
131
|
|
|
131
|
-
|
|
132
|
-
};
|
|
133
|
-
FilterBar.prototype.exit = function() {
|
|
134
|
-
(MdcFilterBar.prototype as any).exit.apply(this, []);
|
|
135
|
-
// Sometimes upon external navigation this._SegmentedButton is already destroyed
|
|
136
|
-
// so check if it exists and then only remove stuff
|
|
137
|
-
if (this._oSegmentedButton) {
|
|
138
|
-
this._oSegmentedButton.detachEvent("select", this._toggleLayout);
|
|
139
|
-
delete this._oSegmentedButton;
|
|
132
|
+
this.setAggregation("layout", this._oFilterBarLayout, true);
|
|
140
133
|
}
|
|
141
|
-
};
|
|
142
134
|
|
|
135
|
+
exit() {
|
|
136
|
+
super.exit();
|
|
137
|
+
// Sometimes upon external navigation this._SegmentedButton is already destroyed
|
|
138
|
+
// so check if it exists and then only remove stuff
|
|
139
|
+
if (this._oSegmentedButton) {
|
|
140
|
+
this._oSegmentedButton.detachEvent("select", this._toggleLayout);
|
|
141
|
+
delete this._oSegmentedButton;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
interface FilterBar {
|
|
146
|
+
_addButtons(): any;
|
|
147
|
+
}
|
|
143
148
|
export default FilterBar;
|
|
@@ -2,47 +2,102 @@
|
|
|
2
2
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
3
|
* (c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
4
4
|
*/
|
|
5
|
-
sap.ui.define(["sap/ui/core/Control"], function (Control) {
|
|
5
|
+
sap.ui.define(["sap/ui/core/Control", "sap/fe/core/helpers/ClassSupport"], function (Control, ClassSupport) {
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
8
|
+
var _dec, _dec2, _dec3, _dec4, _dec5, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4;
|
|
9
|
+
|
|
10
|
+
var property = ClassSupport.property;
|
|
11
|
+
var implementInterface = ClassSupport.implementInterface;
|
|
12
|
+
var defineUI5Class = ClassSupport.defineUI5Class;
|
|
13
|
+
var aggregation = ClassSupport.aggregation;
|
|
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 _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
18
|
+
|
|
19
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
|
|
20
|
+
|
|
21
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
22
|
+
|
|
23
|
+
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; }
|
|
24
|
+
|
|
25
|
+
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.'); }
|
|
26
|
+
|
|
27
|
+
var FormElementWrapper = (_dec = defineUI5Class("sap.fe.core.controls.FormElementWrapper"), _dec2 = implementInterface("sap.ui.core.IFormContent"), _dec3 = property({
|
|
28
|
+
type: "sap.ui.core.CSSSize",
|
|
29
|
+
defaultValue: null
|
|
30
|
+
}), _dec4 = property({
|
|
31
|
+
type: "boolean",
|
|
32
|
+
defaultValue: false
|
|
33
|
+
}), _dec5 = aggregation({
|
|
34
|
+
type: "sap.ui.core.Control",
|
|
35
|
+
multiple: false,
|
|
36
|
+
isDefault: true
|
|
37
|
+
}), _dec(_class = (_class2 = /*#__PURE__*/function (_Control) {
|
|
38
|
+
_inheritsLoose(FormElementWrapper, _Control);
|
|
39
|
+
|
|
40
|
+
function FormElementWrapper() {
|
|
41
|
+
var _this;
|
|
42
|
+
|
|
43
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
44
|
+
args[_key] = arguments[_key];
|
|
27
45
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
46
|
+
|
|
47
|
+
_this = _Control.call.apply(_Control, [this].concat(args)) || this;
|
|
48
|
+
|
|
49
|
+
_initializerDefineProperty(_this, "__implements__sap_ui_core_IFormContent", _descriptor, _assertThisInitialized(_this));
|
|
50
|
+
|
|
51
|
+
_initializerDefineProperty(_this, "width", _descriptor2, _assertThisInitialized(_this));
|
|
52
|
+
|
|
53
|
+
_initializerDefineProperty(_this, "formDoNotAdjustWidth", _descriptor3, _assertThisInitialized(_this));
|
|
54
|
+
|
|
55
|
+
_initializerDefineProperty(_this, "content", _descriptor4, _assertThisInitialized(_this));
|
|
56
|
+
|
|
57
|
+
return _this;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
var _proto = FormElementWrapper.prototype;
|
|
61
|
+
|
|
62
|
+
_proto.getAccessibilityInfo = function getAccessibilityInfo() {
|
|
63
|
+
var oContent = this.content;
|
|
31
64
|
return oContent && oContent.getAccessibilityInfo ? oContent.getAccessibilityInfo() : {};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
FormElementWrapper.render = function render(oRm, oControl) {
|
|
68
|
+
oRm.openStart("div", oControl);
|
|
69
|
+
oRm.style("min-height", "1rem");
|
|
70
|
+
oRm.style("width", oControl.width);
|
|
71
|
+
oRm.openEnd();
|
|
72
|
+
oRm.renderControl(oControl.content); // render the child Control
|
|
73
|
+
|
|
74
|
+
oRm.close("div"); // end of the complete Control
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
return FormElementWrapper;
|
|
78
|
+
}(Control), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "__implements__sap_ui_core_IFormContent", [_dec2], {
|
|
79
|
+
configurable: true,
|
|
80
|
+
enumerable: true,
|
|
81
|
+
writable: true,
|
|
82
|
+
initializer: function () {
|
|
83
|
+
return true;
|
|
44
84
|
}
|
|
45
|
-
})
|
|
85
|
+
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "width", [_dec3], {
|
|
86
|
+
configurable: true,
|
|
87
|
+
enumerable: true,
|
|
88
|
+
writable: true,
|
|
89
|
+
initializer: null
|
|
90
|
+
}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "formDoNotAdjustWidth", [_dec4], {
|
|
91
|
+
configurable: true,
|
|
92
|
+
enumerable: true,
|
|
93
|
+
writable: true,
|
|
94
|
+
initializer: null
|
|
95
|
+
}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "content", [_dec5], {
|
|
96
|
+
configurable: true,
|
|
97
|
+
enumerable: true,
|
|
98
|
+
writable: true,
|
|
99
|
+
initializer: null
|
|
100
|
+
})), _class2)) || _class);
|
|
46
101
|
return FormElementWrapper;
|
|
47
102
|
}, false);
|
|
48
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
103
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkZvcm1FbGVtZW50V3JhcHBlci50cyJdLCJuYW1lcyI6WyJGb3JtRWxlbWVudFdyYXBwZXIiLCJkZWZpbmVVSTVDbGFzcyIsImltcGxlbWVudEludGVyZmFjZSIsInByb3BlcnR5IiwidHlwZSIsImRlZmF1bHRWYWx1ZSIsImFnZ3JlZ2F0aW9uIiwibXVsdGlwbGUiLCJpc0RlZmF1bHQiLCJnZXRBY2Nlc3NpYmlsaXR5SW5mbyIsIm9Db250ZW50IiwiY29udGVudCIsInJlbmRlciIsIm9SbSIsIm9Db250cm9sIiwib3BlblN0YXJ0Iiwic3R5bGUiLCJ3aWR0aCIsIm9wZW5FbmQiLCJyZW5kZXJDb250cm9sIiwiY2xvc2UiLCJDb250cm9sIl0sIm1hcHBpbmdzIjoiO0FBQUE7QUFDQTtBQUNBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztNQUlNQSxrQixXQURMQyxjQUFjLENBQUMseUNBQUQsQyxVQUViQyxrQkFBa0IsQ0FBQywwQkFBRCxDLFVBR2xCQyxRQUFRLENBQUM7QUFDVEMsSUFBQUEsSUFBSSxFQUFFLHFCQURHO0FBRVRDLElBQUFBLFlBQVksRUFBRTtBQUZMLEdBQUQsQyxVQUtSRixRQUFRLENBQUM7QUFDVEMsSUFBQUEsSUFBSSxFQUFFLFNBREc7QUFFVEMsSUFBQUEsWUFBWSxFQUFFO0FBRkwsR0FBRCxDLFVBS1JDLFdBQVcsQ0FBQztBQUFFRixJQUFBQSxJQUFJLEVBQUUscUJBQVI7QUFBK0JHLElBQUFBLFFBQVEsRUFBRSxLQUF6QztBQUFnREMsSUFBQUEsU0FBUyxFQUFFO0FBQTNELEdBQUQsQzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztXQUdaQyxvQixHQUFBLGdDQUF1QjtBQUN0QixVQUFNQyxRQUFRLEdBQUcsS0FBS0MsT0FBdEI7QUFDQSxhQUFPRCxRQUFRLElBQUlBLFFBQVEsQ0FBQ0Qsb0JBQXJCLEdBQTRDQyxRQUFRLENBQUNELG9CQUFULEVBQTVDLEdBQThFLEVBQXJGO0FBQ0EsSzs7dUJBQ01HLE0sR0FBUCxnQkFBY0MsR0FBZCxFQUFrQ0MsUUFBbEMsRUFBZ0U7QUFDL0RELE1BQUFBLEdBQUcsQ0FBQ0UsU0FBSixDQUFjLEtBQWQsRUFBcUJELFFBQXJCO0FBQ0FELE1BQUFBLEdBQUcsQ0FBQ0csS0FBSixDQUFVLFlBQVYsRUFBd0IsTUFBeEI7QUFDQUgsTUFBQUEsR0FBRyxDQUFDRyxLQUFKLENBQVUsT0FBVixFQUFtQkYsUUFBUSxDQUFDRyxLQUE1QjtBQUNBSixNQUFBQSxHQUFHLENBQUNLLE9BQUo7QUFDQUwsTUFBQUEsR0FBRyxDQUFDTSxhQUFKLENBQWtCTCxRQUFRLENBQUNILE9BQTNCLEVBTCtELENBSzFCOztBQUNyQ0UsTUFBQUEsR0FBRyxDQUFDTyxLQUFKLENBQVUsS0FBVixFQU4rRCxDQU03QztBQUNsQixLOzs7SUE1QitCQyxPOzs7OzthQUVrQixJOzs7Ozs7Ozs7Ozs7Ozs7Ozs7U0E0QnBDckIsa0IiLCJzb3VyY2VSb290IjoiLiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBDb250cm9sIGZyb20gXCJzYXAvdWkvY29yZS9Db250cm9sXCI7XG5pbXBvcnQgeyBhZ2dyZWdhdGlvbiwgZGVmaW5lVUk1Q2xhc3MsIGltcGxlbWVudEludGVyZmFjZSwgcHJvcGVydHkgfSBmcm9tIFwic2FwL2ZlL2NvcmUvaGVscGVycy9DbGFzc1N1cHBvcnRcIjtcbmltcG9ydCB7IENTU1NpemUsIElGb3JtQ29udGVudCB9IGZyb20gXCJzYXAvdWkvY29yZS9saWJyYXJ5XCI7XG5pbXBvcnQgUmVuZGVyTWFuYWdlciBmcm9tIFwic2FwL3VpL2NvcmUvUmVuZGVyTWFuYWdlclwiO1xuXG5AZGVmaW5lVUk1Q2xhc3MoXCJzYXAuZmUuY29yZS5jb250cm9scy5Gb3JtRWxlbWVudFdyYXBwZXJcIilcbmNsYXNzIEZvcm1FbGVtZW50V3JhcHBlciBleHRlbmRzIENvbnRyb2wgaW1wbGVtZW50cyBJRm9ybUNvbnRlbnQge1xuXHRAaW1wbGVtZW50SW50ZXJmYWNlKFwic2FwLnVpLmNvcmUuSUZvcm1Db250ZW50XCIpXG5cdF9faW1wbGVtZW50c19fc2FwX3VpX2NvcmVfSUZvcm1Db250ZW50OiBib29sZWFuID0gdHJ1ZTtcblxuXHRAcHJvcGVydHkoe1xuXHRcdHR5cGU6IFwic2FwLnVpLmNvcmUuQ1NTU2l6ZVwiLFxuXHRcdGRlZmF1bHRWYWx1ZTogbnVsbFxuXHR9KVxuXHR3aWR0aCE6IENTU1NpemU7XG5cdEBwcm9wZXJ0eSh7XG5cdFx0dHlwZTogXCJib29sZWFuXCIsXG5cdFx0ZGVmYXVsdFZhbHVlOiBmYWxzZVxuXHR9KVxuXHRmb3JtRG9Ob3RBZGp1c3RXaWR0aCE6IGJvb2xlYW47XG5cdEBhZ2dyZWdhdGlvbih7IHR5cGU6IFwic2FwLnVpLmNvcmUuQ29udHJvbFwiLCBtdWx0aXBsZTogZmFsc2UsIGlzRGVmYXVsdDogdHJ1ZSB9KVxuXHRjb250ZW50ITogQ29udHJvbDtcblxuXHRnZXRBY2Nlc3NpYmlsaXR5SW5mbygpIHtcblx0XHRjb25zdCBvQ29udGVudCA9IHRoaXMuY29udGVudDtcblx0XHRyZXR1cm4gb0NvbnRlbnQgJiYgb0NvbnRlbnQuZ2V0QWNjZXNzaWJpbGl0eUluZm8gPyBvQ29udGVudC5nZXRBY2Nlc3NpYmlsaXR5SW5mbygpIDoge307XG5cdH1cblx0c3RhdGljIHJlbmRlcihvUm06IFJlbmRlck1hbmFnZXIsIG9Db250cm9sOiBGb3JtRWxlbWVudFdyYXBwZXIpIHtcblx0XHRvUm0ub3BlblN0YXJ0KFwiZGl2XCIsIG9Db250cm9sKTtcblx0XHRvUm0uc3R5bGUoXCJtaW4taGVpZ2h0XCIsIFwiMXJlbVwiKTtcblx0XHRvUm0uc3R5bGUoXCJ3aWR0aFwiLCBvQ29udHJvbC53aWR0aCk7XG5cdFx0b1JtLm9wZW5FbmQoKTtcblx0XHRvUm0ucmVuZGVyQ29udHJvbChvQ29udHJvbC5jb250ZW50KTsgLy8gcmVuZGVyIHRoZSBjaGlsZCBDb250cm9sXG5cdFx0b1JtLmNsb3NlKFwiZGl2XCIpOyAvLyBlbmQgb2YgdGhlIGNvbXBsZXRlIENvbnRyb2xcblx0fVxufVxuZXhwb3J0IGRlZmF1bHQgRm9ybUVsZW1lbnRXcmFwcGVyO1xuIl19
|
|
@@ -1,40 +1,37 @@
|
|
|
1
1
|
import Control from "sap/ui/core/Control";
|
|
2
|
+
import { aggregation, defineUI5Class, implementInterface, property } from "sap/fe/core/helpers/ClassSupport";
|
|
3
|
+
import { CSSSize, IFormContent } from "sap/ui/core/library";
|
|
4
|
+
import RenderManager from "sap/ui/core/RenderManager";
|
|
2
5
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
getAccessibilityInfo: function(this: FormElementWrapperType) {
|
|
25
|
-
const oContent = this.getContent();
|
|
6
|
+
@defineUI5Class("sap.fe.core.controls.FormElementWrapper")
|
|
7
|
+
class FormElementWrapper extends Control implements IFormContent {
|
|
8
|
+
@implementInterface("sap.ui.core.IFormContent")
|
|
9
|
+
__implements__sap_ui_core_IFormContent: boolean = true;
|
|
10
|
+
|
|
11
|
+
@property({
|
|
12
|
+
type: "sap.ui.core.CSSSize",
|
|
13
|
+
defaultValue: null
|
|
14
|
+
})
|
|
15
|
+
width!: CSSSize;
|
|
16
|
+
@property({
|
|
17
|
+
type: "boolean",
|
|
18
|
+
defaultValue: false
|
|
19
|
+
})
|
|
20
|
+
formDoNotAdjustWidth!: boolean;
|
|
21
|
+
@aggregation({ type: "sap.ui.core.Control", multiple: false, isDefault: true })
|
|
22
|
+
content!: Control;
|
|
23
|
+
|
|
24
|
+
getAccessibilityInfo() {
|
|
25
|
+
const oContent = this.content;
|
|
26
26
|
return oContent && oContent.getAccessibilityInfo ? oContent.getAccessibilityInfo() : {};
|
|
27
|
-
},
|
|
28
|
-
renderer: {
|
|
29
|
-
apiVersion: 2,
|
|
30
|
-
render: function(oRm: any, oControl: any) {
|
|
31
|
-
oRm.openStart("div", oControl);
|
|
32
|
-
oRm.style("min-height", "1rem");
|
|
33
|
-
oRm.style("width", oControl.getWidth());
|
|
34
|
-
oRm.openEnd();
|
|
35
|
-
oRm.renderControl(oControl.getContent()); // render the child Control
|
|
36
|
-
oRm.close("div"); // end of the complete Control
|
|
37
|
-
}
|
|
38
27
|
}
|
|
39
|
-
|
|
28
|
+
static render(oRm: RenderManager, oControl: FormElementWrapper) {
|
|
29
|
+
oRm.openStart("div", oControl);
|
|
30
|
+
oRm.style("min-height", "1rem");
|
|
31
|
+
oRm.style("width", oControl.width);
|
|
32
|
+
oRm.openEnd();
|
|
33
|
+
oRm.renderControl(oControl.content); // render the child Control
|
|
34
|
+
oRm.close("div"); // end of the complete Control
|
|
35
|
+
}
|
|
36
|
+
}
|
|
40
37
|
export default FormElementWrapper;
|