@sap/ux-specification 1.96.17 → 1.96.18

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 (29) hide show
  1. package/CHANGELOG.md +24 -3
  2. package/dist/documentation/runDocu-min.js +1 -1
  3. package/dist/documentation/v2/v2-AnalyticalListPage.html +1 -1
  4. package/dist/documentation/v2/v2-ApplicationV2.html +1 -1
  5. package/dist/documentation/v2/v2-ListReport.html +1 -1
  6. package/dist/documentation/v2/v2-ObjectPage.html +1 -1
  7. package/dist/documentation/v2/v2-OverviewPage.html +1 -1
  8. package/dist/documentation/v4/v4-ApplicationV4.html +1 -1
  9. package/dist/documentation/v4/v4-FreestylePage.html +1 -1
  10. package/dist/documentation/v4/v4-ListReport.html +1 -1
  11. package/dist/documentation/v4/v4-ObjectPage.html +1 -1
  12. package/dist/index-min.js +1 -1
  13. package/dist/schemas/v2/AnalyticalListPageConfig.json +2 -2
  14. package/dist/schemas/v2/ListReportConfig.json +4 -4
  15. package/dist/schemas/v2/ObjectPageConfig.json +19 -19
  16. package/dist/schemas/v4/ListReportConfig.json +184 -1
  17. package/dist/schemas/v4/ObjectPageConfig.json +101 -1
  18. package/dist/specification/v4/index-min.js +1 -1
  19. package/dist/src/apiTypes.d.ts +6 -3
  20. package/dist/src/specification/v4/controls/ObjectPageToolBar.d.ts +14 -2
  21. package/dist/src/specification/v4/controls/ToolBar.d.ts +59 -2
  22. package/dist/src/sync/common/generate/utils.d.ts +23 -2
  23. package/dist/src/sync/common/types.d.ts +8 -2
  24. package/dist/src/sync/common/utils.d.ts +6 -0
  25. package/dist/src/sync/v4/export/controls/ObjectPageToolBarAction.d.ts +16 -1
  26. package/dist/src/sync/v4/export/controls/ToolBar.d.ts +2 -2
  27. package/dist/src/sync/v4/export/controls/ToolBarAction.d.ts +31 -1
  28. package/dist/src/sync/v4/utils/utils.d.ts +18 -1
  29. package/package.json +5 -5
@@ -2,6 +2,10 @@ export declare enum SelectType {
2
2
  single = "single",
3
3
  multi = "multi"
4
4
  }
5
+ export declare enum ActionPlacement {
6
+ After = "After",
7
+ Before = "Before"
8
+ }
5
9
  /**
6
10
  * Action
7
11
  * @isViewNode true
@@ -28,14 +32,14 @@ export declare type ChartToolBarAction = {};
28
32
  * @isViewNode true
29
33
  */
30
34
  export interface Actions {
31
- [key: string]: ToolBarAction;
35
+ [key: string]: ToolBarAction | CustomAction;
32
36
  }
33
37
  /**
34
38
  * Actions
35
39
  * @isViewNode true
36
40
  */
37
41
  export interface ViewActions {
38
- [key: string]: ViewToolBarAction | ChartToolBarAction;
42
+ [key: string]: ViewToolBarAction | ChartToolBarAction | ViewTableCustomAction;
39
43
  }
