@sap/ux-specification 1.124.19 → 1.136.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.
Files changed (104) hide show
  1. package/CHANGELOG.md +7 -481
  2. package/dist/documentation/v2/v2-AnalyticalListPage.html +2 -2
  3. package/dist/documentation/v2/v2-ApplicationV2.html +2 -2
  4. package/dist/documentation/v2/v2-ListReport.html +2 -2
  5. package/dist/documentation/v2/v2-ObjectPage.html +2 -2
  6. package/dist/documentation/v2/v2-OverviewPage.html +2 -2
  7. package/dist/documentation/v4/v4-ApplicationV4.html +2 -2
  8. package/dist/documentation/v4/v4-BuildingBlocks.html +2 -2
  9. package/dist/documentation/v4/v4-FreestylePage.html +2 -2
  10. package/dist/documentation/v4/v4-ListReport.html +2 -2
  11. package/dist/documentation/v4/v4-ObjectPage.html +2 -2
  12. package/dist/index-min.js +106 -106
  13. package/dist/index-min.js.map +4 -4
  14. package/dist/schemas/v4/ApplicationV4.json +47 -0
  15. package/dist/schemas/v4/BuildingBlocksConfig.json +2499 -1001
  16. package/dist/schemas/v4/ListReportConfig.json +19 -1
  17. package/dist/schemas/v4/ObjectPageConfig.json +27 -0
  18. package/dist/specification/package.json +4 -4
  19. package/dist/specification/src/sync/common/DataFieldStrategy.d.ts +63 -0
  20. package/dist/specification/src/sync/common/DataFieldStrategy.d.ts.map +1 -0
  21. package/dist/specification/src/sync/common/DataFieldStrategy.js +356 -0
  22. package/dist/specification/src/sync/common/DataFieldStrategy.js.map +1 -0
  23. package/dist/specification/src/sync/common/generate/objectPage.d.ts +62 -1
  24. package/dist/specification/src/sync/common/generate/objectPage.d.ts.map +1 -1
  25. package/dist/specification/src/sync/common/generate/objectPage.js +164 -59
  26. package/dist/specification/src/sync/common/generate/objectPage.js.map +1 -1
  27. package/dist/specification/src/sync/common/generate/utils.d.ts +9 -1
  28. package/dist/specification/src/sync/common/generate/utils.d.ts.map +1 -1
  29. package/dist/specification/src/sync/common/generate/utils.js +18 -0
  30. package/dist/specification/src/sync/common/generate/utils.js.map +1 -1
  31. package/dist/specification/src/sync/common/index.d.ts +1 -0
  32. package/dist/specification/src/sync/common/index.d.ts.map +1 -1
  33. package/dist/specification/src/sync/common/index.js +1 -0
  34. package/dist/specification/src/sync/common/index.js.map +1 -1
  35. package/dist/specification/src/sync/common/utils.d.ts +25 -5
  36. package/dist/specification/src/sync/common/utils.d.ts.map +1 -1
  37. package/dist/specification/src/sync/common/utils.js +27 -64
  38. package/dist/specification/src/sync/common/utils.js.map +1 -1
  39. package/dist/specification/src/sync/v4/application.d.ts +1 -0
  40. package/dist/specification/src/sync/v4/application.d.ts.map +1 -1
  41. package/dist/specification/src/sync/v4/application.js +22 -0
  42. package/dist/specification/src/sync/v4/application.js.map +1 -1
  43. package/dist/specification/src/sync/v4/export/controls/ObjectPageForm.d.ts +4 -1
  44. package/dist/specification/src/sync/v4/export/controls/ObjectPageForm.d.ts.map +1 -1
  45. package/dist/specification/src/sync/v4/export/controls/ObjectPageForm.js +4 -1
  46. package/dist/specification/src/sync/v4/export/controls/ObjectPageForm.js.map +1 -1
  47. package/dist/specification/src/sync/v4/export/controls/ObjectPageHeader.d.ts +2 -2
  48. package/dist/specification/src/sync/v4/export/controls/ObjectPageHeader.d.ts.map +1 -1
  49. package/dist/specification/src/sync/v4/export/controls/ObjectPageHeader.js.map +1 -1
  50. package/dist/specification/src/sync/v4/export/controls/ObjectPageHeaderAction.d.ts +3 -0
  51. package/dist/specification/src/sync/v4/export/controls/ObjectPageHeaderAction.d.ts.map +1 -1
  52. package/dist/specification/src/sync/v4/export/controls/ObjectPageHeaderAction.js +4 -1
  53. package/dist/specification/src/sync/v4/export/controls/ObjectPageHeaderAction.js.map +1 -1
  54. package/dist/specification/src/sync/v4/export/controls/ObjectPageToolBarAction.d.ts +6 -0
  55. package/dist/specification/src/sync/v4/export/controls/ObjectPageToolBarAction.d.ts.map +1 -1
  56. package/dist/specification/src/sync/v4/export/controls/ObjectPageToolBarAction.js +7 -1
  57. package/dist/specification/src/sync/v4/export/controls/ObjectPageToolBarAction.js.map +1 -1
  58. package/dist/specification/src/sync/v4/export/controls/ToolBar.d.ts +2 -2
  59. package/dist/specification/src/sync/v4/export/controls/ToolBar.d.ts.map +1 -1
  60. package/dist/specification/src/sync/v4/export/controls/ToolBarAction.d.ts +6 -0
  61. package/dist/specification/src/sync/v4/export/controls/ToolBarAction.d.ts.map +1 -1
  62. package/dist/specification/src/sync/v4/export/controls/ToolBarAction.js +7 -1
  63. package/dist/specification/src/sync/v4/export/controls/ToolBarAction.js.map +1 -1
  64. package/dist/specification/src/sync/v4/export/export.d.ts.map +1 -1
  65. package/dist/specification/src/sync/v4/export/export.js +15 -2
  66. package/dist/specification/src/sync/v4/export/export.js.map +1 -1
  67. package/dist/specification/src/sync/v4/generate/objectPage.d.ts +21 -0
  68. package/dist/specification/src/sync/v4/generate/objectPage.d.ts.map +1 -1
  69. package/dist/specification/src/sync/v4/generate/objectPage.js +42 -36
  70. package/dist/specification/src/sync/v4/generate/objectPage.js.map +1 -1
  71. package/dist/specification/src/sync/v4/import/pages/listReport.d.ts.map +1 -1
  72. package/dist/specification/src/sync/v4/import/pages/listReport.js +13 -5
  73. package/dist/specification/src/sync/v4/import/pages/listReport.js.map +1 -1
  74. package/dist/specification/src/sync/v4/import/pages/objectPage.d.ts.map +1 -1
  75. package/dist/specification/src/sync/v4/import/pages/objectPage.js +36 -38
  76. package/dist/specification/src/sync/v4/import/pages/objectPage.js.map +1 -1
  77. package/dist/specification/src/sync/v4/utils/StableIdHelper.d.ts +21 -0
  78. package/dist/specification/src/sync/v4/utils/StableIdHelper.d.ts.map +1 -1
  79. package/dist/specification/src/sync/v4/utils/StableIdHelper.js +24 -53
  80. package/dist/specification/src/sync/v4/utils/StableIdHelper.js.map +1 -1
  81. package/dist/specification/src/sync/v4/utils/utils.d.ts +68 -2
  82. package/dist/specification/src/sync/v4/utils/utils.d.ts.map +1 -1
  83. package/dist/specification/src/sync/v4/utils/utils.js +273 -121
  84. package/dist/specification/src/sync/v4/utils/utils.js.map +1 -1
  85. package/dist/types/src/common/types.d.ts +5 -0
  86. package/dist/types/src/common/types.d.ts.map +1 -1
  87. package/dist/types/src/common/types.js +5 -0
  88. package/dist/types/src/common/types.js.map +1 -1
  89. package/dist/types/src/common/webapp/manifest/Manifest.d.ts +2 -1
  90. package/dist/types/src/common/webapp/manifest/Manifest.d.ts.map +1 -1
  91. package/dist/types/src/common/webapp/manifest/Manifest.js +1 -0
  92. package/dist/types/src/common/webapp/manifest/Manifest.js.map +1 -1
  93. package/dist/types/src/v4/application.d.ts +39 -0
  94. package/dist/types/src/v4/application.d.ts.map +1 -1
  95. package/dist/types/src/v4/controls/ObjectPageForm.d.ts +4 -1
  96. package/dist/types/src/v4/controls/ObjectPageForm.d.ts.map +1 -1
  97. package/dist/types/src/v4/controls/ObjectPageHeader.d.ts +4 -1
  98. package/dist/types/src/v4/controls/ObjectPageHeader.d.ts.map +1 -1
  99. package/dist/types/src/v4/controls/ObjectPageToolBar.d.ts +4 -1
  100. package/dist/types/src/v4/controls/ObjectPageToolBar.d.ts.map +1 -1
  101. package/dist/types/src/v4/controls/ToolBar.d.ts +8 -2
  102. package/dist/types/src/v4/controls/ToolBar.d.ts.map +1 -1
  103. package/dist/types/src/v4/pages/ListReportConfigV4.d.ts +1 -1
  104. package/package.json +4 -4
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "defaultPath": {
39
39
  "$ref": "#/definitions/DefaultPathType",
40
- "description": "Definesthe initial view mode:\n- primary: This property loads the app in chart-only view.\n- secondary: This property loads the app in table-only view.\n- both: This property loads the app in hybrid view.",
40
+ "description": "Defines the initial view mode:\n- primary: This property loads the app in chart-only view.\n- secondary: This property loads the app in table-only view.\n- both: This property loads the app in hybrid view.",
41
41
  "artifactType": "Manifest",
42
42
  "descriptionSrcURL": "https://ui5.sap.com/sdk/#/topic/2a9df06673d34f72b238549d49da8bfb"
43
43
  },
