@openui5/sap.ui.mdc 1.99.0 → 1.100.1
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 +2 -2
- 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 +50 -32
- package/src/sap/ui/mdc/ChartDelegate.js +66 -21
- package/src/sap/ui/mdc/ChartRenderer.js +1 -1
- package/src/sap/ui/mdc/Control.js +11 -6
- package/src/sap/ui/mdc/Element.js +10 -6
- package/src/sap/ui/mdc/Field.js +19 -4
- package/src/sap/ui/mdc/FilterBar.js +1 -1
- package/src/sap/ui/mdc/FilterBarDelegate.js +26 -0
- package/src/sap/ui/mdc/FilterField.js +41 -3
- package/src/sap/ui/mdc/Link.js +3 -3
- package/src/sap/ui/mdc/MultiValueField.js +11 -1
- package/src/sap/ui/mdc/Table.js +73 -39
- package/src/sap/ui/mdc/TableDelegate.js +28 -1
- package/src/sap/ui/mdc/ValueHelp.js +8 -3
- package/src/sap/ui/mdc/ValueHelpDelegate.js +2 -1
- package/src/sap/ui/mdc/actiontoolbar/ActionToolbarAction.js +1 -1
- package/src/sap/ui/mdc/actiontoolbar/ActionToolbarActionRenderer.js +1 -1
- package/src/sap/ui/mdc/chart/ChartSelectionDetails.js +1 -1
- package/src/sap/ui/mdc/chart/ChartToolbar.js +13 -6
- package/src/sap/ui/mdc/chart/DrillBreadcrumbs.js +7 -7
- package/src/sap/ui/mdc/chart/DrillStackHandler.js +6 -6
- package/src/sap/ui/mdc/chart/PropertyHelper.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 +4 -2
- package/src/sap/ui/mdc/condition/FilterOperatorUtil.js +133 -25
- package/src/sap/ui/mdc/condition/Operator.js +4 -2
- package/src/sap/ui/mdc/condition/OperatorDynamicDateOption.js +78 -24
- package/src/sap/ui/mdc/condition/RangeOperator.js +5 -5
- package/src/sap/ui/mdc/designtime/Util.js +63 -0
- package/src/sap/ui/mdc/designtime/actiontoolbar/ActionToolbar.designtime.js +23 -30
- package/src/sap/ui/mdc/designtime/chart/Chart.designtime.js +3 -0
- package/src/sap/ui/mdc/designtime/link/PanelItem.designtime.js +3 -1
- package/src/sap/ui/mdc/designtime/table/Table.designtime.js +39 -52
- 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 +15 -4
- 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 +16 -5
- package/src/sap/ui/mdc/field/DynamicDateRangeConditionsType.js +76 -19
- package/src/sap/ui/mdc/field/FieldBase.js +62 -11
- package/src/sap/ui/mdc/field/FieldBaseDelegate.js +1 -1
- package/src/sap/ui/mdc/field/FieldHelpBase.js +1 -1
- package/src/sap/ui/mdc/field/FieldInfoBase.js +2 -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 +4 -1
- package/src/sap/ui/mdc/field/FieldValueHelpContentWrapperBase.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelpDelegate.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelpMTableWrapper.js +5 -4
- package/src/sap/ui/mdc/field/FieldValueHelpMdcTableWrapper.js +5 -3
- package/src/sap/ui/mdc/field/FieldValueHelpTableWrapperBase.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelpUITableWrapper.js +7 -7
- 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/TokenDisplay.js +1 -1
- package/src/sap/ui/mdc/field/TokenizerDisplay.js +1 -1
- package/src/sap/ui/mdc/field/ValueHelpPanel.js +1 -1
- package/src/sap/ui/mdc/field/content/ContentFactory.js +5 -1
- package/src/sap/ui/mdc/field/content/DateContent.js +27 -19
- package/src/sap/ui/mdc/field/content/DateTimeContent.js +0 -6
- package/src/sap/ui/mdc/filterbar/FilterBarBase.js +76 -208
- package/src/sap/ui/mdc/filterbar/PropertyHelper.js +27 -2
- package/src/sap/ui/mdc/filterbar/p13n/AdaptationFilterBar.js +127 -57
- package/src/sap/ui/mdc/filterbar/p13n/FilterColumnLayout.js +2 -2
- package/src/sap/ui/mdc/filterbar/p13n/GroupContainer.js +7 -3
- package/src/sap/ui/mdc/filterbar/p13n/TableContainer.js +52 -14
- package/src/sap/ui/mdc/filterbar/vh/FilterBar.js +37 -19
- package/src/sap/ui/mdc/filterbar/vh/FilterContainer.js +1 -1
- package/src/sap/ui/mdc/flexibility/AggregationConfigFlex.js +48 -31
- package/src/sap/ui/mdc/flexibility/Chart.flexibility.js +1 -1
- package/src/sap/ui/mdc/flexibility/ChartItemFlex.js +36 -0
- package/src/sap/ui/mdc/flexibility/ConditionFlex.js +47 -10
- 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 +0 -1
- package/src/sap/ui/mdc/flexibility/PropertyInfoFlex.js +2 -85
- package/src/sap/ui/mdc/library.js +11 -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/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 +2 -1
- package/src/sap/ui/mdc/mixin/AdaptationMixin.js +20 -19
- package/src/sap/ui/mdc/mixin/DelegateMixin.js +1 -141
- package/src/sap/ui/mdc/mixin/FilterIntegrationMixin.js +1 -9
- package/src/sap/ui/mdc/mixin/PromiseMixin.js +1 -1
- package/src/sap/ui/mdc/mixin/PropertyHelperMixin.js +348 -0
- package/src/sap/ui/mdc/odata/TypeUtil.js +1 -1
- package/src/sap/ui/mdc/odata/v4/ChartPropertyHelper.js +70 -3
- package/src/sap/ui/mdc/odata/v4/FilterBarDelegate.js +116 -20
- package/src/sap/ui/mdc/odata/v4/ODataMetaModelUtil.js +2 -2
- package/src/sap/ui/mdc/odata/v4/TableDelegate.js +11 -33
- package/src/sap/ui/mdc/odata/v4/TypeUtil.js +2 -4
- package/src/sap/ui/mdc/odata/v4/ValueHelpDelegate.js +1 -1
- package/src/sap/ui/mdc/odata/v4/vizChart/ChartDelegate.js +281 -263
- package/src/sap/ui/mdc/p13n/AdaptationProvider.js +1 -1
- package/src/sap/ui/mdc/p13n/Engine.js +21 -18
- package/src/sap/ui/mdc/p13n/FlexUtil.js +0 -5
- package/src/sap/ui/mdc/p13n/PropertyHelper.js +2 -2
- package/src/sap/ui/mdc/p13n/StateUtil.js +4 -0
- package/src/sap/ui/mdc/p13n/UIManager.js +16 -13
- package/src/sap/ui/mdc/p13n/modification/ModificationHandler.js +18 -14
- package/src/sap/ui/mdc/p13n/modules/DefaultProviderRegistry.js +1 -1
- package/src/sap/ui/mdc/p13n/panels/ActionToolbarPanel.js +6 -6
- package/src/sap/ui/mdc/p13n/panels/AdaptFiltersPanel.js +49 -27
- package/src/sap/ui/mdc/p13n/panels/ChartItemPanel.js +4 -3
- package/src/sap/ui/mdc/p13n/panels/FilterPanel.js +136 -0
- package/src/sap/ui/mdc/p13n/panels/GroupView.js +53 -28
- package/src/sap/ui/mdc/p13n/panels/LinkSelectionPanel.js +54 -18
- package/src/sap/ui/mdc/p13n/subcontroller/ActionToolbarController.js +4 -7
- package/src/sap/ui/mdc/p13n/subcontroller/AdaptFiltersController.js +1 -2
- package/src/sap/ui/mdc/p13n/subcontroller/BaseController.js +1 -1
- package/src/sap/ui/mdc/p13n/subcontroller/FilterController.js +8 -4
- package/src/sap/ui/mdc/p13n/subcontroller/LinkPanelController.js +1 -0
- package/src/sap/ui/mdc/p13n/subcontroller/SortController.js +2 -2
- package/src/sap/ui/mdc/table/CreationRow.js +1 -1
- package/src/sap/ui/mdc/table/GridTableType.js +75 -27
- package/src/sap/ui/mdc/table/PropertyHelper.js +20 -13
- package/src/sap/ui/mdc/table/ResponsiveTableType.js +86 -13
- package/src/sap/ui/mdc/table/RowActionItem.js +119 -0
- package/src/sap/ui/mdc/table/RowSettings.js +42 -1
- package/src/sap/ui/mdc/table/V4AnalyticsPropertyHelper.js +2 -2
- package/src/sap/ui/mdc/themes/base/Chart.less +2 -0
- package/src/sap/ui/mdc/themes/base/ValueHelpDialog.less +1 -0
- package/src/sap/ui/mdc/util/DateUtil.js +32 -7
- package/src/sap/ui/mdc/util/FilterUtil.js +1 -1
- package/src/sap/ui/mdc/util/PromiseCache.js +1 -1
- package/src/sap/ui/mdc/util/PropertyHelper.js +201 -76
- package/src/sap/ui/mdc/util/TypeUtil.js +1 -1
- package/src/sap/ui/mdc/valuehelp/Dialog.js +1 -1
- package/src/sap/ui/mdc/valuehelp/Popover.js +5 -3
- package/src/sap/ui/mdc/valuehelp/base/Container.js +1 -1
- package/src/sap/ui/mdc/valuehelp/base/Content.js +1 -1
- package/src/sap/ui/mdc/valuehelp/base/DialogTab.js +1 -1
- package/src/sap/ui/mdc/valuehelp/base/FilterableListContent.js +4 -4
- package/src/sap/ui/mdc/valuehelp/base/ListContent.js +1 -1
- package/src/sap/ui/mdc/valuehelp/content/Bool.js +1 -1
- package/src/sap/ui/mdc/valuehelp/content/Conditions.js +1 -1
- package/src/sap/ui/mdc/valuehelp/content/FixedList.js +13 -10
- package/src/sap/ui/mdc/valuehelp/content/MDCTable.js +4 -10
- package/src/sap/ui/mdc/valuehelp/content/MTable.js +6 -4
- package/test/sap/ui/mdc/testutils/opa/chart/TestObjects.js +2 -0
- package/test/sap/ui/mdc/testutils/opa/filterbar/TestObjects.js +0 -1
- package/test/sap/ui/mdc/testutils/opa/p13n/Actions.js +8 -6
- package/src/sap/ui/mdc/filterbar/vh/GenericFilterBarDelegate.js +0 -150
- package/src/sap/ui/mdc/p13n/panels/BasePanel.js +0 -721
- package/src/sap/ui/mdc/p13n/panels/ListView.js +0 -408
- package/src/sap/ui/mdc/p13n/panels/SelectionPanel.js +0 -92
- package/src/sap/ui/mdc/p13n/panels/SortPanel.js +0 -150
- package/src/sap/ui/mdc/ui/Container.js +0 -240
- package/src/sap/ui/mdc/ui/ContainerItem.js +0 -79
|
@@ -1,721 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* ! OpenUI5
|
|
3
|
-
* (c) Copyright 2009-2022 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/m/VBox', 'sap/ui/core/Control', 'sap/m/Column', 'sap/m/Text', 'sap/ui/model/Filter', "sap/m/Table", "sap/m/OverflowToolbar", "sap/m/SearchField", "sap/m/ToolbarSpacer", "sap/m/OverflowToolbarButton", "sap/m/OverflowToolbarLayoutData", "sap/m/Button", "sap/ui/core/dnd/DragDropInfo"
|
|
9
|
-
], function(VBox, Control, Column, Text, Filter, Table, OverflowToolbar, SearchField, ToolbarSpacer, OverflowToolbarButton, OverflowToolbarLayoutData, Button, DragDropInfo) {
|
|
10
|
-
"use strict";
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Constructor for BasePanel.
|
|
14
|
-
*
|
|
15
|
-
* @param {string} [sId] ID for the new control, generated automatically if no ID is given
|
|
16
|
-
* @param {object} [mSettings] initial settings for the new control
|
|
17
|
-
* @class TODO
|
|
18
|
-
* <h3><b>Note:</b></h3>
|
|
19
|
-
* The control is experimental and the API/behaviour is not finalised and hence this should not be used for productive usage.
|
|
20
|
-
* @extends sap.ui.core.Control
|
|
21
|
-
* @author SAP SE
|
|
22
|
-
* @private
|
|
23
|
-
* @experimental
|
|
24
|
-
* @since 1.66
|
|
25
|
-
* @alias sap.ui.mdc.p13n.panels.BasePanel
|
|
26
|
-
* @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
var BasePanel = Control.extend("sap.ui.mdc.p13n.panels.BasePanel", {
|
|
30
|
-
metadata: {
|
|
31
|
-
library: "sap.ui.mdc",
|
|
32
|
-
associations: {},
|
|
33
|
-
defaultAggregation: "items",
|
|
34
|
-
properties: {
|
|
35
|
-
/**
|
|
36
|
-
* Determines whether the reordering of items should be enabled
|
|
37
|
-
*/
|
|
38
|
-
enableReorder: {
|
|
39
|
-
type: "boolean",
|
|
40
|
-
defaultValue: true
|
|
41
|
-
},
|
|
42
|
-
/**
|
|
43
|
-
* Factory function which can be used to enhance custom content
|
|
44
|
-
*/
|
|
45
|
-
itemFactory: {
|
|
46
|
-
type: "function"
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
aggregations: {
|
|
50
|
-
/**
|
|
51
|
-
* Content to be set for the <code>BasePanel</code>.
|
|
52
|
-
*/
|
|
53
|
-
_content: {
|
|
54
|
-
type: "sap.ui.core.Control",
|
|
55
|
-
multiple: false,
|
|
56
|
-
visibility: "hidden"
|
|
57
|
-
},
|
|
58
|
-
/**
|
|
59
|
-
* This template is going to be set from the implementing panel using the <code>BasePanel</code> control, by setting the template
|
|
60
|
-
* for the columns of the inner <code>sap.m.Table</code>.
|
|
61
|
-
*/
|
|
62
|
-
template: {
|
|
63
|
-
type: "sap.ui.core.Control",
|
|
64
|
-
multiple: false
|
|
65
|
-
},
|
|
66
|
-
/**
|
|
67
|
-
* Defines an optional message strip to be displayed in the content area
|
|
68
|
-
*/
|
|
69
|
-
messageStrip: {
|
|
70
|
-
type: "sap.m.MessageStrip",
|
|
71
|
-
multiple: false
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
events: {
|
|
75
|
-
/**
|
|
76
|
-
* This event is fired if there has been made any change within the <code>BasePanel</code> control.
|
|
77
|
-
*/
|
|
78
|
-
change: {
|
|
79
|
-
/**
|
|
80
|
-
* Reason for the change (e.g. Add, Remove, Move, SelectAll, DeselectAll)
|
|
81
|
-
*/
|
|
82
|
-
reason: {
|
|
83
|
-
type: "string"
|
|
84
|
-
},
|
|
85
|
-
/**
|
|
86
|
-
* The affected item (Note: this may only provided in case one item is affected)
|
|
87
|
-
*/
|
|
88
|
-
item: {
|
|
89
|
-
type: "object"
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
renderer: {
|
|
95
|
-
apiVersion: 2,
|
|
96
|
-
render: function(oRm, oControl) {
|
|
97
|
-
oRm.openStart("div", oControl);
|
|
98
|
-
oRm.style("height", "100%");
|
|
99
|
-
oRm.openEnd();
|
|
100
|
-
oRm.renderControl(oControl.getAggregation("_content"));
|
|
101
|
-
oRm.close("div");
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
BasePanel.prototype.P13N_MODEL = "$p13n";
|
|
108
|
-
|
|
109
|
-
BasePanel.prototype.init = function() {
|
|
110
|
-
|
|
111
|
-
Control.prototype.init.apply(this, arguments);
|
|
112
|
-
|
|
113
|
-
// list is necessary to set the template + model on
|
|
114
|
-
this._oListControl = this._createInnerListControl();
|
|
115
|
-
|
|
116
|
-
// disable 'select all'
|
|
117
|
-
this._oListControl.setMultiSelectMode("ClearAll");
|
|
118
|
-
|
|
119
|
-
this._setInnerLayout();
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Can be overwritten in case a different wrapping Control is required for the inner content
|
|
124
|
-
*/
|
|
125
|
-
BasePanel.prototype._setInnerLayout = function() {
|
|
126
|
-
this.setAggregation("_content", new VBox({
|
|
127
|
-
items: [
|
|
128
|
-
this._oListControl
|
|
129
|
-
]
|
|
130
|
-
}));
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Displays a MessageStrip instance between the title and content area of the <code>BasePanel</code>.
|
|
135
|
-
*
|
|
136
|
-
* @param {sap.m.MessageStrip} oStrip Instance of a sap.m.MessageStrip
|
|
137
|
-
*/
|
|
138
|
-
BasePanel.prototype.setMessageStrip = function(oStrip){
|
|
139
|
-
if (!oStrip) {
|
|
140
|
-
this.getAggregation("_content").removeItem(this._oMessageStrip);
|
|
141
|
-
this._oMessageStrip = null;
|
|
142
|
-
} else {
|
|
143
|
-
if (this._oMessageStrip) {
|
|
144
|
-
this._oMessageStrip.destroy();
|
|
145
|
-
}
|
|
146
|
-
this._oMessageStrip = oStrip;
|
|
147
|
-
this.getAggregation("_content").insertItem(oStrip, 0);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
return this;
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
BasePanel.prototype._getDragDropConfig = function() {
|
|
154
|
-
if (!this._oDragDropInfo){
|
|
155
|
-
this._oDragDropInfo = new DragDropInfo({
|
|
156
|
-
enabled: false,
|
|
157
|
-
sourceAggregation: "items",
|
|
158
|
-
targetAggregation: "items",
|
|
159
|
-
dropPosition: "Between",
|
|
160
|
-
drop: [this._onRearrange, this]
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
return this._oDragDropInfo;
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
BasePanel.prototype._getMoveTopButton = function() {
|
|
167
|
-
if (!this._oMoveTopBtn) {
|
|
168
|
-
this._oMoveTopBtn = new OverflowToolbarButton(this.getId() + "-moveTopBtn",{
|
|
169
|
-
type: "Transparent",
|
|
170
|
-
tooltip: this.getResourceText("p13nDialog.MOVE_TO_TOP"),
|
|
171
|
-
icon: "sap-icon://collapse-group",
|
|
172
|
-
press: [this._onPressButtonMoveToTop, this],
|
|
173
|
-
visible: false,
|
|
174
|
-
layoutData: new OverflowToolbarLayoutData({
|
|
175
|
-
moveToOverflow: true,
|
|
176
|
-
priority: "Low",
|
|
177
|
-
group: 2
|
|
178
|
-
})
|
|
179
|
-
});
|
|
180
|
-
this.addDependent(this._oMoveTopBtn);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
return this._oMoveTopBtn;
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
BasePanel.prototype.getItems = function() {
|
|
187
|
-
return this._oListControl.getItems();
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
BasePanel.prototype._getMoveUpButton = function() {
|
|
191
|
-
if (!this._oMoveUpButton) {
|
|
192
|
-
this._oMoveUpButton = new OverflowToolbarButton(this.getId() + "-moveUpBtn",{
|
|
193
|
-
type: "Transparent",
|
|
194
|
-
tooltip: this.getResourceText("p13nDialog.MOVE_UP"),
|
|
195
|
-
icon: "sap-icon://navigation-up-arrow",
|
|
196
|
-
press: [this._onPressButtonMoveUp, this],
|
|
197
|
-
visible: false,
|
|
198
|
-
layoutData: new OverflowToolbarLayoutData({
|
|
199
|
-
moveToOverflow: true,
|
|
200
|
-
priority: "High",
|
|
201
|
-
group: 1
|
|
202
|
-
})
|
|
203
|
-
});
|
|
204
|
-
this.addDependent(this._oMoveUpButton);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
return this._oMoveUpButton;
|
|
208
|
-
};
|
|
209
|
-
|
|
210
|
-
BasePanel.prototype._getMoveDownButton = function() {
|
|
211
|
-
if (!this._oMoveDownButton) {
|
|
212
|
-
this._oMoveDownButton = new OverflowToolbarButton(this.getId() + "-moveDownpBtn",{
|
|
213
|
-
type: "Transparent",
|
|
214
|
-
tooltip: this.getResourceText("p13nDialog.MOVE_DOWN"),
|
|
215
|
-
icon: "sap-icon://navigation-down-arrow",
|
|
216
|
-
press: [this._onPressButtonMoveDown, this],
|
|
217
|
-
visible: false,
|
|
218
|
-
layoutData: new OverflowToolbarLayoutData({
|
|
219
|
-
moveToOverflow: true,
|
|
220
|
-
priority: "High",
|
|
221
|
-
group: 1
|
|
222
|
-
})
|
|
223
|
-
});
|
|
224
|
-
this.addDependent(this._oMoveDownButton);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
return this._oMoveDownButton;
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
BasePanel.prototype._getMoveBottomButton = function() {
|
|
231
|
-
if (!this._oMoveBottomButton) {
|
|
232
|
-
this._oMoveBottomButton = new OverflowToolbarButton(this.getId() + "-moveBottomBtn",{
|
|
233
|
-
type: "Transparent",
|
|
234
|
-
tooltip: this.getResourceText("p13nDialog.MOVE_TO_BOTTOM"),
|
|
235
|
-
icon: "sap-icon://expand-group",
|
|
236
|
-
press: [this._onPressButtonMoveToBottom, this],
|
|
237
|
-
visible: false,
|
|
238
|
-
layoutData: new OverflowToolbarLayoutData({
|
|
239
|
-
moveToOverflow: true,
|
|
240
|
-
priority: "Low",
|
|
241
|
-
group: 2
|
|
242
|
-
})
|
|
243
|
-
});
|
|
244
|
-
this.addDependent(this._oMoveBottomButton);
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
return this._oMoveBottomButton;
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
BasePanel.prototype._createInnerListControl = function() {
|
|
251
|
-
return new Table(this.getId() + "-innerP13nList", Object.assign(this._getListControlConfig(), {
|
|
252
|
-
headerToolbar: new OverflowToolbar({
|
|
253
|
-
content: [
|
|
254
|
-
this._getSearchField(),
|
|
255
|
-
new ToolbarSpacer(),
|
|
256
|
-
this._getMoveTopButton(),
|
|
257
|
-
this._getMoveUpButton(),
|
|
258
|
-
this._getMoveDownButton(),
|
|
259
|
-
this._getMoveBottomButton(),
|
|
260
|
-
this._getReorderButton()
|
|
261
|
-
]
|
|
262
|
-
})
|
|
263
|
-
}));
|
|
264
|
-
};
|
|
265
|
-
|
|
266
|
-
BasePanel.prototype.setEnableReorder = function(bEnableReorder) {
|
|
267
|
-
var oTemplate = this.getTemplate();
|
|
268
|
-
if (bEnableReorder) {
|
|
269
|
-
this._addHover(oTemplate);
|
|
270
|
-
} else if (oTemplate && oTemplate.aDelegates && oTemplate.aDelegates.length > 0) {
|
|
271
|
-
oTemplate.removeEventDelegate(oTemplate.aDelegates[0].oDelegate);
|
|
272
|
-
}
|
|
273
|
-
this._getDragDropConfig().setEnabled(bEnableReorder);
|
|
274
|
-
this._setMoveButtonVisibility(bEnableReorder);
|
|
275
|
-
this.setProperty("enableReorder", bEnableReorder);
|
|
276
|
-
|
|
277
|
-
return this;
|
|
278
|
-
};
|
|
279
|
-
|
|
280
|
-
BasePanel.prototype._addHover = function(oRow) {
|
|
281
|
-
if (oRow && oRow.aDelegates.length < 1) {
|
|
282
|
-
oRow.addEventDelegate({
|
|
283
|
-
onmouseover: this._hoverHandler.bind(this),
|
|
284
|
-
onfocusin: this._focusHandler.bind(this)
|
|
285
|
-
});
|
|
286
|
-
}
|
|
287
|
-
};
|
|
288
|
-
|
|
289
|
-
BasePanel.prototype._focusHandler = function(oEvt) {
|
|
290
|
-
if (!this.getEnableReorder()){
|
|
291
|
-
return;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
//(new) hovered item
|
|
295
|
-
var oHoveredItem = sap.ui.getCore().byId(oEvt.currentTarget.id);
|
|
296
|
-
this._handleActivated(oHoveredItem);
|
|
297
|
-
};
|
|
298
|
-
|
|
299
|
-
BasePanel.prototype._hoverHandler = function(oEvt) {
|
|
300
|
-
//Only use hover if no item has been selected yet
|
|
301
|
-
if (this._oSelectedItem && !this._oSelectedItem.bIsDestroyed) {
|
|
302
|
-
return;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
if (!this.getEnableReorder()){
|
|
306
|
-
return;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
//(new) hovered item
|
|
310
|
-
var oHoveredItem = sap.ui.getCore().byId(oEvt.currentTarget.id);
|
|
311
|
-
|
|
312
|
-
this._handleActivated(oHoveredItem);
|
|
313
|
-
};
|
|
314
|
-
|
|
315
|
-
BasePanel.prototype._handleActivated = function(oHoveredItem) {
|
|
316
|
-
this._oHoveredItem = oHoveredItem;
|
|
317
|
-
//Implement custom hover handling in derivation here..
|
|
318
|
-
};
|
|
319
|
-
|
|
320
|
-
BasePanel.prototype._getReorderButton = function() {
|
|
321
|
-
if (!this.oReorderButton) {
|
|
322
|
-
this.oReorderButton = new Button(this.getId() + "-showSelectedBtn",{
|
|
323
|
-
text: {
|
|
324
|
-
path: this.P13N_MODEL + ">/reorderMode",
|
|
325
|
-
formatter: function (bReorderMode) {
|
|
326
|
-
return bReorderMode ? this.getResourceText("p13nDialog.SELECT") : this.getResourceText("p13nDialog.REORDER");
|
|
327
|
-
}.bind(this)
|
|
328
|
-
},
|
|
329
|
-
press: [this._onPressToggleMode, this]
|
|
330
|
-
});
|
|
331
|
-
}
|
|
332
|
-
return this.oReorderButton;
|
|
333
|
-
};
|
|
334
|
-
|
|
335
|
-
BasePanel.prototype._getListControlConfig = function() {
|
|
336
|
-
return {
|
|
337
|
-
mode:"MultiSelect",
|
|
338
|
-
rememberSelections: true,
|
|
339
|
-
itemPress: [this._onItemPressed, this],
|
|
340
|
-
selectionChange: [this._onSelectionChange, this],
|
|
341
|
-
sticky: ["HeaderToolbar", "ColumnHeaders", "InfoToolbar"],
|
|
342
|
-
dragDropConfig: this._getDragDropConfig()
|
|
343
|
-
};
|
|
344
|
-
};
|
|
345
|
-
|
|
346
|
-
BasePanel.prototype._getSearchField = function() {
|
|
347
|
-
if (!this._oSearchField) {
|
|
348
|
-
this._oSearchField = new SearchField(this.getId() + "-searchField",{
|
|
349
|
-
liveChange: [this._onSearchFieldLiveChange, this],
|
|
350
|
-
width: "100%",
|
|
351
|
-
layoutData: new OverflowToolbarLayoutData({
|
|
352
|
-
shrinkable: true,
|
|
353
|
-
moveToOverflow: true,
|
|
354
|
-
priority: "High",
|
|
355
|
-
maxWidth: "16rem"
|
|
356
|
-
})
|
|
357
|
-
});
|
|
358
|
-
}
|
|
359
|
-
return this._oSearchField;
|
|
360
|
-
};
|
|
361
|
-
|
|
362
|
-
BasePanel.prototype.setTemplate = function(oTemplate) {
|
|
363
|
-
this.setAggregation("template", oTemplate);
|
|
364
|
-
if (oTemplate) {
|
|
365
|
-
if (this.getEnableReorder()){
|
|
366
|
-
this._addHover(oTemplate);
|
|
367
|
-
}
|
|
368
|
-
this._oSelectionBindingInfo = oTemplate.getBindingInfo("selected");
|
|
369
|
-
// Extract the binding info parts
|
|
370
|
-
if (this._oSelectionBindingInfo && this._oSelectionBindingInfo.parts) {
|
|
371
|
-
this._oSelectionBindingInfo = {
|
|
372
|
-
parts: this._oSelectionBindingInfo.parts
|
|
373
|
-
};
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
this._bindListItems();
|
|
377
|
-
return this;
|
|
378
|
-
};
|
|
379
|
-
|
|
380
|
-
BasePanel.prototype.setPanelColumns = function(vColumns) {
|
|
381
|
-
var aColumns;
|
|
382
|
-
if (vColumns instanceof Array) {
|
|
383
|
-
aColumns = vColumns;
|
|
384
|
-
} else {
|
|
385
|
-
aColumns = [
|
|
386
|
-
vColumns
|
|
387
|
-
];
|
|
388
|
-
}
|
|
389
|
-
this._addTableColumns(aColumns);
|
|
390
|
-
};
|
|
391
|
-
|
|
392
|
-
/**
|
|
393
|
-
* @param {Object} oP13nModel Personalization model provided by sap.ui.mdc.p13n.P13nBuilder
|
|
394
|
-
*/
|
|
395
|
-
BasePanel.prototype.setP13nModel = function(oP13nModel) {
|
|
396
|
-
this.setModel(oP13nModel, this.P13N_MODEL);
|
|
397
|
-
//initial value for "Reorder"-mode is false
|
|
398
|
-
this.setPanelMode(false);
|
|
399
|
-
};
|
|
400
|
-
|
|
401
|
-
BasePanel.prototype.getP13nModel = function() {
|
|
402
|
-
return this.getModel(this.P13N_MODEL);
|
|
403
|
-
};
|
|
404
|
-
|
|
405
|
-
BasePanel.prototype.getP13nState = function () {
|
|
406
|
-
return this.getP13nModel().getProperty("/items").filter(function(oField){
|
|
407
|
-
return oField[this._getPresenceAttribute()] === true;
|
|
408
|
-
}.bind(this));
|
|
409
|
-
};
|
|
410
|
-
|
|
411
|
-
BasePanel.prototype.getResourceText = function(sText, vValue) {
|
|
412
|
-
this.oResourceBundle = this.oResourceBundle ? this.oResourceBundle : sap.ui.getCore().getLibraryResourceBundle("sap.ui.mdc");
|
|
413
|
-
return sText ? this.oResourceBundle.getText(sText, vValue) : this.oResourceBundle;
|
|
414
|
-
};
|
|
415
|
-
|
|
416
|
-
BasePanel.prototype._addTableColumns = function(aColumns) {
|
|
417
|
-
var aRemovedColumns = this._oListControl.removeAllColumns();
|
|
418
|
-
aRemovedColumns.forEach(function(oRemovedColumn){
|
|
419
|
-
oRemovedColumn.destroy();
|
|
420
|
-
});
|
|
421
|
-
aColumns.forEach(function(vColumn) {
|
|
422
|
-
var oColumn;
|
|
423
|
-
|
|
424
|
-
if (typeof vColumn == "string") {
|
|
425
|
-
oColumn = new Column({
|
|
426
|
-
header: new Text({
|
|
427
|
-
text: vColumn
|
|
428
|
-
})
|
|
429
|
-
});
|
|
430
|
-
} else {
|
|
431
|
-
oColumn = vColumn;
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
this._oListControl.addColumn(oColumn);
|
|
435
|
-
}, this);
|
|
436
|
-
};
|
|
437
|
-
|
|
438
|
-
BasePanel.prototype._getPresenceAttribute = function() {
|
|
439
|
-
var sPresenceAttribute = this.getP13nModel().getProperty("/presenceAttribute") || "visible";
|
|
440
|
-
return sPresenceAttribute;
|
|
441
|
-
};
|
|
442
|
-
|
|
443
|
-
BasePanel.prototype._bindListItems = function(mBindingInfo) {
|
|
444
|
-
var oTemplate = this.getTemplate();
|
|
445
|
-
if (oTemplate) {
|
|
446
|
-
/*
|
|
447
|
-
* NOTE: as the dialog offers two modes (Select / Reorder) for personalization changes,
|
|
448
|
-
* the type is only required as "Active" in case the user is in "Reorder"-mode, as there
|
|
449
|
-
* are no buttons visible in "Select"-mode. This is only being used to disable/enable the
|
|
450
|
-
* buttons in the "Reorder"-mode via press event.
|
|
451
|
-
*/
|
|
452
|
-
oTemplate.bindProperty("type", {
|
|
453
|
-
path: this.P13N_MODEL + ">/reorderMode",
|
|
454
|
-
formatter: function(bReorderMode) {
|
|
455
|
-
return bReorderMode ? "Active" : "Inactive";
|
|
456
|
-
}
|
|
457
|
-
});
|
|
458
|
-
this._oListControl.bindItems(Object.assign({
|
|
459
|
-
path: this.P13N_MODEL + ">/items",
|
|
460
|
-
key: "name",
|
|
461
|
-
templateShareable: false,
|
|
462
|
-
template: this.getTemplate().clone()
|
|
463
|
-
}, mBindingInfo));
|
|
464
|
-
}
|
|
465
|
-
};
|
|
466
|
-
|
|
467
|
-
BasePanel.prototype._onSelectionChange = function(oEvent) {
|
|
468
|
-
|
|
469
|
-
var aListItems = oEvent.getParameter("listItems");
|
|
470
|
-
var bSelectAll = oEvent.getParameter("selectAll");
|
|
471
|
-
var bDeSelectAll = !bSelectAll && aListItems.length > 1;
|
|
472
|
-
|
|
473
|
-
aListItems.forEach(function(oTableItem) {
|
|
474
|
-
this._selectTableItem(oTableItem, bSelectAll || bDeSelectAll);
|
|
475
|
-
}, this);
|
|
476
|
-
|
|
477
|
-
if (bSelectAll || bDeSelectAll) {
|
|
478
|
-
this.fireChange({
|
|
479
|
-
reason: bSelectAll ? "SelectAll" : "DeselectAll",
|
|
480
|
-
item: undefined //No direct item is affected
|
|
481
|
-
});
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
// in case of 'deselect all', the move buttons for positioning are going to be disabled
|
|
485
|
-
if (bDeSelectAll) {
|
|
486
|
-
this._getMoveTopButton().setEnabled(false);
|
|
487
|
-
this._getMoveUpButton().setEnabled(false);
|
|
488
|
-
this._getMoveDownButton().setEnabled(false);
|
|
489
|
-
this._getMoveBottomButton().setEnabled(false);
|
|
490
|
-
}
|
|
491
|
-
};
|
|
492
|
-
|
|
493
|
-
BasePanel.prototype._onItemPressed = function(oEvent) {
|
|
494
|
-
var oTableItem = oEvent.getParameter('listItem');
|
|
495
|
-
this._oSelectedItem = oTableItem;
|
|
496
|
-
|
|
497
|
-
var oContext = oTableItem.getBindingContext(this.P13N_MODEL);
|
|
498
|
-
if (this.getEnableReorder() && oContext && oContext.getProperty(this._getPresenceAttribute())){
|
|
499
|
-
this._handleActivated(oTableItem);
|
|
500
|
-
this._updateEnableOfMoveButtons(oTableItem, true);
|
|
501
|
-
}
|
|
502
|
-
};
|
|
503
|
-
|
|
504
|
-
BasePanel.prototype._onSearchFieldLiveChange = function(oEvent) {
|
|
505
|
-
this._oListControl.getBinding("items").filter(new Filter("label", "Contains", oEvent.getSource().getValue()));
|
|
506
|
-
};
|
|
507
|
-
|
|
508
|
-
BasePanel.prototype._onPressButtonMoveToTop = function() {
|
|
509
|
-
this._moveSelectedItem(0);
|
|
510
|
-
};
|
|
511
|
-
|
|
512
|
-
BasePanel.prototype._onPressButtonMoveUp = function() {
|
|
513
|
-
this._moveSelectedItem("Up");
|
|
514
|
-
};
|
|
515
|
-
|
|
516
|
-
BasePanel.prototype._onPressButtonMoveDown = function() {
|
|
517
|
-
this._moveSelectedItem("Down");
|
|
518
|
-
};
|
|
519
|
-
|
|
520
|
-
BasePanel.prototype._onPressButtonMoveToBottom = function() {
|
|
521
|
-
var iIndex = this._oListControl.getItems().length - 1;
|
|
522
|
-
this._moveSelectedItem(iIndex);
|
|
523
|
-
};
|
|
524
|
-
|
|
525
|
-
BasePanel.prototype._onPressToggleMode = function(oEvent) {
|
|
526
|
-
this._togglePanelMode();
|
|
527
|
-
};
|
|
528
|
-
|
|
529
|
-
BasePanel.prototype.getPanelMode = function() {
|
|
530
|
-
return this.getP13nModel() ? this.getP13nModel().getProperty("/reorderMode") : false;
|
|
531
|
-
};
|
|
532
|
-
|
|
533
|
-
BasePanel.prototype.setPanelMode = function(bReorder) {
|
|
534
|
-
return this.getP13nModel().setProperty("/reorderMode", bReorder);
|
|
535
|
-
};
|
|
536
|
-
|
|
537
|
-
BasePanel.prototype._togglePanelMode = function() {
|
|
538
|
-
// switch panel mode
|
|
539
|
-
var bReorderMode = !this.getPanelMode();
|
|
540
|
-
this.setPanelMode(bReorderMode);
|
|
541
|
-
|
|
542
|
-
if (bReorderMode) {
|
|
543
|
-
this._updateModelItems();
|
|
544
|
-
}
|
|
545
|
-
// Switch the list mode (which also unbinds selection) and then filter by selected
|
|
546
|
-
this.switchListMode(bReorderMode ? "None" : "MultiSelect");
|
|
547
|
-
this._filterBySelected(bReorderMode, this._oListControl);
|
|
548
|
-
// Show/Hide and clear the search field
|
|
549
|
-
this._oSearchField.setVisible(!bReorderMode);
|
|
550
|
-
this._oSearchField.setValue("");
|
|
551
|
-
|
|
552
|
-
// set the movement buttons to visible / invisible
|
|
553
|
-
this._setMoveButtonVisibility(bReorderMode);
|
|
554
|
-
|
|
555
|
-
this._getMoveTopButton().setEnabled(false);
|
|
556
|
-
this._getMoveUpButton().setEnabled(false);
|
|
557
|
-
this._getMoveDownButton().setEnabled(false);
|
|
558
|
-
this._getMoveBottomButton().setEnabled(false);
|
|
559
|
-
|
|
560
|
-
//disable / enable d&d
|
|
561
|
-
this._getDragDropConfig().setEnabled(bReorderMode);
|
|
562
|
-
};
|
|
563
|
-
|
|
564
|
-
BasePanel.prototype._setMoveButtonVisibility = function(bVisible) {
|
|
565
|
-
this._getMoveTopButton().setVisible(bVisible);
|
|
566
|
-
this._getMoveUpButton().setVisible(bVisible);
|
|
567
|
-
this._getMoveDownButton().setVisible(bVisible);
|
|
568
|
-
this._getMoveBottomButton().setVisible(bVisible);
|
|
569
|
-
};
|
|
570
|
-
|
|
571
|
-
BasePanel.prototype._updateModelItems = function() {
|
|
572
|
-
// Sort and update the model items to ensure selected ones, are at the top
|
|
573
|
-
var aFields = this.getP13nModel().getProperty("/items");
|
|
574
|
-
var aSelectedFields = [], aOtherFields = [];
|
|
575
|
-
aFields.forEach(function(oField) {
|
|
576
|
-
if (oField[this._getPresenceAttribute()]) {
|
|
577
|
-
aSelectedFields.push(oField);
|
|
578
|
-
} else {
|
|
579
|
-
aOtherFields.push(oField);
|
|
580
|
-
}
|
|
581
|
-
}.bind(this));
|
|
582
|
-
this.getP13nModel().setProperty("/items", aSelectedFields.concat(aOtherFields));
|
|
583
|
-
};
|
|
584
|
-
|
|
585
|
-
BasePanel.prototype._filterBySelected = function(bShowSelected, oList) {
|
|
586
|
-
oList.getBinding("items").filter(bShowSelected ? new Filter(this._getPresenceAttribute(), "EQ", true) : []);
|
|
587
|
-
};
|
|
588
|
-
|
|
589
|
-
BasePanel.prototype.switchListMode = function(sMode) {
|
|
590
|
-
// If selection binding exists then unbind the table items
|
|
591
|
-
if (this._oSelectionBindingInfo) {
|
|
592
|
-
if (sMode === "None") {
|
|
593
|
-
// Unbind selected property
|
|
594
|
-
this.getTemplate().unbindProperty("selected");
|
|
595
|
-
} else {
|
|
596
|
-
// bind selected property
|
|
597
|
-
this.getTemplate().bindProperty("selected", this._oSelectionBindingInfo);
|
|
598
|
-
}
|
|
599
|
-
// Unbind the table to ensure selected is not used
|
|
600
|
-
this._oListControl.unbindAggregation("items");
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
// Update the selection mode of the table
|
|
604
|
-
this._oListControl.setMode(sMode);
|
|
605
|
-
|
|
606
|
-
if (this._oSelectionBindingInfo) {
|
|
607
|
-
// Bind the table to ensure selection state (selected binding) is used by the table
|
|
608
|
-
this._bindListItems();
|
|
609
|
-
}
|
|
610
|
-
};
|
|
611
|
-
|
|
612
|
-
BasePanel.prototype._selectTableItem = function(oTableItem, bSelectAll) {
|
|
613
|
-
this._updateEnableOfMoveButtons(oTableItem, bSelectAll ? false : true);
|
|
614
|
-
this._oSelectedItem = oTableItem;
|
|
615
|
-
if (!bSelectAll) {
|
|
616
|
-
var oItem = this.getP13nModel().getProperty(this._oSelectedItem.getBindingContext(this.P13N_MODEL).sPath);
|
|
617
|
-
// only fire this event if one item is being selected in a live scenario, else fire the change event in the _onSelectionChange method
|
|
618
|
-
//TODO: remove 'selected' condition enhance
|
|
619
|
-
var oP13nModel = this.getModel(this.P13N_MODEL);
|
|
620
|
-
if (oP13nModel && oItem) {
|
|
621
|
-
oP13nModel.setProperty(oTableItem.getBindingContext(this.P13N_MODEL).sPath + "/selected", oItem.visible);
|
|
622
|
-
}
|
|
623
|
-
this.fireChange({
|
|
624
|
-
reason: oItem[this._getPresenceAttribute()] ? "Add" : "Remove",
|
|
625
|
-
item: oItem
|
|
626
|
-
});
|
|
627
|
-
}
|
|
628
|
-
};
|
|
629
|
-
|
|
630
|
-
BasePanel.prototype._moveSelectedItem = function(vNewIndex) {
|
|
631
|
-
var oSelectedItem = this._oSelectedItem;
|
|
632
|
-
var iSelectedIndex = this._oListControl.indexOfItem(oSelectedItem);
|
|
633
|
-
if (iSelectedIndex < 0) {
|
|
634
|
-
return;
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
// determine the new index relative to selected index when "Up" or "Down" is passed as a parameter
|
|
638
|
-
var iNewIndex = (typeof vNewIndex == "number") ? vNewIndex : iSelectedIndex + (vNewIndex == "Up" ? -1 : 1);
|
|
639
|
-
this._moveTableItem(oSelectedItem, iNewIndex);
|
|
640
|
-
|
|
641
|
-
};
|
|
642
|
-
|
|
643
|
-
BasePanel.prototype._moveTableItem = function(oItem, iNewIndex) {
|
|
644
|
-
var aItems = this._oListControl.getItems();
|
|
645
|
-
var aFields = this.getP13nModel().getProperty("/items");
|
|
646
|
-
|
|
647
|
-
// index of the item in the model not the index in the aggregation
|
|
648
|
-
var iOlModelIndex = aFields.indexOf(oItem.getBindingContext(this.P13N_MODEL).getObject());
|
|
649
|
-
|
|
650
|
-
// limit the minumum and maximum index
|
|
651
|
-
iNewIndex = (iNewIndex <= 0) ? 0 : Math.min(iNewIndex, aItems.length - 1);
|
|
652
|
-
|
|
653
|
-
// new index of the item in the model
|
|
654
|
-
var iNewModelIndex = aFields.indexOf(aItems[iNewIndex].getBindingContext(this.P13N_MODEL).getObject());
|
|
655
|
-
if (iNewModelIndex == iOlModelIndex) {
|
|
656
|
-
return;
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
// remove data from old position and insert it into new position
|
|
660
|
-
aFields.splice(iNewModelIndex, 0, aFields.splice(iOlModelIndex, 1)[0]);
|
|
661
|
-
this.getP13nModel().setProperty("/items", aFields);
|
|
662
|
-
|
|
663
|
-
// store the moved item again due to binding
|
|
664
|
-
this._oSelectedItem = this._oListControl.getItems()[iNewIndex];
|
|
665
|
-
|
|
666
|
-
this._updateEnableOfMoveButtons(this._oSelectedItem, true);
|
|
667
|
-
|
|
668
|
-
this._handleActivated(this._oSelectedItem);
|
|
669
|
-
|
|
670
|
-
this.fireChange({
|
|
671
|
-
reason: "Move",
|
|
672
|
-
item: this.getP13nModel().getProperty(this._oSelectedItem.getBindingContext(this.P13N_MODEL).sPath)
|
|
673
|
-
});
|
|
674
|
-
};
|
|
675
|
-
|
|
676
|
-
BasePanel.prototype._onRearrange = function(oEvent) {
|
|
677
|
-
var oDraggedItem = oEvent.getParameter("draggedControl");
|
|
678
|
-
var oDroppedItem = oEvent.getParameter("droppedControl");
|
|
679
|
-
var sDropPosition = oEvent.getParameter("dropPosition");
|
|
680
|
-
var iDraggedIndex = this._oListControl.indexOfItem(oDraggedItem);
|
|
681
|
-
var iDroppedIndex = this._oListControl.indexOfItem(oDroppedItem);
|
|
682
|
-
var iActualDroppedIndex = iDroppedIndex + (sDropPosition == "Before" ? 0 : 1) + (iDraggedIndex < iDroppedIndex ? -1 : 0);
|
|
683
|
-
|
|
684
|
-
this._moveTableItem(oDraggedItem, iActualDroppedIndex);
|
|
685
|
-
};
|
|
686
|
-
|
|
687
|
-
BasePanel.prototype._updateEnableOfMoveButtons = function(oTableItem, bFocus) {
|
|
688
|
-
var iTableItemPos = this._oListControl.getItems().indexOf(oTableItem);
|
|
689
|
-
var iLastItemPos = this._oListControl.getItems().length - 1;
|
|
690
|
-
var bUpEnabled = true, bDownEnabled = true;
|
|
691
|
-
if (iTableItemPos == 0) {
|
|
692
|
-
// disable move buttons upwards, if the item is at the top
|
|
693
|
-
bUpEnabled = false;
|
|
694
|
-
}
|
|
695
|
-
if (iTableItemPos == iLastItemPos) {
|
|
696
|
-
// disable move buttons downwards, if the item is at the bottom
|
|
697
|
-
bDownEnabled = false;
|
|
698
|
-
}
|
|
699
|
-
this._getMoveTopButton().setEnabled(bUpEnabled);
|
|
700
|
-
this._getMoveUpButton().setEnabled(bUpEnabled);
|
|
701
|
-
this._getMoveDownButton().setEnabled(bDownEnabled);
|
|
702
|
-
this._getMoveBottomButton().setEnabled(bDownEnabled);
|
|
703
|
-
if (bFocus) {
|
|
704
|
-
oTableItem.focus();
|
|
705
|
-
}
|
|
706
|
-
};
|
|
707
|
-
|
|
708
|
-
BasePanel.prototype.exit = function() {
|
|
709
|
-
Control.prototype.exit.apply(this, arguments);
|
|
710
|
-
this._oSelectionBindingInfo = null;
|
|
711
|
-
this._oSelectedItem = null;
|
|
712
|
-
this._oListControl = null;
|
|
713
|
-
this._oMoveTopBtn = null;
|
|
714
|
-
this._oMoveUpButton = null;
|
|
715
|
-
this._oMoveDownButton = null;
|
|
716
|
-
this._oMoveBottomButton = null;
|
|
717
|
-
this._oSearchField = null;
|
|
718
|
-
};
|
|
719
|
-
|
|
720
|
-
return BasePanel;
|
|
721
|
-
});
|