40
44
  /**
41
45
  * Table Toolbar
@@ -51,3 +55,56 @@ export interface ToolBar {
51
55
  export interface ViewChartToolBar {
52
56
  actions: ViewActions;
53
57
  }
58
+ export interface CustomActionPosition {
59
+ /**
60
+ * The key of another action to be used as placement anchor.
61
+ */
62
+ anchor?: string;
63
+ /**
64
+ * Define the placement, either before or after the anchor action.
65
+ */
66
+ placement: ActionPlacement;
67
+ }
68
+ /**
69
+ * Action
70
+ * @isViewNode true
71
+ */
72
+ export interface CustomAction {
73
+ /**
74
+ * The text that is displayed on the button (typically a binding to an i18n entry).
75
+ * @i18nClassification COL: Custom action text
76
+ */
77
+ text: string;
78
+ /**
79
+ * Defines the position of the action relative to other actions.
80
+ */
81
+ position?: CustomActionPosition;
82
+ /**
83
+ * Relevant for extension actions; allows the definition of a target action handler.
84
+ */
85
+ press: string;
86
+ /**
87
+ * Indicates whether the action requires a selection of items.
88
+ */
89
+ requiresSelection?: boolean;
90
+ /**
91
+ * Whether the action button should be visible on the screen.
92
+ */
93
+ visible?: boolean;
94
+ /**
95
+ * Whether the action button should be enabled. Default value is `true`.
96
+ */
97
+ enabled?: boolean;
98
+ }
99
+ export interface ViewCustomActionPosition extends CustomActionPosition {
100
+ /**
101
+ * The key of another action to be used as placement anchor.
102
+ */
103
+ anchor?: string;
104
+ }
105
+ export interface ViewTableCustomAction extends CustomAction {
106
+ /**
107
+ * Defines the position of the action relative to other actions.
108
+ */
109
+ position?: ViewCustomActionPosition;
110
+ }
@@ -1,11 +1,15 @@
1
1
  import type { AnnotationTerm, ConvertedMetadata, EntitySet, EntityType } from '@sap-ux/vocabularies-types';
2
2
  import type { LineItem } from '@sap-ux/vocabularies-types/vocabularies/UI';
3
- import type { Definition } from 'typescript-json-schema';
3
+ import type { Definition, DefinitionOrBoolean } from 'typescript-json-schema';
4
4
  import type { FacetConfig, FacetSection, SectionType } from '..';
5
5
  import type { SectionTypeV2 } from '../../v2/types';
6
6
  import type { PresentationVariantV4 } from '../../v4/types';
7
7
  import { UIAnnotationTerms } from '@sap-ux/vocabularies-types/vocabularies/UI';
8
8
  import { DefinitionName } from '..';
9
+ interface PropertyInDefinition {
10
+ definition: string;
11
+ property?: string;
12
+ }
9
13
  /**
10
14
  * Adds an enum filled with existing UI annotations of the given list (validAnnotations)
11
15
  * @param {EntityType} entityType
@@ -66,6 +70,14 @@ export declare function getFacetKeyInSchema(facetKey: string): string;
66
70
  * @returns {Definition} part of app schema that has been added and filled
67
71
  */
68
72
  export declare function parseSchemaDefinition(definition: string, facetKey: string, appSchema: Definition, useDefinitionAsKey?: boolean, subDefinitionName?: DefinitionName): Definition;
73
+ /**
74
+ * Method receives custom extension base definition name and detect if it should be combined with lineItemId.
75
+ * @param appSchema - the app specific schema that shall get enhanced
76
+ * @param lineItemId - line item ID, as comprise in stable ID
77
+ * @param customColumnDefinitionName - (optional) definition name of custom extension.
78
+ * @returns $ref path for definition.
79
+ */
80
+ export declare function getCustomExtensionDefinitionName(appSchema: Definition, lineItemId: string, customExtensionDefinitionName: string): string;
69
81
  /**
70
82
  * Functions used both by V2 and V4 to add the common definitions for a line item to the app schema
71
83
  * @param appSchema - the app specific schema that shall get enhanced
@@ -76,7 +88,7 @@ export declare function parseSchemaDefinition(definition: string, facetKey: stri
76
88
  * Passed in the V4 case, then additional properties of this type will be allowed.
77
89
  * @returns the actions definition plus the annotation path to the given line item
78
90
  */
