@openui5/sap.ui.mdc 1.112.2 → 1.114.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/THIRDPARTY.txt +1 -1
- package/package.json +4 -4
- package/src/sap/ui/mdc/.library +1 -1
- package/src/sap/ui/mdc/ActionToolbar.js +5 -4
- package/src/sap/ui/mdc/BaseDelegate.js +49 -15
- package/src/sap/ui/mdc/Chart.js +167 -147
- package/src/sap/ui/mdc/ChartDelegate.js +525 -481
- package/src/sap/ui/mdc/Control.js +3 -2
- package/src/sap/ui/mdc/DefaultTypeMap.js +72 -0
- package/src/sap/ui/mdc/Element.js +3 -2
- package/src/sap/ui/mdc/Field.js +53 -17
- package/src/sap/ui/mdc/FilterBar.js +24 -11
- package/src/sap/ui/mdc/FilterBarDelegate.js +40 -55
- package/src/sap/ui/mdc/FilterField.js +17 -8
- package/src/sap/ui/mdc/Link.js +69 -55
- package/src/sap/ui/mdc/LinkDelegate.js +26 -30
- package/src/sap/ui/mdc/MultiValueField.js +42 -4
- package/src/sap/ui/mdc/Table.js +276 -178
- package/src/sap/ui/mdc/TableDelegate.js +187 -16
- package/src/sap/ui/mdc/ValueHelp.js +13 -14
- package/src/sap/ui/mdc/ValueHelpDelegate.js +12 -7
- package/src/sap/ui/mdc/actiontoolbar/ActionToolbarAction.js +4 -9
- package/src/sap/ui/mdc/chart/ChartImplementationContainer.js +194 -197
- package/src/sap/ui/mdc/chart/ChartSelectionDetails.js +1 -4
- package/src/sap/ui/mdc/chart/ChartToolbar.js +1 -1
- package/src/sap/ui/mdc/chart/ChartTypeButton.js +42 -56
- package/src/sap/ui/mdc/chart/DrillBreadcrumbs.js +3 -3
- package/src/sap/ui/mdc/chart/DrillStackHandler.js +60 -69
- package/src/sap/ui/mdc/chart/Item.js +13 -13
- package/src/sap/ui/mdc/chart/PropertyHelper.js +7 -7
- package/src/sap/ui/mdc/chart/SelectionDetailsActions.js +24 -15
- package/src/sap/ui/mdc/condition/Condition.js +21 -15
- package/src/sap/ui/mdc/condition/ConditionConverter.js +1 -1
- package/src/sap/ui/mdc/condition/ConditionModel.js +6 -149
- package/src/sap/ui/mdc/condition/ConditionModelPropertyBinding.js +5 -3
- package/src/sap/ui/mdc/condition/FilterConverter.js +2 -22
- package/src/sap/ui/mdc/condition/FilterOperatorUtil.js +910 -22
- package/src/sap/ui/mdc/condition/Operator.js +78 -42
- package/src/sap/ui/mdc/condition/OperatorDynamicDateOption.js +3 -2
- package/src/sap/ui/mdc/condition/RangeOperator.js +104 -104
- package/src/sap/ui/mdc/enum/ConditionValidated.js +4 -1
- package/src/sap/ui/mdc/enum/ContentMode.js +1 -1
- package/src/sap/ui/mdc/enum/EditMode.js +7 -7
- package/src/sap/ui/mdc/enum/FieldDisplay.js +3 -3
- package/src/sap/ui/mdc/enum/LinkType.js +46 -0
- package/src/sap/ui/mdc/enum/OperatorOverwrite.js +34 -0
- package/src/sap/ui/mdc/field/ConditionType.js +30 -30
- package/src/sap/ui/mdc/field/ConditionsType.js +5 -5
- package/src/sap/ui/mdc/field/CustomFieldInfo.js +1 -1
- package/src/sap/ui/mdc/field/DynamicDateRangeConditionsType.js +22 -10
- package/src/sap/ui/mdc/field/FieldBase.js +128 -40
- package/src/sap/ui/mdc/field/FieldBaseDelegate.js +17 -28
- package/src/sap/ui/mdc/field/FieldInfoBase.js +29 -14
- 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/ListFieldHelpItem.js +9 -29
- package/src/sap/ui/mdc/field/MultiValueFieldItem.js +1 -2
- package/src/sap/ui/mdc/field/TokenDisplay.js +2 -2
- package/src/sap/ui/mdc/field/TokenizerDisplay.js +2 -2
- package/src/sap/ui/mdc/field/content/ContentFactory.js +1 -1
- package/src/sap/ui/mdc/field/content/DateContent.js +43 -37
- package/src/sap/ui/mdc/field/content/LinkContent.js +8 -4
- package/src/sap/ui/mdc/field/content/UnitContent.js +11 -2
- package/src/sap/ui/mdc/filterbar/FilterBarBase.js +33 -62
- package/src/sap/ui/mdc/filterbar/IFilterContainer.js +31 -14
- package/src/sap/ui/mdc/filterbar/PropertyHelper.js +6 -7
- package/src/sap/ui/mdc/filterbar/aligned/FilterContainer.js +2 -4
- package/src/sap/ui/mdc/filterbar/aligned/FilterItemLayout.js +0 -2
- package/src/sap/ui/mdc/filterbar/p13n/AdaptationFilterBar.js +13 -17
- package/src/sap/ui/mdc/filterbar/p13n/GroupContainer.js +1 -1
- package/src/sap/ui/mdc/filterbar/vh/FilterBar.js +1 -1
- package/src/sap/ui/mdc/flexibility/ActionToolbar.flexibility.js +16 -10
- package/src/sap/ui/mdc/flexibility/AggregateFlex.js +0 -21
- package/src/sap/ui/mdc/flexibility/Chart.flexibility.js +1 -1
- package/src/sap/ui/mdc/flexibility/ColumnFlex.js +0 -18
- package/src/sap/ui/mdc/flexibility/ConditionFlex.js +0 -15
- 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/GroupFlex.js +2 -22
- package/src/sap/ui/mdc/flexibility/ItemBaseFlex.js +1 -1
- package/src/sap/ui/mdc/flexibility/SortFlex.js +2 -21
- package/src/sap/ui/mdc/flexibility/Util.js +11 -9
- package/src/sap/ui/mdc/flp/FlpLinkDelegate.js +1 -1
- package/src/sap/ui/mdc/library.js +209 -48
- 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/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 +11 -2
- package/src/sap/ui/mdc/messagebundle_ar.properties +20 -15
- package/src/sap/ui/mdc/messagebundle_bg.properties +6 -1
- package/src/sap/ui/mdc/messagebundle_ca.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_cs.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_cy.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_da.properties +6 -1
- package/src/sap/ui/mdc/messagebundle_de.properties +7 -2
- package/src/sap/ui/mdc/messagebundle_el.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_en.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_en_GB.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_en_US_sappsd.properties +4 -1
- package/src/sap/ui/mdc/messagebundle_en_US_saprigi.properties +4 -1
- package/src/sap/ui/mdc/messagebundle_en_US_saptrc.properties +6 -1
- package/src/sap/ui/mdc/messagebundle_es.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_es_MX.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_et.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_fi.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_fr.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_fr_CA.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_hi.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_hr.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_hu.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_id.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_it.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_iw.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_ja.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_kk.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_ko.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_lt.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_lv.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_ms.properties +6 -1
- package/src/sap/ui/mdc/messagebundle_nl.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_no.properties +6 -1
- package/src/sap/ui/mdc/messagebundle_pl.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_pt.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_pt_PT.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_ro.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_ru.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_sh.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_sk.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_sl.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_sv.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_th.properties +11 -6
- package/src/sap/ui/mdc/messagebundle_tr.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_uk.properties +7 -2
- package/src/sap/ui/mdc/messagebundle_vi.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_zh_CN.properties +5 -0
- package/src/sap/ui/mdc/messagebundle_zh_TW.properties +5 -0
- package/src/sap/ui/mdc/mixin/AdaptationMixin.js +1 -1
- package/src/sap/ui/mdc/mixin/DelegateMixin.js +11 -4
- package/src/sap/ui/mdc/mixin/FilterIntegrationMixin.js +1 -1
- package/src/sap/ui/mdc/mixin/PromiseMixin.js +1 -1
- package/src/sap/ui/mdc/mixin/PropertyHelperMixin.js +1 -1
- package/src/sap/ui/mdc/odata/TypeMap.js +81 -0
- package/src/sap/ui/mdc/odata/v4/ChartDelegate.js +7 -2
- package/src/sap/ui/mdc/odata/v4/FieldBaseDelegate.js +7 -8
- package/src/sap/ui/mdc/odata/v4/TableDelegate.js +166 -19
- package/src/sap/ui/mdc/odata/v4/TypeMap.js +40 -0
- package/src/sap/ui/mdc/odata/v4/ValueHelpDelegate.js +8 -8
- package/src/sap/ui/mdc/odata/v4/vizChart/ChartDelegate.js +22 -50
- 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/AdaptFiltersPanel.js +4 -0
- package/src/sap/ui/mdc/p13n/panels/ChartItemPanel.js +12 -24
- package/src/sap/ui/mdc/p13n/panels/FilterPanel.js +1 -1
- package/src/sap/ui/mdc/table/Column.js +0 -8
- package/src/sap/ui/mdc/table/ColumnSettings.js +1 -1
- package/src/sap/ui/mdc/table/CreationRow.js +1 -1
- package/src/sap/ui/mdc/table/GridTableType.js +20 -100
- package/src/sap/ui/mdc/table/PropertyHelper.js +49 -1
- package/src/sap/ui/mdc/table/ResponsiveColumnSettings.js +1 -1
- package/src/sap/ui/mdc/table/ResponsiveTableType.js +18 -73
- package/src/sap/ui/mdc/table/RowActionItem.js +1 -1
- package/src/sap/ui/mdc/table/RowSettings.js +1 -1
- package/src/sap/ui/mdc/table/TableSettings.js +37 -131
- package/src/sap/ui/mdc/table/TableTypeBase.js +46 -5
- package/src/sap/ui/mdc/table/TreeTableType.js +11 -28
- package/src/sap/ui/mdc/table/V4AnalyticsPropertyHelper.js +1 -1
- package/src/sap/ui/mdc/table/menu/Item.js +1 -1
- package/src/sap/ui/mdc/table/menu/ItemContainer.js +4 -0
- package/src/sap/ui/mdc/table/menu/QuickActionContainer.js +12 -7
- package/src/sap/ui/mdc/table/utils/Personalization.js +236 -0
- package/src/sap/ui/mdc/themes/base/ValueHelpDialog.less +3 -3
- package/src/sap/ui/mdc/util/DateUtil.js +10 -6
- package/src/sap/ui/mdc/util/FilterUtil.js +3 -0
- package/src/sap/ui/mdc/util/InfoBar.js +2 -3
- package/src/sap/ui/mdc/util/PromiseCache.js +1 -1
- package/src/sap/ui/mdc/util/PropertyHelper.js +1 -1
- package/src/sap/ui/mdc/util/TypeMap.js +177 -0
- package/src/sap/ui/mdc/util/TypeUtilFactory.js +183 -0
- package/src/sap/ui/mdc/valuehelp/Dialog.js +6 -5
- package/src/sap/ui/mdc/valuehelp/Popover.js +3 -2
- package/src/sap/ui/mdc/valuehelp/base/Container.js +20 -2
- package/src/sap/ui/mdc/valuehelp/base/Content.js +6 -3
- package/src/sap/ui/mdc/{field → valuehelp/base}/DefineConditionPanel.js +51 -43
- package/src/sap/ui/mdc/valuehelp/base/DialogTab.js +1 -1
- package/src/sap/ui/mdc/valuehelp/base/FilterableListContent.js +12 -36
- package/src/sap/ui/mdc/valuehelp/base/ListContent.js +5 -2
- package/src/sap/ui/mdc/valuehelp/content/Bool.js +9 -9
- package/src/sap/ui/mdc/valuehelp/content/Conditions.js +21 -4
- package/src/sap/ui/mdc/valuehelp/content/FixedList.js +5 -4
- package/src/sap/ui/mdc/valuehelp/content/FixedListItem.js +63 -0
- package/src/sap/ui/mdc/valuehelp/content/MDCTable.js +4 -2
- package/src/sap/ui/mdc/valuehelp/content/MTable.js +8 -7
- package/test/sap/ui/mdc/testutils/opa/chart/AssertionsViz.js +4 -4
- package/test/sap/ui/mdc/testutils/opa/filterfield/Actions.js +3 -1
- package/test/sap/ui/mdc/testutils/opa/table/Actions.js +39 -66
- package/test/sap/ui/mdc/testutils/opa/valueHelp/doWait.js +1 -1
- package/src/sap/ui/mdc/designtime/p13n/PersistenceProvider.designtime.js +0 -21
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
|
+
* (c) Copyright 2009-2023 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
|
+
"sap/ui/core/library"
|
|
9
|
+
], function(
|
|
10
|
+
CoreLibrary
|
|
11
|
+
) {
|
|
12
|
+
"use strict";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* P13n utilities.
|
|
16
|
+
*
|
|
17
|
+
* @author SAP SE
|
|
18
|
+
* @version 1.114.0
|
|
19
|
+
* @namespace
|
|
20
|
+
* @alias sap.ui.mdc.table.utils.Personalization
|
|
21
|
+
* @private
|
|
22
|
+
*/
|
|
23
|
+
var PersonalizationUtils = {};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Checks whether a p13n UI, e.g. column header menu or settings dialog, is currently shown, or changes that the user has created with this UI
|
|
27
|
+
* are currently being applied.
|
|
28
|
+
*
|
|
29
|
+
* @param {sap.ui.mdc.Table} oTable The table that is personalized with the dialog.
|
|
30
|
+
* @returns {boolean} Whether user personalization is currently active.
|
|
31
|
+
*/
|
|
32
|
+
PersonalizationUtils.isUserPersonalizationActive = function(oTable) {
|
|
33
|
+
return oTable._bUserPersonalizationActive === true;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Begins observing user personalization via a column menu, including change appliance, to detect its completion.
|
|
38
|
+
* The state can be checked with {@link isUserPersonalizationActive}.
|
|
39
|
+
*
|
|
40
|
+
* @param {sap.ui.mdc.Table} oTable The table that is personalized with the column menu.
|
|
41
|
+
* @param {sap.m.table.columnmenu.Menu} oMenu The column menu to observe.
|
|
42
|
+
*/
|
|
43
|
+
PersonalizationUtils.detectUserPersonalizationCompletion = function(oTable, oMenu) {
|
|
44
|
+
if (!oMenu.isOpen()) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
oTable._bUserPersonalizationActive = true;
|
|
49
|
+
oMenu.attachEventOnce("afterClose", function() {
|
|
50
|
+
oTable.getEngine().waitForChanges(oTable).then(function() {
|
|
51
|
+
delete oTable._bUserPersonalizationActive;
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Opens the p13n dialog that contains all panels according to the p13n options enabled in the table.
|
|
58
|
+
* Detects the completion of user personalization. The state can be checked with {@link isUserPersonalizationActive}.
|
|
59
|
+
*
|
|
60
|
+
* @param {sap.ui.mdc.Table} oTable The table that is personalized with the dialog.
|
|
61
|
+
*/
|
|
62
|
+
PersonalizationUtils.openSettingsDialog = function(oTable) {
|
|
63
|
+
openP13nDialog(oTable, oTable.getActiveP13nModes());
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Opens the p13n dialog that contains only the filter panel.
|
|
68
|
+
* Detects the completion of user personalization. The state can be checked with {@link isUserPersonalizationActive}.
|
|
69
|
+
*
|
|
70
|
+
* @param {sap.ui.mdc.Table} oTable The table that is personalized with the dialog.
|
|
71
|
+
* @param {function} [fnOnClose] This callback is called after the filter dialog is closed.
|
|
72
|
+
* @returns {Promise<sap.m.ResponsivePopover | sap.m.Dialog>} A promise that resolves with the p13n dialog.
|
|
73
|
+
*/
|
|
74
|
+
PersonalizationUtils.openFilterDialog = function(oTable, fnOnClose) {
|
|
75
|
+
return openP13nDialog(oTable, ["Filter"], fnOnClose);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
function openP13nDialog(oTable, aPanelKeys, fnOnClose) {
|
|
79
|
+
return oTable.finalizePropertyHelper().then(function() {
|
|
80
|
+
var oEngine = oTable.getEngine();
|
|
81
|
+
|
|
82
|
+
if (oTable.getInbuiltFilter()) {
|
|
83
|
+
oTable.getInbuiltFilter().setVisibleFields(null);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return oEngine.uimanager.show(oTable, aPanelKeys, {
|
|
87
|
+
close: function() {
|
|
88
|
+
if (fnOnClose) {
|
|
89
|
+
fnOnClose();
|
|
90
|
+
}
|
|
91
|
+
oEngine.waitForChanges(oTable).then(function() {
|
|
92
|
+
delete oTable._bUserPersonalizationActive;
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}).then(function(oP13nControl) {
|
|
96
|
+
if (oP13nControl) {
|
|
97
|
+
// The promise resolves with a control instance only if the dialog is opened.
|
|
98
|
+
oTable._bUserPersonalizationActive = true;
|
|
99
|
+
}
|
|
100
|
+
return oP13nControl;
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Creates a sort change and applies it to the table. Current sorters are replaced, so the table is sorted according to this change only.
|
|
107
|
+
*
|
|
108
|
+
* @param {sap.ui.mdc.Table} oTable The table for which to create the change.
|
|
109
|
+
* @param {object} mSettings The change details.
|
|
110
|
+
* @param {string} mSettings.property The name of the property to sort, as specified in the <code>PropertyInfo</code>.
|
|
111
|
+
* @param {sap.ui.core.SortOrder} mSettings.sortOrder The sort order.
|
|
112
|
+
*/
|
|
113
|
+
PersonalizationUtils.createSortChange = function(oTable, mSettings) {
|
|
114
|
+
oTable.getEngine().createChanges({
|
|
115
|
+
control: oTable,
|
|
116
|
+
key: "Sort",
|
|
117
|
+
state: [{
|
|
118
|
+
name: mSettings.property,
|
|
119
|
+
descending: mSettings.sortOrder === CoreLibrary.SortOrder.Descending,
|
|
120
|
+
sorted: mSettings.sortOrder !== CoreLibrary.SortOrder.None
|
|
121
|
+
}],
|
|
122
|
+
applyAbsolute: true
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Creates a group change and applies it to the table. If the type of the table is <code>ResponsiveTable</code>, current groups are replaced,
|
|
128
|
+
* otherwise the change is added to the current state.
|
|
129
|
+
* It works like a switch. If the table is not grouped by this property, it will be grouped, otherwise it will be ungrouped.
|
|
130
|
+
*
|
|
131
|
+
* @param {sap.ui.mdc.Table} oTable The table for which to create the change.
|
|
132
|
+
* @param {object} mSettings The change details.
|
|
133
|
+
* @param {string} mSettings.property The name of the property to group, as specified in the <code>PropertyInfo</code>.
|
|
134
|
+
*/
|
|
135
|
+
PersonalizationUtils.createGroupChange = function(oTable, mSettings) {
|
|
136
|
+
var bIsGrouped = (oTable.getCurrentState().groupLevels || []).some(function(oProperty) {
|
|
137
|
+
return oProperty.name == mSettings.property;
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
oTable.getEngine().createChanges({
|
|
141
|
+
control: oTable,
|
|
142
|
+
key: "Group",
|
|
143
|
+
state: [{
|
|
144
|
+
grouped: !bIsGrouped,
|
|
145
|
+
name: mSettings.property
|
|
146
|
+
}],
|
|
147
|
+
applyAbsolute: oTable._isOfType("ResponsiveTable")
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Creates a filter change and applies it to the table.
|
|
153
|
+
*
|
|
154
|
+
* @param {sap.ui.mdc.Table} oTable The table for which to create the change.
|
|
155
|
+
* @param {object} mSettings The change details.
|
|
156
|
+
* @param {Array} mSettings.conditions The filter conditions that should be applied to the table.
|
|
157
|
+
* @param {sap.ui.mdc.enum.ProcessingStrategy|boolean} mSettings.strategy The processing strategy on how to apply the change.
|
|
158
|
+
*/
|
|
159
|
+
PersonalizationUtils.createFilterChange = function(oTable, mSettings) {
|
|
160
|
+
oTable.getEngine().createChanges({
|
|
161
|
+
control: oTable,
|
|
162
|
+
key: "Filter",
|
|
163
|
+
state: mSettings.conditions,
|
|
164
|
+
applyAbsolute: mSettings.strategy
|
|
165
|
+
});
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Creates an aggregate change and applies it to the table. The change is added to the current state.
|
|
170
|
+
* It works like a switch. If an aggregate does not exist for this property, it will be added, otherwise it will be removed.
|
|
171
|
+
*
|
|
172
|
+
* @param {sap.ui.mdc.Table} oTable The table for which to create the change.
|
|
173
|
+
* @param {object} mSettings The change details.
|
|
174
|
+
* @param {string} mSettings.property The name of the property to aggregate, as specified in the <code>PropertyInfo</code>.
|
|
175
|
+
*/
|
|
176
|
+
PersonalizationUtils.createAggregateChange = function(oTable, mSettings) {
|
|
177
|
+
var bHasAggregate = mSettings.property in (oTable.getCurrentState().aggregations || {});
|
|
178
|
+
|
|
179
|
+
oTable.getEngine().createChanges({
|
|
180
|
+
control: oTable,
|
|
181
|
+
key: "Aggregate",
|
|
182
|
+
state: [{
|
|
183
|
+
name: mSettings.property,
|
|
184
|
+
aggregated: !bHasAggregate
|
|
185
|
+
}],
|
|
186
|
+
applyAbsolute: false
|
|
187
|
+
});
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Creates a column width change and applies it to the table.
|
|
192
|
+
*
|
|
193
|
+
* @param {sap.ui.mdc.Table} oTable The table for which to create the change.
|
|
194
|
+
* @param {object} mSettings The change details.
|
|
195
|
+
* @param {sap.ui.mdc.table.Column} mSettings.column The column for which to create the change.
|
|
196
|
+
* @param {string} mSettings.width The new width of the column.
|
|
197
|
+
*/
|
|
198
|
+
PersonalizationUtils.createColumnWidthChange = function(oTable, mSettings) {
|
|
199
|
+
oTable.getEngine().createChanges({
|
|
200
|
+
control: oTable,
|
|
201
|
+
key: "ColumnWidth",
|
|
202
|
+
state: [{
|
|
203
|
+
name: mSettings.column.getDataProperty(),
|
|
204
|
+
width: mSettings.width
|
|
205
|
+
}],
|
|
206
|
+
applyAbsolute: false
|
|
207
|
+
});
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Creates a column reorder change and applies it to the table. If the column is already at that position, no change is created.
|
|
212
|
+
*
|
|
213
|
+
* @param {sap.ui.mdc.Table} oTable The table for which to create the change.
|
|
214
|
+
* @param {object} mSettings The change details.
|
|
215
|
+
* @param {sap.ui.mdc.table.Column} mSettings.column The column for which to create the change.
|
|
216
|
+
* @param {int} mSettings.index The new index of the column.
|
|
217
|
+
*/
|
|
218
|
+
PersonalizationUtils.createColumnReorderChange = function(oTable, mSettings) {
|
|
219
|
+
var iCurrentIndex = oTable.indexOfColumn(mSettings.column);
|
|
220
|
+
|
|
221
|
+
if (iCurrentIndex === mSettings.index) {
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
oTable.getEngine().createChanges({
|
|
226
|
+
control: oTable,
|
|
227
|
+
key: "Column",
|
|
228
|
+
state: [{
|
|
229
|
+
name: mSettings.column.getDataProperty(),
|
|
230
|
+
position: mSettings.index
|
|
231
|
+
}]
|
|
232
|
+
});
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
return PersonalizationUtils;
|
|
236
|
+
});
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
background-color: @sapUiBaseBG;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
.sapMdcTablePanel > .sapMPanelHdr,
|
|
30
|
-
.sapMdcTokenizerPanel > .sapMPanelHdr,
|
|
31
|
-
.sapMdcDefineconditionPanel > .sapMPanelHdr{
|
|
29
|
+
.sapMdcTablePanel > .sapMPanelHeadingDiv > .sapMPanelHdr,
|
|
30
|
+
.sapMdcTokenizerPanel > .sapMPanelHeadingDiv > .sapMPanelHdr,
|
|
31
|
+
.sapMdcDefineconditionPanel > .sapMPanelHeadingDiv > .sapMPanelHdr{
|
|
32
32
|
border: none;
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -135,9 +135,9 @@ sap.ui.define([
|
|
|
135
135
|
|
|
136
136
|
var oDate = this.typeToDate(vDate, oType, sBaseType);
|
|
137
137
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
138
|
+
if (oType.getFormatOptions().UTC) { // in UTC date we need to bring the local date to UTC
|
|
139
|
+
oDate = UI5Date.getInstance(Date.UTC(oDate.getFullYear(), oDate.getMonth(), oDate.getDate(), oDate.getHours(), oDate.getMinutes(), oDate.getSeconds(), oDate.getMilliseconds()));
|
|
140
|
+
}
|
|
141
141
|
|
|
142
142
|
return oDate.toISOString();
|
|
143
143
|
|
|
@@ -182,6 +182,8 @@ sap.ui.define([
|
|
|
182
182
|
|
|
183
183
|
if (oType.getModelValue) {
|
|
184
184
|
vDate = oType.getModelValue(oDate);
|
|
185
|
+
} else if (oType.isA("sap.ui.model.type.DateTime") && oType.getFormatOptions().UTC) { // old DateTime don't support UTC on ModelFormat
|
|
186
|
+
vDate = UI5Date.getInstance(Date.UTC(oDate.getFullYear(), oDate.getMonth(), oDate.getDate(), oDate.getHours(), oDate.getMinutes(), oDate.getSeconds(), oDate.getMilliseconds()));
|
|
185
187
|
} else { // older types don't support the new getModelValue
|
|
186
188
|
var oModelFormat = oType.getModelFormat();
|
|
187
189
|
var oFormatOptions = oType.getFormatOptions();
|
|
@@ -206,9 +208,11 @@ sap.ui.define([
|
|
|
206
208
|
typeToDate: function(vDate, oType, sBaseType) {
|
|
207
209
|
var oDate;
|
|
208
210
|
|
|
209
|
-
if (oType.
|
|
210
|
-
oDate =
|
|
211
|
-
} else {
|
|
211
|
+
if (oType.getDateValue) {
|
|
212
|
+
oDate = oType.getDateValue(vDate);
|
|
213
|
+
} else if (oType.isA("sap.ui.model.type.DateTime") && oType.getFormatOptions().UTC) { // old DateTime don't support UTC on ModelFormat
|
|
214
|
+
oDate = UI5Date.getInstance(vDate.getUTCFullYear(), vDate.getUTCMonth(), vDate.getUTCDate(), vDate.getUTCHours(), vDate.getUTCMinutes(), vDate.getUTCSeconds(), vDate.getUTCMilliseconds());
|
|
215
|
+
} else { // older types don't support the new getDateValue
|
|
212
216
|
var oModelFormat = oType.getModelFormat();
|
|
213
217
|
var oFormatOptions = oType.getFormatOptions();
|
|
214
218
|
var bUTC = sBaseType === BaseType.DateTime ? !!oFormatOptions.UTC : false;
|
|
@@ -17,6 +17,7 @@ sap.ui.define(['sap/ui/mdc/util/IdentifierUtil', 'sap/ui/mdc/enum/ConditionValid
|
|
|
17
17
|
* @namespace
|
|
18
18
|
* @private
|
|
19
19
|
* @ui5-restricted sap.ui.mdc, sap.fe
|
|
20
|
+
* @MDC_PUBLIC_CANDIDATE
|
|
20
21
|
* @since 1.80.0
|
|
21
22
|
* @alias sap.ui.mdc.util.FilterUtil
|
|
22
23
|
*/
|
|
@@ -30,6 +31,7 @@ sap.ui.define(['sap/ui/mdc/util/IdentifierUtil', 'sap/ui/mdc/enum/ConditionValid
|
|
|
30
31
|
* @returns {object} PropertyInfo object for a given name, or <code>null</code>
|
|
31
32
|
* @private
|
|
32
33
|
* @ui5-restricted sap.ui.mdc, sap.fe
|
|
34
|
+
* @MDC_PUBLIC_CANDIDATE
|
|
33
35
|
*/
|
|
34
36
|
getPropertyByKey : function(aPropertiesMetadata, sKey) {
|
|
35
37
|
var oPropertyInfo = null;
|
|
@@ -115,6 +117,7 @@ sap.ui.define(['sap/ui/mdc/util/IdentifierUtil', 'sap/ui/mdc/enum/ConditionValid
|
|
|
115
117
|
* @returns {object} Object with filters
|
|
116
118
|
* @private
|
|
117
119
|
* @ui5-restricted sap.ui.mdc
|
|
120
|
+
* @MDC_PUBLIC_CANDIDATE
|
|
118
121
|
*/
|
|
119
122
|
getFilterInfo: function(vTypeProvider, mConditions, aPropertiesMetadata, aIgnoreProperties) {
|
|
120
123
|
|
|
@@ -23,12 +23,11 @@ sap.ui.define([
|
|
|
23
23
|
* @class The <code>InfoBar</code> control provides an easy way of displaying filter information inside an <code>sap.ui.mdc.Chart</code> and an <code>sap.ui.mdc.Table</code>.
|
|
24
24
|
* @extends sap.ui.core.Control
|
|
25
25
|
* @author SAP SE
|
|
26
|
-
* @version 1.
|
|
26
|
+
* @version 1.114.0
|
|
27
27
|
* @constructor
|
|
28
28
|
* @experimental As of version 1.111
|
|
29
29
|
* @private
|
|
30
30
|
* @ui5-restricted sap.ui.mdc
|
|
31
|
-
* @MDC_PUBLIC_CANDIDATE
|
|
32
31
|
* @since 1.111.0
|
|
33
32
|
* @alias sap.ui.mdc.util.InfoBar
|
|
34
33
|
*/
|
|
@@ -71,7 +70,6 @@ sap.ui.define([
|
|
|
71
70
|
renderer: InfoBarRenderer
|
|
72
71
|
});
|
|
73
72
|
|
|
74
|
-
|
|
75
73
|
InfoBar.prototype.applySettings = function () {
|
|
76
74
|
Control.prototype.applySettings.apply(this, arguments);
|
|
77
75
|
|
|
@@ -85,6 +83,7 @@ sap.ui.define([
|
|
|
85
83
|
this.oInvisibleText = new InvisibleText().toStatic();
|
|
86
84
|
|
|
87
85
|
this.oRemoveAllFiltersBtn = new Button(this.getId() + "-RemoveAllFilters", {
|
|
86
|
+
type: mLibrary.ButtonType.Transparent,
|
|
88
87
|
press: function (oEvent) {
|
|
89
88
|
this.fireRemoveAllFilters();
|
|
90
89
|
// TODO this.oInvisibleMessage.announce(oMessageBundle.getText("valuehelp.REMOVEALLTOKEN_ANNOUNCE"), InvisibleMessageMode.Polite);
|
|
@@ -45,7 +45,7 @@ sap.ui.define(
|
|
|
45
45
|
* Destroying the cache will cancel all registered promises and delete references. Convenience methods for promise creation, wrapping and replacement are offered.
|
|
46
46
|
*
|
|
47
47
|
* @author SAP SE
|
|
48
|
-
* @version 1.
|
|
48
|
+
* @version 1.114.0
|
|
49
49
|
* @alias sap.ui.mdc.util.PromiseCache
|
|
50
50
|
* @since 1.85.0
|
|
51
51
|
* @private
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
|
+
* (c) Copyright 2009-2023 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
|
+
], function(
|
|
9
|
+
) {
|
|
10
|
+
"use strict";
|
|
11
|
+
|
|
12
|
+
var _cache = new WeakMap(); // We do not want to share Maps with derived TypeMaps
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Configuration class for type-handling in MDC delegates.
|
|
16
|
+
* Allows mapping of model-types to <code>sap.ui.mdc.enum.BaseType</code> and enables model-specific type configuration.
|
|
17
|
+
*
|
|
18
|
+
* <b>Note:</b>
|
|
19
|
+
* This utility is experimental and the API/behavior is not finalized and hence this should not be used for productive usage.
|
|
20
|
+
*
|
|
21
|
+
* @namespace
|
|
22
|
+
* @author SAP SE
|
|
23
|
+
* @private
|
|
24
|
+
* @ui5-restricted sap.fe
|
|
25
|
+
* @experimental As of version 1.114.0
|
|
26
|
+
* @MDC_PUBLIC_CANDIDATE
|
|
27
|
+
* @since 1.114.0
|
|
28
|
+
* @alias sap.ui.mdc.util.TypeMap
|
|
29
|
+
*/
|
|
30
|
+
var TypeMap = {};
|
|
31
|
+
|
|
32
|
+
/*
|
|
33
|
+
* Gets values of the internal map, treating string values as references to other keys (aliases)
|
|
34
|
+
*/
|
|
35
|
+
TypeMap._get = function (sType) {
|
|
36
|
+
var vEntry = this._getMap().get(sType);
|
|
37
|
+
if (typeof vEntry === "string") {
|
|
38
|
+
return this._get(vEntry);
|
|
39
|
+
} else if (vEntry) {
|
|
40
|
+
return [sType, vEntry];
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/*
|
|
45
|
+
* Updates the internal map's values, if not suppressed by TypeMap.freeze()
|
|
46
|
+
*/
|
|
47
|
+
TypeMap._set = function (sKey, vValue) {
|
|
48
|
+
var oMap = this._getMap();
|
|
49
|
+
if (oMap._bFrozen) {
|
|
50
|
+
throw "TypeMap: You must not modify a frozen TypeMap";
|
|
51
|
+
}
|
|
52
|
+
oMap.set(sKey, vValue);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/*
|
|
56
|
+
* As derived typemaps want to act as singletons with separate data-sets, we provide a context based cache for each map's internal data.
|
|
57
|
+
* Please also see <code>sap.ui.mdc.util.TypeMap.import</code>
|
|
58
|
+
*/
|
|
59
|
+
TypeMap._getMap = function () {
|
|
60
|
+
var oMap = _cache.get(this);
|
|
61
|
+
if (!oMap) {
|
|
62
|
+
oMap = new Map();
|
|
63
|
+
_cache.set(this, oMap);
|
|
64
|
+
}
|
|
65
|
+
return oMap;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Sets a BaseType and an optional model- or scenario-specific configuration method for a given sap.ui.model.SimpleType ObjectPath string
|
|
70
|
+
*
|
|
71
|
+
* As default <code>string</code> is returned.
|
|
72
|
+
*
|
|
73
|
+
* @param {string} sType Objectpath string for sap.ui.model.SimpleType
|
|
74
|
+
* @param {sap.ui.mdc.enum.BaseType|function} vBaseType BaseType fitting the given sType or method returning a BaseType based on type configuration
|
|
75
|
+
* @param {function} [fnOptions] Optional customizing method for formatoptions and constraints. See <code>sap.ui.mdc.DefaultTypeMap</code> for examples.
|
|
76
|
+
* @private
|
|
77
|
+
* @ui5-restricted sap.fe
|
|
78
|
+
* @MDC_PUBLIC_CANDIDATE
|
|
79
|
+
*/
|
|
80
|
+
TypeMap.set = function (sType, vBaseType, fnOptions) {
|
|
81
|
+
this._set(sType, [vBaseType, fnOptions]);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Allows alternative identifiers for Types, such as "Boolean" for "sap.ui.model.type.Boolean"
|
|
86
|
+
*
|
|
87
|
+
* @param {string} sType Objectpath string for sap.ui.model.SimpleType
|
|
88
|
+
* @param {string} sAlias Alternative identifier for sType
|
|
89
|
+
* @private
|
|
90
|
+
* @ui5-restricted sap.fe
|
|
91
|
+
* @MDC_PUBLIC_CANDIDATE
|
|
92
|
+
*/
|
|
93
|
+
TypeMap.setAlias = function (sType, sAlias) {
|
|
94
|
+
this._set(sType, sAlias);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Returns the <code>sap.ui.mdc.enum.BaseType</code> or a method to resolve the BaseType dynamically for the given type
|
|
99
|
+
*
|
|
100
|
+
* @param {string} sType Objectpath string for sap.ui.model.SimpleType
|
|
101
|
+
* @returns {sap.ui.mdc.enum.BaseType|function} BaseType configured for the sap.ui.model.SimpleType or function to resolve BaseType based on configuration
|
|
102
|
+
* @private
|
|
103
|
+
* @ui5-restricted sap.fe
|
|
104
|
+
* @MDC_PUBLIC_CANDIDATE
|
|
105
|
+
*/
|
|
106
|
+
TypeMap.getBaseType = function (sType) {
|
|
107
|
+
var aResult = this._get(sType);
|
|
108
|
+
return aResult && aResult[1][0];
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Returns the option customizing method configured for a sap.ui.model.SimpleType
|
|
113
|
+
*
|
|
114
|
+
* @param {string} sType Objectpath string for sap.ui.model.SimpleType
|
|
115
|
+
* @returns {function} Method for model-specific type configuration. See <code>sap.ui.mdc.DefaultTypeMap</code> for examples.
|
|
116
|
+
* @private
|
|
117
|
+
* @ui5-restricted sap.fe
|
|
118
|
+
* @MDC_PUBLIC_CANDIDATE
|
|
119
|
+
*/
|
|
120
|
+
TypeMap.getOptions = function (sType) {
|
|
121
|
+
var aResult = this._get(sType);
|
|
122
|
+
return aResult && aResult[1][1];
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Returns the ObjectPath string for a given type alias.
|
|
127
|
+
*
|
|
128
|
+
* @param {string} sAlias Identifier for a configured Type Alias
|
|
129
|
+
* @returns {string} Objectpath string for sap.ui.model.SimpleType
|
|
130
|
+
* @private
|
|
131
|
+
* @ui5-restricted sap.fe
|
|
132
|
+
* @MDC_PUBLIC_CANDIDATE
|
|
133
|
+
*/
|
|
134
|
+
TypeMap.getClass = function (sAlias) {
|
|
135
|
+
var aResult = this._get(sAlias);
|
|
136
|
+
return aResult && aResult[0];
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Exports the TypeMap's current data
|
|
141
|
+
*
|
|
142
|
+
* @returns {Array} Array created from this TypeMap's internal map
|
|
143
|
+
* @private
|
|
144
|
+
* @ui5-restricted sap.fe
|
|
145
|
+
* @MDC_PUBLIC_CANDIDATE
|
|
146
|
+
*/
|
|
147
|
+
TypeMap.export = function () {
|
|
148
|
+
return Array.from(this._getMap());
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Imports a TypeMap's data into another TypeMap
|
|
153
|
+
*
|
|
154
|
+
* @param {sap.ui.mdc.util.TypeMap} oTypeMap TypeMap to import
|
|
155
|
+
* @private
|
|
156
|
+
* @ui5-restricted sap.fe
|
|
157
|
+
* @MDC_PUBLIC_CANDIDATE
|
|
158
|
+
*/
|
|
159
|
+
TypeMap.import = function (oTypeMap) {
|
|
160
|
+
oTypeMap.export().forEach(function (aEntry) {
|
|
161
|
+
this._getMap().set(aEntry[0], aEntry[1]);
|
|
162
|
+
}.bind(this));
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Prevents further manipulation of a TypeMap's data
|
|
167
|
+
*
|
|
168
|
+
* @private
|
|
169
|
+
* @ui5-restricted sap.fe
|
|
170
|
+
* @MDC_PUBLIC_CANDIDATE
|
|
171
|
+
*/
|
|
172
|
+
TypeMap.freeze = function () {
|
|
173
|
+
this._getMap()._bFrozen = true;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
return TypeMap;
|
|
177
|
+
});
|