@openui5/sap.ui.mdc 1.96.2 → 1.97.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.
Files changed (196) hide show
  1. package/.reuse/dep5 +1 -1
  2. package/THIRDPARTY.txt +2 -1
  3. package/package.json +4 -4
  4. package/src/sap/ui/mdc/.library +1 -1
  5. package/src/sap/ui/mdc/ActionToolbar.js +2 -7
  6. package/src/sap/ui/mdc/Chart.js +1 -1
  7. package/src/sap/ui/mdc/ChartNew.js +1 -1
  8. package/src/sap/ui/mdc/ChartNewRenderer.js +2 -2
  9. package/src/sap/ui/mdc/Control.js +1 -1
  10. package/src/sap/ui/mdc/Element.js +1 -1
  11. package/src/sap/ui/mdc/Field.js +3 -2
  12. package/src/sap/ui/mdc/FilterBar.js +1 -1
  13. package/src/sap/ui/mdc/FilterField.js +16 -2
  14. package/src/sap/ui/mdc/Link.js +1 -1
  15. package/src/sap/ui/mdc/MultiValueField.js +2 -1
  16. package/src/sap/ui/mdc/Table.js +161 -133
  17. package/src/sap/ui/mdc/TableDelegate.js +13 -11
  18. package/src/sap/ui/mdc/ValueHelp.js +33 -7
  19. package/src/sap/ui/mdc/ValueHelpDelegate.js +20 -0
  20. package/src/sap/ui/mdc/actiontoolbar/ActionToolbarAction.js +1 -1
  21. package/src/sap/ui/mdc/chart/SelectionDetailsActions.js +1 -1
  22. package/src/sap/ui/mdc/chart/ToolbarHandler.js +1 -1
  23. package/src/sap/ui/mdc/chartNew/ChartSelectionDetailsNew.js +1 -1
  24. package/src/sap/ui/mdc/chartNew/ChartToolbarNew.js +1 -1
  25. package/src/sap/ui/mdc/chartNew/PropertyHelperNew.js +1 -1
  26. package/src/sap/ui/mdc/condition/Condition.js +1 -1
  27. package/src/sap/ui/mdc/condition/ConditionConverter.js +1 -1
  28. package/src/sap/ui/mdc/condition/ConditionModel.js +1 -1
  29. package/src/sap/ui/mdc/condition/FilterConverter.js +1 -1
  30. package/src/sap/ui/mdc/condition/FilterOperatorUtil.js +6 -2
  31. package/src/sap/ui/mdc/condition/Operator.js +9 -9
  32. package/src/sap/ui/mdc/condition/OperatorDynamicDateOption.js +437 -0
  33. package/src/sap/ui/mdc/condition/RangeOperator.js +1 -1
  34. package/src/sap/ui/mdc/designtime/chart/ChartNew.designtime.js +17 -17
  35. package/src/sap/ui/mdc/designtime/field/Field.designtime.js +21 -0
  36. package/src/sap/ui/mdc/designtime/field/FieldBase.designtime.js +104 -0
  37. package/src/sap/ui/mdc/designtime/field/FilterField.designtime.js +22 -0
  38. package/src/sap/ui/mdc/designtime/field/MultiValueField.designtime.js +23 -0
  39. package/src/sap/ui/mdc/field/BoolFieldHelp.js +1 -1
  40. package/src/sap/ui/mdc/field/ConditionFieldHelp.js +1 -1
  41. package/src/sap/ui/mdc/field/ConditionType.js +7 -7
  42. package/src/sap/ui/mdc/field/ConditionsType.js +7 -7
  43. package/src/sap/ui/mdc/field/CustomFieldHelp.js +1 -1
  44. package/src/sap/ui/mdc/field/CustomFieldInfo.js +1 -1
  45. package/src/sap/ui/mdc/field/DefineConditionPanel.js +1 -1
  46. package/src/sap/ui/mdc/field/DynamicDateRangeConditionsType.js +311 -0
  47. package/src/sap/ui/mdc/field/FieldBase.js +54 -47
  48. package/src/sap/ui/mdc/field/FieldHelpBase.js +1 -1
  49. package/src/sap/ui/mdc/field/FieldInfoBase.js +1 -1
  50. package/src/sap/ui/mdc/field/FieldInput.js +1 -1
  51. package/src/sap/ui/mdc/field/FieldInputRenderUtil.js +1 -1
  52. package/src/sap/ui/mdc/field/FieldMultiInput.js +1 -1
  53. package/src/sap/ui/mdc/field/FieldValueHelp.js +6 -6
  54. package/src/sap/ui/mdc/field/FieldValueHelpContentWrapperBase.js +1 -1
  55. package/src/sap/ui/mdc/field/FieldValueHelpDelegate.js +20 -0
  56. package/src/sap/ui/mdc/field/FieldValueHelpMTableWrapper.js +1 -1
  57. package/src/sap/ui/mdc/field/FieldValueHelpMdcTableWrapper.js +1 -1
  58. package/src/sap/ui/mdc/field/FieldValueHelpTableWrapperBase.js +2 -1
  59. package/src/sap/ui/mdc/field/FieldValueHelpUITableWrapper.js +1 -1
  60. package/src/sap/ui/mdc/field/InParameter.js +1 -1
  61. package/src/sap/ui/mdc/field/ListFieldHelp.js +1 -1
  62. package/src/sap/ui/mdc/field/ListFieldHelpItem.js +1 -1
  63. package/src/sap/ui/mdc/field/MultiValueFieldItem.js +1 -1
  64. package/src/sap/ui/mdc/field/OutParameter.js +1 -1
  65. package/src/sap/ui/mdc/field/ValueHelpPanel.js +2 -1
  66. package/src/sap/ui/mdc/field/content/BooleanContent.js +1 -1
  67. package/src/sap/ui/mdc/field/content/ContentFactory.js +23 -21
  68. package/src/sap/ui/mdc/field/content/DateContent.js +128 -2
  69. package/src/sap/ui/mdc/field/content/DateTimeContent.js +9 -1
  70. package/src/sap/ui/mdc/field/content/DefaultContent.js +1 -1
  71. package/src/sap/ui/mdc/field/content/TimeContent.js +8 -1
  72. package/src/sap/ui/mdc/field/content/UnitContent.js +23 -4
  73. package/src/sap/ui/mdc/filterbar/FilterBarBase.js +25 -17
  74. package/src/sap/ui/mdc/filterbar/PropertyHelper.js +1 -1
  75. package/src/sap/ui/mdc/filterbar/p13n/AdaptationFilterBar.js +1 -1
  76. package/src/sap/ui/mdc/filterbar/vh/FilterBar.js +1 -1
  77. package/src/sap/ui/mdc/flexibility/Chart.flexibility.js +1 -1
  78. package/src/sap/ui/mdc/flexibility/FilterBar.flexibility.js +1 -1
  79. package/src/sap/ui/mdc/flexibility/FilterItemFlex.js +1 -1
  80. package/src/sap/ui/mdc/library.js +19 -3
  81. package/src/sap/ui/mdc/link/ContactDetails.js +1 -1
  82. package/src/sap/ui/mdc/link/ContactDetailsAddressItem.js +1 -1
  83. package/src/sap/ui/mdc/link/ContactDetailsEmailItem.js +1 -1
  84. package/src/sap/ui/mdc/link/ContactDetailsItem.js +1 -1
  85. package/src/sap/ui/mdc/link/ContactDetailsPhoneItem.js +1 -1
  86. package/src/sap/ui/mdc/link/Factory.js +1 -1
  87. package/src/sap/ui/mdc/link/FakeFlpConnector.js +1 -1
  88. package/src/sap/ui/mdc/link/LinkItem.js +1 -1
  89. package/src/sap/ui/mdc/link/Panel.js +1 -1
  90. package/src/sap/ui/mdc/link/PanelItem.js +1 -1
  91. package/src/sap/ui/mdc/link/PanelListItem.js +1 -1
  92. package/src/sap/ui/mdc/link/SelectionDialog.js +1 -1
  93. package/src/sap/ui/mdc/link/SelectionDialogItem.js +1 -1
  94. package/src/sap/ui/mdc/link/SemanticObjectMapping.js +1 -1
  95. package/src/sap/ui/mdc/link/SemanticObjectMappingItem.js +1 -1
  96. package/src/sap/ui/mdc/link/SemanticObjectUnavailableAction.js +1 -1
  97. package/src/sap/ui/mdc/messagebundle.properties +13 -4
  98. package/src/sap/ui/mdc/messagebundle_ar.properties +8 -2
  99. package/src/sap/ui/mdc/messagebundle_bg.properties +8 -2
  100. package/src/sap/ui/mdc/messagebundle_ca.properties +8 -2
  101. package/src/sap/ui/mdc/messagebundle_cs.properties +8 -2
  102. package/src/sap/ui/mdc/messagebundle_cy.properties +8 -2
  103. package/src/sap/ui/mdc/messagebundle_da.properties +8 -2
  104. package/src/sap/ui/mdc/messagebundle_de.properties +8 -2
  105. package/src/sap/ui/mdc/messagebundle_el.properties +8 -2
  106. package/src/sap/ui/mdc/messagebundle_en.properties +8 -2
  107. package/src/sap/ui/mdc/messagebundle_en_GB.properties +8 -2
  108. package/src/sap/ui/mdc/messagebundle_en_US_sappsd.properties +14 -0
  109. package/src/sap/ui/mdc/messagebundle_en_US_saprigi.properties +3 -19
  110. package/src/sap/ui/mdc/messagebundle_en_US_saptrc.properties +14 -0
  111. package/src/sap/ui/mdc/messagebundle_es.properties +9 -3
  112. package/src/sap/ui/mdc/messagebundle_es_MX.properties +8 -2
  113. package/src/sap/ui/mdc/messagebundle_et.properties +8 -2
  114. package/src/sap/ui/mdc/messagebundle_fi.properties +8 -2
  115. package/src/sap/ui/mdc/messagebundle_fr.properties +12 -6
  116. package/src/sap/ui/mdc/messagebundle_fr_CA.properties +8 -2
  117. package/src/sap/ui/mdc/messagebundle_hi.properties +8 -2
  118. package/src/sap/ui/mdc/messagebundle_hr.properties +8 -2
  119. package/src/sap/ui/mdc/messagebundle_hu.properties +8 -2
  120. package/src/sap/ui/mdc/messagebundle_id.properties +8 -2
  121. package/src/sap/ui/mdc/messagebundle_it.properties +8 -2
  122. package/src/sap/ui/mdc/messagebundle_iw.properties +8 -2
  123. package/src/sap/ui/mdc/messagebundle_ja.properties +8 -2
  124. package/src/sap/ui/mdc/messagebundle_kk.properties +8 -2
  125. package/src/sap/ui/mdc/messagebundle_ko.properties +8 -2
  126. package/src/sap/ui/mdc/messagebundle_lt.properties +8 -2
  127. package/src/sap/ui/mdc/messagebundle_lv.properties +8 -2
  128. package/src/sap/ui/mdc/messagebundle_ms.properties +8 -2
  129. package/src/sap/ui/mdc/messagebundle_nl.properties +8 -2
  130. package/src/sap/ui/mdc/messagebundle_no.properties +8 -2
  131. package/src/sap/ui/mdc/messagebundle_pl.properties +8 -2
  132. package/src/sap/ui/mdc/messagebundle_pt.properties +8 -2
  133. package/src/sap/ui/mdc/messagebundle_pt_PT.properties +8 -2
  134. package/src/sap/ui/mdc/messagebundle_ro.properties +8 -2
  135. package/src/sap/ui/mdc/messagebundle_ru.properties +8 -2
  136. package/src/sap/ui/mdc/messagebundle_sh.properties +8 -2
  137. package/src/sap/ui/mdc/messagebundle_sk.properties +8 -2
  138. package/src/sap/ui/mdc/messagebundle_sl.properties +8 -2
  139. package/src/sap/ui/mdc/messagebundle_sv.properties +8 -2
  140. package/src/sap/ui/mdc/messagebundle_th.properties +8 -2
  141. package/src/sap/ui/mdc/messagebundle_tr.properties +8 -2
  142. package/src/sap/ui/mdc/messagebundle_uk.properties +8 -2
  143. package/src/sap/ui/mdc/messagebundle_vi.properties +8 -2
  144. package/src/sap/ui/mdc/messagebundle_zh_CN.properties +8 -2
  145. package/src/sap/ui/mdc/messagebundle_zh_TW.properties +8 -2
  146. package/src/sap/ui/mdc/mixin/AdaptationMixin.js +1 -1
  147. package/src/sap/ui/mdc/mixin/DelegateMixin.js +1 -1
  148. package/src/sap/ui/mdc/mixin/FilterIntegrationMixin.js +3 -3
  149. package/src/sap/ui/mdc/mixin/PromiseMixin.js +1 -1
  150. package/src/sap/ui/mdc/odata/v4/ChartPropertyHelperNew.js +1 -1
  151. package/src/sap/ui/mdc/odata/v4/TableDelegate.js +65 -37
  152. package/src/sap/ui/mdc/odata/v4/ValueHelpDelegate.js +1 -1
  153. package/src/sap/ui/mdc/odata/v4/vizChart/ChartDelegateNew.js +12 -3
  154. package/src/sap/ui/mdc/p13n/Engine.js +32 -9
  155. package/src/sap/ui/mdc/p13n/P13nBuilder.js +1 -1
  156. package/src/sap/ui/mdc/p13n/PersistenceProvider.js +21 -10
  157. package/src/sap/ui/mdc/p13n/PropertyHelper.js +1 -1
  158. package/src/sap/ui/mdc/p13n/StateUtil.js +20 -0
  159. package/src/sap/ui/mdc/p13n/UIManager.js +11 -6
  160. package/src/sap/ui/mdc/p13n/{DefaultProviderRegistry.js → modules/DefaultProviderRegistry.js} +2 -2
  161. package/src/sap/ui/mdc/p13n/modules/StateHandlerRegistry.js +86 -0
  162. package/src/sap/ui/mdc/p13n/panels/AdaptFiltersPanel.js +19 -3
  163. package/src/sap/ui/mdc/p13n/panels/ChartItemPanelNew.js +40 -32
  164. package/src/sap/ui/mdc/p13n/subcontroller/AggregateController.js +1 -1
  165. package/src/sap/ui/mdc/p13n/subcontroller/BaseController.js +1 -1
  166. package/src/sap/ui/mdc/table/Column.js +34 -9
  167. package/src/sap/ui/mdc/table/CreationRow.js +14 -13
  168. package/src/sap/ui/mdc/table/GridTableType.js +11 -10
  169. package/src/sap/ui/mdc/table/PropertyHelper.js +21 -21
  170. package/src/sap/ui/mdc/table/ResponsiveTableType.js +23 -24
  171. package/src/sap/ui/mdc/table/RowSettings.js +8 -6
  172. package/src/sap/ui/mdc/table/TableTypeBase.js +4 -4
  173. package/src/sap/ui/mdc/table/V4AnalyticsPropertyHelper.js +15 -71
  174. package/src/sap/ui/mdc/themes/base/Chart.less +3 -0
  175. package/src/sap/ui/mdc/themes/base/library.source.less +1 -0
  176. package/src/sap/ui/mdc/ui/Container.js +2 -2
  177. package/src/sap/ui/mdc/ui/ContainerItem.js +2 -2
  178. package/src/sap/ui/mdc/util/PromiseCache.js +1 -1
  179. package/src/sap/ui/mdc/util/PropertyHelper.js +111 -319
  180. package/src/sap/ui/mdc/valuehelp/Dialog.js +2 -1
  181. package/src/sap/ui/mdc/valuehelp/Popover.js +13 -2
  182. package/src/sap/ui/mdc/valuehelp/base/Container.js +32 -1
  183. package/src/sap/ui/mdc/valuehelp/base/Content.js +35 -5
  184. package/src/sap/ui/mdc/valuehelp/base/DialogTab.js +1 -1
  185. package/src/sap/ui/mdc/valuehelp/base/FilterableListContent.js +42 -15
  186. package/src/sap/ui/mdc/valuehelp/base/ListContent.js +1 -1
  187. package/src/sap/ui/mdc/valuehelp/content/Bool.js +1 -1
  188. package/src/sap/ui/mdc/valuehelp/content/Conditions.js +25 -31
  189. package/src/sap/ui/mdc/valuehelp/content/FixedList.js +1 -1
  190. package/src/sap/ui/mdc/valuehelp/content/MDCTable.js +8 -3
  191. package/src/sap/ui/mdc/valuehelp/content/MTable.js +15 -3
  192. package/test/sap/ui/mdc/testutils/opa/p13n/Actions.js +102 -96
  193. package/src/sap/ui/mdc/p13n/panels/GroupPanel.js +0 -111
  194. package/src/sap/ui/mdc/p13n/panels/QueryPanel.js +0 -322
  195. package/src/sap/ui/mdc/p13n/panels/SortQueryPanel.js +0 -133
  196. package/src/sap/ui/mdc/p13n/panels/Wrapper.js +0 -203
