@sapui5/sap.fe.templates 1.101.0 → 1.103.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/package.json +1 -1
- package/src/sap/fe/templates/.library +1 -1
- package/src/sap/fe/templates/AnalyticalListPage/chart/FEChartDelegate.js +2 -2
- package/src/sap/fe/templates/AnalyticalListPage/chart/FEChartDelegate.ts +1 -1
- package/src/sap/fe/templates/Feedback.js +18 -18
- package/src/sap/fe/templates/Feedback.ts +12 -12
- package/src/sap/fe/templates/ListReport/ExtensionAPI.js +15 -15
- package/src/sap/fe/templates/ListReport/ExtensionAPI.ts +19 -16
- package/src/sap/fe/templates/ListReport/ListReport.view.xml +107 -58
- package/src/sap/fe/templates/ListReport/ListReportController.controller.js +180 -70
- package/src/sap/fe/templates/ListReport/ListReportController.controller.ts +191 -88
- package/src/sap/fe/templates/ListReport/ListReportTemplating.js +45 -0
- package/src/sap/fe/templates/ListReport/ListReportTemplating.ts +30 -0
- package/src/sap/fe/templates/ListReport/overrides/IntentBasedNavigation.js +1 -1
- package/src/sap/fe/templates/ListReport/overrides/IntentBasedNavigation.ts +2 -2
- package/src/sap/fe/templates/ListReport/overrides/Share.js +9 -7
- package/src/sap/fe/templates/ListReport/overrides/Share.ts +10 -10
- package/src/sap/fe/templates/ListReport/overrides/ViewState.js +13 -6
- package/src/sap/fe/templates/ListReport/overrides/ViewState.ts +17 -11
- package/src/sap/fe/templates/ListReport/view/fragments/MultipleMode.fragment.js +1 -1
- package/src/sap/fe/templates/ListReport/view/fragments/MultipleMode.fragment.ts +1 -1
- package/src/sap/fe/templates/ObjectPage/ExtensionAPI.js +12 -16
- package/src/sap/fe/templates/ObjectPage/ExtensionAPI.ts +17 -20
- package/src/sap/fe/templates/ObjectPage/ObjectPage.view.xml +167 -20
- package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.js +195 -206
- package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.ts +187 -229
- package/src/sap/fe/templates/ObjectPage/ObjectPageTemplating.js +861 -0
- package/src/sap/fe/templates/ObjectPage/ObjectPageTemplating.ts +822 -0
- package/src/sap/fe/templates/ObjectPage/controls/SubSectionBlock.js +2 -3
- package/src/sap/fe/templates/ObjectPage/controls/SubSectionBlock.ts +4 -4
- package/src/sap/fe/templates/ObjectPage/designtime/StashableHBox.designtime.js +1 -1
- package/src/sap/fe/templates/ObjectPage/designtime/StashableHBox.designtime.ts +1 -1
- package/src/sap/fe/templates/ObjectPage/designtime/StashableVBox.designtime.js +1 -1
- package/src/sap/fe/templates/ObjectPage/designtime/StashableVBox.designtime.ts +1 -1
- package/src/sap/fe/templates/ObjectPage/handler/DraftHandler.js +103 -0
- package/src/sap/fe/templates/ObjectPage/handler/DraftHandler.ts +97 -0
- package/src/sap/fe/templates/ObjectPage/overrides/IntentBasedNavigation.js +1 -1
- package/src/sap/fe/templates/ObjectPage/overrides/IntentBasedNavigation.ts +5 -5
- package/src/sap/fe/templates/ObjectPage/overrides/InternalRouting.js +1 -1
- package/src/sap/fe/templates/ObjectPage/overrides/InternalRouting.ts +2 -2
- package/src/sap/fe/templates/ObjectPage/overrides/MessageHandler.js +1 -1
- package/src/sap/fe/templates/ObjectPage/overrides/MessageHandler.ts +2 -2
- package/src/sap/fe/templates/ObjectPage/overrides/Paginator.js +1 -1
- package/src/sap/fe/templates/ObjectPage/overrides/Paginator.ts +1 -1
- package/src/sap/fe/templates/ObjectPage/overrides/Share.js +17 -17
- package/src/sap/fe/templates/ObjectPage/overrides/Share.ts +19 -30
- package/src/sap/fe/templates/ObjectPage/overrides/ViewState.js +2 -2
- package/src/sap/fe/templates/ObjectPage/overrides/ViewState.ts +4 -4
- package/src/sap/fe/templates/ObjectPage/view/fragments/Actions.fragment.xml +15 -11
- package/src/sap/fe/templates/ObjectPage/view/fragments/CollaborationDraft.fragment.xml +1 -2
- package/src/sap/fe/templates/ObjectPage/view/fragments/EditableHeaderFacet.fragment.xml +25 -17
- package/src/sap/fe/templates/ObjectPage/view/fragments/FooterContent.fragment.xml +28 -24
- package/src/sap/fe/templates/ObjectPage/view/fragments/FormActionButtons.fragment.xml +15 -16
- package/src/sap/fe/templates/ObjectPage/view/fragments/FormActions.fragment.xml +1 -5
- package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderDataPoint.fragment.xml +1 -2
- package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderDataPointTitle.fragment.xml +1 -3
- package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderFacet.fragment.xml +3 -17
- package/src/sap/fe/templates/ObjectPage/view/fragments/Heading.fragment.xml +16 -17
- package/src/sap/fe/templates/ObjectPage/view/fragments/HeadingTitle.fragment.xml +4 -3
- package/src/sap/fe/templates/ObjectPage/view/fragments/ObjectPageHeaderAddress.fragment.xml +7 -2
- package/src/sap/fe/templates/ObjectPage/view/fragments/ObjectPageHeaderContact.fragment.xml +26 -0
- package/src/sap/fe/templates/ObjectPage/view/fragments/ObjectPageHeaderForm.fragment.xml +4 -4
- package/src/sap/fe/templates/ObjectPage/view/fragments/RelatedApps.fragment.xml +7 -4
- package/src/sap/fe/templates/ObjectPage/view/fragments/Section.fragment.xml +74 -6
- package/src/sap/fe/templates/ObjectPage/view/fragments/SectionContent.fragment.xml +118 -94
- package/src/sap/fe/templates/ObjectPage/view/fragments/SectionContentLazyLoader.fragment.xml +127 -107
- package/src/sap/fe/templates/ObjectPage/view/fragments/SectionFormContent.fragment.xml +1 -0
- package/src/sap/fe/templates/ObjectPage/view/fragments/SectionMoreFormContent.fragment.xml +1 -0
- package/src/sap/fe/templates/ObjectPage/view/fragments/SwitchDraftAndActiveObjectPopOver.fragment.xml +2 -2
- package/src/sap/fe/templates/RootContainer/controller/Fcl.controller.js +102 -57
- package/src/sap/fe/templates/RootContainer/controller/Fcl.controller.ts +96 -61
- package/src/sap/fe/templates/RootContainer/controller/NavContainer.controller.js +3 -4
- package/src/sap/fe/templates/RootContainer/controller/NavContainer.controller.ts +4 -5
- package/src/sap/fe/templates/RootContainer/controller/RootContainerBaseController.js +140 -52
- package/src/sap/fe/templates/RootContainer/controller/RootContainerBaseController.ts +108 -54
- package/src/sap/fe/templates/RootContainer/overrides/EditFlow.js +1 -1
- package/src/sap/fe/templates/RootContainer/overrides/EditFlow.ts +3 -3
- package/src/sap/fe/templates/TableScroller.js +3 -3
- package/src/sap/fe/templates/TableScroller.ts +2 -2
- package/src/sap/fe/templates/controls/MacroChart.fragment.xml +1 -0
- package/src/sap/fe/templates/controls/Table.fragment.xml +4 -4
- package/src/sap/fe/templates/library.js +5 -2
- package/src/sap/fe/templates/library.ts +3 -0
- package/src/sap/fe/templates/messagebundle.properties +6 -18
- package/src/sap/fe/templates/messagebundle_ar.properties +10 -6
- package/src/sap/fe/templates/messagebundle_bg.properties +6 -2
- package/src/sap/fe/templates/messagebundle_ca.properties +10 -6
- package/src/sap/fe/templates/messagebundle_cs.properties +6 -2
- package/src/sap/fe/templates/messagebundle_cy.properties +10 -6
- package/src/sap/fe/templates/messagebundle_da.properties +10 -6
- package/src/sap/fe/templates/messagebundle_de.properties +10 -6
- package/src/sap/fe/templates/messagebundle_el.properties +10 -6
- package/src/sap/fe/templates/messagebundle_en.properties +6 -2
- package/src/sap/fe/templates/messagebundle_en_GB.properties +8 -4
- package/src/sap/fe/templates/messagebundle_en_US_sappsd.properties +13 -5
- package/src/sap/fe/templates/messagebundle_en_US_saprigi.properties +7 -3
- package/src/sap/fe/templates/messagebundle_en_US_saptrc.properties +7 -3
- package/src/sap/fe/templates/messagebundle_es.properties +6 -2
- package/src/sap/fe/templates/messagebundle_es_MX.properties +10 -6
- package/src/sap/fe/templates/messagebundle_et.properties +6 -2
- package/src/sap/fe/templates/messagebundle_fi.properties +10 -6
- package/src/sap/fe/templates/messagebundle_fr.properties +6 -2
- package/src/sap/fe/templates/messagebundle_fr_CA.properties +10 -6
- package/src/sap/fe/templates/messagebundle_hi.properties +10 -6
- package/src/sap/fe/templates/messagebundle_hr.properties +10 -6
- package/src/sap/fe/templates/messagebundle_hu.properties +6 -2
- package/src/sap/fe/templates/messagebundle_id.properties +6 -2
- package/src/sap/fe/templates/messagebundle_it.properties +10 -6
- package/src/sap/fe/templates/messagebundle_iw.properties +10 -6
- package/src/sap/fe/templates/messagebundle_ja.properties +6 -2
- package/src/sap/fe/templates/messagebundle_kk.properties +10 -6
- package/src/sap/fe/templates/messagebundle_ko.properties +6 -2
- package/src/sap/fe/templates/messagebundle_lt.properties +6 -2
- package/src/sap/fe/templates/messagebundle_lv.properties +6 -2
- package/src/sap/fe/templates/messagebundle_ms.properties +10 -6
- package/src/sap/fe/templates/messagebundle_nl.properties +6 -2
- package/src/sap/fe/templates/messagebundle_no.properties +10 -6
- package/src/sap/fe/templates/messagebundle_pl.properties +10 -6
- package/src/sap/fe/templates/messagebundle_pt.properties +6 -2
- package/src/sap/fe/templates/messagebundle_pt_PT.properties +6 -2
- package/src/sap/fe/templates/messagebundle_ro.properties +10 -6
- package/src/sap/fe/templates/messagebundle_ru.properties +10 -6
- package/src/sap/fe/templates/messagebundle_sh.properties +6 -2
- package/src/sap/fe/templates/messagebundle_sk.properties +6 -2
- package/src/sap/fe/templates/messagebundle_sl.properties +10 -6
- package/src/sap/fe/templates/messagebundle_sv.properties +6 -2
- package/src/sap/fe/templates/messagebundle_th.properties +10 -6
- package/src/sap/fe/templates/messagebundle_tr.properties +6 -2
- package/src/sap/fe/templates/messagebundle_uk.properties +6 -2
- package/src/sap/fe/templates/messagebundle_vi.properties +10 -6
- package/src/sap/fe/templates/messagebundle_zh_CN.properties +10 -6
- package/src/sap/fe/templates/messagebundle_zh_TW.properties +10 -6
- package/src/sap/fe/templates/ObjectPage/AnnotationHelper.js +0 -482
- package/src/sap/fe/templates/ObjectPage/AnnotationHelper.ts +0 -511
- package/src/sap/fe/templates/ObjectPage/templating/ObjectPageTemplating.js +0 -120
- package/src/sap/fe/templates/ObjectPage/templating/ObjectPageTemplating.ts +0 -138
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
// Formatters for the Object Page
|
|
2
|
-
import {
|
|
3
|
-
and,
|
|
4
|
-
ifElse,
|
|
5
|
-
isEmpty,
|
|
6
|
-
concat,
|
|
7
|
-
annotationExpression,
|
|
8
|
-
compileBinding,
|
|
9
|
-
BindingExpression
|
|
10
|
-
} from "sap/fe/core/helpers/BindingExpression";
|
|
11
|
-
import { UI, Draft, Entity } from "sap/fe/core/converters/helpers/BindingHelper";
|
|
12
|
-
import CommonUtils from "sap/fe/core/CommonUtils";
|
|
13
|
-
import { HeaderInfoType } from "@sap-ux/vocabularies-types";
|
|
14
|
-
import { DataModelObjectPath } from "sap/fe/core/templating/DataModelPathHelper";
|
|
15
|
-
import { addTextArrangementToBindingExpression, formatValueRecursively } from "sap/fe/macros/field/FieldTemplating";
|
|
16
|
-
import { DataFieldTypes } from "@sap-ux/vocabularies-types/dist/generated/UI";
|
|
17
|
-
import { isStickySessionSupported } from "sap/fe/core/templating/EntitySetHelper";
|
|
18
|
-
import ResourceBundle from "sap/base/i18n/ResourceBundle";
|
|
19
|
-
|
|
20
|
-
type ViewData = {
|
|
21
|
-
resourceBundle: ResourceBundle;
|
|
22
|
-
entitySet: string;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
//```mermaid
|
|
26
|
-
// graph TD
|
|
27
|
-
// A[Object Page Title] -->|Get DataField Value| C{Evaluate Create Mode}
|
|
28
|
-
// C -->|In Create Mode| D{Is DataField Value empty}
|
|
29
|
-
// D -->|Yes| F{Is there a TypeName}
|
|
30
|
-
// F -->|Yes| G[Is there an custom title]
|
|
31
|
-
// G -->|Yes| G1[Show the custom title + 'TypeName']
|
|
32
|
-
// G -->|No| G2[Display the default title 'New + TypeName']
|
|
33
|
-
// F -->|No| H[Is there a custom title]
|
|
34
|
-
// H -->|Yes| I[Show the custom title]
|
|
35
|
-
// H -->|No| J[Show the default 'Unamned Object']
|
|
36
|
-
// D -->|No| E
|
|
37
|
-
// C -->|Not in create mode| E[Show DataField Value]
|
|
38
|
-
// ```
|
|
39
|
-
/**
|
|
40
|
-
* Compute the title for the object page.
|
|
41
|
-
* @param oHeaderInfo The @UI.HeaderInfo annotation content
|
|
42
|
-
* @param oViewData The view data object we're currently on
|
|
43
|
-
* @param fullContextPath The full context path used to reach that object page
|
|
44
|
-
* @param oDraftRoot
|
|
45
|
-
* @returns The binding expression for the object page title
|
|
46
|
-
*/
|
|
47
|
-
export const getExpressionForTitle = function(
|
|
48
|
-
oHeaderInfo: HeaderInfoType | undefined,
|
|
49
|
-
oViewData: ViewData,
|
|
50
|
-
fullContextPath: DataModelObjectPath,
|
|
51
|
-
oDraftRoot: Object | undefined
|
|
52
|
-
): BindingExpression<string> {
|
|
53
|
-
const titleNoHeaderInfo = CommonUtils.getTranslatedText("T_NEW_OBJECT", oViewData.resourceBundle, undefined, oViewData.entitySet);
|
|
54
|
-
|
|
55
|
-
const titleWithHeaderInfo = CommonUtils.getTranslatedText(
|
|
56
|
-
"T_ANNOTATION_HELPER_DEFAULT_OBJECT_PAGE_HEADER_TITLE",
|
|
57
|
-
oViewData.resourceBundle,
|
|
58
|
-
undefined,
|
|
59
|
-
oViewData.entitySet
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
const oEmptyHeaderInfoTitle =
|
|
63
|
-
oHeaderInfo?.Title === undefined || (oHeaderInfo?.Title as any) === "" || (oHeaderInfo?.Title as DataFieldTypes)?.Value === "";
|
|
64
|
-
|
|
65
|
-
const titleForActiveHeaderNoHeaderInfo = !oEmptyHeaderInfoTitle
|
|
66
|
-
? CommonUtils.getTranslatedText("T_ANNOTATION_HELPER_DEFAULT_OBJECT_PAGE_HEADER_TITLE_NO_HEADER_INFO", oViewData.resourceBundle)
|
|
67
|
-
: "";
|
|
68
|
-
|
|
69
|
-
let titleValueExpression = annotationExpression((oHeaderInfo?.Title as DataFieldTypes)?.Value);
|
|
70
|
-
if ((oHeaderInfo?.Title as DataFieldTypes)?.Value?.$target?.annotations?.Common?.Text?.annotations?.UI?.TextArrangement) {
|
|
71
|
-
// In case an explicit text arrangement was set we make use of it in the description as well
|
|
72
|
-
titleValueExpression = addTextArrangementToBindingExpression(titleValueExpression, fullContextPath);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
titleValueExpression = formatValueRecursively(titleValueExpression, fullContextPath);
|
|
76
|
-
|
|
77
|
-
// If there is a TypeName defined, show the default title 'New + TypeName', otherwise show the custom title or the default 'New object'
|
|
78
|
-
const createModeTitle = oHeaderInfo?.TypeName
|
|
79
|
-
? concat(titleWithHeaderInfo, ": ", annotationExpression(oHeaderInfo.TypeName.toString()))
|
|
80
|
-
: titleNoHeaderInfo;
|
|
81
|
-
const activeExpression = oDraftRoot ? Entity.IsActive : true;
|
|
82
|
-
|
|
83
|
-
return compileBinding(
|
|
84
|
-
ifElse(
|
|
85
|
-
// If Create Mode && Empty expression
|
|
86
|
-
and(UI.IsCreateMode, titleValueExpression && isEmpty(titleValueExpression)),
|
|
87
|
-
|
|
88
|
-
createModeTitle,
|
|
89
|
-
// Otherwise show the default expression
|
|
90
|
-
ifElse(
|
|
91
|
-
and(activeExpression, titleValueExpression && isEmpty(titleValueExpression)),
|
|
92
|
-
titleForActiveHeaderNoHeaderInfo,
|
|
93
|
-
titleValueExpression
|
|
94
|
-
)
|
|
95
|
-
)
|
|
96
|
-
);
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Retrieves the expression for the description of an object page.
|
|
101
|
-
*
|
|
102
|
-
* @param oHeaderInfo The @UI.HeaderInfo annotation content
|
|
103
|
-
* @param fullContextPath The full context path used to reach that object page
|
|
104
|
-
* @returns The binding expression for the object page description
|
|
105
|
-
*/
|
|
106
|
-
export const getExpressionForDescription = function(
|
|
107
|
-
oHeaderInfo: HeaderInfoType | undefined,
|
|
108
|
-
fullContextPath: DataModelObjectPath
|
|
109
|
-
): BindingExpression<string> {
|
|
110
|
-
let bindingExpression = annotationExpression((oHeaderInfo?.Description as DataFieldTypes)?.Value);
|
|
111
|
-
if ((oHeaderInfo?.Description as DataFieldTypes)?.Value?.$target?.annotations?.Common?.Text?.annotations?.UI?.TextArrangement) {
|
|
112
|
-
// In case an explicit text arrangement was set we make use of it in the description as well
|
|
113
|
-
bindingExpression = addTextArrangementToBindingExpression(bindingExpression, fullContextPath);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return compileBinding(formatValueRecursively(bindingExpression, fullContextPath));
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Return the expression for the save button.
|
|
121
|
-
*
|
|
122
|
-
* @param oViewData The current view data
|
|
123
|
-
* @param fullContextPath The path used up until here
|
|
124
|
-
* @returns The binding expression that shows the right save button text
|
|
125
|
-
*/
|
|
126
|
-
export const getExpressionForSaveButton = function(oViewData: ViewData, fullContextPath: DataModelObjectPath): BindingExpression<string> {
|
|
127
|
-
const saveButtonText = CommonUtils.getTranslatedText("T_OP_OBJECT_PAGE_SAVE", oViewData.resourceBundle);
|
|
128
|
-
const createButtonText = CommonUtils.getTranslatedText("T_OP_OBJECT_PAGE_CREATE", oViewData.resourceBundle);
|
|
129
|
-
let saveExpression;
|
|
130
|
-
if (isStickySessionSupported(fullContextPath.startingEntitySet)) {
|
|
131
|
-
// If we're in sticky mode AND the ui is in create mode, show Create, else show Save
|
|
132
|
-
saveExpression = ifElse(UI.IsCreateModeSticky, createButtonText, saveButtonText);
|
|
133
|
-
} else {
|
|
134
|
-
// If we're in draft AND the draft is a new object (!IsActiveEntity && !HasActiveEntity), show create, else show save
|
|
135
|
-
saveExpression = ifElse(Draft.IsNewObject, createButtonText, saveButtonText);
|
|
136
|
-
}
|
|
137
|
-
return compileBinding(saveExpression);
|
|
138
|
-
};
|