@@ -375,6 +375,9 @@
375
375
  "type": "object",
376
376
  "additionalProperties": {
377
377
  "anyOf": [
378
+ {
379
+ "$ref": "#/definitions/ViewToolBarActionGroup"
380
+ },
378
381
  {
379
382
  "$ref": "#/definitions/ViewToolBarAction"
380
383
  },
@@ -388,6 +391,12 @@
388
391
  ]
389
392
  }
390
393
  },
394
+ "ViewToolBarActionGroup": {
395
+ "type": "object",
396
+ "additionalProperties": {
397
+ "$ref": "#/definitions/ViewToolBarAction"
398
+ }
399
+ },
391
400
  "ViewToolBarAction": {
392
401
  "description": "Action",
393
402
  "isViewNode": true,
@@ -653,6 +662,9 @@
653
662
  {
654
663
  "$ref": "#/definitions/ToolBarAction"
655
664
  },
665
+ {
666
+ "$ref": "#/definitions/ToolBarActionGroup"
667
+ },
656
668
  {
657
669
  "$ref": "#/definitions/CustomTableAction"
658
670
  }
@@ -677,6 +689,12 @@
677
689
  },
678
690
  "additionalProperties": false
679
691
  },
692
+ "ToolBarActionGroup": {
693
+ "type": "object",
694
+ "additionalProperties": {
695
+ "$ref": "#/definitions/ToolBarAction"
696
+ }
697
+ },
680
698
  "CustomTableAction": {
681
699
  "type": "object",
682
700
  "properties": {
@@ -73,6 +73,9 @@
73
73
  },
74
74
  {
75
75
  "$ref": "#/definitions/RelatedApps"
76
+ },
77
+ {
78
+ "$ref": "#/definitions/ObjectPageHeaderActionGroup"
76
79
  }
77
80
  ]
78
81
  }
