@openui5/sap.ui.mdc 1.96.2 → 1.97.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.reuse/dep5 +1 -1
- package/THIRDPARTY.txt +2 -1
- package/package.json +4 -4
- package/src/sap/ui/mdc/.library +1 -1
- package/src/sap/ui/mdc/ActionToolbar.js +2 -7
- package/src/sap/ui/mdc/Chart.js +1 -1
- package/src/sap/ui/mdc/ChartNew.js +1 -1
- package/src/sap/ui/mdc/ChartNewRenderer.js +2 -2
- package/src/sap/ui/mdc/Control.js +1 -1
- package/src/sap/ui/mdc/Element.js +1 -1
- package/src/sap/ui/mdc/Field.js +3 -2
- package/src/sap/ui/mdc/FilterBar.js +1 -1
- package/src/sap/ui/mdc/FilterField.js +16 -2
- package/src/sap/ui/mdc/Link.js +1 -1
- package/src/sap/ui/mdc/MultiValueField.js +2 -1
- package/src/sap/ui/mdc/Table.js +161 -133
- package/src/sap/ui/mdc/TableDelegate.js +13 -11
- package/src/sap/ui/mdc/ValueHelp.js +33 -7
- package/src/sap/ui/mdc/ValueHelpDelegate.js +20 -0
- package/src/sap/ui/mdc/actiontoolbar/ActionToolbarAction.js +1 -1
- package/src/sap/ui/mdc/chart/SelectionDetailsActions.js +1 -1
- package/src/sap/ui/mdc/chart/ToolbarHandler.js +1 -1
- package/src/sap/ui/mdc/chartNew/ChartSelectionDetailsNew.js +1 -1
- package/src/sap/ui/mdc/chartNew/ChartToolbarNew.js +1 -1
- package/src/sap/ui/mdc/chartNew/PropertyHelperNew.js +1 -1
- package/src/sap/ui/mdc/condition/Condition.js +1 -1
- package/src/sap/ui/mdc/condition/ConditionConverter.js +1 -1
- package/src/sap/ui/mdc/condition/ConditionModel.js +1 -1
- package/src/sap/ui/mdc/condition/FilterConverter.js +1 -1
- package/src/sap/ui/mdc/condition/FilterOperatorUtil.js +6 -2
- package/src/sap/ui/mdc/condition/Operator.js +9 -9
- package/src/sap/ui/mdc/condition/OperatorDynamicDateOption.js +437 -0
- package/src/sap/ui/mdc/condition/RangeOperator.js +1 -1
- package/src/sap/ui/mdc/designtime/chart/ChartNew.designtime.js +17 -17
- package/src/sap/ui/mdc/designtime/field/Field.designtime.js +21 -0
- package/src/sap/ui/mdc/designtime/field/FieldBase.designtime.js +104 -0
- package/src/sap/ui/mdc/designtime/field/FilterField.designtime.js +22 -0
- package/src/sap/ui/mdc/designtime/field/MultiValueField.designtime.js +23 -0
- package/src/sap/ui/mdc/field/BoolFieldHelp.js +1 -1
- package/src/sap/ui/mdc/field/ConditionFieldHelp.js +1 -1
- package/src/sap/ui/mdc/field/ConditionType.js +7 -7
- package/src/sap/ui/mdc/field/ConditionsType.js +7 -7
- 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 +1 -1
- package/src/sap/ui/mdc/field/DynamicDateRangeConditionsType.js +311 -0
- package/src/sap/ui/mdc/field/FieldBase.js +54 -47
- package/src/sap/ui/mdc/field/FieldHelpBase.js +1 -1
- package/src/sap/ui/mdc/field/FieldInfoBase.js +1 -1
- package/src/sap/ui/mdc/field/FieldInput.js +1 -1
- package/src/sap/ui/mdc/field/FieldInputRenderUtil.js +1 -1
- package/src/sap/ui/mdc/field/FieldMultiInput.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelp.js +6 -6
- package/src/sap/ui/mdc/field/FieldValueHelpContentWrapperBase.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelpDelegate.js +20 -0
- package/src/sap/ui/mdc/field/FieldValueHelpMTableWrapper.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelpMdcTableWrapper.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelpTableWrapperBase.js +2 -1
- package/src/sap/ui/mdc/field/FieldValueHelpUITableWrapper.js +1 -1
- package/src/sap/ui/mdc/field/InParameter.js +1 -1
- package/src/sap/ui/mdc/field/ListFieldHelp.js +1 -1
- package/src/sap/ui/mdc/field/ListFieldHelpItem.js +1 -1
- package/src/sap/ui/mdc/field/MultiValueFieldItem.js +1 -1
- package/src/sap/ui/mdc/field/OutParameter.js +1 -1
- package/src/sap/ui/mdc/field/ValueHelpPanel.js +2 -1
- package/src/sap/ui/mdc/field/content/BooleanContent.js +1 -1
- package/src/sap/ui/mdc/field/content/ContentFactory.js +23 -21
- package/src/sap/ui/mdc/field/content/DateContent.js +128 -2
- package/src/sap/ui/mdc/field/content/DateTimeContent.js +9 -1
- package/src/sap/ui/mdc/field/content/DefaultContent.js +1 -1
- package/src/sap/ui/mdc/field/content/TimeContent.js +8 -1
- package/src/sap/ui/mdc/field/content/UnitContent.js +23 -4
- package/src/sap/ui/mdc/filterbar/FilterBarBase.js +25 -17
- package/src/sap/ui/mdc/filterbar/PropertyHelper.js +1 -1
- package/src/sap/ui/mdc/filterbar/p13n/AdaptationFilterBar.js +1 -1
- package/src/sap/ui/mdc/filterbar/vh/FilterBar.js +1 -1
- package/src/sap/ui/mdc/flexibility/Chart.flexibility.js +1 -1
- package/src/sap/ui/mdc/flexibility/FilterBar.flexibility.js +1 -1
- package/src/sap/ui/mdc/flexibility/FilterItemFlex.js +1 -1
- package/src/sap/ui/mdc/library.js +19 -3
- package/src/sap/ui/mdc/link/ContactDetails.js +1 -1
- package/src/sap/ui/mdc/link/ContactDetailsAddressItem.js +1 -1
- package/src/sap/ui/mdc/link/ContactDetailsEmailItem.js +1 -1
- package/src/sap/ui/mdc/link/ContactDetailsItem.js +1 -1
- package/src/sap/ui/mdc/link/ContactDetailsPhoneItem.js +1 -1
- package/src/sap/ui/mdc/link/Factory.js +1 -1
- package/src/sap/ui/mdc/link/FakeFlpConnector.js +1 -1
- package/src/sap/ui/mdc/link/LinkItem.js +1 -1
- package/src/sap/ui/mdc/link/Panel.js +1 -1
- package/src/sap/ui/mdc/link/PanelItem.js +1 -1
- package/src/sap/ui/mdc/link/PanelListItem.js +1 -1
- package/src/sap/ui/mdc/link/SelectionDialog.js +1 -1
- package/src/sap/ui/mdc/link/SelectionDialogItem.js +1 -1
- package/src/sap/ui/mdc/link/SemanticObjectMapping.js +1 -1
- package/src/sap/ui/mdc/link/SemanticObjectMappingItem.js +1 -1
- package/src/sap/ui/mdc/link/SemanticObjectUnavailableAction.js +1 -1
- package/src/sap/ui/mdc/messagebundle.properties +13 -4
- package/src/sap/ui/mdc/messagebundle_ar.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_bg.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_ca.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_cs.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_cy.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_da.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_de.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_el.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_en.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_en_GB.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_en_US_sappsd.properties +14 -0
- package/src/sap/ui/mdc/messagebundle_en_US_saprigi.properties +3 -19
- package/src/sap/ui/mdc/messagebundle_en_US_saptrc.properties +14 -0
- package/src/sap/ui/mdc/messagebundle_es.properties +9 -3
- package/src/sap/ui/mdc/messagebundle_es_MX.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_et.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_fi.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_fr.properties +12 -6
- package/src/sap/ui/mdc/messagebundle_fr_CA.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_hi.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_hr.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_hu.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_id.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_it.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_iw.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_ja.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_kk.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_ko.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_lt.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_lv.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_ms.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_nl.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_no.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_pl.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_pt.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_pt_PT.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_ro.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_ru.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_sh.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_sk.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_sl.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_sv.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_th.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_tr.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_uk.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_vi.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_zh_CN.properties +8 -2
- package/src/sap/ui/mdc/messagebundle_zh_TW.properties +8 -2
- package/src/sap/ui/mdc/mixin/AdaptationMixin.js +1 -1
- package/src/sap/ui/mdc/mixin/DelegateMixin.js +1 -1
- package/src/sap/ui/mdc/mixin/FilterIntegrationMixin.js +3 -3
- package/src/sap/ui/mdc/mixin/PromiseMixin.js +1 -1
- package/src/sap/ui/mdc/odata/v4/ChartPropertyHelperNew.js +1 -1
- package/src/sap/ui/mdc/odata/v4/TableDelegate.js +65 -37
- package/src/sap/ui/mdc/odata/v4/ValueHelpDelegate.js +1 -1
- package/src/sap/ui/mdc/odata/v4/vizChart/ChartDelegateNew.js +12 -3
- package/src/sap/ui/mdc/p13n/Engine.js +32 -9
- package/src/sap/ui/mdc/p13n/P13nBuilder.js +1 -1
- package/src/sap/ui/mdc/p13n/PersistenceProvider.js +21 -10
- package/src/sap/ui/mdc/p13n/PropertyHelper.js +1 -1
- package/src/sap/ui/mdc/p13n/StateUtil.js +20 -0
- package/src/sap/ui/mdc/p13n/UIManager.js +11 -6
- package/src/sap/ui/mdc/p13n/{DefaultProviderRegistry.js → modules/DefaultProviderRegistry.js} +2 -2
- package/src/sap/ui/mdc/p13n/modules/StateHandlerRegistry.js +86 -0
- package/src/sap/ui/mdc/p13n/panels/AdaptFiltersPanel.js +19 -3
- package/src/sap/ui/mdc/p13n/panels/ChartItemPanelNew.js +40 -32
- package/src/sap/ui/mdc/p13n/subcontroller/AggregateController.js +1 -1
- package/src/sap/ui/mdc/p13n/subcontroller/BaseController.js +1 -1
- package/src/sap/ui/mdc/table/Column.js +34 -9
- package/src/sap/ui/mdc/table/CreationRow.js +14 -13
- package/src/sap/ui/mdc/table/GridTableType.js +11 -10
- package/src/sap/ui/mdc/table/PropertyHelper.js +21 -21
- package/src/sap/ui/mdc/table/ResponsiveTableType.js +23 -24
- package/src/sap/ui/mdc/table/RowSettings.js +8 -6
- package/src/sap/ui/mdc/table/TableTypeBase.js +4 -4
- package/src/sap/ui/mdc/table/V4AnalyticsPropertyHelper.js +15 -71
- package/src/sap/ui/mdc/themes/base/Chart.less +3 -0
- package/src/sap/ui/mdc/themes/base/library.source.less +1 -0
- package/src/sap/ui/mdc/ui/Container.js +2 -2
- package/src/sap/ui/mdc/ui/ContainerItem.js +2 -2
- package/src/sap/ui/mdc/util/PromiseCache.js +1 -1
- package/src/sap/ui/mdc/util/PropertyHelper.js +111 -319
- package/src/sap/ui/mdc/valuehelp/Dialog.js +2 -1
- package/src/sap/ui/mdc/valuehelp/Popover.js +13 -2
- package/src/sap/ui/mdc/valuehelp/base/Container.js +32 -1
- package/src/sap/ui/mdc/valuehelp/base/Content.js +35 -5
- package/src/sap/ui/mdc/valuehelp/base/DialogTab.js +1 -1
- package/src/sap/ui/mdc/valuehelp/base/FilterableListContent.js +42 -15
- package/src/sap/ui/mdc/valuehelp/base/ListContent.js +1 -1
- package/src/sap/ui/mdc/valuehelp/content/Bool.js +1 -1
- package/src/sap/ui/mdc/valuehelp/content/Conditions.js +25 -31
- package/src/sap/ui/mdc/valuehelp/content/FixedList.js +1 -1
- package/src/sap/ui/mdc/valuehelp/content/MDCTable.js +8 -3
- package/src/sap/ui/mdc/valuehelp/content/MTable.js +15 -3
- package/test/sap/ui/mdc/testutils/opa/p13n/Actions.js +102 -96
- package/src/sap/ui/mdc/p13n/panels/GroupPanel.js +0 -111
- package/src/sap/ui/mdc/p13n/panels/QueryPanel.js +0 -322
- package/src/sap/ui/mdc/p13n/panels/SortQueryPanel.js +0 -133
- package/src/sap/ui/mdc/p13n/panels/Wrapper.js +0 -203
|
@@ -456,7 +456,7 @@ sap.ui.define([
|
|
|
456
456
|
|
|
457
457
|
var iPersonalizeListViewItems = function(oP13nDialog, aItems) {
|
|
458
458
|
this.waitFor({
|
|
459
|
-
controlType: oP13nDialog.getContent()[0].getView("columns") ? "sap.ui.mdc.p13n.panels.ListView" : "sap.m.p13n.SelectionPanel",
|
|
459
|
+
controlType: oP13nDialog.getContent()[0].getView("columns") && oP13nDialog.getContent()[0].getView("columns").getContent().isA("sap.ui.mdc.p13n.panels.ListView") ? "sap.ui.mdc.p13n.panels.ListView" : "sap.m.p13n.SelectionPanel",
|
|
460
460
|
matchers: new Ancestor(oP13nDialog, false),
|
|
461
461
|
success: function(aListViews) {
|
|
462
462
|
var oListView = aListViews[0];
|
|
@@ -627,10 +627,14 @@ sap.ui.define([
|
|
|
627
627
|
this.waitFor({
|
|
628
628
|
controlType: "sap.ui.mdc.p13n.panels.ChartItemPanelNew",
|
|
629
629
|
matchers: new Ancestor(oP13nDialog, false),
|
|
630
|
-
success: function() {
|
|
631
|
-
//
|
|
630
|
+
success: function(aItemPanels) {
|
|
631
|
+
//This is done in 3 steps
|
|
632
|
+
//1. Remove current selection
|
|
633
|
+
//2. Add items in order
|
|
634
|
+
//3. Select correct roles
|
|
635
|
+
|
|
632
636
|
var aItemsToRemoveIds = [];
|
|
633
|
-
var
|
|
637
|
+
var oItemPanel = aItemPanels[0];
|
|
634
638
|
|
|
635
639
|
this.waitFor({
|
|
636
640
|
|
|
@@ -639,125 +643,127 @@ sap.ui.define([
|
|
|
639
643
|
new Ancestor(oP13nDialog, false)
|
|
640
644
|
],
|
|
641
645
|
actions: function(oColumnListItem) {
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
matchers: new Ancestor(oColumnListItem),
|
|
645
|
-
success: function(aComboBoxes) {
|
|
646
|
-
var oComboBox = aComboBoxes[0];
|
|
647
|
-
var oItem = aItems.find(function(oItem) {
|
|
648
|
-
return oComboBox.getSelectedKey() === oItem.key;
|
|
649
|
-
});
|
|
650
|
-
var bItemIsPresent = !!oItem;
|
|
651
|
-
|
|
652
|
-
//Remove if not selected
|
|
653
|
-
if (!bItemIsPresent) {
|
|
654
|
-
|
|
655
|
-
//Template has only one cell (no role & remove)
|
|
656
|
-
var bTemplate = oColumnListItem.getCells().length === 1;
|
|
657
|
-
|
|
658
|
-
if (!bTemplate){
|
|
659
|
-
this.waitFor({
|
|
660
|
-
controlType: "sap.m.Button",
|
|
661
|
-
matchers: new Ancestor(oColumnListItem, false),
|
|
662
|
-
actions: function(oBtn) {
|
|
663
|
-
aItemsToRemoveIds.push(oBtn.getId());
|
|
664
|
-
}
|
|
665
|
-
});
|
|
666
|
-
}
|
|
667
|
-
} else {
|
|
668
|
-
aItemsAlreadyPresent.push(oComboBox.getSelectedKey());
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
});
|
|
672
|
-
}.bind(this),
|
|
673
|
-
success: function() {
|
|
674
|
-
|
|
675
|
-
aItemsToRemoveIds.forEach(function(oBtnId){
|
|
646
|
+
//Step 1.1: Find all remove buttons
|
|
647
|
+
var bTemplate = oColumnListItem.getCells().length === 1;
|
|
676
648
|
|
|
649
|
+
if (!bTemplate){
|
|
677
650
|
this.waitFor({
|
|
678
|
-
|
|
679
651
|
controlType: "sap.m.Button",
|
|
680
652
|
matchers: [
|
|
681
|
-
new Ancestor(
|
|
653
|
+
new Ancestor(oColumnListItem),
|
|
682
654
|
new Properties({
|
|
683
|
-
|
|
655
|
+
icon: "sap-icon://decline"
|
|
684
656
|
})
|
|
685
657
|
],
|
|
686
658
|
success: function(aBtns) {
|
|
687
|
-
|
|
659
|
+
var oButton = aBtns[0];
|
|
660
|
+
aItemsToRemoveIds.push(oButton.getId());
|
|
688
661
|
}
|
|
689
662
|
});
|
|
663
|
+
}
|
|
664
|
+
}.bind(this),
|
|
665
|
+
success: function() {
|
|
690
666
|
|
|
691
|
-
|
|
667
|
+
var iClickOnChartP13nRemoveButton = function(sCurrentBtnId, oP13nDialog, aBtnIds, fnFollowUpFunction, aFollowUpParams){
|
|
668
|
+
this.waitFor({
|
|
669
|
+
|
|
670
|
+
controlType: "sap.m.Button",
|
|
671
|
+
id: sCurrentBtnId,
|
|
672
|
+
matchers: [
|
|
673
|
+
new Ancestor(oP13nDialog, false)
|
|
674
|
+
],
|
|
675
|
+
success: function(oBtn) {
|
|
676
|
+
new Press().executeOn(oBtn);
|
|
692
677
|
|
|
693
|
-
|
|
678
|
+
var iIdx = aBtnIds.indexOf(sCurrentBtnId);
|
|
694
679
|
|
|
695
|
-
|
|
680
|
+
if (iIdx === aBtnIds.length - 1){
|
|
681
|
+
fnFollowUpFunction.apply(this, aFollowUpParams);
|
|
682
|
+
} else {
|
|
683
|
+
iClickOnChartP13nRemoveButton.call(this, aBtnIds[iIdx + 1], oP13nDialog, aBtnIds, fnFollowUpFunction, aFollowUpParams);
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
});
|
|
687
|
+
};
|
|
696
688
|
|
|
697
|
-
|
|
689
|
+
var fnAddAllItems = function(oCurrentItem, aItems, fnFollowUp){
|
|
690
|
+
if (oCurrentItem.kind) {
|
|
698
691
|
this.waitFor({
|
|
699
692
|
controlType: "sap.m.ComboBox",
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
new Properties({
|
|
703
|
-
id: "p13nPanel-templateComboBox-" + oItem.kind
|
|
704
|
-
})
|
|
705
|
-
],
|
|
693
|
+
id: "p13nPanel-templateComboBox-" + oCurrentItem.kind,
|
|
694
|
+
matchers: new Ancestor(oP13nDialog, false),
|
|
706
695
|
actions: function(oComboBox) {
|
|
707
|
-
iChangeComboBoxSelection.call(this, oComboBox,
|
|
708
|
-
}.bind(this)
|
|
696
|
+
iChangeComboBoxSelection.call(this, oComboBox, oCurrentItem.key);
|
|
697
|
+
}.bind(this),
|
|
698
|
+
success: function(){
|
|
699
|
+
var iIdx = aItems.indexOf(oCurrentItem);
|
|
700
|
+
|
|
701
|
+
if (iIdx === aItems.length - 1){
|
|
702
|
+
fnFollowUp.call(this);
|
|
703
|
+
} else {
|
|
704
|
+
fnAddAllItems.call(this, aItems[iIdx + 1], aItems, fnFollowUp);
|
|
705
|
+
}
|
|
706
|
+
}
|
|
709
707
|
});
|
|
710
708
|
} else {
|
|
711
|
-
Log.error("P13nChartPersonalizationOPA: No kind field given for " +
|
|
709
|
+
Log.error("P13nChartPersonalizationOPA: No kind field given for " + oCurrentItem.key + ". Ignoring the field!");
|
|
712
710
|
}
|
|
711
|
+
};
|
|
713
712
|
|
|
713
|
+
var fnAssignRoles = function(){
|
|
714
|
+
this.waitFor({
|
|
714
715
|
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
var oComboBox = aComboBoxes[0];
|
|
730
|
-
var oItem = aItems.find(function(oItem) {
|
|
731
|
-
return oComboBox.getSelectedKey() === oItem.key;
|
|
732
|
-
});
|
|
733
|
-
var bItemIsPresent = !!oItem;
|
|
716
|
+
controlType: "sap.m.ColumnListItem",
|
|
717
|
+
matchers: [
|
|
718
|
+
new Ancestor(oP13nDialog, false)
|
|
719
|
+
],
|
|
720
|
+
actions: function(oColumnListItem) {
|
|
721
|
+
this.waitFor({
|
|
722
|
+
controlType: "sap.m.ComboBox",
|
|
723
|
+
matchers: new Ancestor(oColumnListItem),
|
|
724
|
+
success: function(aComboBoxes) {
|
|
725
|
+
var oComboBox = aComboBoxes[0];
|
|
726
|
+
var oItem = aItems.find(function(oItem) {
|
|
727
|
+
return oComboBox.getSelectedKey() === oItem.key;
|
|
728
|
+
});
|
|
729
|
+
var bItemIsPresent = !!oItem;
|
|
734
730
|
|
|
735
|
-
|
|
731
|
+
if (bItemIsPresent) {
|
|
736
732
|
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
733
|
+
//Ignore templates / items with no role select (due to chart type)
|
|
734
|
+
var bMobile = oItemPanel._bMobileMode;
|
|
735
|
+
if (bMobile && oColumnListItem.getCells()[0].getItems[1].getVisible() == false) {
|
|
736
|
+
return;
|
|
737
|
+
}
|
|
741
738
|
|
|
742
739
|
if (!bMobile && !oColumnListItem.getCells()[1].getVisible()) {
|
|
743
|
-
|
|
740
|
+
return;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
//Select correct role if selected
|
|
744
|
+
this.waitFor({
|
|
745
|
+
controlType: "sap.m.Select",
|
|
746
|
+
matchers: new Ancestor(oColumnListItem),
|
|
747
|
+
actions: function(oSelect) {
|
|
748
|
+
iChangeSelectSelection.call(this, oSelect, oItem.role);
|
|
749
|
+
}.bind(this)
|
|
750
|
+
});
|
|
744
751
|
}
|
|
752
|
+
}.bind(this)
|
|
753
|
+
});
|
|
754
|
+
}.bind(this),
|
|
755
|
+
success: function() {
|
|
756
|
+
iPressTheOKButtonOnTheDialog.call(this, oP13nDialog);
|
|
757
|
+
}
|
|
758
|
+
});
|
|
759
|
+
};
|
|
745
760
|
|
|
746
|
-
//Select correct role if selected
|
|
747
|
-
this.waitFor({
|
|
748
|
-
controlType: "sap.m.Select",
|
|
749
|
-
matchers: new Ancestor(oColumnListItem),
|
|
750
|
-
actions: function(oSelect) {
|
|
751
|
-
iChangeSelectSelection.call(this, oSelect, oItem.role);
|
|
752
|
-
}.bind(this)
|
|
753
|
-
});
|
|
754
|
-
}
|
|
755
|
-
}.bind(this)
|
|
756
|
-
});
|
|
757
|
-
}.bind(this)
|
|
758
|
-
});
|
|
759
761
|
|
|
760
|
-
|
|
762
|
+
if (aItemsToRemoveIds.length != 0){
|
|
763
|
+
iClickOnChartP13nRemoveButton.call(this, aItemsToRemoveIds[0], oP13nDialog, aItemsToRemoveIds, fnAddAllItems, [aItems[0], aItems, fnAssignRoles]);
|
|
764
|
+
} else {
|
|
765
|
+
fnAddAllItems.call(this, aItems[0], aItems, fnAssignRoles);
|
|
766
|
+
}
|
|
761
767
|
}
|
|
762
768
|
});
|
|
763
769
|
}
|
|
@@ -972,7 +978,7 @@ sap.ui.define([
|
|
|
972
978
|
return iPersonalize.call(this, oControl, Util.texts.group, {
|
|
973
979
|
success: function(oP13nDialog) {
|
|
974
980
|
this.waitFor({
|
|
975
|
-
controlType: (oP13nDialog.getContent()[0].getView("group") ? "sap.ui.mdc.p13n.panels.GroupPanel" : "sap.m.p13n.GroupPanel"
|
|
981
|
+
controlType: oP13nDialog.getContent()[0].getView("group") && oP13nDialog.getContent()[0].getView("group").getContent().isA("sap.ui.mdc.p13n.panels.GroupPanel") ? "sap.ui.mdc.p13n.panels.GroupPanel" : "sap.m.p13n.GroupPanel",
|
|
976
982
|
matchers: new Ancestor(oP13nDialog, false),
|
|
977
983
|
success: function(aGroupPanels) {
|
|
978
984
|
var oGroupPanel = aGroupPanels[0];
|
|
@@ -1014,7 +1020,7 @@ sap.ui.define([
|
|
|
1014
1020
|
return iPersonalize.call(this, oControl, Util.texts.sort, {
|
|
1015
1021
|
success: function(oP13nDialog) {
|
|
1016
1022
|
this.waitFor({
|
|
1017
|
-
controlType: oP13nDialog.getContent()[0].getView("sort") ? "sap.ui.mdc.p13n.panels.SortQueryPanel" : "sap.m.p13n.SortPanel",
|
|
1023
|
+
controlType: oP13nDialog.getContent()[0].getView("sort") && oP13nDialog.getContent()[0].getView("sort").getContent().isA("sap.ui.mdc.p13n.panels.SortQueryPanel") ? "sap.ui.mdc.p13n.panels.SortQueryPanel" : "sap.m.p13n.SortPanel",
|
|
1018
1024
|
matchers: new Ancestor(oP13nDialog, false),
|
|
1019
1025
|
success: function(aSortPanels) {
|
|
1020
1026
|
var oSortPanel = aSortPanels[0];
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* ! OpenUI5
|
|
3
|
-
* (c) Copyright 2009-2021 SAP SE or an SAP affiliate company.
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
-
*/
|
|
6
|
-
sap.ui.define([
|
|
7
|
-
"./QueryPanel", "sap/m/HBox", "sap/m/CheckBox", "sap/ui/layout/Grid"
|
|
8
|
-
], function (QueryPanel, HBox, CheckBox, Grid) {
|
|
9
|
-
"use strict";
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Constructor for a new GroupPanel. The GroupPanel can be used
|
|
13
|
-
* to personalize groupings for a control by using a group specific QueryPanel
|
|
14
|
-
* implementation.
|
|
15
|
-
*
|
|
16
|
-
* @class
|
|
17
|
-
* @extends sap.ui.mdc.p13n.panels.QueryPanel
|
|
18
|
-
*
|
|
19
|
-
* @author SAP SE
|
|
20
|
-
* @version 1.96.2
|
|
21
|
-
*
|
|
22
|
-
* @private
|
|
23
|
-
* @ui5-restricted sap.ui.mdc
|
|
24
|
-
* @experimental
|
|
25
|
-
* @since 1.90
|
|
26
|
-
* @alias sap.ui.mdc.p13n.panels.GroupPanel
|
|
27
|
-
*/
|
|
28
|
-
var GroupPanel = QueryPanel.extend("sap.ui.mdc.p13n.panels.GroupPanel", {
|
|
29
|
-
metadata: {
|
|
30
|
-
properties: {
|
|
31
|
-
enableShowField: {
|
|
32
|
-
type: "boolean",
|
|
33
|
-
defaultValue: false
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
renderer: {}
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
GroupPanel.prototype._createQueryRowGrid = function(oItem) {
|
|
41
|
-
var sKey = oItem.name;
|
|
42
|
-
var oSelect = this._createKeySelect(sKey);
|
|
43
|
-
|
|
44
|
-
var oGrid = new Grid({
|
|
45
|
-
containerQuery: true,
|
|
46
|
-
defaultSpan: this.getEnableShowField() ? "XL4 L4 M4 S4" : "XL6 L6 M6 S6",
|
|
47
|
-
content: [
|
|
48
|
-
oSelect
|
|
49
|
-
]
|
|
50
|
-
}).addStyleClass("sapUiTinyMargin");
|
|
51
|
-
|
|
52
|
-
if (this.getEnableShowField()){
|
|
53
|
-
var oCheckBox = this._createCheckBox(oItem);
|
|
54
|
-
oGrid.addContent(oCheckBox);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return oGrid;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
GroupPanel.prototype._createCheckBox = function(oItem) {
|
|
61
|
-
var sKey = oItem.name;
|
|
62
|
-
var oCheckBox = new HBox({
|
|
63
|
-
alignItems: "Center",
|
|
64
|
-
items: [
|
|
65
|
-
new CheckBox({
|
|
66
|
-
enabled: sKey ? true : false,
|
|
67
|
-
selected: oItem.hasOwnProperty("showIfGrouped") ? oItem.showIfGrouped : true,
|
|
68
|
-
select: function(oEvt) {
|
|
69
|
-
var oPanel = oEvt.getSource().getParent().getParent().getParent().getParent().getParent().getParent();
|
|
70
|
-
var sKey = oEvt.oSource.getParent().getParent().getContent()[0].getSelectedItem().getKey();
|
|
71
|
-
this._changeShowIfGrouped(sKey, oEvt.getParameter("selected"));
|
|
72
|
-
oPanel.fireChange({
|
|
73
|
-
reason: "change",
|
|
74
|
-
item: {
|
|
75
|
-
name: sKey,
|
|
76
|
-
grouped: true,
|
|
77
|
-
showIfGrouped: oEvt.getParameter("selected")
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
}.bind(this),
|
|
81
|
-
text: this.getResourceText("group.PERSONALIZATION_GROUP_CHECKBOX")
|
|
82
|
-
})
|
|
83
|
-
]
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
return oCheckBox;
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
GroupPanel.prototype._changeShowIfGrouped = function (sKey, bShow) {
|
|
90
|
-
var aItems = this.getP13nModel().getProperty("/items").filter(function (oItem) {
|
|
91
|
-
return oItem.name === sKey;
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
aItems[0].showIfGrouped = bShow;
|
|
95
|
-
|
|
96
|
-
this.fireChange({
|
|
97
|
-
reason: "change",
|
|
98
|
-
item: aItems[0]
|
|
99
|
-
});
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
GroupPanel.prototype._selectKey = function(oEvt) {
|
|
103
|
-
QueryPanel.prototype._selectKey.apply(this, arguments);
|
|
104
|
-
//Enable CheckBox
|
|
105
|
-
var oListItem = oEvt.getSource().getParent().getParent();
|
|
106
|
-
var sNewKey = oEvt.getParameter("selectedItem").getKey();
|
|
107
|
-
oListItem.getContent()[0].getContent()[1].getItems()[0].setEnabled(sNewKey !== this.NONE_KEY);
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
return GroupPanel;
|
|
111
|
-
});
|
|
@@ -1,322 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* ! OpenUI5
|
|
3
|
-
* (c) Copyright 2009-2021 SAP SE or an SAP affiliate company.
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
-
*/
|
|
6
|
-
sap.ui.define([
|
|
7
|
-
"sap/ui/layout/Grid", "./BasePanel", "sap/ui/core/Item", "sap/m/CustomListItem", "sap/m/Select", "sap/m/List", "sap/m/HBox", "sap/m/library", "sap/m/Button"
|
|
8
|
-
], function (Grid, BasePanel, Item, CustomListItem, Select, List, HBox, mLibrary, Button) {
|
|
9
|
-
"use strict";
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Constructor for a new QueryPanel. The QueryPanel can be used
|
|
13
|
-
* to show personalization content by selecting a key from a dropdown
|
|
14
|
-
* to create new key specific personalizations which can be reordered
|
|
15
|
-
* and deleted by the user.
|
|
16
|
-
*
|
|
17
|
-
* @class
|
|
18
|
-
* @extends sap.ui.mdc.p13n.panels.BasePanel
|
|
19
|
-
*
|
|
20
|
-
* @author SAP SE
|
|
21
|
-
* @version 1.96.2
|
|
22
|
-
*
|
|
23
|
-
* @private
|
|
24
|
-
* @ui5-restricted sap.ui.mdc
|
|
25
|
-
* @experimental
|
|
26
|
-
* @since 1.90
|
|
27
|
-
* @alias sap.ui.mdc.p13n.panels.QueryPanel
|
|
28
|
-
*/
|
|
29
|
-
var QueryPanel = BasePanel.extend("sap.ui.mdc.p13n.panels.QueryPanel", {
|
|
30
|
-
metadata: {
|
|
31
|
-
library: "sap.ui.mdc",
|
|
32
|
-
properties: {
|
|
33
|
-
queryLimit: {
|
|
34
|
-
type: "int",
|
|
35
|
-
defaultValue: -1 //unlimited queries
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
renderer: {}
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
// shortcut for sap.m.ListType
|
|
43
|
-
var ListItemType = mLibrary.ListType;
|
|
44
|
-
|
|
45
|
-
// shortcut for sap.m.FlexJustifyContent
|
|
46
|
-
var FlexJustifyContent = mLibrary.FlexJustifyContent;
|
|
47
|
-
|
|
48
|
-
// shortcut for sap.m.ButtonType
|
|
49
|
-
var ButtonType = mLibrary.ButtonType;
|
|
50
|
-
|
|
51
|
-
QueryPanel.prototype.NONE_KEY = "$_none";
|
|
52
|
-
|
|
53
|
-
QueryPanel.prototype.init = function () {
|
|
54
|
-
BasePanel.prototype.init.apply(this, arguments);
|
|
55
|
-
this.setEnableReorder(true);
|
|
56
|
-
this.addStyleClass("sapUiMDCP13nQueryPanel");
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
QueryPanel.prototype.setP13nModel = function (oModel) {
|
|
60
|
-
BasePanel.prototype.setP13nModel.apply(this, arguments);
|
|
61
|
-
|
|
62
|
-
this._oListControl.removeAllItems();
|
|
63
|
-
|
|
64
|
-
//Add rows for grouped items
|
|
65
|
-
oModel.getProperty("/items").forEach(function (oItem) {
|
|
66
|
-
if (oItem[this._getPresenceAttribute()]) {
|
|
67
|
-
this._addQueryRow(oItem);
|
|
68
|
-
}
|
|
69
|
-
}.bind(this));
|
|
70
|
-
|
|
71
|
-
this._addQueryRow();
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
QueryPanel.prototype._moveTableItem = function (oItem, iNewIndex) {
|
|
75
|
-
this._oListControl.removeItem(oItem);
|
|
76
|
-
this._oListControl.insertItem(oItem, iNewIndex);
|
|
77
|
-
|
|
78
|
-
this._updateEnableOfMoveButtons(oItem, false);
|
|
79
|
-
|
|
80
|
-
this.fireChange({
|
|
81
|
-
reason: "Move",
|
|
82
|
-
item: this._getModelEntryForRow(oItem)
|
|
83
|
-
});
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
QueryPanel.prototype._updateEnableOfMoveButtons = function(oTableItem, bFocus) {
|
|
87
|
-
BasePanel.prototype._updateEnableOfMoveButtons.apply(this, arguments);
|
|
88
|
-
|
|
89
|
-
//The last item is always the "$_none" field, check if its the item before, if yes do not allow to reorder it below
|
|
90
|
-
if (this._oListControl.getItems().indexOf(oTableItem) === (this._oListControl.getItems().length - 2)) {
|
|
91
|
-
this._getMoveDownButton().setEnabled(false);
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
QueryPanel.prototype._createInnerListControl = function () {
|
|
96
|
-
return new List(this.getId() + "-innerP13nList", {
|
|
97
|
-
itemPress: [this._onItemPressed, this],
|
|
98
|
-
dragDropConfig: this._getDragDropConfig()
|
|
99
|
-
});
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
QueryPanel.prototype._getModelEntryForRow = function(oRow) {
|
|
103
|
-
var sKey = oRow.getContent()[0].getContent()[0]._key;
|
|
104
|
-
var oField = this.getP13nModel().getProperty("/items").find(function (o) {
|
|
105
|
-
return o.name == sKey;
|
|
106
|
-
});
|
|
107
|
-
return oField;
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
QueryPanel.prototype._getAvailableItems = function (sKey) {
|
|
111
|
-
var aItems = this.getP13nModel().getProperty("/items");
|
|
112
|
-
|
|
113
|
-
var aAvailableItems = [new Item({
|
|
114
|
-
key: this.NONE_KEY,
|
|
115
|
-
text: this.getResourceText("sort.PERSONALIZATION_DIALOG_OPTION_NONE"),
|
|
116
|
-
enabled: !sKey
|
|
117
|
-
})];
|
|
118
|
-
|
|
119
|
-
aItems.forEach(function (oNonPresent, iIndex) {
|
|
120
|
-
aAvailableItems.push(new Item({
|
|
121
|
-
key: oNonPresent.name,
|
|
122
|
-
tooltip: oNonPresent.tooltip,
|
|
123
|
-
text: oNonPresent.label,
|
|
124
|
-
enabled: {
|
|
125
|
-
path: this.P13N_MODEL + ">/items/" + iIndex + "/" + this._getPresenceAttribute(),
|
|
126
|
-
formatter: function(bQueried) {
|
|
127
|
-
return !bQueried; //Only enable the selection in case there is not yet a query present
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}));
|
|
131
|
-
}.bind(this));
|
|
132
|
-
|
|
133
|
-
return aAvailableItems;
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
QueryPanel.prototype._getMoveDownButton = function() {
|
|
137
|
-
var oMoveBtn = BasePanel.prototype._getMoveDownButton.apply(this, arguments);
|
|
138
|
-
oMoveBtn.setIcon("sap-icon://navigation-down-arrow");
|
|
139
|
-
return oMoveBtn;
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
QueryPanel.prototype._getMoveUpButton = function() {
|
|
143
|
-
var oMoveBtn = BasePanel.prototype._getMoveUpButton.apply(this, arguments);
|
|
144
|
-
oMoveBtn.setIcon("sap-icon://navigation-up-arrow");
|
|
145
|
-
return oMoveBtn;
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
QueryPanel.prototype.getP13nState = function () {
|
|
149
|
-
var aItems = [];
|
|
150
|
-
this._oListControl.getItems().forEach(function (oItem) {
|
|
151
|
-
|
|
152
|
-
var sKey = oItem.getContent()[0].getContent()[0]._key;
|
|
153
|
-
if (sKey) {
|
|
154
|
-
var oField = this.getP13nModel().getProperty("/items").find(function (o) {
|
|
155
|
-
return o.name == sKey;
|
|
156
|
-
});
|
|
157
|
-
aItems.push(Object.assign({}, oField));
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
}.bind(this));
|
|
161
|
-
return aItems;
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
QueryPanel.prototype._addQueryRow = function (oItem) {
|
|
165
|
-
|
|
166
|
-
if (this.getQueryLimit() > -1 && this.getQueryLimit() === this._oListControl.getItems().length) {
|
|
167
|
-
return;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
oItem = oItem ? oItem : {name: null, descending: null};
|
|
171
|
-
|
|
172
|
-
var oQueryRowGrid = this._createQueryRowGrid(oItem);
|
|
173
|
-
|
|
174
|
-
var oRow = new CustomListItem({
|
|
175
|
-
type: ListItemType.Active,
|
|
176
|
-
content: [
|
|
177
|
-
oQueryRowGrid
|
|
178
|
-
]
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
//We only need 'move' buttons if:
|
|
182
|
-
// 1) Reordering is enabled
|
|
183
|
-
// 2) At least 2 queries can be made
|
|
184
|
-
if (this.getEnableReorder() && (this.getQueryLimit() === -1 || this.getQueryLimit() > 1)){
|
|
185
|
-
this._addHover(oRow);
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
oRow.getContent()[0].getContent()[0]._key = oItem.name;
|
|
189
|
-
|
|
190
|
-
this._oListControl.addItem(oRow);
|
|
191
|
-
|
|
192
|
-
var bShowRemoveBtn = !!oItem.name;
|
|
193
|
-
var oRemoveButton = this._createRemoveButton(bShowRemoveBtn);
|
|
194
|
-
oRow.getContent()[0].addContent(oRemoveButton);
|
|
195
|
-
|
|
196
|
-
return oRow;
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
QueryPanel.prototype._createQueryRowGrid = function(oItem) {
|
|
200
|
-
var oSelect = this._createKeySelect(oItem.name);
|
|
201
|
-
return new Grid({
|
|
202
|
-
containerQuery: true,
|
|
203
|
-
defaultSpan: "XL6 L6 M6 S6",
|
|
204
|
-
content: [
|
|
205
|
-
oSelect
|
|
206
|
-
]
|
|
207
|
-
}).addStyleClass("sapUiTinyMargin");
|
|
208
|
-
};
|
|
209
|
-
|
|
210
|
-
QueryPanel.prototype._handleActivated = function(oHoveredItem) {
|
|
211
|
-
var oQueryRow = oHoveredItem.getContent()[0];
|
|
212
|
-
if (oQueryRow) {
|
|
213
|
-
var iItemLength = oQueryRow.getContent().length - 1;
|
|
214
|
-
var oButtonBox = oHoveredItem.getContent()[0].getContent()[iItemLength];
|
|
215
|
-
|
|
216
|
-
//Only add the buttons if 1) an hovered item is provided 2) the buttons are not already there
|
|
217
|
-
if (oHoveredItem && oButtonBox.getItems().length < 2) {
|
|
218
|
-
oButtonBox.insertItem(this._getMoveUpButton(), 0);
|
|
219
|
-
oButtonBox.insertItem(this._getMoveDownButton(), 1);
|
|
220
|
-
this._updateEnableOfMoveButtons(oHoveredItem, false);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
};
|
|
224
|
-
|
|
225
|
-
QueryPanel.prototype._createKeySelect = function (sKey) {
|
|
226
|
-
var oKeySelect = new Select({
|
|
227
|
-
width: "14rem",
|
|
228
|
-
items: this._getAvailableItems(sKey),
|
|
229
|
-
selectedKey: sKey,
|
|
230
|
-
change: this._selectKey.bind(this)
|
|
231
|
-
});
|
|
232
|
-
|
|
233
|
-
return oKeySelect;
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
QueryPanel.prototype._selectKey = function(oEvt) {
|
|
237
|
-
|
|
238
|
-
var oListItem = oEvt.getSource().getParent().getParent();
|
|
239
|
-
|
|
240
|
-
var bIsLastRow = this._oListControl.getItems().length - 1 == this._oListControl.getItems().indexOf(oListItem);
|
|
241
|
-
var sNewKey = oEvt.getParameter("selectedItem").getKey();
|
|
242
|
-
var sOldKey = oEvt.getSource()._key;
|
|
243
|
-
|
|
244
|
-
var oBtnContainer = oListItem.getContent()[0].getContent()[oListItem.getContent()[0].getContent().length - 1];
|
|
245
|
-
//var oRemoveBtn = oBtnContainer.getItems()[oBtnContainer.getItems().length - 1];
|
|
246
|
-
|
|
247
|
-
oBtnContainer.setVisible(sNewKey !== this.NONE_KEY);
|
|
248
|
-
|
|
249
|
-
//Remove previous sorter
|
|
250
|
-
if (sOldKey) {
|
|
251
|
-
this._updatePresence(sOldKey, false);
|
|
252
|
-
}
|
|
253
|
-
//store old key
|
|
254
|
-
oEvt.getSource()._key = sNewKey;
|
|
255
|
-
|
|
256
|
-
//add new sorter
|
|
257
|
-
this._updatePresence(sNewKey, true);
|
|
258
|
-
|
|
259
|
-
//Add a new row in case the last "empty" row has been configured
|
|
260
|
-
if (sNewKey !== this.NONE_KEY && bIsLastRow) {
|
|
261
|
-
this._addQueryRow();
|
|
262
|
-
var oSelect = oEvt.getSource();
|
|
263
|
-
var oNoneItem = oSelect.getItemByKey(this.NONE_KEY);
|
|
264
|
-
oNoneItem.setEnabled(false);
|
|
265
|
-
}
|
|
266
|
-
};
|
|
267
|
-
|
|
268
|
-
QueryPanel.prototype._createRemoveButton = function (bVisible) {
|
|
269
|
-
var oRemoveBox = new HBox({
|
|
270
|
-
justifyContent: FlexJustifyContent.End,
|
|
271
|
-
width: "100%",
|
|
272
|
-
visible: bVisible,
|
|
273
|
-
items: [
|
|
274
|
-
new Button({
|
|
275
|
-
type: ButtonType.Transparent,
|
|
276
|
-
icon: "sap-icon://decline",
|
|
277
|
-
press: function (oEvt) {
|
|
278
|
-
var oRow = oEvt.getSource().getParent().getParent().getParent();
|
|
279
|
-
this._oListControl.removeItem(oRow);
|
|
280
|
-
this._updatePresence(oRow.getContent()[0].getContent()[0]._key, false);
|
|
281
|
-
if (this._oListControl.getItems().length === 0) {
|
|
282
|
-
this._addQueryRow();
|
|
283
|
-
} else {
|
|
284
|
-
//In case an item has been removed, focus the Select control of the new 'none' row
|
|
285
|
-
var iLastIndex = this._oListControl.getItems().length - 1;
|
|
286
|
-
this._oListControl.getItems()[iLastIndex].getContent()[0].getContent()[0].focus();
|
|
287
|
-
}
|
|
288
|
-
}.bind(this)
|
|
289
|
-
})
|
|
290
|
-
]
|
|
291
|
-
});
|
|
292
|
-
|
|
293
|
-
return oRemoveBox;
|
|
294
|
-
};
|
|
295
|
-
|
|
296
|
-
QueryPanel.prototype._moveSelectedItem = function(){
|
|
297
|
-
this._oSelectedItem = this._getMoveUpButton().getParent().getParent().getParent();
|
|
298
|
-
BasePanel.prototype._moveSelectedItem.apply(this, arguments);
|
|
299
|
-
};
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
QueryPanel.prototype._updatePresence = function (sKey, bAdd, sOldKey) {
|
|
303
|
-
var aItems = this.getP13nModel().getProperty("/items");
|
|
304
|
-
var aRelevant = aItems.filter(function (oItem) {
|
|
305
|
-
return oItem.name === sKey;
|
|
306
|
-
});
|
|
307
|
-
|
|
308
|
-
if (aRelevant[0]) {
|
|
309
|
-
aRelevant[0][this._getPresenceAttribute()] = bAdd;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
this.getP13nModel().setProperty("/items", aItems);
|
|
313
|
-
|
|
314
|
-
this.fireChange({
|
|
315
|
-
reason: bAdd ? "Add" : "Remove",
|
|
316
|
-
item: aRelevant[0]
|
|
317
|
-
});
|
|
318
|
-
};
|
|
319
|
-
|
|
320
|
-
return QueryPanel;
|
|
321
|
-
|
|
322
|
-
});
|