@openui5/sap.ui.mdc 1.113.0 → 1.115.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 +0 -5
- package/README.md +22 -9
- package/THIRDPARTY.txt +1 -7
- package/package.json +4 -4
- package/src/sap/ui/mdc/.library +1 -1
- package/src/sap/ui/mdc/ActionToolbar.js +5 -7
- package/src/sap/ui/mdc/AggregationBaseDelegate.js +5 -5
- package/src/sap/ui/mdc/BaseDelegate.js +49 -14
- package/src/sap/ui/mdc/Chart.js +147 -179
- package/src/sap/ui/mdc/ChartDelegate.js +404 -514
- package/src/sap/ui/mdc/ChartRenderer.js +11 -11
- package/src/sap/ui/mdc/Control.js +4 -4
- package/src/sap/ui/mdc/DefaultTypeMap.js +84 -0
- package/src/sap/ui/mdc/Element.js +4 -4
- package/src/sap/ui/mdc/Field.js +98 -96
- package/src/sap/ui/mdc/FilterBar.js +33 -56
- package/src/sap/ui/mdc/FilterBarDelegate.js +36 -69
- package/src/sap/ui/mdc/FilterField.js +93 -47
- package/src/sap/ui/mdc/Link.js +83 -82
- package/src/sap/ui/mdc/LinkDelegate.js +29 -48
- package/src/sap/ui/mdc/MultiValueField.js +34 -30
- package/src/sap/ui/mdc/Table.js +182 -193
- package/src/sap/ui/mdc/TableDelegate.js +244 -33
- package/src/sap/ui/mdc/ValueHelp.js +67 -50
- package/src/sap/ui/mdc/ValueHelpDelegate.js +57 -89
- package/src/sap/ui/mdc/actiontoolbar/ActionToolbarAction.js +4 -12
- package/src/sap/ui/mdc/chart/ChartImplementationContainer.js +192 -197
- package/src/sap/ui/mdc/chart/ChartSelectionDetails.js +10 -20
- package/src/sap/ui/mdc/chart/ChartToolbar.js +50 -50
- package/src/sap/ui/mdc/chart/ChartTypeButton.js +23 -27
- package/src/sap/ui/mdc/chart/DrillBreadcrumbs.js +10 -10
- package/src/sap/ui/mdc/chart/DrillStackHandler.js +14 -14
- package/src/sap/ui/mdc/chart/Item.js +30 -17
- package/src/sap/ui/mdc/chart/PropertyHelper.js +10 -10
- package/src/sap/ui/mdc/chart/SelectionDetailsActions.js +23 -15
- package/src/sap/ui/mdc/condition/Condition.js +11 -23
- package/src/sap/ui/mdc/condition/ConditionConverter.js +8 -8
- package/src/sap/ui/mdc/condition/ConditionModel.js +1 -1
- package/src/sap/ui/mdc/condition/FilterConverter.js +2 -2
- package/src/sap/ui/mdc/condition/FilterOperatorUtil.js +771 -123
- package/src/sap/ui/mdc/condition/Operator.js +52 -50
- package/src/sap/ui/mdc/condition/OperatorDynamicDateOption.js +14 -14
- package/src/sap/ui/mdc/condition/RangeOperator.js +3 -5
- package/src/sap/ui/mdc/designtime/table/Table.designtime.js +2 -2
- package/src/sap/ui/mdc/enum/ActionToolbarActionAlignment.js +5 -9
- package/src/sap/ui/mdc/enum/BaseType.js +15 -20
- package/src/sap/ui/mdc/enum/ConditionValidated.js +5 -9
- package/src/sap/ui/mdc/enum/ContentMode.js +1 -0
- package/src/sap/ui/mdc/enum/EditMode.js +7 -19
- package/src/sap/ui/mdc/enum/FieldDisplay.js +12 -18
- package/src/sap/ui/mdc/enum/FilterBarValidationStatus.js +3 -1
- package/src/sap/ui/mdc/enum/LinkType.js +40 -0
- package/src/sap/ui/mdc/enum/OperatorOverwrite.js +4 -2
- package/src/sap/ui/mdc/enum/OperatorValueType.js +47 -0
- package/src/sap/ui/mdc/enum/PersistenceMode.js +36 -36
- package/src/sap/ui/mdc/enum/ProcessingStrategy.js +3 -1
- package/src/sap/ui/mdc/enum/PropagationReason.js +1 -1
- package/src/sap/ui/mdc/enum/ReasonMode.js +1 -0
- package/src/sap/ui/mdc/enum/SelectType.js +1 -0
- package/src/sap/ui/mdc/enums/ActionToolbarActionAlignment.js +31 -0
- package/src/sap/ui/mdc/enums/BaseType.js +72 -0
- package/src/sap/ui/mdc/enums/ChartItemRoleType.js +61 -0
- package/src/sap/ui/mdc/enums/ChartItemType.js +31 -0
- package/src/sap/ui/mdc/enums/ChartP13nMode.js +48 -0
- package/src/sap/ui/mdc/enums/ChartToolbarActionType.js +49 -0
- package/src/sap/ui/mdc/enums/ConditionValidated.js +43 -0
- package/src/sap/ui/mdc/enums/ContentMode.js +74 -0
- package/src/sap/ui/mdc/enums/FieldDisplay.js +49 -0
- package/src/sap/ui/mdc/enums/FieldEditMode.js +55 -0
- package/src/sap/ui/mdc/enums/FilterBarP13nMode.js +36 -0
- package/src/sap/ui/mdc/enums/FilterBarValidationStatus.js +56 -0
- package/src/sap/ui/mdc/enums/LinkType.js +38 -0
- package/src/sap/ui/mdc/enums/OperatorOverwrite.js +34 -0
- package/src/sap/ui/mdc/enums/OperatorValueType.js +44 -0
- package/src/sap/ui/mdc/enums/PersistenceMode.js +44 -0
- package/src/sap/ui/mdc/enums/ProcessingStrategy.js +39 -0
- package/src/sap/ui/mdc/enums/ReasonMode.js +53 -0
- package/src/sap/ui/mdc/enums/TableGrowingMode.js +42 -0
- package/src/sap/ui/mdc/enums/TableMultiSelectMode.js +35 -0
- package/src/sap/ui/mdc/enums/TableP13nMode.js +54 -0
- package/src/sap/ui/mdc/enums/TableRowAction.js +30 -0
- package/src/sap/ui/mdc/enums/TableRowCountMode.js +36 -0
- package/src/sap/ui/mdc/enums/TableSelectionMode.js +45 -0
- package/src/sap/ui/mdc/enums/TableType.js +43 -0
- package/src/sap/ui/mdc/enums/ValueHelpPropagationReason.js +41 -0
- package/src/sap/ui/mdc/enums/ValueHelpSelectionType.js +46 -0
- package/src/sap/ui/mdc/field/ConditionType.js +120 -88
- package/src/sap/ui/mdc/field/ConditionsType.js +149 -44
- package/src/sap/ui/mdc/field/CustomFieldInfo.js +1 -1
- package/src/sap/ui/mdc/field/DynamicDateRangeConditionsType.js +15 -17
- package/src/sap/ui/mdc/field/FieldBase.js +512 -323
- package/src/sap/ui/mdc/field/FieldBaseDelegate.js +31 -114
- package/src/sap/ui/mdc/field/FieldBaseRenderer.js +4 -4
- package/src/sap/ui/mdc/field/FieldInfoBase.js +23 -21
- package/src/sap/ui/mdc/field/FieldInput.js +1 -1
- package/src/sap/ui/mdc/field/FieldInputRenderUtil.js +1 -1
- package/src/sap/ui/mdc/field/FieldMultiInput.js +1 -1
- package/src/sap/ui/mdc/field/ListFieldHelpItem.js +8 -29
- package/src/sap/ui/mdc/field/MultiValueFieldDelegate.js +2 -7
- package/src/sap/ui/mdc/field/MultiValueFieldItem.js +2 -6
- package/src/sap/ui/mdc/field/TokenDisplay.js +1 -1
- package/src/sap/ui/mdc/field/TokenizerDisplay.js +2 -1
- package/src/sap/ui/mdc/field/TokenizerDisplayRenderer.js +0 -4
- package/src/sap/ui/mdc/field/content/BooleanContent.js +2 -2
- package/src/sap/ui/mdc/field/content/ContentFactory.js +47 -35
- package/src/sap/ui/mdc/field/content/DateContent.js +49 -43
- package/src/sap/ui/mdc/field/content/DateTimeContent.js +2 -2
- package/src/sap/ui/mdc/field/content/DefaultContent.js +8 -8
- package/src/sap/ui/mdc/field/content/LinkContent.js +10 -6
- package/src/sap/ui/mdc/field/content/SearchContent.js +4 -4
- package/src/sap/ui/mdc/field/content/TimeContent.js +2 -2
- package/src/sap/ui/mdc/field/content/UnitContent.js +19 -11
- package/src/sap/ui/mdc/field/splitValue.js +45 -0
- package/src/sap/ui/mdc/filterbar/FilterBarBase.js +109 -218
- package/src/sap/ui/mdc/filterbar/IFilterContainer.js +22 -19
- package/src/sap/ui/mdc/filterbar/PropertyHelper.js +6 -7
- package/src/sap/ui/mdc/filterbar/aligned/FilterContainer.js +2 -4
- package/src/sap/ui/mdc/filterbar/aligned/FilterItemLayout.js +3 -7
- package/src/sap/ui/mdc/filterbar/p13n/AdaptationFilterBar.js +52 -41
- package/src/sap/ui/mdc/filterbar/p13n/FilterColumnLayout.js +2 -4
- package/src/sap/ui/mdc/filterbar/p13n/FilterGroupLayout.js +1 -3
- package/src/sap/ui/mdc/filterbar/p13n/TableContainer.js +4 -2
- package/src/sap/ui/mdc/filterbar/vh/FilterBar.js +14 -21
- package/src/sap/ui/mdc/filterbar/vh/FilterBarDelegate.js +1 -1
- package/src/sap/ui/mdc/flexibility/Chart.flexibility.js +1 -1
- package/src/sap/ui/mdc/flexibility/ChartItemFlex.js +2 -38
- package/src/sap/ui/mdc/flexibility/ColumnFlex.js +3 -3
- package/src/sap/ui/mdc/flexibility/ConditionFlex.js +11 -6
- package/src/sap/ui/mdc/flexibility/FilterBar.flexibility.js +1 -1
- package/src/sap/ui/mdc/flexibility/FilterItemFlex.js +2 -2
- package/src/sap/ui/mdc/flexibility/GroupFlex.js +11 -2
- package/src/sap/ui/mdc/flexibility/ItemBaseFlex.js +25 -9
- package/src/sap/ui/mdc/flexibility/SortFlex.js +11 -1
- package/src/sap/ui/mdc/flexibility/Util.js +2 -2
- package/src/sap/ui/mdc/flp/FlpLinkDelegate.js +7 -4
- package/src/sap/ui/mdc/library.js +178 -84
- 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 +26 -5
- package/src/sap/ui/mdc/link/Panel.js +1 -1
- package/src/sap/ui/mdc/link/PanelItem.js +1 -1
- package/src/sap/ui/mdc/link/SemanticObjectMapping.js +1 -1
- package/src/sap/ui/mdc/link/SemanticObjectMappingItem.js +1 -1
- package/src/sap/ui/mdc/link/SemanticObjectUnavailableAction.js +1 -1
- package/src/sap/ui/mdc/messagebundle.properties +9 -0
- package/src/sap/ui/mdc/messagebundle_ar.properties +7 -1
- package/src/sap/ui/mdc/messagebundle_bg.properties +19 -13
- package/src/sap/ui/mdc/messagebundle_ca.properties +6 -0
- package/src/sap/ui/mdc/messagebundle_cs.properties +6 -0
- package/src/sap/ui/mdc/messagebundle_cy.properties +6 -0
- package/src/sap/ui/mdc/messagebundle_da.properties +6 -0
- package/src/sap/ui/mdc/messagebundle_de.properties +6 -0
- package/src/sap/ui/mdc/messagebundle_el.properties +13 -7
- package/src/sap/ui/mdc/messagebundle_en.properties +6 -0
- package/src/sap/ui/mdc/messagebundle_en_GB.properties +6 -0
- package/src/sap/ui/mdc/messagebundle_en_US_sappsd.properties +6 -0
- package/src/sap/ui/mdc/messagebundle_en_US_saprigi.properties +6 -0
- package/src/sap/ui/mdc/messagebundle_en_US_saptrc.properties +6 -0
- package/src/sap/ui/mdc/messagebundle_es.properties +6 -0
- package/src/sap/ui/mdc/messagebundle_es_MX.properties +6 -0
- package/src/sap/ui/mdc/messagebundle_et.properties +6 -0
- package/src/sap/ui/mdc/messagebundle_fi.properties +7 -1
- package/src/sap/ui/mdc/messagebundle_fr.properties +6 -0
- package/src/sap/ui/mdc/messagebundle_fr_CA.properties +10 -4
- package/src/sap/ui/mdc/messagebundle_hi.properties +6 -0
- package/src/sap/ui/mdc/messagebundle_hr.properties +15 -9
- package/src/sap/ui/mdc/messagebundle_hu.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_id.properties +6 -0
- package/src/sap/ui/mdc/messagebundle_it.properties +10 -4
- package/src/sap/ui/mdc/messagebundle_iw.properties +6 -0
- package/src/sap/ui/mdc/messagebundle_ja.properties +14 -8
- package/src/sap/ui/mdc/messagebundle_kk.properties +16 -10
- package/src/sap/ui/mdc/messagebundle_ko.properties +9 -3
- package/src/sap/ui/mdc/messagebundle_lt.properties +6 -0
- package/src/sap/ui/mdc/messagebundle_lv.properties +6 -0
- package/src/sap/ui/mdc/messagebundle_ms.properties +9 -3
- package/src/sap/ui/mdc/messagebundle_nl.properties +7 -1
- package/src/sap/ui/mdc/messagebundle_no.properties +6 -0
- package/src/sap/ui/mdc/messagebundle_pl.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_pt.properties +6 -0
- package/src/sap/ui/mdc/messagebundle_pt_PT.properties +6 -0
- package/src/sap/ui/mdc/messagebundle_ro.properties +6 -0
- package/src/sap/ui/mdc/messagebundle_ru.properties +6 -0
- package/src/sap/ui/mdc/messagebundle_sh.properties +6 -0
- package/src/sap/ui/mdc/messagebundle_sk.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_sl.properties +6 -0
- package/src/sap/ui/mdc/messagebundle_sv.properties +6 -0
- package/src/sap/ui/mdc/messagebundle_th.properties +19 -13
- package/src/sap/ui/mdc/messagebundle_tr.properties +6 -0
- package/src/sap/ui/mdc/messagebundle_uk.properties +7 -1
- package/src/sap/ui/mdc/messagebundle_vi.properties +6 -0
- package/src/sap/ui/mdc/messagebundle_zh_CN.properties +7 -1
- package/src/sap/ui/mdc/messagebundle_zh_TW.properties +6 -0
- package/src/sap/ui/mdc/mixin/AdaptationMixin.js +1 -1
- package/src/sap/ui/mdc/mixin/DelegateMixin.js +33 -14
- package/src/sap/ui/mdc/mixin/FilterIntegrationMixin.js +3 -5
- package/src/sap/ui/mdc/mixin/PromiseMixin.js +1 -1
- package/src/sap/ui/mdc/mixin/PropertyHelperMixin.js +1 -1
- package/src/sap/ui/mdc/odata/TypeMap.js +155 -0
- package/src/sap/ui/mdc/odata/TypeUtil.js +42 -1
- package/src/sap/ui/mdc/odata/v4/ChartDelegate.js +17 -11
- package/src/sap/ui/mdc/odata/v4/FieldBaseDelegate.js +5 -50
- package/src/sap/ui/mdc/odata/v4/ODataMetaModelUtil.js +1 -1
- package/src/sap/ui/mdc/odata/v4/TableDelegate.js +156 -44
- package/src/sap/ui/mdc/odata/v4/TypeMap.js +70 -0
- package/src/sap/ui/mdc/odata/v4/TypeUtil.js +2 -1
- package/src/sap/ui/mdc/odata/v4/ValueHelpDelegate.js +8 -9
- package/src/sap/ui/mdc/odata/v4/vizChart/ChartDelegate.js +380 -390
- package/src/sap/ui/mdc/p13n/PropertyHelper.js +1 -1
- package/src/sap/ui/mdc/p13n/StateUtil.js +6 -19
- package/src/sap/ui/mdc/p13n/UIManager.js +1 -1
- package/src/sap/ui/mdc/p13n/panels/ChartItemPanel.js +43 -34
- package/src/sap/ui/mdc/p13n/panels/FilterPanel.js +3 -4
- package/src/sap/ui/mdc/p13n/subcontroller/FilterController.js +1 -1
- package/src/sap/ui/mdc/p13n/subcontroller/LinkPanelController.js +4 -6
- package/src/sap/ui/mdc/table/Column.js +45 -17
- package/src/sap/ui/mdc/table/ColumnSettings.js +2 -5
- package/src/sap/ui/mdc/table/CreationRow.js +4 -6
- package/src/sap/ui/mdc/table/GridTableType.js +31 -115
- package/src/sap/ui/mdc/table/PropertyHelper.js +56 -11
- package/src/sap/ui/mdc/table/ResponsiveColumnSettings.js +2 -5
- package/src/sap/ui/mdc/table/ResponsiveTableType.js +13 -84
- package/src/sap/ui/mdc/table/RowActionItem.js +9 -14
- package/src/sap/ui/mdc/table/RowSettings.js +2 -5
- package/src/sap/ui/mdc/table/TableSettings.js +23 -19
- package/src/sap/ui/mdc/table/TableTypeBase.js +43 -15
- package/src/sap/ui/mdc/table/TreeTableType.js +12 -32
- package/src/sap/ui/mdc/table/V4AnalyticsPropertyHelper.js +2 -5
- package/src/sap/ui/mdc/table/menu/Item.js +1 -1
- package/src/sap/ui/mdc/table/menu/QuickActionContainer.js +3 -3
- package/src/sap/ui/mdc/table/utils/Personalization.js +4 -4
- package/src/sap/ui/mdc/themes/base/ValueHelpDialog.less +6 -6
- package/src/sap/ui/mdc/util/DateUtil.js +15 -11
- package/src/sap/ui/mdc/util/FilterUtil.js +44 -19
- package/src/sap/ui/mdc/util/IdentifierUtil.js +0 -1
- package/src/sap/ui/mdc/util/InfoBar.js +1 -2
- package/src/sap/ui/mdc/util/PromiseCache.js +1 -1
- package/src/sap/ui/mdc/util/PropertyHelper.js +15 -8
- package/src/sap/ui/mdc/util/TypeMap.js +377 -0
- package/src/sap/ui/mdc/util/TypeUtil.js +35 -2
- package/src/sap/ui/mdc/util/mapVersions.js +225 -0
- package/src/sap/ui/mdc/valuehelp/Dialog.js +52 -33
- package/src/sap/ui/mdc/valuehelp/Popover.js +33 -35
- package/src/sap/ui/mdc/valuehelp/base/Container.js +193 -62
- package/src/sap/ui/mdc/valuehelp/base/Content.js +134 -57
- package/src/sap/ui/mdc/{field → valuehelp/base}/DefineConditionPanel.js +426 -197
- package/src/sap/ui/mdc/valuehelp/base/DialogTab.js +2 -2
- package/src/sap/ui/mdc/valuehelp/base/FilterableListContent.js +140 -47
- package/src/sap/ui/mdc/valuehelp/base/ListContent.js +11 -9
- package/src/sap/ui/mdc/valuehelp/content/Bool.js +11 -20
- package/src/sap/ui/mdc/valuehelp/content/Conditions.js +26 -32
- package/src/sap/ui/mdc/valuehelp/content/FixedList.js +14 -17
- package/src/sap/ui/mdc/valuehelp/content/FixedListItem.js +60 -0
- package/src/sap/ui/mdc/valuehelp/content/MDCTable.js +194 -199
- package/src/sap/ui/mdc/valuehelp/content/MTable.js +48 -51
- package/test/sap/ui/mdc/testutils/opa/chart/AssertionsViz.js +4 -4
- package/test/sap/ui/mdc/testutils/opa/field/Actions.js +1 -1
- package/test/sap/ui/mdc/testutils/opa/field/Assertions.js +3 -3
- package/test/sap/ui/mdc/testutils/opa/filterfield/Actions.js +4 -2
- package/test/sap/ui/mdc/testutils/opa/filterfield/Assertions.js +1 -1
- package/test/sap/ui/mdc/testutils/opa/table/Actions.js +41 -70
- package/test/sap/ui/mdc/testutils/opa/valueHelp/doWait.js +1 -1
- package/src/sap/ui/mdc/designtime/p13n/PersistenceProvider.designtime.js +0 -21
- package/src/sap/ui/mdc/util/FormatUtil.js +0 -82
|
@@ -5,16 +5,17 @@
|
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
7
7
|
'sap/ui/Device',
|
|
8
|
-
'sap/ui/mdc/
|
|
9
|
-
'sap/ui/mdc/
|
|
10
|
-
'sap/ui/mdc/
|
|
8
|
+
'sap/ui/mdc/enums/FieldEditMode',
|
|
9
|
+
'sap/ui/mdc/enums/FieldDisplay',
|
|
10
|
+
'sap/ui/mdc/enums/ConditionValidated',
|
|
11
11
|
'sap/ui/mdc/field/FieldBaseRenderer',
|
|
12
12
|
'sap/ui/mdc/condition/FilterOperatorUtil',
|
|
13
13
|
'sap/ui/mdc/condition/Condition',
|
|
14
14
|
'sap/ui/mdc/condition/ConditionValidateException',
|
|
15
15
|
'sap/ui/mdc/field/ConditionType',
|
|
16
16
|
'sap/ui/mdc/field/ConditionsType',
|
|
17
|
-
'sap/ui/mdc/
|
|
17
|
+
'sap/ui/mdc/field/splitValue',
|
|
18
|
+
'sap/ui/mdc/enums/BaseType',
|
|
18
19
|
'sap/ui/mdc/field/content/ContentFactory',
|
|
19
20
|
'sap/ui/mdc/Control',
|
|
20
21
|
"sap/ui/mdc/util/loadModules",
|
|
@@ -36,7 +37,7 @@ sap.ui.define([
|
|
|
36
37
|
'sap/ui/events/KeyCodes'
|
|
37
38
|
], function(
|
|
38
39
|
Device,
|
|
39
|
-
|
|
40
|
+
FieldEditMode,
|
|
40
41
|
FieldDisplay,
|
|
41
42
|
ConditionValidated,
|
|
42
43
|
FieldBaseRenderer,
|
|
@@ -45,6 +46,7 @@ sap.ui.define([
|
|
|
45
46
|
ConditionValidateException,
|
|
46
47
|
ConditionType,
|
|
47
48
|
ConditionsType,
|
|
49
|
+
splitValue,
|
|
48
50
|
BaseType,
|
|
49
51
|
ContentFactory,
|
|
50
52
|
Control,
|
|
@@ -77,10 +79,7 @@ sap.ui.define([
|
|
|
77
79
|
* @namespace
|
|
78
80
|
* @name sap.ui.mdc.field
|
|
79
81
|
* @since 1.58.0
|
|
80
|
-
* @
|
|
81
|
-
* @experimental As of version 1.58
|
|
82
|
-
* @ui5-restricted sap.ui.mdc sap.fe
|
|
83
|
-
* @MDC_PUBLIC_CANDIDATE
|
|
82
|
+
* @public
|
|
84
83
|
*/
|
|
85
84
|
|
|
86
85
|
/**
|
|
@@ -90,25 +89,25 @@ sap.ui.define([
|
|
|
90
89
|
* @param {object} [mSettings] Initial settings for the new control
|
|
91
90
|
*
|
|
92
91
|
* @class
|
|
93
|
-
* The <code>FieldBase</code> control is the
|
|
92
|
+
* The <code>FieldBase</code> control is the base class for the {@link sap.ui.mdc.Field Field}, {@link sap.ui.mdc.MultiValueField MultiValueField}
|
|
94
93
|
* and {@link sap.ui.mdc.FilterField FilterField} controls.
|
|
95
94
|
* It must not be used stand-alone.
|
|
96
95
|
*
|
|
97
96
|
* @extends sap.ui.mdc.Control
|
|
98
|
-
* @implements sap.ui.core.IFormContent, sap.ui.core.ISemanticFormContent
|
|
97
|
+
* @implements sap.ui.core.IFormContent, sap.ui.core.ISemanticFormContent, sap.m.IOverflowToolbarContent
|
|
99
98
|
*
|
|
100
99
|
* @author SAP SE
|
|
101
|
-
* @version 1.
|
|
100
|
+
* @version 1.115.0
|
|
102
101
|
*
|
|
103
102
|
* @constructor
|
|
104
103
|
* @alias sap.ui.mdc.field.FieldBase
|
|
105
104
|
* @since 1.58.0
|
|
106
105
|
* @abstract
|
|
107
106
|
*
|
|
108
|
-
* @
|
|
109
|
-
* @
|
|
110
|
-
*
|
|
111
|
-
* @
|
|
107
|
+
* @borrows sap.ui.core.ISemanticFormContent.getFormFormattedValue as #getFormFormattedValue
|
|
108
|
+
* @borrows sap.ui.core.ISemanticFormContent.getFormValueProperty as #getFormValueProperty
|
|
109
|
+
*
|
|
110
|
+
* @public
|
|
112
111
|
*/
|
|
113
112
|
var FieldBase = Control.extend("sap.ui.mdc.field.FieldBase", /* @lends sap.ui.mdc.field.FieldBase.prototype */ {
|
|
114
113
|
metadata: {
|
|
@@ -148,9 +147,9 @@ sap.ui.define([
|
|
|
148
147
|
* Determines whether the field is editable, read-only, or disabled.
|
|
149
148
|
*/
|
|
150
149
|
editMode: {
|
|
151
|
-
type: "sap.ui.mdc.
|
|
150
|
+
type: "sap.ui.mdc.enums.FieldEditMode",
|
|
152
151
|
group: "Data",
|
|
153
|
-
defaultValue:
|
|
152
|
+
defaultValue: FieldEditMode.Editable
|
|
154
153
|
},
|
|
155
154
|
|
|
156
155
|
/**
|
|
@@ -163,10 +162,10 @@ sap.ui.define([
|
|
|
163
162
|
},
|
|
164
163
|
|
|
165
164
|
/**
|
|
166
|
-
* Defines whether the value and/or description of the field is shown and in
|
|
165
|
+
* Defines whether the value and/or description of the field is shown and in which order.
|
|
167
166
|
*/
|
|
168
167
|
display: {
|
|
169
|
-
type: "sap.ui.mdc.
|
|
168
|
+
type: "sap.ui.mdc.enums.FieldDisplay",
|
|
170
169
|
defaultValue: FieldDisplay.Value
|
|
171
170
|
},
|
|
172
171
|
|
|
@@ -182,7 +181,7 @@ sap.ui.define([
|
|
|
182
181
|
},
|
|
183
182
|
|
|
184
183
|
/**
|
|
185
|
-
* Defines the text directionality of the input field, for example <code>RTL</code
|
|
184
|
+
* Defines the text directionality of the input field, for example, <code>RTL</code> or <code>LTR</code>.
|
|
186
185
|
*
|
|
187
186
|
* <b>Note:</b> If the rendered control doesn't support this feature, this property is ignored.
|
|
188
187
|
*/
|
|
@@ -193,8 +192,8 @@ sap.ui.define([
|
|
|
193
192
|
},
|
|
194
193
|
|
|
195
194
|
/**
|
|
196
|
-
* Defines a short hint intended to
|
|
197
|
-
* If the value is <code>null</code
|
|
195
|
+
* Defines a short hint intended to help the user with the data entry when the control has no value.
|
|
196
|
+
* If the value is <code>null</code>, no placeholder is shown.
|
|
198
197
|
*
|
|
199
198
|
* <b>Note:</b> If the rendered control doesn't support this feature, this property is ignored.
|
|
200
199
|
*/
|
|
@@ -205,7 +204,7 @@ sap.ui.define([
|
|
|
205
204
|
},
|
|
206
205
|
|
|
207
206
|
/**
|
|
208
|
-
* Visualizes the validation state of the control, for example <code>Error</code>, <code>Warning</code
|
|
207
|
+
* Visualizes the validation state of the control, for example, <code>Error</code>, <code>Warning</code> or <code>Success</code>.
|
|
209
208
|
*
|
|
210
209
|
* <b>Note:</b> The visualization of the <code>ValueState</code> property is handled by the inner rendered control.
|
|
211
210
|
* If a control is set (using <code>content</code>, <code>contentEdit</code>, or <code>contentDisplay</code>), this control needs to support
|
|
@@ -218,7 +217,7 @@ sap.ui.define([
|
|
|
218
217
|
},
|
|
219
218
|
|
|
220
219
|
/**
|
|
221
|
-
* Defines the text that appears in the value state message pop-up. If this has not specified, a default text from the resource bundle is shown.
|
|
220
|
+
* Defines the text that appears in the value state message pop-up. If this has not been specified, a default text from the resource bundle is shown.
|
|
222
221
|
*/
|
|
223
222
|
valueStateText: {
|
|
224
223
|
type: "string",
|
|
@@ -242,7 +241,7 @@ sap.ui.define([
|
|
|
242
241
|
*
|
|
243
242
|
* This property is only used for single-value fields.
|
|
244
243
|
*
|
|
245
|
-
* <b>Note</b> If the data type used doesn't support multiple lines an error is thrown.
|
|
244
|
+
* <b>Note</b> If the data type used doesn't support multiple lines, an error is thrown.
|
|
246
245
|
*/
|
|
247
246
|
multipleLines: {
|
|
248
247
|
type: "boolean",
|
|
@@ -251,9 +250,9 @@ sap.ui.define([
|
|
|
251
250
|
},
|
|
252
251
|
|
|
253
252
|
/**
|
|
254
|
-
* Sets the maximum
|
|
253
|
+
* Sets the maximum number of conditions that are allowed for this field.
|
|
255
254
|
*
|
|
256
|
-
* The default value of -1 indicates that an unlimited
|
|
255
|
+
* The default value of -1 indicates that an unlimited number of conditions can be defined.
|
|
257
256
|
*
|
|
258
257
|
* <b>Note</b> If the data type used doesn't support multiple conditions, an error is thrown.
|
|
259
258
|
*/
|
|
@@ -266,11 +265,11 @@ sap.ui.define([
|
|
|
266
265
|
/**
|
|
267
266
|
* Sets the conditions that represent the values of the field.
|
|
268
267
|
*
|
|
269
|
-
|
|
268
|
+
* These should be bound to a {@link sap.ui.mdc.condition.ConditionModel ConditionModel} using the corresponding <code>fieldPath</code>.
|
|
270
269
|
*
|
|
271
270
|
* <b>Note:</b> For {@link sap.ui.mdc.FilterField FilterField} controls, the <code>conditions</code> property must be used to bind
|
|
272
271
|
* {@link sap.ui.mdc.FilterField FilterField} to a {@link sap.ui.mdc.condition.ConditionModel ConditionModel}.</br>
|
|
273
|
-
* For example, for a {@link sap.ui.mdc.FilterField FilterField} control inside a {@link sap.ui.mdc.FilterBar FilterBar} control the binding looks like this:</br>
|
|
272
|
+
* For example, for a {@link sap.ui.mdc.FilterField FilterField} control inside a {@link sap.ui.mdc.FilterBar FilterBar} control, the binding looks like this:</br>
|
|
274
273
|
* <code>conditions="{$filters>/conditions/propertyPath}"</code> with the following data:
|
|
275
274
|
* <ul>
|
|
276
275
|
* <li><code>$filters</code> as the name of the condition model</li>
|
|
@@ -278,16 +277,6 @@ sap.ui.define([
|
|
|
278
277
|
* <li><code>propertyPath</code> as the property name</li>
|
|
279
278
|
* </ul>
|
|
280
279
|
*
|
|
281
|
-
* For an Any (see {@link sap.ui.model.FilterOperator}) {@link sap.ui.mdc.FilterField FilterField} control, the binding looks like this:</br>
|
|
282
|
-
* <code>conditions='{$filters>/conditions/navPath*/propertyPath}'</code> with the following data:
|
|
283
|
-
* <ul>
|
|
284
|
-
* <li><code>$filters</code> as the name of the condition model</li>
|
|
285
|
-
* <li><code>/conditions/</code> as a required static part of the binding</li>
|
|
286
|
-
* <li><code>navPath*/</code> as the navigation property name</li>
|
|
287
|
-
* <li><code>propertyPath</code> as the property name</li>
|
|
288
|
-
* </ul>
|
|
289
|
-
* Between <code>navPath</code> and <code>propertyPath</code>, <b>*/</b> is required.
|
|
290
|
-
*
|
|
291
280
|
* <b>Note:</b> A condition must have the structure of {@link sap.ui.mdc.condition.ConditionObject ConditionObject}.
|
|
292
281
|
*/
|
|
293
282
|
conditions: {
|
|
@@ -303,8 +292,7 @@ sap.ui.define([
|
|
|
303
292
|
*
|
|
304
293
|
* This can be used by {@link sap.ui.mdc.FilterBar FilterBar} or {@link sap.ui.layout.form.Form Form} controls to create a {@link sap.m.Label Label} control for the field.
|
|
305
294
|
*
|
|
306
|
-
* @
|
|
307
|
-
* @since 1.62.0 Disclaimer: this property is in a beta state - incompatible API changes may be done before its official public release. Use at your own discretion.
|
|
295
|
+
* @since 1.62.0
|
|
308
296
|
*/
|
|
309
297
|
label: {
|
|
310
298
|
type: "string",
|
|
@@ -329,7 +317,7 @@ sap.ui.define([
|
|
|
329
317
|
},
|
|
330
318
|
|
|
331
319
|
/**
|
|
332
|
-
* If set, an empty <code>Field</code> renders an empty
|
|
320
|
+
* If set, an empty <code>Field</code> renders an empty indicator in display mode.
|
|
333
321
|
*
|
|
334
322
|
* This property only takes effect if <code>editMode</code> is set to <code>Display</code>.
|
|
335
323
|
*
|
|
@@ -366,6 +354,15 @@ sap.ui.define([
|
|
|
366
354
|
defaultValue: {},
|
|
367
355
|
byValue: true,
|
|
368
356
|
visibility: "hidden"
|
|
357
|
+
},
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Internal property to bind the operators to the internal <code>DynamicDateRange</code> (or other) control.
|
|
361
|
+
*/
|
|
362
|
+
_operators: {
|
|
363
|
+
type: "string[]",
|
|
364
|
+
defaultValue: [],
|
|
365
|
+
visibility: "hidden"
|
|
369
366
|
}
|
|
370
367
|
|
|
371
368
|
},
|
|
@@ -373,6 +370,10 @@ sap.ui.define([
|
|
|
373
370
|
/**
|
|
374
371
|
* Optional content that can be rendered.
|
|
375
372
|
*
|
|
373
|
+
* Per default, depending on <code>editMode</code>, <code>multipleLines</code> and the used data type, a content control is rendered. For simple string types, a {@link sap.m.Text Text}
|
|
374
|
+
* control is rendered in display mode and a {@link sap.m.Input Input} control in edit mode. If a control is assigned in the <code>content</code> aggregation, this will be
|
|
375
|
+
* rendered instead.
|
|
376
|
+
*
|
|
376
377
|
* <b>Note:</b> Bind the value-holding property of the control to <code>'$field>/conditions'</code>
|
|
377
378
|
* using {@link sap.ui.mdc.field.ConditionsType ConditionsType} as type.
|
|
378
379
|
*
|
|
@@ -391,6 +392,9 @@ sap.ui.define([
|
|
|
391
392
|
/**
|
|
392
393
|
* Optional content to be rendered if the <code>editMode</code> property is not set to <code>Display</code>.
|
|
393
394
|
*
|
|
395
|
+
* Per default, depending on <code>multipleLines</code> and the used data type, a content control is rendered in edit mode. For simple string types, an {@link sap.m.Input Input}
|
|
396
|
+
* control is rendered in edit mode. If a control is assigned in the <code>contentEdit</code> aggregation, this will be rendered instead.
|
|
397
|
+
*
|
|
394
398
|
* <b>Note:</b> If a control is assigned to the <code>content</code> aggregation, this one is ignored.
|
|
395
399
|
*
|
|
396
400
|
* <b>Note:</b> Bind the value-holding property of the control to <code>'$field>/conditions'</code>
|
|
@@ -413,6 +417,9 @@ sap.ui.define([
|
|
|
413
417
|
/**
|
|
414
418
|
* Optional content to be rendered if the <code>editMode</code> property is set to <code>Display</code>.
|
|
415
419
|
*
|
|
420
|
+
* Per default, depending on <code>multipleLines</code> and the used data type, a content control is rendered in display mode. For simple string types, a {@link sap.m.Text Text}
|
|
421
|
+
* control is rendered in display mode. If a control is assigned in the <code>contentDisplay</code> aggregation, this will be rendered instead.
|
|
422
|
+
*
|
|
416
423
|
* <b>Note:</b> If a control is assigned to the <code>content</code> aggregation, this one is ignored.
|
|
417
424
|
*
|
|
418
425
|
* <b>Note:</b> Bind the value-holding property of the control to <code>'$field>/conditions'</code>
|
|
@@ -443,6 +450,7 @@ sap.ui.define([
|
|
|
443
450
|
|
|
444
451
|
/**
|
|
445
452
|
* Optional <code>FieldInfo</code> used for detail information. This is only active in display mode.
|
|
453
|
+
* Especially {@link sap.ui.mdc.Link} can be used to activate link features.
|
|
446
454
|
*
|
|
447
455
|
* <b>Note:</b> If a special data type is defined or a content control is set, this is ignored.
|
|
448
456
|
*/
|
|
@@ -464,12 +472,31 @@ sap.ui.define([
|
|
|
464
472
|
* be rendering or update issues.
|
|
465
473
|
*
|
|
466
474
|
* <b>Note:</b> For <code>Boolean</code> fields, no <code>ValueHelp</code> should be added, but a default <code>ValueHelp</code> used instead.
|
|
475
|
+
* @deprecated as of 1.114.0, replaced by {@link #setValueHelp valueHelp} association
|
|
467
476
|
*/
|
|
468
477
|
fieldHelp: {
|
|
469
478
|
type: "sap.ui.mdc.ValueHelp",
|
|
470
479
|
multiple: false
|
|
471
480
|
},
|
|
472
481
|
|
|
482
|
+
/**
|
|
483
|
+
* Optional <code>ValueHelp</code>.
|
|
484
|
+
*
|
|
485
|
+
* This is an association that allows the usage of one <code>ValueHelp</code> instance for multiple fields.
|
|
486
|
+
*
|
|
487
|
+
* <b>Note:</b> If the field is inside of a table, do not set the <code>ValueHelp</code> instance as <code>dependent</code>
|
|
488
|
+
* to the field. If you do, every field instance in every table row gets a clone of it.
|
|
489
|
+
* Put the <code>ValueHelp</code> instance e.g. as dependent on the table or page.
|
|
490
|
+
* The <code>ValueHelp</code> instance must be somewhere in the control tree, otherwise there might
|
|
491
|
+
* be rendering or update issues.
|
|
492
|
+
*
|
|
493
|
+
* <b>Note:</b> For <code>Boolean</code> fields, no <code>ValueHelp</code> should be added, but a default <code>ValueHelp</code> used instead.
|
|
494
|
+
*/
|
|
495
|
+
valueHelp: {
|
|
496
|
+
type: "sap.ui.mdc.ValueHelp",
|
|
497
|
+
multiple: false
|
|
498
|
+
},
|
|
499
|
+
|
|
473
500
|
/**
|
|
474
501
|
* Association to controls / IDs that label this control (see WAI-ARIA attribute aria-labelledby).
|
|
475
502
|
*/
|
|
@@ -541,7 +568,10 @@ sap.ui.define([
|
|
|
541
568
|
onsappageup: _handleKeybordEvent,
|
|
542
569
|
onsappagedown: _handleKeybordEvent,
|
|
543
570
|
|
|
544
|
-
onsapbackspace: _handleKeybordEvent
|
|
571
|
+
onsapbackspace: _handleKeybordEvent,
|
|
572
|
+
onchange: _handleContentOnchange,
|
|
573
|
+
onsapfocusleave: _handleContentOnsapfocusleave,
|
|
574
|
+
onpaste: _handlePaste
|
|
545
575
|
};
|
|
546
576
|
|
|
547
577
|
var oContentEventDelegateAfter = {
|
|
@@ -564,7 +594,6 @@ sap.ui.define([
|
|
|
564
594
|
bool: {
|
|
565
595
|
modules: ["sap/ui/mdc/ValueHelp", "sap/ui/mdc/valuehelp/Popover", "sap/ui/mdc/valuehelp/content/Bool"],
|
|
566
596
|
id: "BoolDefaultHelp",
|
|
567
|
-
getDelegate: "getDefaultValueHelpDelegate",
|
|
568
597
|
contentProperties: {},
|
|
569
598
|
dialog: false,
|
|
570
599
|
control: undefined,
|
|
@@ -575,7 +604,6 @@ sap.ui.define([
|
|
|
575
604
|
defineConditions: {
|
|
576
605
|
modules: ["sap/ui/mdc/ValueHelp", "sap/ui/mdc/valuehelp/Dialog", "sap/ui/mdc/valuehelp/content/Conditions"],
|
|
577
606
|
id: "Field-DefineConditions-Help",
|
|
578
|
-
getDelegate: "getDefaultValueHelpDelegate",
|
|
579
607
|
contentProperties: {},
|
|
580
608
|
dialog: true,
|
|
581
609
|
control: undefined,
|
|
@@ -594,16 +622,16 @@ sap.ui.define([
|
|
|
594
622
|
|
|
595
623
|
Control.prototype.init.apply(this, arguments);
|
|
596
624
|
|
|
597
|
-
this._oObserver = new ManagedObjectObserver(this.
|
|
625
|
+
this._oObserver = new ManagedObjectObserver(this.observeChanges.bind(this));
|
|
598
626
|
|
|
599
627
|
this._oObserver.observe(this, {
|
|
600
628
|
properties: ["display", "editMode", "dataType", "dataTypeFormatOptions", "dataTypeConstraints",
|
|
601
629
|
"multipleLines", "maxConditions", "conditions", "delegate"],
|
|
602
630
|
aggregations: ["fieldInfo", "content", "contentEdit", "contentDisplay"],
|
|
603
|
-
associations: ["fieldHelp", "ariaLabelledBy"]
|
|
631
|
+
associations: ["fieldHelp", "valueHelp", "ariaLabelledBy"]
|
|
604
632
|
});
|
|
605
633
|
|
|
606
|
-
this.attachEvent("modelContextChange", this.
|
|
634
|
+
this.attachEvent("modelContextChange", this.handleModelContextChange, this);
|
|
607
635
|
|
|
608
636
|
this._oResourceBundle = sap.ui.getCore().getLibraryResourceBundle("sap.ui.mdc");
|
|
609
637
|
|
|
@@ -611,7 +639,7 @@ sap.ui.define([
|
|
|
611
639
|
|
|
612
640
|
this._bPreventGetDescription = false; // set in navigate or select from field help
|
|
613
641
|
|
|
614
|
-
this._oContentFactory = this.
|
|
642
|
+
this._oContentFactory = this.getContentFactory();
|
|
615
643
|
|
|
616
644
|
this._oCreateContentPromise = undefined;
|
|
617
645
|
|
|
@@ -620,11 +648,11 @@ sap.ui.define([
|
|
|
620
648
|
};
|
|
621
649
|
|
|
622
650
|
/**
|
|
623
|
-
* @
|
|
651
|
+
* @protected
|
|
624
652
|
* @returns {sap.ui.mdc.field.content.ContentFactory} oContentFactory the ContentFactory of the Field
|
|
625
653
|
*/
|
|
626
|
-
FieldBase.prototype.
|
|
627
|
-
if (this.
|
|
654
|
+
FieldBase.prototype.getContentFactory = function() {
|
|
655
|
+
if (this.isFieldDestroyed()) {
|
|
628
656
|
return;
|
|
629
657
|
}
|
|
630
658
|
if (!this._oContentFactory) {
|
|
@@ -645,8 +673,10 @@ sap.ui.define([
|
|
|
645
673
|
var oFieldHelp = _getFieldHelp.call(this);
|
|
646
674
|
if (oFieldHelp && !this._iFocusTimer && oFieldHelp.shouldOpenOnFocus() && !oFieldHelp.isOpen()) {
|
|
647
675
|
this._iFocusTimer = setTimeout(function () {
|
|
648
|
-
oFieldHelp.
|
|
649
|
-
|
|
676
|
+
if (!this.isFieldDestroyed() && !oFieldHelp.isOpen()) {
|
|
677
|
+
_handleValueHelpRequest.call(this, oEvent, true); // open typeahead
|
|
678
|
+
this._redirectFocus(oEvent, oFieldHelp);
|
|
679
|
+
}
|
|
650
680
|
this._iFocusTimer = null;
|
|
651
681
|
}.bind(this),300);
|
|
652
682
|
}
|
|
@@ -716,7 +746,7 @@ sap.ui.define([
|
|
|
716
746
|
if (!this.bDelegateInitialized && !this.bDelegateLoading) {
|
|
717
747
|
this.initControlDelegate();
|
|
718
748
|
}
|
|
719
|
-
this.
|
|
749
|
+
this.triggerCheckCreateInternalContent();
|
|
720
750
|
|
|
721
751
|
this._bSettingsApplied = true;
|
|
722
752
|
|
|
@@ -730,7 +760,7 @@ sap.ui.define([
|
|
|
730
760
|
if (sPropertyName === "editMode") {
|
|
731
761
|
// only invalidate if switched between edit and display, not for redonly or disabled
|
|
732
762
|
var sOld = this.getEditMode();
|
|
733
|
-
if (sOld !==
|
|
763
|
+
if (sOld !== FieldEditMode.Display && sOld !== FieldEditMode.EditableDisplay && vValue !== FieldEditMode.Display && vValue !== FieldEditMode.EditableDisplay) {
|
|
734
764
|
bSuppressInvalidate = true;
|
|
735
765
|
}
|
|
736
766
|
} else if (sPropertyName !== "width" && sPropertyName !== "multipleLines" && sPropertyName !== "showEmptyIndicator") {
|
|
@@ -775,7 +805,7 @@ sap.ui.define([
|
|
|
775
805
|
if (oPromise) {
|
|
776
806
|
_executeChange.call(this, undefined, undefined, undefined, oPromise);
|
|
777
807
|
} else {
|
|
778
|
-
_executeChange.call(this, this.getConditions(), !this.
|
|
808
|
+
_executeChange.call(this, this.getConditions(), !this.isInvalidInput());
|
|
779
809
|
}
|
|
780
810
|
}
|
|
781
811
|
}
|
|
@@ -817,13 +847,13 @@ sap.ui.define([
|
|
|
817
847
|
|
|
818
848
|
FieldBase.prototype._handleNavigate = function(oEvent, iStep) {
|
|
819
849
|
|
|
820
|
-
if (this.getEditMode() ===
|
|
850
|
+
if (this.getEditMode() === FieldEditMode.Editable) {
|
|
821
851
|
var oFieldHelp = _getFieldHelp.call(this);
|
|
822
852
|
var oSource = oEvent.srcControl;
|
|
823
853
|
|
|
824
854
|
if (oFieldHelp) {
|
|
825
855
|
if (oFieldHelp.isNavigationEnabled(iStep) && // if open let ValueHelp decide if and how to navigate
|
|
826
|
-
(!this.
|
|
856
|
+
(!this.getContentFactory().isMeasure() || oSource.getShowValueHelp())) { // for Currenncy/Unit field navigate only in part with valueHelp
|
|
827
857
|
// if only type-ahead but no real value help, only navigate if open
|
|
828
858
|
oEvent.preventDefault();
|
|
829
859
|
oEvent.stopPropagation();
|
|
@@ -855,7 +885,7 @@ sap.ui.define([
|
|
|
855
885
|
|
|
856
886
|
FieldBase.prototype._redirectFocus = function (oEvent, oFieldHelp) {
|
|
857
887
|
var oSource = oEvent.srcControl;
|
|
858
|
-
if (oFieldHelp.isOpen() && (!this.
|
|
888
|
+
if (oFieldHelp.isOpen() && (!this.getContentFactory().isMeasure() || (oSource.getShowValueHelp && oSource.getShowValueHelp()))) {
|
|
859
889
|
oSource.addStyleClass("sapMFocus"); // to show focus outline again after navigation
|
|
860
890
|
oFieldHelp.removeFocus();
|
|
861
891
|
}
|
|
@@ -867,7 +897,7 @@ sap.ui.define([
|
|
|
867
897
|
var oFieldHelp = _getFieldHelp.call(this);
|
|
868
898
|
if (oFieldHelp) {
|
|
869
899
|
if (oFieldHelp.shouldOpenOnClick() && !oFieldHelp.isOpen()) {
|
|
870
|
-
|
|
900
|
+
_handleValueHelpRequest.call(this, oEvent, true); // open typeahead
|
|
871
901
|
}
|
|
872
902
|
this._redirectFocus(oEvent, oFieldHelp);
|
|
873
903
|
}
|
|
@@ -878,7 +908,7 @@ sap.ui.define([
|
|
|
878
908
|
|
|
879
909
|
// detach event handler before cloning to not have it twice on the clone
|
|
880
910
|
// attach it after clone again
|
|
881
|
-
this.detachEvent("modelContextChange", this.
|
|
911
|
+
this.detachEvent("modelContextChange", this.handleModelContextChange, this);
|
|
882
912
|
|
|
883
913
|
var oContent = this.getContent();
|
|
884
914
|
if (oContent) {
|
|
@@ -900,7 +930,7 @@ sap.ui.define([
|
|
|
900
930
|
|
|
901
931
|
var oClone = Control.prototype.clone.apply(this, arguments);
|
|
902
932
|
|
|
903
|
-
this.attachEvent("modelContextChange", this.
|
|
933
|
+
this.attachEvent("modelContextChange", this.handleModelContextChange, this);
|
|
904
934
|
|
|
905
935
|
if (oContent) {
|
|
906
936
|
_attachContentHandlers.call(this, oContent);
|
|
@@ -934,6 +964,7 @@ sap.ui.define([
|
|
|
934
964
|
* @private
|
|
935
965
|
* @ui5-restricted sap.ui.mdc.filterbar.FilterBarBase
|
|
936
966
|
*/
|
|
967
|
+
// @deprecated as of 1.115.0, replaced by {@link #setPropertyKey propertyKey} property
|
|
937
968
|
FieldBase.prototype.getFieldPath = function() {
|
|
938
969
|
|
|
939
970
|
var sBindingPath = this.getBindingPath("conditions");
|
|
@@ -947,7 +978,7 @@ sap.ui.define([
|
|
|
947
978
|
|
|
948
979
|
function _triggerChange(aConditions, bValid, vWrongValue, oPromise) {
|
|
949
980
|
|
|
950
|
-
if (this.
|
|
981
|
+
if (this.getCurrentContent().length > 1) {
|
|
951
982
|
// in unit/currency field fire Change only if ENTER pressed or field completely left. Not on focus between number and unit
|
|
952
983
|
this._bPendingChange = true;
|
|
953
984
|
} else {
|
|
@@ -961,7 +992,7 @@ sap.ui.define([
|
|
|
961
992
|
if (!oPromise) {
|
|
962
993
|
// not promise -> change is synchronously -> return resolved SyncPromise
|
|
963
994
|
if (bValid) {
|
|
964
|
-
oPromise = Promise.resolve(this.
|
|
995
|
+
oPromise = Promise.resolve(this.getResultForChangePromise(aConditions));
|
|
965
996
|
} else {
|
|
966
997
|
var oException = this._getInvalidInputException();
|
|
967
998
|
if (oException) {
|
|
@@ -972,13 +1003,17 @@ sap.ui.define([
|
|
|
972
1003
|
}
|
|
973
1004
|
}
|
|
974
1005
|
|
|
975
|
-
this.
|
|
1006
|
+
this.fireChangeEvent(aConditions, bValid, vWrongValue, oPromise);
|
|
976
1007
|
|
|
977
1008
|
this._bPendingChange = false;
|
|
978
1009
|
|
|
979
1010
|
}
|
|
980
1011
|
|
|
981
|
-
|
|
1012
|
+
/**
|
|
1013
|
+
* Here inheriting controls need to fire the control-specific change event.
|
|
1014
|
+
* @protected
|
|
1015
|
+
*/
|
|
1016
|
+
FieldBase.prototype.fireChangeEvent = function(aConditions, bValid, vWrongValue, oPromise) {
|
|
982
1017
|
// to be implemented by Filed and FilterField
|
|
983
1018
|
};
|
|
984
1019
|
|
|
@@ -993,17 +1028,17 @@ sap.ui.define([
|
|
|
993
1028
|
|
|
994
1029
|
if (oPromise) {
|
|
995
1030
|
bPending = true;
|
|
996
|
-
} else if (this.
|
|
1031
|
+
} else if (this.isInvalidInput()) {
|
|
997
1032
|
oPromise = Promise.reject();
|
|
998
1033
|
} else {
|
|
999
|
-
oPromise = Promise.resolve(this.
|
|
1034
|
+
oPromise = Promise.resolve(this.getResultForChangePromise(this.getConditions()));
|
|
1000
1035
|
}
|
|
1001
1036
|
|
|
1002
1037
|
if (this._bPendingChange) {
|
|
1003
1038
|
if (bPending) {
|
|
1004
1039
|
_executeChange.call(this, undefined, undefined, undefined, oPromise);
|
|
1005
1040
|
} else {
|
|
1006
|
-
_executeChange.call(this, this.getConditions(), !this.
|
|
1041
|
+
_executeChange.call(this, this.getConditions(), !this.isInvalidInput(), undefined, oPromise);
|
|
1007
1042
|
}
|
|
1008
1043
|
}
|
|
1009
1044
|
|
|
@@ -1012,45 +1047,97 @@ sap.ui.define([
|
|
|
1012
1047
|
|
|
1013
1048
|
}
|
|
1014
1049
|
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1050
|
+
function _handlePaste(oEvent) {
|
|
1051
|
+
|
|
1052
|
+
var iMaxConditions = this.getMaxConditions();
|
|
1053
|
+
|
|
1054
|
+
if (iMaxConditions === 1) { // only for multi-value
|
|
1055
|
+
return;
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
// for the purpose to copy from column in excel and paste in FilterField/MultiValueField
|
|
1059
|
+
var sOriginalText = oEvent.originalEvent.clipboardData.getData('text/plain');
|
|
1060
|
+
var aSeparatedText = splitValue(sOriginalText, true); // check without BT support as if TAB is inside the Paste logic needs to be used anyhow
|
|
1061
|
+
|
|
1062
|
+
if (aSeparatedText.length <= 1) {
|
|
1063
|
+
// only one entry -> use default logic
|
|
1064
|
+
return;
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
var oControl = oEvent.srcControl;
|
|
1068
|
+
var sBoundProperty;
|
|
1069
|
+
for (var sProperty in oControl.getMetadata().getAllProperties()) {
|
|
1070
|
+
if (oControl.getBindingPath(sProperty) === "/conditions") {
|
|
1071
|
+
sBoundProperty = sProperty;
|
|
1072
|
+
break;
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
oControl.updateModelProperty(sBoundProperty, sOriginalText, oControl.getProperty(sBoundProperty)); // Use normal parsing functionality to habe Async-handling and error handling
|
|
1076
|
+
|
|
1077
|
+
oEvent.stopImmediatePropagation(true); // to prevent MultiInputs own logic
|
|
1078
|
+
oEvent.preventDefault(); // to prevent pasting string into INPUT
|
|
1079
|
+
|
|
1080
|
+
oEvent.source = oEvent.srcControl; // to align with other events
|
|
1081
|
+
oEvent.parameters = {}; // to align with other events
|
|
1082
|
+
// as change might be async
|
|
1083
|
+
var iLength = this._aAsyncChanges.length;
|
|
1084
|
+
var oPromise;
|
|
1085
|
+
var bValid;
|
|
1086
|
+
var aConditions;
|
|
1087
|
+
if (iLength > 0) {
|
|
1088
|
+
this._aAsyncChanges[iLength - 1].changeFired = true;
|
|
1089
|
+
this._aAsyncChanges[iLength - 1].changeEvent = oEvent;
|
|
1090
|
+
oPromise = this._aAsyncChanges[iLength - 1].promise;
|
|
1091
|
+
} else {
|
|
1092
|
+
bValid = !this._bParseError;
|
|
1093
|
+
aConditions = this.getConditions();
|
|
1094
|
+
}
|
|
1095
|
+
_triggerChange.call(this, aConditions, bValid, undefined, oPromise);
|
|
1096
|
+
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
/**
|
|
1100
|
+
* Initializes internal data-types and dependent objects.
|
|
1101
|
+
* @protected
|
|
1102
|
+
*/
|
|
1103
|
+
FieldBase.prototype.initDataType = function() {
|
|
1104
|
+
if (this.getContentFactory().getDataType()) {
|
|
1105
|
+
this.getContentFactory().getDataType().destroy();
|
|
1106
|
+
this.getContentFactory().setDataType(undefined);
|
|
1020
1107
|
}
|
|
1021
1108
|
|
|
1022
|
-
if (this.
|
|
1023
|
-
if (this.
|
|
1109
|
+
if (this.getContentFactory().getDateOriginalType()) {
|
|
1110
|
+
if (this.getContentFactory().getDateOriginalType()._bCreatedByField) {
|
|
1024
1111
|
// do not destroy if used in Field binding
|
|
1025
|
-
this.
|
|
1112
|
+
this.getContentFactory().getDateOriginalType().destroy();
|
|
1026
1113
|
}
|
|
1027
|
-
this.
|
|
1114
|
+
this.getContentFactory().setDateOriginalType(undefined);
|
|
1028
1115
|
}
|
|
1029
1116
|
|
|
1030
|
-
if (this.
|
|
1031
|
-
if (this.
|
|
1117
|
+
if (this.getContentFactory().getUnitOriginalType()) {
|
|
1118
|
+
if (this.getContentFactory().getUnitOriginalType()._bCreatedByField) {
|
|
1032
1119
|
// do not destroy if used in Field binding
|
|
1033
|
-
this.
|
|
1120
|
+
this.getContentFactory().getUnitOriginalType().destroy();
|
|
1034
1121
|
}
|
|
1035
|
-
this.
|
|
1122
|
+
this.getContentFactory().setUnitOriginalType(undefined);
|
|
1036
1123
|
}
|
|
1037
1124
|
|
|
1038
|
-
this.
|
|
1125
|
+
this.getContentFactory().setIsMeasure(false);
|
|
1039
1126
|
};
|
|
1040
1127
|
|
|
1041
1128
|
function _getDataTypeName() {
|
|
1042
|
-
var oDataType = this.
|
|
1129
|
+
var oDataType = this.getContentFactory().getDateOriginalType() || this.getContentFactory().getUnitOriginalType() || this.getContentFactory().getDataType(); // use original data type
|
|
1043
1130
|
if (oDataType && typeof oDataType === "object") {
|
|
1044
1131
|
return oDataType.getMetadata().getName();
|
|
1045
1132
|
} else if (this.bDelegateInitialized) {
|
|
1046
|
-
return this.
|
|
1133
|
+
return this.getTypeMap().getDataTypeClassName(this.getDataType());
|
|
1047
1134
|
} else {
|
|
1048
1135
|
return this.getDataType();
|
|
1049
1136
|
}
|
|
1050
1137
|
}
|
|
1051
1138
|
|
|
1052
1139
|
function _getDataTypeConstraints() {
|
|
1053
|
-
var oDataType = this.
|
|
1140
|
+
var oDataType = this.getContentFactory().getDateOriginalType() || this.getContentFactory().getUnitOriginalType() || this.getContentFactory().getDataType(); // use original data type
|
|
1054
1141
|
if (oDataType && typeof oDataType === "object" && oDataType.getConstraints()) {
|
|
1055
1142
|
return oDataType.getConstraints();
|
|
1056
1143
|
} else {
|
|
@@ -1059,7 +1146,7 @@ sap.ui.define([
|
|
|
1059
1146
|
}
|
|
1060
1147
|
|
|
1061
1148
|
function _getDataTypeFormatOptions() {
|
|
1062
|
-
var oDataType = this.
|
|
1149
|
+
var oDataType = this.getContentFactory().getDateOriginalType() || this.getContentFactory().getUnitOriginalType() || this.getContentFactory().getDataType(); // use original data type
|
|
1063
1150
|
if (oDataType && typeof oDataType === "object" && oDataType.getFormatOptions()) {
|
|
1064
1151
|
return oDataType.getFormatOptions();
|
|
1065
1152
|
} else {
|
|
@@ -1067,11 +1154,16 @@ sap.ui.define([
|
|
|
1067
1154
|
}
|
|
1068
1155
|
}
|
|
1069
1156
|
|
|
1157
|
+
/**
|
|
1158
|
+
* Determines the <code>BaseType</code> of the currently used data type.
|
|
1159
|
+
* @returns {sap.ui.mdc.enums.BaseType} BaseType
|
|
1160
|
+
* @protected
|
|
1161
|
+
*/
|
|
1070
1162
|
FieldBase.prototype.getBaseType = function() {
|
|
1071
1163
|
var sDataType = _getDataTypeName.call(this);
|
|
1072
1164
|
var oDataTypeConstraints = _getDataTypeConstraints.call(this);
|
|
1073
1165
|
var oDataTypeFormatOptions = _getDataTypeFormatOptions.call(this);
|
|
1074
|
-
var sBaseType = this.
|
|
1166
|
+
var sBaseType = this.getTypeMap().getBaseType(sDataType, oDataTypeFormatOptions, oDataTypeConstraints);
|
|
1075
1167
|
|
|
1076
1168
|
return sBaseType;
|
|
1077
1169
|
};
|
|
@@ -1086,13 +1178,17 @@ sap.ui.define([
|
|
|
1086
1178
|
|
|
1087
1179
|
}
|
|
1088
1180
|
|
|
1089
|
-
|
|
1090
|
-
|
|
1181
|
+
/**
|
|
1182
|
+
* Gets the currently used content controls.
|
|
1183
|
+
* @returns {sap.ui.core.Conterol[]} Array of content controls
|
|
1184
|
+
* @protected
|
|
1185
|
+
*/
|
|
1186
|
+
FieldBase.prototype.getCurrentContent = function() {
|
|
1091
1187
|
|
|
1092
1188
|
var oContent = this.getContent();
|
|
1093
1189
|
|
|
1094
1190
|
if (!oContent) {
|
|
1095
|
-
if (this.getEditMode() ===
|
|
1191
|
+
if (this.getEditMode() === FieldEditMode.Display) {
|
|
1096
1192
|
oContent = this.getContentDisplay();
|
|
1097
1193
|
} else {
|
|
1098
1194
|
oContent = this.getContentEdit();
|
|
@@ -1107,7 +1203,12 @@ sap.ui.define([
|
|
|
1107
1203
|
|
|
1108
1204
|
};
|
|
1109
1205
|
|
|
1110
|
-
|
|
1206
|
+
/**
|
|
1207
|
+
* Handler of the <code>ModelContextChange</code> event.
|
|
1208
|
+
* @param {object} oEvent event
|
|
1209
|
+
* @protected
|
|
1210
|
+
*/
|
|
1211
|
+
FieldBase.prototype.handleModelContextChange = function(oEvent) {
|
|
1111
1212
|
|
|
1112
1213
|
// let empty as overwritten in Field
|
|
1113
1214
|
|
|
@@ -1130,23 +1231,23 @@ sap.ui.define([
|
|
|
1130
1231
|
/**
|
|
1131
1232
|
* Observes changes.
|
|
1132
1233
|
*
|
|
1133
|
-
* To be enhanced by
|
|
1234
|
+
* To be enhanced by {@link sap.ui.mdc.Field Field}, {@link sap.ui.mdc.MultiValueField MultiValueField},
|
|
1235
|
+
* {@link sap.ui.mdc.FilterField FilterField}, or other inherited controls.
|
|
1134
1236
|
*
|
|
1135
1237
|
* @param {object} oChanges Changes
|
|
1136
|
-
* @
|
|
1137
|
-
* @ui5-restricted FieldBase subclasses
|
|
1238
|
+
* @protected
|
|
1138
1239
|
*/
|
|
1139
|
-
FieldBase.prototype.
|
|
1240
|
+
FieldBase.prototype.observeChanges = function(oChanges) {
|
|
1140
1241
|
|
|
1141
1242
|
if (oChanges.name === "dataType") {
|
|
1142
1243
|
// check only if different type (in Field type might be already taken from binding)
|
|
1143
|
-
if (this.
|
|
1244
|
+
if (this.getContentFactory().getDataType()) {
|
|
1144
1245
|
var fnCheck = function(sType) {
|
|
1145
|
-
this.
|
|
1146
|
-
if (bChanged && !this.
|
|
1147
|
-
this.
|
|
1246
|
+
this.getContentFactory().checkDataTypeChanged(sType).then(function(bChanged) {
|
|
1247
|
+
if (bChanged && !this.isFieldDestroyed()) {
|
|
1248
|
+
this.initDataType();
|
|
1148
1249
|
this.destroyAggregation("_content");
|
|
1149
|
-
this.
|
|
1250
|
+
this.getContentFactory().updateConditionType();
|
|
1150
1251
|
}
|
|
1151
1252
|
}.bind(this)).catch(function(oError) {
|
|
1152
1253
|
throw oError;
|
|
@@ -1163,19 +1264,19 @@ sap.ui.define([
|
|
|
1163
1264
|
|
|
1164
1265
|
if (oChanges.name === "dataTypeFormatOptions" || oChanges.name === "dataTypeConstraints") {
|
|
1165
1266
|
// if type is not created right now nothing to do
|
|
1166
|
-
if (this.
|
|
1167
|
-
this.
|
|
1267
|
+
if (this.getContentFactory().getDataType()) {
|
|
1268
|
+
this.initDataType();
|
|
1168
1269
|
this.destroyAggregation("_content");
|
|
1169
|
-
this.
|
|
1270
|
+
this.getContentFactory().updateConditionType();
|
|
1170
1271
|
}
|
|
1171
1272
|
}
|
|
1172
1273
|
|
|
1173
1274
|
if (oChanges.name === "maxConditions") {
|
|
1174
|
-
this.
|
|
1275
|
+
this.updateInternalContent();
|
|
1175
1276
|
}
|
|
1176
1277
|
|
|
1177
1278
|
if (oChanges.name === "conditions") {
|
|
1178
|
-
this.
|
|
1279
|
+
this.resetInvalidInput(); // if conditions updated from outside parse error is obsolete. If updated from inside no parse error occurs
|
|
1179
1280
|
_handleConditionsChange.call(this, oChanges.current, oChanges.old);
|
|
1180
1281
|
|
|
1181
1282
|
// try to find the corresponding async. change
|
|
@@ -1194,19 +1295,19 @@ sap.ui.define([
|
|
|
1194
1295
|
}
|
|
1195
1296
|
|
|
1196
1297
|
// in display mode rerender if changed from or to empty (show or hide empty-indicator)
|
|
1197
|
-
if ((oChanges.current.length === 0 || oChanges.old.length === 0) && this.getShowEmptyIndicator() && this.getEditMode() ===
|
|
1298
|
+
if ((oChanges.current.length === 0 || oChanges.old.length === 0) && this.getShowEmptyIndicator() && this.getEditMode() === FieldEditMode.Display && !this.getContent() && !this.getContentDisplay()) {
|
|
1198
1299
|
this.invalidate();
|
|
1199
1300
|
}
|
|
1200
1301
|
}
|
|
1201
1302
|
|
|
1202
1303
|
if (oChanges.name === "display") {
|
|
1203
|
-
this.
|
|
1204
|
-
this.
|
|
1304
|
+
this.destroyInternalContent(); // as bound property can change
|
|
1305
|
+
this.getContentFactory().updateConditionType();
|
|
1205
1306
|
}
|
|
1206
1307
|
|
|
1207
|
-
if (oChanges.name === "fieldHelp" && oChanges.ids) {
|
|
1308
|
+
if ((oChanges.name === "fieldHelp" || oChanges.name === "valueHelp") && oChanges.ids) {
|
|
1208
1309
|
_fieldHelpChanged.call(this, oChanges.ids, oChanges.mutation);
|
|
1209
|
-
this.
|
|
1310
|
+
this.getContentFactory().updateConditionType();
|
|
1210
1311
|
}
|
|
1211
1312
|
|
|
1212
1313
|
if (oChanges.name === "fieldInfo" && oChanges.child) {
|
|
@@ -1235,25 +1336,30 @@ sap.ui.define([
|
|
|
1235
1336
|
|
|
1236
1337
|
if (oChanges.name === "editMode") {
|
|
1237
1338
|
_refreshLabel.call(this); // as required-idicator might set or removed on Label
|
|
1238
|
-
if (this._bSettingsApplied && (oChanges.old ===
|
|
1339
|
+
if (this._bSettingsApplied && (oChanges.old === FieldEditMode.Display || oChanges.old === FieldEditMode.EditableDisplay || oChanges.current === FieldEditMode.Display || oChanges.current === FieldEditMode.EditableDisplay)) {
|
|
1239
1340
|
// edit mode changed after settings applied (happens if edit mode is bound and binding updates after control initialization)
|
|
1240
|
-
this.
|
|
1341
|
+
this.triggerCheckCreateInternalContent();
|
|
1241
1342
|
}
|
|
1242
1343
|
}
|
|
1243
1344
|
};
|
|
1244
1345
|
|
|
1245
|
-
|
|
1246
|
-
|
|
1346
|
+
/**
|
|
1347
|
+
* Triggers an update of the internal content controls.
|
|
1348
|
+
*
|
|
1349
|
+
* Should be called if properties are changed that might influence the content control.
|
|
1350
|
+
* @protected
|
|
1351
|
+
*/
|
|
1352
|
+
FieldBase.prototype.updateInternalContent = function() {
|
|
1247
1353
|
if (this.getAggregation("_content", []).length > 0) {
|
|
1248
1354
|
_createInternalContentWrapper.call(this);
|
|
1249
|
-
this.
|
|
1355
|
+
this.getContentFactory().updateConditionType(); // if control is not excanged at least ConditionType needs to be updated
|
|
1250
1356
|
}
|
|
1251
1357
|
};
|
|
1252
1358
|
|
|
1253
1359
|
// return the focus DOM elementof the used control
|
|
1254
1360
|
FieldBase.prototype.getFocusDomRef = function() {
|
|
1255
1361
|
|
|
1256
|
-
var aContent = this.
|
|
1362
|
+
var aContent = this.getCurrentContent();
|
|
1257
1363
|
|
|
1258
1364
|
if (aContent.length > 0) {
|
|
1259
1365
|
return aContent[0].getFocusDomRef();
|
|
@@ -1267,7 +1373,7 @@ sap.ui.define([
|
|
|
1267
1373
|
FieldBase.prototype.getIdForLabel = function() {
|
|
1268
1374
|
|
|
1269
1375
|
var sId;
|
|
1270
|
-
var aContent = this.
|
|
1376
|
+
var aContent = this.getCurrentContent();
|
|
1271
1377
|
if (aContent.length > 0) {
|
|
1272
1378
|
sId = aContent[0].getIdForLabel();
|
|
1273
1379
|
} else {
|
|
@@ -1295,9 +1401,9 @@ sap.ui.define([
|
|
|
1295
1401
|
*/
|
|
1296
1402
|
FieldBase.prototype.getControlForSuggestion = function() {
|
|
1297
1403
|
|
|
1298
|
-
var aContent = this.
|
|
1404
|
+
var aContent = this.getCurrentContent();
|
|
1299
1405
|
if (aContent.length > 0) {
|
|
1300
|
-
if (this.
|
|
1406
|
+
if (this.getContentFactory().isMeasure()) {
|
|
1301
1407
|
return aContent[1];
|
|
1302
1408
|
} else {
|
|
1303
1409
|
return aContent[0];
|
|
@@ -1342,7 +1448,7 @@ sap.ui.define([
|
|
|
1342
1448
|
*/
|
|
1343
1449
|
FieldBase.prototype.getMaxConditionsForHelp = function() {
|
|
1344
1450
|
|
|
1345
|
-
if (this.
|
|
1451
|
+
if (this.getContentFactory().isMeasure()) {
|
|
1346
1452
|
return 1; // only one unit allowed in help
|
|
1347
1453
|
} else {
|
|
1348
1454
|
return this.getMaxConditions();
|
|
@@ -1367,16 +1473,16 @@ sap.ui.define([
|
|
|
1367
1473
|
this._oResourceBundleM = sap.ui.getCore().getLibraryResourceBundle("sap.m");
|
|
1368
1474
|
}
|
|
1369
1475
|
return this._oResourceBundleM.getText("EMPTY_INDICATOR"); // TODO: clarify accessibility support for semantic conected fields
|
|
1370
|
-
} else if (this.
|
|
1476
|
+
} else if (this.getContentFactory().isMeasure() && this.getContentFactory().getUnitOriginalType()) {
|
|
1371
1477
|
// in unit case use original data type for formatting (as internal type hides unit)
|
|
1372
1478
|
var aValue = aConditions.length > 0 ? aConditions[0].values[0] : [0, null]; // TODO: support multiple conditions or other operator than EQ?
|
|
1373
|
-
return this.
|
|
1374
|
-
} else if (this.
|
|
1479
|
+
return this.getContentFactory().getUnitOriginalType().formatValue(aValue, "string");
|
|
1480
|
+
} else if (this.getContentFactory().getDateOriginalType()) {
|
|
1375
1481
|
// in date case use original data type for formatting (as internal type formats to ISO format)
|
|
1376
1482
|
var vValue = aConditions.length > 0 ? aConditions[0].values[0] : null; // TODO: support multiple conditions or other operator than EQ?
|
|
1377
|
-
return this.
|
|
1483
|
+
return this.getContentFactory().getDateOriginalType().formatValue(vValue, "string");
|
|
1378
1484
|
} else {
|
|
1379
|
-
var oConditionsType = this.
|
|
1485
|
+
var oConditionsType = this.getContentFactory().getConditionsType();
|
|
1380
1486
|
var oFormatOptions = oConditionsType.getFormatOptions();
|
|
1381
1487
|
var bNoFormatting = oFormatOptions.noFormatting;
|
|
1382
1488
|
oFormatOptions.noFormatting = false; // for display text always format
|
|
@@ -1404,7 +1510,7 @@ sap.ui.define([
|
|
|
1404
1510
|
|
|
1405
1511
|
/**
|
|
1406
1512
|
* Required by the {@link sap.m.IOverflowToolbarContent} interface.
|
|
1407
|
-
* Registers invalidations event
|
|
1513
|
+
* Registers invalidations event that is fired when width of the control is changed.
|
|
1408
1514
|
*
|
|
1409
1515
|
* @protected
|
|
1410
1516
|
* @returns {object} Configuration information for the <code>sap.m.IOverflowToolbarContent</code> interface.
|
|
@@ -1431,14 +1537,14 @@ sap.ui.define([
|
|
|
1431
1537
|
|
|
1432
1538
|
};
|
|
1433
1539
|
|
|
1434
|
-
|
|
1540
|
+
/*
|
|
1435
1541
|
* @returns {object} Current accessibility state of the control.
|
|
1436
1542
|
* @see sap.ui.core.Control#getAccessibilityInfo
|
|
1437
1543
|
* @protected
|
|
1438
1544
|
*/
|
|
1439
1545
|
FieldBase.prototype.getAccessibilityInfo = function() {
|
|
1440
1546
|
|
|
1441
|
-
var aContent = this.
|
|
1547
|
+
var aContent = this.getCurrentContent();
|
|
1442
1548
|
if (aContent.length > 0 && aContent[0].getAccessibilityInfo) {
|
|
1443
1549
|
return aContent[0].getAccessibilityInfo(); // TODO: unit field
|
|
1444
1550
|
} else {
|
|
@@ -1513,18 +1619,15 @@ sap.ui.define([
|
|
|
1513
1619
|
}
|
|
1514
1620
|
|
|
1515
1621
|
/**
|
|
1516
|
-
* Assigns a <code>Label</code> control to the {@link sap.ui.mdc.Field Field} or {@link sap.ui.mdc.FilterField FilterField} controls.
|
|
1622
|
+
* Assigns a <code>Label</code> control to the {@link sap.ui.mdc.Field Field}, {@link sap.ui.mdc.MultiValueField MultiValueField}, or {@link sap.ui.mdc.FilterField FilterField} controls.
|
|
1517
1623
|
*
|
|
1518
|
-
* The text of the label is taken from the {@link sap.ui.mdc.Field Field} or {@link sap.ui.mdc.FilterField FilterField} controls.
|
|
1519
|
-
* The <code>labelFor</code> association is set to the {@link sap.ui.mdc.Field Field} or {@link sap.ui.mdc.FilterField FilterField} control.
|
|
1624
|
+
* The text of the label is taken from the {@link sap.ui.mdc.Field Field}, {@link sap.ui.mdc.MultiValueField MultiValueField}, or {@link sap.ui.mdc.FilterField FilterField} controls.
|
|
1625
|
+
* The <code>labelFor</code> association is set to the {@link sap.ui.mdc.Field Field}, {@link sap.ui.mdc.MultiValueField MultiValueField}, or {@link sap.ui.mdc.FilterField FilterField} control.
|
|
1520
1626
|
*
|
|
1521
1627
|
* @param {sap.ui.core.Label} oLabel Label control
|
|
1522
1628
|
* @returns {this} Reference to <code>this</code> to allow method chaining
|
|
1523
1629
|
*
|
|
1524
|
-
* @
|
|
1525
|
-
* @ui5-restricted sap.ui.mdc sap.fe
|
|
1526
|
-
* @MDC_PUBLIC_CANDIDATE
|
|
1527
|
-
* @experimental As of version 1.62.0
|
|
1630
|
+
* @public
|
|
1528
1631
|
* @since 1.62.0 Disclaimer: this function is in a beta state - incompatible API changes may be done before its official public release. Use at your own discretion.
|
|
1529
1632
|
*/
|
|
1530
1633
|
FieldBase.prototype.connectLabel = function(oLabel) {
|
|
@@ -1558,8 +1661,8 @@ sap.ui.define([
|
|
|
1558
1661
|
_restoreKeyboardHandler.call(this, oContent);
|
|
1559
1662
|
_restoreFieldGroupHandler.call(this, oContent);
|
|
1560
1663
|
|
|
1561
|
-
if (this.
|
|
1562
|
-
delete this.
|
|
1664
|
+
if (this.getContentFactory().getContentConditionTypes()) {
|
|
1665
|
+
delete this.getContentFactory().getContentConditionTypes()[sName];
|
|
1563
1666
|
}
|
|
1564
1667
|
oContent.setModel(null, "$field"); // remove binding to Field
|
|
1565
1668
|
// let the internal control be created on rendering
|
|
@@ -1574,23 +1677,23 @@ sap.ui.define([
|
|
|
1574
1677
|
// bind to ManagedObjectModel at rendering to prevent unneded updates
|
|
1575
1678
|
|
|
1576
1679
|
if (this.getAggregation("_content", []).length > 0) {
|
|
1577
|
-
this.
|
|
1680
|
+
this.destroyInternalContent();
|
|
1578
1681
|
}
|
|
1579
1682
|
|
|
1580
1683
|
// as for edit and display different Types are possible switch them with edit mode
|
|
1581
|
-
if (!this.
|
|
1582
|
-
this.
|
|
1684
|
+
if (!this.getContentFactory().getContentConditionTypes()) {
|
|
1685
|
+
this.getContentFactory().setContentConditionTypes({});
|
|
1583
1686
|
}
|
|
1584
|
-
if (!this.
|
|
1585
|
-
this.
|
|
1687
|
+
if (!this.getContentFactory().getContentConditionTypes()[sName]) {
|
|
1688
|
+
this.getContentFactory().getContentConditionTypes()[sName] = {};
|
|
1586
1689
|
}
|
|
1587
|
-
this.
|
|
1690
|
+
this.getContentFactory().setNoFormatting(false); // initialize
|
|
1588
1691
|
this.awaitControlDelegate().then(function() {
|
|
1589
|
-
if (!this.
|
|
1590
|
-
var bHideOperator = _isOnlyOneSingleValue.call(this, this.
|
|
1591
|
-
if (bHideOperator !== this.
|
|
1592
|
-
this.
|
|
1593
|
-
this.
|
|
1692
|
+
if (!this.isFieldDestroyed()) {
|
|
1693
|
+
var bHideOperator = _isOnlyOneSingleValue.call(this, this.getSupportedOperators());
|
|
1694
|
+
if (bHideOperator !== this.getContentFactory().getHideOperator()) {
|
|
1695
|
+
this.getContentFactory().setHideOperator(bHideOperator); // in single value eq Field hide operator
|
|
1696
|
+
this.getContentFactory()._setUsedConditionType(this.getContent(), this.getContentEdit(), this.getContentDisplay(), this.getEditMode()); // if external content use it's conditionType
|
|
1594
1697
|
}
|
|
1595
1698
|
}
|
|
1596
1699
|
}.bind(this));
|
|
@@ -1603,7 +1706,7 @@ sap.ui.define([
|
|
|
1603
1706
|
if (oContent.getBindingPath(sProperty) === "/conditions") {
|
|
1604
1707
|
oBindingInfo = oContent.getBindingInfo(sProperty);
|
|
1605
1708
|
if (oBindingInfo && oBindingInfo.type && oBindingInfo.type instanceof ConditionsType) {
|
|
1606
|
-
this.
|
|
1709
|
+
this.getContentFactory().getContentConditionTypes()[sName].oConditionsType = oBindingInfo.type;
|
|
1607
1710
|
}
|
|
1608
1711
|
bPropertyBound = true;
|
|
1609
1712
|
}
|
|
@@ -1649,9 +1752,9 @@ sap.ui.define([
|
|
|
1649
1752
|
for (sProperty in oBindingInfo.template.getMetadata().getAllProperties()) {
|
|
1650
1753
|
var oTemplateBindingInfo = oBindingInfo.template.getBindingInfo(sProperty);
|
|
1651
1754
|
if (oTemplateBindingInfo && oTemplateBindingInfo.type && oTemplateBindingInfo.type instanceof ConditionType) {
|
|
1652
|
-
this.
|
|
1755
|
+
this.getContentFactory().getContentConditionTypes()[sName].oConditionType = oTemplateBindingInfo.type;
|
|
1653
1756
|
if (bPropertyBound) { // both value and tokens are bound -> don't format Value, only parse it
|
|
1654
|
-
this.
|
|
1757
|
+
this.getContentFactory().setNoFormatting(true);
|
|
1655
1758
|
}
|
|
1656
1759
|
break;
|
|
1657
1760
|
}
|
|
@@ -1665,7 +1768,7 @@ sap.ui.define([
|
|
|
1665
1768
|
}
|
|
1666
1769
|
|
|
1667
1770
|
if (oContent.getMetadata().getAllAssociations().ariaLabelledBy) {
|
|
1668
|
-
this.
|
|
1771
|
+
this.getContentFactory().setAriaLabelledBy(oContent);
|
|
1669
1772
|
}
|
|
1670
1773
|
}
|
|
1671
1774
|
|
|
@@ -1738,29 +1841,34 @@ sap.ui.define([
|
|
|
1738
1841
|
}
|
|
1739
1842
|
}
|
|
1740
1843
|
|
|
1741
|
-
|
|
1742
|
-
*
|
|
1844
|
+
/**
|
|
1845
|
+
* Checks if all needed information is provided to create the internal content control.
|
|
1846
|
+
* If possible create internal controls.
|
|
1847
|
+
* @protected
|
|
1743
1848
|
*/
|
|
1744
|
-
FieldBase.prototype.
|
|
1849
|
+
FieldBase.prototype.checkCreateInternalContent = function() {
|
|
1745
1850
|
|
|
1746
|
-
if (!this.
|
|
1851
|
+
if (!this.isFieldDestroyed() && this.getVisible() && this.getContentFactory().getDataType()) {
|
|
1747
1852
|
_createInternalContentWrapper.call(this);
|
|
1748
1853
|
}
|
|
1749
1854
|
|
|
1750
1855
|
};
|
|
1751
1856
|
|
|
1752
|
-
|
|
1753
|
-
*
|
|
1857
|
+
/**
|
|
1858
|
+
* Triggers a check if all relevant properties are set to create the internal content control.
|
|
1859
|
+
*
|
|
1860
|
+
* To be sure that the check is not called multiple times, it needs
|
|
1754
1861
|
* to be checked if there is a pending check.
|
|
1755
|
-
* Multiple calls might happen if properties are
|
|
1756
|
-
* the
|
|
1862
|
+
* Multiple calls might happen if properties are changed often or
|
|
1863
|
+
* the check is triggered during a <code>BindingContext</code> update (which is often called in propagation).
|
|
1864
|
+
* @protected
|
|
1757
1865
|
*/
|
|
1758
|
-
FieldBase.prototype.
|
|
1866
|
+
FieldBase.prototype.triggerCheckCreateInternalContent = function() {
|
|
1759
1867
|
|
|
1760
1868
|
if (!this._oCheckCreateInternalContentPromise) {
|
|
1761
1869
|
this._oCheckCreateInternalContentPromise = this.awaitControlDelegate().then(function() {
|
|
1762
1870
|
delete this._oCheckCreateInternalContentPromise;
|
|
1763
|
-
this.
|
|
1871
|
+
this.checkCreateInternalContent();
|
|
1764
1872
|
}.bind(this));
|
|
1765
1873
|
}
|
|
1766
1874
|
|
|
@@ -1768,7 +1876,7 @@ sap.ui.define([
|
|
|
1768
1876
|
|
|
1769
1877
|
function _createInternalContent() {
|
|
1770
1878
|
|
|
1771
|
-
if (this.
|
|
1879
|
+
if (this.isFieldDestroyed()) {
|
|
1772
1880
|
return; // for destroyed field do nothing on internal control
|
|
1773
1881
|
}
|
|
1774
1882
|
|
|
@@ -1777,16 +1885,16 @@ sap.ui.define([
|
|
|
1777
1885
|
var oContentEdit = this.getContentEdit();
|
|
1778
1886
|
var oContentDisplay = this.getContentDisplay();
|
|
1779
1887
|
|
|
1780
|
-
this.
|
|
1781
|
-
_checkFieldHelpExist.call(this, this.
|
|
1888
|
+
this.getContentFactory()._setUsedConditionType(oContent, oContentEdit, oContentDisplay, sEditMode); // if external content use it's conditionType
|
|
1889
|
+
_checkFieldHelpExist.call(this, this._getValueHelp()); // as ValueHelp might be created after ID is assigned to Field
|
|
1782
1890
|
_setAriaAttributes.call(this, false);
|
|
1783
1891
|
|
|
1784
1892
|
|
|
1785
1893
|
if (oContent ||
|
|
1786
|
-
(sEditMode ===
|
|
1787
|
-
(sEditMode !==
|
|
1788
|
-
this.
|
|
1789
|
-
var aContent = this.
|
|
1894
|
+
(sEditMode === FieldEditMode.Display && oContentDisplay) ||
|
|
1895
|
+
(sEditMode !== FieldEditMode.Display && oContentEdit)) {
|
|
1896
|
+
this.destroyInternalContent();
|
|
1897
|
+
var aContent = this.getCurrentContent(); // external set content
|
|
1790
1898
|
if (aContent.length === 1) {
|
|
1791
1899
|
_setModelOnContent.call(this, aContent[0]); // bind to ManagedObjectModel
|
|
1792
1900
|
}
|
|
@@ -1795,7 +1903,7 @@ sap.ui.define([
|
|
|
1795
1903
|
|
|
1796
1904
|
// Moved to ContentFactory logic
|
|
1797
1905
|
var iMaxConditions = this.getMaxConditions();
|
|
1798
|
-
var aOperators = this.
|
|
1906
|
+
var aOperators = this.getSupportedOperators();
|
|
1799
1907
|
var sControlName;
|
|
1800
1908
|
var aContentOld = this.getAggregation("_content", []);
|
|
1801
1909
|
var oContentOld;
|
|
@@ -1803,28 +1911,28 @@ sap.ui.define([
|
|
|
1803
1911
|
|
|
1804
1912
|
var bMultipleLines = this.getMultipleLines();
|
|
1805
1913
|
var bIsTriggerable = this._bTriggerable;
|
|
1806
|
-
var oContentType = this.
|
|
1914
|
+
var oContentType = this.getContentFactory().getContentType(this.getBaseType(), this.getMaxConditions(), bIsTriggerable);
|
|
1807
1915
|
|
|
1808
1916
|
if (aContentOld.length > 0) {
|
|
1809
1917
|
oContentOld = aContentOld[0];
|
|
1810
1918
|
sControlNameOld = oContentOld.getMetadata().getName().replace(/\./g, "/");
|
|
1811
1919
|
}
|
|
1812
1920
|
|
|
1813
|
-
var sContentMode = this.
|
|
1921
|
+
var sContentMode = this.getContentFactory().getContentMode(oContentType, sEditMode, iMaxConditions, bMultipleLines, aOperators);
|
|
1814
1922
|
var aControlNames = oContentType.getControlNames(sContentMode, aOperators[0]);
|
|
1815
1923
|
sControlName = aControlNames[0];
|
|
1816
1924
|
if (sControlName !== sControlNameOld) {
|
|
1817
|
-
this.
|
|
1925
|
+
this.getContentFactory().setHideOperator(_isOnlyOneSingleValue.call(this, aOperators)); // in single value eq Field hide operator
|
|
1818
1926
|
|
|
1819
1927
|
if (oContentOld) {
|
|
1820
|
-
this.
|
|
1928
|
+
this.destroyInternalContent();
|
|
1821
1929
|
|
|
1822
1930
|
if (oContentOld.isA("sap.m.DateTimeField")) {
|
|
1823
1931
|
// in case of DatePicker remove type with special format options
|
|
1824
|
-
this.
|
|
1932
|
+
this.initDataType();
|
|
1825
1933
|
}
|
|
1826
1934
|
|
|
1827
|
-
this.
|
|
1935
|
+
this.getContentFactory().updateConditionType();
|
|
1828
1936
|
}
|
|
1829
1937
|
|
|
1830
1938
|
if (_useDefaultFieldHelp.call(this, oContentType, aOperators, sEditMode, iMaxConditions)) {
|
|
@@ -1835,10 +1943,10 @@ sap.ui.define([
|
|
|
1835
1943
|
}
|
|
1836
1944
|
|
|
1837
1945
|
var sId = _getIdForInternalControl.call(this);
|
|
1838
|
-
this._oCreateContentPromise = this.
|
|
1946
|
+
this._oCreateContentPromise = this.getContentFactory().createContent(oContentType, sContentMode, sId);
|
|
1839
1947
|
this._oCreateContentPromise.then(function(aControls) {
|
|
1840
1948
|
delete this._oCreateContentPromise; // after finished new creation request can be sync again (clear at the beginning as error might break function before end)
|
|
1841
|
-
for (var iIndex = 0; iIndex < aControls.length; iIndex++) {
|
|
1949
|
+
for (var iIndex = 0; iIndex < aControls.length; iIndex++) { // if already destroyed ContentFactory will not create any content control
|
|
1842
1950
|
var oControl = aControls[iIndex];
|
|
1843
1951
|
oControl.attachEvent("parseError", _handleParseError, this);
|
|
1844
1952
|
oControl.attachEvent("validationError", _handleValidationError, this);
|
|
@@ -1846,9 +1954,6 @@ sap.ui.define([
|
|
|
1846
1954
|
_modifyKeyboardHandler.call(this, oControl, oContentType.getUseDefaultEnterHandler());
|
|
1847
1955
|
_modifyFieldGroupHandler.call(this, oControl, false);
|
|
1848
1956
|
_setModelOnContent.call(this, oControl);
|
|
1849
|
-
if (this._bConnected && ((iIndex === 0 && !this._getContentFactory().isMeasure()) || (iIndex === 1 && this._getContentFactory().isMeasure()))) {
|
|
1850
|
-
_setFocusHandlingForFieldHelp.call(this, oControl);
|
|
1851
|
-
}
|
|
1852
1957
|
this.addAggregation("_content", oControl);
|
|
1853
1958
|
}
|
|
1854
1959
|
|
|
@@ -1866,34 +1971,38 @@ sap.ui.define([
|
|
|
1866
1971
|
|
|
1867
1972
|
}
|
|
1868
1973
|
|
|
1869
|
-
|
|
1974
|
+
/**
|
|
1975
|
+
* Destroys the internal content controls.
|
|
1976
|
+
* @protected
|
|
1977
|
+
*/
|
|
1978
|
+
FieldBase.prototype.destroyInternalContent = function () {
|
|
1870
1979
|
|
|
1871
1980
|
// if the internalContent must be new created the data type must be switched back to original one
|
|
1872
1981
|
// so new creation of control is using original data
|
|
1873
1982
|
this.destroyAggregation("_content");
|
|
1874
1983
|
|
|
1875
|
-
if (this.
|
|
1876
|
-
this.
|
|
1877
|
-
this.
|
|
1878
|
-
} else if (this.
|
|
1879
|
-
this.
|
|
1880
|
-
this.
|
|
1984
|
+
if (this.getContentFactory().getDateOriginalType()) {
|
|
1985
|
+
this.getContentFactory().setDataType(this.getContentFactory().getDateOriginalType());
|
|
1986
|
+
this.getContentFactory().setDateOriginalType(undefined);
|
|
1987
|
+
} else if (this.getContentFactory().getUnitOriginalType()) {
|
|
1988
|
+
this.getContentFactory().setDataType(this.getContentFactory().getUnitOriginalType());
|
|
1989
|
+
this.getContentFactory().setUnitOriginalType(undefined);
|
|
1881
1990
|
}
|
|
1882
1991
|
|
|
1883
|
-
if (this.
|
|
1992
|
+
if (this.isInvalidInput()) {
|
|
1884
1993
|
// as wrong input get lost if content control is destroyed.
|
|
1885
|
-
this.
|
|
1994
|
+
this.resetInvalidInput();
|
|
1886
1995
|
this._removeUIMessage();
|
|
1887
1996
|
}
|
|
1888
1997
|
|
|
1889
|
-
if (this.
|
|
1890
|
-
this.
|
|
1998
|
+
if (this.getContentFactory().isMeasure()) {
|
|
1999
|
+
this.getContentFactory().setIsMeasure(false);
|
|
1891
2000
|
}
|
|
1892
2001
|
|
|
1893
2002
|
};
|
|
1894
2003
|
|
|
1895
2004
|
function _setModelOnContent(oContent) {
|
|
1896
|
-
if (!this._oManagedObjectModel && !this.
|
|
2005
|
+
if (!this._oManagedObjectModel && !this.isFieldDestroyed()) {
|
|
1897
2006
|
this._oManagedObjectModel = new ManagedObjectModel(this);
|
|
1898
2007
|
}
|
|
1899
2008
|
oContent.setModel(this._oManagedObjectModel, "$field");
|
|
@@ -2038,7 +2147,7 @@ sap.ui.define([
|
|
|
2038
2147
|
|
|
2039
2148
|
var oValueHelp = mDefaultHelps[sType].control;
|
|
2040
2149
|
|
|
2041
|
-
if (oValueHelp && oValueHelp.
|
|
2150
|
+
if (oValueHelp && oValueHelp.isDestroyed()) {
|
|
2042
2151
|
// someone destroyed FieldHelp -> initialize
|
|
2043
2152
|
mDefaultHelps[sType].control = undefined;
|
|
2044
2153
|
oValueHelp = undefined;
|
|
@@ -2054,9 +2163,8 @@ sap.ui.define([
|
|
|
2054
2163
|
var ValueHelp = aModules[0];
|
|
2055
2164
|
var Container = aModules[1];
|
|
2056
2165
|
var Content = aModules[2];
|
|
2057
|
-
var oDelegate = this.bDelegateInitialized && this.getControlDelegate()[mDefaultHelps[sType].getDelegate]();
|
|
2058
2166
|
oValueHelp = new ValueHelp(mDefaultHelps[sType].id, {
|
|
2059
|
-
delegate:
|
|
2167
|
+
delegate: {name: "sap/ui/mdc/ValueHelpDelegate", payload: {isDefaultHelp: true}} // use base-delegate as TypeUtil of delegate is not used in current ValueHelp implementation as we transfer the Type of the Field into the ValueHelp (oConfig)
|
|
2060
2168
|
});
|
|
2061
2169
|
var oContainer = new Container(mDefaultHelps[sType].id + "-container", {
|
|
2062
2170
|
content: [new Content(mDefaultHelps[sType].id + "-content", mDefaultHelps[sType].contentProperties)]
|
|
@@ -2091,7 +2199,7 @@ sap.ui.define([
|
|
|
2091
2199
|
function _useDefaultFieldHelp(oContentType, aOperators, sEditMode, iMaxConditions) {
|
|
2092
2200
|
|
|
2093
2201
|
var oUseDefaultFieldHelp = oContentType.getUseDefaultFieldHelp();
|
|
2094
|
-
if (oUseDefaultFieldHelp && !this.
|
|
2202
|
+
if (oUseDefaultFieldHelp && !this._getValueHelp() && sEditMode !== FieldEditMode.Display) {
|
|
2095
2203
|
if ((iMaxConditions === 1 && oUseDefaultFieldHelp.single) || (iMaxConditions !== 1 && oUseDefaultFieldHelp.multi)) {
|
|
2096
2204
|
if (aOperators.length === 1) {
|
|
2097
2205
|
var bIsSingleValue = _isOnlyOneSingleValue.call(this, aOperators); // if operator not exists unse no field help
|
|
@@ -2140,13 +2248,24 @@ sap.ui.define([
|
|
|
2140
2248
|
|
|
2141
2249
|
};
|
|
2142
2250
|
|
|
2143
|
-
|
|
2251
|
+
/**
|
|
2252
|
+
* Resets invalid input information.
|
|
2253
|
+
*
|
|
2254
|
+
* Might be called if Binding changes or field is initialized.
|
|
2255
|
+
* @protected
|
|
2256
|
+
*/
|
|
2257
|
+
FieldBase.prototype.resetInvalidInput = function() {
|
|
2144
2258
|
|
|
2145
2259
|
this._oInvalidInput = null;
|
|
2146
2260
|
|
|
2147
2261
|
};
|
|
2148
2262
|
|
|
2149
|
-
|
|
2263
|
+
/**
|
|
2264
|
+
* Checks if there is invalid input.
|
|
2265
|
+
* @returns {boolean} True if there is invalid input
|
|
2266
|
+
* @protected
|
|
2267
|
+
*/
|
|
2268
|
+
FieldBase.prototype.isInvalidInput = function() {
|
|
2150
2269
|
|
|
2151
2270
|
return !!this._oInvalidInput;
|
|
2152
2271
|
|
|
@@ -2198,7 +2317,7 @@ sap.ui.define([
|
|
|
2198
2317
|
|
|
2199
2318
|
function _handleValidationSuccess(oEvent) {
|
|
2200
2319
|
|
|
2201
|
-
this.
|
|
2320
|
+
this.resetInvalidInput(); // if last valid value is entered again no condition is updated
|
|
2202
2321
|
|
|
2203
2322
|
}
|
|
2204
2323
|
|
|
@@ -2231,7 +2350,7 @@ sap.ui.define([
|
|
|
2231
2350
|
|
|
2232
2351
|
if (oChange.changeEvent.parameters.hasOwnProperty("valid")) {
|
|
2233
2352
|
bValid = oChange.changeEvent.parameters["valid"];
|
|
2234
|
-
} else if (this.
|
|
2353
|
+
} else if (this.isInvalidInput()) {
|
|
2235
2354
|
// this might be result of a value that cannot be parsed
|
|
2236
2355
|
bValid = false;
|
|
2237
2356
|
}
|
|
@@ -2255,7 +2374,7 @@ sap.ui.define([
|
|
|
2255
2374
|
|
|
2256
2375
|
if (this._oNavigateCondition) {
|
|
2257
2376
|
this._oNavigateCondition = undefined; // navigation now finished
|
|
2258
|
-
this.
|
|
2377
|
+
this.getContentFactory().updateConditionType();
|
|
2259
2378
|
}
|
|
2260
2379
|
|
|
2261
2380
|
if (oChange.resolve) {
|
|
@@ -2275,7 +2394,7 @@ sap.ui.define([
|
|
|
2275
2394
|
var oSource = oEvent.getSource();
|
|
2276
2395
|
|
|
2277
2396
|
this._oNavigateCondition = undefined; // navigation item is not longer valid
|
|
2278
|
-
this.
|
|
2397
|
+
this.getContentFactory().updateConditionType();
|
|
2279
2398
|
|
|
2280
2399
|
if ("value" in oEvent.getParameters()) {
|
|
2281
2400
|
vValue = oEvent.getParameter("value");
|
|
@@ -2297,7 +2416,7 @@ sap.ui.define([
|
|
|
2297
2416
|
|
|
2298
2417
|
var oFieldHelp = _getFieldHelp.call(this);
|
|
2299
2418
|
|
|
2300
|
-
if (oFieldHelp && (!this.
|
|
2419
|
+
if (oFieldHelp && (!this.getContentFactory().isMeasure() || oSource.getShowValueHelp())) {
|
|
2301
2420
|
if (bEscPressed) {
|
|
2302
2421
|
// close FieldHelp if escape pressed and not repoen it for last typed characters
|
|
2303
2422
|
if (oFieldHelp.isOpen()) {
|
|
@@ -2307,7 +2426,7 @@ sap.ui.define([
|
|
|
2307
2426
|
this._sFilterValue = "";
|
|
2308
2427
|
}
|
|
2309
2428
|
} else {
|
|
2310
|
-
var aOperators = this.
|
|
2429
|
+
var aOperators = this.getSupportedOperators(); // show suggestion only if equal operators are supported
|
|
2311
2430
|
var bUseFieldHelp = false;
|
|
2312
2431
|
|
|
2313
2432
|
// check if at least one operator supports field help
|
|
@@ -2373,7 +2492,7 @@ sap.ui.define([
|
|
|
2373
2492
|
}
|
|
2374
2493
|
}.bind(this);
|
|
2375
2494
|
|
|
2376
|
-
if (this._bConnected && this.
|
|
2495
|
+
if (this._bConnected && this.getCurrentContent()[0]) {
|
|
2377
2496
|
oFieldHelp.isTypeaheadSupported().then(function (bTypeahead) {
|
|
2378
2497
|
return !!bTypeahead && _handleTypeahead();
|
|
2379
2498
|
});
|
|
@@ -2420,7 +2539,7 @@ sap.ui.define([
|
|
|
2420
2539
|
if (oFieldInfo) {
|
|
2421
2540
|
oFieldInfo.getTriggerHref().then(function(sHref) {
|
|
2422
2541
|
if (!sHref) {
|
|
2423
|
-
oFieldInfo.open(this.
|
|
2542
|
+
oFieldInfo.open(this.getCurrentContent()[0]);
|
|
2424
2543
|
_setAriaAttributes.call(this, true);
|
|
2425
2544
|
}
|
|
2426
2545
|
}.bind(this));
|
|
@@ -2448,7 +2567,7 @@ sap.ui.define([
|
|
|
2448
2567
|
|
|
2449
2568
|
for (i = aConditions.length - 1; i >= 0; i--) {
|
|
2450
2569
|
if (aConditions[i].delete) {
|
|
2451
|
-
if (this.
|
|
2570
|
+
if (this.getContentFactory().isMeasure()) {
|
|
2452
2571
|
// store for dummy condition if all conditions are removed
|
|
2453
2572
|
sUnit = aConditions[i].values[0][1];
|
|
2454
2573
|
oPayload = aConditions[i].payload;
|
|
@@ -2457,7 +2576,7 @@ sap.ui.define([
|
|
|
2457
2576
|
}
|
|
2458
2577
|
}
|
|
2459
2578
|
|
|
2460
|
-
if (this.
|
|
2579
|
+
if (this.getContentFactory().isMeasure() && sUnit && aConditions.length === 0) {
|
|
2461
2580
|
// create dummy condition for unit
|
|
2462
2581
|
aConditions = [Condition.createItemCondition([undefined, sUnit], undefined, undefined, undefined, oPayload)];
|
|
2463
2582
|
}
|
|
@@ -2488,7 +2607,7 @@ sap.ui.define([
|
|
|
2488
2607
|
_checkFieldHelpExist.call(this, sId);
|
|
2489
2608
|
|
|
2490
2609
|
// update icon (on remove not necessary as hidden)
|
|
2491
|
-
var oControl = this.
|
|
2610
|
+
var oControl = this.getCurrentContent()[0];
|
|
2492
2611
|
if (oControl && oControl.setValueHelpIconSrc) {
|
|
2493
2612
|
oControl.setValueHelpIconSrc(this._getFieldHelpIcon());
|
|
2494
2613
|
}
|
|
@@ -2512,9 +2631,16 @@ sap.ui.define([
|
|
|
2512
2631
|
|
|
2513
2632
|
}
|
|
2514
2633
|
|
|
2634
|
+
// TODO: remove this function and replace by getValueHelp once FieldHelp association is completetly removed.
|
|
2635
|
+
FieldBase.prototype._getValueHelp = function() {
|
|
2636
|
+
|
|
2637
|
+
return this.getValueHelp() || (this.getFieldHelp && this.getFieldHelp()); // as getFieldHelp not exist in legacy-free UI5
|
|
2638
|
+
|
|
2639
|
+
};
|
|
2640
|
+
|
|
2515
2641
|
function _getFieldHelp() {
|
|
2516
2642
|
|
|
2517
|
-
var sId = this.
|
|
2643
|
+
var sId = this._getValueHelp();
|
|
2518
2644
|
var oFieldHelp;
|
|
2519
2645
|
|
|
2520
2646
|
if (!sId && this._sDefaultFieldHelp) {
|
|
@@ -2536,11 +2662,11 @@ sap.ui.define([
|
|
|
2536
2662
|
}
|
|
2537
2663
|
|
|
2538
2664
|
var aHelpConditions;
|
|
2539
|
-
if (this.
|
|
2665
|
+
if (this.isInvalidInput() && this.getMaxConditionsForHelp() === 1) {
|
|
2540
2666
|
// if parsing error and single value case do not see the old (outdated) condition as selected
|
|
2541
2667
|
// TODO: handling if error only on unit or number part
|
|
2542
2668
|
aHelpConditions = [];
|
|
2543
|
-
} else if (this.
|
|
2669
|
+
} else if (this.getContentFactory().isMeasure()) {
|
|
2544
2670
|
// for unit or curreny add only the unit/currency to FieldHelp
|
|
2545
2671
|
aHelpConditions = [];
|
|
2546
2672
|
for (var i = 0; i < aConditions.length; i++) {
|
|
@@ -2558,7 +2684,7 @@ sap.ui.define([
|
|
|
2558
2684
|
|
|
2559
2685
|
}
|
|
2560
2686
|
|
|
2561
|
-
function _handleValueHelpRequest(oEvent) {
|
|
2687
|
+
function _handleValueHelpRequest(oEvent, bOpenAsTypeahed) { // if triggered by valueHelpRequest event alway open as dialog, if called from Tap or Focus as typeahead
|
|
2562
2688
|
|
|
2563
2689
|
var oFieldHelp = _getFieldHelp.call(this);
|
|
2564
2690
|
|
|
@@ -2569,10 +2695,10 @@ sap.ui.define([
|
|
|
2569
2695
|
oFieldHelp.setFilterValue(this._sFilterValue); // use types value for filtering, even if reopening FieldHelp
|
|
2570
2696
|
var aConditions = this.getConditions();
|
|
2571
2697
|
_setConditionsOnFieldHelp.call(this, aConditions, oFieldHelp);
|
|
2572
|
-
oFieldHelp.toggleOpen(
|
|
2698
|
+
oFieldHelp.toggleOpen(!!bOpenAsTypeahed);
|
|
2573
2699
|
if (!oFieldHelp.isFocusInHelp()) {
|
|
2574
2700
|
// need to reset bValueHelpRequested in Input, otherwise on focusout no change event and navigation don't work
|
|
2575
|
-
var oContent = oEvent.getSource();
|
|
2701
|
+
var oContent = oEvent.srcControl || oEvent.getSource(); // as, if called from Tap or other brwowser event getSource is not available
|
|
2576
2702
|
if (oContent.bValueHelpRequested) {
|
|
2577
2703
|
oContent.bValueHelpRequested = false; // TODO: need API
|
|
2578
2704
|
}
|
|
@@ -2594,7 +2720,7 @@ sap.ui.define([
|
|
|
2594
2720
|
var sDOMValue;
|
|
2595
2721
|
var i = 0;
|
|
2596
2722
|
|
|
2597
|
-
if (this.
|
|
2723
|
+
if (this.getContentFactory().isMeasure()) {
|
|
2598
2724
|
if (aNewConditions.length > 1) {
|
|
2599
2725
|
throw new Error("Only one item must be selected! " + this);
|
|
2600
2726
|
}
|
|
@@ -2620,12 +2746,12 @@ sap.ui.define([
|
|
|
2620
2746
|
}
|
|
2621
2747
|
}
|
|
2622
2748
|
} else {
|
|
2623
|
-
var oOperator = FilterOperatorUtil.getEQOperator(this.
|
|
2624
|
-
var aValue =
|
|
2749
|
+
var oOperator = FilterOperatorUtil.getEQOperator(this.getSupportedOperators());
|
|
2750
|
+
var aValue = [null, aNewConditions[0].values[0]];
|
|
2625
2751
|
oCondition = Condition.createCondition(oOperator.name, [aValue], aNewConditions[0].inParameters, aNewConditions[0].outParameters, ConditionValidated.NotValidated, aNewConditions[0].payload);
|
|
2626
2752
|
aConditions.push(oCondition);
|
|
2627
|
-
var oConditionType = this.
|
|
2628
|
-
var oConditionsType = this.
|
|
2753
|
+
var oConditionType = this.getContentFactory().getConditionType(true);
|
|
2754
|
+
var oConditionsType = this.getContentFactory().getUnitConditionsType(true);
|
|
2629
2755
|
// TODO: format once to update current value in type (as empty condtions are not displayed as token)
|
|
2630
2756
|
if (oConditionType) {
|
|
2631
2757
|
sDOMValue = oConditionType.formatValue(oCondition);
|
|
@@ -2645,7 +2771,7 @@ sap.ui.define([
|
|
|
2645
2771
|
}
|
|
2646
2772
|
|
|
2647
2773
|
// take what ever comes from field help as valid - even if it is an empty key
|
|
2648
|
-
var iIndex = FilterOperatorUtil.indexOfCondition(oCondition, aConditions); // check if already exist
|
|
2774
|
+
var iIndex = bAdd ? FilterOperatorUtil.indexOfCondition(oCondition, aConditions) : -1; // check if already exist
|
|
2649
2775
|
if (iIndex === -1) { // new -> add
|
|
2650
2776
|
aConditions.push(oCondition);
|
|
2651
2777
|
} else if (oCondition.validated === ConditionValidated.Validated && oCondition.values.length > 1 && (aConditions[iIndex].values.length === 1 || oCondition.values[1] !== aConditions[iIndex].values[1])) {
|
|
@@ -2666,12 +2792,12 @@ sap.ui.define([
|
|
|
2666
2792
|
// the focus is still in the Field. The update of the inner control is done via ManagedObjectModel binding.
|
|
2667
2793
|
// The inner Input is configured to prefer user input in this case.
|
|
2668
2794
|
// so we need to set the DOM value here. Otherwise it is not updated or, if empty, selected.
|
|
2669
|
-
if (this.
|
|
2670
|
-
sDOMValue = this.
|
|
2671
|
-
} else if (this.
|
|
2672
|
-
sDOMValue = this.
|
|
2673
|
-
} else if (this.
|
|
2674
|
-
sDOMValue = this.
|
|
2795
|
+
if (this.getContentFactory().isMeasure() && this.getContentFactory().getUnitConditionsType()) {
|
|
2796
|
+
sDOMValue = this.getContentFactory().getUnitConditionsType().formatValue(aConditions);
|
|
2797
|
+
} else if (this.getContentFactory().getConditionType(true)) {
|
|
2798
|
+
sDOMValue = this.getContentFactory().getConditionType().formatValue(aConditions[0]);
|
|
2799
|
+
} else if (this.getContentFactory().getConditionsType(true)) {
|
|
2800
|
+
sDOMValue = this.getContentFactory().getConditionsType().formatValue(aConditions);
|
|
2675
2801
|
}
|
|
2676
2802
|
|
|
2677
2803
|
var fnUpdateDOMValue = function(sText) {
|
|
@@ -2700,8 +2826,8 @@ sap.ui.define([
|
|
|
2700
2826
|
}
|
|
2701
2827
|
|
|
2702
2828
|
// after selection input cannot be wrong
|
|
2703
|
-
if (this.
|
|
2704
|
-
this.
|
|
2829
|
+
if (this.isInvalidInput()) { // only remove messages set by Field itself, message from outside should stay.
|
|
2830
|
+
this.resetInvalidInput();
|
|
2705
2831
|
this._removeUIMessage();
|
|
2706
2832
|
bChangeAfterError = true;
|
|
2707
2833
|
}
|
|
@@ -2711,7 +2837,7 @@ sap.ui.define([
|
|
|
2711
2837
|
|
|
2712
2838
|
if (!deepEqual(aConditions, aConditionsOld)) {
|
|
2713
2839
|
this._oNavigateCondition = undefined;
|
|
2714
|
-
this.
|
|
2840
|
+
this.getContentFactory().updateConditionType();
|
|
2715
2841
|
|
|
2716
2842
|
this.setProperty("conditions", aConditions, true); // do not invalidate whole field
|
|
2717
2843
|
|
|
@@ -2740,7 +2866,7 @@ sap.ui.define([
|
|
|
2740
2866
|
var sNewValue;
|
|
2741
2867
|
var sDOMValue;
|
|
2742
2868
|
var oContent = this.getControlForSuggestion();
|
|
2743
|
-
var oOperator = FilterOperatorUtil.getEQOperator(this.
|
|
2869
|
+
var oOperator = FilterOperatorUtil.getEQOperator(this.getSupportedOperators()); /// use EQ operator of Field (might be different one)
|
|
2744
2870
|
var oFieldHelp = _getFieldHelp.call(this);
|
|
2745
2871
|
|
|
2746
2872
|
if (bLeaveFocus) {
|
|
@@ -2760,7 +2886,7 @@ sap.ui.define([
|
|
|
2760
2886
|
this._oNavigateCondition = Condition.createCondition(oOperator.name, [vKey, sValue],undefined, undefined, ConditionValidated.Validated);
|
|
2761
2887
|
}
|
|
2762
2888
|
|
|
2763
|
-
if (this.
|
|
2889
|
+
if (this.getContentFactory().isMeasure()) {
|
|
2764
2890
|
var aConditions = this.getConditions();
|
|
2765
2891
|
// use number of first condition. In Multicase all conditions must be updated in change event
|
|
2766
2892
|
if (aConditions.length > 0) {
|
|
@@ -2772,12 +2898,12 @@ sap.ui.define([
|
|
|
2772
2898
|
this._oNavigateCondition.values.splice(1);
|
|
2773
2899
|
}
|
|
2774
2900
|
} else {
|
|
2775
|
-
this._oNavigateCondition.values = [
|
|
2901
|
+
this._oNavigateCondition.values = [[null, vKey]];
|
|
2776
2902
|
}
|
|
2777
2903
|
}
|
|
2778
2904
|
|
|
2779
2905
|
this._bPreventGetDescription = true; // if no description in navigated condition, no description exist. Don't try to read one
|
|
2780
|
-
this.
|
|
2906
|
+
this.getContentFactory().updateConditionType();
|
|
2781
2907
|
|
|
2782
2908
|
// take what ever comes from field help as valid - even if it is an empty key
|
|
2783
2909
|
// TODO: what if field is required?
|
|
@@ -2795,12 +2921,12 @@ sap.ui.define([
|
|
|
2795
2921
|
|
|
2796
2922
|
if (oContent && oContent.setDOMValue) {
|
|
2797
2923
|
if (!sDOMValue) {
|
|
2798
|
-
if (this.
|
|
2799
|
-
sDOMValue = this.
|
|
2800
|
-
} else if (this.
|
|
2801
|
-
sDOMValue = this.
|
|
2802
|
-
} else if (this.
|
|
2803
|
-
sDOMValue = this.
|
|
2924
|
+
if (this.getContentFactory().isMeasure() && this.getContentFactory().getUnitConditionsType() && this._oNavigateCondition) {
|
|
2925
|
+
sDOMValue = this.getContentFactory().getUnitConditionsType().formatValue([this._oNavigateCondition]);
|
|
2926
|
+
} else if (this.getContentFactory().getConditionType(true) && this._oNavigateCondition) {
|
|
2927
|
+
sDOMValue = this.getContentFactory().getConditionType().formatValue(this._oNavigateCondition);
|
|
2928
|
+
} else if (this.getContentFactory().getConditionsType(true) && this._oNavigateCondition) {
|
|
2929
|
+
sDOMValue = this.getContentFactory().getConditionsType().formatValue([this._oNavigateCondition]);
|
|
2804
2930
|
} else {
|
|
2805
2931
|
sDOMValue = sValue || vKey;
|
|
2806
2932
|
}
|
|
@@ -2815,7 +2941,7 @@ sap.ui.define([
|
|
|
2815
2941
|
}
|
|
2816
2942
|
|
|
2817
2943
|
this._bPreventGetDescription = false; // back to default
|
|
2818
|
-
this.
|
|
2944
|
+
this.getContentFactory().updateConditionType();
|
|
2819
2945
|
|
|
2820
2946
|
_setAriaAttributes.call(this, bOpen, sItemId);
|
|
2821
2947
|
|
|
@@ -2832,7 +2958,7 @@ sap.ui.define([
|
|
|
2832
2958
|
this._bIgnoreInputValue = false;
|
|
2833
2959
|
oContent.setDOMValue("");
|
|
2834
2960
|
this._sFilterValue = "";
|
|
2835
|
-
this.
|
|
2961
|
+
this.getContentFactory().updateConditionType();
|
|
2836
2962
|
if (this.getMaxConditions() !== 1) {
|
|
2837
2963
|
// clear "value" property of MultiInput as there might be an old value from a invalid input before
|
|
2838
2964
|
this._oManagedObjectModel.checkUpdate(true); // forces update of value property via binding to conditions
|
|
@@ -2868,13 +2994,13 @@ sap.ui.define([
|
|
|
2868
2994
|
|
|
2869
2995
|
function _handleHelpDataUpdate(oEvent) {
|
|
2870
2996
|
|
|
2871
|
-
var isEditing = this.getEditMode() ===
|
|
2872
|
-
sap.ui.getCore().getCurrentFocusedControlId() === this.
|
|
2997
|
+
var isEditing = this.getEditMode() === FieldEditMode.Editable && this.getCurrentContent().length > 0 &&
|
|
2998
|
+
sap.ui.getCore().getCurrentFocusedControlId() === this.getCurrentContent()[0].getId();
|
|
2873
2999
|
|
|
2874
3000
|
// // also in display mode to get right text
|
|
2875
3001
|
// _handleConditionsChange.call(this, this.getConditions());
|
|
2876
3002
|
if (!isEditing && !this._bPendingConditionUpdate && this.getConditions().length > 0 &&
|
|
2877
|
-
(this.getMaxConditions() !== 1 || (this.getDisplay() !== FieldDisplay.Value && !this.
|
|
3003
|
+
(this.getMaxConditions() !== 1 || (this.getDisplay() !== FieldDisplay.Value && !this.isInvalidInput()))
|
|
2878
3004
|
&& this._oManagedObjectModel) {
|
|
2879
3005
|
// update tokens in MultiValue
|
|
2880
3006
|
// update text/value only if no parse error, otherwise wrong value would be removed
|
|
@@ -2911,21 +3037,21 @@ sap.ui.define([
|
|
|
2911
3037
|
var oFieldHelp = _getFieldHelp.call(this);
|
|
2912
3038
|
if (oFieldHelp) { // as Config or BindingContext might change, update connection on every focus
|
|
2913
3039
|
var oType;
|
|
2914
|
-
var bIsMeasure = this.
|
|
3040
|
+
var bIsMeasure = this.getContentFactory().isMeasure();
|
|
2915
3041
|
|
|
2916
3042
|
if (bIsMeasure) {
|
|
2917
3043
|
// for value help, use the basic type of the unit part, not the unit type. (As ony this part is tranfered, not the composite-array.)
|
|
2918
|
-
var aCompositeTypes = this.
|
|
3044
|
+
var aCompositeTypes = this.getContentFactory().getCompositeTypes();
|
|
2919
3045
|
if (aCompositeTypes && aCompositeTypes.length > 1) { // if no type is defined the default (String) will be used
|
|
2920
3046
|
oType = aCompositeTypes[1];
|
|
2921
3047
|
}
|
|
2922
3048
|
} else {
|
|
2923
|
-
oType = this.
|
|
3049
|
+
oType = this.getContentFactory().getDataType(); // use data type of Field
|
|
2924
3050
|
}
|
|
2925
3051
|
var oConfig = { // TODO: only what is needed (also for DefineConditions and Tokenizer)
|
|
2926
3052
|
maxConditions: this.getMaxConditions(), // TODO: in unit case only 1?
|
|
2927
3053
|
dataType: oType,
|
|
2928
|
-
operators: this.
|
|
3054
|
+
operators: this.getSupportedOperators(),
|
|
2929
3055
|
display: bIsMeasure ? FieldDisplay.Value : this.getDisplay(),
|
|
2930
3056
|
delegate: this.getControlDelegate(),
|
|
2931
3057
|
delegateName: this.getDelegate() && this.getDelegate().name,
|
|
@@ -2946,8 +3072,6 @@ sap.ui.define([
|
|
|
2946
3072
|
var aConditions = this.getConditions();
|
|
2947
3073
|
_setConditionsOnFieldHelp.call(this, aConditions, oFieldHelp);
|
|
2948
3074
|
|
|
2949
|
-
var oContent = this.getControlForSuggestion();
|
|
2950
|
-
_setFocusHandlingForFieldHelp.call(this, oContent);
|
|
2951
3075
|
if (oFieldHelp._bIsDefaultHelp) {
|
|
2952
3076
|
// use label as default title for FilterField
|
|
2953
3077
|
mDefaultHelps[oFieldHelp._sDefaultHelpType].updateTitle(oFieldHelp, this.getLabel());
|
|
@@ -2957,34 +3081,41 @@ sap.ui.define([
|
|
|
2957
3081
|
|
|
2958
3082
|
}
|
|
2959
3083
|
|
|
2960
|
-
function
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
this.bValueHelpRequested = false; // to enable change-event after closing value help
|
|
2975
|
-
}
|
|
2976
|
-
return; // do not execute Inputs logic to prevent to run in Inputs own suggest-popup logic
|
|
2977
|
-
} else {
|
|
2978
|
-
oFieldHelp.skipOpening();
|
|
2979
|
-
}
|
|
3084
|
+
function _handleContentOnsapfocusleave(oEvent) {
|
|
3085
|
+
|
|
3086
|
+
var oFieldHelp = _getFieldHelp.call(this);
|
|
3087
|
+
var oContent = this.getControlForSuggestion();
|
|
3088
|
+
var oSourceControl = oEvent.srcControl;
|
|
3089
|
+
|
|
3090
|
+
if (oFieldHelp && oContent === oSourceControl) { // in unit case only handle content with assigned value help
|
|
3091
|
+
var oFocusedControl = sap.ui.getCore().byId(oEvent.relatedControlId);
|
|
3092
|
+
if (oFocusedControl) {
|
|
3093
|
+
if (containsOrEquals(oFieldHelp.getDomRef(), oFocusedControl.getFocusDomRef())) {
|
|
3094
|
+
oEvent.stopPropagation(); // to prevent focusleave on Field itself
|
|
3095
|
+
oEvent.stopImmediatePropagation(true); // to prevent focusleave on content
|
|
3096
|
+
if (oContent.bValueHelpRequested) {
|
|
3097
|
+
oContent.bValueHelpRequested = false; // to enable change-event after closing value help
|
|
2980
3098
|
}
|
|
3099
|
+
} else {
|
|
3100
|
+
oFieldHelp.skipOpening();
|
|
2981
3101
|
}
|
|
2982
|
-
|
|
2983
|
-
|
|
3102
|
+
}
|
|
3103
|
+
}
|
|
3104
|
+
|
|
3105
|
+
}
|
|
3106
|
+
|
|
3107
|
+
function _handleContentOnchange(oEvent) {
|
|
3108
|
+
|
|
3109
|
+
if (_getFieldHelp.call(this)) { // there is a similar logic in sap.m.Input to not execute change if ValueHelp or suggestion is used
|
|
3110
|
+
oEvent.stopImmediatePropagation(true);
|
|
2984
3111
|
}
|
|
2985
3112
|
|
|
2986
3113
|
}
|
|
2987
3114
|
|
|
3115
|
+
/**
|
|
3116
|
+
* Gets the icon that needs to be rendered for used value help.
|
|
3117
|
+
* @returns {sap.ui.core.URI|null} Icon
|
|
3118
|
+
*/
|
|
2988
3119
|
FieldBase.prototype._getFieldHelpIcon = function() {
|
|
2989
3120
|
|
|
2990
3121
|
var oFieldHelp = _getFieldHelp.call(this);
|
|
@@ -3013,7 +3144,7 @@ sap.ui.define([
|
|
|
3013
3144
|
oFieldInfo.isTriggerable().then(function(bTriggerable) {
|
|
3014
3145
|
that._bTriggerable = bTriggerable;
|
|
3015
3146
|
var aContent = that.getAggregation("_content", []);
|
|
3016
|
-
if (aContent.length > 0 && that.getEditMode() ===
|
|
3147
|
+
if (aContent.length > 0 && that.getEditMode() === FieldEditMode.Display) {
|
|
3017
3148
|
_createInternalContentWrapper.call(that);
|
|
3018
3149
|
if (that._bTriggerable) {
|
|
3019
3150
|
aContent = that.getAggregation("_content", []);
|
|
@@ -3028,26 +3159,26 @@ sap.ui.define([
|
|
|
3028
3159
|
|
|
3029
3160
|
// TODO: better API?
|
|
3030
3161
|
/**
|
|
3031
|
-
* Provides some internals of the field to be used in the
|
|
3162
|
+
* Provides some internals of the field to be used in {@link sap.ui.mdc.field.ConditionsType ConditionsType} for format and parse the conditions.
|
|
3032
3163
|
*
|
|
3033
|
-
* @returns {object} formatOptions of the field
|
|
3034
|
-
* @
|
|
3164
|
+
* @returns {object} formatOptions of the field (see {@link sap.ui.mdc.field.ConditionsType ConditionsType})
|
|
3165
|
+
* @protected
|
|
3035
3166
|
*/
|
|
3036
|
-
FieldBase.prototype.
|
|
3167
|
+
FieldBase.prototype.getFormatOptions = function() {
|
|
3037
3168
|
|
|
3038
3169
|
if (!this._asyncParsingCall) {
|
|
3039
3170
|
this._asyncParsingCall = _asyncParsingCall.bind(this); //as variable to have the same function after each update of formatOptions. Otherwise it would be a change on FormatOption in ValueHelpPanel every time
|
|
3040
3171
|
}
|
|
3041
3172
|
|
|
3042
3173
|
return {
|
|
3043
|
-
valueType: this.
|
|
3044
|
-
originalDateType: this.
|
|
3045
|
-
additionalType: this.
|
|
3046
|
-
compositeTypes: this.
|
|
3047
|
-
display: this.
|
|
3048
|
-
|
|
3049
|
-
operators: this.
|
|
3050
|
-
hideOperator: this.
|
|
3174
|
+
valueType: this.getContentFactory().retrieveDataType(),
|
|
3175
|
+
originalDateType: this.getContentFactory().getDateOriginalType() || this.getContentFactory().getUnitOriginalType(),
|
|
3176
|
+
additionalType: this.getContentFactory().getUnitType(), // only set if unit or timezone
|
|
3177
|
+
compositeTypes: this.getContentFactory().getCompositeTypes(), // only set if CompositeType used
|
|
3178
|
+
display: this.getContentFactory().isMeasure() ? FieldDisplay.Value : this.getDisplay(),
|
|
3179
|
+
valueHelpID: this.getContentFactory().isMeasure() ? undefined : this._getValueHelp() || this._sDefaultFieldHelp,
|
|
3180
|
+
operators: this.getSupportedOperators(),
|
|
3181
|
+
hideOperator: this.getContentFactory().getHideOperator(),
|
|
3051
3182
|
maxConditions: this.getMaxConditions(),
|
|
3052
3183
|
bindingContext: this.getBindingContext(), // to dertmine text and key usding in/out-parameter using correct bindingContext (In Table FieldHelp might be connected to other row)
|
|
3053
3184
|
asyncParsing: this._asyncParsingCall,
|
|
@@ -3056,11 +3187,11 @@ sap.ui.define([
|
|
|
3056
3187
|
delegateName: this.getDelegate() && this.getDelegate().name,
|
|
3057
3188
|
payload: this.getPayload(),
|
|
3058
3189
|
preventGetDescription: this._bPreventGetDescription,
|
|
3059
|
-
convertWhitespaces: this.getEditMode() ===
|
|
3190
|
+
convertWhitespaces: this.getEditMode() === FieldEditMode.Display || this.getMaxConditions() !== 1, // also replace whitespaces in tokens
|
|
3060
3191
|
control: this,
|
|
3061
3192
|
defaultOperatorName : this.getDefaultOperator ? this.getDefaultOperator() : null,
|
|
3062
3193
|
getConditions: this.getConditions.bind(this), // to add condition in multi-value case
|
|
3063
|
-
noFormatting: this.
|
|
3194
|
+
noFormatting: this.getContentFactory().getNoFormatting(),
|
|
3064
3195
|
keepValue: this._bIgnoreInputValue ? this._sFilterValue : null
|
|
3065
3196
|
};
|
|
3066
3197
|
|
|
@@ -3073,17 +3204,16 @@ sap.ui.define([
|
|
|
3073
3204
|
*
|
|
3074
3205
|
* @param {any} vValue Value to be checked
|
|
3075
3206
|
* @returns {boolean} true if value is initial
|
|
3076
|
-
* @
|
|
3077
|
-
* @ui5-restricted FieldBase subclasses
|
|
3207
|
+
* @protected
|
|
3078
3208
|
*/
|
|
3079
|
-
FieldBase.prototype.
|
|
3209
|
+
FieldBase.prototype.checkValueInitial = function(vValue) {
|
|
3080
3210
|
|
|
3081
3211
|
if (vValue === null || vValue === undefined) {
|
|
3082
3212
|
return true;
|
|
3083
3213
|
}
|
|
3084
3214
|
|
|
3085
3215
|
if (vValue === "" || (typeof (vValue) === "string" && vValue.match(/^0+$/))) { // if String is dig-sequence, initial value contains only "0"s
|
|
3086
|
-
var oType = this.
|
|
3216
|
+
var oType = this.getContentFactory().retrieveDataType();
|
|
3087
3217
|
var vResult = oType.parseValue("", "string");
|
|
3088
3218
|
if (vResult === vValue) {
|
|
3089
3219
|
return true; // it's initial value
|
|
@@ -3097,7 +3227,7 @@ sap.ui.define([
|
|
|
3097
3227
|
}
|
|
3098
3228
|
} else {
|
|
3099
3229
|
var sDataType = _getDataTypeName.call(this);
|
|
3100
|
-
if (this.
|
|
3230
|
+
if (this.getTypeMap().getBaseType(sDataType) === BaseType.Unit
|
|
3101
3231
|
&& Array.isArray(vValue) && vValue.length > 1 && (vValue[0] === undefined || vValue[0] === null) && !vValue[1]) { // as 0 is a valid number
|
|
3102
3232
|
//no number and no unit -> initial
|
|
3103
3233
|
return true;
|
|
@@ -3110,19 +3240,25 @@ sap.ui.define([
|
|
|
3110
3240
|
|
|
3111
3241
|
};
|
|
3112
3242
|
|
|
3113
|
-
|
|
3243
|
+
/**
|
|
3244
|
+
* Provides some internals of the unit part of the field to be used in {@link sap.ui.mdc.field.ConditionsType ConditionsType} for format and parse the conditions.
|
|
3245
|
+
*
|
|
3246
|
+
* @returns {object} formatOptions of the field (see {@link sap.ui.mdc.field.ConditionsType ConditionsType})
|
|
3247
|
+
* @protected
|
|
3248
|
+
*/
|
|
3249
|
+
FieldBase.prototype.getUnitFormatOptions = function() {
|
|
3114
3250
|
|
|
3115
3251
|
if (!this._asyncParsingCall) { //as variable to have the same function after each update of formatOptions. Otherwise it would be a change on FormatOption in ValueHelpPanel every time
|
|
3116
3252
|
this._asyncParsingCall = _asyncParsingCall.bind(this);
|
|
3117
3253
|
}
|
|
3118
3254
|
|
|
3119
3255
|
return {
|
|
3120
|
-
valueType: this.
|
|
3121
|
-
originalDateType: this.
|
|
3122
|
-
additionalType: this.
|
|
3123
|
-
compositeTypes: this.
|
|
3256
|
+
valueType: this.getContentFactory().getUnitType(),
|
|
3257
|
+
originalDateType: this.getContentFactory().getDateOriginalType() || this.getContentFactory().getUnitOriginalType(),
|
|
3258
|
+
additionalType: this.getContentFactory().retrieveDataType(), // use type of measure for currentValue
|
|
3259
|
+
compositeTypes: this.getContentFactory().getCompositeTypes(),
|
|
3124
3260
|
display: this.getDisplay(),
|
|
3125
|
-
|
|
3261
|
+
valueHelpID: this._getValueHelp() || this._sDefaultFieldHelp,
|
|
3126
3262
|
operators: ["EQ"],
|
|
3127
3263
|
hideOperator: true, // TODO: no operator for units
|
|
3128
3264
|
maxConditions: 1, // TODO: only one unit allowed
|
|
@@ -3133,7 +3269,7 @@ sap.ui.define([
|
|
|
3133
3269
|
delegateName: this.getDelegate() && this.getDelegate().name,
|
|
3134
3270
|
payload: this.getPayload(),
|
|
3135
3271
|
preventGetDescription: this._bPreventGetDescription,
|
|
3136
|
-
convertWhitespaces: this.getEditMode() ===
|
|
3272
|
+
convertWhitespaces: this.getEditMode() === FieldEditMode.Display || this.getEditMode() === FieldEditMode.EditableDisplay,
|
|
3137
3273
|
control: this,
|
|
3138
3274
|
getConditions: this.getConditions.bind(this), // TODO: better solution to update unit in all conditions
|
|
3139
3275
|
noFormatting: false
|
|
@@ -3161,7 +3297,7 @@ sap.ui.define([
|
|
|
3161
3297
|
|
|
3162
3298
|
oPromise.then(function(vResult) {// vResult can be a condition or an array of conditions
|
|
3163
3299
|
oChange.result = vResult;
|
|
3164
|
-
this.
|
|
3300
|
+
this.resetInvalidInput();
|
|
3165
3301
|
var aConditions = this.getConditions();
|
|
3166
3302
|
if (deepEqual(vResult, aConditions)) {
|
|
3167
3303
|
// parsingResult is same as current value -> no update will happen
|
|
@@ -3196,7 +3332,7 @@ sap.ui.define([
|
|
|
3196
3332
|
|
|
3197
3333
|
if (aPromises.length > 0) {
|
|
3198
3334
|
return Promise.all(aPromises).then(function() {
|
|
3199
|
-
return this.
|
|
3335
|
+
return this.getResultForChangePromise(this.getConditions());
|
|
3200
3336
|
}.bind(this));
|
|
3201
3337
|
}
|
|
3202
3338
|
|
|
@@ -3204,7 +3340,13 @@ sap.ui.define([
|
|
|
3204
3340
|
|
|
3205
3341
|
}
|
|
3206
3342
|
|
|
3207
|
-
|
|
3343
|
+
/**
|
|
3344
|
+
* Determines, based on conditions, the value returned by the <code>change</code> event.
|
|
3345
|
+
* @param {sap.ui.mdc.field.ConditionType[]} aConditions Array of conditions
|
|
3346
|
+
* @returns {any} control-dependent value for <code>change</code> event
|
|
3347
|
+
* @protected
|
|
3348
|
+
*/
|
|
3349
|
+
FieldBase.prototype.getResultForChangePromise = function(aConditions) {
|
|
3208
3350
|
|
|
3209
3351
|
// to be overwritten by Field - per default resolve conditions
|
|
3210
3352
|
return aConditions;
|
|
@@ -3213,7 +3355,7 @@ sap.ui.define([
|
|
|
3213
3355
|
|
|
3214
3356
|
function _resolveAsyncChange(oChange) {
|
|
3215
3357
|
|
|
3216
|
-
oChange.resolve(this.
|
|
3358
|
+
oChange.resolve(this.getResultForChangePromise(oChange.result));
|
|
3217
3359
|
|
|
3218
3360
|
}
|
|
3219
3361
|
|
|
@@ -3235,27 +3377,50 @@ sap.ui.define([
|
|
|
3235
3377
|
|
|
3236
3378
|
}
|
|
3237
3379
|
|
|
3238
|
-
|
|
3239
|
-
*
|
|
3380
|
+
/**
|
|
3381
|
+
* Returns the supported operators.
|
|
3240
3382
|
*
|
|
3241
|
-
*
|
|
3383
|
+
* Needs to be overwritten by {@link sap.ui.mdc.Field Field}, {@link sap.ui.mdc.MultiValueField MultiValueField}
|
|
3384
|
+
* and {@link sap.ui.mdc.FilterField FilterField}
|
|
3385
|
+
* @returns {string[]} Array of operator names
|
|
3386
|
+
* @protected
|
|
3242
3387
|
*/
|
|
3243
|
-
FieldBase.prototype.
|
|
3388
|
+
FieldBase.prototype.getSupportedOperators = function() {
|
|
3244
3389
|
|
|
3245
|
-
var
|
|
3246
|
-
if (
|
|
3390
|
+
var aOperators;
|
|
3391
|
+
if (this.isSearchField()) {
|
|
3247
3392
|
// for SearchField use Contains operator
|
|
3248
|
-
|
|
3249
|
-
}
|
|
3393
|
+
aOperators = ["Contains"];
|
|
3394
|
+
} else {
|
|
3395
|
+
// get default operators for type
|
|
3396
|
+
var sBaseType = this.getBaseType(); // TODO what if delegate not loaded
|
|
3250
3397
|
|
|
3251
|
-
|
|
3252
|
-
|
|
3398
|
+
if (sBaseType === BaseType.Unit) {
|
|
3399
|
+
sBaseType = BaseType.Numeric;
|
|
3400
|
+
}
|
|
3253
3401
|
|
|
3254
|
-
|
|
3255
|
-
sBaseType = BaseType.Numeric;
|
|
3402
|
+
aOperators = FilterOperatorUtil.getOperatorsForType(sBaseType);
|
|
3256
3403
|
}
|
|
3257
3404
|
|
|
3258
|
-
|
|
3405
|
+
this.setProperty("_operators", aOperators, true);
|
|
3406
|
+
return aOperators;
|
|
3407
|
+
|
|
3408
|
+
};
|
|
3409
|
+
|
|
3410
|
+
/**
|
|
3411
|
+
* Checks if the field is configured to be a <code>SearchField</code>
|
|
3412
|
+
*
|
|
3413
|
+
* Needs to be overwritten by {@link sap.ui.mdc.Field Field}, {@link sap.ui.mdc.MultiValueField MultiValueField},
|
|
3414
|
+
* and {@link sap.ui.mdc.FilterField FilterField}
|
|
3415
|
+
* @returns {boolean} True if configures as search field
|
|
3416
|
+
* @protected
|
|
3417
|
+
* @since 1.115.0
|
|
3418
|
+
*/
|
|
3419
|
+
FieldBase.prototype.isSearchField = function() {
|
|
3420
|
+
|
|
3421
|
+
var regexp = new RegExp("^\\*(.*)\\*|\\$search$");
|
|
3422
|
+
var sFieldPath = this.getFieldPath();
|
|
3423
|
+
return regexp.test(sFieldPath) && this.getMaxConditions() === 1;
|
|
3259
3424
|
|
|
3260
3425
|
};
|
|
3261
3426
|
|
|
@@ -3265,7 +3430,7 @@ sap.ui.define([
|
|
|
3265
3430
|
*/
|
|
3266
3431
|
function _isValidOperator(sOperator) {
|
|
3267
3432
|
|
|
3268
|
-
var aOperators = this.
|
|
3433
|
+
var aOperators = this.getSupportedOperators();
|
|
3269
3434
|
|
|
3270
3435
|
for (var i = 0; i < aOperators.length; i++) {
|
|
3271
3436
|
if (sOperator === aOperators[i]) {
|
|
@@ -3277,7 +3442,16 @@ sap.ui.define([
|
|
|
3277
3442
|
|
|
3278
3443
|
}
|
|
3279
3444
|
|
|
3280
|
-
|
|
3445
|
+
/**
|
|
3446
|
+
* Returns whether the given property value is initial and has not been explicitly set or no binding exist.
|
|
3447
|
+
* Even after setting the default value or setting null/undefined (which also causes the default value to be set),
|
|
3448
|
+
* the property is no longer initial. A property can be reset to initial state by calling <code>resetProperty(sPropertyName)</code>.
|
|
3449
|
+
*
|
|
3450
|
+
* @param {string} sPropertyName the name of the property
|
|
3451
|
+
* @returns {boolean} true if the property is initial
|
|
3452
|
+
* @protected
|
|
3453
|
+
*/
|
|
3454
|
+
FieldBase.prototype.isFieldPropertyInitial = function(sPropertyName) {
|
|
3281
3455
|
|
|
3282
3456
|
// as bound propertys are never initial even if there is no existing binding right now check the binding too
|
|
3283
3457
|
if (this.isBound(sPropertyName) && !this.getBinding(sPropertyName)) {
|
|
@@ -3288,6 +3462,21 @@ sap.ui.define([
|
|
|
3288
3462
|
|
|
3289
3463
|
};
|
|
3290
3464
|
|
|
3465
|
+
/**
|
|
3466
|
+
* Checks if the field is already destoyed or destruction has started.
|
|
3467
|
+
*
|
|
3468
|
+
* In this casse creation of internal content or binding must be prevented.
|
|
3469
|
+
*
|
|
3470
|
+
* @returns {boolean} True if destroyed or destruction has been started
|
|
3471
|
+
* @protected
|
|
3472
|
+
* @since 1.115.0
|
|
3473
|
+
*/
|
|
3474
|
+
FieldBase.prototype.isFieldDestroyed = function() {
|
|
3475
|
+
|
|
3476
|
+
return this.isDestroyed() || this.isDestroyStarted();
|
|
3477
|
+
|
|
3478
|
+
};
|
|
3479
|
+
|
|
3291
3480
|
return FieldBase;
|
|
3292
3481
|
|
|
3293
3482
|
});
|