@sapui5/sap.ui.vbm 1.119.0 → 1.121.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/sap/ui/vbm/.library +1 -1
- package/src/sap/ui/vbm/Adapter.js +19 -19
- package/src/sap/ui/vbm/Adapter3D.js +7 -18
- package/src/sap/ui/vbm/AnalyticMap.js +3 -2
- package/src/sap/ui/vbm/ContainerBase.js +799 -0
- package/src/sap/ui/vbm/ContainerBaseRenderer.js +85 -0
- package/src/sap/ui/vbm/ContainerContent.js +82 -0
- package/src/sap/ui/vbm/ContainerContentRenderer.js +28 -0
- package/src/sap/ui/vbm/ContainerLegendItem.js +68 -0
- package/src/sap/ui/vbm/ContainerLegendItemRenderer.js +58 -0
- package/src/sap/ui/vbm/GeoMap.js +4 -4
- package/src/sap/ui/vbm/Legend.js +5 -3
- package/src/sap/ui/vbm/ListPanel.js +336 -0
- package/src/sap/ui/vbm/ListPanelRenderer.js +36 -0
- package/src/sap/ui/vbm/ListPanelStack.js +254 -0
- package/src/sap/ui/vbm/ListPanelStackRenderer.js +29 -0
- package/src/sap/ui/vbm/MapContainer.js +514 -0
- package/src/sap/ui/vbm/MapContainerButtonType.js +23 -0
- package/src/sap/ui/vbm/MapContainerRenderer.js +67 -0
- package/src/sap/ui/vbm/Viewport.js +1 -1
- package/src/sap/ui/vbm/VoAbstract.js +15 -1
- package/src/sap/ui/vbm/VoBase.js +4 -0
- package/src/sap/ui/vbm/adapter3d/DragDropHandler.js +1 -1
- package/src/sap/ui/vbm/adapter3d/ModelHandler.js +1 -1
- package/src/sap/ui/vbm/adapter3d/ObjectFactory.js +1 -1
- package/src/sap/ui/vbm/adapter3d/PolygonHandler.js +1 -1
- package/src/sap/ui/vbm/adapter3d/SceneBuilder.js +6 -5
- package/src/sap/ui/vbm/adapter3d/VBIJSONParser.js +10 -10
- package/src/sap/ui/vbm/getResourceBundle.js +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle.properties +25 -0
- package/src/sap/ui/vbm/i18n/messagebundle_ar.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_ca.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_cnr.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_cs.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_cy.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_da.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_de.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_el.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_en.properties +13 -0
- package/src/sap/ui/vbm/i18n/messagebundle_en_GB.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_en_US_sappsd.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_en_US_saprigi.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_en_US_saptrc.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_es.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_es_MX.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_et.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_fi.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_fr.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_fr_CA.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_hi.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_hr.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_hu.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_id.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_it.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_iw.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_ja.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_kk.properties +15 -0
- package/src/sap/ui/vbm/i18n/messagebundle_ko.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_lt.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_lv.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_mk.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_ms.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_nl.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_no.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_pl.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_pt.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_pt_PT.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_ro.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_ru.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_sk.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_sl.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_sr.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_sv.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_th.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_tr.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_uk.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_vi.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_zh_CN.properties +14 -0
- package/src/sap/ui/vbm/i18n/messagebundle_zh_TW.properties +14 -0
- package/src/sap/ui/vbm/lib/sapnavigation.js +7 -3
- package/src/sap/ui/vbm/lib/sapscale.js +1 -1
- package/src/sap/ui/vbm/lib/saputilities.js +11 -5
- package/src/sap/ui/vbm/lib/sapvbmenu.js +6 -1
- package/src/sap/ui/vbm/library.js +13 -7
- package/src/sap/ui/vbm/themes/base/ContainerBase.less +45 -0
- package/src/sap/ui/vbm/themes/base/ContainerLegendItem.less +46 -0
- package/src/sap/ui/vbm/themes/base/ListPanel.less +43 -0
- package/src/sap/ui/vbm/themes/base/ListPanelStack.less +30 -0
- package/src/sap/ui/vbm/themes/base/MapContainer.less +210 -0
- package/src/sap/ui/vbm/themes/base/fonts/map-container.eot +0 -0
- package/src/sap/ui/vbm/themes/base/fonts/map-container.svg +13 -0
- package/src/sap/ui/vbm/themes/base/fonts/map-container.ttf +0 -0
- package/src/sap/ui/vbm/themes/base/fonts/map-container.woff +0 -0
- package/src/sap/ui/vbm/themes/base/library.source.less +5 -0
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* SAP UI development toolkit for HTML5 (SAPUI5) (c) Copyright 2009-2012 SAP AG. All rights reserved
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// Provides control sap.ui.vbm.ListPanel.
|
|
6
|
+
sap.ui.define([
|
|
7
|
+
"./library",
|
|
8
|
+
"sap/ui/core/Control",
|
|
9
|
+
"sap/m/library",
|
|
10
|
+
"./ListPanelRenderer"
|
|
11
|
+
], function(
|
|
12
|
+
library,
|
|
13
|
+
Control,
|
|
14
|
+
mobileLibrary,
|
|
15
|
+
ListPanelRenderer
|
|
16
|
+
) {
|
|
17
|
+
"use strict";
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Constructor for a new ListPanel.
|
|
21
|
+
*
|
|
22
|
+
* @param {string} [sId] id for the new control, generated automatically if no id is given
|
|
23
|
+
* @param {object} [mSettings] initial settings for the new control
|
|
24
|
+
* @class Aggregation control for the Legend
|
|
25
|
+
* @extends sap.ui.core.Control
|
|
26
|
+
* @constructor
|
|
27
|
+
* @public
|
|
28
|
+
* @alias sap.ui.vbm.ListPanel
|
|
29
|
+
* @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel
|
|
30
|
+
* @experimental Since 1.38.0 This class is experimental and might be modified or removed in future versions.
|
|
31
|
+
*/
|
|
32
|
+
var ListPanel = Control.extend("sap.ui.vbm.ListPanel", /** @lends sap.ui.vbm.ListPanel.prototype */ {
|
|
33
|
+
metadata: {
|
|
34
|
+
|
|
35
|
+
library: "sap.ui.vbm",
|
|
36
|
+
properties: {
|
|
37
|
+
/**
|
|
38
|
+
* Header text
|
|
39
|
+
*/
|
|
40
|
+
"headerText": {
|
|
41
|
+
type: "string",
|
|
42
|
+
group: "Misc"
|
|
43
|
+
},
|
|
44
|
+
/**
|
|
45
|
+
* Header icon
|
|
46
|
+
*/
|
|
47
|
+
"headerIcon": {
|
|
48
|
+
type: "sap.ui.core.URI",
|
|
49
|
+
group: "Misc"
|
|
50
|
+
},
|
|
51
|
+
/**
|
|
52
|
+
* Expansion state
|
|
53
|
+
*/
|
|
54
|
+
"expanded": {
|
|
55
|
+
type: "boolean",
|
|
56
|
+
group: "Misc",
|
|
57
|
+
defaultValue: true
|
|
58
|
+
},
|
|
59
|
+
/**
|
|
60
|
+
* Expand animation
|
|
61
|
+
*/
|
|
62
|
+
"expandAnimation": {
|
|
63
|
+
type: "boolean",
|
|
64
|
+
group: "Misc",
|
|
65
|
+
defaultValue: true
|
|
66
|
+
},
|
|
67
|
+
/**
|
|
68
|
+
* Selection Mode
|
|
69
|
+
*/
|
|
70
|
+
"selectionMode": {
|
|
71
|
+
type: "sap.m.ListMode",
|
|
72
|
+
group: "Misc",
|
|
73
|
+
defaultValue: sap.m.ListMode.MultiSelect
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
},
|
|
77
|
+
aggregations: {
|
|
78
|
+
/**
|
|
79
|
+
* Item aggregation
|
|
80
|
+
*/
|
|
81
|
+
"items": {
|
|
82
|
+
type: "sap.m.ListItemBase",
|
|
83
|
+
multiple: true,
|
|
84
|
+
singularName: "item"
|
|
85
|
+
},
|
|
86
|
+
/**
|
|
87
|
+
* hidden panel aggregation needed for binding
|
|
88
|
+
*/
|
|
89
|
+
"panel": {
|
|
90
|
+
type: "sap.m.Panel",
|
|
91
|
+
multiple: false,
|
|
92
|
+
visibility: "hidden"
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
events: {
|
|
96
|
+
/**
|
|
97
|
+
* Event is fired if the header icon is pressed
|
|
98
|
+
*/
|
|
99
|
+
headerIconPress: {},
|
|
100
|
+
/**
|
|
101
|
+
* Event is fired if the panel is expanded of collapsed
|
|
102
|
+
*/
|
|
103
|
+
expand: {},
|
|
104
|
+
/**
|
|
105
|
+
* Event is fired when selection is changed via user interaction inside the control.
|
|
106
|
+
*/
|
|
107
|
+
selectionChange: {
|
|
108
|
+
parameters: {
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* The item whose selection has changed. In <code>MultiSelect</code> mode, only the up-most selected item is returned. This
|
|
112
|
+
* parameter can be used for single-selection modes.
|
|
113
|
+
*/
|
|
114
|
+
listItem: {
|
|
115
|
+
type: "sap.m.ListItemBase"
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Array of items whose selection has changed. This parameter can be used for <code>MultiSelect</code> mode.
|
|
120
|
+
*/
|
|
121
|
+
listItems: {
|
|
122
|
+
type: "sap.m.ListItemBase[]"
|
|
123
|
+
},
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Indicates whether the <code>listItem</code> parameter is selected or not.
|
|
127
|
+
*/
|
|
128
|
+
selected: {
|
|
129
|
+
type: "boolean"
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
/**
|
|
134
|
+
* Event is fired when an item is pressed unless the item's <code>type</code> property is <code>Inactive</code>.
|
|
135
|
+
*/
|
|
136
|
+
itemPress: {
|
|
137
|
+
parameters: {
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* The item which fired the pressed event.
|
|
141
|
+
*/
|
|
142
|
+
listItem: { type: "sap.m.ListItemBase" },
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* The control which caused the press event within the container.
|
|
146
|
+
*/
|
|
147
|
+
srcControl: { type: "sap.ui.core.Control" }
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
// ...........................................................................//
|
|
155
|
+
// This file defines behavior for the control,...............................//
|
|
156
|
+
// ...........................................................................//
|
|
157
|
+
// Public API functions
|
|
158
|
+
// ............................................................................//
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Returns selected list item. When no item is selected, "null" is returned. When "multi-selection" is enabled and multiple items are selected, only the up-most selected item is returned.
|
|
162
|
+
* @returns {sap.m.ListItemBase} Selected item.
|
|
163
|
+
* @public
|
|
164
|
+
* @ui5-metamodel This method also will be described in the UI5 (legacy) designtime metamodel
|
|
165
|
+
*/
|
|
166
|
+
ListPanel.prototype.getSelectedItem = function() {
|
|
167
|
+
return this._oList.getSelectedItem();
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Selects or deselects the given list item.
|
|
172
|
+
*
|
|
173
|
+
* @param {sap.m.ListItemBase} oListItem
|
|
174
|
+
* The list item whose selection to be changed. This parameter is mandatory.
|
|
175
|
+
* @param {boolean} bSelect
|
|
176
|
+
* Sets selected status of the list item. Default value is true.
|
|
177
|
+
* @param {boolean} bFireEvent Whether to fire the event or not.
|
|
178
|
+
* @public
|
|
179
|
+
* @ui5-metamodel This method also will be described in the UI5 (legacy) designtime metamodel
|
|
180
|
+
*/
|
|
181
|
+
ListPanel.prototype.setSelectedItem = function(oListItem, bSelect, bFireEvent) {
|
|
182
|
+
this._oList.setSelectedItem(oListItem, bSelect, bFireEvent);
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Returns an array containing the selected list items. If no items are selected, an empty array is returned.
|
|
187
|
+
*
|
|
188
|
+
* @returns {sap.m.ListItemBase[]} Selected items
|
|
189
|
+
* @public
|
|
190
|
+
* @ui5-metamodel This method also will be described in the UI5 (legacy) designtime metamodel
|
|
191
|
+
*/
|
|
192
|
+
ListPanel.prototype.getSelectedItems = function() {
|
|
193
|
+
return this._oList.getSelectedItems();
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
// ........................................................................//
|
|
197
|
+
// Implementation of UI5 Interface functions
|
|
198
|
+
// ........................................................................//
|
|
199
|
+
ListPanel.prototype.init = function() {
|
|
200
|
+
// do something for initialization...
|
|
201
|
+
this._oList = new sap.m.ListBase({
|
|
202
|
+
mode: this.getSelectionMode(),
|
|
203
|
+
itemPress: this.fireItemPress.bind(this),
|
|
204
|
+
selectionChange: this.fireSelectionChange.bind(this)
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
this._oPanel = new sap.m.Panel({
|
|
208
|
+
expandable: true,
|
|
209
|
+
expanded: true,
|
|
210
|
+
expandAnimation: true,
|
|
211
|
+
headerToolbar: new sap.m.Toolbar({
|
|
212
|
+
active: false
|
|
213
|
+
}),
|
|
214
|
+
content: [
|
|
215
|
+
this._oList
|
|
216
|
+
],
|
|
217
|
+
expand: this.fireExpand.bind(this)
|
|
218
|
+
});
|
|
219
|
+
this._oPanel.getHeaderToolbar().addStyleClass("sapUiVkLPTb");
|
|
220
|
+
this.setAggregation("panel", this._oPanel, /* bSuppressInvalidate= */ true);
|
|
221
|
+
|
|
222
|
+
this._oHeaderIcon = null;
|
|
223
|
+
this._oHeaderText = null;
|
|
224
|
+
this._bHeaderToolbarChanged = true;
|
|
225
|
+
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
ListPanel.prototype.exit = function() {
|
|
229
|
+
this._destroyControl(this._oList);
|
|
230
|
+
this._destroyControl(this._oPanel);
|
|
231
|
+
this._destroyControl(this._oHeaderIcon);
|
|
232
|
+
this._destroyControl(this._oHeaderText);
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
ListPanel.prototype.getItems = function() {
|
|
236
|
+
return this._oList.getItems();
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
ListPanel.prototype.addItem = function(oObject) {
|
|
240
|
+
return this._oList.addItem(oObject);
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
ListPanel.prototype.insertItem = function(oObject, iIndex) {
|
|
244
|
+
return this._oList.insertItem(oObject, iIndex);
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
ListPanel.prototype.removeItem = function(oObject) {
|
|
248
|
+
return this._oList.removeItem(oObject);
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
ListPanel.prototype.removeAllItems = function() {
|
|
252
|
+
return this._oList.removeAllItems();
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
ListPanel.prototype.setHeaderText = function(value) {
|
|
256
|
+
if (!this._oHeaderText) {
|
|
257
|
+
this._oHeaderText = new sap.m.Title();
|
|
258
|
+
}
|
|
259
|
+
this._oHeaderText.setText(value);
|
|
260
|
+
this._bHeaderToolbarChanged = true;
|
|
261
|
+
|
|
262
|
+
if (this._oHeaderIcon) {
|
|
263
|
+
this._oHeaderIcon.setTooltip(value);
|
|
264
|
+
this._oHeaderIcon.addAriaLabelledBy(this._oHeaderText);
|
|
265
|
+
this._oHeaderIcon.addAriaDescribedBy(this._oHeaderText);
|
|
266
|
+
}
|
|
267
|
+
return this.setProperty("headerText", value);
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
ListPanel.prototype.getExpanded = function() {
|
|
271
|
+
return this._oPanel.getExpanded();
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
ListPanel.prototype.setExpanded = function(value) {
|
|
275
|
+
return this._oPanel.setExpanded(value);
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
ListPanel.prototype.getExpandAnimation = function() {
|
|
279
|
+
return this._oPanel.getExpandAnimation();
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
ListPanel.prototype.setExpandAnimation = function(value) {
|
|
283
|
+
return this._oPanel.setExpandAnimation(value);
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
ListPanel.prototype.setHeaderIcon = function(value) {
|
|
287
|
+
if (!this._oHeaderIcon) {
|
|
288
|
+
this._oHeaderIcon = new sap.m.Button({
|
|
289
|
+
press: this.fireHeaderIconPress.bind(this),
|
|
290
|
+
type: sap.m.ButtonType.Transparent,
|
|
291
|
+
tooltip: this.getHeaderText()
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
this._oHeaderIcon.setIcon(value);
|
|
295
|
+
this._bHeaderToolbarChanged = true;
|
|
296
|
+
|
|
297
|
+
if (this._oHeaderText) {
|
|
298
|
+
this._oHeaderIcon.addAriaLabelledBy(this._oHeaderText);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
return this.setProperty("headerIcon", value);
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
ListPanel.prototype.setSelectionMode = function(value) {
|
|
305
|
+
this._oList.setMode(value);
|
|
306
|
+
return this.setProperty("selectionMode", value);
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
ListPanel.prototype.onBeforeRendering = function() {
|
|
310
|
+
if (this._bHeaderToolbarChanged) {
|
|
311
|
+
var oToolbar = this._oPanel.getHeaderToolbar();
|
|
312
|
+
oToolbar.removeAllContent();
|
|
313
|
+
if (this._oHeaderIcon) {
|
|
314
|
+
oToolbar.addContent(this._oHeaderIcon);
|
|
315
|
+
}
|
|
316
|
+
if (this._oHeaderText) {
|
|
317
|
+
oToolbar.addContent(this._oHeaderText);
|
|
318
|
+
}
|
|
319
|
+
this._bHeaderToolbarChanged = false;
|
|
320
|
+
}
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
// ...............................................................................
|
|
324
|
+
// Internal functions
|
|
325
|
+
// ...............................................................................
|
|
326
|
+
|
|
327
|
+
ListPanel.prototype._destroyControl = function(oControl) {
|
|
328
|
+
if (oControl) {
|
|
329
|
+
oControl.destroy();
|
|
330
|
+
oControl = undefined;
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
return ListPanel;
|
|
335
|
+
|
|
336
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* SAP UI development toolkit for HTML5 (SAPUI5) (c) Copyright 2009-2012 SAP AG. All rights reserved
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
sap.ui.define(function() {
|
|
6
|
+
"use strict";
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
* @class ListPanel renderer. @static
|
|
10
|
+
*/
|
|
11
|
+
var ListPanelRenderer = {
|
|
12
|
+
apiVersion: 2
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Renders the HTML for the given control, using the provided {@link sap.ui.core.RenderManager}.
|
|
17
|
+
*
|
|
18
|
+
* @param {sap.ui.core.RenderManager} oRm the RenderManager that can be used for writing to the render output buffer
|
|
19
|
+
* @param {sap.ui.core.Control} oControl an object representation of the control that should be rendered
|
|
20
|
+
*/
|
|
21
|
+
ListPanelRenderer.render = function(oRm, oControl) {
|
|
22
|
+
// just render the internal Panel. The purpose is to only provide more specific properties.
|
|
23
|
+
var oPanel = oControl._oPanel;
|
|
24
|
+
oPanel.addStyleClass("sapUiVkListPanel");
|
|
25
|
+
|
|
26
|
+
oRm.openStart("div", oControl);
|
|
27
|
+
oRm.attr("role", sap.ui.core.AccessibleRole.Presentation);
|
|
28
|
+
oRm.openEnd();
|
|
29
|
+
oRm.renderControl(oPanel);
|
|
30
|
+
oRm.close("div");
|
|
31
|
+
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
return ListPanelRenderer;
|
|
35
|
+
|
|
36
|
+
}, /* bExport= */true);
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* SAP UI development toolkit for HTML5 (SAPUI5) (c) Copyright 2009-2012 SAP AG. All rights reserved
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// Provides control sap.ui.vbm.ListPanelStack.
|
|
6
|
+
sap.ui.define([
|
|
7
|
+
"./library",
|
|
8
|
+
"sap/ui/core/Control",
|
|
9
|
+
"sap/ui/layout/library",
|
|
10
|
+
"./ListPanelStackRenderer"
|
|
11
|
+
], function(
|
|
12
|
+
library,
|
|
13
|
+
Control,
|
|
14
|
+
layoutLibrary,
|
|
15
|
+
ListPanelStackRenderer
|
|
16
|
+
) {
|
|
17
|
+
"use strict";
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Constructor for a new ListPanelStack.
|
|
21
|
+
*
|
|
22
|
+
* @param {string} [sId] id for the new control, generated automatically if no id is given
|
|
23
|
+
* @param {object} [mSettings] initial settings for the new control
|
|
24
|
+
* @class ListPanelStack control
|
|
25
|
+
* @extends sap.ui.core.Control
|
|
26
|
+
* @constructor
|
|
27
|
+
* @public
|
|
28
|
+
* @alias sap.ui.vbm.ListPanelStack
|
|
29
|
+
* @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel
|
|
30
|
+
* @experimental Since 1.38.0 This class is experimental and might be modified or removed in future versions.
|
|
31
|
+
*/
|
|
32
|
+
var ListPanelStack = Control.extend("sap.ui.vbm.ListPanelStack", /** @lends sap.ui.vbm.ListPanelStack.prototype */ {
|
|
33
|
+
metadata: {
|
|
34
|
+
|
|
35
|
+
library: "sap.ui.vbm",
|
|
36
|
+
properties: {
|
|
37
|
+
/**
|
|
38
|
+
* Control width
|
|
39
|
+
*/
|
|
40
|
+
"width": {
|
|
41
|
+
type: "sap.ui.core.CSSSize",
|
|
42
|
+
group: "Misc",
|
|
43
|
+
defaultValue: "100%"
|
|
44
|
+
},
|
|
45
|
+
/**
|
|
46
|
+
* Expansion state
|
|
47
|
+
*/
|
|
48
|
+
"expanded": {
|
|
49
|
+
type: "boolean",
|
|
50
|
+
group: "Misc",
|
|
51
|
+
defaultValue: true
|
|
52
|
+
},
|
|
53
|
+
/**
|
|
54
|
+
* Expand animation
|
|
55
|
+
*/
|
|
56
|
+
"expandAnimation": {
|
|
57
|
+
type: "boolean",
|
|
58
|
+
group: "Misc",
|
|
59
|
+
defaultValue: true
|
|
60
|
+
},
|
|
61
|
+
/**
|
|
62
|
+
* Ability to collapse
|
|
63
|
+
*/
|
|
64
|
+
"collapsible": {
|
|
65
|
+
type: "boolean",
|
|
66
|
+
group: "Misc",
|
|
67
|
+
defaultValue: true
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
aggregations: {
|
|
71
|
+
|
|
72
|
+
"content": {
|
|
73
|
+
type: "sap.ui.vbm.ListPanel",
|
|
74
|
+
multiple: true,
|
|
75
|
+
singularName: "content"
|
|
76
|
+
},
|
|
77
|
+
/**
|
|
78
|
+
* hidden layout aggregation needed for binding
|
|
79
|
+
*/
|
|
80
|
+
"layout": {
|
|
81
|
+
type: "sap.ui.layout.VerticalLayout",
|
|
82
|
+
multiple: false,
|
|
83
|
+
visibility: "hidden"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
// ...........................................................................//
|
|
90
|
+
// This file defines behavior for the control,...............................//
|
|
91
|
+
// ...........................................................................//
|
|
92
|
+
// Public API functions
|
|
93
|
+
// ............................................................................//
|
|
94
|
+
|
|
95
|
+
// ........................................................................//
|
|
96
|
+
// Implementation of UI5 Interface functions
|
|
97
|
+
// ........................................................................//
|
|
98
|
+
ListPanelStack.prototype.init = function() {
|
|
99
|
+
// do something for initialization...
|
|
100
|
+
this._oLayout = new sap.ui.layout.VerticalLayout();
|
|
101
|
+
// default expandAnimation: true
|
|
102
|
+
this._oLayout.addStyleClass("sapUiVkLPSTrans");
|
|
103
|
+
this.setAggregation("layout", this._oLayout, /* bSuppressInvalidate= */ true);
|
|
104
|
+
this._bFirstTime = true;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
ListPanelStack.prototype.exit = function() {
|
|
108
|
+
if (this._oLayout) {
|
|
109
|
+
this._oLayout.destroy();
|
|
110
|
+
this._oLayout = undefined;
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
ListPanelStack.prototype.getContent = function() {
|
|
115
|
+
return this._oLayout.getContent();
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
ListPanelStack.prototype.addContent = function(oObject) {
|
|
119
|
+
oObject.attachExpand(this._onContentExpand.bind(this));
|
|
120
|
+
oObject.attachHeaderIconPress(this._onContentHeaderIconPress.bind(this));
|
|
121
|
+
return this._oLayout.addContent(oObject);
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
ListPanelStack.prototype.removeContent = function(oObject) {
|
|
125
|
+
return this._oLayout.removeContent(oObject);
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
ListPanelStack.prototype.insertContent = function(oObject, iIndex) {
|
|
129
|
+
return this._oLayout.insertContent(oObject, iIndex);
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
ListPanelStack.prototype.removeAllContent = function() {
|
|
133
|
+
return this._oLayout.removeAllContent();
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
ListPanelStack.prototype.getWidth = function() {
|
|
137
|
+
return this._oLayout.getWidth();
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
ListPanelStack.prototype.setWidth = function(value) {
|
|
141
|
+
this.setProperty("width", value, true);
|
|
142
|
+
return this._oLayout.setWidth(value);
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
ListPanelStack.prototype.setExpanded = function(value) {
|
|
146
|
+
if (value != this.getExpanded()) {
|
|
147
|
+
if (value) {
|
|
148
|
+
this._expand();
|
|
149
|
+
} else {
|
|
150
|
+
this._collapse();
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return this;
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
ListPanelStack.prototype.setExpandAnimation = function(value) {
|
|
157
|
+
this._oLayout.removeStyleClass("sapUiVkLPSTrans");
|
|
158
|
+
if (value) {
|
|
159
|
+
this._oLayout.addStyleClass("sapUiVkLPSTrans");
|
|
160
|
+
}
|
|
161
|
+
return this.setProperty("expandAnimation", value, true);
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
ListPanelStack.prototype.onBeforeRendering = function() {
|
|
165
|
+
if (this._bFirstTime) {
|
|
166
|
+
// check expand state of all content panels to determine initial expand state for stack
|
|
167
|
+
var bExpanded = false;
|
|
168
|
+
var aContent = this.getContent();
|
|
169
|
+
for (var i = 0; i < aContent.length; ++i) {
|
|
170
|
+
if (aContent[i].getExpanded()) {
|
|
171
|
+
bExpanded = true;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
this.setExpanded(bExpanded);
|
|
175
|
+
this._bFirstTime = false;
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
ListPanelStack.prototype.onAfterRendering = function() {
|
|
180
|
+
// If the control is not expanded, then it means it's collapsed
|
|
181
|
+
// so we applied the required width.
|
|
182
|
+
if (!this.getExpanded()) {
|
|
183
|
+
this._updateCollapsedLayoutWidth();
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
// ...............................................................................
|
|
188
|
+
// Internal functions
|
|
189
|
+
// ...............................................................................
|
|
190
|
+
|
|
191
|
+
ListPanelStack.prototype._onContentExpand = function(oEvent) {
|
|
192
|
+
var expanded = false;
|
|
193
|
+
var aContent = this._oLayout.getContent();
|
|
194
|
+
for (var i = 0; i < aContent.length; ++i) {
|
|
195
|
+
if (aContent[i].getExpanded()) {
|
|
196
|
+
expanded = true;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
this.setExpanded(expanded);
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
ListPanelStack.prototype._onContentHeaderIconPress = function(oEvent) {
|
|
203
|
+
var bsetExpand = oEvent.oSource.getExpanded() ? false : true;
|
|
204
|
+
oEvent.oSource.setExpanded(bsetExpand);
|
|
205
|
+
var bExpand = false;
|
|
206
|
+
var aContent = this._oLayout.getContent();
|
|
207
|
+
for (var i = 0; i < aContent.length; ++i) {
|
|
208
|
+
if (aContent[i].getExpanded()) {
|
|
209
|
+
bExpand = true;
|
|
210
|
+
break;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
this.setExpanded(bExpand);
|
|
214
|
+
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
ListPanelStack.prototype._expand = function() {
|
|
218
|
+
this._oLayout.removeStyleClass("sapUiVkLPSCollapse");
|
|
219
|
+
this._oLayout.setWidth(this.getProperty("width"));
|
|
220
|
+
this.setProperty("expanded", true, true);
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
ListPanelStack.prototype._collapse = function() {
|
|
224
|
+
if (!this.getCollapsible()) {
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// make sure all panels are collapsed
|
|
229
|
+
var aContent = this.getContent();
|
|
230
|
+
for (var i = 0; i < aContent.length; ++i) {
|
|
231
|
+
aContent[i].setExpanded(false);
|
|
232
|
+
}
|
|
233
|
+
// collapse the stack
|
|
234
|
+
this._oLayout.addStyleClass("sapUiVkLPSCollapse");
|
|
235
|
+
|
|
236
|
+
this._updateCollapsedLayoutWidth();
|
|
237
|
+
|
|
238
|
+
this.setProperty("expanded", false, true);
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
ListPanelStack.prototype._updateCollapsedLayoutWidth = function() {
|
|
242
|
+
// Checking if any ancestor of this element has the compact class;
|
|
243
|
+
// we do not to apply the cozy size if the sapUiSizeCompact class
|
|
244
|
+
// exists on an element which is not an ancestor.
|
|
245
|
+
if (this._oLayout.$().closest(".sapUiSizeCompact").length === 0) {
|
|
246
|
+
this._oLayout.setWidth("3rem");
|
|
247
|
+
} else {
|
|
248
|
+
this._oLayout.setWidth("2.5rem");
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
return ListPanelStack;
|
|
253
|
+
|
|
254
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* SAP UI development toolkit for HTML5 (SAPUI5) (c) Copyright 2009-2012 SAP AG. All rights reserved
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
sap.ui.define(function() {
|
|
6
|
+
"use strict";
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
* @class Legend renderer. @static
|
|
10
|
+
*/
|
|
11
|
+
var ListPanelStackRenderer = {
|
|
12
|
+
apiVersion: 2
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Renders the HTML for the given control, using the provided {@link sap.ui.core.RenderManager}.
|
|
17
|
+
*
|
|
18
|
+
* @param {sap.ui.core.RenderManager} oRm the RenderManager that can be used for writing to the render output buffer
|
|
19
|
+
* @param {sap.ui.core.Control} oControl an object representation of the control that should be rendered
|
|
20
|
+
*/
|
|
21
|
+
ListPanelStackRenderer.render = function(oRm, oControl) {
|
|
22
|
+
oControl._oLayout.addStyleClass("sapUiVkListPanelStack");
|
|
23
|
+
// render the internal Panel.
|
|
24
|
+
oRm.renderControl(oControl._oLayout);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
return ListPanelStackRenderer;
|
|
28
|
+
|
|
29
|
+
}, /* bExport= */true);
|