@openui5/sap.ui.mdc 1.98.0 → 1.101.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/THIRDPARTY.txt +6 -6
- package/package.json +4 -4
- package/src/sap/ui/mdc/.library +1 -1
- package/src/sap/ui/mdc/ActionToolbar.js +6 -3
- package/src/sap/ui/mdc/AggregationBaseDelegate.js +1 -1
- package/src/sap/ui/mdc/Chart.js +186 -102
- package/src/sap/ui/mdc/ChartDelegate.js +85 -30
- package/src/sap/ui/mdc/ChartRenderer.js +1 -1
- package/src/sap/ui/mdc/Control.js +11 -6
- package/src/sap/ui/mdc/Element.js +10 -6
- package/src/sap/ui/mdc/Field.js +19 -4
- package/src/sap/ui/mdc/FilterBar.js +1 -1
- package/src/sap/ui/mdc/FilterBarDelegate.js +26 -0
- package/src/sap/ui/mdc/FilterField.js +41 -3
- package/src/sap/ui/mdc/Link.js +22 -4
- package/src/sap/ui/mdc/LinkDelegate.js +9 -7
- package/src/sap/ui/mdc/MultiValueField.js +30 -6
- package/src/sap/ui/mdc/Table.js +332 -316
- package/src/sap/ui/mdc/TableDelegate.js +146 -31
- package/src/sap/ui/mdc/ValueHelp.js +136 -624
- package/src/sap/ui/mdc/ValueHelpDelegate.js +154 -7
- package/src/sap/ui/mdc/actiontoolbar/ActionToolbarAction.js +2 -2
- package/src/sap/ui/mdc/actiontoolbar/ActionToolbarActionRenderer.js +1 -1
- package/src/sap/ui/mdc/chart/ChartSelectionDetails.js +1 -1
- package/src/sap/ui/mdc/chart/ChartToolbar.js +56 -11
- package/src/sap/ui/mdc/chart/ChartTypeButton.js +24 -10
- package/src/sap/ui/mdc/chart/DrillBreadcrumbs.js +9 -7
- package/src/sap/ui/mdc/chart/DrillStackHandler.js +6 -6
- package/src/sap/ui/mdc/chart/PropertyHelper.js +1 -1
- package/src/sap/ui/mdc/condition/Condition.js +14 -9
- package/src/sap/ui/mdc/condition/ConditionConverter.js +58 -6
- package/src/sap/ui/mdc/condition/ConditionModel.js +1 -1
- package/src/sap/ui/mdc/condition/FilterConverter.js +4 -2
- package/src/sap/ui/mdc/condition/FilterOperatorUtil.js +393 -68
- package/src/sap/ui/mdc/condition/Operator.js +14 -2
- package/src/sap/ui/mdc/condition/OperatorDynamicDateOption.js +78 -24
- package/src/sap/ui/mdc/condition/RangeOperator.js +5 -5
- package/src/sap/ui/mdc/designtime/Util.js +63 -0
- package/src/sap/ui/mdc/designtime/actiontoolbar/ActionToolbar.designtime.js +23 -30
- package/src/sap/ui/mdc/designtime/chart/Chart.designtime.js +6 -0
- package/src/sap/ui/mdc/designtime/filterbar/FilterBar.designtime.js +3 -1
- package/src/sap/ui/mdc/designtime/link/PanelItem.designtime.js +3 -1
- package/src/sap/ui/mdc/designtime/table/Table.designtime.js +36 -9
- package/src/sap/ui/mdc/enum/PropagationReason.js +43 -0
- package/src/sap/ui/mdc/field/BoolFieldHelp.js +1 -1
- package/src/sap/ui/mdc/field/ConditionFieldHelp.js +1 -1
- package/src/sap/ui/mdc/field/ConditionType.js +44 -13
- package/src/sap/ui/mdc/field/ConditionsType.js +3 -1
- package/src/sap/ui/mdc/field/CustomFieldHelp.js +1 -1
- package/src/sap/ui/mdc/field/CustomFieldInfo.js +1 -1
- package/src/sap/ui/mdc/field/DefineConditionPanel.js +31 -9
- package/src/sap/ui/mdc/field/DynamicDateRangeConditionsType.js +76 -19
- package/src/sap/ui/mdc/field/FieldBase.js +69 -14
- package/src/sap/ui/mdc/field/FieldBaseDelegate.js +41 -19
- package/src/sap/ui/mdc/field/FieldHelpBase.js +2 -2
- package/src/sap/ui/mdc/field/FieldInfoBase.js +24 -10
- package/src/sap/ui/mdc/field/FieldInput.js +1 -1
- package/src/sap/ui/mdc/field/FieldInputRenderUtil.js +1 -1
- package/src/sap/ui/mdc/field/FieldMultiInput.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelp.js +9 -4
- package/src/sap/ui/mdc/field/FieldValueHelpContentWrapperBase.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelpDelegate.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelpMTableWrapper.js +5 -4
- package/src/sap/ui/mdc/field/FieldValueHelpMdcTableWrapper.js +6 -4
- package/src/sap/ui/mdc/field/FieldValueHelpTableWrapperBase.js +6 -3
- package/src/sap/ui/mdc/field/FieldValueHelpUITableWrapper.js +7 -7
- package/src/sap/ui/mdc/field/InParameter.js +1 -1
- package/src/sap/ui/mdc/field/ListFieldHelp.js +1 -1
- package/src/sap/ui/mdc/field/ListFieldHelpItem.js +1 -1
- package/src/sap/ui/mdc/field/MultiValueFieldItem.js +1 -1
- package/src/sap/ui/mdc/field/OutParameter.js +1 -1
- package/src/sap/ui/mdc/field/TokenDisplay.js +70 -0
- package/src/sap/ui/mdc/field/TokenDisplayRenderer.js +24 -0
- package/src/sap/ui/mdc/field/TokenizerDisplay.js +80 -0
- package/src/sap/ui/mdc/field/TokenizerDisplayRenderer.js +69 -0
- package/src/sap/ui/mdc/field/ValueHelpPanel.js +1 -1
- package/src/sap/ui/mdc/field/content/ContentFactory.js +10 -6
- package/src/sap/ui/mdc/field/content/DateContent.js +27 -19
- package/src/sap/ui/mdc/field/content/DateTimeContent.js +0 -6
- package/src/sap/ui/mdc/field/content/DefaultContent.js +35 -13
- package/src/sap/ui/mdc/field/content/LinkContent.js +1 -1
- package/src/sap/ui/mdc/filterbar/FilterBarBase.js +137 -216
- package/src/sap/ui/mdc/filterbar/FilterBarBaseRenderer.js +1 -1
- package/src/sap/ui/mdc/filterbar/IFilterContainer.js +5 -0
- package/src/sap/ui/mdc/filterbar/PropertyHelper.js +27 -2
- package/src/sap/ui/mdc/filterbar/aligned/FilterContainer.js +1 -0
- package/src/sap/ui/mdc/filterbar/aligned/FilterItemLayout.js +1 -0
- package/src/sap/ui/mdc/filterbar/p13n/AdaptationFilterBar.js +144 -64
- package/src/sap/ui/mdc/filterbar/p13n/FilterColumnLayout.js +2 -2
- package/src/sap/ui/mdc/filterbar/p13n/GroupContainer.js +7 -3
- package/src/sap/ui/mdc/filterbar/p13n/TableContainer.js +52 -14
- package/src/sap/ui/mdc/filterbar/vh/FilterBar.js +73 -23
- package/src/sap/ui/mdc/filterbar/vh/FilterContainer.js +1 -1
- package/src/sap/ui/mdc/flexibility/AggregationConfigFlex.js +48 -31
- package/src/sap/ui/mdc/flexibility/Chart.flexibility.js +7 -42
- package/src/sap/ui/mdc/flexibility/ChartItemFlex.js +36 -0
- package/src/sap/ui/mdc/flexibility/ChartTypeFlex.js +54 -0
- package/src/sap/ui/mdc/flexibility/ConditionFlex.js +49 -12
- package/src/sap/ui/mdc/flexibility/FilterBar.flexibility.js +1 -1
- package/src/sap/ui/mdc/flexibility/FilterItemFlex.js +1 -1
- package/src/sap/ui/mdc/flexibility/ItemBaseFlex.js +0 -1
- package/src/sap/ui/mdc/flexibility/PropertyInfoFlex.js +2 -85
- package/src/sap/ui/mdc/flp/FlpLinkDelegate.js +5 -5
- package/src/sap/ui/mdc/library.js +41 -30
- package/src/sap/ui/mdc/link/ContactDetails.js +107 -23
- 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/ContactDetailsRenderer.js +26 -0
- package/src/sap/ui/mdc/link/Factory.js +1 -1
- package/src/sap/ui/mdc/link/FakeFlpConnector.js +1 -1
- package/src/sap/ui/mdc/link/LinkItem.js +1 -1
- package/src/sap/ui/mdc/link/Log.js +1 -1
- package/src/sap/ui/mdc/link/Panel.js +205 -29
- package/src/sap/ui/mdc/link/PanelItem.js +1 -1
- package/src/sap/ui/mdc/link/PanelRenderer.js +26 -0
- 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 +59 -6
- package/src/sap/ui/mdc/messagebundle_ar.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_bg.properties +58 -24
- package/src/sap/ui/mdc/messagebundle_ca.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_cs.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_cy.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_da.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_de.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_el.properties +39 -5
- package/src/sap/ui/mdc/messagebundle_en.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_en_GB.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_en_US_sappsd.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_en_US_saprigi.properties +68 -9
- package/src/sap/ui/mdc/messagebundle_en_US_saptrc.properties +41 -7
- package/src/sap/ui/mdc/messagebundle_es.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_es_MX.properties +41 -7
- package/src/sap/ui/mdc/messagebundle_et.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_fi.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_fr.properties +41 -7
- package/src/sap/ui/mdc/messagebundle_fr_CA.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_hi.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_hr.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_hu.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_id.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_it.properties +41 -7
- package/src/sap/ui/mdc/messagebundle_iw.properties +39 -5
- package/src/sap/ui/mdc/messagebundle_ja.properties +41 -7
- package/src/sap/ui/mdc/messagebundle_kk.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_ko.properties +39 -5
- package/src/sap/ui/mdc/messagebundle_lt.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_lv.properties +44 -10
- package/src/sap/ui/mdc/messagebundle_ms.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_nl.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_no.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_pl.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_pt.properties +41 -7
- package/src/sap/ui/mdc/messagebundle_pt_PT.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_ro.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_ru.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_sh.properties +43 -9
- package/src/sap/ui/mdc/messagebundle_sk.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_sl.properties +41 -7
- package/src/sap/ui/mdc/messagebundle_sv.properties +41 -7
- package/src/sap/ui/mdc/messagebundle_th.properties +43 -9
- package/src/sap/ui/mdc/messagebundle_tr.properties +41 -7
- package/src/sap/ui/mdc/messagebundle_uk.properties +43 -9
- package/src/sap/ui/mdc/messagebundle_vi.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_zh_CN.properties +40 -6
- package/src/sap/ui/mdc/messagebundle_zh_TW.properties +40 -6
- package/src/sap/ui/mdc/mixin/AdaptationMixin.js +24 -15
- package/src/sap/ui/mdc/mixin/DelegateMixin.js +1 -141
- package/src/sap/ui/mdc/mixin/FilterIntegrationMixin.js +1 -9
- package/src/sap/ui/mdc/mixin/PromiseMixin.js +1 -1
- package/src/sap/ui/mdc/mixin/PropertyHelperMixin.js +354 -0
- package/src/sap/ui/mdc/odata/TypeUtil.js +1 -1
- package/src/sap/ui/mdc/odata/v4/ChartPropertyHelper.js +70 -3
- package/src/sap/ui/mdc/odata/v4/FieldBaseDelegate.js +8 -6
- package/src/sap/ui/mdc/odata/v4/FilterBarDelegate.js +116 -20
- package/src/sap/ui/mdc/odata/v4/ODataMetaModelUtil.js +2 -2
- package/src/sap/ui/mdc/odata/v4/TableDelegate.js +32 -69
- package/src/sap/ui/mdc/odata/v4/TypeUtil.js +2 -4
- package/src/sap/ui/mdc/odata/v4/ValueHelpDelegate.js +65 -5
- package/src/sap/ui/mdc/odata/v4/vizChart/ChartDelegate.js +412 -326
- package/src/sap/ui/mdc/p13n/AdaptationProvider.js +1 -1
- package/src/sap/ui/mdc/p13n/Engine.js +169 -66
- package/src/sap/ui/mdc/p13n/FlexUtil.js +26 -19
- package/src/sap/ui/mdc/p13n/P13nBuilder.js +6 -6
- package/src/sap/ui/mdc/p13n/PropertyHelper.js +2 -2
- package/src/sap/ui/mdc/p13n/StateUtil.js +34 -51
- package/src/sap/ui/mdc/p13n/UIManager.js +21 -14
- package/src/sap/ui/mdc/p13n/modification/ModificationHandler.js +0 -174
- package/src/sap/ui/mdc/p13n/modules/DefaultProviderRegistry.js +2 -2
- package/src/sap/ui/mdc/p13n/modules/xConfigAPI.js +219 -0
- package/src/sap/ui/mdc/p13n/panels/ActionToolbarPanel.js +6 -6
- package/src/sap/ui/mdc/p13n/panels/AdaptFiltersPanel.js +49 -27
- package/src/sap/ui/mdc/p13n/panels/ChartItemPanel.js +76 -16
- package/src/sap/ui/mdc/p13n/panels/FilterPanel.js +136 -0
- package/src/sap/ui/mdc/p13n/panels/GroupView.js +53 -28
- package/src/sap/ui/mdc/p13n/panels/LinkSelectionPanel.js +54 -18
- package/src/sap/ui/mdc/p13n/subcontroller/ActionToolbarController.js +4 -7
- package/src/sap/ui/mdc/p13n/subcontroller/AdaptFiltersController.js +1 -2
- package/src/sap/ui/mdc/p13n/subcontroller/AggregateController.js +2 -2
- package/src/sap/ui/mdc/p13n/subcontroller/BaseController.js +30 -2
- package/src/sap/ui/mdc/p13n/subcontroller/ChartTypeController.js +46 -0
- package/src/sap/ui/mdc/p13n/subcontroller/ColumnWidthController.js +37 -6
- package/src/sap/ui/mdc/p13n/subcontroller/FilterController.js +40 -12
- package/src/sap/ui/mdc/p13n/subcontroller/GroupController.js +9 -2
- package/src/sap/ui/mdc/p13n/subcontroller/LinkPanelController.js +1 -0
- package/src/sap/ui/mdc/p13n/subcontroller/SortController.js +4 -4
- package/src/sap/ui/mdc/table/Column.js +271 -132
- package/src/sap/ui/mdc/table/CreationRow.js +1 -1
- package/src/sap/ui/mdc/table/GridTableType.js +75 -27
- package/src/sap/ui/mdc/table/PropertyHelper.js +71 -95
- package/src/sap/ui/mdc/table/ResponsiveTableType.js +121 -40
- package/src/sap/ui/mdc/table/RowActionItem.js +119 -0
- package/src/sap/ui/mdc/table/RowSettings.js +42 -1
- package/src/sap/ui/mdc/table/TableSettings.js +10 -22
- package/src/sap/ui/mdc/table/V4AnalyticsPropertyHelper.js +2 -2
- package/src/sap/ui/mdc/table/menu/Item.js +78 -0
- package/src/sap/ui/mdc/table/menu/ItemContainer.js +60 -0
- package/src/sap/ui/mdc/table/menu/QuickActionContainer.js +151 -0
- package/src/sap/ui/mdc/themes/base/Chart.less +6 -0
- package/src/sap/ui/mdc/themes/base/TokenDisplay.less +89 -0
- package/src/sap/ui/mdc/themes/base/TokenizerDisplay.less +90 -0
- package/src/sap/ui/mdc/themes/base/ValueHelpDialog.less +4 -3
- package/src/sap/ui/mdc/themes/base/library.source.less +2 -0
- package/src/sap/ui/mdc/ui/Container.js +0 -240
- package/src/sap/ui/mdc/util/DateUtil.js +32 -7
- package/src/sap/ui/mdc/util/FilterUtil.js +2 -2
- package/src/sap/ui/mdc/util/FormatUtil.js +2 -2
- package/src/sap/ui/mdc/util/IdentifierUtil.js +7 -7
- package/src/sap/ui/mdc/util/PromiseCache.js +6 -2
- package/src/sap/ui/mdc/util/PropertyHelper.js +205 -76
- package/src/sap/ui/mdc/util/TypeUtil.js +1 -1
- package/src/sap/ui/mdc/valuehelp/Dialog.js +234 -44
- package/src/sap/ui/mdc/valuehelp/Popover.js +7 -4
- package/src/sap/ui/mdc/valuehelp/base/Container.js +63 -48
- package/src/sap/ui/mdc/valuehelp/base/Content.js +35 -16
- package/src/sap/ui/mdc/valuehelp/base/DialogTab.js +1 -1
- package/src/sap/ui/mdc/valuehelp/base/FilterableListContent.js +161 -284
- package/src/sap/ui/mdc/valuehelp/base/ListContent.js +4 -4
- package/src/sap/ui/mdc/valuehelp/content/Bool.js +4 -4
- package/src/sap/ui/mdc/valuehelp/content/Conditions.js +4 -4
- package/src/sap/ui/mdc/valuehelp/content/FixedList.js +16 -13
- package/src/sap/ui/mdc/valuehelp/content/ListCollection.js +205 -0
- package/src/sap/ui/mdc/valuehelp/content/MDCTable.js +67 -66
- package/src/sap/ui/mdc/valuehelp/content/MTable.js +94 -185
- package/test/sap/ui/mdc/testutils/opa/TestLibrary.js +2 -1
- package/test/sap/ui/mdc/testutils/opa/chart/TestObjects.js +6 -5
- package/test/sap/ui/mdc/testutils/opa/chartNew/TestObjects.js +4 -5
- package/test/sap/ui/mdc/testutils/opa/filterbar/TestObjects.js +8 -9
- package/test/sap/ui/mdc/testutils/opa/link/TestObjects.js +8 -8
- package/test/sap/ui/mdc/testutils/opa/p13n/Actions.js +43 -27
- package/test/sap/ui/mdc/testutils/opa/valueHelp/Actions.js +54 -0
- package/test/sap/ui/mdc/testutils/opa/valueHelp/Assertions.js +5 -0
- package/test/sap/ui/mdc/testutils/opa/valueHelp/TestObjects.js +40 -0
- package/test/sap/ui/mdc/testutils/opa/valueHelp/Util.js +28 -0
- package/src/sap/ui/mdc/filterbar/vh/GenericFilterBarDelegate.js +0 -150
- package/src/sap/ui/mdc/link/ContactDetails.control.xml +0 -29
- package/src/sap/ui/mdc/link/Panel.control.xml +0 -36
- package/src/sap/ui/mdc/link/PanelListItem.control.xml +0 -24
- package/src/sap/ui/mdc/link/PanelListItem.js +0 -101
- package/src/sap/ui/mdc/p13n/panels/BasePanel.js +0 -721
- package/src/sap/ui/mdc/p13n/panels/ListView.js +0 -408
- package/src/sap/ui/mdc/p13n/panels/SelectionPanel.js +0 -92
- package/src/sap/ui/mdc/p13n/panels/SortPanel.js +0 -150
- package/src/sap/ui/mdc/ui/ContainerItem.js +0 -79
|
@@ -1,408 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* ! OpenUI5
|
|
3
|
-
* (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
-
*/
|
|
6
|
-
sap.ui.define([
|
|
7
|
-
"./BasePanel",
|
|
8
|
-
"sap/m/Label",
|
|
9
|
-
"sap/m/ColumnListItem",
|
|
10
|
-
"sap/m/HBox",
|
|
11
|
-
"sap/m/VBox",
|
|
12
|
-
"sap/ui/core/Icon",
|
|
13
|
-
"sap/ui/core/library",
|
|
14
|
-
"sap/m/Text",
|
|
15
|
-
"sap/m/Column",
|
|
16
|
-
"sap/m/Table",
|
|
17
|
-
"sap/m/library",
|
|
18
|
-
"sap/m/ToolbarSpacer",
|
|
19
|
-
"sap/m/Button",
|
|
20
|
-
"sap/m/OverflowToolbar",
|
|
21
|
-
"sap/ui/model/Filter"
|
|
22
|
-
], function(BasePanel, Label, ColumnListItem, HBox, VBox, Icon, coreLibrary, Text, Column, Table, mLibrary, ToolbarSpacer, Button, OverflowToolbar, Filter) {
|
|
23
|
-
"use strict";
|
|
24
|
-
|
|
25
|
-
// shortcut for sap.m.ListKeyboardMode
|
|
26
|
-
var ListKeyboardMode = mLibrary.ListKeyboardMode;
|
|
27
|
-
|
|
28
|
-
// shortcut for sap.m.FlexJustifyContent
|
|
29
|
-
var FlexJustifyContent = mLibrary.FlexJustifyContent;
|
|
30
|
-
|
|
31
|
-
// shortcut for sap.m.ListType
|
|
32
|
-
var ListType = mLibrary.ListType;
|
|
33
|
-
|
|
34
|
-
// shortcut for sap.ui.core.IconColor;
|
|
35
|
-
var IconColor = coreLibrary.IconColor;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Constructor for a new ListView
|
|
39
|
-
*
|
|
40
|
-
* @param {string} [sId] ID for the new control, generated automatically if no ID is given
|
|
41
|
-
* @param {object} [mSettings] initial settings for the new control
|
|
42
|
-
* @class The ListView is a list based view to personalize selection and ordering of a Control aggregation.
|
|
43
|
-
* @extends sap.ui.mdc.p13n.panels.BasePanel
|
|
44
|
-
* @author SAP SE
|
|
45
|
-
* @private
|
|
46
|
-
* @experimental
|
|
47
|
-
* @since 1.85
|
|
48
|
-
* @alias sap.ui.mdc.p13n.panels.ListView
|
|
49
|
-
* @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel
|
|
50
|
-
*/
|
|
51
|
-
var ListView = BasePanel.extend("sap.ui.mdc.p13n.panels.ListView", {
|
|
52
|
-
metadata: {
|
|
53
|
-
library: "sap.ui.mdc",
|
|
54
|
-
properties: {
|
|
55
|
-
/**
|
|
56
|
-
* Shows an additional header with a SearchField and 'Show Selected' button
|
|
57
|
-
*/
|
|
58
|
-
showHeader: {
|
|
59
|
-
type: "boolean",
|
|
60
|
-
defaultValue: false
|
|
61
|
-
},
|
|
62
|
-
/**
|
|
63
|
-
* Enables a count for selected items compared to available items as '<fields> (3 / 12)' in addition
|
|
64
|
-
* for the first provided column text
|
|
65
|
-
*/
|
|
66
|
-
enableCount: {
|
|
67
|
-
type: "boolean",
|
|
68
|
-
defaultValue: false
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
renderer: {
|
|
73
|
-
apiVersion: 2
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
ListView.prototype.applySettings = function(){
|
|
78
|
-
this.setTemplate(this._getListTemplate());
|
|
79
|
-
BasePanel.prototype.applySettings.apply(this, arguments);
|
|
80
|
-
this.addStyleClass("sapUiMDCListView");
|
|
81
|
-
|
|
82
|
-
this._aInitializedFields = [];
|
|
83
|
-
|
|
84
|
-
//Do not show the factory by default
|
|
85
|
-
this._bShowFactory = false;
|
|
86
|
-
this.addStyleClass("listViewHover");
|
|
87
|
-
|
|
88
|
-
this.displayColumns();
|
|
89
|
-
this.setEnableReorder(true);
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
ListView.prototype.setItemFactory = function(fnItemFactory) {
|
|
93
|
-
this.setProperty("itemFactory", fnItemFactory);
|
|
94
|
-
this._oListControl.setGrowing(!!fnItemFactory);
|
|
95
|
-
return this;
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
ListView.prototype._getListTemplate = function() {
|
|
99
|
-
return new ColumnListItem({
|
|
100
|
-
selected: "{" + this.P13N_MODEL + ">visible}",
|
|
101
|
-
type: ListType.Active,
|
|
102
|
-
cells: [
|
|
103
|
-
new VBox({
|
|
104
|
-
items: [
|
|
105
|
-
new Label({
|
|
106
|
-
wrapping: true,
|
|
107
|
-
required: "{" + this.P13N_MODEL + ">required}",
|
|
108
|
-
tooltip: "{" + this.P13N_MODEL + ">tooltip}",
|
|
109
|
-
text: "{" + this.P13N_MODEL + ">label}"
|
|
110
|
-
})
|
|
111
|
-
]
|
|
112
|
-
}),
|
|
113
|
-
new HBox({
|
|
114
|
-
justifyContent: FlexJustifyContent.Center,
|
|
115
|
-
items: [
|
|
116
|
-
new Icon({
|
|
117
|
-
src: "sap-icon://circle-task-2",
|
|
118
|
-
size: "0.5rem",
|
|
119
|
-
color: IconColor.Neutral,
|
|
120
|
-
visible: {
|
|
121
|
-
path: this.P13N_MODEL + ">isFiltered",
|
|
122
|
-
formatter: function(bIsFiltered) {
|
|
123
|
-
if (bIsFiltered){
|
|
124
|
-
return true;
|
|
125
|
-
} else {
|
|
126
|
-
return false;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
})
|
|
131
|
-
]
|
|
132
|
-
})
|
|
133
|
-
]
|
|
134
|
-
});
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
ListView.prototype.setShowHeader = function(bShowHeader) {
|
|
138
|
-
if (bShowHeader){
|
|
139
|
-
var sShowSelected = this.getResourceText("p13nDialog.SHOW_SELECTED");
|
|
140
|
-
var sShowAll = this.getResourceText("p13nDialog.SHOW_ALL");
|
|
141
|
-
this._oListControl.setHeaderToolbar(new OverflowToolbar({
|
|
142
|
-
content: [
|
|
143
|
-
this._getSearchField(),
|
|
144
|
-
new ToolbarSpacer(),
|
|
145
|
-
new Button({
|
|
146
|
-
press: function(oEvt){
|
|
147
|
-
this._bShowSelected = oEvt.getSource().getText() == sShowSelected;
|
|
148
|
-
this._filterList(this._bShowSelected, this._sSearch);
|
|
149
|
-
oEvt.getSource().setText(this._bShowSelected ? sShowAll : sShowSelected);
|
|
150
|
-
}.bind(this),
|
|
151
|
-
text: sShowSelected
|
|
152
|
-
})
|
|
153
|
-
]
|
|
154
|
-
}));
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
this.setProperty("showHeader", bShowHeader);
|
|
158
|
-
|
|
159
|
-
return this;
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
ListView.prototype._filterList = function(bShowSelected, sSarch) {
|
|
163
|
-
var oSearchFilter = [], oSelectedFilter = [];
|
|
164
|
-
if (bShowSelected) {
|
|
165
|
-
oSelectedFilter = new Filter(this._getPresenceAttribute(), "EQ", true);
|
|
166
|
-
}
|
|
167
|
-
if (sSarch) {
|
|
168
|
-
oSearchFilter = new Filter("label", "Contains", sSarch);
|
|
169
|
-
}
|
|
170
|
-
this._oListControl.getBinding("items").filter(new Filter([].concat(oSelectedFilter, oSearchFilter), true));
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
ListView.prototype._onSearchFieldLiveChange = function(oEvent) {
|
|
174
|
-
this._sSearch = oEvent.getSource().getValue();
|
|
175
|
-
this._filterList(this._bShowSelected, this._sSearch);
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
ListView.prototype._handleActivated = function(oHoveredItem) {
|
|
179
|
-
//remove move buttons if unselected item is hovered (not covered by updateStarted)
|
|
180
|
-
this.removeMoveButtons();
|
|
181
|
-
|
|
182
|
-
//Check if the prior hovered item had a visible icon and renable it if required
|
|
183
|
-
if (this._oHoveredItem && this._oHoveredItem.getBindingContextPath()){
|
|
184
|
-
var bVisible = !!this.getP13nModel().getProperty(this._oHoveredItem.getBindingContextPath()).isFiltered;
|
|
185
|
-
var oOldIcon = this._oHoveredItem.getCells()[1].getItems()[0];
|
|
186
|
-
oOldIcon.setVisible(bVisible);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
//Store (new) hovered item and set its icon to visible: false + add move buttons to it
|
|
190
|
-
var oIcon = oHoveredItem.getCells()[1].getItems()[0];
|
|
191
|
-
oIcon.setVisible(false);
|
|
192
|
-
this._oHoveredItem = oHoveredItem;
|
|
193
|
-
this._updateEnableOfMoveButtons(oHoveredItem, false);
|
|
194
|
-
this._addMoveButtons(oHoveredItem);
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
ListView.prototype.removeMoveButtons = function() {
|
|
198
|
-
var oMoveButtonBox = this._getMoveButtonContainer();
|
|
199
|
-
|
|
200
|
-
if (oMoveButtonBox){
|
|
201
|
-
oMoveButtonBox.removeItem(this._getMoveTopButton());
|
|
202
|
-
oMoveButtonBox.removeItem(this._getMoveUpButton());
|
|
203
|
-
oMoveButtonBox.removeItem(this._getMoveDownButton());
|
|
204
|
-
oMoveButtonBox.removeItem(this._getMoveBottomButton());
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
ListView.prototype._getMoveButtonContainer = function() {
|
|
210
|
-
if (this._oMoveBottomButton &&
|
|
211
|
-
this._oMoveBottomButton.getParent() &&
|
|
212
|
-
this._oMoveBottomButton.getParent().isA("sap.m.FlexBox")
|
|
213
|
-
){
|
|
214
|
-
return this._oMoveBottomButton.getParent();
|
|
215
|
-
}
|
|
216
|
-
};
|
|
217
|
-
|
|
218
|
-
ListView.prototype.showFactory = function(bShow) {
|
|
219
|
-
|
|
220
|
-
this._bShowFactory = bShow;
|
|
221
|
-
this.displayColumns();
|
|
222
|
-
|
|
223
|
-
if (bShow){
|
|
224
|
-
this.removeStyleClass("listViewHover");
|
|
225
|
-
this._oListControl.setKeyboardMode(ListKeyboardMode.Edit); //--> tab through editable fields (fields shown)
|
|
226
|
-
this._addFactoryControl();
|
|
227
|
-
} else {
|
|
228
|
-
this.addStyleClass("listViewHover");
|
|
229
|
-
this._oListControl.setKeyboardMode(ListKeyboardMode.Navigation); //--> tab through list items (fields hidden)
|
|
230
|
-
this._removeFactoryControl();
|
|
231
|
-
}
|
|
232
|
-
};
|
|
233
|
-
|
|
234
|
-
ListView.prototype._updateCount = function() {
|
|
235
|
-
this.getP13nModel().setProperty("/selectedItems", this._oListControl.getSelectedContexts(true).length);
|
|
236
|
-
};
|
|
237
|
-
|
|
238
|
-
ListView.prototype._selectTableItem = function(oTableItem, bSelectAll) {
|
|
239
|
-
BasePanel.prototype._selectTableItem.apply(this, arguments);
|
|
240
|
-
this._updateCount();
|
|
241
|
-
};
|
|
242
|
-
|
|
243
|
-
ListView.prototype.setP13nModel = function(oModel) {
|
|
244
|
-
this.setModel(oModel, "$p13n");
|
|
245
|
-
this._updateCount();
|
|
246
|
-
this.setPanelMode(true);
|
|
247
|
-
this._getDragDropConfig().setEnabled(this.getEnableReorder());
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
ListView.prototype._removeFactoryControl = function() {
|
|
251
|
-
var aItems = this._oListControl.getItems().filter(function(oItem) {
|
|
252
|
-
return !oItem._bGroupHeader;
|
|
253
|
-
});
|
|
254
|
-
|
|
255
|
-
aItems.forEach(function(oItem){
|
|
256
|
-
var oFirstCell = oItem.getCells()[0];
|
|
257
|
-
if (oFirstCell.getItems().length > 1){
|
|
258
|
-
oFirstCell.removeItem(oFirstCell.getItems()[1]);
|
|
259
|
-
}
|
|
260
|
-
});
|
|
261
|
-
this.removeStyleClass("sapUiMDCAFLabelMarkingList");
|
|
262
|
-
|
|
263
|
-
return this._aInitializedFields;
|
|
264
|
-
|
|
265
|
-
};
|
|
266
|
-
|
|
267
|
-
ListView.prototype._moveSelectedItem = function(){
|
|
268
|
-
this._oSelectedItem = this._getMoveButtonContainer().getParent();
|
|
269
|
-
BasePanel.prototype._moveSelectedItem.apply(this, arguments);
|
|
270
|
-
};
|
|
271
|
-
|
|
272
|
-
ListView.prototype.getShowFactory = function() {
|
|
273
|
-
return this._bShowFactory;
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
ListView.prototype.displayColumns = function() {
|
|
277
|
-
|
|
278
|
-
var aColumns = [
|
|
279
|
-
this.getResourceText("p13nDialog.LIST_VIEW_COLUMN")
|
|
280
|
-
];
|
|
281
|
-
|
|
282
|
-
if (!this._bShowFactory) {
|
|
283
|
-
aColumns.push(new Column({
|
|
284
|
-
width: "25%",
|
|
285
|
-
hAlign: "Center",
|
|
286
|
-
vAlign: "Middle",
|
|
287
|
-
header: new Text({
|
|
288
|
-
text: this.getResourceText("p13nDialog.LIST_VIEW_ACTIVE")
|
|
289
|
-
})
|
|
290
|
-
}));
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
this.setPanelColumns(aColumns);
|
|
294
|
-
};
|
|
295
|
-
|
|
296
|
-
ListView.prototype.setPanelColumns = function(aColumns) {
|
|
297
|
-
this._sText = aColumns[0];
|
|
298
|
-
var bEnableCount = this.getEnableCount();
|
|
299
|
-
|
|
300
|
-
if (bEnableCount) {
|
|
301
|
-
var oColumn = new Column({
|
|
302
|
-
header: new Text({
|
|
303
|
-
text: {
|
|
304
|
-
parts: [
|
|
305
|
-
{
|
|
306
|
-
path: this.P13N_MODEL + '>/selectedItems'
|
|
307
|
-
}, {
|
|
308
|
-
path: this.P13N_MODEL + '>/items'
|
|
309
|
-
}
|
|
310
|
-
],
|
|
311
|
-
formatter: function(iSelected, aAll) {
|
|
312
|
-
return this._sText + " " + this.getResourceText('p13nDialog.HEADER_COUNT', [
|
|
313
|
-
iSelected, aAll.length
|
|
314
|
-
]);
|
|
315
|
-
}.bind(this)
|
|
316
|
-
}
|
|
317
|
-
})
|
|
318
|
-
});
|
|
319
|
-
aColumns[0] = oColumn;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
BasePanel.prototype.setPanelColumns.apply(this, arguments);
|
|
323
|
-
};
|
|
324
|
-
|
|
325
|
-
ListView.prototype._addFactoryControl = function(oList) {
|
|
326
|
-
|
|
327
|
-
this._oListControl.getItems().forEach(function(oItem){
|
|
328
|
-
var oContext = oItem.getBindingContext(this.P13N_MODEL);
|
|
329
|
-
var oField = this.getItemFactory().call(this, oContext);
|
|
330
|
-
var oCell = oItem.getCells()[0];
|
|
331
|
-
oCell.addItem(oField);
|
|
332
|
-
}.bind(this));
|
|
333
|
-
|
|
334
|
-
this.addStyleClass("sapUiMDCAFLabelMarkingList");
|
|
335
|
-
};
|
|
336
|
-
|
|
337
|
-
ListView.prototype._createInnerListControl = function() {
|
|
338
|
-
return new Table(this.getId() + "-innerListViewTable", Object.assign({
|
|
339
|
-
growing: false,
|
|
340
|
-
growingThreshold: 25,
|
|
341
|
-
growingScrollToLoad: true,
|
|
342
|
-
updateStarted: function() {
|
|
343
|
-
this.removeMoveButtons();
|
|
344
|
-
this._removeFactoryControl();
|
|
345
|
-
}.bind(this),
|
|
346
|
-
updateFinished: function() {
|
|
347
|
-
if (this.getShowFactory()) {
|
|
348
|
-
this._addFactoryControl();
|
|
349
|
-
}
|
|
350
|
-
}.bind(this)
|
|
351
|
-
}, this._getListControlConfig()));
|
|
352
|
-
};
|
|
353
|
-
|
|
354
|
-
ListView.prototype.getSelectedFields = function() {
|
|
355
|
-
var aSelectedItems = [];
|
|
356
|
-
this._loopItems(this._oListControl, function(oItem, sKey){
|
|
357
|
-
if (oItem.getSelected()){
|
|
358
|
-
aSelectedItems.push(sKey);
|
|
359
|
-
}
|
|
360
|
-
});
|
|
361
|
-
|
|
362
|
-
return aSelectedItems;
|
|
363
|
-
};
|
|
364
|
-
|
|
365
|
-
ListView.prototype._loopItems = function(oList, fnItemCallback) {
|
|
366
|
-
oList.getItems().forEach(function(oItem){
|
|
367
|
-
|
|
368
|
-
var sPath = oItem.getBindingContextPath();
|
|
369
|
-
var sKey = this.getP13nModel().getProperty(sPath).name;
|
|
370
|
-
|
|
371
|
-
fnItemCallback.call(this, oItem, sKey);
|
|
372
|
-
}.bind(this));
|
|
373
|
-
};
|
|
374
|
-
|
|
375
|
-
ListView.prototype.filterWithoutDestroy = function(aFilter) {
|
|
376
|
-
if (this._oListControl.getBinding("items")){
|
|
377
|
-
this._oListControl.getBinding("items").filter(aFilter, true);
|
|
378
|
-
}
|
|
379
|
-
};
|
|
380
|
-
|
|
381
|
-
ListView.prototype._addMoveButtons = function(oItem) {
|
|
382
|
-
var oTableItem = oItem;
|
|
383
|
-
if (!oTableItem){
|
|
384
|
-
return;
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
var bItemSelected = this.getP13nModel().getProperty(oTableItem.getBindingContextPath()).visible;
|
|
388
|
-
|
|
389
|
-
if (bItemSelected){
|
|
390
|
-
oTableItem.getCells()[1].addItem(this._getMoveTopButton());
|
|
391
|
-
oTableItem.getCells()[1].addItem(this._getMoveUpButton());
|
|
392
|
-
oTableItem.getCells()[1].addItem(this._getMoveDownButton());
|
|
393
|
-
oTableItem.getCells()[1].addItem(this._getMoveBottomButton());
|
|
394
|
-
}
|
|
395
|
-
};
|
|
396
|
-
|
|
397
|
-
ListView.prototype.exit = function() {
|
|
398
|
-
BasePanel.prototype.exit.apply(this, arguments);
|
|
399
|
-
this._aInitializedFields = null;
|
|
400
|
-
this._oHoveredItem = null;
|
|
401
|
-
this._bShowFactory = null;
|
|
402
|
-
this._sSearch = null;
|
|
403
|
-
this._bShowSelected = null;
|
|
404
|
-
};
|
|
405
|
-
|
|
406
|
-
return ListView;
|
|
407
|
-
|
|
408
|
-
});
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* ! OpenUI5
|
|
3
|
-
* (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
-
*/
|
|
6
|
-
sap.ui.define([
|
|
7
|
-
"./BasePanel", "sap/m/Label", "sap/m/ColumnListItem", "sap/m/HBox", "sap/m/VBox", "sap/ui/model/Filter"
|
|
8
|
-
], function(BasePanel, Label, ColumnListItem, HBox, VBox, Filter) {
|
|
9
|
-
"use strict";
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Constructor for SelectionPanel
|
|
13
|
-
*
|
|
14
|
-
* @param {string} [sId] ID for the new control, generated automatically if no ID is given
|
|
15
|
-
* @param {object} [mSettings] initial settings for the new control
|
|
16
|
-
* @class TODO
|
|
17
|
-
* <h3><b>Note:</b></h3>
|
|
18
|
-
* The control is experimental and the API/behaviour is not finalised and hence this should not be used for productive usage.
|
|
19
|
-
* @extends sap.ui.mdc.p13n.panels.BasePanel
|
|
20
|
-
* @author SAP SE
|
|
21
|
-
* @private
|
|
22
|
-
* @experimental
|
|
23
|
-
* @since 1.66
|
|
24
|
-
* @alias sap.ui.mdc.p13n.panels.SelectionPanel
|
|
25
|
-
* @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel
|
|
26
|
-
*/
|
|
27
|
-
var SelectionPanel = BasePanel.extend("sap.ui.mdc.p13n.panels.SelectionPanel", {
|
|
28
|
-
metadata: {
|
|
29
|
-
library: "sap.ui.mdc"
|
|
30
|
-
},
|
|
31
|
-
init: function() {
|
|
32
|
-
|
|
33
|
-
// Initialize the BasePanel
|
|
34
|
-
BasePanel.prototype.init.apply(this, arguments);
|
|
35
|
-
|
|
36
|
-
this.setPanelColumns(this.getResourceText("fieldsui.COLUMNS"));
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
renderer: {}
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
SelectionPanel.prototype.setP13nModel = function(oModel) {
|
|
43
|
-
BasePanel.prototype.setP13nModel.apply(this, arguments);
|
|
44
|
-
|
|
45
|
-
var oSelectionPanelTemplate = new ColumnListItem({
|
|
46
|
-
selected: "{" + this.P13N_MODEL + ">" + this._getPresenceAttribute() + "}",
|
|
47
|
-
cells: new VBox({
|
|
48
|
-
items: [
|
|
49
|
-
new Label({
|
|
50
|
-
design: {
|
|
51
|
-
path: this.P13N_MODEL + ">groupLabel",
|
|
52
|
-
formatter: function(sGroupLabel){
|
|
53
|
-
return sGroupLabel ? "Bold" : "Standard";
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
wrapping: true,
|
|
57
|
-
tooltip: "{" + this.P13N_MODEL + ">tooltip}",
|
|
58
|
-
text: "{" + this.P13N_MODEL + ">label}"
|
|
59
|
-
}),
|
|
60
|
-
new Label({
|
|
61
|
-
visible: {
|
|
62
|
-
path: this.P13N_MODEL + ">groupLabel",
|
|
63
|
-
formatter: function(sGroupLabel){
|
|
64
|
-
return sGroupLabel ? true : false;
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
wrapping: true,
|
|
68
|
-
tooltip: "{" + this.P13N_MODEL + ">tooltip}",
|
|
69
|
-
text: "{" + this.P13N_MODEL + ">groupLabel}"
|
|
70
|
-
})
|
|
71
|
-
|
|
72
|
-
]
|
|
73
|
-
})
|
|
74
|
-
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
this.setTemplate(oSelectionPanelTemplate);
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
SelectionPanel.prototype._onSearchFieldLiveChange = function(oEvent) {
|
|
81
|
-
//TODO: implement in BasePanel
|
|
82
|
-
var aFilters = new Filter([
|
|
83
|
-
new Filter("label", "Contains", oEvent.getSource().getValue()),
|
|
84
|
-
new Filter("groupLabel", "Contains", oEvent.getSource().getValue())
|
|
85
|
-
]);
|
|
86
|
-
|
|
87
|
-
this._oListControl.getBinding("items").filter(aFilters, false);
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
return SelectionPanel;
|
|
91
|
-
|
|
92
|
-
});
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* ! OpenUI5
|
|
3
|
-
* (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
-
*/
|
|
6
|
-
sap.ui.define([
|
|
7
|
-
"./BasePanel", "sap/m/ColumnListItem", "sap/m/Label", "sap/m/Select", "sap/ui/core/Item", "sap/m/HBox", "sap/m/VBox", "sap/ui/model/Filter"
|
|
8
|
-
], function(BasePanel, ColumnListItem, Label, Select, Item, HBox, VBox, Filter) {
|
|
9
|
-
"use strict";
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Constructor for SortPanel
|
|
13
|
-
*
|
|
14
|
-
* @param {string} [sId] ID for the new control, generated automatically if no ID is given
|
|
15
|
-
* @param {object} [mSettings] initial settings for the new control
|
|
16
|
-
* @class TODO
|
|
17
|
-
* <h3><b>Note:</b></h3>
|
|
18
|
-
* The control is experimental and the API/behaviour is not finalised and hence this should not be used for productive usage.
|
|
19
|
-
* @extends sap.ui.mdc.p13n.panels.BasePanel
|
|
20
|
-
* @author SAP SE
|
|
21
|
-
* @private
|
|
22
|
-
* @experimental
|
|
23
|
-
* @since 1.66
|
|
24
|
-
* @alias sap.ui.mdc.p13n.panels.SortPanel
|
|
25
|
-
* @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel
|
|
26
|
-
*/
|
|
27
|
-
var SortPanel = BasePanel.extend("sap.ui.mdc.p13n.panels.SortPanel", {
|
|
28
|
-
metadata: {
|
|
29
|
-
library: "sap.ui.mdc"
|
|
30
|
-
},
|
|
31
|
-
init: function() {
|
|
32
|
-
// Initialize the BasePanel
|
|
33
|
-
BasePanel.prototype.init.apply(this, arguments);
|
|
34
|
-
|
|
35
|
-
var oSortPanelTemplate = new ColumnListItem({
|
|
36
|
-
selected: "{" + this.P13N_MODEL + ">sorted}",
|
|
37
|
-
cells: [
|
|
38
|
-
new VBox({
|
|
39
|
-
items: [
|
|
40
|
-
new Label({
|
|
41
|
-
design: {
|
|
42
|
-
path: this.P13N_MODEL + ">groupLabel",
|
|
43
|
-
formatter: function(sGroupLabel){
|
|
44
|
-
return sGroupLabel ? "Bold" : "Standard";
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
wrapping: true,
|
|
48
|
-
tooltip: "{" + this.P13N_MODEL + ">tooltip}",
|
|
49
|
-
text: "{" + this.P13N_MODEL + ">label}"
|
|
50
|
-
}),
|
|
51
|
-
new Label({
|
|
52
|
-
visible: {
|
|
53
|
-
path: this.P13N_MODEL + ">groupLabel",
|
|
54
|
-
formatter: function(sGroupLabel){
|
|
55
|
-
return sGroupLabel ? true : false;
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
wrapping: true,
|
|
59
|
-
tooltip: "{" + this.P13N_MODEL + ">tooltip}",
|
|
60
|
-
text: "{" + this.P13N_MODEL + ">groupLabel}"
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
]
|
|
64
|
-
}),
|
|
65
|
-
new Select("IDsortOrderSelect", {
|
|
66
|
-
width: "100%",
|
|
67
|
-
selectedKey: "{" + this.P13N_MODEL + ">descending}",
|
|
68
|
-
change: [this.onChangeOfSortOrder, this],
|
|
69
|
-
enabled: {
|
|
70
|
-
path: this.P13N_MODEL + ">sorted",
|
|
71
|
-
formatter: function(bEnabled) {
|
|
72
|
-
return !!bEnabled;
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
items: [
|
|
76
|
-
new Item({
|
|
77
|
-
key: false,
|
|
78
|
-
text: this.getResourceText("sort.PERSONALIZATION_DIALOG_OPTION_ASCENDING")
|
|
79
|
-
}),
|
|
80
|
-
new Item({
|
|
81
|
-
key: true,
|
|
82
|
-
text: this.getResourceText("sort.PERSONALIZATION_DIALOG_OPTION_DESCENDING")
|
|
83
|
-
})
|
|
84
|
-
]
|
|
85
|
-
})
|
|
86
|
-
]
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
this.setTemplate(oSortPanelTemplate);
|
|
90
|
-
this.setPanelColumns([
|
|
91
|
-
this.getResourceText("sort.PERSONALIZATION_DIALOG_COLUMN_DESCRIPTION"), this.getResourceText("sort.PERSONALIZATION_DIALOG_COLUMN_SORTORDER")
|
|
92
|
-
]);
|
|
93
|
-
},
|
|
94
|
-
renderer: {}
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
SortPanel.prototype._filterBySelected = function(bShowSelected) {
|
|
98
|
-
this._oListControl.getBinding("items").filter(bShowSelected ? new Filter("sorted", "EQ", true) : []);
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
SortPanel.prototype._updateModelItems = function() {
|
|
102
|
-
// Sort and update the model items to ensure selected ones, are at the top
|
|
103
|
-
var aFields = this.getP13nModel().getProperty("/items");
|
|
104
|
-
var aSelectedFields = [], aOtherFields = [];
|
|
105
|
-
aFields.forEach(function(oField) {
|
|
106
|
-
if (oField.sorted) {
|
|
107
|
-
aSelectedFields.push(oField);
|
|
108
|
-
} else {
|
|
109
|
-
aOtherFields.push(oField);
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
this.getP13nModel().setProperty("/items", aSelectedFields.concat(aOtherFields));
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
SortPanel.prototype.onChangeOfSortOrder = function(oEvent) {
|
|
116
|
-
var oSelectedItem = oEvent.getParameter("selectedItem");
|
|
117
|
-
// Fire event only for valid selection
|
|
118
|
-
if (oSelectedItem) {
|
|
119
|
-
var oBindingContext = oSelectedItem.getBindingContext(this.P13N_MODEL);
|
|
120
|
-
if (oBindingContext) {
|
|
121
|
-
var sPath = oBindingContext.getPath();
|
|
122
|
-
|
|
123
|
-
//convert stringified boolean back to boolean instance type
|
|
124
|
-
this.getP13nModel().setProperty(sPath + "/descending", oSelectedItem.getKey() === "true");
|
|
125
|
-
}
|
|
126
|
-
this.fireChange();
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
SortPanel.prototype._onSearchFieldLiveChange = function(oEvent) {
|
|
131
|
-
//TODO: implement in BasePanel
|
|
132
|
-
var aFilters = new Filter([
|
|
133
|
-
new Filter("label", "Contains", oEvent.getSource().getValue()),
|
|
134
|
-
new Filter("groupLabel", "Contains", oEvent.getSource().getValue())
|
|
135
|
-
]);
|
|
136
|
-
|
|
137
|
-
this._oListControl.getBinding("items").filter(aFilters, false);
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
SortPanel.prototype._onPressToggleMode = function(oEvent) {
|
|
141
|
-
var aPanelColumns = this.getPanelMode() ?
|
|
142
|
-
[this.getResourceText("sort.PERSONALIZATION_DIALOG_COLUMN_DESCRIPTION"), this.getResourceText("sort.PERSONALIZATION_DIALOG_COLUMN_SORTORDER")] :
|
|
143
|
-
this.getResourceText("sort.PERSONALIZATION_DIALOG_COLUMN_DESCRIPTION");
|
|
144
|
-
this.setPanelColumns(aPanelColumns);
|
|
145
|
-
this._togglePanelMode();
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
return SortPanel;
|
|
149
|
-
|
|
150
|
-
});
|