@sap-ux/fe-fpm-writer 0.24.2 → 0.24.4

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.
@@ -7,5 +7,5 @@ var TargetControl;
7
7
  TargetControl["footer"] = "footer";
8
8
  TargetControl["section"] = "@com.sap.vocabularies.UI.v1.FieldGroup";
9
9
  TargetControl["table"] = "@com.sap.vocabularies.UI.v1.LineItem";
10
- })(TargetControl = exports.TargetControl || (exports.TargetControl = {}));
10
+ })(TargetControl || (exports.TargetControl = TargetControl = {}));
11
11
  //# sourceMappingURL=types.js.map
@@ -12,5 +12,5 @@ var BuildingBlockType;
12
12
  BuildingBlockType["Chart"] = "chart";
13
13
  BuildingBlockType["Field"] = "field";
14
14
  BuildingBlockType["Table"] = "table";
15
- })(BuildingBlockType = exports.BuildingBlockType || (exports.BuildingBlockType = {}));
15
+ })(BuildingBlockType || (exports.BuildingBlockType = BuildingBlockType = {}));
16
16
  //# sourceMappingURL=types.js.map
@@ -66,6 +66,7 @@ function enhanceConfig(fs, data, manifestPath, manifest) {
66
66
  * @param {Editor} [fs] - the mem-fs editor instance
67
67
  */
68
68
  function generateCustomColumn(basePath, customColumn, fs) {
69
+ var _a;
69
70
  (0, validate_1.validateVersion)(customColumn.minUI5Version);
70
71
  if (!fs) {
71
72
  fs = (0, mem_fs_editor_1.create)((0, mem_fs_1.create)());
@@ -84,7 +85,7 @@ function generateCustomColumn(basePath, customColumn, fs) {
84
85
  tabInfo: customColumn.tabInfo
85
86
  });
86
87
  // add fragment
87
- const viewPath = (0, path_1.join)(completeColumn.path, `${completeColumn.name}.fragment.xml`);
88
+ const viewPath = (0, path_1.join)(completeColumn.path, `${(_a = completeColumn.fragmentFile) !== null && _a !== void 0 ? _a : completeColumn.name}.fragment.xml`);
88
89
  if (completeColumn.control || !fs.exists(viewPath)) {
89
90
  fs.copyTpl((0, templates_1.getTemplatePath)('common/Fragment.xml'), viewPath, completeColumn);
90
91
  }
@@ -1,4 +1,4 @@
1
- import type { CustomElement, InternalCustomElement, Position, EventHandler } from '../common/types';
1
+ import type { CustomElement, InternalCustomElement, Position, EventHandler, CustomFragment } from '../common/types';
2
2
  export declare enum Availability {
3
3
  'Default' = "Default",
4
4
  'Adaptation' = "Adaptation",
@@ -14,7 +14,7 @@ export type ColumnPropertiesType = string[];
14
14
  * Custom Column.
15
15
  *
16
16
  */
17
- export interface CustomTableColumn extends CustomElement, EventHandler {
17
+ export interface CustomTableColumn extends CustomElement, EventHandler, CustomFragment {
18
18
  /**
19
19
  * Name of the routing target
20
20
  */
@@ -6,11 +6,11 @@ var Availability;
6
6
  Availability["Default"] = "Default";
7
7
  Availability["Adaptation"] = "Adaptation";
8
8
  Availability["Hidden"] = "Hidden";
9
- })(Availability = exports.Availability || (exports.Availability = {}));
9
+ })(Availability || (exports.Availability = Availability = {}));
10
10
  var HorizontalAlign;
11
11
  (function (HorizontalAlign) {
12
12
  HorizontalAlign["Begin"] = "Begin";
13
13
  HorizontalAlign["Center"] = "Center";
14
14
  HorizontalAlign["End"] = "End";
15
- })(HorizontalAlign = exports.HorizontalAlign || (exports.HorizontalAlign = {}));
15
+ })(HorizontalAlign || (exports.HorizontalAlign = HorizontalAlign = {}));
16
16
  //# sourceMappingURL=types.js.map
@@ -160,4 +160,10 @@ export interface WriterConfig {
160
160
  */
161
161
  tabInfo?: TabInfo;
162
162
  }