@@ -257,6 +260,12 @@
257
260
  "type": "string"
258
261
  }
259
262
  },
263
+ "ObjectPageHeaderActionGroup": {
264
+ "type": "object",
265
+ "additionalProperties": {
266
+ "$ref": "#/definitions/ObjectPageHeaderAction"
267
+ }
268
+ },
260
269
  "HeaderSections": {
261
270
  "description": "Header Sections",
262
271
  "isViewNode": true,
@@ -702,6 +711,9 @@
702
711
  },
703
712
  {
704
713
  "$ref": "#/definitions/CustomTableActionOP"
714
+ },
715
+ {
716
+ "$ref": "#/definitions/ObjectPageToolBarActionGroup"
705
717
  }
706
718
  ]
707
719
  }
@@ -812,6 +824,12 @@
812
824
  "placement"
813
825
  ]
814
826
  },
827
+ "ObjectPageToolBarActionGroup": {
828
+ "type": "object",
829
+ "additionalProperties": {
830
+ "$ref": "#/definitions/ObjectPageToolBarAction"
831
+ }
832
+ },
815
833
  "TableCreationModeOP": {
816
834
  "type": "object",
817
835
  "properties": {
@@ -1415,6 +1433,9 @@
1415
1433
  },
1416
1434
  {
1417
1435
  "$ref": "#/definitions/FormAction"
1436
+ },
1437
+ {
1438
+ "$ref": "#/definitions/ObjectPageFormActionGroup"
1418
1439
  }
1419
1440
  ]
1420
1441
  }
@@ -1509,6 +1530,12 @@
1509
1530
  },
1510
1531
  "additionalProperties": false
1511
1532
  },
