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

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.
@@ -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
  */
@@ -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
@@ -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
  */
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.3",
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.16.1"
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) { %>,<% } %>