163
+ export interface CustomFragment {
164
+ /**
165
+ * Name of the custom element fragment.
166
+ */
167
+ fragmentFile?: string;
168
+ }
163
169
  //# sourceMappingURL=types.d.ts.map
@@ -9,5 +9,5 @@ var Placement;
9
9
  Placement["After"] = "After";
10
10
  Placement["Before"] = "Before";
11
11
  Placement["End"] = "End";
12
- })(Placement = exports.Placement || (exports.Placement = {}));
12
+ })(Placement || (exports.Placement = Placement = {}));
13
13
  //# sourceMappingURL=types.js.map
@@ -10,5 +10,5 @@ var ControllerExtensionPageType;
10
10
  (function (ControllerExtensionPageType) {
11
11
  ControllerExtensionPageType["ObjectPage"] = "ObjectPage";
12
12
  ControllerExtensionPageType["ListReport"] = "ListReport";
13
- })(ControllerExtensionPageType = exports.ControllerExtensionPageType || (exports.ControllerExtensionPageType = {}));
13
+ })(ControllerExtensionPageType || (exports.ControllerExtensionPageType = ControllerExtensionPageType = {}));
14
14
  //# sourceMappingURL=types.js.map
@@ -175,7 +175,7 @@ function validatePageConfig(basePath, config, fs) {
175
175
  Object.assign(routes, (_k = (_j = (_h = manifest['sap.ui5']) === null || _h === void 0 ? void 0 : _h.routing) === null || _j === void 0 ? void 0 : _j.routes) !== null && _k !== void 0 ? _k : {});
176
176
  }
177
177
  const route = routes[config.navigation.sourcePage];
178
- if (!route || !route.pattern || !route.target) {
178
+ if (!(route === null || route === void 0 ? void 0 : route.pattern) || !route.target) {
179
179
  throw new Error(`Invalid routing configuration for navigation source ${config.navigation.sourcePage}!`);
180
180
  }
181
181
  }
@@ -73,6 +73,7 @@ function enhanceConfig(fs, data, manifestPath, manifest) {
73
73
  * @returns {Promise<Editor>} the updated mem-fs editor instance
74
74
  */
75
75
  function generate(basePath, customSection, manifestTemplateRoot, fs) {
76
+ var _a;
76
77
  (0, validate_1.validateVersion)(customSection.minUI5Version);
77
78
  if (!fs) {
78
79
  fs = (0, mem_fs_editor_1.create)((0, mem_fs_1.create)());
@@ -90,7 +91,7 @@ function generate(basePath, customSection, manifestTemplateRoot, fs) {
90
91
  tabInfo: customSection.tabInfo
91
92
  });
92
93
  // add fragment
93
- const viewPath = (0, path_1.join)(completeSection.path, `${completeSection.name}.fragment.xml`);
94
+ const viewPath = (0, path_1.join)(completeSection.path, `${(_a = completeSection.fragmentFile) !== null && _a !== void 0 ? _a : completeSection.name}.fragment.xml`);
94
95
  if (!fs.exists(viewPath)) {
95
96
  fs.copyTpl((0, templates_1.getTemplatePath)('common/FragmentWithVBox.xml'), viewPath, completeSection);
96
97
  }
@@ -1,5 +1,5 @@
1
- import type { CustomElement, InternalCustomElement, Position, EventHandler } from '../common/types';
2
- export interface CustomSection extends CustomElement, EventHandler {
1
+ import type { CustomElement, InternalCustomElement, Position, EventHandler, CustomFragment } from '../common/types';
2
+ export interface CustomSection extends CustomElement, EventHandler, CustomFragment {
3
3
  /**
4
4
  * Name of the routing target
5
5
  */
@@ -7,7 +7,7 @@ var RequestGroupId;
7
7
  RequestGroupId["Decoration"] = "Decoration";
8
8
  RequestGroupId["Workers"] = "Workers";
9
9
  RequestGroupId["LongRunners"] = "LongRunners";
10
- })(RequestGroupId = exports.RequestGroupId || (exports.RequestGroupId = {}));
10
+ })(RequestGroupId || (exports.RequestGroupId = RequestGroupId = {}));
11
11
  var DesignTime;