1533
+ "ObjectPageFormActionGroup": {
1534
+ "type": "object",
1535
+ "additionalProperties": {
1536
+ "$ref": "#/definitions/FormAction"
1537
+ }
1538
+ },
1512
1539
  "ObjectPageSectionDataPoint": {
1513
1540
  "type": "object",
1514
1541
  "properties": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap/ux-specification",
3
- "version": "1.124.19",
3
+ "version": "1.136.0",
4
4
  "displayName": "SAP Fiori tools - Specification",
5
5
  "description": "SAP Fiori tools - Specification",
6
6
  "files": [
@@ -55,10 +55,10 @@
55
55
  "devDependencies": {
56
56
  "@sap-ux/annotation-converter": "0.10.3",
57
57
  "@sap-ux/edmx-parser": "0.8.2",
58
- "@sap/ux-specification-types": "1.124.19",
59
- "@sapui5/types": "latest-1.124",
58
+ "@sap/ux-specification-types": "1.136.0",
59
+ "@sapui5/types": "latest-1.135",
60
60
  "@types/d3": "7.4.3",
61
- "@types/jquery": "3.5.31",
61
+ "@types/jquery": "3.5.32",
62
62
  "@types/mem-fs-editor": "7.0.7",
63
63
  "@ui5/flexibility-utils": "0.1.3",
64
64
  "@xml-tools/ast": "5.0.5",
@@ -0,0 +1,63 @@
1
+ import type { DataFieldAbstractTypes } from '@sap-ux/vocabularies-types/vocabularies/UI';
2
+ import { UIAnnotationTypes } from '@sap-ux/vocabularies-types/vocabularies/UI';
3
+ import type { EntityType } from '@sap-ux/vocabularies-types';
4
+ import { type AddDefinitionParams } from './generate/objectPage';
5
+ import { type AddLineItemDefinitionParams } from '../v4/utils/utils';
6
+ export declare abstract class DataFieldStrategy {
7
+ /**
8
+ * Generates a stable identifier based on the provided data field.
9
+ *
10
+ * @param {DataFieldAbstractTypes} dataField - The data field used to generate the stable identifier.
11
+ * @returns {string | undefined} A stable identifier as a string if successful, or undefined if the generation fails.
12
+ */
13
+ generateStableId?(dataField: DataFieldAbstractTypes): string | undefined;
14
+ /**
15
+ * Generates a descriptive string or value based on the provided data field, entity type, and data field label.
16
+ *
17
+ * @param {DataFieldAbstractTypes} dataField - The abstract type representation of the data field used to generate the description.
18
+ * @param {EntityType} entityType - The type of entity associated with the data field.
19
+ */
20
+ generateDescription?(dataField: DataFieldAbstractTypes, entityType: EntityType): string;
21
+ /**
22
+ * Adds a new definition based on the provided parameters.
23
+ *
24
+ * @param {AddDefinitionParams} data - An object containing the parameters required to add the definition.
25
+ * @returns {void}
26
+ */
27
+ addDefinition?(data: AddDefinitionParams): void;
28
+ /**
29
+ * Adds a new line item definition to the system based on the provided parameters.
30
+ *
31
+ * @param {AddLineItemDefinitionParams} data - The parameters used to define the new line item.
32
+ * @returns {void} Does not return a value.
33
+ */
34
+ addLineItemDefinition?(data: AddLineItemDefinitionParams): void;
35
+ }
36
+ export declare class DataFieldStrategyContext {
37
+ private strategies;
38
+ /**
39
+ * Constructor to initialize the strategies map with various UIAnnotationTypes and their corresponding strategies.
40
+ * It registers predefined strategies to handle different UI annotation types by mapping each type
41
+ * to the appropriate strategy instance.
42
+ *
43
+ * @returns {void} Initializes the strategies map with registered strategies. Does not return any value.
44
+ */
45
+ constructor();
46
+ /**
47
+ * Registers a strategy for a specific type of data field.
48
+ *
49
+ * @param {string} type - The type of data field to associate with the strategy.
50
+ * @param {DataFieldStrategy} strategy - The strategy to be registered for the specified type.
51
+ * @returns {void} This method does not return a value.
52
+ */
53
+ registerStrategy(type: UIAnnotationTypes, strategy: DataFieldStrategy): void;
54
+ /**
55
+ * Retrieves the strategy associated with the given type.
56
+ *
57
+ * @param {string} type - The key representing the type of strategy to retrieve.
58
+ * @returns {DataFieldStrategy | undefined} The strategy corresponding to the provided type, or undefined if no strategy is found.
59
+ */
60
+ getStrategy(type: UIAnnotationTypes): DataFieldStrategy | undefined;
61
+ }
62
+ export declare const dataFieldStrategyContext: DataFieldStrategyContext;
63
+ //# sourceMappingURL=DataFieldStrategy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataFieldStrategy.d.ts","sourceRoot":"","sources":["../../../../../src/sync/common/DataFieldStrategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAER,sBAAsB,EAOzB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAC/E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAO7D,OAAO,EAGH,KAAK,mBAAmB,EAC3B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAGH,KAAK,2BAA2B,EAEnC,MAAM,mBAAmB,CAAC;AAE3B,8BAAsB,iBAAiB;IACnC;;;;;OAKG;IACH,gBAAgB,CAAC,CAAC,SAAS,EAAE,sBAAsB,GAAG,MAAM,GAAG,SAAS;IAExE;;;;;OAKG;IACH,mBAAmB,CAAC,CAAC,SAAS,EAAE,sBAAsB,EAAE,UAAU,EAAE,UAAU,GAAG,MAAM;IAEvF;;;;;OAKG;IACH,aAAa,CAAC,CAAC,IAAI,EAAE,mBAAmB,GAAG,IAAI;IAI/C;;;;;OAKG;IACH,qBAAqB,CAAC,CAAC,IAAI,EAAE,2BAA2B,GAAG,IAAI;CAGlE;AA2TD,qBAAa,wBAAwB;IACjC,OAAO,CAAC,UAAU,CAA4C;IAE9D;;;;;;OAMG;;IAqBH;;;;;;OAMG;IACH,gBAAgB,CAAC,IAAI,EAAE,iBAAiB,EAAE,QAAQ,EAAE,iBAAiB,GAAG,IAAI;IAI5E;;;;;OAKG;IACH,WAAW,CAAC,IAAI,EAAE,iBAAiB,GAAG,iBAAiB,GAAG,SAAS;CAGtE;AAED,eAAO,MAAM,wBAAwB,0BAAiC,CAAC"}
@@ -0,0 +1,356 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dataFieldStrategyContext = exports.DataFieldStrategyContext = exports.DataFieldStrategy = void 0;
4
+ const utils_1 = require("./utils");
5
+ const StableIdHelper_1 = require("../v4/utils/StableIdHelper");
6
+ const objectPage_1 = require("./generate/objectPage");
7
+ const utils_2 = require("../v4/utils/utils");
8
+ class DataFieldStrategy {
9
+ /**
10
+ * Adds a new definition based on the provided parameters.
11
+ *
12
+ * @param {AddDefinitionParams} data - An object containing the parameters required to add the definition.
13
+ * @returns {void}
14
+ */
15
+ addDefinition(data) {
16
+ (0, objectPage_1.addDataFieldDefinition)(data);
17
+ }
18
+ /**
19
+ * Adds a new line item definition to the system based on the provided parameters.
20
+ *
21
+ * @param {AddLineItemDefinitionParams} data - The parameters used to define the new line item.
22
+ * @returns {void} Does not return a value.
23
+ */
24
+ addLineItemDefinition(data) {
25
+ (0, utils_2.addLineItemRecordToSchema)(data);
26
+ }
27
+ }
28
+ exports.DataFieldStrategy = DataFieldStrategy;
29
+ class DataFieldForActionStrategy extends DataFieldStrategy {
30
+ /**
31
+ * Generates a stable identifier based on the given data field.
32
+ *
33
+ * @param {DataFieldForActionAbstractTypes} dataField - The data field used to generate the stable identifier.
34
+ * @returns {string} A stable identifier string derived from the provided data field.
35
+ */
36
+ generateStableId(dataField) {
37
+ return (0, StableIdHelper_1.prepareId)('DataFieldForAction::' + dataField.Action);
38
+ }
39
+ /**
40
+ * Generates a description for the provided data field based on its label and context.
41
+ *
42
+ * @param {DataFieldForActionAbstractTypes} dataField - The data field for which the description is generated.
43
+ * @param {EntityType} entityType - The type of the entity associated with the data field.
44
+ * @returns {string} The generated description for the specified data field.
45
+ */
46
+ generateDescription(dataField, entityType) {
47
+ const dataFieldLabel = (0, utils_1.getLabel)(dataField.Label, entityType);
48
+ return (0, utils_1.getDescriptionForActionBasedDataFields)(dataField, dataFieldLabel);
49
+ }
50
+ /**
51
+ * Adds a new definition for an action.
52
+ * This method processes the given data and integrates it into the action definition structure.
53
+ *
54
+ * @param {AddDefinitionParams} data - An object containing the necessary parameters for the action definition.
55
+ * @returns {void} This method does not return a value.
56
+ */
57
+ addDefinition(data) {
58
+ (0, objectPage_1.addDataFieldForActionAndActionGroupDefinition)(data);
59
+ }
60
+ /**
61
+ * Adds a line item definition to the schema based on the provided data.
62
+ * Determines the appropriate action based on the properties of the line item record.
63
+ *
64
+ * @param {object} data - The parameters for adding the line item definition.
65
+ * @param {object} data.lineItemRecord - The line item record object containing specific properties.
66
+ * @param {object} data.lineItemDefinition - The line item definition object.
67
+ * @returns {void} This method does not return a value.
68
+ */
69
+ addLineItemDefinition(data) {
70
+ (0, utils_2.addLineItemActionDefinition)(data);
71
+ }
72
+ }
73
+ class DataFieldForActionGroupStrategy extends DataFieldStrategy {
74
+ /**
75
+ * Generates a stable identifier for a given data field.
76
+ *
77
+ * @param {DataFieldForActionGroupTypes} dataField - The data field object containing necessary details for generating the stable ID.
78
+ * @returns {string} A stable identifier string based on the provided data field.
79
+ */
80
+ generateStableId(dataField) {
81
+ return (0, StableIdHelper_1.prepareId)('DataFieldForActionGroup::' + dataField.ID);
82
+ }
83
+ /**
84
+ * Generates a description based on the provided data field, entity type, and label.
85
+ *
86
+ * @param {DataFieldForActionGroupTypes} dataField - The data field object used to generate the description.
87
+ * @param {EntityType} entityType - The entity type associated with the data field.
88
+ * @returns {string} The generated description, which will be the data field's label, ID, or the provided default label.
89
+ */
90
+ generateDescription(dataField, entityType) {
91
+ const dataFieldLabel = (0, utils_1.getLabel)(dataField.Label, entityType);
92
+ return dataField.Label ?? dataField.ID ?? dataFieldLabel;
93
+ }
94
+ /**
95
+ * Adds a definition using the given data.
96
+ *
97
+ * @param {AddDefinitionParams} data - The data object containing the definition details to be added.
98
+ * @returns {void} Does not return a value.
99
+ */
100
+ addDefinition(data) {
101
+ (0, objectPage_1.addDataFieldForActionAndActionGroupDefinition)(data);
102
+ }
103
+ /**
104
+ * Adds a new line item definition to the schema.
105
+ *
106
+ * @param {AddLineItemDefinitionParams} data - The data for the line item definition to be added.
107
+ * @returns {void}
108
+ */
109
+ addLineItemDefinition(data) {
110
+ (0, utils_2.addGroupActionRecordToSchema)(data);
111
+ }
112
+ }
113
+ class DataFieldForIntentBasedNavigationStrategy extends DataFieldStrategy {
114
+ /**
115
+ * Generates a stable ID for the given data field by concatenating a prefix with a part derived
116
+ * from the semantic object and action of the data field.
117
+ *
118
+ * @param {DataFieldForActionAbstractTypes} dataField - The data field for which the stable ID is to be generated.
119
+ * @returns {string} The generated stable ID as a string.
120
+ */
121
+ generateStableId(dataField) {
122
+ return 'DataFieldForIntentBasedNavigation::' + (0, StableIdHelper_1.getStableIdPartFromSemanticObjectAndAction)(dataField);
123
+ }
124
+ /**
125
+ * Generates a description for the given data field based on the provided entity type and label.
126
+ *
127
+ * @param {DataFieldForActionAbstractTypes} dataField - The data field for which the description is to be generated.
128
+ * @param {EntityType} entityType - The type of the entity associated with the data field.
129
+ * @returns {string} The generated description for the given data field.
130
+ */
131
+ generateDescription(dataField, entityType) {
132
+ const dataFieldLabel = (0, utils_1.getLabel)(dataField.Label, entityType);
133
+ return (0, utils_1.getDescriptionForActionBasedDataFields)(dataField, dataFieldLabel);
134
+ }
135
+ /**
136
+ * Adds a new definition based on the provided data.
137
+ *
138
+ * @param {AddDefinitionParams} data - The data used to create the new definition.
139
+ * @returns {void} - Does not return a value.
140
+ */
141
+ addDefinition(data) {
142
+ (0, objectPage_1.addDataFieldForActionAndActionGroupDefinition)(data);
143
+ }
144
+ /**
145
+ * Adds a line item definition to the schema based on the provided data.
146
+ * Determines the appropriate action based on the properties of the line item record.
147
+ *
148
+ * @param {object} data - The parameters for adding the line item definition.
149
+ * @param {object} data.lineItemRecord - The line item record object containing specific properties.
150
+ * @param {object} data.lineItemDefinition - The line item definition object.
151
+ * @returns {void} This method does not return a value.
152
+ */
153
+ addLineItemDefinition(data) {
154
+ (0, utils_2.addLineItemActionDefinition)(data);
155
+ }
156
+ }
157
+ class DataFieldForAnnotationStrategy extends DataFieldStrategy {
158
+ /**
159
+ * Generates a stable identifier for a given data field.
160
+ *
161
+ * @param {DataFieldForAnnotationTypes} dataField - The data field for which the stable identifier will be generated.
162
+ * This parameter includes information about annotations and target paths related to the field.
163
+ * @returns {string} The stable identifier created by combining specific parts of the data field's annotation path.
164
+ */
165
+ generateStableId(dataField) {
166
+ const annotationPath = dataField.Target?.$AnnotationPath ?? dataField.Target?.value ?? '';
167
+ return 'DataFieldForAnnotation::' + (0, StableIdHelper_1.prepareId)(annotationPath);
168
+ }
169
+ /**
170
+ * Generates a description for a given data field based on its label, common label, or target metadata.
171
+ *
172
+ * @param {DataFieldForAnnotationTypes} dataField - The data field object containing metadata for the data annotation.
173
+ * @param {EntityType} entityType - The entity type associated with the data field.
174
+ * @returns {string} A string representing the generated description based on the provided data field and entity type.
175
+ */
176
+ generateDescription(dataField, entityType) {
177
+ const propertyCommonLabel = (0, utils_1.getLabelForDataField)(dataField, entityType);
178
+ const dataFieldLabel = (0, utils_1.getLabel)(dataField.Label, entityType);
179
+ return (dataFieldLabel ||
180
+ propertyCommonLabel ||
181
+ dataField?.Target?.$target?.Title ||
182
+ dataField?.Target?.value?.split('UI.v1.')[1]);
183
+ }
184
+ }
185
+ class DataFieldWithActionStrategy extends DataFieldStrategy {
186
+ /**
187
+ * Generates a stable identifier for a given data field with action.
188
+ * The stable ID is constructed based on the Value property of the data field
189
+ * (if it exists) and the Action property of the data field.
190
+ *
191
+ * @param {DataFieldForActionAbstractTypes} dataField - The data field containing
192
+ * the action and optionally a value, used to generate the stable identifier.
193
+ * @returns {string} A stable identifier string constructed based on the data field's
194
+ * Value and Action properties.
195
+ */
196
+ generateStableId(dataField) {
197
+ let sIdPart = 'DataFieldWithAction::';
198
+ if ('Value' in dataField && dataField.Value) {
199
+ sIdPart += (0, StableIdHelper_1.getStableIdPartFromValue)(dataField.Value) + '::';
200
+ }
201
+ sIdPart += dataField.Action;
202
+ return (0, StableIdHelper_1.prepareId)(sIdPart);
203
+ }
204
+ /**
205
+ * Generates a description based on the provided data field, entity type, and data field label.
206
+ *
207
+ * @param {DataFieldForActionAbstractTypes} dataField - The data field for which the description is to be generated.
208
+ * @param {EntityType} entityType - The entity type that is associated with the data field.
209
+ * @returns {string} The generated description for the specified data field and entity type.
210
+ */
211
+ generateDescription(dataField, entityType) {
212
+ const dataFieldLabel = (0, utils_1.getLabel)(dataField.Label, entityType);
213
+ return (0, utils_1.getDescriptionForActionBasedDataFields)(dataField, dataFieldLabel);
214
+ }
215
+ }
216
+ class DataFieldStrategyDefault extends DataFieldStrategy {
217
+ /**
218
+ * Generates a stable identifier string for a provided data field.
219
+ *
220
+ * @param {DataField} dataField - The data field object containing the value to generate the stable identifier from.
221
+ * @returns {string} A stable identifier string derived from the data field value.
222
+ */
223
+ generateStableId(dataField) {
224
+ return (0, StableIdHelper_1.prepareId)('DataField::' + (0, StableIdHelper_1.getStableIdPartFromValue)(dataField.Value));
225
+ }
226
+ /**
227
+ * Generates a descriptive title for the given data field.
228
+ *
229
+ * @param {DataField} dataField - The data field for which the description will be generated.
230
+ * @param {EntityType} entityType - The entity type associated with the data field.
231
+ * @returns {string} The generated description for the data field.
232
+ */
233
+ generateDescription(dataField, entityType) {
234
+ const dataFieldLabel = (0, utils_1.getLabel)(dataField.Label, entityType);
235
+ return (0, utils_1.getTitleForDataField)(dataField, entityType, dataFieldLabel);
236
+ }
237
+ }
238
+ class DataFieldWithIntentBasedNavigationStrategy extends DataFieldStrategy {
239
+ /**
240
+ * Generates a stable ID for a given DataFieldWithIntentBasedNavigationTypes object.
241
+ *
242
+ * @param {DataFieldWithIntentBasedNavigationTypes} dataField - The data field object containing information for intent-based navigation.
243
+ * @returns {string} A stable ID string created based on the provided data field.
244
+ */
245
+ generateStableId(dataField) {
246
+ let sIdPart = 'DataFieldWithIntentBasedNavigation::';
247
+ sIdPart += (0, StableIdHelper_1.getStableIdPartFromValue)(dataField.Value) + '::';
248
+ sIdPart += (0, StableIdHelper_1.getStableIdPartFromSemanticObjectAndAction)(dataField);
249
+ return (0, StableIdHelper_1.prepareId)(sIdPart);
250
+ }
251
+ /**
252
+ * Generates a description for the given data field based on its intent-based navigation or common label.
253
+ *
254
+ * @param {DataFieldWithIntentBasedNavigationTypes} dataField - The data field for which the description is to be generated.
255
+ * @param {EntityType} entityType - The entity type to be used for retrieving the label of the data field.
256
+ * @returns {string} The generated description, either derived from the common label or the value path of the data field.
257
+ */
258
+ generateDescription(dataField, entityType) {
259
+ const propertyCommonLabel = (0, utils_1.getLabelForDataField)(dataField, entityType);
260
+ return propertyCommonLabel || dataField.Value.path;
261
+ }
262
+ }
263
+ class DataFieldWithNavigationPathStrategy extends DataFieldStrategy {
264
+ /**
265
+ * Generates a stable ID based on the given DataFieldWithNavigationPath object.
266
+ *
267
+ * @param {DataFieldWithNavigationPath} dataField - The data field from which the stable ID will be generated. It should include properties like Value and optionally Target with a $NavigationPropertyPath.
268
+ * @returns {string} The generated stable ID as a string.
269
+ */
270
+ generateStableId(dataField) {
271
+ let sIdPart = 'DataFieldWithNavigationPath::' + (0, StableIdHelper_1.getStableIdPartFromValue)(dataField.Value);
272
+ if (dataField.Target && dataField.Target['$NavigationPropertyPath']) {
273
+ sIdPart += '::' + dataField.Target['$NavigationPropertyPath'];
274
+ }
275
+ return (0, StableIdHelper_1.prepareId)(sIdPart);
276
+ }
277
+ /**
278
+ * Generates a description for a given data field based on the entity type and label provided.
279
+ *
280
+ * @param {DataField} dataField - The data field for which the description is being generated.
281
+ * @param {EntityType} entityType - The type of the entity associated with the data field.
282
+ * @returns {string} The generated description for the data field.
283
+ */
284
+ generateDescription(dataField, entityType) {
285
+ const dataFieldLabel = (0, utils_1.getLabel)(dataField.Label, entityType);
286
+ return (0, utils_1.getTitleForDataField)(dataField, entityType, dataFieldLabel);
287
+ }
288
+ }
289
+ class DataFieldWithUrlStrategy extends DataFieldStrategy {
290
+ /**
291
+ * Generates a stable ID based on the provided data field.
292
+ *
293
+ * @param {DataFieldWithUrl} dataField - An object containing the data field information, including a URL and a value used to generate the ID.
294
+ * @returns {string} A stable and unique string ID derived from the data field's value.
295
+ */
296
+ generateStableId(dataField) {
297
+ return (0, StableIdHelper_1.prepareId)('DataFieldWithUrl::' + (0, StableIdHelper_1.getStableIdPartFromValue)(dataField.Value));
298
+ }
299
+ /**
300
+ * Generates a description based on the provided data field, entity type, and label.
301
+ *
302
+ * @param {DataFieldWithUrl} dataField - The data field containing the information needed to generate the description.
303
+ * @param {EntityType} entityType - The type of entity associated with the data field.
304
+ * @returns {string} The generated description, which is determined by the provided label, the common label for the data field, or the data field's value.
305
+ */
306
+ generateDescription(dataField, entityType) {
307
+ const propertyCommonLabel = (0, utils_1.getLabelForDataField)(dataField, entityType);
308
+ const dataFieldLabel = (0, utils_1.getLabel)(dataField.Label, entityType);
309
+ return (dataFieldLabel ||
310
+ propertyCommonLabel ||
311
+ (typeof dataField.Value === 'string' ? dataField.Value : dataField.Value.path));
312
+ }
313
+ }
314
+ class DataFieldStrategyContext {
315
+ /**
316
+ * Constructor to initialize the strategies map with various UIAnnotationTypes and their corresponding strategies.
317
+ * It registers predefined strategies to handle different UI annotation types by mapping each type
318
+ * to the appropriate strategy instance.
319
+ *
320
+ * @returns {void} Initializes the strategies map with registered strategies. Does not return any value.
321
+ */
322
+ constructor() {
323
+ this.strategies = new Map();
324
+ this.registerStrategy("com.sap.vocabularies.UI.v1.DataFieldForAction" /* UIAnnotationTypes.DataFieldForAction */, new DataFieldForActionStrategy());
325
+ this.registerStrategy("com.sap.vocabularies.UI.v1.DataFieldForActionGroup" /* UIAnnotationTypes.DataFieldForActionGroup */, new DataFieldForActionGroupStrategy());
326
+ this.registerStrategy("com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation" /* UIAnnotationTypes.DataFieldForIntentBasedNavigation */, new DataFieldForIntentBasedNavigationStrategy());
327
+ this.registerStrategy("com.sap.vocabularies.UI.v1.DataFieldForAnnotation" /* UIAnnotationTypes.DataFieldForAnnotation */, new DataFieldForAnnotationStrategy());
328
+ this.registerStrategy("com.sap.vocabularies.UI.v1.DataFieldWithAction" /* UIAnnotationTypes.DataFieldWithAction */, new DataFieldWithActionStrategy());
329
+ this.registerStrategy("com.sap.vocabularies.UI.v1.DataField" /* UIAnnotationTypes.DataField */, new DataFieldStrategyDefault());
330
+ this.registerStrategy("com.sap.vocabularies.UI.v1.DataFieldWithIntentBasedNavigation" /* UIAnnotationTypes.DataFieldWithIntentBasedNavigation */, new DataFieldWithIntentBasedNavigationStrategy());
331
+ this.registerStrategy("com.sap.vocabularies.UI.v1.DataFieldWithNavigationPath" /* UIAnnotationTypes.DataFieldWithNavigationPath */, new DataFieldWithNavigationPathStrategy());
332
+ this.registerStrategy("com.sap.vocabularies.UI.v1.DataFieldWithUrl" /* UIAnnotationTypes.DataFieldWithUrl */, new DataFieldWithUrlStrategy());
333
+ }
334
+ /**
335
+ * Registers a strategy for a specific type of data field.
336
+ *
337
+ * @param {string} type - The type of data field to associate with the strategy.
338
+ * @param {DataFieldStrategy} strategy - The strategy to be registered for the specified type.
339
+ * @returns {void} This method does not return a value.
340
+ */
341
+ registerStrategy(type, strategy) {
342
+ this.strategies.set(type, strategy);
343
+ }
344
+ /**
345
+ * Retrieves the strategy associated with the given type.
346
+ *
347
+ * @param {string} type - The key representing the type of strategy to retrieve.
348
+ * @returns {DataFieldStrategy | undefined} The strategy corresponding to the provided type, or undefined if no strategy is found.
349
+ */
350
+ getStrategy(type) {
351
+ return this.strategies.get(type);
352
+ }
353
+ }
354
+ exports.DataFieldStrategyContext = DataFieldStrategyContext;
355
+ exports.dataFieldStrategyContext = new DataFieldStrategyContext();
356
+ //# sourceMappingURL=DataFieldStrategy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataFieldStrategy.js","sourceRoot":"","sources":["../../../../../src/sync/common/DataFieldStrategy.ts"],"names":[],"mappings":";;;AAYA,mCAAuH;AACvH,+DAIoC;AACpC,sDAI+B;AAC/B,6CAK2B;AAE3B,MAAsB,iBAAiB;IAiBnC;;;;;OAKG;IACH,aAAa,CAAE,IAAyB;QACpC,IAAA,mCAAsB,EAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IAED;;;;;OAKG;IACH,qBAAqB,CAAE,IAAiC;QACpD,IAAA,iCAAyB,EAAC,IAAI,CAAC,CAAC;IACpC,CAAC;CACJ;AApCD,8CAoCC;AAED,MAAM,0BAA2B,SAAQ,iBAAiB;IACtD;;;;;OAKG;IACH,gBAAgB,CAAC,SAA0C;QACvD,OAAO,IAAA,0BAAS,EAAC,sBAAsB,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;IAChE,CAAC;IAED;;;;;;OAMG;IACH,mBAAmB,CAAC,SAA0C,EAAE,UAAsB;QAClF,MAAM,cAAc,GAAG,IAAA,gBAAQ,EAAC,SAAS,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;QAC7D,OAAO,IAAA,8CAAsC,EAAC,SAAS,EAAE,cAAc,CAAC,CAAC;IAC7E,CAAC;IAED;;;;;;OAMG;IACH,aAAa,CAAC,IAAyB;QACnC,IAAA,0DAA6C,EAAC,IAAI,CAAC,CAAC;IACxD,CAAC;IAED;;;;;;;;OAQG;IACH,qBAAqB,CAAE,IAAiC;QACpD,IAAA,mCAA2B,EAAC,IAAI,CAAC,CAAC;IACtC,CAAC;CACJ;AAED,MAAM,+BAAgC,SAAQ,iBAAiB;IAC3D;;;;;OAKG;IACH,gBAAgB,CAAC,SAAuC;QACpD,OAAO,IAAA,0BAAS,EAAC,2BAA2B,GAAG,SAAS,CAAC,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;OAMG;IACH,mBAAmB,CAAC,SAAuC,EAAE,UAAsB;QAC/E,MAAM,c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EAA8B,IAAI,wBAAwB,EAAE,CAAC,CAAC;QACnF,IAAI,CAAC,gBAAgB,6HAEjB,IAAI,0CAA0C,EAAE,CACnD,CAAC;QACF,IAAI,CAAC,gBAAgB,+GAAgD,IAAI,mCAAmC,EAAE,CAAC,CAAC;QAChH,IAAI,CAAC,gBAAgB,yFAAqC,IAAI,wBAAwB,EAAE,CAAC,CAAC;IAC9F,CAAC;IAED;;;;;;OAMG;IACH,gBAAgB,CAAC,IAAuB,EAAE,QAA2B;QACjE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACxC,CAAC;IAED;;;;;OAKG;IACH,WAAW,CAAC,IAAuB;QAC/B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;CACJ;AAlDD,4DAkDC;AAEY,QAAA,wBAAwB,GAAG,IAAI,wBAAwB,EAAE,CAAC"}
@@ -1,8 +1,38 @@
1
1
  import type { ConvertedMetadata, EntitySet, EntityType } from '@sap-ux/vocabularies-types';
2
- import type { FacetConfig, GenerateAppSchemaParameters } from '@sap/ux-specification-types';
2
+ import type { DataFieldAbstractTypes } from '@sap-ux/vocabularies-types/vocabularies/UI';
3
+ import type { FacetConfig, GenerateAppSchemaParameters, SchemaDefinition } from '@sap/ux-specification-types';
3
4
  import { FioriElementsVersion, SectionType, v2 } from '@sap/ux-specification-types';
4
5
  import type { Definition } from 'typescript-json-schema';
5
6
  import type { SapUiAppPageV4 } from '@sap/ux-specification-types/src/v4';
7
+ type DefinitionsProperties = {
8
+ [key: string]: SchemaDefinition;
9
+ };
10
+ export interface AddDefinitionParams {
11
+ appSchema: Definition;
12
+ withActions: boolean;
13
+ sectionType: SectionType;
14
+ field: DataFieldAbstractTypes;
15
+ targetID: string;
16
+ containersSchema: FieldsContainerSchema;
17
+ key: string;
18
+ version: FioriElementsVersion;
19
+ section: FacetConfig;
20
+ entityTypeName: string;
21
+ }
22
+ interface FieldsContainerSchema {
23
+ fields?: DefinitionsProperties;
24
+ actions?: DefinitionsProperties;
25
+ }
26
+ /**
27
+ * Retrieves the modified field reference based on the specified Fiori Elements version
28
+ * and the provided field reference identifier.
29
+ *
30
+ * @param {FioriElementsVersion} version - The Fiori Elements version (e.g., v2, v4).
31
+ * @param {string} fieldReferenceId - The identifier for the field reference to be processed.
32
+ * @returns {string} The transformed field reference if the version is v2 and the identifier contains '::',
33
+ * otherwise returns the original field reference identifier.
34
+ */
35
+ export declare function getFieldReference(version: FioriElementsVersion, fieldReferenceId: string): string;
6
36
  /**
7
37
  * Adds definitions for forms in object page sections to the app schema.
8
38
  *
@@ -71,4 +101,35 @@ export declare function addCommonHeaderSchema(appSchema: Definition, entityType:
71
101
  * @returns the entity set as defined in AVT, if found
72
102
  */
73
103
  export declare function determineEntitySetOfEntityType(entityType: EntityType, serviceAVT: ConvertedMetadata): EntitySet | undefined;
104
+ /**
105
+ * Adds a data field definition to the application schema based on the provided parameters.
106
+ *
107
+ * @param {AddDefinitionParams} data - An object containing the parameters necessary to define and add the data field.
108
+ * This includes:
109
+ * - `appSchema`: The application schema to which the definition is added
110
+ * - `section`: The section in which the field resides
111
+ * - `sectionType`: The type of the section
112
+ * - `field`: The specific field to be added
113
+ * - `targetID`: The target identifier for the field
114
+ * - `containersSchema`: The schema container for fields
115
+ * - `key`: The key that determines the order of the field
116
+ * - `version`: The version of the schema
117
+ */
118
+ export declare function addDataFieldDefinition(data: AddDefinitionParams): void;
119
+ /**
120
+ * Adds a data field to the schema definition for action and action group configurations.
121
+ *
122
+ * @param {AddDefinitionParams} data - The input data required to add the data field, including:
123
+ * - appSchema: The application schema to be updated.
124
+ * - withActions: A flag indicating whether actions are included.
125
+ * - sectionType: The type of the section (e.g., Section).
126
+ * - field: The data field to be added.
127
+ * - targetID: The identifier of the target.
128
+ * - containersSchema: The schema containing action and action groups configurations.
129
+ * - key: The key used for the property's index.
130
+ * - version: The schema version information.
131
+ * @returns {void} The function does not return a value.
132
+ */
133
+ export declare function addDataFieldForActionAndActionGroupDefinition(data: AddDefinitionParams): void;
134
+ export {};
74
135
  //# sourceMappingURL=objectPage.d.ts.map