@sap/ux-specification 1.120.57 → 1.120.59
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/CHANGELOG.md +41 -9
- package/dist/documentation/{runDocu-min.js → runDocu-min.mjs} +6 -6
- package/dist/documentation/{runDocu-min.js.map → runDocu-min.mjs.map} +2 -2
- package/dist/documentation/v2/v2-AnalyticalListPage.html +4 -4
- package/dist/documentation/v2/v2-ApplicationV2.html +4 -4
- package/dist/documentation/v2/v2-ListReport.html +4 -4
- package/dist/documentation/v2/v2-ListReportNew.html +4 -4
- package/dist/documentation/v2/v2-ObjectPage.html +4 -4
- package/dist/documentation/v2/v2-OverviewPage.html +4 -4
- package/dist/documentation/v4/v4-ApplicationV4.html +4 -4
- package/dist/documentation/v4/v4-BuildingBlocks.html +4 -4
- package/dist/documentation/v4/v4-FreestylePage.html +4 -4
- package/dist/documentation/v4/v4-ListReport.html +4 -4
- package/dist/documentation/v4/v4-ObjectPage.html +4 -4
- package/dist/index-min.mjs +1302 -0
- package/dist/index-min.mjs.map +7 -0
- package/dist/schemas/v2/ListReportNewConfig.json +143 -0
- package/dist/schemas/v4/BuildingBlocksConfig.json +16 -4
- package/dist/specification/package.json +17 -11
- package/dist/specification/scripts/macros/corrections.d.ts.map +1 -1
- package/dist/specification/scripts/macros/corrections.js +35 -3
- package/dist/specification/scripts/macros/corrections.js.map +1 -1
- package/dist/specification/scripts/macros/schema.d.ts +9 -0
- package/dist/specification/scripts/macros/schema.d.ts.map +1 -1
- package/dist/specification/scripts/macros/schema.js +21 -4
- package/dist/specification/scripts/macros/schema.js.map +1 -1
- package/dist/specification/scripts/schema/to-json-schema.js +1 -1
- package/dist/specification/scripts/schema/to-json-schema.js.map +1 -1
- package/dist/specification/src/ftfs/parser/model/ObjectAggregation.d.ts +21 -0
- package/dist/specification/src/ftfs/parser/model/ObjectAggregation.d.ts.map +1 -1
- package/dist/specification/src/ftfs/parser/model/ObjectAggregation.js +35 -0
- package/dist/specification/src/ftfs/parser/model/ObjectAggregation.js.map +1 -1
- package/dist/specification/src/ftfs/parser/model/TreeModel.d.ts.map +1 -1
- package/dist/specification/src/ftfs/parser/model/TreeModel.js +3 -2
- package/dist/specification/src/ftfs/parser/model/TreeModel.js.map +1 -1
- package/dist/specification/src/ftfs/parser/model/actions/ActionAggregation.d.ts +0 -3
- package/dist/specification/src/ftfs/parser/model/actions/ActionAggregation.d.ts.map +1 -1
- package/dist/specification/src/ftfs/parser/model/actions/ActionAggregation.js +6 -4
- package/dist/specification/src/ftfs/parser/model/actions/ActionAggregation.js.map +1 -1
- package/dist/specification/src/ftfs/parser/model/actions/ActionGroupAggregation.d.ts +86 -0
- package/dist/specification/src/ftfs/parser/model/actions/ActionGroupAggregation.d.ts.map +1 -0
- package/dist/specification/src/ftfs/parser/model/actions/ActionGroupAggregation.js +139 -0
- package/dist/specification/src/ftfs/parser/model/actions/ActionGroupAggregation.js.map +1 -0
- package/dist/specification/src/ftfs/parser/model/actions/ActionsAggregation.d.ts +11 -52
- package/dist/specification/src/ftfs/parser/model/actions/ActionsAggregation.d.ts.map +1 -1
- package/dist/specification/src/ftfs/parser/model/actions/ActionsAggregation.js +15 -81
- package/dist/specification/src/ftfs/parser/model/actions/ActionsAggregation.js.map +1 -1
- package/dist/specification/src/ftfs/parser/model/actions/ActionsContainerAggregation.d.ts +46 -0
- package/dist/specification/src/ftfs/parser/model/actions/ActionsContainerAggregation.d.ts.map +1 -0
- package/dist/specification/src/ftfs/parser/model/actions/ActionsContainerAggregation.js +82 -0
- package/dist/specification/src/ftfs/parser/model/actions/ActionsContainerAggregation.js.map +1 -0
- package/dist/specification/src/ftfs/parser/model/actions/index.d.ts +2 -0
- package/dist/specification/src/ftfs/parser/model/actions/index.d.ts.map +1 -1
- package/dist/specification/src/ftfs/parser/model/actions/index.js +2 -0
- package/dist/specification/src/ftfs/parser/model/actions/index.js.map +1 -1
- package/dist/specification/src/i18n/i18n.js +35 -2
- package/dist/specification/src/i18n/i18n.js.map +1 -1
- package/dist/specification/src/sync/common/generate/utils.d.ts +8 -0
- package/dist/specification/src/sync/common/generate/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/common/generate/utils.js +56 -34
- package/dist/specification/src/sync/common/generate/utils.js.map +1 -1
- package/dist/specification/src/sync/common/utils.d.ts +9 -2
- package/dist/specification/src/sync/common/utils.d.ts.map +1 -1
- package/dist/specification/src/sync/common/utils.js +10 -0
- package/dist/specification/src/sync/common/utils.js.map +1 -1
- package/dist/specification/src/sync/v2/generate/stableIdUtils.d.ts +14 -1
- package/dist/specification/src/sync/v2/generate/stableIdUtils.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/generate/stableIdUtils.js +110 -0
- package/dist/specification/src/sync/v2/generate/stableIdUtils.js.map +1 -1
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/FilterBar.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/FilterBar.js +1 -1
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/FilterBar.js.map +1 -1
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/Table.d.ts +1 -0
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/Table.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/Table.js +4 -0
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/Table.js.map +1 -1
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/TableColumn.d.ts +32 -0
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/TableColumn.d.ts.map +1 -0
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/TableColumn.js +274 -0
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/TableColumn.js.map +1 -0
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/index.d.ts +1 -0
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/index.d.ts.map +1 -1
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/index.js +1 -0
- package/dist/specification/src/sync/v2/genericSchemaHandling/controls/index.js.map +1 -1
- package/dist/specification/src/sync/v4/export/fpmCustomPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/export/fpmCustomPage.js +141 -72
- package/dist/specification/src/sync/v4/export/fpmCustomPage.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/annotations.js +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/annotations.js.map +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/generator.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/generator.js +66 -4
- package/dist/specification/src/sync/v4/generate/fpm-custom-page/generator.js.map +1 -1
- package/dist/specification/src/sync/v4/import/pages/fpmCustomPage.d.ts.map +1 -1
- package/dist/specification/src/sync/v4/import/pages/fpmCustomPage.js +70 -19
- package/dist/specification/src/sync/v4/import/pages/fpmCustomPage.js.map +1 -1
- package/dist/templates/action/manifest.action-menu.json +10 -0
- package/dist/templates/action/manifest.action.json +13 -0
- package/dist/templates/app/Component.js +13 -0
- package/dist/templates/app/Component.ts +11 -0
- package/dist/templates/building-block/action/View.xml +30 -0
- package/dist/templates/building-block/chart/View.xml +9 -0
- package/dist/templates/building-block/common/manifest.json +7 -0
- package/dist/templates/building-block/custom-column/View.xml +5 -0
- package/dist/templates/building-block/custom-filter-field/View.xml +12 -0
- package/dist/templates/building-block/custom-form-field/View.xml +12 -0
- package/dist/templates/building-block/field/View.xml +8 -0
- package/dist/templates/building-block/filter-bar/View.xml +10 -0
- package/dist/templates/building-block/form/View.xml +4 -0
- package/dist/templates/building-block/page/View.xml +5 -0
- package/dist/templates/building-block/rich-text-editor/View.xml +3 -0
- package/dist/templates/building-block/rich-text-editor-button-groups/View.xml +18 -0
- package/dist/templates/building-block/table/View.xml +19 -0
- package/dist/templates/column/1.84/manifest.json +28 -0
- package/dist/templates/column/1.85/manifest.json +31 -0
- package/dist/templates/column/1.86/manifest.json +43 -0
- package/dist/templates/common/EventHandler.js +25 -0
- package/dist/templates/common/EventHandler.ts +28 -0
- package/dist/templates/common/Fragment.xml +3 -0
- package/dist/templates/common/FragmentWithForm.xml +7 -0
- package/dist/templates/common/FragmentWithVBox.xml +5 -0
- package/dist/templates/common/sap.fe.d.ts +43 -0
- package/dist/templates/controller-extension/Controller.js +18 -0
- package/dist/templates/controller-extension/Controller.ts +20 -0
- package/dist/templates/controller-extension/ControllerExtension.d.ts +11 -0
- package/dist/templates/controller-extension/manifest.json +14 -0
- package/dist/templates/field/manifest.json +32 -0
- package/dist/templates/filter/Controller.js +21 -0
- package/dist/templates/filter/Controller.ts +24 -0
- package/dist/templates/filter/fragment.xml +15 -0
- package/dist/templates/filter/manifest.json +12 -0
- package/dist/templates/header-section/1.85/manifest.json +43 -0
- package/dist/templates/header-section/1.86/manifest.json +45 -0
- package/dist/templates/page/custom/1.84/ext/Controller.js +45 -0
- package/dist/templates/page/custom/1.84/ext/Controller.ts +42 -0
- package/dist/templates/page/custom/1.84/ext/View.xml +6 -0
- package/dist/templates/page/custom/1.84/i18n/i18n.properties +2 -0
- package/dist/templates/page/custom/1.84/manifest.json +32 -0
- package/dist/templates/page/custom/1.94/ext/Controller.js +45 -0
- package/dist/templates/page/custom/1.94/ext/Controller.ts +42 -0
- package/dist/templates/page/custom/1.94/ext/View.xml +6 -0
- package/dist/templates/page/custom/1.94/i18n/i18n.properties +2 -0
- package/dist/templates/page/custom/1.94/manifest.json +33 -0
- package/dist/templates/page/custom/i18n/i18n.properties +2 -0
- package/dist/templates/page/list/manifest.json +20 -0
- package/dist/templates/page/object/manifest.json +33 -0
- package/dist/templates/section/1.85/manifest.json +33 -0
- package/dist/templates/section/1.86/manifest.json +32 -0
- package/dist/templates/subsection/1.85/manifest.json +37 -0
- package/dist/templates/subsection/1.86/manifest.json +36 -0
- package/dist/templates/view/ext/CustomViewWithTable.xml +3 -0
- package/dist/templates/view/manifest.json +41 -0
- package/package.json +17 -11
- package/dist/index-min.js +0 -649
- package/dist/index-min.js.map +0 -7
|
@@ -1,67 +1,26 @@
|
|
|
1
1
|
import type { JSONSchema4 } from 'json-schema';
|
|
2
|
-
import type {
|
|
3
|
-
import { ObjectAggregation } from '../ObjectAggregation';
|
|
4
|
-
import type { PageEditAggregationData } from '../ObjectAggregation';
|
|
2
|
+
import type { ObjectAggregation, PageEditAggregationData } from '../ObjectAggregation';
|
|
5
3
|
import { AggregationCreationForm } from '../types';
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
export declare enum ActionType {
|
|
9
|
-
Annotation = "Annotation",
|
|
10
|
-
Copy = "Copy",
|
|
11
|
-
Criticality = "Criticality",
|
|
12
|
-
Custom = "Custom",
|
|
13
|
-
Standard = "Standard",
|
|
14
|
-
StandardWithoutAnnotation = "StandardWithoutAnnotation"
|
|
15
|
-
}
|
|
16
|
-
export interface ActionsContainers {
|
|
17
|
-
top: AllowedMoveRange;
|
|
18
|
-
bottom: AllowedMoveRange;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Represents an aggregation for actions container object.
|
|
22
|
-
*/
|
|
23
|
-
export declare class ActionsAggregation extends ObjectAggregation {
|
|
24
|
-
sortableList: boolean;
|
|
25
|
-
childClass: typeof ActionAggregation;
|
|
4
|
+
import { ActionsContainerAggregation } from './ActionsContainerAggregation';
|
|
5
|
+
export declare class ActionsAggregation extends ActionsContainerAggregation {
|
|
26
6
|
allowedAnnotationCreationForms: AggregationCreationForm[];
|
|
27
|
-
sortableCollection: string | undefined;
|
|
28
|
-
i18nKey: string;
|
|
29
7
|
/**
|
|
30
8
|
* Creates an instance of `ActionsAggregation`.
|
|
9
|
+
* Registers a custom creation form when the schema exposes `additionalProperties`
|
|
10
|
+
* and is not a pure aggregation type.
|
|
31
11
|
*
|
|
32
12
|
* @param data Optional aggregation data object used to initialize properties.
|
|
33
13
|
* @param schema Optional JSON schema fragment associated with this aggregation.
|
|
34
14
|
*/
|
|
35
15
|
constructor(data?: PageEditAggregationData, schema?: JSONSchema4);
|
|
36
16
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* @param name Name of aggregation.
|
|
41
|
-
* @param aggregation Aggregation to add.
|
|
42
|
-
* @param path Array of path to aggregation.
|
|
43
|
-
* @param order Order index.
|
|
44
|
-
* @param overwrite Overwrite existing aggregation.
|
|
45
|
-
* @returns Added aggregation.
|
|
46
|
-
*/
|
|
47
|
-
addAggregation(name: string, aggregation: ObjectAggregation, path: Parser.PropertyPath, order?: number, overwrite?: boolean): ObjectAggregation;
|
|
48
|
-
/**
|
|
49
|
-
* Overwritten method for data update of object page actions
|
|
50
|
-
* Method receives current values for actions and detects custom actions.
|
|
51
|
-
*
|
|
52
|
-
* @param data Data which should be used for value population.
|
|
53
|
-
* @param page Page config data.
|
|
54
|
-
* @param pageType Page type.
|
|
55
|
-
* @param path Aggregation path.
|
|
56
|
-
* @param annotations Annotations data.
|
|
57
|
-
*/
|
|
58
|
-
updatePropertiesValues(data: PageData, page: PageConfig, pageType: PageType, path: Parser.PropertyPath, annotations: PageAnnotations): void;
|
|
59
|
-
/**
|
|
60
|
-
* Method provides creation options based on its related annotation node.
|
|
17
|
+
* Resolves the child class to use when instantiating a nested action node.
|
|
18
|
+
* Returns `ActionGroupAggregation` for annotation-based action groups (`DataFieldForActionGroup`)
|
|
19
|
+
* and custom menu groups (`CustomMenu`); falls back to the default `childClass` otherwise.
|
|
61
20
|
*
|
|
62
|
-
* @param
|
|
63
|
-
* @returns
|
|
21
|
+
* @param schema - The JSON schema of the property being resolved.
|
|
22
|
+
* @returns The appropriate child class constructor, or `undefined` if none is defined.
|
|
64
23
|
*/
|
|
65
|
-
|
|
24
|
+
getChildClass(schema?: JSONSchema4): typeof ObjectAggregation | undefined;
|
|
66
25
|
}
|
|
67
26
|
//# sourceMappingURL=ActionsAggregation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionsAggregation.d.ts","sourceRoot":"","sources":["../../../../../../../src/ftfs/parser/model/actions/ActionsAggregation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"ActionsAggregation.d.ts","sourceRoot":"","sources":["../../../../../../../src/ftfs/parser/model/actions/ActionsAggregation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAwB,MAAM,UAAU,CAAC;AAEzE,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5E,qBAAa,kBAAmB,SAAQ,2BAA2B;IAC/D,8BAA8B,4BAAoF;IAElH;;;;;;;OAOG;gBACS,IAAI,CAAC,EAAE,uBAAuB,EAAE,MAAM,CAAC,EAAE,WAAW;IAehE;;;;;;;OAOG;IACI,aAAa,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,iBAAiB,GAAG,SAAS;CAMnF"}
|
|
@@ -1,36 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ActionsAggregation =
|
|
4
|
-
const ObjectAggregation_1 = require("../ObjectAggregation");
|
|
3
|
+
exports.ActionsAggregation = void 0;
|
|
5
4
|
const types_1 = require("../types");
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
(function (ActionType) {
|
|
10
|
-
ActionType["Annotation"] = "Annotation";
|
|
11
|
-
ActionType["Copy"] = "Copy";
|
|
12
|
-
ActionType["Criticality"] = "Criticality";
|
|
13
|
-
ActionType["Custom"] = "Custom";
|
|
14
|
-
ActionType["Standard"] = "Standard";
|
|
15
|
-
ActionType["StandardWithoutAnnotation"] = "StandardWithoutAnnotation";
|
|
16
|
-
})(ActionType || (exports.ActionType = ActionType = {}));
|
|
17
|
-
/**
|
|
18
|
-
* Represents an aggregation for actions container object.
|
|
19
|
-
*/
|
|
20
|
-
class ActionsAggregation extends ObjectAggregation_1.ObjectAggregation {
|
|
5
|
+
const ActionGroupAggregation_1 = require("./ActionGroupAggregation");
|
|
6
|
+
const ActionsContainerAggregation_1 = require("./ActionsContainerAggregation");
|
|
7
|
+
class ActionsAggregation extends ActionsContainerAggregation_1.ActionsContainerAggregation {
|
|
21
8
|
/**
|
|
22
9
|
* Creates an instance of `ActionsAggregation`.
|
|
10
|
+
* Registers a custom creation form when the schema exposes `additionalProperties`
|
|
11
|
+
* and is not a pure aggregation type.
|
|
23
12
|
*
|
|
24
13
|
* @param data Optional aggregation data object used to initialize properties.
|
|
25
14
|
* @param schema Optional JSON schema fragment associated with this aggregation.
|
|
26
15
|
*/
|
|
27
16
|
constructor(data, schema) {
|
|
28
17
|
super(data, schema);
|
|
29
|
-
this.sortableList = true;
|
|
30
|
-
this.childClass = ActionAggregation_1.ActionAggregation;
|
|
31
18
|
this.allowedAnnotationCreationForms = [types_1.AggregationCreationForm.NativeAction, types_1.AggregationCreationForm.NativeNavigation];
|
|
32
|
-
this.sortableCollection = 'actions';
|
|
33
|
-
this.i18nKey = 'ACTIONS';
|
|
34
19
|
// Custom creation form - check schema if supported
|
|
35
20
|
if (schema?.properties && this.schema?.additionalProperties && this.schema?.metadata?.type !== 'Aggregation') {
|
|
36
21
|
this.schemaCreationForms = [
|
|
@@ -44,69 +29,18 @@ class ActionsAggregation extends ObjectAggregation_1.ObjectAggregation {
|
|
|
44
29
|
}
|
|
45
30
|
}
|
|
46
31
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
32
|
+
* Resolves the child class to use when instantiating a nested action node.
|
|
33
|
+
* Returns `ActionGroupAggregation` for annotation-based action groups (`DataFieldForActionGroup`)
|
|
34
|
+
* and custom menu groups (`CustomMenu`); falls back to the default `childClass` otherwise.
|
|
49
35
|
*
|
|
50
|
-
* @param
|
|
51
|
-
* @
|
|
52
|
-
* @param path Array of path to aggregation.
|
|
53
|
-
* @param order Order index.
|
|
54
|
-
* @param overwrite Overwrite existing aggregation.
|
|
55
|
-
* @returns Added aggregation.
|
|
36
|
+
* @param schema - The JSON schema of the property being resolved.
|
|
37
|
+
* @returns The appropriate child class constructor, or `undefined` if none is defined.
|
|
56
38
|
*/
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
switch (aggregation.schema?.actionType) {
|
|
61
|
-
case ActionType.Standard: {
|
|
62
|
-
aggregation.markAsStandardAction();
|
|
63
|
-
break;
|
|
64
|
-
}
|
|
65
|
-
case ActionType.Copy: {
|
|
66
|
-
aggregation.sortableItem = types_1.SortingOptions.Readonly;
|
|
67
|
-
break;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return aggregation;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Overwritten method for data update of object page actions
|
|
75
|
-
* Method receives current values for actions and detects custom actions.
|
|
76
|
-
*
|
|
77
|
-
* @param data Data which should be used for value population.
|
|
78
|
-
* @param page Page config data.
|
|
79
|
-
* @param pageType Page type.
|
|
80
|
-
* @param path Aggregation path.
|
|
81
|
-
* @param annotations Annotations data.
|
|
82
|
-
*/
|
|
83
|
-
updatePropertiesValues(data, page, pageType, path, annotations) {
|
|
84
|
-
super.updatePropertiesValues(data, page, pageType, path, annotations);
|
|
85
|
-
this.formSchema = this.additionalProperties?.aggregations['actions'];
|
|
86
|
-
const actions = data || {};
|
|
87
|
-
for (const id in actions) {
|
|
88
|
-
const action = this.aggregations[id];
|
|
89
|
-
if (action?.name && action.schema?.actionType === 'Standard') {
|
|
90
|
-
action.markAsStandardAction();
|
|
91
|
-
}
|
|
92
|
-
else if (action?.schema && (action.schema.actionType === 'Custom' || !action.schema.annotationPath)) {
|
|
93
|
-
action.markAsCustomAction();
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Method provides creation options based on its related annotation node.
|
|
99
|
-
*
|
|
100
|
-
* @param annotations Page annotations.
|
|
101
|
-
* @returns Array of creation forms.
|
|
102
|
-
*/
|
|
103
|
-
getNativeNodeCreationForms(annotations) {
|
|
104
|
-
if (this.parent) {
|
|
105
|
-
if (this.parent.name === 'footer') {
|
|
106
|
-
this.allowedAnnotationCreationForms = [types_1.AggregationCreationForm.NativeAction];
|
|
107
|
-
}
|
|
39
|
+
getChildClass(schema) {
|
|
40
|
+
if (schema?.dataType === 'DataFieldForActionGroup' || schema?.actionType === 'CustomMenu') {
|
|
41
|
+
return ActionGroupAggregation_1.ActionGroupAggregation;
|
|
108
42
|
}
|
|
109
|
-
return
|
|
43
|
+
return this.childClass;
|
|
110
44
|
}
|
|
111
45
|
}
|
|
112
46
|
exports.ActionsAggregation = ActionsAggregation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionsAggregation.js","sourceRoot":"","sources":["../../../../../../../src/ftfs/parser/model/actions/ActionsAggregation.ts"],"names":[],"mappings":";;;AAEA,
|
|
1
|
+
{"version":3,"file":"ActionsAggregation.js","sourceRoot":"","sources":["../../../../../../../src/ftfs/parser/model/actions/ActionsAggregation.ts"],"names":[],"mappings":";;;AAEA,oCAAyE;AACzE,qEAAkE;AAClE,+EAA4E;AAE5E,MAAa,kBAAmB,SAAQ,yDAA2B;IAG/D;;;;;;;OAOG;IACH,YAAY,IAA8B,EAAE,MAAoB;QAC5D,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAXxB,mCAA8B,GAAG,CAAC,+BAAuB,CAAC,YAAY,EAAE,+BAAuB,CAAC,gBAAgB,CAAC,CAAC;QAY9G,mDAAmD;QACnD,IAAI,MAAM,EAAE,UAAU,IAAI,IAAI,CAAC,MAAM,EAAE,oBAAoB,IAAI,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,KAAK,aAAa,EAAE,CAAC;YAC3G,IAAI,CAAC,mBAAmB,GAAG;gBACvB;oBACI,IAAI,EAAE,+BAAuB,CAAC,YAAY;oBAC1C,IAAI,EAAE,4BAAoB;oBAC1B,KAAK,EAAE,8CAA8C;oBACrD,QAAQ,EAAE,KAAK;iBAClB;aACJ,CAAC;QACN,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACI,aAAa,CAAC,MAAoB;QACrC,IAAI,MAAM,EAAE,QAAQ,KAAK,yBAAyB,IAAI,MAAM,EAAE,UAAU,KAAK,YAAY,EAAE,CAAC;YACxF,OAAO,+CAAsB,CAAC;QAClC,CAAC;QACD,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;CACJ;AAxCD,gDAwCC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { JSONSchema4 } from 'json-schema';
|
|
2
|
+
import { type PageConfig, type PageType, type Parser } from '@sap/ux-specification-types';
|
|
3
|
+
import { ObjectAggregation } from '../ObjectAggregation';
|
|
4
|
+
import type { PageEditAggregationData } from '../ObjectAggregation';
|
|
5
|
+
import { AggregationCreationForm } from '../types';
|
|
6
|
+
import type { PageData, PageAnnotations } from '../types';
|
|
7
|
+
import { ActionAggregation } from './ActionAggregation';
|
|
8
|
+
export declare class ActionsContainerAggregation extends ObjectAggregation {
|
|
9
|
+
sortableList: boolean;
|
|
10
|
+
childClass: typeof ActionAggregation;
|
|
11
|
+
allowedAnnotationCreationForms: AggregationCreationForm[];
|
|
12
|
+
sortableCollection: string | undefined;
|
|
13
|
+
i18nKey: string;
|
|
14
|
+
isNestedContainer: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Creates an instance of `ActionsContainerAggregation`.
|
|
17
|
+
*
|
|
18
|
+
* @param data Optional aggregation data object used to initialize properties.
|
|
19
|
+
* @param schema Optional JSON schema fragment associated with this aggregation.
|
|
20
|
+
*/
|
|
21
|
+
constructor(data?: PageEditAggregationData, schema?: JSONSchema4);
|
|
22
|
+
/**
|
|
23
|
+
* Method adds aggregation object.
|
|
24
|
+
* Overwritten to mark standard action.
|
|
25
|
+
*
|
|
26
|
+
* @param name Name of aggregation.
|
|
27
|
+
* @param aggregation Aggregation to add.
|
|
28
|
+
* @param path Array of path to aggregation.
|
|
29
|
+
* @param order Order index.
|
|
30
|
+
* @param overwrite Overwrite existing aggregation.
|
|
31
|
+
* @returns Added aggregation.
|
|
32
|
+
*/
|
|
33
|
+
addAggregation(name: string, aggregation: ObjectAggregation, path: Parser.PropertyPath, order?: number, overwrite?: boolean): ObjectAggregation;
|
|
34
|
+
/**
|
|
35
|
+
* Overwritten method for data update of object page actions
|
|
36
|
+
* Method receives current values for actions and detects custom actions.
|
|
37
|
+
*
|
|
38
|
+
* @param data Data which should be used for value population.
|
|
39
|
+
* @param page Page config data.
|
|
40
|
+
* @param pageType Page type.
|
|
41
|
+
* @param path Aggregation path.
|
|
42
|
+
* @param annotations Annotations data.
|
|
43
|
+
*/
|
|
44
|
+
updatePropertiesValues(data: PageData, page: PageConfig, pageType: PageType, path: Parser.PropertyPath, annotations: PageAnnotations): void;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=ActionsContainerAggregation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionsContainerAggregation.d.ts","sourceRoot":"","sources":["../../../../../../../src/ftfs/parser/model/actions/ActionsContainerAggregation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAc,KAAK,UAAU,EAAE,KAAK,QAAQ,EAAE,KAAK,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACtG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAkB,MAAM,UAAU,CAAC;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,qBAAa,2BAA4B,SAAQ,iBAAiB;IAC9D,YAAY,UAAQ;IACpB,UAAU,2BAAqB;IAC/B,8BAA8B,4BAA0C;IACxE,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAa;IACnD,OAAO,SAAa;IACpB,iBAAiB,UAAS;IAE1B;;;;;OAKG;gBACS,IAAI,CAAC,EAAE,uBAAuB,EAAE,MAAM,CAAC,EAAE,WAAW;IAIhE;;;;;;;;;;OAUG;IACI,cAAc,CACjB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,iBAAiB,EAC9B,IAAI,EAAE,MAAM,CAAC,YAAY,EACzB,KAAK,CAAC,EAAE,MAAM,EACd,SAAS,CAAC,EAAE,OAAO,GACpB,iBAAiB;IAiBpB;;;;;;;;;OASG;IACI,sBAAsB,CACzB,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,MAAM,CAAC,YAAY,EACzB,WAAW,EAAE,eAAe,GAC7B,IAAI;CAoBV"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ActionsContainerAggregation = void 0;
|
|
4
|
+
const ux_specification_types_1 = require("@sap/ux-specification-types");
|
|
5
|
+
const ObjectAggregation_1 = require("../ObjectAggregation");
|
|
6
|
+
const types_1 = require("../types");
|
|
7
|
+
const ActionAggregation_1 = require("./ActionAggregation");
|
|
8
|
+
class ActionsContainerAggregation extends ObjectAggregation_1.ObjectAggregation {
|
|
9
|
+
/**
|
|
10
|
+
* Creates an instance of `ActionsContainerAggregation`.
|
|
11
|
+
*
|
|
12
|
+
* @param data Optional aggregation data object used to initialize properties.
|
|
13
|
+
* @param schema Optional JSON schema fragment associated with this aggregation.
|
|
14
|
+
*/
|
|
15
|
+
constructor(data, schema) {
|
|
16
|
+
super(data, schema);
|
|
17
|
+
this.sortableList = true;
|
|
18
|
+
this.childClass = ActionAggregation_1.ActionAggregation;
|
|
19
|
+
this.allowedAnnotationCreationForms = [types_1.AggregationCreationForm.NativeAction];
|
|
20
|
+
this.sortableCollection = 'actions';
|
|
21
|
+
this.i18nKey = 'ACTIONS';
|
|
22
|
+
this.isNestedContainer = false; // Whether container is nested in another container (e.g. actions container within action group )
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Method adds aggregation object.
|
|
26
|
+
* Overwritten to mark standard action.
|
|
27
|
+
*
|
|
28
|
+
* @param name Name of aggregation.
|
|
29
|
+
* @param aggregation Aggregation to add.
|
|
30
|
+
* @param path Array of path to aggregation.
|
|
31
|
+
* @param order Order index.
|
|
32
|
+
* @param overwrite Overwrite existing aggregation.
|
|
33
|
+
* @returns Added aggregation.
|
|
34
|
+
*/
|
|
35
|
+
addAggregation(name, aggregation, path, order, overwrite) {
|
|
36
|
+
aggregation = super.addAggregation(name, aggregation, path, order, overwrite);
|
|
37
|
+
if (aggregation instanceof ActionAggregation_1.ActionAggregation && aggregation.name) {
|
|
38
|
+
switch (aggregation.schema?.actionType) {
|
|
39
|
+
case ux_specification_types_1.ActionType.Standard: {
|
|
40
|
+
aggregation.markAsStandardAction();
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
case ux_specification_types_1.ActionType.Copy: {
|
|
44
|
+
aggregation.sortableItem = types_1.SortingOptions.Readonly;
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return aggregation;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Overwritten method for data update of object page actions
|
|
53
|
+
* Method receives current values for actions and detects custom actions.
|
|
54
|
+
*
|
|
55
|
+
* @param data Data which should be used for value population.
|
|
56
|
+
* @param page Page config data.
|
|
57
|
+
* @param pageType Page type.
|
|
58
|
+
* @param path Aggregation path.
|
|
59
|
+
* @param annotations Annotations data.
|
|
60
|
+
*/
|
|
61
|
+
updatePropertiesValues(data, page, pageType, path, annotations) {
|
|
62
|
+
super.updatePropertiesValues(data, page, pageType, path, annotations);
|
|
63
|
+
this.formSchema = this.additionalProperties?.aggregations['actions'];
|
|
64
|
+
const actions = data || {};
|
|
65
|
+
if (!actions['menu']) {
|
|
66
|
+
for (const id in actions) {
|
|
67
|
+
const action = this.aggregations[id];
|
|
68
|
+
if (action?.name && action.schema?.actionType === 'Standard') {
|
|
69
|
+
action.markAsStandardAction();
|
|
70
|
+
}
|
|
71
|
+
else if (action?.schema &&
|
|
72
|
+
'markAsCustomAction' in action &&
|
|
73
|
+
(action.schema.actionType === 'Custom' ||
|
|
74
|
+
(!action.schema.annotationPath && action.schema.actionType !== 'CustomMenu'))) {
|
|
75
|
+
action.markAsCustomAction();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.ActionsContainerAggregation = ActionsContainerAggregation;
|
|
82
|
+
//# sourceMappingURL=ActionsContainerAggregation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionsContainerAggregation.js","sourceRoot":"","sources":["../../../../../../../src/ftfs/parser/model/actions/ActionsContainerAggregation.ts"],"names":[],"mappings":";;;AACA,wEAAsG;AACtG,4DAAyD;AAEzD,oCAAmE;AAEnE,2DAAwD;AAExD,MAAa,2BAA4B,SAAQ,qCAAiB;IAQ9D;;;;;OAKG;IACH,YAAY,IAA8B,EAAE,MAAoB;QAC5D,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAdxB,iBAAY,GAAG,IAAI,CAAC;QACpB,eAAU,GAAG,qCAAiB,CAAC;QAC/B,mCAA8B,GAAG,CAAC,+BAAuB,CAAC,YAAY,CAAC,CAAC;QACxE,uBAAkB,GAAuB,SAAS,CAAC;QACnD,YAAO,GAAG,SAAS,CAAC;QACpB,sBAAiB,GAAG,KAAK,CAA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E,UAAU,KAAK,UAAU,EAAE,CAAC;oBAC3D,MAAM,CAAC,oBAAoB,EAAE,CAAC;gBAClC,CAAC;qBAAM,IACH,MAAM,EAAE,MAAM;oBACd,oBAAoB,IAAI,MAAM;oBAC9B,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,KAAK,QAAQ;wBAClC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,cAAc,IAAI,MAAM,CAAC,MAAM,CAAC,UAAU,KAAK,YAAY,CAAC,CAAC,EACnF,CAAC;oBACC,MAAM,CAAC,kBAAkB,EAAE,CAAC;gBAChC,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;CACJ;AAxFD,kEAwFC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/ftfs/parser/model/actions/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/ftfs/parser/model/actions/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC"}
|
|
@@ -16,4 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./ActionAggregation"), exports);
|
|
18
18
|
__exportStar(require("./ActionsAggregation"), exports);
|
|
19
|
+
__exportStar(require("./ActionsContainerAggregation"), exports);
|
|
20
|
+
__exportStar(require("./ActionGroupAggregation"), exports);
|
|
19
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/ftfs/parser/model/actions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,uDAAqC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/ftfs/parser/model/actions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,uDAAqC;AACrC,gEAA8C;AAC9C,2DAAyC"}
|
|
@@ -1,11 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
37
|
};
|
|
5
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
39
|
exports.initI18n = initI18n;
|
|
7
40
|
const i18next_1 = __importDefault(require("i18next"));
|
|
8
|
-
const
|
|
41
|
+
const i18nEn = __importStar(require("@sap/ux-specification-types"));
|
|
9
42
|
const i18n_1 = require("../sync/i18n");
|
|
10
43
|
/**
|
|
11
44
|
* Initializes i18next with the given language.
|
|
@@ -17,7 +50,7 @@ function initI18n(language = 'en') {
|
|
|
17
50
|
i18next_1.default.init({
|
|
18
51
|
resources: {
|
|
19
52
|
en: {
|
|
20
|
-
translation:
|
|
53
|
+
translation: i18nEn
|
|
21
54
|
}
|
|
22
55
|
},
|
|
23
56
|
lng: language,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../../../src/i18n/i18n.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../../../src/i18n/i18n.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,4BAgBC;AAzBD,sDAA8B;AAC9B,oEAAsD;AACtD,uCAAwD;AAExD;;;;GAIG;AACH,SAAgB,QAAQ,CAAC,QAAQ,GAAG,IAAI;IACpC,sCAAsC;IACtC,iBAAO,CAAC,IAAI,CAAC;QACT,SAAS,EAAE;YACP,EAAE,EAAE;gBACA,WAAW,EAAE,MAAM;aACtB;SACJ;QACD,GAAG,EAAE,QAAQ;QACb,WAAW,EAAE,IAAI;QACjB,UAAU,EAAE,MAAM;QAClB,iBAAiB,EAAE,KAAK;KAC3B,CAAC,CAAC;IAEH,oCAAoC;IACpC,IAAA,eAAY,EAAC,iBAAO,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -268,6 +268,14 @@ export declare function getActionKey(action: string, isAction: boolean): {
|
|
|
268
268
|
key: string;
|
|
269
269
|
ns: string;
|
|
270
270
|
};
|
|
271
|
+
/**
|
|
272
|
+
* Adds the schema tag 'key' to a line item record or property in schema. By default it also adds schema tag 'target' if applicable.
|
|
273
|
+
*
|
|
274
|
+
* @param lineItemRecord - the given line item record
|
|
275
|
+
* @param element - the target object to be updated
|
|
276
|
+
* @param addTarget - if true the schema tag 'target' will be added as well if applicable
|
|
277
|
+
*/
|
|
278
|
+
export declare function addKeyToElement(lineItemRecord: object, element: object, addTarget?: boolean): void;
|
|
271
279
|
/**
|
|
272
280
|
* Adds the schema tag key to a line item record or property in schema.
|
|
273
281
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/sync/common/generate/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC3G,OAAO,KAAK,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AACnG,OAAO,EAAqB,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAClG,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAU5D,OAAO,KAAK,EACR,WAAW,EACX,YAAY,EACZ,WAAW,EACX,gBAAgB,EAEhB,iBAAiB,EACpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,cAAc,EAAa,aAAa,EAAgB,MAAM,6BAA6B,CAAC;AAKrG,UAAU,oBAAoB;IAC1B,UAAU,CA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AAE,UAAU,GAAG,MAAM,CAOjH;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,SAAiB,EAAE,EAAE,iBAAiB,GAAG,IAAI,CAU5G"}
|
|
@@ -30,6 +30,7 @@ exports.addFieldsType = addFieldsType;
|
|
|
30
30
|
exports.getEnumEntry = getEnumEntry;
|
|
31
31
|
exports.addDescriptiveEnumDefinition = addDescriptiveEnumDefinition;
|
|
32
32
|
exports.getActionKey = getActionKey;
|
|
33
|
+
exports.addKeyToElement = addKeyToElement;
|
|
33
34
|
exports.addKeyToDefinition = addKeyToDefinition;
|
|
34
35
|
exports.getDataFieldDescription = getDataFieldDescription;
|
|
35
36
|
exports.addMessageToSchema = addMessageToSchema;
|
|
@@ -683,50 +684,71 @@ function getActionKey(action, isAction) {
|
|
|
683
684
|
return { key: actionKey.replace(/@/g, ''), ns: namespace };
|
|
684
685
|
}
|
|
685
686
|
/**
|
|
686
|
-
*
|
|
687
|
+
* This function determines the content of the 'keys' and the 'target' property that should be added to a schema element representing a given line item record.
|
|
688
|
+
*
|
|
689
|
+
* @param lineItemRecord - object representing the line item record, as defined in the AVT ConvertedMetadata, e.g. containing properties like '$Type', 'Value', 'Action', 'Target' etc.
|
|
690
|
+
* @returns An object containing the 'keys' array and the 'target' string (if applicable) for the given line item record.
|
|
691
|
+
*/
|
|
692
|
+
function getKeysAndTargetForLineItemRecord(lineItemRecord) {
|
|
693
|
+
let keys, target;
|
|
694
|
+
if (lineItemRecord['Value']) {
|
|
695
|
+
keys = [{ name: ux_specification_types_1.SchemaKeyName.value, value: (0, StableIdHelper_1.getStableIdPartFromValue)(lineItemRecord['Value']) }];
|
|
696
|
+
}
|
|
697
|
+
else if (lineItemRecord['$Type'] === "com.sap.vocabularies.UI.v1.DataFieldWithAction" /* UIAnnotationTypes.DataFieldWithAction */ ||
|
|
698
|
+
lineItemRecord['$Type'] === "com.sap.vocabularies.UI.v1.DataFieldForAction" /* UIAnnotationTypes.DataFieldForAction */) {
|
|
699
|
+
const { key, ns } = getActionKey(lineItemRecord['Action'], true);
|
|
700
|
+
keys = [{ name: ux_specification_types_1.SchemaKeyName.action, value: key }];
|
|
701
|
+
target = ns;
|
|
702
|
+
}
|
|
703
|
+
else if (lineItemRecord['$Type'] === "com.sap.vocabularies.UI.v1.DataFieldForAnnotation" /* UIAnnotationTypes.DataFieldForAnnotation */) {
|
|
704
|
+
const { key } = getActionKey(lineItemRecord['Target'].value, false);
|
|
705
|
+
keys = [{ name: ux_specification_types_1.SchemaKeyName.target, value: (0, __1.replaceNamespaces)(key) }];
|
|
706
|
+
target = lineItemRecord['Target']?.$target?.fullyQualifiedName?.split('@')[0];
|
|
707
|
+
}
|
|
708
|
+
else if (lineItemRecord['$Type'] === "com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation" /* UIAnnotationTypes.DataFieldForIntentBasedNavigation */ ||
|
|
709
|
+
lineItemRecord['$Type'] === "com.sap.vocabularies.UI.v1.DataFieldWithIntentBasedNavigation" /* UIAnnotationTypes.DataFieldWithIntentBasedNavigation */) {
|
|
710
|
+
const actionId = typeof lineItemRecord['Action'] === 'string' ? lineItemRecord['Action'] : lineItemRecord['Action'].path;
|
|
711
|
+
const { key, ns } = getActionKey(actionId, true);
|
|
712
|
+
keys = [
|
|
713
|
+
{ name: `SemanticObject`, value: lineItemRecord[ux_specification_types_1.SchemaKeyName.semanticObject] },
|
|
714
|
+
{ name: `Action`, value: key }
|
|
715
|
+
];
|
|
716
|
+
target = ns;
|
|
717
|
+
}
|
|
718
|
+
target = target || undefined; // normalize empty string to undefined
|
|
719
|
+
return { keys, target };
|
|
720
|
+
}
|
|
721
|
+
/**
|
|
722
|
+
* Adds the schema tag 'key' to a line item record or property in schema. By default it also adds schema tag 'target' if applicable.
|
|
687
723
|
*
|
|
688
724
|
* @param lineItemRecord - the given line item record
|
|
689
|
-
* @param
|
|
690
|
-
* @param
|
|
725
|
+
* @param element - the target object to be updated
|
|
726
|
+
* @param addTarget - if true the schema tag 'target' will be added as well if applicable
|
|
691
727
|
*/
|
|
692
|
-
function
|
|
728
|
+
function addKeyToElement(lineItemRecord, element, addTarget = true) {
|
|
693
729
|
try {
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
];
|
|
698
|
-
}
|
|
699
|
-
else if (lineItemRecord['$Type'] === "com.sap.vocabularies.UI.v1.DataFieldWithAction" /* UIAnnotationTypes.DataFieldWithAction */ ||
|
|
700
|
-
lineItemRecord['$Type'] === "com.sap.vocabularies.UI.v1.DataFieldForAction" /* UIAnnotationTypes.DataFieldForAction */) {
|
|
701
|
-
const { key, ns } = getActionKey(lineItemRecord['Action'], true);
|
|
702
|
-
properties[schemaKey][ux_specification_types_1.SchemaTag.keys] = [{ name: ux_specification_types_1.SchemaKeyName.action, value: key }];
|
|
703
|
-
if (ns) {
|
|
704
|
-
properties[schemaKey][ux_specification_types_1.SchemaTag.target] = ns;
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
else if (lineItemRecord['$Type'] === "com.sap.vocabularies.UI.v1.DataFieldForAnnotation" /* UIAnnotationTypes.DataFieldForAnnotation */) {
|
|
708
|
-
const { key } = getActionKey(lineItemRecord['Target'].value, false);
|
|
709
|
-
properties[schemaKey][ux_specification_types_1.SchemaTag.keys] = [{ name: ux_specification_types_1.SchemaKeyName.target, value: (0, __1.replaceNamespaces)(key) }];
|
|
710
|
-
properties[schemaKey][ux_specification_types_1.SchemaTag.target] =
|
|
711
|
-
lineItemRecord['Target']?.$target?.fullyQualifiedName?.split('@')[0];
|
|
730
|
+
const { keys, target } = getKeysAndTargetForLineItemRecord(lineItemRecord);
|
|
731
|
+
if (keys) {
|
|
732
|
+
element[ux_specification_types_1.SchemaTag.keys] = keys;
|
|
712
733
|
}
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
const actionId = typeof lineItemRecord['Action'] === 'string' ? lineItemRecord['Action'] : lineItemRecord['Action'].path;
|
|
716
|
-
const { key, ns } = getActionKey(actionId, true);
|
|
717
|
-
properties[schemaKey][ux_specification_types_1.SchemaTag.keys] = [
|
|
718
|
-
{ name: `SemanticObject`, value: lineItemRecord[ux_specification_types_1.SchemaKeyName.semanticObject] },
|
|
719
|
-
{ name: `Action`, value: key }
|
|
720
|
-
];
|
|
721
|
-
if (ns) {
|
|
722
|
-
properties[schemaKey][ux_specification_types_1.SchemaTag.target] = ns;
|
|
723
|
-
}
|
|
734
|
+
if (addTarget && target) {
|
|
735
|
+
element[ux_specification_types_1.SchemaTag.target] = target;
|
|
724
736
|
}
|
|
725
737
|
}
|
|
726
|
-
catch {
|
|
738
|
+
catch (error) {
|
|
727
739
|
return;
|
|
728
740
|
}
|
|
729
741
|
}
|
|
742
|
+
/**
|
|
743
|
+
* Adds the schema tag key to a line item record or property in schema.
|
|
744
|
+
*
|
|
745
|
+
* @param lineItemRecord - the given line item record
|
|
746
|
+
* @param properties - list of all properties in schema
|
|
747
|
+
* @param schemaKey - key of the given property
|
|
748
|
+
*/
|
|
749
|
+
function addKeyToDefinition(lineItemRecord, properties, schemaKey) {
|
|
750
|
+
addKeyToElement(lineItemRecord, properties[schemaKey]);
|
|
751
|
+
}
|
|
730
752
|
/**
|
|
731
753
|
* Determines the description of a data field, e.g. for the column header.
|
|
732
754
|
*
|