12
12
  (function (DesignTime) {
13
13
  DesignTime["Default"] = "Default";
@@ -15,5 +15,5 @@ var DesignTime;
15
15
  DesignTime["NotAdaptable"] = "not-adaptable";
16
16
  DesignTime["NotAdaptableTree"] = "not-adaptable-tree";
17
17
  DesignTime["NotRemovable"] = "not-removable";
18
- })(DesignTime = exports.DesignTime || (exports.DesignTime = {}));
18
+ })(DesignTime || (exports.DesignTime = DesignTime = {}));
19
19
  //# sourceMappingURL=types.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sap-ux/fe-fpm-writer",
3
3
  "description": "SAP Fiori elements flexible programming model writer",
4
- "version": "0.24.2",
4
+ "version": "0.24.4",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -33,7 +33,7 @@
33
33
  "@types/mem-fs": "1.1.2",
34
34
  "@types/mem-fs-editor": "7.0.1",
35
35
  "@types/semver": "7.5.2",
36
- "@sap-ux/project-access": "1.15.4"
36
+ "@sap-ux/project-access": "1.17.0"
37
37
  },
38
38
  "engines": {
39
39
  "pnpm": ">=6.26.1 < 7.0.0 || >=7.1.0",
@@ -14,7 +14,7 @@
14
14
  "width": "<%- width %>",
15
15
  <% } %>
16
16
  "position": <%- JSON.stringify(position) %>,
17
- "template": "<%- ns %>.<%- name %>"
17
+ "template": "<%- ns %>.<%- typeof fragmentFile !== 'undefined' ? fragmentFile : name %>"
18
18
  }
19
19
  }
20
20
  }
@@ -14,7 +14,7 @@
14
14
  "width": "<%- width %>",
15
15
  <% } %>
16
16
  "position": <%- JSON.stringify(position) %>,
17
- "template": "<%- ns %>.<%- name %>"
17
+ "template": "<%- ns %>.<%- typeof fragmentFile !== 'undefined' ? fragmentFile : name %>"
18
18
  <% if (locals.availability) { %>
19
19
  , "availability": "<%- availability %>"
20
20
  <% } %>
@@ -15,7 +15,7 @@
15
15
  "position": <%- JSON.stringify(position) %>,
16
16
  <% if (locals.horizontalAlign) { %> "horizontalAlign": "<%- horizontalAlign %>", <%
17
17
  } %>
18
- "template": "<%- ns %>.<%- name %>"
18
+ "template": "<%- ns %>.<%- typeof fragmentFile !== 'undefined' ? fragmentFile : name %>"
19
19
  <% if (locals.availability) { %> , "availability": "<%- availability %>" <%
20
20
  } %>
21
21
  <% if (locals.properties) { %> , "properties": [
@@ -9,7 +9,7 @@
9
9
  "header": {
10
10
  "facets": {
11
11
  "<%- name %>": {
12
- "template": "<%- ns %>.<%- name %>",
12
+ "template": "<%- ns %>.<%- typeof fragmentFile !== 'undefined' ? fragmentFile : name %>",
13
13
  <% if (typeof edit !== 'undefined') { %>
14
14
  "templateEdit": "<%- edit.ns %>.<%- edit.name %>",
15
15
  <% } %>
@@ -9,7 +9,7 @@
9
9
  "body": {
10
10
  "sections": {
11
11
  "<%- name %>": {
12
- "template": "<%- ns %>.<%- name %>",
12
+ "template": "<%- ns %>.<%- typeof fragmentFile !== 'undefined' ? fragmentFile : name %>",
13
13
  <%if (typeof position !== 'undefined') {%>"position": {
14
14
  <% if (position.placement) { %>
15
15
  "placement": "<%- position.placement %>"<% if (position.anchor) { %>,<% } %>
@@ -11,7 +11,7 @@
11
11
  "<%- parentSection %>": {
12
12
  "subSections": {
13
13
  "<%- name %>": {
14
- "template": "<%- ns %>.<%- name %>",
14
+ "template": "<%- ns %>.<%- typeof fragmentFile !== 'undefined' ? fragmentFile : name %>",
15
15
  <%if (typeof position !== 'undefined') {%>"position": {
16
16
  <% if (position.placement) { %>
17
17
  "placement": "<%- position.placement %>"<% if (position.anchor) { %>,<% } %>