@openui5/sap.ui.mdc 1.94.0 → 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.
- package/.reuse/dep5 +12 -12
- package/THIRDPARTY.txt +21 -17
- package/package.json +4 -4
- package/src/sap/ui/mdc/.library +1 -1
- package/src/sap/ui/mdc/ActionToolbar.js +231 -334
- package/src/sap/ui/mdc/Chart.js +148 -21
- package/src/sap/ui/mdc/ChartDelegateNew.js +15 -0
- package/src/sap/ui/mdc/ChartNew.js +83 -56
- package/src/sap/ui/mdc/ChartNewRenderer.js +2 -2
- package/src/sap/ui/mdc/Control.js +4 -3
- package/src/sap/ui/mdc/Element.js +5 -4
- package/src/sap/ui/mdc/Field.js +3 -2
- package/src/sap/ui/mdc/FilterBar.js +1 -10
- package/src/sap/ui/mdc/FilterField.js +42 -4
- package/src/sap/ui/mdc/Link.js +2 -2
- package/src/sap/ui/mdc/MultiValueField.js +2 -1
- package/src/sap/ui/mdc/Table.js +285 -186
- package/src/sap/ui/mdc/TableDelegate.js +13 -11
- package/src/sap/ui/mdc/ValueHelp.js +1500 -0
- package/src/sap/ui/mdc/ValueHelpDelegate.js +167 -0
- package/src/sap/ui/mdc/actiontoolbar/ActionToolbarAction.js +49 -104
- package/src/sap/ui/mdc/chart/DimensionItem.js +3 -3
- package/src/sap/ui/mdc/chart/Item.js +2 -3
- package/src/sap/ui/mdc/chart/MeasureItem.js +2 -2
- package/src/sap/ui/mdc/chart/SelectionDetailsActions.js +21 -2
- package/src/sap/ui/mdc/chart/ToolbarHandler.js +237 -226
- package/src/sap/ui/mdc/chartNew/ChartSelectionDetailsNew.js +1 -1
- package/src/sap/ui/mdc/chartNew/ChartToolbarNew.js +14 -10
- package/src/sap/ui/mdc/chartNew/ChartTypeButtonNew.js +1 -1
- package/src/sap/ui/mdc/chartNew/DrillStackHandlerNew.js +11 -9
- package/src/sap/ui/mdc/chartNew/ItemNew.js +0 -1
- package/src/sap/ui/mdc/chartNew/PropertyHelperNew.js +1 -1
- package/src/sap/ui/mdc/condition/Condition.js +2 -2
- package/src/sap/ui/mdc/condition/ConditionConverter.js +1 -1
- package/src/sap/ui/mdc/condition/ConditionModel.js +1 -1
- package/src/sap/ui/mdc/condition/FilterConverter.js +1 -1
- package/src/sap/ui/mdc/condition/FilterOperatorUtil.js +6 -2
- package/src/sap/ui/mdc/condition/Operator.js +9 -9
- package/src/sap/ui/mdc/condition/OperatorDynamicDateOption.js +437 -0
- package/src/sap/ui/mdc/condition/RangeOperator.js +1 -1
- package/src/sap/ui/mdc/designtime/actiontoolbar/ActionToolbar.designtime.js +43 -0
- package/src/sap/ui/mdc/designtime/chart/ChartNew.designtime.js +91 -0
- package/src/sap/ui/mdc/designtime/field/Field.designtime.js +21 -0
- package/src/sap/ui/mdc/designtime/field/FieldBase.designtime.js +104 -0
- package/src/sap/ui/mdc/designtime/field/FilterField.designtime.js +22 -0
- package/src/sap/ui/mdc/designtime/field/MultiValueField.designtime.js +23 -0
- package/src/sap/ui/mdc/designtime/filterbar/FilterBar.designtime.js +19 -0
- package/src/sap/ui/mdc/designtime/filterbar/FilterBarBase.designtime.js +31 -0
- package/src/sap/ui/mdc/designtime/table/Table.designtime.js +5 -0
- package/src/sap/ui/mdc/enum/ContentMode.js +25 -4
- package/src/sap/ui/mdc/enum/SelectType.js +43 -0
- package/src/sap/ui/mdc/field/BoolFieldHelp.js +1 -1
- package/src/sap/ui/mdc/field/ConditionFieldHelp.js +1 -1
- package/src/sap/ui/mdc/field/ConditionType.js +67 -35
- package/src/sap/ui/mdc/field/ConditionsType.js +12 -10
- package/src/sap/ui/mdc/field/CustomFieldHelp.js +1 -1
- package/src/sap/ui/mdc/field/CustomFieldInfo.js +1 -1
- package/src/sap/ui/mdc/field/DefineConditionPanel.js +13 -2
- package/src/sap/ui/mdc/field/DynamicDateRangeConditionsType.js +311 -0
- package/src/sap/ui/mdc/field/FieldBase.js +143 -83
- package/src/sap/ui/mdc/field/FieldBaseDelegate.js +9 -2
- package/src/sap/ui/mdc/field/FieldHelpBase.js +64 -4
- package/src/sap/ui/mdc/field/FieldInfoBase.js +9 -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 +12 -6
- package/src/sap/ui/mdc/field/FieldValueHelpContentWrapperBase.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelpDelegate.js +20 -0
- package/src/sap/ui/mdc/field/FieldValueHelpMTableWrapper.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelpMdcTableWrapper.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelpTableWrapperBase.js +2 -1
- package/src/sap/ui/mdc/field/FieldValueHelpUITableWrapper.js +1 -1
- package/src/sap/ui/mdc/field/InParameter.js +1 -1
- package/src/sap/ui/mdc/field/ListFieldHelp.js +1 -1
- package/src/sap/ui/mdc/field/ListFieldHelpItem.js +1 -1
- package/src/sap/ui/mdc/field/MultiValueFieldItem.js +1 -1
- package/src/sap/ui/mdc/field/OutParameter.js +1 -1
- package/src/sap/ui/mdc/field/ValueHelpPanel.js +2 -1
- package/src/sap/ui/mdc/field/content/BooleanContent.js +16 -4
- package/src/sap/ui/mdc/field/content/ContentFactory.js +34 -24
- package/src/sap/ui/mdc/field/content/DateContent.js +128 -2
- package/src/sap/ui/mdc/field/content/DateTimeContent.js +9 -1
- package/src/sap/ui/mdc/field/content/DefaultContent.js +65 -24
- package/src/sap/ui/mdc/field/content/LinkContent.js +6 -0
- package/src/sap/ui/mdc/field/content/SearchContent.js +21 -3
- package/src/sap/ui/mdc/field/content/TimeContent.js +8 -1
- package/src/sap/ui/mdc/field/content/UnitContent.js +25 -6
- package/src/sap/ui/mdc/filterbar/FilterBarBase.js +43 -24
- package/src/sap/ui/mdc/filterbar/PropertyHelper.js +1 -1
- package/src/sap/ui/mdc/filterbar/p13n/AdaptationFilterBar.js +1 -1
- package/src/sap/ui/mdc/filterbar/vh/FilterBar.js +1 -1
- package/src/sap/ui/mdc/flexibility/ActionToolbar.flexibility.js +22 -0
- package/src/sap/ui/mdc/flexibility/ActionToolbarAction.flexibility.js +19 -0
- package/src/sap/ui/mdc/flexibility/Chart.flexibility.js +1 -1
- package/src/sap/ui/mdc/flexibility/FilterBar.flexibility.js +1 -1
- package/src/sap/ui/mdc/flexibility/FilterItemFlex.js +1 -1
- package/src/sap/ui/mdc/flexibility/ItemBaseFlex.js +203 -197
- package/src/sap/ui/mdc/library.js +603 -5
- package/src/sap/ui/mdc/link/ContactDetails.js +1 -1
- package/src/sap/ui/mdc/link/ContactDetailsAddressItem.js +1 -1
- package/src/sap/ui/mdc/link/ContactDetailsEmailItem.js +1 -1
- package/src/sap/ui/mdc/link/ContactDetailsItem.js +1 -1
- package/src/sap/ui/mdc/link/ContactDetailsPhoneItem.js +1 -1
- package/src/sap/ui/mdc/link/Factory.js +1 -1
- package/src/sap/ui/mdc/link/FakeFlpConnector.js +1 -1
- package/src/sap/ui/mdc/link/LinkItem.js +1 -1
- package/src/sap/ui/mdc/link/Panel.js +1 -1
- package/src/sap/ui/mdc/link/PanelItem.js +1 -1
- package/src/sap/ui/mdc/link/PanelListItem.js +1 -1
- package/src/sap/ui/mdc/link/SelectionDialog.js +2 -2
- package/src/sap/ui/mdc/link/SelectionDialogItem.js +1 -1
- package/src/sap/ui/mdc/link/SemanticObjectMapping.js +1 -1
- package/src/sap/ui/mdc/link/SemanticObjectMappingItem.js +1 -1
- package/src/sap/ui/mdc/link/SemanticObjectUnavailableAction.js +1 -1
- package/src/sap/ui/mdc/messagebundle.properties +37 -3
- package/src/sap/ui/mdc/messagebundle_ar.properties +24 -3
- package/src/sap/ui/mdc/messagebundle_bg.properties +23 -2
- package/src/sap/ui/mdc/messagebundle_ca.properties +23 -2
- package/src/sap/ui/mdc/messagebundle_cs.properties +36 -15
- package/src/sap/ui/mdc/messagebundle_cy.properties +23 -2
- package/src/sap/ui/mdc/messagebundle_da.properties +23 -2
- package/src/sap/ui/mdc/messagebundle_de.properties +23 -2
- package/src/sap/ui/mdc/messagebundle_el.properties +24 -3
- package/src/sap/ui/mdc/messagebundle_en.properties +23 -2
- package/src/sap/ui/mdc/messagebundle_en_GB.properties +23 -2
- package/src/sap/ui/mdc/messagebundle_en_US_sappsd.properties +23 -2
- package/src/sap/ui/mdc/messagebundle_en_US_saptrc.properties +23 -2
- package/src/sap/ui/mdc/messagebundle_es.properties +48 -27
- package/src/sap/ui/mdc/messagebundle_es_MX.properties +23 -2
- package/src/sap/ui/mdc/messagebundle_et.properties +23 -2
- package/src/sap/ui/mdc/messagebundle_fi.properties +24 -3
- package/src/sap/ui/mdc/messagebundle_fr.properties +36 -15
- package/src/sap/ui/mdc/messagebundle_fr_CA.properties +23 -2
- package/src/sap/ui/mdc/messagebundle_hi.properties +23 -2
- package/src/sap/ui/mdc/messagebundle_hr.properties +23 -2
- package/src/sap/ui/mdc/messagebundle_hu.properties +24 -3
- package/src/sap/ui/mdc/messagebundle_id.properties +23 -2
- package/src/sap/ui/mdc/messagebundle_it.properties +46 -25
- package/src/sap/ui/mdc/messagebundle_iw.properties +23 -2
- package/src/sap/ui/mdc/messagebundle_ja.properties +30 -9
- package/src/sap/ui/mdc/messagebundle_kk.properties +23 -2
- package/src/sap/ui/mdc/messagebundle_ko.properties +23 -2
- package/src/sap/ui/mdc/messagebundle_lt.properties +23 -2
- package/src/sap/ui/mdc/messagebundle_lv.properties +23 -2
- package/src/sap/ui/mdc/messagebundle_ms.properties +23 -2
- package/src/sap/ui/mdc/messagebundle_nl.properties +24 -3
- package/src/sap/ui/mdc/messagebundle_no.properties +30 -9
- package/src/sap/ui/mdc/messagebundle_pl.properties +27 -6
- package/src/sap/ui/mdc/messagebundle_pt.properties +24 -3
- package/src/sap/ui/mdc/messagebundle_pt_PT.properties +23 -2
- package/src/sap/ui/mdc/messagebundle_ro.properties +26 -5
- package/src/sap/ui/mdc/messagebundle_ru.properties +23 -2
- package/src/sap/ui/mdc/messagebundle_sh.properties +23 -2
- package/src/sap/ui/mdc/messagebundle_sk.properties +24 -3
- package/src/sap/ui/mdc/messagebundle_sl.properties +23 -2
- package/src/sap/ui/mdc/messagebundle_sv.properties +24 -3
- package/src/sap/ui/mdc/messagebundle_th.properties +29 -8
- package/src/sap/ui/mdc/messagebundle_tr.properties +23 -2
- package/src/sap/ui/mdc/messagebundle_uk.properties +23 -2
- package/src/sap/ui/mdc/messagebundle_vi.properties +23 -2
- package/src/sap/ui/mdc/messagebundle_zh_CN.properties +23 -2
- package/src/sap/ui/mdc/messagebundle_zh_TW.properties +23 -2
- package/src/sap/ui/mdc/mixin/AdaptationMixin.js +1 -1
- package/src/sap/ui/mdc/mixin/DelegateMixin.js +1 -1
- package/src/sap/ui/mdc/mixin/FilterIntegrationMixin.js +3 -3
- package/src/sap/ui/mdc/mixin/PromiseMixin.js +94 -0
- package/src/sap/ui/mdc/odata/v4/ChartPropertyHelperNew.js +1 -1
- package/src/sap/ui/mdc/odata/v4/TableDelegate.js +65 -37
- package/src/sap/ui/mdc/odata/v4/ValueHelpDelegate.js +94 -0
- package/src/sap/ui/mdc/odata/v4/vizChart/ChartDelegateNew.js +221 -32
- package/src/sap/ui/mdc/p13n/Engine.js +34 -10
- package/src/sap/ui/mdc/p13n/P13nBuilder.js +2 -2
- package/src/sap/ui/mdc/p13n/PersistenceProvider.js +21 -10
- package/src/sap/ui/mdc/p13n/PropertyHelper.js +1 -1
- package/src/sap/ui/mdc/p13n/StateUtil.js +20 -0
- package/src/sap/ui/mdc/p13n/UIManager.js +11 -6
- package/src/sap/ui/mdc/p13n/{DefaultProviderRegistry.js → modules/DefaultProviderRegistry.js} +2 -2
- package/src/sap/ui/mdc/p13n/modules/StateHandlerRegistry.js +86 -0
- package/src/sap/ui/mdc/p13n/panels/ActionToolbarPanel.js +59 -0
- package/src/sap/ui/mdc/p13n/panels/AdaptFiltersPanel.js +20 -5
- package/src/sap/ui/mdc/p13n/panels/BasePanel.js +8 -8
- package/src/sap/ui/mdc/p13n/panels/ChartItemPanel.js +1 -2
- package/src/sap/ui/mdc/p13n/panels/ChartItemPanelNew.js +1179 -0
- package/src/sap/ui/mdc/p13n/panels/GroupView.js +1 -2
- package/src/sap/ui/mdc/p13n/panels/ListView.js +6 -4
- package/src/sap/ui/mdc/p13n/panels/SelectionPanel.js +0 -1
- package/src/sap/ui/mdc/p13n/panels/SortPanel.js +0 -1
- package/src/sap/ui/mdc/p13n/subcontroller/ActionToolbarController.js +89 -0
- package/src/sap/ui/mdc/p13n/subcontroller/AggregateController.js +1 -1
- package/src/sap/ui/mdc/p13n/subcontroller/BaseController.js +9 -6
- package/src/sap/ui/mdc/p13n/subcontroller/ChartItemController.js +33 -4
- package/src/sap/ui/mdc/p13n/subcontroller/ColumnController.js +9 -15
- package/src/sap/ui/mdc/p13n/subcontroller/GroupController.js +5 -12
- package/src/sap/ui/mdc/p13n/subcontroller/SortController.js +19 -21
- package/src/sap/ui/mdc/table/Column.js +67 -17
- package/src/sap/ui/mdc/table/CreationRow.js +14 -13
- package/src/sap/ui/mdc/table/GridTableType.js +11 -11
- package/src/sap/ui/mdc/table/PropertyHelper.js +120 -17
- package/src/sap/ui/mdc/table/ResponsiveTableType.js +35 -26
- package/src/sap/ui/mdc/table/RowSettings.js +8 -6
- package/src/sap/ui/mdc/table/TableTypeBase.js +4 -5
- package/src/sap/ui/mdc/table/V4AnalyticsPropertyHelper.js +15 -71
- package/src/sap/ui/mdc/themes/base/Chart.less +3 -0
- package/src/sap/ui/mdc/themes/base/ValueHelpDialog.less +51 -21
- package/src/sap/ui/mdc/themes/base/library.source.less +1 -0
- package/src/sap/ui/mdc/ui/Container.js +2 -2
- package/src/sap/ui/mdc/ui/ContainerItem.js +2 -2
- package/src/sap/ui/mdc/util/Common.js +26 -0
- package/src/sap/ui/mdc/util/PromiseCache.js +266 -0
- package/src/sap/ui/mdc/util/PropertyHelper.js +114 -304
- package/src/sap/ui/mdc/valuehelp/Dialog.js +499 -0
- package/src/sap/ui/mdc/valuehelp/Popover.js +373 -0
- package/src/sap/ui/mdc/valuehelp/base/Container.js +673 -0
- package/src/sap/ui/mdc/valuehelp/base/Content.js +658 -0
- package/src/sap/ui/mdc/valuehelp/base/DialogTab.js +139 -0
- package/src/sap/ui/mdc/valuehelp/base/FilterableListContent.js +584 -0
- package/src/sap/ui/mdc/valuehelp/base/ListContent.js +133 -0
- package/src/sap/ui/mdc/valuehelp/content/Bool.js +318 -0
- package/src/sap/ui/mdc/valuehelp/content/Conditions.js +270 -0
- package/src/sap/ui/mdc/valuehelp/content/FixedList.js +532 -0
- package/src/sap/ui/mdc/valuehelp/content/MDCTable.js +643 -0
- package/src/sap/ui/mdc/valuehelp/content/MTable.js +928 -0
- package/test/sap/ui/mdc/testutils/opa/TestLibrary.js +3 -2
- package/test/sap/ui/mdc/testutils/opa/actions/OpenContextMenu.js +48 -0
- package/test/sap/ui/mdc/testutils/opa/chartNew/ActionsBase.js +310 -0
- package/test/sap/ui/mdc/testutils/opa/chartNew/ActionsViz.js +39 -0
- package/test/sap/ui/mdc/testutils/opa/chartNew/AssertionsBase.js +118 -0
- package/test/sap/ui/mdc/testutils/opa/chartNew/AssertionsViz.js +137 -0
- package/test/sap/ui/mdc/testutils/opa/chartNew/ChartNew.js +24 -0
- package/test/sap/ui/mdc/testutils/opa/chartNew/TestObjects.js +289 -0
- package/test/sap/ui/mdc/testutils/opa/filterbar/Actions.js +250 -0
- package/test/sap/ui/mdc/testutils/opa/filterbar/Assertions.js +91 -0
- package/test/sap/ui/mdc/testutils/opa/filterbar/TestObjects.js +137 -0
- package/test/sap/ui/mdc/testutils/opa/filterbar/Util.js +25 -0
- package/test/sap/ui/mdc/testutils/opa/p13n/Actions.js +407 -93
- package/test/sap/ui/mdc/testutils/opa/p13n/Util.js +4 -1
- package/test/sap/ui/mdc/testutils/opa/p13n/{waitForP13nButtonWithParentAndIcon.js → waitForP13nButtonWithMatchers.js} +5 -18
- package/test/sap/ui/mdc/testutils/opa/table/TestObjects.js +0 -1
- package/src/sap/ui/mdc/p13n/panels/GroupPanel.js +0 -111
- package/src/sap/ui/mdc/p13n/panels/QueryPanel.js +0 -322
- package/src/sap/ui/mdc/p13n/panels/SortQueryPanel.js +0 -133
- package/src/sap/ui/mdc/p13n/panels/Wrapper.js +0 -203
|
@@ -0,0 +1,499 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* ! OpenUI5
|
|
3
|
+
* (c) Copyright 2009-2021 SAP SE or an SAP affiliate company.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
sap.ui.define([
|
|
8
|
+
'sap/ui/mdc/valuehelp/base/Container',
|
|
9
|
+
'sap/ui/mdc/valuehelp/base/DialogTab',
|
|
10
|
+
'sap/ui/mdc/util/loadModules',
|
|
11
|
+
'sap/ui/Device',
|
|
12
|
+
'sap/m/VBox',
|
|
13
|
+
'sap/m/FlexItemData',
|
|
14
|
+
'sap/ui/model/resource/ResourceModel',
|
|
15
|
+
'sap/ui/mdc/util/Common',
|
|
16
|
+
'sap/ui/mdc/enum/SelectType'
|
|
17
|
+
], function(
|
|
18
|
+
Container,
|
|
19
|
+
DialogTab,
|
|
20
|
+
loadModules,
|
|
21
|
+
Device,
|
|
22
|
+
VBox,
|
|
23
|
+
FlexItemData,
|
|
24
|
+
ResourceModel,
|
|
25
|
+
Common,
|
|
26
|
+
SelectType
|
|
27
|
+
) {
|
|
28
|
+
"use strict";
|
|
29
|
+
|
|
30
|
+
var MDialog, MLibrary, Button, ManagedObjectModel, IconTabBar, IconTabFilter;
|
|
31
|
+
var Panel, HBox, Tokenizer, Token, formatMessage;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Constructor for a new <code>Dialog</code> container.
|
|
35
|
+
*
|
|
36
|
+
* @param {string} [sId] ID for the new control, generated automatically if no ID is given
|
|
37
|
+
* @param {object} [mSettings] Initial settings for the new control
|
|
38
|
+
* @class Container for the <code>sap.ui.mdc.ValueHelp</code> element showing a dialog.
|
|
39
|
+
* @extends sap.ui.mdc.valuehelp.base.Container
|
|
40
|
+
* @version 1.97.0
|
|
41
|
+
* @constructor
|
|
42
|
+
* @abstract
|
|
43
|
+
* @private
|
|
44
|
+
* @ui5-restricted sap.ui.mdc
|
|
45
|
+
* @since 1.95.0
|
|
46
|
+
* @alias sap.ui.mdc.valuehelp.Dialog
|
|
47
|
+
* @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel
|
|
48
|
+
*/
|
|
49
|
+
var Dialog = Container.extend("sap.ui.mdc.valuehelp.Dialog", /** @lends sap.ui.mdc.valuehelp.Dialog.prototype */
|
|
50
|
+
{
|
|
51
|
+
metadata: {
|
|
52
|
+
library: "sap.ui.mdc",
|
|
53
|
+
interfaces: [
|
|
54
|
+
"sap.ui.mdc.valuehelp.IDialogContainer"
|
|
55
|
+
],
|
|
56
|
+
properties: {
|
|
57
|
+
_selectedContentKey: {
|
|
58
|
+
type: "string",
|
|
59
|
+
visibility: "hidden"
|
|
60
|
+
},
|
|
61
|
+
_quickSelectEnabled: {
|
|
62
|
+
type: "boolean",
|
|
63
|
+
visibility: "hidden",
|
|
64
|
+
defaultValue: false
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
defaultAggregation: "content"
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
function _getContentHeight() {
|
|
72
|
+
if (Device.system.desktop) {
|
|
73
|
+
return "700px";
|
|
74
|
+
}
|
|
75
|
+
if (Device.system.tablet) {
|
|
76
|
+
return Device.orientation.landscape ? "600px" : "600px";
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function _getContentWidth() {
|
|
81
|
+
if (Device.system.desktop) {
|
|
82
|
+
return "1080px";
|
|
83
|
+
}
|
|
84
|
+
if (Device.system.tablet) {
|
|
85
|
+
return Device.orientation.landscape ? "920px" : "600px";
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
Dialog.prototype.invalidate = function(oOrigin) {
|
|
89
|
+
|
|
90
|
+
if (oOrigin) {
|
|
91
|
+
var aContent = this.getContent();
|
|
92
|
+
var iIndex = aContent.indexOf(oOrigin);
|
|
93
|
+
if (this._oIconTabBar && iIndex !== -1 && !this._bIsBeingDestroyed) {
|
|
94
|
+
// Content invalidated -> invalidate corresponding IconTabFilter
|
|
95
|
+
var aItems = this._oIconTabBar.getItems();
|
|
96
|
+
if (aItems[iIndex]) {
|
|
97
|
+
aItems[iIndex].invalidate(oOrigin);
|
|
98
|
+
}
|
|
99
|
+
} else { // standard logic
|
|
100
|
+
Container.prototype.invalidate.apply(this, arguments);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
Dialog.prototype._getUIAreaForContent = function() {
|
|
107
|
+
var oDialog = this.getAggregation("_container");
|
|
108
|
+
if (oDialog) {
|
|
109
|
+
return oDialog.getUIArea();
|
|
110
|
+
}
|
|
111
|
+
return Container.prototype._getUIAreaForContent.apply(this, arguments);
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
Dialog.prototype._handleConfirmed = function (oEvent) {
|
|
115
|
+
this.fireConfirm({close: true});
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
Dialog.prototype._handleClosed = function (oEvent) {
|
|
119
|
+
|
|
120
|
+
var aContents = this.getContent();
|
|
121
|
+
var oContent = this._sSelectedKey && aContents && aContents.find(function (oContent) {
|
|
122
|
+
return oContent.getId() === this._sSelectedKey;
|
|
123
|
+
}.bind(this));
|
|
124
|
+
|
|
125
|
+
if (oContent) {
|
|
126
|
+
oContent.onHide();
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
Container.prototype._handleClosed.apply(this, arguments);
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
Dialog.prototype._getContainer = function () {
|
|
133
|
+
if (!this.getModel("$i18n")) {
|
|
134
|
+
// if ResourceModel not provided from outside create own one
|
|
135
|
+
this.setModel(new ResourceModel({ bundleName: "sap/ui/mdc/messagebundle", async: false }), "$i18n");
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
var oDialog = this.getAggregation("_container");
|
|
139
|
+
|
|
140
|
+
if (!oDialog) {
|
|
141
|
+
return this._retrievePromise("dialog", function (){
|
|
142
|
+
return loadModules([
|
|
143
|
+
"sap/m/Dialog",
|
|
144
|
+
"sap/m/Button",
|
|
145
|
+
"sap/ui/model/base/ManagedObjectModel",
|
|
146
|
+
"sap/m/library"
|
|
147
|
+
]).then(function (aModules) {
|
|
148
|
+
|
|
149
|
+
MDialog = aModules[0];
|
|
150
|
+
Button = aModules[1];
|
|
151
|
+
ManagedObjectModel = aModules[2];
|
|
152
|
+
MLibrary = aModules[3];
|
|
153
|
+
|
|
154
|
+
var ButtonType = MLibrary.ButtonType;
|
|
155
|
+
|
|
156
|
+
if (!this._oResourceBundle) {
|
|
157
|
+
this._oResourceBundle = sap.ui.getCore().getLibraryResourceBundle("sap.ui.mdc");
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
this.oButtonOK = new Button(this.getId() + "-ok", {
|
|
161
|
+
text: this._oResourceBundle.getText("valuehelp.OK"),
|
|
162
|
+
enabled: "{$valueHelp>/_valid}",
|
|
163
|
+
type: ButtonType.Emphasized,
|
|
164
|
+
press: this._handleConfirmed.bind(this),
|
|
165
|
+
visible: { parts: ['$valueHelp>/_config/maxConditions', '$help>/_quickSelectEnabled'], formatter: function(iMaxConditions, bQuickSelectEnabled) {
|
|
166
|
+
return iMaxConditions !== 1 || !bQuickSelectEnabled;
|
|
167
|
+
}}
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
this.oButtonCancel = new Button(this.getId() + "-cancel", {
|
|
171
|
+
text: this._oResourceBundle.getText("valuehelp.CANCEL"),
|
|
172
|
+
press: this._handleCanceled.bind(this)
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
this._oManagedObjectModel = new ManagedObjectModel(this);
|
|
176
|
+
|
|
177
|
+
var oDialog = new MDialog(this.getId() + "-dialog", {
|
|
178
|
+
contentHeight: _getContentHeight(),
|
|
179
|
+
contentWidth: _getContentWidth(),
|
|
180
|
+
horizontalScrolling: false,
|
|
181
|
+
verticalScrolling: false,
|
|
182
|
+
title: {parts: ['$help>/title', '$help>/content'], formatter:
|
|
183
|
+
function(sTitle, aContent) {
|
|
184
|
+
if (aContent.length == 1) {
|
|
185
|
+
var oContent = aContent[0];
|
|
186
|
+
var sDlgTitle = oContent.getFormattedShortTitle() ? oContent.getFormattedShortTitle() : oContent.getTitle();
|
|
187
|
+
if (sDlgTitle) {
|
|
188
|
+
sTitle = this._oResourceBundle.getText("valuehelp.DIALOGSHORTTITLECOLONTITLE", [sDlgTitle, sTitle]);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
return sTitle;
|
|
193
|
+
}.bind(this)
|
|
194
|
+
},
|
|
195
|
+
stretch: Device.system.phone,
|
|
196
|
+
resizable: true,
|
|
197
|
+
draggable: true,
|
|
198
|
+
afterOpen: this._handleOpened.bind(this),
|
|
199
|
+
afterClose: this._handleClosed.bind(this),
|
|
200
|
+
buttons: [this.oButtonOK, this.oButtonCancel]
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
oDialog.setModel(this._oManagedObjectModel, "$help");
|
|
204
|
+
this.setAggregation("_container", oDialog, true);
|
|
205
|
+
|
|
206
|
+
oDialog.isPopupAdaptationAllowed = function () {
|
|
207
|
+
return false;
|
|
208
|
+
};
|
|
209
|
+
oDialog.addStyleClass("sapMdcValueHelp");
|
|
210
|
+
oDialog.addStyleClass("sapMdcValueHelpTitle");
|
|
211
|
+
oDialog.addStyleClass("sapMdcValueHelpTitleShadow");
|
|
212
|
+
|
|
213
|
+
var oVBox = new VBox({ fitContainer: true});
|
|
214
|
+
oVBox.addStyleClass("sapMdcValueHelpPanel");
|
|
215
|
+
oDialog.addContent(oVBox);
|
|
216
|
+
|
|
217
|
+
var oIconTabBar = this._getIconTabBar(oDialog);
|
|
218
|
+
var oTokenizer = this._getTokenizerPanel();
|
|
219
|
+
|
|
220
|
+
return Promise.all([oIconTabBar, oTokenizer]).then(function (aControls) {
|
|
221
|
+
aControls.forEach(function (oControl) {
|
|
222
|
+
oVBox.addItem(oControl);
|
|
223
|
+
});
|
|
224
|
+
return oDialog;
|
|
225
|
+
});
|
|
226
|
+
}.bind(this));
|
|
227
|
+
}.bind(this));
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
return oDialog;
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
Dialog.prototype._handleSelect = function (oEvent) {
|
|
234
|
+
Container.prototype._handleSelect.apply(this, arguments);
|
|
235
|
+
|
|
236
|
+
if (this.getProperty("_quickSelectEnabled") && this._isSingleSelect()) {
|
|
237
|
+
this.fireConfirm({close: true});
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
Dialog.prototype._observeChanges = function (oChanges) {
|
|
242
|
+
if (oChanges.name === "content") {
|
|
243
|
+
var aContent = this.getContent();
|
|
244
|
+
this.setProperty("_quickSelectEnabled", aContent && aContent.every(function (oContent) {
|
|
245
|
+
return oContent.isQuickSelectSupported && oContent.isQuickSelectSupported();
|
|
246
|
+
}));
|
|
247
|
+
}
|
|
248
|
+
Container.prototype._observeChanges.apply(this, arguments);
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
Dialog.prototype._onTabBarSelect = function (oEvent) {
|
|
252
|
+
var aContents = this.getContent();
|
|
253
|
+
var oNextKey = oEvent && oEvent.getParameter("key");
|
|
254
|
+
var oPreviouslyShownContent = this._sSelectedKey && aContents && aContents.find(function (oContent) {
|
|
255
|
+
return oContent.getId() === this._sSelectedKey;
|
|
256
|
+
}.bind(this));
|
|
257
|
+
if (oPreviouslyShownContent) {
|
|
258
|
+
oPreviouslyShownContent.onHide();
|
|
259
|
+
}
|
|
260
|
+
this._sSelectedKey = oNextKey || this._oIconTabBar && this._oIconTabBar.getSelectedKey();
|
|
261
|
+
if (!this._sSelectedKey) {
|
|
262
|
+
// in the initial usecase the selectedKey is undefined
|
|
263
|
+
var oFirstItem = this._oIconTabBar.getItems()[0];
|
|
264
|
+
this._sSelectedKey = oFirstItem && oFirstItem.getKey();
|
|
265
|
+
if (this._sSelectedKey) {
|
|
266
|
+
this.setProperty("_selectedContentKey", this._sSelectedKey);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
var oShownContent = this._sSelectedKey ? aContents && aContents.find(function (oContent) {
|
|
270
|
+
return oContent.getId() === this._sSelectedKey;
|
|
271
|
+
}.bind(this)) : aContents[0];
|
|
272
|
+
if (oShownContent) {
|
|
273
|
+
Promise.all([this._retrievePromise("open"), oShownContent.getContent()]).then(function () {
|
|
274
|
+
oShownContent.onShow();
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
Dialog.prototype._getIconTabBar = function (oDialog) {
|
|
280
|
+
if (!this._oIconTabBar) {
|
|
281
|
+
return loadModules([
|
|
282
|
+
"sap/m/IconTabBar",
|
|
283
|
+
"sap/m/IconTabFilter"]).then(function(aModules){
|
|
284
|
+
IconTabBar = aModules[0];
|
|
285
|
+
IconTabFilter = aModules[1];
|
|
286
|
+
var IconTabHeaderMode = MLibrary.IconTabHeaderMode;
|
|
287
|
+
|
|
288
|
+
this._oIconTabBar = new IconTabBar(this.getId() + "-ITB", {
|
|
289
|
+
expandable: false,
|
|
290
|
+
upperCase: false,
|
|
291
|
+
stretchContentHeight: true,
|
|
292
|
+
headerMode: IconTabHeaderMode.Inline,
|
|
293
|
+
select: this._onTabBarSelect.bind(this),
|
|
294
|
+
layoutData: new FlexItemData({growFactor: 1}),
|
|
295
|
+
selectedKey: "{$help>/_selectedContentKey}",
|
|
296
|
+
visible: {parts : ['$help>/content'], formatter:
|
|
297
|
+
function(aContent) {
|
|
298
|
+
if (aContent && aContent.length == 1) {
|
|
299
|
+
this.addStyleClass("sapMdcNoHeader"); // hide the IconTabBar header
|
|
300
|
+
oDialog.removeStyleClass("sapMdcValueHelpTitleShadow"); // make the Header border visible
|
|
301
|
+
} else {
|
|
302
|
+
this.removeStyleClass("sapMdcNoHeader");
|
|
303
|
+
oDialog.addStyleClass("sapMdcValueHelpTitleShadow"); // make the Header border invisible
|
|
304
|
+
}
|
|
305
|
+
return true;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
// this._oIconTabBar.setModel(this._oManagedObjectModel, "$help");
|
|
310
|
+
this._oIconTabBar.addStyleClass("sapUiNoContentPadding");
|
|
311
|
+
|
|
312
|
+
var oITF = new IconTabFilter(this.getId() + "-ITF", {
|
|
313
|
+
key: {path: "$help>id"},
|
|
314
|
+
content: new DialogTab(this.getId() + "-DT", {content: {path: "$help>displayContent"}}),
|
|
315
|
+
text: {parts: ['$help>', '$valueHelp>/conditions'], formatter:
|
|
316
|
+
function(oContent, aConditions) {
|
|
317
|
+
return oContent ? oContent.getFormattedTitle(oContent.getCount(aConditions)) : "none";
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
this._oIconTabBar.bindAggregation("items", {path: "/content", model: "$help", templateShareable: false, template: oITF});
|
|
323
|
+
return this._oIconTabBar;
|
|
324
|
+
}.bind(this));
|
|
325
|
+
}
|
|
326
|
+
return this._oIconTabBar;
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
Dialog.prototype._getTokenizerPanel = function (oDialog) {
|
|
330
|
+
if (!this.oTokenizerPanel) {
|
|
331
|
+
return loadModules([
|
|
332
|
+
'sap/m/Panel',
|
|
333
|
+
'sap/m/HBox',
|
|
334
|
+
'sap/m/VBox',
|
|
335
|
+
'sap/m/Tokenizer',
|
|
336
|
+
'sap/m/Token',
|
|
337
|
+
'sap/base/strings/formatMessage',
|
|
338
|
+
'sap/ui/model/Filter',
|
|
339
|
+
'sap/ui/mdc/field/ConditionType'
|
|
340
|
+
]).then(function (aModules) {
|
|
341
|
+
|
|
342
|
+
Panel = aModules[0];
|
|
343
|
+
HBox = aModules[1];
|
|
344
|
+
VBox = aModules[2];
|
|
345
|
+
Tokenizer = aModules[3];
|
|
346
|
+
Token = aModules[4];
|
|
347
|
+
formatMessage = aModules[5];
|
|
348
|
+
var Filter = aModules[6];
|
|
349
|
+
var ConditionType = aModules[7];
|
|
350
|
+
var BackgroundDesign = MLibrary.BackgroundDesign;
|
|
351
|
+
var ButtonType = MLibrary.ButtonType;
|
|
352
|
+
|
|
353
|
+
this.oTokenizerPanel = new Panel( {
|
|
354
|
+
backgroundDesign: BackgroundDesign.Transparent,
|
|
355
|
+
expanded: true,
|
|
356
|
+
visible: { parts: ['$valueHelp>/_config/maxConditions', '$help>/content'], formatter:
|
|
357
|
+
function(iMaxConditions, aContent) {
|
|
358
|
+
var bVisible = false;
|
|
359
|
+
|
|
360
|
+
if (aContent && aContent.some(function(oContent) {
|
|
361
|
+
// make the tokenizer visible when at least one content request the tokenizer
|
|
362
|
+
return oContent.getRequiresTokenizer();
|
|
363
|
+
})) {
|
|
364
|
+
bVisible = true;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
return bVisible && iMaxConditions === -1;
|
|
368
|
+
}},
|
|
369
|
+
headerText: {parts: ['$i18n>valuehelp.TOKENIZERTITLE', '$valueHelp>/conditions'], formatter:
|
|
370
|
+
function(sText, aConditions) {
|
|
371
|
+
var iCount = 0;
|
|
372
|
+
for (var i = 0; i < aConditions.length; i++) {
|
|
373
|
+
var oCondition = aConditions[i];
|
|
374
|
+
if (oCondition.isEmpty !== true) {
|
|
375
|
+
iCount++;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
if (iCount === 0) {
|
|
379
|
+
// in case of no items do not show a number
|
|
380
|
+
sText = this._oResourceBundle.getText("valuehelp.TOKENIZERTITLENONUMBER");
|
|
381
|
+
}
|
|
382
|
+
return formatMessage(sText, iCount);
|
|
383
|
+
}.bind(this)
|
|
384
|
+
}
|
|
385
|
+
});
|
|
386
|
+
this.oTokenizerPanel.addStyleClass("sapMdcTokenizerPanel");
|
|
387
|
+
|
|
388
|
+
var oHBox = new HBox({fitContainer: true, width: "100%"});
|
|
389
|
+
|
|
390
|
+
var oFilter = new Filter({path:'isEmpty', operator:'NE', value1:true});
|
|
391
|
+
|
|
392
|
+
var oValueHelpModel = this.getModel("$valueHelp");
|
|
393
|
+
var oConfig = oValueHelpModel ? oValueHelpModel.getProperty("/_config") : {};
|
|
394
|
+
var oFormatOptions = { // TODO: is more needed?
|
|
395
|
+
maxConditions: -1, // as for tokens there should not be a limit on type side
|
|
396
|
+
valueType: oConfig.dataType,
|
|
397
|
+
operators: oConfig.operators,
|
|
398
|
+
display: oConfig.display
|
|
399
|
+
};
|
|
400
|
+
var oTokenTemplate = new Token({text: {path: '$valueHelp>', type: new ConditionType(oFormatOptions)}});
|
|
401
|
+
this.oTokenizer = new Tokenizer({
|
|
402
|
+
width: "100%",
|
|
403
|
+
tokenDelete: function(oEvent) {
|
|
404
|
+
if (oEvent.getParameter("tokens")) {
|
|
405
|
+
var aRemovedTokens = oEvent.getParameter("tokens");
|
|
406
|
+
var aConditions = this.getModel("$valueHelp").getObject("/conditions");
|
|
407
|
+
var aRemovedConditions = [];
|
|
408
|
+
|
|
409
|
+
aRemovedTokens.forEach(function(oRemovedToken, i) {
|
|
410
|
+
var sPath = oRemovedToken.getBindingContext("$valueHelp").sPath;
|
|
411
|
+
var iIndex = parseInt(sPath.slice(sPath.lastIndexOf("/") + 1));
|
|
412
|
+
aRemovedConditions.push(aConditions[iIndex]);
|
|
413
|
+
});
|
|
414
|
+
|
|
415
|
+
this.fireSelect({type: SelectType.Remove, conditions: aRemovedConditions});
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
}.bind(this),
|
|
419
|
+
tokens: {path: '/conditions', model: "$valueHelp", templateShareable: false, template: oTokenTemplate, filters: oFilter},
|
|
420
|
+
layoutData: new FlexItemData({growFactor: 1, maxWidth: "calc(100% - 2rem)"})
|
|
421
|
+
});
|
|
422
|
+
this.oTokenizer.addAriaDescribedBy( this.oTokenizer.getTokensInfoId());
|
|
423
|
+
this.oTokenizer.addStyleClass("sapMdcTokenizer");
|
|
424
|
+
|
|
425
|
+
this.oRemoveAllBtn = new Button({
|
|
426
|
+
press: function(oEvent) {
|
|
427
|
+
this.fireSelect({type: SelectType.Set, conditions: []});
|
|
428
|
+
|
|
429
|
+
}.bind(this),
|
|
430
|
+
type: ButtonType.Transparent,
|
|
431
|
+
icon: "sap-icon://decline",
|
|
432
|
+
tooltip: "{$i18n>valuehelp.REMOVEALLTOKEN}",
|
|
433
|
+
layoutData: new FlexItemData({growFactor: 0, baseSize: "2rem"})
|
|
434
|
+
});
|
|
435
|
+
this.oRemoveAllBtn.addStyleClass("sapUiTinyMarginBegin");
|
|
436
|
+
|
|
437
|
+
oHBox.addItem(this.oTokenizer);
|
|
438
|
+
oHBox.addItem(this.oRemoveAllBtn);
|
|
439
|
+
this.oTokenizerPanel.addContent(oHBox);
|
|
440
|
+
|
|
441
|
+
return this.oTokenizerPanel;
|
|
442
|
+
}.bind(this));
|
|
443
|
+
}
|
|
444
|
+
return this.oTokenizerPanel;
|
|
445
|
+
};
|
|
446
|
+
|
|
447
|
+
Dialog.prototype._open = function (oContainer) {
|
|
448
|
+
this._onTabBarSelect();
|
|
449
|
+
if (oContainer) {
|
|
450
|
+
oContainer.open();
|
|
451
|
+
}
|
|
452
|
+
};
|
|
453
|
+
|
|
454
|
+
Dialog.prototype._close = function () {
|
|
455
|
+
var oContainer = this.getAggregation("_container");
|
|
456
|
+
if (oContainer) {
|
|
457
|
+
oContainer.close();
|
|
458
|
+
}
|
|
459
|
+
};
|
|
460
|
+
|
|
461
|
+
Dialog.prototype.getValueHelpIcon = function() {
|
|
462
|
+
return "sap-icon://value-help";
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
Dialog.prototype.getAriaAttributes = function(iMaxConditions) {
|
|
466
|
+
|
|
467
|
+
// var aContent = this.getContent();
|
|
468
|
+
// var oContentAttributes = oContent && oContent.getAriaAttributes(iMaxConditions);
|
|
469
|
+
//
|
|
470
|
+
return {
|
|
471
|
+
contentId: null, // as in Dialog case focus is not in field, it is not needed
|
|
472
|
+
ariaHasPopup: "dialog",
|
|
473
|
+
role: null, // TODO: use "combobox" role here? But Input and MultiInput don't set a role if valueHelp is available
|
|
474
|
+
roleDescription: null // TODO: is it needed in multiselect case?
|
|
475
|
+
};
|
|
476
|
+
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
Dialog.prototype.isMultiSelect = function() {
|
|
480
|
+
|
|
481
|
+
return this.getMaxConditions() !== 1; // TODO: ask content?
|
|
482
|
+
|
|
483
|
+
};
|
|
484
|
+
|
|
485
|
+
Dialog.prototype.exit = function () {
|
|
486
|
+
Common.cleanup(this, [
|
|
487
|
+
"_oManagedObjectModel",
|
|
488
|
+
"_oResourceBundle",
|
|
489
|
+
"oButtonOK",
|
|
490
|
+
"oButtonCancel",
|
|
491
|
+
"oTokenizerPanel",
|
|
492
|
+
"oTokenizer",
|
|
493
|
+
"_oIconTabBar"
|
|
494
|
+
]);
|
|
495
|
+
};
|
|
496
|
+
|
|
497
|
+
return Dialog;
|
|
498
|
+
|
|
499
|
+
});
|