79
- export declare function addCommonLineItemDefinitions(appSchema: Definition, lineItemAnnotation: AnnotationTerm<LineItem>, entityType: EntityType, lineItemId: string, customColumnDefinitionName?: string): {
91
+ export declare function addCommonLineItemDefinitions(appSchema: Definition, lineItemAnnotation: AnnotationTerm<LineItem>, entityType: EntityType, lineItemId: string, customColumnDefinitionName?: string, customActionDefinitionName?: string): {
80
92
  actions: Definition;
81
93
  footerActions: Definition;
82
94
  lineItemPath: string;
@@ -150,3 +162,12 @@ export declare function getFacetAnnotationPath(facet: FacetConfig | Presentation
150
162
  * @param {SectionType} sectionPrefix - prefix to distinguish Section and HeaderSection
151
163
  */
152
164
  export declare function handleAddressContact(facet: FacetConfig, facetKey: string, sections: Definition, appSchema: Definition, sectionPrefix: SectionType, subSectionPrefix?: SectionType, versionPostfix?: string): void;
165
+ /**
166
+ * Method adds enum with key and description to schema definition.
167
+ * Description can be easily used by UI to describe enum value/key.
168
+ * @param {Definition} appSchema App specific JSON schema
169
+ * @param {DefinitionOrBoolean} origin Origin schema object containing key and description.
170
+ * @param {PropertyInDefinition} target Target to update with enum.
171
+ */
172
+ export declare function addDescriptiveEnumDefinition(appSchema: Definition, origin: DefinitionOrBoolean, target: PropertyInDefinition): void;
173
+ export {};
@@ -219,7 +219,7 @@ export interface ObjectPageSectionData {
219
219
  target: string;
220
220
  key?: string;
221
221
  }
222
- export declare const BindingPropertyRegexAsString = "^{[A-Za-z0-9{}&$!@#? _|,<>'()[\\]\\/:=.]+}$";
222
+ export declare const BindingPropertyRegexAsString = "^{[A-Za-z0-9{}&$!@#%? _|,<>'()[\\]\\/:=.]+}$";
223
223
  export declare enum ViewTemplateType {
224
224
  ResponsiveTableColumnsExtension = "ResponsiveTableColumnsExtension",
225
225
  AnalyticalTableColumnsExtension = "AnalyticalTableColumnsExtension",
@@ -239,6 +239,8 @@ export declare enum DefinitionName {
239
239
  AnnotationPathAsObject = "AnnotationPathAsObject",
240
240
  ChartToolBarAction = "ChartToolBarAction",
241
241
  CommonHeaderFacetSettings = "CommonHeaderFacetSettings",
242
+ CustomAction = "CustomAction",
243
+ CustomActionOP = "CustomActionOP",
242
244
  CustomColumn = "TableCustomColumn",
243
245
  CustomColumnOP = "TableCustomColumnOP",
244
246
  CustomColumns = "TableCustomColumns",
@@ -308,9 +310,13 @@ export declare enum DefinitionName {
308
310
  ToolBar = "ToolBar",
309
311
  ViewTableColumn = "ViewTableColumn",
310
312
  ViewCustomColumn = "ViewTableCustomColumn",
313
+ ViewCustomAction = "ViewTableCustomAction",
311
314
  ViewChartToolBar = "ViewChartToolBar",
312
315
  ViewToolBarAction = "ViewToolBarAction",
313
- ViewPosition = "ViewPosition"
316
+ ViewPosition = "ViewPosition",
317
+ ViewCustomActionPosition = "ViewCustomActionPosition",
318
+ CustomActionPosition = "CustomActionPosition",
319
+ CustomActionPositionOP = "CustomActionPositionOP"
314
320
  }
315
321
  export declare enum PropertyName {
316
322
  actions = "actions",
@@ -241,3 +241,9 @@ export declare function convertEnumToCSV(manifestSection: any, configPart: any,
241
241
  * @returns the converted action ID
242
242
  */
243
243
  export declare function convertActionKeyToStableId(actionId: string): string;
244
+ /**
245
+ * Method returns definition key for passed '$ref' property by removing 'definition' prefix
246
+ * @param $ref - definition reference.
247
+ * @returns Definition key.
248
+ */
249
+ export declare function getDefinitionKey($ref: string): string;
@@ -1,4 +1,19 @@
1
- import type { ObjectPageToolBarAction as ToolBarActionIF, SelectType } from '../../../../specification/v4';
1
+ import type { ObjectPageToolBarAction as ToolBarActionIF, SelectType, CustomAction as CustomActionIF, CustomActionPosition as PositionIF, ActionPlacement } from '../../../../specification/v4';
2
2
  export declare class ObjectPageToolBarAction implements ToolBarActionIF {
3
3
  enableOnSelect?: SelectType;
4
4
  }
5
+ /**
6
+ * Sync class for Position
7
+ */
8
+ export declare class CustomActionPositionOP implements PositionIF {
9
+ anchor?: string;
10
+ placement: ActionPlacement;
11
+ }
12
+ export declare class CustomActionOP implements CustomActionIF {
13
+ text: string;
14
+ position: CustomActionPositionOP;
15
+ press: string;
16
+ requiresSelection?: boolean;
17
+ visible?: boolean;
18
+ enabled?: boolean;
19
+ }
@@ -1,7 +1,7 @@
1
1
  import type { ToolBar as ToolBarIF, Actions as ActionsIF } from '../../../../specification/v4';
2
- import { ToolBarAction } from './ToolBarAction';
2
+ import { ToolBarAction, CustomAction } from './ToolBarAction';
3
3
  export declare class Actions implements ActionsIF {
4
- [key: string]: ToolBarAction;
4
+ [key: string]: ToolBarAction | CustomAction;
5
5
  }
6
6
  export declare class ToolBar implements ToolBarIF {
7
7
  actions: Actions;
@@ -1,7 +1,37 @@
1
- import type { ToolBarAction as ToolBarActionIF, ViewToolBarAction as ViewToolBarActionIF, SelectType } from '../../../../specification/v4';
1
+ import type { ToolBarAction as ToolBarActionIF, ViewToolBarAction as ViewToolBarActionIF, SelectType, CustomAction as CustomActionIF, CustomActionPosition as PositionIF, ViewTableCustomAction as ViewTableCustomActionIF, ViewCustomActionPosition as ViewCustomActionPositionIF, ActionPlacement } from '../../../../specification/v4';
2
2
  export declare class ToolBarAction implements ToolBarActionIF {
3
3
  enableOnSelect?: SelectType;
4
4
  }
5
5
  export declare class ViewToolBarAction implements ViewToolBarActionIF {
6
6
  enableOnSelect?: SelectType;
7
7
  }
8
+ /**
9
+ * Sync class for Position
10
+ */
11
+ export declare class CustomActionPosition implements PositionIF {
12
+ anchor?: string;
13
+ placement: ActionPlacement;
14
+ }
15
+ export declare class CustomAction implements CustomActionIF {
16
+ text: string;
17
+ position: CustomActionPosition;
18
+ press: string;
19
+ requiresSelection?: boolean;
20
+ visible?: boolean;
21
+ enabled?: boolean;
22
+ }
23
+ /**
24
+ * Sync class for Position
25
+ */
26
+ export declare class ViewCustomActionPosition implements ViewCustomActionPositionIF {
27
+ anchor?: string;
28
+ placement: ActionPlacement;
29
+ }
30
+ export declare class ViewTableCustomAction implements ViewTableCustomActionIF {
31
+ text: string;
32
+ position: CustomActionPosition;
33
+ press: string;
34
+ requiresSelection?: boolean;
35
+ visible?: boolean;
36
+ enabled?: boolean;
37
+ }
@@ -35,7 +35,7 @@ export declare function handleActionRecord(appSchema: Definition, entityType: En
35
35
  * @param columnDefinitionName - name of the column definition, i.e. TableColumn or ObjectPageTableColumn
36
36
  * @param customColumnDefinitionName - name of the custom column definition
37
37
  */
38
- export declare function addLineItemsType(appSchema: Definition, lineItemAnnotation: AnnotationTerm<LineItem>, entityType: EntityType, oDataServiceAVT: ConvertedMetadata, lineItemId: string, columnDefinitionName?: string, customColumnDefinitionName?: string): void;
38
+ export declare function addLineItemsType(appSchema: Definition, lineItemAnnotation: AnnotationTerm<LineItem>, entityType: EntityType, oDataServiceAVT: ConvertedMetadata, lineItemId: string, columnDefinitionName?: string, customColumnDefinitionName?: string, customActionDefinitionName?: string): void;
39
39
  /**
40
40
  * Adds an enum or value help to position > anchor of custom column
41
41
  * @param appSchema - app specific JSON schema
@@ -45,6 +45,13 @@ export declare function addLineItemsType(appSchema: Definition, lineItemAnnotati
45
45
  * @param sectionIdInManifest - identifier of the current object page section in manifest
46
46
  */
47
47
  export declare function addFragmentEnumForAnchor(appSchema: Definition, lineItemId: string, v4Page: SapUiAppPageV4, positionName?: string, sectionIdInManifest?: string): void;
48
+ /**
49
+ * Adds an enum or value help to position > anchor of custom column
50
+ * @param appSchema - app specific JSON schema
51
+ * @param definitionId - definition key of actions
52
+ * @param positionName - target definition to update
53
+ */
54
+ export declare function addEnumForActionAnchor(appSchema: Definition, definitionId: string, positionName?: string): void;
48
55
  /**
49
56
  * Find the relevant V4 page under the routing targets of manifest,json
50
57
  * @param pages - list of all pages in manifest
@@ -61,3 +68,13 @@ export declare function findPageV4(pages: SapUiAppPageV4[], pageName: string, en
61
68
  * @returns the right definition name for the table in the schema
62
69
  */
63
70
  export declare function alignSchemaWithTemplateType(appSchema: Definition, generateParameters: GenerateAppSchemaParameters): DefinitionName.Table | DefinitionName.ALPTableView;
71
+ /**
72
+ * Common function for enhancing the LineItems definition of app schema by custom columns
73
+ * @param appSchema - app-specific JSON schema
74
+ * @param v4Page - actual page in the manifest
75
+ * @param logger - logger for error messages
76
+ * @param customColumnDefinitionName - custom column definition name
77
+ * @param sectionId - identifier of the current object page section in schema
78
+ * @param sectionIdInManifest - identifier of the current object page section in manifest
79
+ */
80
+ export declare function addCustomActionDefinition(appSchema: Definition, v4Page: SapUiAppPageV4, logger: ExtensionLogger, customColumnDefinitionName?: string, sectionId?: string, sectionIdInManifest?: string): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap/ux-specification",
3
- "version": "1.96.17",
3
+ "version": "1.96.18",
4
4
  "displayName": "SAP Fiori tools - Specification",
5
5
  "description": "SAP Fiori tools - Specification",
6
6
  "files": [
@@ -46,7 +46,7 @@
46
46
  "publisher": "SAPSE",
47
47
  "license": "SEE LICENSE IN LICENSE",
48
48
  "dependencies": {
49
- "@sap-ux/fe-fpm-writer": "0.11.0"
49
+ "@sap-ux/fe-fpm-writer": "0.13.4"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@sap-ux/annotation-converter": "0.5.7",
@@ -77,21 +77,21 @@
77
77
  "jest-sonar-reporter": "2.0.0",
78
78
  "jquery": "3.6.0",
79
79
  "lodash.unset": "4.5.2",
80
- "mem-fs-editor": "9.3.0",
80
+ "mem-fs-editor": "9.4.0",
81
81
  "path": "0.12.7",
82
82
  "prettier": "2.5.1",
83
83
  "reflect-metadata": "0.1.13",
84
84
  "rimraf": "3.0.2",
85
85
  "sax": "1.2.4",
86
86
  "source-map-loader": "1.0.0",
87
- "terser-webpack-plugin": "4.2.3",
87
+ "terser-webpack-plugin": "5.3.3",
88
88
  "ts-jest": "26.5.6",
89
89
  "ts-json-schema-generator": "0.96.0",
90
90
  "ts-loader": "9.1.2",
91
91
  "ts-node": "9.1.1",
92
92
  "typescript": "3.8.3",
93
93
  "typescript-json-schema": "0.48.0",
94
- "webpack-cli": "4.7.2",
94
+ "webpack-cli": "4.10.0",
95
95
  "xml-js": "1.6.11"
96
96
  },
97
97
  "husky": {