@sapui5/sap.fe.macros 1.99.2 → 1.99.3
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/package.json
CHANGED
|
@@ -16,7 +16,7 @@ sap.ui.define(
|
|
|
16
16
|
"sap/ui/Device",
|
|
17
17
|
"sap/m/library"
|
|
18
18
|
],
|
|
19
|
-
function(
|
|
19
|
+
function (
|
|
20
20
|
ResourceModel,
|
|
21
21
|
ODataModelAnnotationHelper,
|
|
22
22
|
Log,
|
|
@@ -31,7 +31,7 @@ sap.ui.define(
|
|
|
31
31
|
"use strict";
|
|
32
32
|
var ValueColor = mobilelibrary.ValueColor;
|
|
33
33
|
var Helper = {
|
|
34
|
-
getPathToKey: function(oCtx) {
|
|
34
|
+
getPathToKey: function (oCtx) {
|
|
35
35
|
return oCtx.getObject();
|
|
36
36
|
},
|
|
37
37
|
|
|
@@ -42,7 +42,7 @@ sap.ui.define(
|
|
|
42
42
|
* @param {object} oInterface Interface instance
|
|
43
43
|
* @returns {string|boolean} Returns true, false, or expression with path, for example "{= !${IsActiveEntity} }"
|
|
44
44
|
*/
|
|
45
|
-
isVisible: function(target, oInterface) {
|
|
45
|
+
isVisible: function (target, oInterface) {
|
|
46
46
|
var oModel = oInterface.context.getModel(),
|
|
47
47
|
sPropertyPath = oInterface.context.getPath(),
|
|
48
48
|
oAnnotations = oModel.getObject(sPropertyPath + "@"),
|
|
@@ -58,7 +58,7 @@ sap.ui.define(
|
|
|
58
58
|
* @param oInterface
|
|
59
59
|
* @returns {boolean} `true` if a dialog is needed
|
|
60
60
|
*/
|
|
61
|
-
isDialog: function(oActionContext, oInterface) {
|
|
61
|
+
isDialog: function (oActionContext, oInterface) {
|
|
62
62
|
var oModel = oInterface.context.getModel(),
|
|
63
63
|
sPropertyPath = oInterface.context.getPath(),
|
|
64
64
|
isCritical = oModel.getObject(sPropertyPath + "/@$ui5.overload@com.sap.vocabularies.Common.v1.IsActionCritical");
|
|
@@ -80,7 +80,7 @@ sap.ui.define(
|
|
|
80
80
|
* @param {object} oInterface Interface instance
|
|
81
81
|
* @returns {string} A Binding Expression to determine if a field should be editable or not.
|
|
82
82
|
*/
|
|
83
|
-
getParameterEditMode: function(target, oInterface) {
|
|
83
|
+
getParameterEditMode: function (target, oInterface) {
|
|
84
84
|
var oModel = oInterface.context.getModel(),
|
|
85
85
|
sPropertyPath = oInterface.context.getPath(),
|
|
86
86
|
oAnnotations = oModel.getObject(sPropertyPath + "@"),
|
|
@@ -129,13 +129,13 @@ sap.ui.define(
|
|
|
129
129
|
* @param oInterface
|
|
130
130
|
* @returns {string | undefined}
|
|
131
131
|
*/
|
|
132
|
-
getMetaPath: function(target, oInterface) {
|
|
132
|
+
getMetaPath: function (target, oInterface) {
|
|
133
133
|
return (oInterface && oInterface.context && oInterface.context.getPath()) || undefined;
|
|
134
134
|
},
|
|
135
|
-
isDesktop: function() {
|
|
135
|
+
isDesktop: function () {
|
|
136
136
|
return Device.system.desktop === true;
|
|
137
137
|
},
|
|
138
|
-
getTargetCollection: function(oContext, navCollection) {
|
|
138
|
+
getTargetCollection: function (oContext, navCollection) {
|
|
139
139
|
var sPath = oContext.getPath(),
|
|
140
140
|
aParts,
|
|
141
141
|
entitySet,
|
|
@@ -149,13 +149,10 @@ sap.ui.define(
|
|
|
149
149
|
if (oContext.getModel) {
|
|
150
150
|
sPath =
|
|
151
151
|
(oContext.getModel().getMetaPath && oContext.getModel().getMetaPath(sPath)) ||
|
|
152
|
-
oContext
|
|
153
|
-
.getModel()
|
|
154
|
-
.getMetaModel()
|
|
155
|
-
.getMetaPath(sPath);
|
|
152
|
+
oContext.getModel().getMetaModel().getMetaPath(sPath);
|
|
156
153
|
}
|
|
157
154
|
//Supporting sPath of any format, either '/<entitySet>/<navigationCollection>' <OR> '/<entitySet>/$Type/<navigationCollection>'
|
|
158
|
-
aParts = sPath.split("/").filter(function(sPart) {
|
|
155
|
+
aParts = sPath.split("/").filter(function (sPart) {
|
|
159
156
|
return sPart && sPart != "$Type";
|
|
160
157
|
}); //filter out empty strings and parts referring to '$Type'
|
|
161
158
|
entitySet = "/" + aParts[0];
|
|
@@ -166,7 +163,7 @@ sap.ui.define(
|
|
|
166
163
|
return entitySet + "/$NavigationPropertyBinding/" + navigationCollection; // used in gotoTargetEntitySet method in the same file
|
|
167
164
|
},
|
|
168
165
|
|
|
169
|
-
isPropertyFilterable: function(property, oInterface, oDataField) {
|
|
166
|
+
isPropertyFilterable: function (property, oInterface, oDataField) {
|
|
170
167
|
var oModel = oInterface.context.getModel(),
|
|
171
168
|
sPropertyPath = oInterface.context.getPath(),
|
|
172
169
|
// LoacationPath would be the prefix of sPropertyPath, example: sPropertyPath = '/Customer/Set/Name' -> sPropertyLocationPath = '/Customer/Set'
|
|
@@ -184,7 +181,7 @@ sap.ui.define(
|
|
|
184
181
|
return CommonUtils.isPropertyFilterable(oModel, sPropertyLocationPath, sProperty);
|
|
185
182
|
},
|
|
186
183
|
|
|
187
|
-
getLocationForPropertyPath: function(oModel, sPropertyPath) {
|
|
184
|
+
getLocationForPropertyPath: function (oModel, sPropertyPath) {
|
|
188
185
|
var iLength;
|
|
189
186
|
var sCollectionPath = sPropertyPath.slice(0, sPropertyPath.lastIndexOf("/"));
|
|
190
187
|
if (oModel.getObject(sCollectionPath + "/$kind") === "EntityContainer") {
|
|
@@ -193,7 +190,7 @@ sap.ui.define(
|
|
|
193
190
|
}
|
|
194
191
|
return sCollectionPath;
|
|
195
192
|
},
|
|
196
|
-
gotoActionParameter: function(oContext) {
|
|
193
|
+
gotoActionParameter: function (oContext) {
|
|
197
194
|
var sPath = oContext.getPath(),
|
|
198
195
|
sPropertyName = oContext.getObject(sPath + "/$Name");
|
|
199
196
|
var sContext;
|
|
@@ -216,7 +213,7 @@ sap.ui.define(
|
|
|
216
213
|
* @private
|
|
217
214
|
* @ui5-restricted
|
|
218
215
|
*/
|
|
219
|
-
getEntitySetName: function(oMetaModel, sEntityType) {
|
|
216
|
+
getEntitySetName: function (oMetaModel, sEntityType) {
|
|
220
217
|
var oEntityContainer = oMetaModel.getObject("/");
|
|
221
218
|
for (var key in oEntityContainer) {
|
|
222
219
|
if (typeof oEntityContainer[key] === "object" && oEntityContainer[key].$Type === sEntityType) {
|
|
@@ -240,7 +237,7 @@ sap.ui.define(
|
|
|
240
237
|
* @private
|
|
241
238
|
* @ui5-restricted
|
|
242
239
|
*/
|
|
243
|
-
getActionPath: function(oAction, bReturnOnlyPath, sActionName, bCheckStaticValue) {
|
|
240
|
+
getActionPath: function (oAction, bReturnOnlyPath, sActionName, bCheckStaticValue) {
|
|
244
241
|
var sContextPath = oAction.getPath().split("/@")[0];
|
|
245
242
|
|
|
246
243
|
sActionName = !sActionName ? oAction.getObject(oAction.getPath()) : sActionName;
|
|
@@ -286,7 +283,7 @@ sap.ui.define(
|
|
|
286
283
|
* @param {string} sPropertyPath The property path
|
|
287
284
|
* @returns {string|boolean} A runtime binding or fixed string value for Field true/false for Rating Indicator
|
|
288
285
|
*/
|
|
289
|
-
getEditMode: function(
|
|
286
|
+
getEditMode: function (
|
|
290
287
|
oAnnotations,
|
|
291
288
|
sDataFieldType,
|
|
292
289
|
oFieldControl,
|
|
@@ -488,7 +485,7 @@ sap.ui.define(
|
|
|
488
485
|
return sExpression;
|
|
489
486
|
},
|
|
490
487
|
|
|
491
|
-
getNavigationContext: function(oContext) {
|
|
488
|
+
getNavigationContext: function (oContext) {
|
|
492
489
|
return ODataModelAnnotationHelper.getNavigationPath(oContext.getPath());
|
|
493
490
|
},
|
|
494
491
|
|
|
@@ -503,9 +500,9 @@ sap.ui.define(
|
|
|
503
500
|
* @param bKeepProperty
|
|
504
501
|
* @returns {string} The navigation path
|
|
505
502
|
*/
|
|
506
|
-
getNavigationPath: function(sPropertyPath, bKeepProperty) {
|
|
503
|
+
getNavigationPath: function (sPropertyPath, bKeepProperty) {
|
|
507
504
|
var bStartsWithEntityType = sPropertyPath.startsWith("/");
|
|
508
|
-
var aParts = sPropertyPath.split("/").filter(function(part) {
|
|
505
|
+
var aParts = sPropertyPath.split("/").filter(function (part) {
|
|
509
506
|
return !!part;
|
|
510
507
|
});
|
|
511
508
|
if (bStartsWithEntityType) {
|
|
@@ -534,7 +531,7 @@ sap.ui.define(
|
|
|
534
531
|
* @private
|
|
535
532
|
* @ui5-restricted
|
|
536
533
|
**/
|
|
537
|
-
getActionContext: function(oAction) {
|
|
534
|
+
getActionContext: function (oAction) {
|
|
538
535
|
return Helper.getActionPath(oAction, true);
|
|
539
536
|
},
|
|
540
537
|
/**
|
|
@@ -551,7 +548,7 @@ sap.ui.define(
|
|
|
551
548
|
* @private
|
|
552
549
|
* @ui5-restricted
|
|
553
550
|
**/
|
|
554
|
-
getPathToBoundActionOverload: function(oAction) {
|
|
551
|
+
getPathToBoundActionOverload: function (oAction) {
|
|
555
552
|
var sPath = Helper.getActionPath(oAction, true);
|
|
556
553
|
return sPath + "/@$ui5.overload/0";
|
|
557
554
|
},
|
|
@@ -565,7 +562,7 @@ sap.ui.define(
|
|
|
565
562
|
* @param {boolean} bEscape Should the string be escaped beforehand
|
|
566
563
|
* @returns {string} - String with single quotes
|
|
567
564
|
**/
|
|
568
|
-
addSingleQuotes: function(sValue, bEscape) {
|
|
565
|
+
addSingleQuotes: function (sValue, bEscape) {
|
|
569
566
|
if (bEscape && sValue) {
|
|
570
567
|
sValue = this.escapeSingleQuotes(sValue);
|
|
571
568
|
}
|
|
@@ -580,7 +577,7 @@ sap.ui.define(
|
|
|
580
577
|
* @param {string} sValue Some string that needs escaping of single quotes
|
|
581
578
|
* @returns {string} - String with escaped single quotes
|
|
582
579
|
**/
|
|
583
|
-
escapeSingleQuotes: function(sValue) {
|
|
580
|
+
escapeSingleQuotes: function (sValue) {
|
|
584
581
|
return sValue.replace(/[']/g, "\\'");
|
|
585
582
|
},
|
|
586
583
|
|
|
@@ -593,7 +590,7 @@ sap.ui.define(
|
|
|
593
590
|
* @param {string} sFuncName Some string for the function name
|
|
594
591
|
* @returns {string} - Function string depends on arguments passed
|
|
595
592
|
**/
|
|
596
|
-
generateFunction: function(sFuncName) {
|
|
593
|
+
generateFunction: function (sFuncName) {
|
|
597
594
|
var sParams = "";
|
|
598
595
|
for (var i = 1; i < arguments.length; i++) {
|
|
599
596
|
sParams += arguments[i];
|
|
@@ -619,7 +616,7 @@ sap.ui.define(
|
|
|
619
616
|
*
|
|
620
617
|
*/
|
|
621
618
|
|
|
622
|
-
getHeaderDataPointLinkVisibility: function(sPath, bLink, bFieldVisibility) {
|
|
619
|
+
getHeaderDataPointLinkVisibility: function (sPath, bLink, bFieldVisibility) {
|
|
623
620
|
var sVisibilityExp;
|
|
624
621
|
if (bFieldVisibility) {
|
|
625
622
|
sVisibilityExp = bLink
|
|
@@ -641,7 +638,7 @@ sap.ui.define(
|
|
|
641
638
|
* @param {string} oParams Some object
|
|
642
639
|
* @returns {string} - Object string
|
|
643
640
|
**/
|
|
644
|
-
objectToString: function(oParams) {
|
|
641
|
+
objectToString: function (oParams) {
|
|
645
642
|
var iNumberOfKeys = Object.keys(oParams).length,
|
|
646
643
|
sParams = "";
|
|
647
644
|
|
|
@@ -669,7 +666,7 @@ sap.ui.define(
|
|
|
669
666
|
* @param {string} sExpression An expression with escape characters
|
|
670
667
|
* @returns {string} Expression string without escape characters or undefined
|
|
671
668
|
**/
|
|
672
|
-
removeEscapeCharacters: function(sExpression) {
|
|
669
|
+
removeEscapeCharacters: function (sExpression) {
|
|
673
670
|
return sExpression ? sExpression.replace(/\\?\\([{}])/g, "$1") : undefined;
|
|
674
671
|
},
|
|
675
672
|
|
|
@@ -679,7 +676,7 @@ sap.ui.define(
|
|
|
679
676
|
* @param {string} sStringified
|
|
680
677
|
* @returns {string} The updated string representation of the object
|
|
681
678
|
*/
|
|
682
|
-
stringifyObject: function(sStringified) {
|
|
679
|
+
stringifyObject: function (sStringified) {
|
|
683
680
|
if (!sStringified) {
|
|
684
681
|
return undefined;
|
|
685
682
|
} else {
|
|
@@ -704,7 +701,7 @@ sap.ui.define(
|
|
|
704
701
|
* @param {object} vData The data to stringify
|
|
705
702
|
* @returns {string} The string representation of the data.
|
|
706
703
|
*/
|
|
707
|
-
stringifyCustomData: function(vData) {
|
|
704
|
+
stringifyCustomData: function (vData) {
|
|
708
705
|
var oObject = {
|
|
709
706
|
ui5object: true
|
|
710
707
|
};
|
|
@@ -718,7 +715,7 @@ sap.ui.define(
|
|
|
718
715
|
* @param {object | string} vData The data to parse
|
|
719
716
|
* @returns {object} The result of the data parsing
|
|
720
717
|
*/
|
|
721
|
-
parseCustomData: function(vData) {
|
|
718
|
+
parseCustomData: function (vData) {
|
|
722
719
|
var vData = typeof vData === "string" ? JSON.parse(vData) : vData;
|
|
723
720
|
if ("customData" in vData) {
|
|
724
721
|
return vData["customData"];
|
|
@@ -732,7 +729,7 @@ sap.ui.define(
|
|
|
732
729
|
* @param {string} sEntityType The EntityType name
|
|
733
730
|
* @returns {object} The DraftAdministrativeData
|
|
734
731
|
*/
|
|
735
|
-
_getDraftAdministrativeDataType: function(oMetaModel, sEntityType) {
|
|
732
|
+
_getDraftAdministrativeDataType: function (oMetaModel, sEntityType) {
|
|
736
733
|
return oMetaModel.requestObject("/" + sEntityType + "/DraftAdministrativeData/");
|
|
737
734
|
},
|
|
738
735
|
/**
|
|
@@ -742,8 +739,8 @@ sap.ui.define(
|
|
|
742
739
|
* @param {string} sEntityType The EntityType name
|
|
743
740
|
* @returns {string} The Binding Expression for the draft popover
|
|
744
741
|
*/
|
|
745
|
-
getPopoverText: function(iContext, sEntityType) {
|
|
746
|
-
return Helper._getDraftAdministrativeDataType(iContext.getModel(), sEntityType).then(function(oDADEntityType) {
|
|
742
|
+
getPopoverText: function (iContext, sEntityType) {
|
|
743
|
+
return Helper._getDraftAdministrativeDataType(iContext.getModel(), sEntityType).then(function (oDADEntityType) {
|
|
747
744
|
var sBinding =
|
|
748
745
|
"{parts: [{path: 'HasDraftEntity', targetType: 'any'}, " +
|
|
749
746
|
//"{path: 'DraftAdministrativeData/LastChangeDateTime'}, " +
|
|
@@ -760,7 +757,7 @@ sap.ui.define(
|
|
|
760
757
|
return sBinding;
|
|
761
758
|
});
|
|
762
759
|
},
|
|
763
|
-
getContextPath: function(oValue, oInterface) {
|
|
760
|
+
getContextPath: function (oValue, oInterface) {
|
|
764
761
|
var sPath = oInterface && oInterface.context && oInterface.context.getPath();
|
|
765
762
|
return sPath[sPath.length - 1] === "/" ? sPath.slice(0, -1) : sPath;
|
|
766
763
|
},
|
|
@@ -770,7 +767,7 @@ sap.ui.define(
|
|
|
770
767
|
* @param sPresentationVariantPath
|
|
771
768
|
* @returns {string} Stringified JSON object
|
|
772
769
|
*/
|
|
773
|
-
getSortConditions: function(oPresentationVariant, sPresentationVariantPath) {
|
|
770
|
+
getSortConditions: function (oPresentationVariant, sPresentationVariantPath) {
|
|
774
771
|
if (
|
|
775
772
|
oPresentationVariant &&
|
|
776
773
|
this._isPresentationVariantAnnotation(sPresentationVariantPath) &&
|
|
@@ -779,7 +776,7 @@ sap.ui.define(
|
|
|
779
776
|
var aSortConditions = {
|
|
780
777
|
sorters: []
|
|
781
778
|
};
|
|
782
|
-
oPresentationVariant.SortOrder.forEach(function(oCondition) {
|
|
779
|
+
oPresentationVariant.SortOrder.forEach(function (oCondition) {
|
|
783
780
|
var oSorter = {};
|
|
784
781
|
oSorter.name = oCondition.Property.$PropertyPath;
|
|
785
782
|
oSorter.descending = !!oCondition.Descending;
|
|
@@ -789,13 +786,13 @@ sap.ui.define(
|
|
|
789
786
|
}
|
|
790
787
|
return undefined;
|
|
791
788
|
},
|
|
792
|
-
_isPresentationVariantAnnotation: function(sAnnotationPath) {
|
|
789
|
+
_isPresentationVariantAnnotation: function (sAnnotationPath) {
|
|
793
790
|
return (
|
|
794
791
|
sAnnotationPath.indexOf("@com.sap.vocabularies.UI.v1.PresentationVariant") > -1 ||
|
|
795
792
|
sAnnotationPath.indexOf("@com.sap.vocabularies.UI.v1.SelectionPresentationVariant") > -1
|
|
796
793
|
);
|
|
797
794
|
},
|
|
798
|
-
createPresentationPathContext: function(oPresentationContext) {
|
|
795
|
+
createPresentationPathContext: function (oPresentationContext) {
|
|
799
796
|
var aPaths = oPresentationContext.sPath.split("@") || [];
|
|
800
797
|
var oModel = oPresentationContext.getModel();
|
|
801
798
|
if (aPaths.length && aPaths[aPaths.length - 1].indexOf("com.sap.vocabularies.UI.v1.SelectionPresentationVariant") > -1) {
|
|
@@ -804,7 +801,7 @@ sap.ui.define(
|
|
|
804
801
|
}
|
|
805
802
|
return oModel.createBindingContext(oPresentationContext.sPath + "@sapui.name");
|
|
806
803
|
},
|
|
807
|
-
getPressHandlerForDataFieldForIBN: function(oDataField, sContext, bNavigateWithConfirmationDialog) {
|
|
804
|
+
getPressHandlerForDataFieldForIBN: function (oDataField, sContext, bNavigateWithConfirmationDialog) {
|
|
808
805
|
var mNavigationParameters = {
|
|
809
806
|
navigationContexts: sContext ? sContext : "${$source>/}.getBindingContext()"
|
|
810
807
|
};
|
|
@@ -827,11 +824,11 @@ sap.ui.define(
|
|
|
827
824
|
this.objectToString(mNavigationParameters)
|
|
828
825
|
);
|
|
829
826
|
},
|
|
830
|
-
getEntitySet: function(oContext) {
|
|
827
|
+
getEntitySet: function (oContext) {
|
|
831
828
|
var sPath = oContext.getPath();
|
|
832
829
|
return ModelHelper.getEntitySetPath(sPath);
|
|
833
830
|
},
|
|
834
|
-
_isRatingIndicator: function(oControl) {
|
|
831
|
+
_isRatingIndicator: function (oControl) {
|
|
835
832
|
if (oControl.isA("sap.fe.core.controls.FieldWrapper")) {
|
|
836
833
|
var vContentDisplay = Array.isArray(oControl.getContentDisplay())
|
|
837
834
|
? oControl.getContentDisplay()[0]
|
|
@@ -842,7 +839,7 @@ sap.ui.define(
|
|
|
842
839
|
}
|
|
843
840
|
return false;
|
|
844
841
|
},
|
|
845
|
-
_updateStyleClassForRatingIndicator: function(oFieldWrapper, bLast) {
|
|
842
|
+
_updateStyleClassForRatingIndicator: function (oFieldWrapper, bLast) {
|
|
846
843
|
var vContentDisplay = Array.isArray(oFieldWrapper.getContentDisplay())
|
|
847
844
|
? oFieldWrapper.getContentDisplay()[0]
|
|
848
845
|
: oFieldWrapper.getContentDisplay();
|
|
@@ -869,7 +866,7 @@ sap.ui.define(
|
|
|
869
866
|
* @param {*} sVisibleValue Either static boolean values or Array of path expressions for visibility of menu button.
|
|
870
867
|
* @returns {*} The binding expression determining the visibility of menu actions.
|
|
871
868
|
**/
|
|
872
|
-
handleVisibilityOfMenuActions: function(sVisibleValue) {
|
|
869
|
+
handleVisibilityOfMenuActions: function (sVisibleValue) {
|
|
873
870
|
var combinedConditions = [];
|
|
874
871
|
if (Array.isArray(sVisibleValue)) {
|
|
875
872
|
for (var i = 0; i < sVisibleValue.length; i++) {
|
|
@@ -921,7 +918,7 @@ sap.ui.define(
|
|
|
921
918
|
* @param {string} sDeviationHigh ExpressionBinding for Higher Deviation level
|
|
922
919
|
* @returns {string} Returns criticality calculation as expression binding
|
|
923
920
|
*/
|
|
924
|
-
getCriticalityCalculationBinding: function(
|
|
921
|
+
getCriticalityCalculationBinding: function (
|
|
925
922
|
sImprovementDirection,
|
|
926
923
|
sValue,
|
|
927
924
|
sDeviationLow,
|
|
@@ -1074,7 +1071,7 @@ sap.ui.define(
|
|
|
1074
1071
|
* @returns {sIndicator} Return the indicator for criticality
|
|
1075
1072
|
* @private
|
|
1076
1073
|
*/
|
|
1077
|
-
_getCriticalityFromEnum: function(sCriticality) {
|
|
1074
|
+
_getCriticalityFromEnum: function (sCriticality) {
|
|
1078
1075
|
var sIndicator;
|
|
1079
1076
|
if (sCriticality === "com.sap.vocabularies.UI.v1.CriticalityType/Negative") {
|
|
1080
1077
|
sIndicator = ValueColor.Error;
|
|
@@ -1087,11 +1084,11 @@ sap.ui.define(
|
|
|
1087
1084
|
}
|
|
1088
1085
|
return sIndicator;
|
|
1089
1086
|
},
|
|
1090
|
-
getValueCriticality: function(sDimension, aValueCriticality) {
|
|
1087
|
+
getValueCriticality: function (sDimension, aValueCriticality) {
|
|
1091
1088
|
var sResult,
|
|
1092
1089
|
aValues = [];
|
|
1093
1090
|
if (aValueCriticality && aValueCriticality.length > 0) {
|
|
1094
|
-
aValueCriticality.forEach(function(oVC) {
|
|
1091
|
+
aValueCriticality.forEach(function (oVC) {
|
|
1095
1092
|
if (oVC.Value && oVC.Criticality.$EnumMember) {
|
|
1096
1093
|
var sValue =
|
|
1097
1094
|
"${" +
|
|
@@ -1116,13 +1113,13 @@ sap.ui.define(
|
|
|
1116
1113
|
* @returns {string} MeasureAttribute index.
|
|
1117
1114
|
* @private
|
|
1118
1115
|
*/
|
|
1119
|
-
getMeasureAttributeIndex: function(iMeasure, oChartAnnotations) {
|
|
1116
|
+
getMeasureAttributeIndex: function (iMeasure, oChartAnnotations) {
|
|
1120
1117
|
var aMeasures = oChartAnnotations.Measures,
|
|
1121
1118
|
bMeasureAttributeExists,
|
|
1122
1119
|
aMeasureAttributes = oChartAnnotations.MeasureAttributes,
|
|
1123
1120
|
sMeasurePropertyPath = aMeasures && aMeasures[iMeasure] && aMeasures[iMeasure].$PropertyPath,
|
|
1124
1121
|
iMeasureAttribute = -1,
|
|
1125
|
-
fnCheckMeasure = function(sMeasure, oMeasureAttribute, index) {
|
|
1122
|
+
fnCheckMeasure = function (sMeasure, oMeasureAttribute, index) {
|
|
1126
1123
|
if ((oMeasureAttribute && oMeasureAttribute.Measure && oMeasureAttribute.Measure.$PropertyPath) === sMeasure) {
|
|
1127
1124
|
iMeasureAttribute = index;
|
|
1128
1125
|
return true;
|
|
@@ -1139,13 +1136,13 @@ sap.ui.define(
|
|
|
1139
1136
|
* @param {object} oContext Context to the measure annotation
|
|
1140
1137
|
* @returns {string} Path to the measureAttribute of the measure
|
|
1141
1138
|
*/
|
|
1142
|
-
getMeasureAttributeForMeasure: function(oContext) {
|
|
1139
|
+
getMeasureAttributeForMeasure: function (oContext) {
|
|
1143
1140
|
var oMetaModel = oContext.getModel(),
|
|
1144
1141
|
sMeasurePath = oContext.getPath(),
|
|
1145
1142
|
sChartAnnotationPath = sMeasurePath.substring(0, sMeasurePath.lastIndexOf("Measure")),
|
|
1146
1143
|
iMeasure = sMeasurePath.replace(/.*\//, "");
|
|
1147
1144
|
|
|
1148
|
-
return oMetaModel.requestObject(sChartAnnotationPath).then(function(oChartAnnotations) {
|
|
1145
|
+
return oMetaModel.requestObject(sChartAnnotationPath).then(function (oChartAnnotations) {
|
|
1149
1146
|
var aMeasureAttributes = oChartAnnotations.MeasureAttributes,
|
|
1150
1147
|
iMeasureAttribute = Helper.getMeasureAttributeIndex(iMeasure, oChartAnnotations);
|
|
1151
1148
|
var sMeasureAttributePath =
|
|
@@ -1164,7 +1161,7 @@ sap.ui.define(
|
|
|
1164
1161
|
* @param {object} oTableMetadata Table metadata for which draft support shall be checked
|
|
1165
1162
|
* @returns {boolean} Returns true if draft
|
|
1166
1163
|
*/
|
|
1167
|
-
isDraftParentEntityForContainment: function(oTargetCollectionContainsTarget, oTableMetadata) {
|
|
1164
|
+
isDraftParentEntityForContainment: function (oTargetCollectionContainsTarget, oTableMetadata) {
|
|
1168
1165
|
if (oTargetCollectionContainsTarget) {
|
|
1169
1166
|
if (oTableMetadata && oTableMetadata.parentEntitySet && oTableMetadata.parentEntitySet.sPath) {
|
|
1170
1167
|
var sParentEntitySetPath = oTableMetadata.parentEntitySet.sPath;
|
|
@@ -1194,7 +1191,7 @@ sap.ui.define(
|
|
|
1194
1191
|
* @param {object} dataElement The data that is currently being processed.
|
|
1195
1192
|
* @returns {string} The correct path according to the template.
|
|
1196
1193
|
**/
|
|
1197
|
-
getDataFromTemplate: function(dataElement) {
|
|
1194
|
+
getDataFromTemplate: function (dataElement) {
|
|
1198
1195
|
var splitPath = dataElement.getPath().split("/");
|
|
1199
1196
|
var dataKey = splitPath[splitPath.length - 1];
|
|
1200
1197
|
var connectedDataPath = "/" + splitPath.slice(1, -2).join("/") + "/@";
|
|
@@ -1206,7 +1203,12 @@ sap.ui.define(
|
|
|
1206
1203
|
var key = splitTemp[i].split("{")[1].trim();
|
|
1207
1204
|
tempArray.push(key);
|
|
1208
1205
|
}
|
|
1209
|
-
|
|
1206
|
+
Object.keys(connectedObject.Data).forEach(function (sKey) {
|
|
1207
|
+
if (sKey.startsWith("$")) {
|
|
1208
|
+
delete connectedObject.Data[sKey];
|
|
1209
|
+
}
|
|
1210
|
+
});
|
|
1211
|
+
var index = Object.keys(connectedObject.Data).indexOf(dataKey);
|
|
1210
1212
|
return "/" + splitPath.slice(1, -2).join("/") + "/Data/" + tempArray[index];
|
|
1211
1213
|
},
|
|
1212
1214
|
|
|
@@ -1219,7 +1221,7 @@ sap.ui.define(
|
|
|
1219
1221
|
* @param {object} element The element that is currently being processed.
|
|
1220
1222
|
* @returns {boolean} True or False (depending on the template index).
|
|
1221
1223
|
**/
|
|
1222
|
-
notLastIndex: function(target, element) {
|
|
1224
|
+
notLastIndex: function (target, element) {
|
|
1223
1225
|
var template = target.Template;
|
|
1224
1226
|
var splitTemp = template.split("}");
|
|
1225
1227
|
var tempArray = [];
|
|
@@ -1229,7 +1231,7 @@ sap.ui.define(
|
|
|
1229
1231
|
tempArray.push(dataKey);
|
|
1230
1232
|
}
|
|
1231
1233
|
|
|
1232
|
-
tempArray.forEach(function(template) {
|
|
1234
|
+
tempArray.forEach(function (template) {
|
|
1233
1235
|
if (target.Data[template] === element && tempArray.indexOf(template) !== tempArray.length - 1) {
|
|
1234
1236
|
isLastIndex = true;
|
|
1235
1237
|
}
|
|
@@ -1245,18 +1247,15 @@ sap.ui.define(
|
|
|
1245
1247
|
* @param {string} template The template string.
|
|
1246
1248
|
* @returns {string} The delimiter in the template string.
|
|
1247
1249
|
**/
|
|
1248
|
-
getDelimiter: function(template) {
|
|
1249
|
-
return template
|
|
1250
|
-
.split("}")[1]
|
|
1251
|
-
.split("{")[0]
|
|
1252
|
-
.trim();
|
|
1250
|
+
getDelimiter: function (template) {
|
|
1251
|
+
return template.split("}")[1].split("{")[0].trim();
|
|
1253
1252
|
},
|
|
1254
1253
|
|
|
1255
|
-
setMetaModel: function(oMetaModel) {
|
|
1254
|
+
setMetaModel: function (oMetaModel) {
|
|
1256
1255
|
this.oMetaModel = oMetaModel;
|
|
1257
1256
|
},
|
|
1258
1257
|
|
|
1259
|
-
getMetaModel: function(oContext, oInterface) {
|
|
1258
|
+
getMetaModel: function (oContext, oInterface) {
|
|
1260
1259
|
if (oContext) {
|
|
1261
1260
|
var oMetaModel = oInterface.context.getModel();
|
|
1262
1261
|
return oMetaModel;
|
|
@@ -1264,7 +1263,7 @@ sap.ui.define(
|
|
|
1264
1263
|
return this.oMetaModel;
|
|
1265
1264
|
},
|
|
1266
1265
|
|
|
1267
|
-
getParameters: function(oContext, oInterface) {
|
|
1266
|
+
getParameters: function (oContext, oInterface) {
|
|
1268
1267
|
if (oContext) {
|
|
1269
1268
|
var oMetaModel = oInterface.context.getModel();
|
|
1270
1269
|
var sPath = oInterface.context.getPath();
|