@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,13 +2,32 @@
|
|
|
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/
|
|
5
|
+
sap.ui.define(["sap/base/Log", "sap/fe/core/helpers/ClassSupport", "sap/ui/core/CommandExecution", "sap/ui/core/Element", "sap/ui/core/Shortcut"], function (Log, ClassSupport, CommandExecution, Element, Shortcut) {
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
+
var CustomCommandExecution = (_dec = defineUI5Class("sap.fe.core.controls.CommandExecution"), _dec(_class = /*#__PURE__*/function (_CommandExecution) {
|
|
17
|
+
_inheritsLoose(CustomCommandExecution, _CommandExecution);
|
|
18
|
+
|
|
19
|
+
function CustomCommandExecution() {
|
|
20
|
+
return _CommandExecution.apply(this, arguments) || this;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var _proto = CustomCommandExecution.prototype;
|
|
24
|
+
|
|
25
|
+
_proto.setParent = function setParent(oParent) {
|
|
26
|
+
var aExcludedSingleKey = ["escape"]; // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
|
|
29
|
+
_CommandExecution.prototype.setParent.call(this, oParent);
|
|
30
|
+
|
|
12
31
|
var aCommands = oParent.data("sap.ui.core.Shortcut");
|
|
13
32
|
|
|
14
33
|
if (Array.isArray(aCommands) && aCommands.length > 0) {
|
|
@@ -39,8 +58,9 @@ sap.ui.define(["sap/ui/core/CommandExecution", "sap/base/Log", "sap/ui/core/Elem
|
|
|
39
58
|
|
|
40
59
|
return this;
|
|
41
60
|
}
|
|
42
|
-
}
|
|
43
|
-
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
_proto.destroy = function destroy(bSuppressInvalidate) {
|
|
44
64
|
var oParent = this.getParent();
|
|
45
65
|
|
|
46
66
|
if (oParent) {
|
|
@@ -54,19 +74,22 @@ sap.ui.define(["sap/ui/core/CommandExecution", "sap/base/Log", "sap/ui/core/Elem
|
|
|
54
74
|
}
|
|
55
75
|
|
|
56
76
|
Element.prototype.destroy.apply(this, [bSuppressInvalidate]);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
setVisible: function (bValue) {
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
_proto.setVisible = function setVisible(bValue) {
|
|
61
80
|
var oCommand = this._getCommandInfo();
|
|
62
81
|
|
|
63
82
|
if (oCommand) {
|
|
64
|
-
|
|
83
|
+
_CommandExecution.prototype.setVisible.call(this, bValue);
|
|
65
84
|
} else {
|
|
66
85
|
Log.info("There is no shortcut definition registered in the manifest for the command : " + this.getCommand());
|
|
67
86
|
}
|
|
68
|
-
|
|
69
|
-
|
|
87
|
+
|
|
88
|
+
return this;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
return CustomCommandExecution;
|
|
92
|
+
}(CommandExecution)) || _class);
|
|
70
93
|
return CustomCommandExecution;
|
|
71
94
|
}, false);
|
|
72
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
95
|
+
//# sourceMapp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N1dGlvbiB7XG5cdF9nZXRDb21tYW5kSW5mbygpOiBhbnk7XG5cdF9jbGVhbnVwQ29udGV4dChvUGFyZW50OiBhbnkpOiB2b2lkO1xufVxuZXhwb3J0IGRlZmF1bHQgQ3VzdG9tQ29tbWFuZEV4ZWN1dGlvbjtcbiJdfQ==
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import CommandExecution from "sap/ui/core/CommandExecution";
|
|
2
1
|
import Log from "sap/base/Log";
|
|
2
|
+
import { defineUI5Class } from "sap/fe/core/helpers/ClassSupport";
|
|
3
|
+
import CommandExecution from "sap/ui/core/CommandExecution";
|
|
3
4
|
import Element from "sap/ui/core/Element";
|
|
4
5
|
import Shortcut from "sap/ui/core/Shortcut";
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
_cleanupContext(oParent: any): void;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const CustomCommandExecution = CommandExecution.extend("sap.fe.core.controls.CommandExecution", {
|
|
13
|
-
setParent: function(oParent: any) {
|
|
7
|
+
@defineUI5Class("sap.fe.core.controls.CommandExecution")
|
|
8
|
+
class CustomCommandExecution extends CommandExecution {
|
|
9
|
+
setParent(oParent: any) {
|
|
14
10
|
const aExcludedSingleKey = ["escape"];
|
|
15
|
-
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
12
|
+
// @ts-ignore
|
|
13
|
+
super.setParent(oParent);
|
|
16
14
|
const aCommands = oParent.data("sap.ui.core.Shortcut");
|
|
17
15
|
if (Array.isArray(aCommands) && aCommands.length > 0) {
|
|
18
16
|
const oCommand = oParent.data("sap.ui.core.Shortcut")[aCommands.length - 1],
|
|
@@ -27,7 +25,7 @@ const CustomCommandExecution = CommandExecution.extend("sap.fe.core.controls.Com
|
|
|
27
25
|
// Need to disable ShortCut when user press single shortcut key into an input
|
|
28
26
|
oParent.addDelegate(
|
|
29
27
|
{
|
|
30
|
-
"onkeydown": function(oEvent: any) {
|
|
28
|
+
"onkeydown": function (oEvent: any) {
|
|
31
29
|
if (aExcludedSingleKey.indexOf(oEvent.key.toLowerCase()) > -1) {
|
|
32
30
|
const sElement = oEvent.target ? oEvent.target.tagName.toLowerCase() : undefined;
|
|
33
31
|
if (sElement === "input") {
|
|
@@ -43,9 +41,9 @@ const CustomCommandExecution = CommandExecution.extend("sap.fe.core.controls.Com
|
|
|
43
41
|
}
|
|
44
42
|
return this;
|
|
45
43
|
}
|
|
46
|
-
}
|
|
44
|
+
}
|
|
47
45
|
|
|
48
|
-
destroy
|
|
46
|
+
destroy(bSuppressInvalidate: boolean) {
|
|
49
47
|
const oParent = this.getParent();
|
|
50
48
|
if (oParent) {
|
|
51
49
|
const oCommand = this._getCommandInfo();
|
|
@@ -55,18 +53,20 @@ const CustomCommandExecution = CommandExecution.extend("sap.fe.core.controls.Com
|
|
|
55
53
|
this._cleanupContext(oParent);
|
|
56
54
|
}
|
|
57
55
|
Element.prototype.destroy.apply(this, [bSuppressInvalidate]);
|
|
58
|
-
}
|
|
56
|
+
}
|
|
59
57
|
|
|
60
|
-
|
|
61
|
-
// @ts-ignore
|
|
62
|
-
setVisible: function(this: CommandExecutionEx, bValue: any) {
|
|
58
|
+
setVisible(bValue: boolean) {
|
|
63
59
|
const oCommand = this._getCommandInfo();
|
|
64
60
|
if (oCommand) {
|
|
65
|
-
|
|
61
|
+
super.setVisible(bValue);
|
|
66
62
|
} else {
|
|
67
63
|
Log.info("There is no shortcut definition registered in the manifest for the command : " + this.getCommand());
|
|
68
64
|
}
|
|
65
|
+
return this;
|
|
69
66
|
}
|
|
70
|
-
}
|
|
71
|
-
|
|
67
|
+
}
|
|
68
|
+
interface CustomCommandExecution {
|
|
69
|
+
_getCommandInfo(): any;
|
|
70
|
+
_cleanupContext(oParent: any): void;
|
|
71
|
+
}
|
|
72
72
|
export default CustomCommandExecution;
|
|
@@ -2,49 +2,81 @@
|
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
8
|
+
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7;
|
|
9
|
+
|
|
10
|
+
var property = ClassSupport.property;
|
|
11
|
+
var implementInterface = ClassSupport.implementInterface;
|
|
12
|
+
var defineUI5Class = ClassSupport.defineUI5Class;
|
|
13
|
+
var association = ClassSupport.association;
|
|
14
|
+
var aggregation = ClassSupport.aggregation;
|
|
15
|
+
|
|
16
|
+
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 }); }
|
|
17
|
+
|
|
18
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
19
|
+
|
|
20
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
|
|
21
|
+
|
|
22
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
25
|
+
|
|
26
|
+
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.'); }
|
|
27
|
+
|
|
28
|
+
var ConditionalWrapper = (_dec = defineUI5Class("sap.fe.core.controls.ConditionalWrapper"), _dec2 = implementInterface("sap.ui.core.IFormContent"), _dec3 = property({
|
|
29
|
+
type: "sap.ui.core.CSSSize",
|
|
30
|
+
defaultValue: null
|
|
31
|
+
}), _dec4 = property({
|
|
32
|
+
type: "boolean",
|
|
33
|
+
defaultValue: false
|
|
34
|
+
}), _dec5 = property({
|
|
35
|
+
type: "boolean",
|
|
36
|
+
defaultValue: false
|
|
37
|
+
}), _dec6 = association({
|
|
38
|
+
type: "sap.ui.core.Control",
|
|
39
|
+
multiple: true,
|
|
40
|
+
singularName: "ariaLabelledBy"
|
|
41
|
+
}), _dec7 = aggregation({
|
|
42
|
+
type: "sap.ui.core.Control",
|
|
43
|
+
multiple: false,
|
|
44
|
+
isDefault: true
|
|
45
|
+
}), _dec8 = aggregation({
|
|
46
|
+
type: "sap.ui.core.Control",
|
|
47
|
+
multiple: false
|
|
48
|
+
}), _dec(_class = (_class2 = /*#__PURE__*/function (_Control) {
|
|
49
|
+
_inheritsLoose(ConditionalWrapper, _Control);
|
|
50
|
+
|
|
51
|
+
function ConditionalWrapper() {
|
|
52
|
+
var _this;
|
|
53
|
+
|
|
54
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
55
|
+
args[_key] = arguments[_key];
|
|
45
56
|
}
|
|
46
|
-
|
|
47
|
-
|
|
57
|
+
|
|
58
|
+
_this = _Control.call.apply(_Control, [this].concat(args)) || this;
|
|
59
|
+
|
|
60
|
+
_initializerDefineProperty(_this, "__implements__sap_ui_core_IFormContent", _descriptor, _assertThisInitialized(_this));
|
|
61
|
+
|
|
62
|
+
_initializerDefineProperty(_this, "width", _descriptor2, _assertThisInitialized(_this));
|
|
63
|
+
|
|
64
|
+
_initializerDefineProperty(_this, "formDoNotAdjustWidth", _descriptor3, _assertThisInitialized(_this));
|
|
65
|
+
|
|
66
|
+
_initializerDefineProperty(_this, "condition", _descriptor4, _assertThisInitialized(_this));
|
|
67
|
+
|
|
68
|
+
_initializerDefineProperty(_this, "ariaLabelledBy", _descriptor5, _assertThisInitialized(_this));
|
|
69
|
+
|
|
70
|
+
_initializerDefineProperty(_this, "contentTrue", _descriptor6, _assertThisInitialized(_this));
|
|
71
|
+
|
|
72
|
+
_initializerDefineProperty(_this, "contentFalse", _descriptor7, _assertThisInitialized(_this));
|
|
73
|
+
|
|
74
|
+
return _this;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
var _proto = ConditionalWrapper.prototype;
|
|
78
|
+
|
|
79
|
+
_proto.enhanceAccessibilityState = function enhanceAccessibilityState(oElement, mAriaProps) {
|
|
48
80
|
var oParent = this.getParent();
|
|
49
81
|
|
|
50
82
|
if (oParent && oParent.enhanceAccessibilityState) {
|
|
@@ -52,10 +84,11 @@ sap.ui.define(["sap/ui/core/Control"], function (Control) {
|
|
|
52
84
|
}
|
|
53
85
|
|
|
54
86
|
return mAriaProps;
|
|
55
|
-
}
|
|
56
|
-
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
_proto._setAriaLabelledBy = function _setAriaLabelledBy(oContent) {
|
|
57
90
|
if (oContent && oContent.addAriaLabelledBy) {
|
|
58
|
-
var aAriaLabelledBy = this.
|
|
91
|
+
var aAriaLabelledBy = this.ariaLabelledBy;
|
|
59
92
|
|
|
60
93
|
for (var i = 0; i < aAriaLabelledBy.length; i++) {
|
|
61
94
|
var sId = aAriaLabelledBy[i];
|
|
@@ -66,32 +99,70 @@ sap.ui.define(["sap/ui/core/Control"], function (Control) {
|
|
|
66
99
|
}
|
|
67
100
|
}
|
|
68
101
|
}
|
|
69
|
-
}
|
|
70
|
-
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
_proto.onBeforeRendering = function onBeforeRendering() {
|
|
71
105
|
// before calling the renderer of the ConditionalWrapper parent control may have set ariaLabelledBy
|
|
72
106
|
// we ensure it is passed to its inner controls
|
|
73
|
-
this._setAriaLabelledBy(this.
|
|
74
|
-
|
|
75
|
-
this._setAriaLabelledBy(this.getContentFalse());
|
|
76
|
-
},
|
|
77
|
-
renderer: {
|
|
78
|
-
apiVersion: 2,
|
|
79
|
-
render: function (oRm, oControl) {
|
|
80
|
-
oRm.openStart("div", oControl);
|
|
81
|
-
oRm.style("width", oControl.getWidth());
|
|
82
|
-
oRm.style("display", "inline-block");
|
|
83
|
-
oRm.openEnd();
|
|
84
|
-
|
|
85
|
-
if (oControl.getCondition()) {
|
|
86
|
-
oRm.renderControl(oControl.getContentTrue());
|
|
87
|
-
} else {
|
|
88
|
-
oRm.renderControl(oControl.getContentFalse());
|
|
89
|
-
}
|
|
107
|
+
this._setAriaLabelledBy(this.contentTrue);
|
|
90
108
|
|
|
91
|
-
|
|
109
|
+
this._setAriaLabelledBy(this.contentFalse);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
ConditionalWrapper.render = function render(oRm, oControl) {
|
|
113
|
+
oRm.openStart("div", oControl);
|
|
114
|
+
oRm.style("width", oControl.width);
|
|
115
|
+
oRm.style("display", "inline-block");
|
|
116
|
+
oRm.openEnd();
|
|
117
|
+
|
|
118
|
+
if (oControl.condition) {
|
|
119
|
+
oRm.renderControl(oControl.contentTrue);
|
|
120
|
+
} else {
|
|
121
|
+
oRm.renderControl(oControl.contentFalse);
|
|
92
122
|
}
|
|
123
|
+
|
|
124
|
+
oRm.close("div"); // end of the complete Control
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
return ConditionalWrapper;
|
|
128
|
+
}(Control), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "__implements__sap_ui_core_IFormContent", [_dec2], {
|
|
129
|
+
configurable: true,
|
|
130
|
+
enumerable: true,
|
|
131
|
+
writable: true,
|
|
132
|
+
initializer: function () {
|
|
133
|
+
return true;
|
|
93
134
|
}
|
|
94
|
-
})
|
|
135
|
+
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "width", [_dec3], {
|
|
136
|
+
configurable: true,
|
|
137
|
+
enumerable: true,
|
|
138
|
+
writable: true,
|
|
139
|
+
initializer: null
|
|
140
|
+
}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "formDoNotAdjustWidth", [_dec4], {
|
|
141
|
+
configurable: true,
|
|
142
|
+
enumerable: true,
|
|
143
|
+
writable: true,
|
|
144
|
+
initializer: null
|
|
145
|
+
}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "condition", [_dec5], {
|
|
146
|
+
configurable: true,
|
|
147
|
+
enumerable: true,
|
|
148
|
+
writable: true,
|
|
149
|
+
initializer: null
|
|
150
|
+
}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "ariaLabelledBy", [_dec6], {
|
|
151
|
+
configurable: true,
|
|
152
|
+
enumerable: true,
|
|
153
|
+
writable: true,
|
|
154
|
+
initializer: null
|
|
155
|
+
}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "contentTrue", [_dec7], {
|
|
156
|
+
configurable: true,
|
|
157
|
+
enumerable: true,
|
|
158
|
+
writable: true,
|
|
159
|
+
initializer: null
|
|
160
|
+
}), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "contentFalse", [_dec8], {
|
|
161
|
+
configurable: true,
|
|
162
|
+
enumerable: true,
|
|
163
|
+
writable: true,
|
|
164
|
+
initializer: null
|
|
165
|
+
})), _class2)) || _class);
|
|
95
166
|
return ConditionalWrapper;
|
|
96
167
|
}, false);
|
|
97
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
168
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNvbmRpdGlvbmFsV3JhcHBlci50cyJdLCJuYW1lcyI6WyJDb25kaXRpb25hbFdyYXBwZXIiLCJkZWZpbmVVSTVDbGFzcyIsImltcGxlbWVudEludGVyZmFjZSIsInByb3BlcnR5IiwidHlwZSIsImRlZmF1bHRWYWx1ZSIsImFzc29jaWF0aW9uIiwibXVsdGlwbGUiLCJzaW5ndWxhck5hbWUiLCJhZ2dyZWdhdGlvbiIsImlzRGVmYXVsdCIsImVuaGFuY2VBY2Nlc3NpYmlsaXR5U3RhdGUiLCJvRWxlbWVudCIsIm1BcmlhUHJvcHMiLCJvUGFyZW50IiwiZ2V0UGFyZW50IiwiX3NldEFyaWFMYWJlbGxlZEJ5Iiwib0NvbnRlbnQiLCJhZGRBcmlhTGFiZWxsZWRCeSIsImFBcmlhTGFiZWxsZWRCeSIsImFyaWFMYWJlbGxlZEJ5IiwiaSIsImxlbmd0aCIsInNJZCIsImFBcmlhTGFiZWxsZWRCeXMiLCJnZXRBcmlhTGFiZWxsZWRCeSIsImluZGV4T2YiLCJvbkJlZm9yZVJlbmRlcmluZyIsImNvbnRlbnRUcnVlIiwiY29udGVudEZhbHNlIiwicmVu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cImRpdlwiKTsgLy8gZW5kIG9mIHRoZSBjb21wbGV0ZSBDb250cm9sXG5cdH1cbn1cblxuZXhwb3J0IGRlZmF1bHQgQ29uZGl0aW9uYWxXcmFwcGVyO1xuIl19
|
|
@@ -1,41 +1,35 @@
|
|
|
1
1
|
import Control from "sap/ui/core/Control";
|
|
2
|
+
import { aggregation, association, 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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
ariaLabelledBy: { type: "sap.ui.core.Control", multiple: true, singularName: "ariaLabelledBy" }
|
|
31
|
-
},
|
|
32
|
-
defaultAggregation: "contentTrue",
|
|
33
|
-
aggregations: {
|
|
34
|
-
contentTrue: { type: "sap.ui.core.Control", multiple: false },
|
|
35
|
-
contentFalse: { type: "sap.ui.core.Control", multiple: false }
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
enhanceAccessibilityState: function(oElement: any, mAriaProps: any) {
|
|
6
|
+
@defineUI5Class("sap.fe.core.controls.ConditionalWrapper")
|
|
7
|
+
class ConditionalWrapper extends Control implements IFormContent {
|
|
8
|
+
@implementInterface("sap.ui.core.IFormContent")
|
|
9
|
+
__implements__sap_ui_core_IFormContent: boolean = true;
|
|
10
|
+
|
|
11
|
+
@property({ type: "sap.ui.core.CSSSize", defaultValue: null })
|
|
12
|
+
width!: CSSSize;
|
|
13
|
+
|
|
14
|
+
@property({ type: "boolean", defaultValue: false })
|
|
15
|
+
formDoNotAdjustWidth!: boolean;
|
|
16
|
+
|
|
17
|
+
@property({ type: "boolean", defaultValue: false })
|
|
18
|
+
condition!: boolean;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Association to controls / IDs that label this control (see WAI-ARIA attribute aria-labelledby).
|
|
22
|
+
*/
|
|
23
|
+
@association({ type: "sap.ui.core.Control", multiple: true, singularName: "ariaLabelledBy" })
|
|
24
|
+
ariaLabelledBy!: Control[];
|
|
25
|
+
|
|
26
|
+
@aggregation({ type: "sap.ui.core.Control", multiple: false, isDefault: true })
|
|
27
|
+
contentTrue!: Control;
|
|
28
|
+
|
|
29
|
+
@aggregation({ type: "sap.ui.core.Control", multiple: false })
|
|
30
|
+
contentFalse!: Control;
|
|
31
|
+
|
|
32
|
+
enhanceAccessibilityState(oElement: any, mAriaProps: any) {
|
|
39
33
|
const oParent = this.getParent() as any;
|
|
40
34
|
|
|
41
35
|
if (oParent && oParent.enhanceAccessibilityState) {
|
|
@@ -43,10 +37,10 @@ const ConditionalWrapper = Control.extend("sap.fe.core.controls.ConditionalWrapp
|
|
|
43
37
|
}
|
|
44
38
|
|
|
45
39
|
return mAriaProps;
|
|
46
|
-
}
|
|
47
|
-
_setAriaLabelledBy
|
|
40
|
+
}
|
|
41
|
+
_setAriaLabelledBy(oContent: any) {
|
|
48
42
|
if (oContent && oContent.addAriaLabelledBy) {
|
|
49
|
-
const aAriaLabelledBy = this.
|
|
43
|
+
const aAriaLabelledBy = this.ariaLabelledBy;
|
|
50
44
|
|
|
51
45
|
for (let i = 0; i < aAriaLabelledBy.length; i++) {
|
|
52
46
|
const sId = aAriaLabelledBy[i];
|
|
@@ -56,28 +50,25 @@ const ConditionalWrapper = Control.extend("sap.fe.core.controls.ConditionalWrapp
|
|
|
56
50
|
}
|
|
57
51
|
}
|
|
58
52
|
}
|
|
59
|
-
}
|
|
60
|
-
onBeforeRendering
|
|
53
|
+
}
|
|
54
|
+
onBeforeRendering() {
|
|
61
55
|
// before calling the renderer of the ConditionalWrapper parent control may have set ariaLabelledBy
|
|
62
56
|
// we ensure it is passed to its inner controls
|
|
63
|
-
this._setAriaLabelledBy(this.
|
|
64
|
-
this._setAriaLabelledBy(this.
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
oRm.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
} else {
|
|
76
|
-
oRm.renderControl(oControl.getContentFalse());
|
|
77
|
-
}
|
|
78
|
-
oRm.close("div"); // end of the complete Control
|
|
57
|
+
this._setAriaLabelledBy(this.contentTrue);
|
|
58
|
+
this._setAriaLabelledBy(this.contentFalse);
|
|
59
|
+
}
|
|
60
|
+
static render(oRm: RenderManager, oControl: ConditionalWrapper) {
|
|
61
|
+
oRm.openStart("div", oControl);
|
|
62
|
+
oRm.style("width", oControl.width);
|
|
63
|
+
oRm.style("display", "inline-block");
|
|
64
|
+
oRm.openEnd();
|
|
65
|
+
if (oControl.condition) {
|
|
66
|
+
oRm.renderControl(oControl.contentTrue);
|
|
67
|
+
} else {
|
|
68
|
+
oRm.renderControl(oControl.contentFalse);
|
|
79
69
|
}
|
|
70
|
+
oRm.close("div"); // end of the complete Control
|
|
80
71
|
}
|
|
81
|
-
}
|
|
72
|
+
}
|
|
82
73
|
|
|
83
74
|
export default ConditionalWrapper;
|