@openui5/sap.ui.mdc 1.94.0 → 1.95.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/.reuse/dep5 +1 -6
- package/THIRDPARTY.txt +3 -9
- package/package.json +4 -4
- package/src/sap/ui/mdc/.library +1 -1
- package/src/sap/ui/mdc/ActionToolbar.js +1 -1
- package/src/sap/ui/mdc/Chart.js +12 -5
- package/src/sap/ui/mdc/ChartNew.js +1 -1
- package/src/sap/ui/mdc/Control.js +1 -1
- package/src/sap/ui/mdc/Element.js +2 -2
- package/src/sap/ui/mdc/Field.js +2 -2
- package/src/sap/ui/mdc/FilterBar.js +1 -1
- package/src/sap/ui/mdc/FilterField.js +28 -4
- package/src/sap/ui/mdc/Link.js +1 -1
- package/src/sap/ui/mdc/MultiValueField.js +1 -1
- package/src/sap/ui/mdc/Table.js +44 -29
- package/src/sap/ui/mdc/ValueHelp.js +1459 -0
- package/src/sap/ui/mdc/ValueHelpDelegate.js +41 -0
- package/src/sap/ui/mdc/chart/ToolbarHandler.js +233 -224
- package/src/sap/ui/mdc/chartNew/ChartSelectionDetailsNew.js +1 -1
- package/src/sap/ui/mdc/chartNew/ChartToolbarNew.js +1 -1
- package/src/sap/ui/mdc/chartNew/ChartTypeButtonNew.js +1 -1
- package/src/sap/ui/mdc/chartNew/PropertyHelperNew.js +1 -1
- package/src/sap/ui/mdc/condition/Condition.js +1 -1
- package/src/sap/ui/mdc/condition/ConditionConverter.js +1 -1
- package/src/sap/ui/mdc/condition/ConditionModel.js +1 -1
- package/src/sap/ui/mdc/condition/FilterConverter.js +1 -1
- package/src/sap/ui/mdc/condition/FilterOperatorUtil.js +1 -1
- package/src/sap/ui/mdc/condition/Operator.js +1 -1
- package/src/sap/ui/mdc/condition/RangeOperator.js +1 -1
- package/src/sap/ui/mdc/enum/SelectType.js +43 -0
- package/src/sap/ui/mdc/field/BoolFieldHelp.js +1 -1
- package/src/sap/ui/mdc/field/ConditionFieldHelp.js +1 -1
- package/src/sap/ui/mdc/field/ConditionType.js +61 -29
- package/src/sap/ui/mdc/field/ConditionsType.js +2 -1
- package/src/sap/ui/mdc/field/CustomFieldHelp.js +1 -1
- package/src/sap/ui/mdc/field/CustomFieldInfo.js +1 -1
- package/src/sap/ui/mdc/field/DefineConditionPanel.js +13 -2
- package/src/sap/ui/mdc/field/FieldBase.js +81 -35
- package/src/sap/ui/mdc/field/FieldBaseDelegate.js +9 -2
- package/src/sap/ui/mdc/field/FieldHelpBase.js +64 -4
- package/src/sap/ui/mdc/field/FieldInfoBase.js +1 -1
- package/src/sap/ui/mdc/field/FieldInput.js +1 -1
- package/src/sap/ui/mdc/field/FieldInputRenderUtil.js +1 -1
- package/src/sap/ui/mdc/field/FieldMultiInput.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelp.js +7 -1
- package/src/sap/ui/mdc/field/FieldValueHelpContentWrapperBase.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelpMTableWrapper.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelpMdcTableWrapper.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelpTableWrapperBase.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelpUITableWrapper.js +1 -1
- package/src/sap/ui/mdc/field/InParameter.js +1 -1
- package/src/sap/ui/mdc/field/ListFieldHelp.js +1 -1
- package/src/sap/ui/mdc/field/ListFieldHelpItem.js +1 -1
- package/src/sap/ui/mdc/field/MultiValueFieldItem.js +1 -1
- package/src/sap/ui/mdc/field/OutParameter.js +1 -1
- package/src/sap/ui/mdc/field/ValueHelpPanel.js +1 -1
- package/src/sap/ui/mdc/filterbar/FilterBarBase.js +17 -9
- package/src/sap/ui/mdc/filterbar/PropertyHelper.js +1 -1
- package/src/sap/ui/mdc/filterbar/p13n/AdaptationFilterBar.js +1 -1
- package/src/sap/ui/mdc/filterbar/vh/FilterBar.js +1 -1
- package/src/sap/ui/mdc/flexibility/Chart.flexibility.js +1 -1
- package/src/sap/ui/mdc/flexibility/FilterBar.flexibility.js +1 -1
- package/src/sap/ui/mdc/flexibility/FilterItemFlex.js +1 -1
- package/src/sap/ui/mdc/flexibility/ItemBaseFlex.js +203 -197
- package/src/sap/ui/mdc/library.js +576 -4
- package/src/sap/ui/mdc/link/ContactDetails.js +1 -1
- package/src/sap/ui/mdc/link/ContactDetailsAddressItem.js +1 -1
- package/src/sap/ui/mdc/link/ContactDetailsEmailItem.js +1 -1
- package/src/sap/ui/mdc/link/ContactDetailsItem.js +1 -1
- package/src/sap/ui/mdc/link/ContactDetailsPhoneItem.js +1 -1
- package/src/sap/ui/mdc/link/Factory.js +1 -1
- package/src/sap/ui/mdc/link/FakeFlpConnector.js +1 -1
- package/src/sap/ui/mdc/link/LinkItem.js +1 -1
- package/src/sap/ui/mdc/link/Panel.js +1 -1
- package/src/sap/ui/mdc/link/PanelItem.js +1 -1
- package/src/sap/ui/mdc/link/PanelListItem.js +1 -1
- package/src/sap/ui/mdc/link/SelectionDialog.js +1 -1
- package/src/sap/ui/mdc/link/SelectionDialogItem.js +1 -1
- package/src/sap/ui/mdc/link/SemanticObjectMapping.js +1 -1
- package/src/sap/ui/mdc/link/SemanticObjectMappingItem.js +1 -1
- package/src/sap/ui/mdc/link/SemanticObjectUnavailableAction.js +1 -1
- package/src/sap/ui/mdc/messagebundle.properties +10 -3
- package/src/sap/ui/mdc/messagebundle_ar.properties +10 -3
- package/src/sap/ui/mdc/messagebundle_bg.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_ca.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_cs.properties +11 -4
- package/src/sap/ui/mdc/messagebundle_cy.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_da.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_de.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_el.properties +10 -3
- package/src/sap/ui/mdc/messagebundle_en.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_en_GB.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_en_US_sappsd.properties +7 -2
- package/src/sap/ui/mdc/messagebundle_en_US_saptrc.properties +7 -2
- package/src/sap/ui/mdc/messagebundle_es.properties +33 -26
- package/src/sap/ui/mdc/messagebundle_es_MX.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_et.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_fi.properties +10 -3
- package/src/sap/ui/mdc/messagebundle_fr.properties +16 -9
- package/src/sap/ui/mdc/messagebundle_fr_CA.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_hi.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_hr.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_hu.properties +10 -3
- package/src/sap/ui/mdc/messagebundle_id.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_it.properties +32 -25
- package/src/sap/ui/mdc/messagebundle_iw.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_ja.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_kk.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_ko.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_lt.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_lv.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_ms.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_nl.properties +10 -3
- package/src/sap/ui/mdc/messagebundle_no.properties +16 -9
- package/src/sap/ui/mdc/messagebundle_pl.properties +13 -6
- package/src/sap/ui/mdc/messagebundle_pt.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_pt_PT.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_ro.properties +12 -5
- package/src/sap/ui/mdc/messagebundle_ru.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_sh.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_sk.properties +10 -3
- package/src/sap/ui/mdc/messagebundle_sl.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_sv.properties +10 -3
- package/src/sap/ui/mdc/messagebundle_th.properties +15 -8
- package/src/sap/ui/mdc/messagebundle_tr.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_uk.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_vi.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_zh_CN.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_zh_TW.properties +9 -2
- package/src/sap/ui/mdc/mixin/AdaptationMixin.js +1 -1
- package/src/sap/ui/mdc/mixin/DelegateMixin.js +1 -1
- package/src/sap/ui/mdc/mixin/FilterIntegrationMixin.js +1 -1
- package/src/sap/ui/mdc/mixin/PromiseMixin.js +94 -0
- package/src/sap/ui/mdc/odata/v4/ChartPropertyHelperNew.js +1 -1
- package/src/sap/ui/mdc/odata/v4/ValueHelpDelegate.js +94 -0
- package/src/sap/ui/mdc/p13n/DefaultProviderRegistry.js +1 -1
- package/src/sap/ui/mdc/p13n/Engine.js +1 -1
- package/src/sap/ui/mdc/p13n/PropertyHelper.js +1 -1
- package/src/sap/ui/mdc/p13n/UIManager.js +1 -1
- package/src/sap/ui/mdc/p13n/panels/BasePanel.js +2 -2
- package/src/sap/ui/mdc/p13n/panels/GroupPanel.js +1 -1
- package/src/sap/ui/mdc/p13n/panels/ListView.js +1 -1
- package/src/sap/ui/mdc/p13n/panels/QueryPanel.js +1 -1
- package/src/sap/ui/mdc/p13n/panels/SortQueryPanel.js +1 -1
- package/src/sap/ui/mdc/p13n/panels/Wrapper.js +1 -1
- package/src/sap/ui/mdc/p13n/subcontroller/BaseController.js +1 -1
- package/src/sap/ui/mdc/table/Column.js +20 -4
- package/src/sap/ui/mdc/table/CreationRow.js +1 -1
- package/src/sap/ui/mdc/table/PropertyHelper.js +176 -4
- package/src/sap/ui/mdc/table/RowSettings.js +1 -1
- package/src/sap/ui/mdc/table/V4AnalyticsPropertyHelper.js +1 -1
- package/src/sap/ui/mdc/themes/base/ValueHelpDialog.less +51 -21
- package/src/sap/ui/mdc/ui/Container.js +2 -2
- package/src/sap/ui/mdc/ui/ContainerItem.js +2 -2
- package/src/sap/ui/mdc/util/Common.js +26 -0
- package/src/sap/ui/mdc/util/PromiseCache.js +266 -0
- package/src/sap/ui/mdc/util/PropertyHelper.js +19 -1
- package/src/sap/ui/mdc/valuehelp/Dialog.js +475 -0
- package/src/sap/ui/mdc/valuehelp/Popover.js +346 -0
- package/src/sap/ui/mdc/valuehelp/base/Container.js +440 -0
- package/src/sap/ui/mdc/valuehelp/base/Content.js +442 -0
- package/src/sap/ui/mdc/valuehelp/base/DialogTab.js +96 -0
- package/src/sap/ui/mdc/valuehelp/base/FilterableListContent.js +537 -0
- package/src/sap/ui/mdc/valuehelp/base/ListContent.js +105 -0
- package/src/sap/ui/mdc/valuehelp/content/Bool.js +232 -0
- package/src/sap/ui/mdc/valuehelp/content/Conditions.js +250 -0
- package/src/sap/ui/mdc/valuehelp/content/FixedList.js +504 -0
- package/src/sap/ui/mdc/valuehelp/content/MDCTable.js +619 -0
- package/src/sap/ui/mdc/valuehelp/content/MTable.js +881 -0
- package/test/sap/ui/mdc/testutils/opa/TestLibrary.js +2 -2
- package/test/sap/ui/mdc/testutils/opa/filterbar/Actions.js +250 -0
- package/test/sap/ui/mdc/testutils/opa/filterbar/Assertions.js +91 -0
- package/test/sap/ui/mdc/testutils/opa/filterbar/TestObjects.js +137 -0
- package/test/sap/ui/mdc/testutils/opa/filterbar/Util.js +25 -0
- package/test/sap/ui/mdc/testutils/opa/p13n/Actions.js +239 -77
- package/test/sap/ui/mdc/testutils/opa/p13n/Util.js +2 -1
- package/test/sap/ui/mdc/testutils/opa/p13n/{waitForP13nButtonWithParentAndIcon.js → waitForP13nButtonWithMatchers.js} +5 -18
- package/test/sap/ui/mdc/testutils/opa/table/TestObjects.js +0 -1
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
|
+
* (c) Copyright 2009-2021 SAP SE or an SAP affiliate company.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
+
*/
|
|
6
|
+
sap.ui.define(
|
|
7
|
+
["sap/ui/mdc/util/PromiseCache"]
|
|
8
|
+
,
|
|
9
|
+
function (PromiseCache) {
|
|
10
|
+
"use strict";
|
|
11
|
+
/**
|
|
12
|
+
* Enhances a given control prototype with a management mechanism for lifecycle related promises.
|
|
13
|
+
* Calling any of the enhanced methods after control exit will result in a no-op.
|
|
14
|
+
*
|
|
15
|
+
* @author SAP SE
|
|
16
|
+
* @version 1.95.0
|
|
17
|
+
* @alias sap.ui.mdc.mixin.PromiseMixin
|
|
18
|
+
* @namespace
|
|
19
|
+
* @since 1.85.0
|
|
20
|
+
* @private
|
|
21
|
+
* @experimental
|
|
22
|
+
* @ui5-restricted sap.ui.mdc
|
|
23
|
+
*
|
|
24
|
+
* @borrows sap.ui.mdc.util.PromiseCache.add as addPromise
|
|
25
|
+
* @borrows sap.ui.mdc.util.PromiseCache.remove as removePromise
|
|
26
|
+
* @borrows sap.ui.mdc.util.PromiseCache.resolve as resolvePromise
|
|
27
|
+
* @borrows sap.ui.mdc.util.PromiseCache.reject as rejectPromise
|
|
28
|
+
* @borrows sap.ui.mdc.util.PromiseCache.retrieve as retrievePromise
|
|
29
|
+
* @borrows sap.ui.mdc.util.PromiseCache.retrieveMany as retrievePromises
|
|
30
|
+
*/
|
|
31
|
+
var PromiseMixin = {};
|
|
32
|
+
PromiseMixin.addPromise = function (sName, fnCreate) {
|
|
33
|
+
return this.promiseCache.add(sName, fnCreate);
|
|
34
|
+
};
|
|
35
|
+
PromiseMixin.cancelPromise = function (sName, oReason) {
|
|
36
|
+
return this.promiseCache.cancel(sName, oReason);
|
|
37
|
+
};
|
|
38
|
+
PromiseMixin.retrievePromise = function (sName, fnCreate) {
|
|
39
|
+
return this.promiseCache.retrieve(sName, fnCreate);
|
|
40
|
+
};
|
|
41
|
+
PromiseMixin.retrievePromises = function () {
|
|
42
|
+
return this.promiseCache.retrieveMany.apply(this.promiseCache, arguments);
|
|
43
|
+
};
|
|
44
|
+
PromiseMixin.removePromise = function (sName) {
|
|
45
|
+
return this.promiseCache.remove(sName);
|
|
46
|
+
};
|
|
47
|
+
PromiseMixin.resolvePromise = function (sName, oValue) {
|
|
48
|
+
return this.promiseCache.resolve(sName, oValue);
|
|
49
|
+
};
|
|
50
|
+
PromiseMixin.rejectPromise = function (sName, oValue) {
|
|
51
|
+
return this.promiseCache.reject(sName, oValue);
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Provides cleanup functionality for the controls promise cache
|
|
55
|
+
*
|
|
56
|
+
* @private
|
|
57
|
+
* @param {function} fnExit Existing exit callback function
|
|
58
|
+
* @returns {function} Returns a thunk applicable to a control prototype, wrapping an existing exit method
|
|
59
|
+
*/
|
|
60
|
+
PromiseMixin.exit = function (fnExit) {
|
|
61
|
+
return function () {
|
|
62
|
+
if (this.promiseCache) {
|
|
63
|
+
this.promiseCache.destroy();
|
|
64
|
+
this.promiseCache = null;
|
|
65
|
+
}
|
|
66
|
+
if (fnExit) {
|
|
67
|
+
fnExit.apply(this, arguments);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
return function () {
|
|
72
|
+
var _noop = function (fnMethod) {
|
|
73
|
+
return function () {
|
|
74
|
+
if (this.bIsDestroyed) {
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
if (!this.promiseCache) {
|
|
78
|
+
this.promiseCache = new PromiseCache();
|
|
79
|
+
}
|
|
80
|
+
return fnMethod.apply(this, arguments);
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
this._addPromise = _noop(PromiseMixin.addPromise);
|
|
84
|
+
this._cancelPromise = _noop(PromiseMixin.cancelPromise);
|
|
85
|
+
this._removePromise = _noop(PromiseMixin.removePromise);
|
|
86
|
+
this._resolvePromise = _noop(PromiseMixin.resolvePromise);
|
|
87
|
+
this._rejectPromise = _noop(PromiseMixin.rejectPromise);
|
|
88
|
+
this._retrievePromise = _noop(PromiseMixin.retrievePromise);
|
|
89
|
+
this._retrievePromises = _noop(PromiseMixin.retrievePromises);
|
|
90
|
+
this.exit = PromiseMixin.exit(this.exit);
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
/* bExport= */ true
|
|
94
|
+
);
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* ! OpenUI5
|
|
3
|
+
* (c) Copyright 2009-2021 SAP SE or an SAP affiliate company.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
sap.ui.define([
|
|
8
|
+
"../../ValueHelpDelegate",
|
|
9
|
+
'sap/ui/model/FilterType'
|
|
10
|
+
], function(
|
|
11
|
+
ValueHelpDelegate,
|
|
12
|
+
FilterType
|
|
13
|
+
) {
|
|
14
|
+
"use strict";
|
|
15
|
+
|
|
16
|
+
var ODataV4ValueHelpDelegate = Object.assign({}, ValueHelpDelegate);
|
|
17
|
+
|
|
18
|
+
ODataV4ValueHelpDelegate.isSearchSupported = function(oPayload, oListBinding) {
|
|
19
|
+
return true; // only on V4
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
var _waitForBindingData = function (oBinding) {
|
|
23
|
+
return new Promise(function (resolve) {
|
|
24
|
+
var _bIsExecutionComplete = false;
|
|
25
|
+
var fnHandleBindingEvent = function (oParameters) {
|
|
26
|
+
if (oParameters.mParameters.detailedReason) { // do not consider virtualcontext events triggered during automatic determination of $expand and $select
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (!_bIsExecutionComplete) {
|
|
31
|
+
_bIsExecutionComplete = true;
|
|
32
|
+
oBinding.detachEvent("change", fnHandleBindingEvent);
|
|
33
|
+
resolve(oBinding);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
oBinding.attachEvent("change", fnHandleBindingEvent); // Note: According to an earlier change the change event may not always be fired in some scenarios
|
|
37
|
+
oBinding.attachEventOnce("dataReceived", fnHandleBindingEvent); // Note: According to an earlier change the dataReceived event may not always be fired in some caching scenarios
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
ODataV4ValueHelpDelegate.executeSearch = function(oPayload, oListBinding, sSearch) {
|
|
42
|
+
|
|
43
|
+
if (sSearch) {
|
|
44
|
+
oListBinding.changeParameters({ $search: sSearch });
|
|
45
|
+
} else {
|
|
46
|
+
oListBinding.changeParameters({ $search: undefined });
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return _waitForBindingData(oListBinding);
|
|
50
|
+
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
ODataV4ValueHelpDelegate.executeFilter = function(oPayload, oListBinding, oFilter, iRequestedItems) {
|
|
54
|
+
|
|
55
|
+
oListBinding.initialize();
|
|
56
|
+
oListBinding.filter(oFilter, FilterType.Application);
|
|
57
|
+
oListBinding.getContexts(0, iRequestedItems); // trigger request. not all entries needed, we only need to know if there is one, none or more
|
|
58
|
+
|
|
59
|
+
return _waitForBindingData(oListBinding);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
ODataV4ValueHelpDelegate.checkBindingsPending = function(oPayload, aBindings) {
|
|
63
|
+
|
|
64
|
+
var aPromises = [];
|
|
65
|
+
|
|
66
|
+
for (var i = 0; i < aBindings.length; i++) {
|
|
67
|
+
var oBinding = aBindings[i];
|
|
68
|
+
if (oBinding && oBinding.requestValue) {
|
|
69
|
+
aPromises.push(oBinding.requestValue());
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (aPromises.length > 0) {
|
|
74
|
+
return Promise.all(aPromises);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return null;
|
|
78
|
+
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
ODataV4ValueHelpDelegate.checkListBindingPending = function(oPayload, oListBinding, oListBindingInfo) {
|
|
82
|
+
|
|
83
|
+
if (!oListBinding || oListBinding.isSuspended()) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return oListBinding.requestContexts(0, oListBindingInfo && oListBindingInfo.length).then(function(aContexts){ // TODO: never resolves for mdc.table and prevents loading??
|
|
88
|
+
return aContexts.length > 0;
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
return ODataV4ValueHelpDelegate;
|
|
94
|
+
});
|
|
@@ -336,7 +336,7 @@ sap.ui.define([
|
|
|
336
336
|
BasePanel.prototype._getListControlConfig = function() {
|
|
337
337
|
return {
|
|
338
338
|
mode:"MultiSelect",
|
|
339
|
-
rememberSelections:
|
|
339
|
+
rememberSelections: true,
|
|
340
340
|
itemPress: [this._onItemPressed, this],
|
|
341
341
|
selectionChange: [this._onSelectionChange, this],
|
|
342
342
|
sticky: ["HeaderToolbar", "ColumnHeaders", "InfoToolbar"],
|
|
@@ -611,7 +611,7 @@ sap.ui.define([
|
|
|
611
611
|
};
|
|
612
612
|
|
|
613
613
|
BasePanel.prototype._selectTableItem = function(oTableItem, bSelectAll) {
|
|
614
|
-
this._updateEnableOfMoveButtons(oTableItem, true);
|
|
614
|
+
this._updateEnableOfMoveButtons(oTableItem, bSelectAll ? false : true);
|
|
615
615
|
this._oSelectedItem = oTableItem;
|
|
616
616
|
if (!bSelectAll) {
|
|
617
617
|
var oItem = this.getP13nModel().getProperty(this._oSelectedItem.getBindingContext(this.P13N_MODEL).sPath);
|
|
@@ -229,7 +229,7 @@ sap.ui.define([
|
|
|
229
229
|
};
|
|
230
230
|
|
|
231
231
|
ListView.prototype._updateCount = function() {
|
|
232
|
-
this.getP13nModel().setProperty("/selectedItems", this._oListControl.
|
|
232
|
+
this.getP13nModel().setProperty("/selectedItems", this._oListControl.getSelectedContexts(true).length);
|
|
233
233
|
};
|
|
234
234
|
|
|
235
235
|
ListView.prototype._selectTableItem = function(oTableItem, bSelectAll) {
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
|
-
"sap/ui/core/Element", "sap/m/Label", "sap/ui/core/Core"
|
|
9
|
-
], function(Element, Label, Core
|
|
8
|
+
"sap/ui/core/Element", "sap/m/Label", "sap/ui/core/Core"
|
|
9
|
+
], function(Element, Label, Core) {
|
|
10
10
|
"use strict";
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -141,7 +141,7 @@ sap.ui.define([
|
|
|
141
141
|
Column.prototype.setHeader = function(sHeader) {
|
|
142
142
|
this.setProperty("header", sHeader, true);
|
|
143
143
|
this._updateColumnHeaderControl();
|
|
144
|
-
var oLabelElement =
|
|
144
|
+
var oLabelElement = this.getDomRef();
|
|
145
145
|
if (oLabelElement) {
|
|
146
146
|
oLabelElement.textContent = this.getHeader();
|
|
147
147
|
}
|
|
@@ -155,6 +155,22 @@ sap.ui.define([
|
|
|
155
155
|
return this;
|
|
156
156
|
};
|
|
157
157
|
|
|
158
|
+
/**
|
|
159
|
+
* Updates the width of the column based on the auto column width calculation.
|
|
160
|
+
* @private
|
|
161
|
+
*/
|
|
162
|
+
Column.prototype._updateColumnWidth = function(sWidth) {
|
|
163
|
+
var oInnerColumn = Core.byId(this.getId() + "-innerColumn");
|
|
164
|
+
if (!oInnerColumn || !this.getWidth()) {
|
|
165
|
+
this.setProperty("width", sWidth);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// set the inner column width only if there is no user(flex) changes has been applied
|
|
169
|
+
if (oInnerColumn && !oInnerColumn.getWidth()) {
|
|
170
|
+
oInnerColumn.setWidth(sWidth);
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
|
|
158
174
|
/**
|
|
159
175
|
* Updates the column header control based on the current column property seetings.
|
|
160
176
|
* @private
|
|
@@ -212,7 +228,7 @@ sap.ui.define([
|
|
|
212
228
|
};
|
|
213
229
|
|
|
214
230
|
Column.prototype._removeAriaStaticDom = function() {
|
|
215
|
-
var oDomElement =
|
|
231
|
+
var oDomElement = this.getDomRef();
|
|
216
232
|
|
|
217
233
|
if (oDomElement) {
|
|
218
234
|
oDomElement.parentNode.removeChild(oDomElement);
|
|
@@ -22,7 +22,7 @@ sap.ui.define([
|
|
|
22
22
|
* is experimental and the API/behaviour is not finalised and hence this should not be used for productive usage.
|
|
23
23
|
* @extends sap.ui.core.Element
|
|
24
24
|
* @author SAP SE
|
|
25
|
-
* @version 1.
|
|
25
|
+
* @version 1.95.0
|
|
26
26
|
* @constructor
|
|
27
27
|
* @private
|
|
28
28
|
* @experimental
|
|
@@ -5,9 +5,15 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
|
-
"../util/PropertyHelper"
|
|
8
|
+
"../util/PropertyHelper",
|
|
9
|
+
"sap/ui/core/Core",
|
|
10
|
+
"sap/ui/core/theming/Parameters",
|
|
11
|
+
"sap/m/library"
|
|
9
12
|
], function(
|
|
10
|
-
PropertyHelperBase
|
|
13
|
+
PropertyHelperBase,
|
|
14
|
+
Core,
|
|
15
|
+
ThemeParameters,
|
|
16
|
+
MLibrary
|
|
11
17
|
) {
|
|
12
18
|
"use strict";
|
|
13
19
|
|
|
@@ -33,7 +39,7 @@ sap.ui.define([
|
|
|
33
39
|
* @extends sap.ui.mdc.util.PropertyHelper
|
|
34
40
|
*
|
|
35
41
|
* @author SAP SE
|
|
36
|
-
* @version 1.
|
|
42
|
+
* @version 1.95.0
|
|
37
43
|
*
|
|
38
44
|
* @private
|
|
39
45
|
* @experimental
|
|
@@ -43,7 +49,7 @@ sap.ui.define([
|
|
|
43
49
|
*/
|
|
44
50
|
var PropertyHelper = PropertyHelperBase.extend("sap.ui.mdc.table.PropertyHelper", {
|
|
45
51
|
constructor: function(aProperties, mExtensions, oParent, mExtensionAttributeMetadata) {
|
|
46
|
-
var aAllowedAttributes = ["filterable", "sortable", "groupable", "key", "unit", "text", "exportSettings", "propertyInfos"];
|
|
52
|
+
var aAllowedAttributes = ["filterable", "sortable", "groupable", "key", "unit", "text", "exportSettings", "propertyInfos", "visualSettings"];
|
|
47
53
|
PropertyHelperBase.call(this, aProperties, mExtensions, oParent, aAllowedAttributes, mExtensionAttributeMetadata);
|
|
48
54
|
}
|
|
49
55
|
});
|
|
@@ -205,5 +211,171 @@ sap.ui.define([
|
|
|
205
211
|
return oExportObj;
|
|
206
212
|
}
|
|
207
213
|
|
|
214
|
+
/**
|
|
215
|
+
* Measures the given text width in a canvas and returns the converted rem value.
|
|
216
|
+
*
|
|
217
|
+
* @param {string} [sText] The text to be measured
|
|
218
|
+
* @returns {float} The text width converted to rem
|
|
219
|
+
* @private
|
|
220
|
+
*/
|
|
221
|
+
var measureText = (function() {
|
|
222
|
+
var fBaseFontSize = parseFloat(MLibrary.BaseFontSize);
|
|
223
|
+
var oCanvasContext = document.createElement("canvas").getContext("2d");
|
|
224
|
+
var fnUpdateFont = function() {
|
|
225
|
+
oCanvasContext.font = [
|
|
226
|
+
ThemeParameters.get({ name: "sapMFontMediumSize" }) || "0.875rem",
|
|
227
|
+
ThemeParameters.get({ name: "sapUiFontFamily" }) || "Arial"
|
|
228
|
+
].join(" ");
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
Core.attachThemeChanged(fnUpdateFont);
|
|
232
|
+
fnUpdateFont();
|
|
233
|
+
|
|
234
|
+
return function(sText) {
|
|
235
|
+
return oCanvasContext.measureText(sText || "").width / fBaseFontSize;
|
|
236
|
+
};
|
|
237
|
+
})();
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Sets the width of the provided column based on the <code>visualSettings</code> of the relevant <code>PropertyInfo</code>.
|
|
241
|
+
*
|
|
242
|
+
* @param {sap.ui.mdc.table.Column} oMDCColumn The MDCColumn instance for which to set the width
|
|
243
|
+
* @public
|
|
244
|
+
* @since 1.95
|
|
245
|
+
*/
|
|
246
|
+
PropertyHelper.prototype.setColumnWidth = function(oMDCColumn) {
|
|
247
|
+
var sPropertyName = oMDCColumn.getDataProperty();
|
|
248
|
+
var oProperty = this.getProperty(sPropertyName);
|
|
249
|
+
if (!oProperty) {
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
var mPropertyInfoVisualSettings = oProperty.getVisualSettings(sPropertyName);
|
|
254
|
+
if (mPropertyInfoVisualSettings && mPropertyInfoVisualSettings.widthCalculation === false) {
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
var fWidth = this._calcColumnWidth(oProperty) + 1; // add 1rem extra for padding and border
|
|
259
|
+
oMDCColumn._updateColumnWidth(fWidth + "rem");
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Calculates the column width based on the provided <code>PropertyInfo</code>
|
|
264
|
+
*
|
|
265
|
+
* @param {object} oProperty The properties of PropertyInfo of MDCColumn instance for which to set the width for
|
|
266
|
+
* @param {object} [mWidthCalculation] The configuration object for the width calculation
|
|
267
|
+
* @param {int} [mWidthCalculation.minWidth=2] The minimum content width in rem
|
|
268
|
+
* @param {int} [mWidthCalculation.maxWidth=19] The maximum content width in rem
|
|
269
|
+
* @param {int} [mWidthCalculation.defaultWidth=8] The default column content width when type check fails
|
|
270
|
+
* @param {boolean} [mWidthCalculation.includeLabel=true] Whether the label should be taken into account
|
|
271
|
+
* @param {float} [mWidthCalculation.gap=0] The additional content width in rem
|
|
272
|
+
* @param {boolean} [mWidthCalculation.verticalArrangement=false] Whether the referenced properties are arranged vertically
|
|
273
|
+
* @param {string|array[]} [mWidthCalculation.excludeProperties=[]] A list of invisible referenced property names
|
|
274
|
+
* @return {float} [fWidth] Calculated width
|
|
275
|
+
* @since 1.95
|
|
276
|
+
* @private
|
|
277
|
+
*/
|
|
278
|
+
PropertyHelper.prototype._calcColumnWidth = function (oProperty, mWidthCalculation) {
|
|
279
|
+
var fWidth = 0;
|
|
280
|
+
var fLabelWidth = 0;
|
|
281
|
+
var mPropertyInfoWidthCalculation = oProperty.getVisualSettings() ? oProperty.getVisualSettings().widthCalculation : {};
|
|
282
|
+
|
|
283
|
+
mWidthCalculation = Object.assign({
|
|
284
|
+
minWidth: 2,
|
|
285
|
+
maxWidth: 19,
|
|
286
|
+
defaultWidth: 8,
|
|
287
|
+
gap: 0,
|
|
288
|
+
includeLabel: true,
|
|
289
|
+
excludeProperties: [],
|
|
290
|
+
verticalArrangement: false
|
|
291
|
+
}, mPropertyInfoWidthCalculation);
|
|
292
|
+
|
|
293
|
+
var iMinWidth = Math.max(1, mWidthCalculation.minWidth);
|
|
294
|
+
var iMaxWidth = Math.max(iMinWidth, mWidthCalculation.maxWidth);
|
|
295
|
+
|
|
296
|
+
if (oProperty.isComplex()) {
|
|
297
|
+
oProperty.getReferencedProperties().forEach(function(oReferencedProperty) {
|
|
298
|
+
if ([].concat(mWidthCalculation.excludeProperties).includes(oReferencedProperty.getName())) {
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
var fReferencedPropertyWidth = this._calcColumnWidth(oReferencedProperty, {
|
|
303
|
+
minWidth: 1,
|
|
304
|
+
maxWidth: iMaxWidth - fWidth,
|
|
305
|
+
includeLabel: false
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
if (mWidthCalculation.verticalArrangement) {
|
|
309
|
+
fWidth = Math.max(fReferencedPropertyWidth, fWidth);
|
|
310
|
+
} else {
|
|
311
|
+
fWidth = fWidth + fReferencedPropertyWidth + 0.5; // add 0.5rem for some extra spacing in h-alignment
|
|
312
|
+
}
|
|
313
|
+
}, this);
|
|
314
|
+
} else {
|
|
315
|
+
var oTypeConfig = oProperty.getTypeConfig();
|
|
316
|
+
var oType = oTypeConfig.typeInstance;
|
|
317
|
+
var sBaseType = oTypeConfig.baseType;
|
|
318
|
+
var sChar = "A";
|
|
319
|
+
var vSample;
|
|
320
|
+
|
|
321
|
+
if (sBaseType === "Boolean") {
|
|
322
|
+
var oResourceBundle = Core.getLibraryResourceBundle("sap.ui.core");
|
|
323
|
+
var fTrueWidth = measureText(oResourceBundle.getText("YES"));
|
|
324
|
+
var fFalseWidth = measureText(oResourceBundle.getText("NO"));
|
|
325
|
+
fWidth = Math.max(fTrueWidth, fFalseWidth);
|
|
326
|
+
} else if (sBaseType === "Numeric") {
|
|
327
|
+
var iPrecision = oType.getConstraints().precision;
|
|
328
|
+
var iScale = oType.getConstraints().scale;
|
|
329
|
+
var mNumericLimits = {
|
|
330
|
+
"Edm.Byte" : 3,
|
|
331
|
+
"Edm.SByte" : 3,
|
|
332
|
+
"Edm.Int16" : 5,
|
|
333
|
+
"Edm.Int32" : 9,
|
|
334
|
+
"Edm.Int64" : 12,
|
|
335
|
+
"Edm.Float" : 6,
|
|
336
|
+
"Edm.Single" : 6,
|
|
337
|
+
"Edm.Double" : 13,
|
|
338
|
+
"Edm.Decimal" : 15,
|
|
339
|
+
"Numeric" : 10
|
|
340
|
+
};
|
|
341
|
+
iPrecision = Math.min(iPrecision || 20, mNumericLimits[oTypeConfig.className] || mNumericLimits.Numeric);
|
|
342
|
+
vSample = 2 * Math.pow(10, iPrecision - (iScale || 0) - 1);
|
|
343
|
+
} else if (sBaseType === "Date" || sBaseType === "Time" || sBaseType === "DateTime") {
|
|
344
|
+
vSample = new Date(2023, 12, 26, 22, 47, 58);
|
|
345
|
+
} else if (sBaseType === "String") {
|
|
346
|
+
var iMaxLength = oType.getConstraints().maxLength;
|
|
347
|
+
if (!iMaxLength) {
|
|
348
|
+
fWidth = iMaxWidth * 0.7;
|
|
349
|
+
} else {
|
|
350
|
+
vSample = sChar.repeat(Math.min(8, iMaxLength)) + sChar.toLowerCase().repeat(Math.max(0, iMaxLength - 8));
|
|
351
|
+
}
|
|
352
|
+
} else {
|
|
353
|
+
fWidth = mWidthCalculation.defaultWidth;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
if (vSample) {
|
|
357
|
+
var sSample = oType.formatValue(vSample, "string");
|
|
358
|
+
fWidth = measureText(sSample);
|
|
359
|
+
}
|
|
360
|
+
if (oProperty.getUnitProperty()) {
|
|
361
|
+
fWidth += measureText(sChar.repeat(4));
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
fWidth += mWidthCalculation.gap;
|
|
366
|
+
|
|
367
|
+
if (mWidthCalculation.includeLabel && fWidth < iMaxWidth) {
|
|
368
|
+
var sLabel = oProperty.getLabel();
|
|
369
|
+
var fMaxLabelWidth = fWidth * Math.max(1, 1 - Math.log(Math.max(fWidth - 1.71, 0.2)) / Math.log(iMaxWidth * 0.62) + 1);
|
|
370
|
+
fLabelWidth = Math.min(measureText(sLabel), fMaxLabelWidth);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
fWidth = Math.max(iMinWidth, fWidth, fLabelWidth);
|
|
374
|
+
fWidth = Math.min(fWidth, iMaxWidth);
|
|
375
|
+
fWidth = Math.round(fWidth * 100) / 100;
|
|
376
|
+
|
|
377
|
+
return fWidth;
|
|
378
|
+
};
|
|
379
|
+
|
|
208
380
|
return PropertyHelper;
|
|
209
381
|
});
|
|
@@ -19,7 +19,7 @@ sap.ui.define([
|
|
|
19
19
|
* The <code>RowSettings</code> control allows you to configure a row.
|
|
20
20
|
* You can only use this control in the context of the <code>sap.ui.mdc.Table</code> control to define row settings.
|
|
21
21
|
* @extends sap.ui.core.Element
|
|
22
|
-
* @version 1.
|
|
22
|
+
* @version 1.95.0
|
|
23
23
|
*
|
|
24
24
|
* @constructor
|
|
25
25
|
* @private
|