@@ -1,133 +0,0 @@
1
- /*
2
- * ! OpenUI5
3
- * (c) Copyright 2009-2021 SAP SE or an SAP affiliate company.
4
- * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
- */
6
- sap.ui.define([
7
- "./QueryPanel", "sap/m/Text", "sap/m/SegmentedButton", "sap/m/SegmentedButtonItem", "sap/ui/layout/Grid", "sap/ui/layout/GridData"
8
- ], function (QueryPanel, Text, SegmentedButton, SegmentedButtonItem, Grid, GridData) {
9
- "use strict";
10
-
11
- /**
12
- * Constructor for a new SortQueryPanel. The SortQueryPanel can be used
13
- * to personalize sorters for a control by using a sort specific QueryPanel
14
- * implementation. The SortQueryPanel will enhance the QueryPanel by
15
- * adding a toggle to switch between ascending and desceding sortorder by also
16
- * displaying this configuration in form of a text control.
17
- *
18
- * @class
19
- * @extends sap.ui.mdc.p13n.panels.QueryPanel
20
- *
21
- * @author SAP SE
22
- * @version 1.96.2
23
- *
24
- * @private
25
- * @ui5-restricted sap.ui.mdc
26
- * @experimental
27
- * @since 1.90
28
- * @alias sap.ui.mdc.p13n.panels.SortQueryPanel
29
- */
30
- var SortQueryPanel = QueryPanel.extend("sap.ui.mdc.p13n.panels.SortQueryPanel", {
31
- renderer: {}
32
- });
33
-
34
-
35
- SortQueryPanel.prototype._createRemoveButton = function () {
36
- var oRemvoeBtn = QueryPanel.prototype._createRemoveButton.apply(this, arguments);
37
- oRemvoeBtn.setLayoutData(new GridData({
38
- span: "XL3 L3 M3 S4"//on "S" the Asc/Desc text is invisible, we need to increase the size the
39
- }));
40
- return oRemvoeBtn;
41
- };
42
-
43
- SortQueryPanel.prototype._createOrderSwitch = function (sKey, bDesc) {
44
- var oSortOrderSwitch = new SegmentedButton({
45
- enabled: sKey ? true : false,
46
- layoutData: new GridData({
47
- span: "XL2 L2 M2 S4" //on "S" the Asc/Desc text is invisible, we need to increase the size then
48
- }),
49
- items: [
50
- new SegmentedButtonItem({
51
- key: "asc",
52
- icon: "sap-icon://sort-ascending"
53
- }),
54
- new SegmentedButtonItem({
55
- key: "desc",
56
- icon: "sap-icon://sort-descending"
57
- })
58
- ],
59
- select: function (oEvt) {
60
- var sSortOrder = oEvt.getParameter("key");
61
- var oText = oEvt.getSource().getParent().getContent()[2];
62
- oText.setText(this._getSortOrderText(sSortOrder === "desc"));
63
- var sKey = oEvt.oSource.getParent().getContent()[0].getSelectedItem().getKey();
64
-
65
- this._changeOrder(sKey, sSortOrder == "desc");
66
- }.bind(this)
67
- });
68
-
69
- oSortOrderSwitch.setSelectedItem(bDesc ? oSortOrderSwitch.getItems()[1] : oSortOrderSwitch.getItems()[0]);
70
-
71
- return oSortOrderSwitch;
72
- };
73
-
74
- SortQueryPanel.prototype._createSortOrderText = function (bDesc) {
75
- return new Text({
76
- layoutData: new GridData({
77
- span: "XL3 L3 M3 S3",
78
- visibleS: false
79
- }),
80
- text: this._getSortOrderText(bDesc)
81
- }).addStyleClass("sapUiTinyMarginTop");
82
- };
83
-
84
- SortQueryPanel.prototype._createQueryRowGrid = function(oItem) {
85
- //Enhance row with sort specific controls (Segmented Button + sort order text)
86
- var oSelect = this._createKeySelect(oItem.name);
87
- var oSortOrderSwitch = this._createOrderSwitch(oItem.name, oItem.descending);
88
- var oSortOrderText = this._createSortOrderText(oItem.descending);
89
-
90
- return new Grid({
91
- containerQuery: true,
92
- defaultSpan: "XL4 L4 M4 S4",
93
- content: [
94
- oSelect,
95
- oSortOrderSwitch,
96
- oSortOrderText
97
- ]
98
- }).addStyleClass("sapUiTinyMargin");
99
- };
100
-
101
- SortQueryPanel.prototype._selectKey = function(oEvt) {
102
- QueryPanel.prototype._selectKey.apply(this, arguments);
103
-
104
- //Enable SegmentedButton
105
- var oListItem = oEvt.getSource().getParent().getParent();
106
- var sNewKey = oEvt.getParameter("selectedItem").getKey();
107
- oListItem.getContent()[0].getContent()[1].setEnabled(sNewKey !== this.NONE_KEY);
108
-
109
- //keep existing 'sortorder' selection
110
- var bDescending = oListItem.getContent()[0].getContent()[1].getSelectedKey() === "desc";
111
- this._changeOrder(sNewKey, bDescending);
112
- };
113
-
114
- SortQueryPanel.prototype._getSortOrderText = function(bDesc) {
115
- return bDesc ? this.getResourceText("sort.PERSONALIZATION_DIALOG_OPTION_DESCENDING") : this.getResourceText("sort.PERSONALIZATION_DIALOG_OPTION_ASCENDING");
116
- };
117
-
118
- SortQueryPanel.prototype._changeOrder = function (sKey, bDesc) {
119
- var aItems = this.getP13nModel().getProperty("/items").filter(function (oItem) {
120
- return oItem.name === sKey;
121
- });
122
-
123
- aItems[0].descending = bDesc;
124
-
125
- this.fireChange({
126
- reason: "change",
127
- item: aItems[0]
128
- });
129
- };
130
-
131
- return SortQueryPanel;
132
-
133
- });
@@ -1,203 +0,0 @@
1
- /*
2
- * ! OpenUI5
3
- * (c) Copyright 2009-2021 SAP SE or an SAP affiliate company.
4
- * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
- */
6
- sap.ui.define([
7
- "sap/ui/mdc/ui/Container",
8
- "sap/m/Bar",
9
- "sap/m/Button",
10
- "sap/m/List",
11
- "sap/m/IconTabBar",
12
- "sap/m/IconTabFilter",
13
- "sap/ui/mdc/ui/ContainerItem",
14
- "sap/ui/Device",
15
- "sap/m/library",
16
- "sap/m/StandardListItem"
17
- ], function (Container, Bar, Button, List, IconTabBar, IconTabFilter, ContainerItem, Device, mLibrary, StandardListItem) {
18
- "use strict";
19
-
20
- // shortcut for sap.m.ButtonType
21
- var ButtonType = mLibrary.ButtonType;
22
-
23
- // shortcut for sap.m.ListType
24
- var ListItemType = mLibrary.ListType;
25
-
26
- /**
27
- * Constructor for a new Wrapper. The Wrapper can be used
28
- * to dynamically add personalization content to a switchable
29
- * layout container, by allowing to switch the content using
30
- * an <code>IconTabBar</code> or a <code>List</code> control,
31
- * depending on the desired layout mode.
32
- *
33
- * @class
34
- * @extends sap.ui.mdc.ui.Container
35
- *
36
- * @author SAP SE
37
- * @version 1.96.2
38
- *
39
- * @private
40
- * @ui5-restricted sap.ui.mdc
41
- * @experimental
42
- * @since 1.90
43
- * @alias sap.ui.mdc.p13n.panels.Wrapper
44
- */
45
- var Wrapper = Container.extend("sap.ui.mdc.p13n.panels.Wrapper", {
46
- metadata: {
47
- library: "sap.ui.mdc",
48
- properties: {
49
- listLayout: {
50
- type: "Boolean",
51
- defaultValue: false
52
- }
53
- }
54
- },
55
- renderer: {
56
- apiVersion: 2
57
- }
58
- });
59
-
60
- Wrapper.prototype.DEFAULT_KEY = "$default";
61
-
62
- Wrapper.prototype.init = function () {
63
- Container.prototype.init.apply(this, arguments);
64
- this.addStyleClass("sapUiMDCP13nWrapper");
65
- this.setListLayout(Device.system.phone);
66
- };
67
-
68
- Wrapper.prototype.setListLayout = function (bListLayout) {
69
- this.setProperty("listLayout", bListLayout);
70
-
71
- //clear existing navigation items
72
- this._getTabBar().removeAllItems();
73
- this._getNavigationList().removeAllItems();
74
- var oHeaderContent = [];
75
-
76
- //update navigator control
77
- if (bListLayout) {
78
- this._getTabBar().setVisible(false);
79
- this._getNavigationList();
80
- this.switchView(this.DEFAULT_KEY);
81
- oHeaderContent.push(this._getNavBackBtn());
82
- } else {
83
- this._getTabBar().setVisible(true);
84
- var aViews = this.getViews();
85
- if (aViews.length > 1) {
86
- //0 is $default, use index 1 as the first "custom" added view
87
- this.switchView(aViews[1].getKey());
88
- }
89
- oHeaderContent.push(this._getTabBar());
90
- }
91
-
92
- var oBar = new Bar({
93
- contentLeft: oHeaderContent
94
- });
95
- this.setHeader(oBar);
96
-
97
- //recreate the navigation items
98
- this.getViewMap().forEach(function (mView) {
99
- this._addToNavigator(mView.key);
100
- }.bind(this));
101
-
102
- return this;
103
- };
104
-
105
- Wrapper.prototype._getTabBar = function () {
106
- if (!this._oTabBar) {
107
- this._oTabBar = new IconTabBar({
108
- expandable: false,
109
- expanded: true,
110
- select: function (oEvt) {
111
- this.switchView(oEvt.getParameter("key"));
112
- }.bind(this)
113
- });
114
- this.addDependent(this._oTabBar);
115
- }
116
- return this._oTabBar;
117
- };
118
-
119
- Wrapper.prototype._getNavigationList = function () {
120
- if (!this._oNavigationList) {
121
- this._oNavigationList = new List({
122
- itemPress: function (oEvt) {
123
- var oItem = oEvt.getParameter("listItem");
124
- this.switchView(oItem._key);
125
- }.bind(this)
126
- }).addStyleClass("wrapperDefaultList");
127
- this.addDependent(this._oNavigationList);
128
- }
129
- if (!this.getView(this.DEFAULT_KEY)) {
130
- var oListContainer = new ContainerItem({
131
- key: this.DEFAULT_KEY,
132
- content: this._oNavigationList
133
- });
134
- this.addView(oListContainer);
135
- }
136
-
137
- return this._oNavigationList;
138
- };
139
-
140
- Wrapper.prototype._getNavBackBtn = function () {
141
- if (!this._oNavBackBtn) {
142
- this._oNavBackBtn = new Button({
143
- type: ButtonType.Back,
144
- press: function (oEvt) {
145
- this.switchView(this.DEFAULT_KEY);
146
- }.bind(this)
147
- });
148
- this.addDependent(this._oNavBackBtn);
149
- }
150
- return this._oNavBackBtn;
151
- };
152
-
153
- Wrapper.prototype.addPanel = function (oPanel, sKey, sTab) {
154
- var oContainerItem = new ContainerItem({
155
- key: sKey,
156
- content: oPanel
157
- });
158
-
159
- this._addToNavigator(sKey, sTab);
160
-
161
- this.addView(oContainerItem);
162
- };
163
-
164
- Wrapper.prototype.switchView = function (sKey) {
165
- Container.prototype.switchView.apply(this, arguments);
166
- this.oLayout.setShowHeader(sKey !== this.DEFAULT_KEY); //Don't show header in dafault view (avoid empty space),
167
- this._getTabBar().setSelectedKey(sKey);
168
- this._getNavBackBtn().setVisible(sKey !== this.DEFAULT_KEY);
169
- this._getNavBackBtn().setText(sKey);
170
- };
171
-
172
- Wrapper.prototype._addToNavigator = function (sKey, sText) {
173
-
174
- if (sKey == this.DEFAULT_KEY) {
175
- return;
176
- }
177
-
178
- if (this.getListLayout()) {
179
- this.getView(this.DEFAULT_KEY);
180
- var oItem = new StandardListItem({
181
- type: ListItemType.Navigation,
182
- title: sText
183
- });
184
- oItem._key = sKey;
185
- this._getNavigationList().addItem(oItem);
186
- } else {
187
- this._getTabBar().addItem(new IconTabFilter({
188
- key: sKey,
189
- text: sText || sKey
190
- }));
191
- }
192
- };
193
-
194
- Wrapper.prototype.exit = function () {
195
- Container.prototype.exit.apply(this, arguments);
196
- this._oTabBar = null;
197
- this._oNavigationList = null;
198
- this._oNavBackBtn = null;
199
- };
200
-
201
- return Wrapper;
202
-
203
- });