@sap-ux/fe-fpm-writer 0.9.0 → 0.12.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.
package/README.md CHANGED
@@ -25,7 +25,6 @@ const fs = await generateCustomPage(
25
25
  name: 'MyCustomPage',
26
26
  entity: 'Booking',
27
27
  navigation: {
28
- sourceEntity: 'Travel',
29
28
  sourcePage: 'TravelObjectPage',
30
29
  navEntity: '_Booking'
31
30
  }
@@ -17,6 +17,7 @@ export interface CustomAction extends CustomElement {
17
17
  text: string;
18
18
  visible?: string | true;
19
19
  enabled?: string | true;
20
+ requiresSelection?: boolean;
20
21
  position?: Position;
21
22
  /**
22
23
  * If not set (i.e. undefined) then no event handler is linked. If it is set true, a new one is created and linked to the action.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/action/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEtF,oBAAY,aAAa;IACrB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,OAAO,2CAA2C;IAClD,KAAK,yCAAyC;CACjD;AAED,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,aAAa,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,YAAa,SAAQ,aAAa;IAC/C,MAAM,EAAE,kBAAkB,CAAC;IAC3B,QAAQ,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACxB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACxB,QAAQ,CAAC,EAAE,QAAQ,CAAC;QACpB;;;WAGG;QACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAChC,CAAC;CACL;AAED,oBAAY,oBAAoB,GAAG,YAAY,GAAG,qBAAqB,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/action/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEtF,oBAAY,aAAa;IACrB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,OAAO,2CAA2C;IAClD,KAAK,yCAAyC;CACjD;AAED,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,aAAa,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,YAAa,SAAQ,aAAa;IAC/C,MAAM,EAAE,kBAAkB,CAAC;IAC3B,QAAQ,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACxB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACxB,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAC5B,QAAQ,CAAC,EAAE,QAAQ,CAAC;QACpB;;;WAGG;QACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAChC,CAAC;CACL;AAED,oBAAY,oBAAoB,GAAG,YAAY,GAAG,qBAAqB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { Editor } from 'mem-fs-editor';
2
+ import type { BuildingBlock, BuildingBlockConfig } from './types';
3
+ /**
4
+ * Generates a building block into the provided xml view file.
5
+ *
6
+ * @param {string} basePath - the base path
7
+ * @param {BuildingBlockConfig} config - the building block configuration parameters
8
+ * @param {Editor} [fs] - the memfs editor instance
9
+ * @returns {Editor} the updated memfs editor instance
10
+ */
11
+ export declare function generateBuildingBlock<T extends BuildingBlock>(basePath: string, config: BuildingBlockConfig<T>, fs?: Editor): Editor;
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/building-block/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAMlE;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,aAAa,EACzD,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC,EAC9B,EAAE,CAAC,EAAE,MAAM,GACZ,MAAM,CAgBR"}
@@ -0,0 +1,157 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ var __importDefault = (this && this.__importDefault) || function (mod) {
22
+ return (mod && mod.__esModule) ? mod : { "default": mod };
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.generateBuildingBlock = void 0;
26
+ const mem_fs_1 = require("mem-fs");
27
+ const mem_fs_editor_1 = require("mem-fs-editor");
28
+ const ejs_1 = require("ejs");
29
+ const path_1 = require("path");
30
+ const xmldom_1 = require("@xmldom/xmldom");
31
+ const xpath = __importStar(require("xpath"));
32
+ const xml_formatter_1 = __importDefault(require("xml-formatter"));
33
+ const validate_1 = require("../common/validate");
34
+ /**
35
+ * Generates a building block into the provided xml view file.
36
+ *
37
+ * @param {string} basePath - the base path
38
+ * @param {BuildingBlockConfig} config - the building block configuration parameters
39
+ * @param {Editor} [fs] - the memfs editor instance
40
+ * @returns {Editor} the updated memfs editor instance
41
+ */
42
+ function generateBuildingBlock(basePath, config, fs) {
43
+ // Validate the base and view paths
44
+ if (!fs) {
45
+ fs = mem_fs_editor_1.create(mem_fs_1.create());
46
+ }
47
+ validate_1.validateBasePath(basePath, fs);
48
+ if (!fs.exists(path_1.join(basePath, config.viewOrFragmentPath))) {
49
+ throw new Error(`Invalid view path ${config.viewOrFragmentPath}.`);
50
+ }
51
+ // Read the view xml and template files and update contents of the view xml file
52
+ const xmlDocument = getUI5XmlDocument(basePath, config.viewOrFragmentPath, fs);
53
+ const templateDocument = getTemplateDocument(config.buildingBlockData, xmlDocument, fs);
54
+ fs = updateViewFile(basePath, config.viewOrFragmentPath, config.aggregationPath, xmlDocument, templateDocument, fs);
55
+ return fs;
56
+ }
57
+ exports.generateBuildingBlock = generateBuildingBlock;
58
+ /**
59
+ * Returns the UI5 xml file document (view/fragment).
60
+ *
61
+ * @param {string} basePath - the base path
62
+ * @param {string} viewPath - the path of the xml view relative to the base path
63
+ * @param {Editor} fs - the memfs editor instance
64
+ * @returns {Document} the view xml file document
65
+ */
66
+ function getUI5XmlDocument(basePath, viewPath, fs) {
67
+ let viewContent;
68
+ try {
69
+ viewContent = fs.read(path_1.join(basePath, viewPath));
70
+ }
71
+ catch (error) {
72
+ throw new Error(`Unable to read xml view file. Details: ${validate_1.getErrorMessage(error)}`);
73
+ }
74
+ const errorHandler = (level, message) => {
75
+ throw new Error(`Unable to parse xml view file. Details: [${level}] - ${message}`);
76
+ };
77
+ // Parse the xml view content
78
+ let viewDocument;
79
+ try {
80
+ viewDocument = new xmldom_1.DOMParser({ errorHandler }).parseFromString(viewContent);
81
+ }
82
+ catch (error) {
83
+ throw new Error(`Unable to parse xml view file. Details: ${validate_1.getErrorMessage(error)}`);
84
+ }
85
+ return viewDocument;
86
+ }
87
+ /**
88
+ * Returns the macros namespace from the xml document if it exists or creates a new one and returns it.
89
+ *
90
+ * @param {Document} ui5XmlDocument - the view/fragment xml file document
91
+ * @returns {string} the macros namespace
92
+ */
93
+ function getOrAddMacrosNamespace(ui5XmlDocument) {
94
+ const namespaceMap = ui5XmlDocument.firstChild._nsMap;
95
+ const macrosNamespaceEntry = Object.entries(namespaceMap).find(([_, value]) => value === 'sap.fe.macros');
96
+ if (!macrosNamespaceEntry) {
97
+ ui5XmlDocument.firstChild._nsMap['macros'] = 'sap.fe.macros';
98
+ }
99
+ return macrosNamespaceEntry ? macrosNamespaceEntry[0] : 'macros';
100
+ }
101
+ /**
102
+ * Returns the template xml file document.
103
+ *
104
+ * @param {BuildingBlock} buildingBlockData - the building block data
105
+ * @param {Document} viewDocument - the view xml file document
106
+ * @param {Editor} fs - the memfs editor instance
107
+ * @returns {Document} the template xml file document
108
+ */
109
+ function getTemplateDocument(buildingBlockData, viewDocument, fs) {
110
+ const templateFolderName = buildingBlockData.buildingBlockType;
111
+ const templateFilePath = path_1.join(__dirname, `../../templates/building-block/${templateFolderName}/View.xml`);
112
+ const templateContent = ejs_1.render(fs.read(templateFilePath), {
113
+ macrosNamespace: getOrAddMacrosNamespace(viewDocument),
114
+ data: buildingBlockData
115
+ });
116
+ const errorHandler = (level, message) => {
117
+ throw new Error(`Unable to parse template file with building block data. Details: [${level}] - ${message}`);
118
+ };
119
+ // Parse the rendered template content
120
+ let templateDocument;
121
+ try {
122
+ templateDocument = new xmldom_1.DOMParser({ errorHandler }).parseFromString(templateContent);
123
+ }
124
+ catch (error) {
125
+ throw new Error(`Unable to parse template file with building block data. Details: ${validate_1.getErrorMessage(error)}`);
126
+ }
127
+ return templateDocument;
128
+ }
129
+ /**
130
+ * Updates the view file by inserting the template as a child of the element specified in the aggregated xpath.
131
+ *
132
+ * @param {string} basePath - the base path
133
+ * @param {string} viewPath - the path of the xml view relative to the base path
134
+ * @param {string} aggregationPath - the aggregation xpath
135
+ * @param {Document} viewDocument - the view xml document
136
+ * @param {Document} templateDocument - the template xml document
137
+ * @param {Editor} [fs] - the memfs editor instance
138
+ * @returns {Editor} the updated memfs editor instance
139
+ */
140
+ function updateViewFile(basePath, viewPath, aggregationPath, viewDocument, templateDocument, fs) {
141
+ const xpathSelect = xpath.useNamespaces(viewDocument.firstChild._nsMap);
142
+ // Find target aggregated element and append template as child
143
+ const targetNodes = xpathSelect(aggregationPath, viewDocument);
144
+ if (targetNodes && targetNodes.length > 0) {
145
+ const targetNode = targetNodes[0];
146
+ const sourceNode = viewDocument.importNode(templateDocument.documentElement, true);
147
+ targetNode.appendChild(sourceNode);
148
+ // Serialize and format new view xml document
149
+ const newXmlContent = new xmldom_1.XMLSerializer().serializeToString(viewDocument);
150
+ fs.write(path_1.join(basePath, viewPath), xml_formatter_1.default(newXmlContent));
151
+ }
152
+ else {
153
+ throw new Error(`Aggregation control not found ${aggregationPath}.`);
154
+ }
155
+ return fs;
156
+ }
157
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/building-block/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAiD;AACjD,iDAAuC;AACvC,6BAA6B;AAE7B,+BAA4B;AAE5B,2CAA0D;AAC1D,6CAA+B;AAC/B,kEAAmC;AACnC,iDAAuE;AAEvE;;;;;;;GAOG;AACH,SAAgB,qBAAqB,CACjC,QAAgB,EAChB,MAA8B,EAC9B,EAAW;IAEX,mCAAmC;IACnC,IAAI,CAAC,EAAE,EAAE;QACL,EAAE,GAAG,sBAAM,CAAC,eAAa,EAAE,CAAC,CAAC;KAChC;IACD,2BAAgB,CAAC,Q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+ export declare enum BuildingBlockType {
7
+ FilterBar = "filter-bar",
8
+ Chart = "chart",
9
+ Field = "field"
10
+ }
11
+ /**
12
+ * Represents a building block control.
13
+ */
14
+ export interface BuildingBlock {
15
+ /**
16
+ * Building block type.
17
+ */
18
+ buildingBlockType: BuildingBlockType;
19
+ /**
20
+ * Defines the path of the context used in the current page or block. This setting is defined by the framework.
21
+ */
22
+ contextPath?: string;
23
+ /**
24
+ * ID of the building block.
25
+ */
26
+ id: string;
27
+ /**
28
+ * Defines the relative path of the property in the metamodel, based on the current contextPath.
29
+ */
30
+ metaPath?: string;
31
+ }
32
+ /**
33
+ * Represents a Chart building block control.
34
+ * Usually, a contextPath and metaPath is expected.
35
+ *
36
+ * @example
37
+ * <macro:Chart id="Mychart" contextPath="/RootEntity" metaPath="@com.sap.vocabularies.UI.v1.Chart" />
38
+ * @extends {BuildingBlock}
39
+ */
40
+ export interface Chart extends BuildingBlock {
41
+ /**
42
+ * ID of the FilterBar building block associated with the chart.
43
+ */
44
+ filterBar?: string;
45
+ /**
46
+ * Sets the personalization of the chart
47
+ */
48
+ personalization?: boolean | string;
49
+ /**
50
+ * Specifies the selection mode.
51
+ */
52
+ selectionMode?: string;
53
+ /**
54
+ * An event triggered when chart selections are changed.
55
+ * The event contains information about the data selected/deselected and the Boolean flag that indicates
56
+ * whether data is selected or deselected.
57
+ */
58
+ selectionChange?: string;
59
+ }
60
+ /**
61
+ * Represents a custom filter to be used inside the FilterBar.
62
+ * The template for the FilterField has to be provided as the default aggregation.
63
+ */
64
+ export interface FilterField {
65
+ /**
66
+ * Reference to the key of another filter already displayed in the table to properly place this one.
67
+ */
68
+ anchor: string;
69
+ /**
70
+ * The property name of the FilterField.
71
+ */
72
+ key: string;
73
+ /**
74
+ * The text that will be displayed for this FilterField.
75
+ */
76
+ label: string;
77
+ /**
78
+ * If set the search will be automatically triggered, when a filter value was changed.
79
+ */
80
+ liveMode: boolean;
81
+ /**
82
+ * Defines where this filter should be placed relative to the defined anchor.
83
+ * Allowed values are `Before` and `After`.
84
+ */
85
+ placement: 'Before' | 'After';
86
+ /**
87
+ * Parameter which sets the visibility of the FilterBar building block.
88
+ */
89
+ visible: boolean;
90
+ }
91
+ /**
92
+ * Represents a Filter Bar building block control.
93
+ * Usually, a SelectionFields annotation is expected.
94
+ *
95
+ * @example
96
+ * <macro:FilterBar id="MyFilterBar" metaPath="@com.sap.vocabularies.UI.v1.SelectionFields" />
97
+ * @extends {BuildingBlock}
98
+ */
99
+ export interface FilterBar extends BuildingBlock {
100
+ /**
101
+ * This event is fired after either a filter value or the visibility of a filter item has been changed.
102
+ * The event contains conditions that will be used as filters.
103
+ */
104
+ filterChanged?: string;
105
+ /**
106
+ * This event is fired when the Go button is pressed or after a condition change.
107
+ */
108
+ search?: string;
109
+ }
110
+ /**
111
+ * Represents the format options for a field control.
112
+ */
113
+ export interface FieldFormatOptions {
114
+ /**
115
+ * Defines how the field value and associated text will be displayed together.
116
+ * Allowed values are "Value", "Description", "ValueDescription" and "DescriptionValue"
117
+ */
118
+ displayMode?: 'Value' | 'Description' | 'ValueDescription' | 'DescriptionValue';
119
+ /**
120
+ * Defines if and how the field measure will be displayed.
121
+ * Allowed values are "Hidden" and "ReadOnly"
122
+ */
123
+ measureDisplayMode?: 'Hidden' | 'ReadOnly';
124
+ /**
125
+ * Defines how the full text will be displayed.
126
+ * Allowed values are "InPlace" and "Popover"
127
+ */
128
+ textExpandBehaviorDisplay?: 'InPlace' | 'Popover';
129
+ /**
130
+ * Maximum number of lines for multiline texts in edit mode.
131
+ */
132
+ textLinesEdit?: number;
133
+ /**
134
+ * Maximum number of characters from the beginning of the text field that are shown initially.
135
+ */
136
+ textMaxCharactersDisplay?: number;
137
+ /**
138
+ * Maximum number of lines that multiline texts in edit mode can grow to.
139
+ */
140
+ textMaxLines?: number;
141
+ }
142
+ /**
143
+ * Building block for creating a field based on the metadata provided by OData V4.
144
+ * Usually, a DataField or DataPoint annotation is expected, but the field can also be used to display
145
+ * a property from the entity type.
146
+ *
147
+ * @example
148
+ * <macro:Field id="MyField" metaPath="MyProperty" />
149
+ * @extends {BuildingBlock}
150
+ */
151
+ export interface Field extends BuildingBlock {
152
+ /**
153
+ * A set of format options that can be configured.
154
+ */
155
+ formatOptions?: FieldFormatOptions;
156
+ /**
157
+ * An expression that allows you to control the read-only state of the field.
158
+ * If you do not set any expression, SAP Fiori elements hooks into the standard lifecycle
159
+ * to determine the current state.
160
+ */
161
+ readOnly?: boolean;
162
+ /**
163
+ * Option to add semantic objects to a field.
164
+ * Valid options are either a single semantic object, a stringified array of semantic objects
165
+ * or a single binding expression returning either a single semantic object or an array of semantic objects
166
+ */
167
+ semanticObject?: string;
168
+ }
169
+ /**
170
+ * Building block for creating a Form based on the metadata provided by OData V4.
171
+ * It is designed to work based on a FieldGroup annotation but can also work if you provide a
172
+ * ReferenceFacet or a CollectionFacet.
173
+ *
174
+ * @example
175
+ * <macro:Form id="MyForm" metaPath="@com.sap.vocabularies.UI.v1.FieldGroup#GeneralInformation" />
176
+ * @extends {BuildingBlock}
177
+ */
178
+ export interface Form extends BuildingBlock {
179
+ /**
180
+ * The title of the form control.
181
+ */
182
+ title?: string;
183
+ }
184
+ /**
185
+ * Building block used to create a form element containing a label and a field.
186
+ *
187
+ * @extends {BuildingBlock}
188
+ */
189
+ export interface FormElement extends BuildingBlock {
190
+ /**
191
+ * Label shown for the field. If not set, the label from the annotations will be shown.
192
+ */
193
+ label: string;
194
+ /**
195
+ * If set to false, the FormElement is not rendered.
196
+ */
197
+ visible: boolean;
198
+ }
199
+ /**
200
+ * Building block used to create a micro chart based on the metadata provided by OData V4.
201
+ *
202
+ * @extends {BuildingBlock}
203
+ */
204
+ export interface MicroChart extends BuildingBlock {
205
+ /**
206
+ * Batch group ID along with which this call should be grouped.
207
+ */
208
+ batchGroupId?: string;
209
+ /**
210
+ * Show blank space in case there is no data in the chart.
211
+ */
212
+ hideOnNoData?: boolean;
213
+ /**
214
+ * To control the rendering of Title, Subtitle and Currency Labels. When the size is xs then we do not see
215
+ * the inner labels of the micro chart as well.
216
+ */
217
+ showOnlyChart?: boolean;
218
+ /**
219
+ * Size of the micro chart control.
220
+ */
221
+ size?: string;
222
+ }
223
+ /**
224
+ * Building block used to create a paginator control.
225
+ *
226
+ * @example
227
+ * <macro:Paginator id="someID" />
228
+ * @extends {BuildingBlock}
229
+ */
230
+ export declare type Paginator = BuildingBlock;
231
+ /**
232
+ * Building block used to create the share functionality.
233
+ * Please note that the 'Share in SAP Jam' option is only available on platforms that are integrated with SAP Jam.
234
+ * If you are consuming this macro in an environment where the SAP Fiori launchpad is not available,
235
+ * then the 'Save as Tile' option is not visible.
236
+ *
237
+ * @example
238
+ * <macro:Share id="someID" visible="true" />
239
+ * @extends {BuildingBlock}
240
+ */
241
+ export interface Share extends BuildingBlock {
242
+ /**
243
+ * If set to false, the share control is not rendered.
244
+ */
245
+ visible: boolean;
246
+ }
247
+ /**
248
+ * Building block used to create a table based on the metadata provided by OData V4.
249
+ * Usually, a LineItem or PresentationVariant annotation is expected,
250
+ * but the table building block can also be used to display an EntitySet.
251
+ *
252
+ * @example
253
+ * <macro:Table id="MyTable" metaPath="@com.sap.vocabularies.UI.v1.LineItem" />
254
+ * @extends {BuildingBlock}
255
+ */
256
+ export interface Table extends BuildingBlock {
257
+ /**
258
+ * An expression that allows you to control the 'busy' state of the table.
259
+ */
260
+ busy?: boolean;
261
+ /**
262
+ * Specifies the header text that is shown in the table.
263
+ */
264
+ enableAutoColumnWidth?: boolean;
265
+ /**
266
+ * Controls if the export functionality of the table is enabled or not.
267
+ * Default value is true.
268
+ */
269
+ enableExport?: boolean;
270
+ /**
271
+ * Controls whether the table can be opened in fullscreen mode or not.
272
+ */
273
+ enableFullScreen?: boolean;
274
+ /**
275
+ * Controls if the paste functionality of the table is enabled or not.
276
+ */
277
+ enablePaste?: boolean;
278
+ /**
279
+ * ID of the FilterBar building block associated with the table.
280
+ */
281
+ filterBar?: string;
282
+ /**
283
+ * Specifies the header text that is shown in the table.
284
+ */
285
+ header?: string;
286
+ /**
287
+ * Controls if the header text should be shown or not.
288
+ * Default value is true.
289
+ */
290
+ headerVisible?: boolean;
291
+ /**
292
+ * Defines whether to display the search action.
293
+ */
294
+ isSearchable?: boolean;
295
+ /**
296
+ * Groups menu actions by key.
297
+ */
298
+ menu?: string;
299
+ /**
300
+ * Controls which options should be enabled for the table personalization dialog.
301
+ * If it is set to `true`, all possible options for this kind of table are enabled.
302
+ * If it is set to `false`, personalization is disabled.
303
+ * You can also provide a more granular control for the personalization by providing a comma-separated list
304
+ * with the options you want to be available.
305
+ * Available options are: `Sort`, `Column` and `Filter`
306
+ */
307
+ personalization?: boolean | 'Sort' | 'Column' | 'Filter';
308
+ /**
309
+ * An expression that allows you to control the 'read-only' state of the table.
310
+ * If you do not set any expression, SAP Fiori elements hooks into the standard lifecycle to determine
311
+ * the current state.
312
+ */
313
+ readOnly?: boolean;
314
+ /**
315
+ * Defines the selection mode to be used by the table.
316
+ * Allowed values are `None`, `Single`, `Multi` or `Auto`
317
+ */
318
+ selectionMode?: 'None' | 'Single' | 'Multi' | 'Auto';
319
+ /**
320
+ * Defines the type of table that will be used by the building block to render the data.
321
+ * Allowed values are `GridTable` and `ResponsiveTable`.
322
+ * Default value is `ResponsiveTable`.
323
+ */
324
+ type?: 'GridTable' | 'ResponsiveTable';
325
+ /**
326
+ * Controls the kind of variant management that should be enabled for the table.
327
+ * Allowed values are `Page`, `Control` and `None`.
328
+ * If the table is used within a SAP Fiori elements template, the default value will be taken from
329
+ * the current page variant management.
330
+ * Otherwise it's `None`.
331
+ */
332
+ variantManagement?: string;
333
+ }
334
+ /**
335
+ * Input configuration for the generate function.
336
+ */
337
+ export interface BuildingBlockConfig<T extends BuildingBlock> {
338
+ /**
339
+ * The path of the view or fragment xml file relative to the base path.
340
+ */
341
+ viewOrFragmentPath: string;
342
+ /**
343
+ * The aggregation xpath.
344
+ */
345
+ aggregationPath: string;
346
+ /**
347
+ * The building block parameters.
348
+ */
349
+ buildingBlockData: T;
350
+ }
351
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/building-block/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,oBAAY,iBAAiB;IACzB,SAAS,eAAe;IACxB,KAAK,UAAU;IACf,KAAK,UAAU;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B;;OAEG;IACH,iBAAiB,EAAE,iBAAiB,CAAC;IAErC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,KAAM,SAAQ,aAAa;IACxC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACnC;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IACxB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,SAAS,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC9B;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,SAAU,SAAQ,aAAa;IAC5C;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC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O,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,KAAM,SAAQ,aAAa;IACxC;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACzD;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;IACrD;;;;OAIG;IACH,IAAI,CAAC,EAAE,WAAW,GAAG,iBAAiB,CAAC;IACvC;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,aAAa;IACxD;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,iBAAiB,EAAE,CAAC,CAAC;CACxB"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BuildingBlockType = void 0;
4
+ /**
5
+ * Building block type.
6
+ *
7
+ * @enum {string}
8
+ */
9
+ var BuildingBlockType;
10
+ (function (BuildingBlockType) {
11
+ BuildingBlockType["FilterBar"] = "filter-bar";
12
+ BuildingBlockType["Chart"] = "chart";
13
+ BuildingBlockType["Field"] = "field";
14
+ })(BuildingBlockType = exports.BuildingBlockType || (exports.BuildingBlockType = {}));
15
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/building-block/types.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IACzB,6CAAwB,CAAA;IACxB,oCAAe,CAAA;IACf,oCAAe,CAAA;AACnB,CAAC,EAJW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAI5B"}
@@ -14,4 +14,11 @@ export declare function validateVersion(ui5Version?: number): boolean;
14
14
  * @returns true if the path is valid, otherwise, throws and error
15
15
  */
16
16
  export declare function validateBasePath(basePath: string, fs?: Editor): boolean;
17
+ /**
18
+ * Returns the message property if the error is an instance of `Error` else a string representation of the error.
19
+ *
20
+ * @param error {Error | unknown} - the error instance
21
+ * @returns {string} the error message
22
+ */
23
+ export declare function getErrorMessage(error: Error | unknown): string;
17
24
  //# sourceMappingURL=validate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/common/validate.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAG5C;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAK5D;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAkBvE"}
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/common/validate.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAG5C;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAK5D;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAkBvE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,GAAG,MAAM,CAE9D"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateBasePath = exports.validateVersion = void 0;
3
+ exports.getErrorMessage = exports.validateBasePath = exports.validateVersion = void 0;
4
4
  const path_1 = require("path");
5
5
  const mem_fs_1 = require("mem-fs");
6
6
  const mem_fs_editor_1 = require("mem-fs-editor");
@@ -42,4 +42,14 @@ function validateBasePath(basePath, fs) {
42
42
  return true;
43
43
  }
44
44
  exports.validateBasePath = validateBasePath;
45
+ /**
46
+ * Returns the message property if the error is an instance of `Error` else a string representation of the error.
47
+ *
48
+ * @param error {Error | unknown} - the error instance
49
+ * @returns {string} the error message
50
+ */
51
+ function getErrorMessage(error) {
52
+ return error instanceof Error ? error.message : String(error);
53
+ }
54
+ exports.getErrorMessage = getErrorMessage;
45
55
  //# sourceMappingURL=validate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/common/validate.ts"],"names":[],"mappings":";;;AAAA,+BAA4B;AAC5B,mCAAiD;AAEjD,iDAAuC;AAEvC;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,UAAmB;IAC/C,IAAI,UAAU,IAAI,UAAU,GAAG,IAAI,EAAE;QACjC,MAAM,IAAI,KAAK,CAAC,8EAA8E,CAAC,CAAC;KACnG;IACD,OAAO,IAAI,CAAC;AAChB,CAAC;AALD,0CAKC;AAED;;;;;;GAMG;AACH,SAAgB,gBA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,MAAM,CAAC,YAAY,CAAC,EAAE;QAC1B,MAAM,IAAI,KAAK,CAAC,qDAAqD,YAAY,EAAE,CAAC,CAAC;KACxF;SAAM;QACH,MAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAQ,CAAC;QAClD,IAAI,CAAC,mBAAA,QAAQ,CAAC,SAAS,CAAC,0CAAE,YAAY,0CAAE,IAAI,0CAAG,kBAAkB,OAAM,SAAS,CAAC,KAAK,KAAK,EAAE;YACzF,MAAM,IAAI,KAAK,CACX,gHAAgH,CACnH,CAAC;SACL;KACJ;IAED,OAAO,IAAI,CAAC;AAChB,CAAC;AAlBD,4CAkBC;AAED;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,KAAsB;IAClD,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAClE,CAAC;AAFD,0CAEC"}
package/dist/index.d.ts CHANGED
@@ -10,4 +10,6 @@ export { CustomView } from './view/types';
10
10
  export { generateCustomView } from './view';
11
11
  export { enableFPM, FPMConfig } from './app';
12
12
  export { validateBasePath, validateVersion } from './common/validate';
13
+ export { BuildingBlockType, FilterBar, Chart, Field, FieldFormatOptions } from './building-block/types';
14
+ export { generateBuildingBlock } from './building-block';
13
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAEpF,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,EAAE,iBAA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K,EAAE,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACxG,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC"}
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateVersion = exports.validateBasePath = exports.enableFPM = exports.generateCustomView = exports.generateCustomSection = exports.generateCustomColumn = exports.generateCustomAction = exports.TargetControl = exports.generateListReport = exports.generateObjectPage = exports.generateCustomPage = void 0;
3
+ exports.generateBuildingBlock = exports.BuildingBlockType = exports.validateVersion = exports.validateBasePath = exports.enableFPM = exports.generateCustomView = exports.generateCustomSection = exports.generateCustomColumn = exports.generateCustomAction = exports.TargetControl = exports.generateListReport = exports.generateObjectPage = exports.generateCustomPage = void 0;
4
4
  var page_1 = require("./page");
5
5
  Object.defineProperty(exports, "generateCustomPage", { enumerable: true, get: function () { return page_1.generateCustomPage; } });
6
6
  Object.defineProperty(exports, "generateObjectPage", { enumerable: true, get: function () { return page_1.generateObjectPage; } });
@@ -20,4 +20,8 @@ Object.defineProperty(exports, "enableFPM", { enumerable: true, get: function ()
20
20
  var validate_1 = require("./common/validate");
21
21
  Object.defineProperty(exports, "validateBasePath", { enumerable: true, get: function () { return validate_1.validateBasePath; } });
22
22
  Object.defineProperty(exports, "validateVersion", { enumerable: true, get: function () { return validate_1.validateVersion; } });
23
+ var types_2 = require("./building-block/types");
24
+ Object.defineProperty(exports, "BuildingBlockType", { enumerable: true, get: function () { return types_2.BuildingBlockType; } });
25
+ var building_block_1 = require("./building-block");
26
+ Object.defineProperty(exports, "generateBuildingBlock", { enumerable: true, get: function () { return building_block_1.generateBuildingBlock; } });
23
27
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,+BAAoF;AAA3E,0GAAA,kBAAkB,OAAA;AAAE,0GAAA,kBAAkB,OAAA;AAAE,0GAAA,kBAAkB,OAAA;AAEnE,wCAA6D;AAAtC,sGAAA,aAAa,OAAA;AACpC,mCAAgD;AAAvC,8GAAA,oBAAoB,OAAA;AAG7B,mCAAgD;AAAvC,8GAAA,oBAAoB,OAAA;AAG7B,qCAAkD;AAAzC,gHAAA,qBAAqB,OAAA;AAG9B,+BAA4C;AAAnC,0GAAA,kBAAkB,OAAA;AAE3B,6BAA6C;AAApC,gGAAA,SAAS,OAAA;AAElB,8CAAsE;AAA7D,4GAAA,gBAAgB,OAAA;AAAE,2GAAA,eAAe,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,+BAAoF;AAA3E,0GAAA,kBAAkB,OAAA;AAAE,0GAAA,kBAAkB,OAAA;AAAE,0GAAA,kBAAkB,OAAA;AAEnE,wCAA6D;AAAtC,sGAAA,aAAa,OAAA;AACpC,mCAAgD;AAAvC,8GAAA,oBAAoB,OAAA;AAG7B,mCAAgD;AAAvC,8GAAA,oBAAoB,OAAA;AAG7B,qCAAkD;AAAzC,gHAAA,qBAAqB,OAAA;AAG9B,+BAA4C;AAAnC,0GAAA,kBAAkB,OAAA;AAE3B,6BAA6C;AAApC,gGAAA,SAAS,OAAA;AAElB,8CAAsE;AAA7D,4GAAA,gBAAgB,OAAA;AAAE,2GAAA,eAAe,OAAA;AAE1C,gDAAwG;AAA/F,0GAAA,iBAAiB,OAAA;AAC1B,mDAAyD;AAAhD,uHAAA,qBAAqB,OAAA"}
@@ -3,12 +3,28 @@ import type { ManifestNamespace } from '@sap-ux/ui5-config';
3
3
  import type { CustomPage, FCL, InternalCustomPage, InternalObjectPage, ObjectPage, Navigation, InternalListReport } from './types';
4
4
  import type { Manifest } from '../common/types';
5
5
  /**
6
- * Add a new route to the provided route array, and update existing routes if necessary (e.g. if targets are defined as arrays for FCL).
6
+ * Suffix for patterns to support arbitrary paramters
7
+ */
8
+ export declare const PATTERN_SUFFIX = ":?query:";
9
+ /**
10
+ * Generates the pattern for a new route based on the input.
11
+ *
12
+ * @param routes existing routes
13
+ * @param targetEntity entity of the target
14
+ * @param nav navigation object
15
+ * @returns the generated pattern as string
16
+ */
17
+ export declare function generateRoutePattern(routes: ManifestNamespace.Route[], targetEntity: string, nav?: Navigation): string;
18
+ /**
19
+ * Generates the target property for a route based on exiting routes, configurations and the target's name.
7
20
  *
8
- * @param routes existing application routes (from the manifest)
9
- * @param config configuration object
21
+ * @param routes existing routes
22
+ * @param name name of the target page
23
+ * @param fcl optional flag if FCL is enabled
24
+ * @param nav navigation object
25
+ * @returns the target property of a route
10
26
  */
11
- export declare function updateRoutes(routes: ManifestNamespace.Route[], config: InternalCustomPage | InternalObjectPage | InternalListReport): void;
27
+ export declare function generateRouteTarget(routes: ManifestNamespace.Route[], name: string, fcl?: boolean, nav?: Navigation): string | [string] | [ManifestNamespace.RouteTargetObject];
12
28
  /**
13
29
  * Create a function that can be used as JsonReplace when calling extendJson.
14
30
  *
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/page/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,KAAK,EACR,UAAU,EACV,GAAG,EACH,kBAAkB,EAClB,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,kBAAkB,EACrB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGhD;;;;;GAKG;AACH,wBAAgB,YAAY,CACxB,MAAM,EAAE,iBAAiB,CAAC,KAAK,EAAE,EACjC,MAAM,EAAE,kBAAkB,GAAG,kBAAkB,GAAG,kBAAkB,QAwBvE;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC1C,MAAM,EAAE,kBAAkB,GAAG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,MAAM,EAAE,kBAAkB,GAAG,kBAAkB,GAAG,kBAAkB,GACrE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,GAAG,CAmBlC;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,QAAQ,EAAE,UAAU,CAAC,EAAE,UAAU,GAAG,GAAG,CAe7E;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,UAAU,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CA2BxG"}
@@ -1,43 +1,72 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validatePageConfig = exports.getFclConfig = exports.getManifestJsonExtensionHelper = exports.updateRoutes = void 0;
3
+ exports.validatePageConfig = exports.getFclConfig = exports.getManifestJsonExtensionHelper = exports.generateRouteTarget = exports.generateRoutePattern = exports.PATTERN_SUFFIX = void 0;
4
4
  const path_1 = require("path");
5
5
  const validate_1 = require("../common/validate");
6
6
  const defaults_1 = require("../common/defaults");
7
7
  /**
8
- * Add a new route to the provided route array, and update existing routes if necessary (e.g. if targets are defined as arrays for FCL).
8
+ * Suffix for patterns to support arbitrary paramters
9
+ */
10
+ exports.PATTERN_SUFFIX = ':?query:';
11
+ /**
12
+ * Generates the pattern for a new route based on the input.
9
13
  *
10
- * @param routes existing application routes (from the manifest)
11
- * @param config configuration object
14
+ * @param routes existing routes
15
+ * @param targetEntity entity of the target
16
+ * @param nav navigation object
17
+ * @returns the generated pattern as string
12
18
  */
13
- function updateRoutes(routes, config) {
14
- var _a, _b;
15
- const newRoute = {
16
- name: `${config.entity}${config.name}`
17
- };
18
- if (config.navigation) {
19
- const sourceRoute = routes.find((route) => { var _a; return route.name === ((_a = config.navigation) === null || _a === void 0 ? void 0 : _a.sourcePage); });
20
- const pattern = {
21
- base: (_a = sourceRoute === null || sourceRoute === void 0 ? void 0 : sourceRoute.pattern) === null || _a === void 0 ? void 0 : _a.replace(':?query:', ''),
22
- navEntity: config.navigation.navEntity,
23
- navKey: config.navigation.navKey ? `({${config.navigation.navEntity}Key})` : ''
24
- };
25
- newRoute.pattern = `${pattern.base}/${pattern.navEntity}${pattern.navKey}:?query:`;
26
- // FCL only supports 3 columns, therefore, show the page in fullscreen if it is the 4th level of navigation
27
- if (((_b = sourceRoute === null || sourceRoute === void 0 ? void 0 : sourceRoute.target) === null || _b === void 0 ? void 0 : _b.constructor) === Array && sourceRoute.target.length < 3) {
28
- newRoute.target = [...sourceRoute.target, newRoute.name];
19
+ function generateRoutePattern(routes, targetEntity, nav) {
20
+ var _a;
21
+ const parts = [];
22
+ if ((nav === null || nav === void 0 ? void 0 : nav.sourcePage) && nav.navEntity) {
23
+ const sourceRoute = routes.find((route) => route.name === nav.sourcePage);
24
+ if (sourceRoute === null || sourceRoute === void 0 ? void 0 : sourceRoute.pattern) {
25
+ const basePattern = sourceRoute.pattern.replace(exports.PATTERN_SUFFIX, '');
26
+ if (basePattern) {
27
+ parts.push(basePattern);
28
+ parts.push('/');
29
+ parts.push(nav.navEntity);
30
+ }
31
+ else {
32
+ parts.push(targetEntity);
33
+ }
29
34
  }
30
35
  else {
31
- newRoute.target = config.fcl ? [newRoute.name] : newRoute.name;
36
+ throw new Error('Navigation source invalid');
32
37
  }
33
38
  }
34
- else {
35
- newRoute.pattern = routes.length > 0 ? `${config.entity}:?query:` : ':?query:';
36
- newRoute.target = config.fcl ? [newRoute.name] : newRoute.name;
39
+ else if (routes.length > 0) {
40
+ parts.push(targetEntity);
41
+ }
42
+ if (nav === null || nav === void 0 ? void 0 : nav.navKey) {
43
+ parts.push(`({${(_a = nav === null || nav === void 0 ? void 0 : nav.navEntity) !== null && _a !== void 0 ? _a : targetEntity}Key})`);
44
+ }
45
+ parts.push(exports.PATTERN_SUFFIX);
46
+ return parts.join('');
47
+ }
48
+ exports.generateRoutePattern = generateRoutePattern;
49
+ /**
50
+ * Generates the target property for a route based on exiting routes, configurations and the target's name.
51
+ *
52
+ * @param routes existing routes
53
+ * @param name name of the target page
54
+ * @param fcl optional flag if FCL is enabled
55
+ * @param nav navigation object
56
+ * @returns the target property of a route
57
+ */
58
+ function generateRouteTarget(routes, name, fcl, nav) {
59
+ var _a;
60
+ if (nav === null || nav === void 0 ? void 0 : nav.sourcePage) {
61
+ const sourceRoute = routes.find((route) => route.name === nav.sourcePage);
62
+ // FCL only supports 3 columns, therefore, show the page in fullscreen if it is the 4th level of navigation
63
+ if (fcl && ((_a = sourceRoute === null || sourceRoute === void 0 ? void 0 : sourceRoute.target) === null || _a === void 0 ? void 0 : _a.constructor) === Array && sourceRoute.target.length < 3) {
64
+ return [...sourceRoute.target, name];
65
+ }
37
66
  }
38
- routes.push(newRoute);
67
+ return fcl ? [name] : name;
39
68
  }
40
- exports.updateRoutes = updateRoutes;
69
+ exports.generateRouteTarget = generateRouteTarget;
41
70
  /**
42
71
  * Create a function that can be used as JsonReplace when calling extendJson.
43
72
  *
@@ -52,7 +81,12 @@ function getManifestJsonExtensionHelper(config) {
52
81
  value.routes = (_a = value.routes) !== null && _a !== void 0 ? _a : [];
53
82
  break;
54
83
  case 'routes':
55
- updateRoutes(value, config);
84
+ const routes = value;
85
+ routes.push({
86
+ name: `${config.entity}${config.name}`,
87
+ pattern: generateRoutePattern(routes, config.entity, config.navigation),
88
+ target: generateRouteTarget(routes, `${config.entity}${config.name}`, config.fcl, config.navigation)
89
+ });
56
90
  break;
57
91
  default:
58
92
  break;
@@ -98,23 +132,23 @@ function validatePageConfig(basePath, config, fs) {
98
132
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
99
133
  validate_1.validateBasePath(basePath, fs);
100
134
  // validate config against the manifest
101
- const manifest = fs.readJSON(path_1.join(basePath, 'webapp/manifest.json'));
102
- if (config.navigation) {
103
- if (!((_c = (_b = (_a = manifest['sap.ui5']) === null || _a === void 0 ? void 0 : _a.routing) === null || _b === void 0 ? void 0 : _b.targets) === null || _c === void 0 ? void 0 : _c[config.navigation.sourcePage])) {
135
+ if ((_a = config.navigation) === null || _a === void 0 ? void 0 : _a.sourcePage) {
136
+ const manifest = fs.readJSON(path_1.join(basePath, 'webapp/manifest.json'));
137
+ if (!((_d = (_c = (_b = manifest['sap.ui5']) === null || _b === void 0 ? void 0 : _b.routing) === null || _c === void 0 ? void 0 : _c.targets) === null || _d === void 0 ? void 0 : _d[config.navigation.sourcePage])) {
104
138
  throw new Error(`Could not find navigation source ${config.navigation.sourcePage}!`);
105
139
  }
106
140
  const routes = {};
107
- if (((_f = (_e = (_d = manifest['sap.ui5']) === null || _d === void 0 ? void 0 : _d.routing) === null || _e === void 0 ? void 0 : _e.routes) === null || _f === void 0 ? void 0 : _f.constructor) === Array) {
141
+ if (((_g = (_f = (_e = manifest['sap.ui5']) === null || _e === void 0 ? void 0 : _e.routing) === null || _f === void 0 ? void 0 : _f.routes) === null || _g === void 0 ? void 0 : _g.constructor) === Array) {
108
142
  manifest['sap.ui5'].routing.routes.forEach((routeWithName) => {
109
143
  routes[routeWithName.name] = routeWithName;
110
144
  });
111
145
  }
112
146
  else {
113
- Object.assign(routes, (_j = (_h = (_g = manifest['sap.ui5']) === null || _g === void 0 ? void 0 : _g.routing) === null || _h === void 0 ? void 0 : _h.routes) !== null && _j !== void 0 ? _j : {});
147
+ 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 : {});
114
148
  }
115
- const route = routes[(_k = config.navigation) === null || _k === void 0 ? void 0 : _k.sourcePage];
149
+ const route = routes[config.navigation.sourcePage];
116
150
  if (!route || !route.pattern || !route.target) {
117
- throw new Error(`Missing or invalid routing configuration for navigation source ${config.navigation.sourcePage}!`);
151
+ throw new Error(`Invalid routing configuration for navigation source ${config.navigation.sourcePage}!`);
118
152
  }
119
153
  }
120
154
  return fs;
@@ -1 +1 @@
1
- {"version":3,"file":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IAAI,CAAC,GAAG,aAAa,CAAC;YAC/C,CAAC,CAAC,CAAC;SACN;aAAM;YACH,MAAM,CAAC,MAAM,CAAC,MAAM,oBAAE,QAAQ,CAAC,SAAS,CAAC,0CAAE,OAAO,0CAAE,MAAM,mCAAI,EAAE,CAAC,CAAC;SACrE;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QACnD,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;YAC3C,MAAM,IAAI,KAAK,CAAC,uDAAuD,MAAM,CAAC,UAAU,CAAC,UAAU,GAAG,CAAC,CAAC;SAC3G;KACJ;IAED,OAAO,EAAE,CAAC;AACd,CAAC;AA3BD,gDA2BC"}
@@ -6,15 +6,11 @@ export interface Navigation {
6
6
  /**
7
7
  * Source of the navigation to the custom page
8
8
  */
9
- sourcePage: string;
10
- /**
11
- * Source entity that is use as the base part of the route
12
- */
13
- sourceEntity: string;
9
+ sourcePage?: string;
14
10
  /**
15
11
  * Name of the navigation entity
16
12
  */
17
- navEntity: string;
13
+ navEntity?: string;
18
14
  /**
19
15
  * If set to true, then the generated route will point to a specific entity, otherwise, it will point to a list of the entities.
20
16
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/page/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE5E;;GAEG;AACH,MAAM,WAAW,UAAU;IACvB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACjC,WAAW,CAAC,EAAE,MAAM,GAAG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;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,UAAW,SAAQ,aAAa;IAC7C;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,GAAG;QACtB;;WAEG;QACH,MAAM,CAAC,EAAE,OAAO,CAAC;KACpB,CAAC;IAEF;;OAEG;IACH,IAAI,CAAC,EAAE;QACH;;WAEG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACL;AAED,MAAM,WAAW,GAAG;IAChB;;OAEG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;IAEd;;;OAGG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,GAAG,gBAAgB,GAAG,gBAAgB,CAAC;CACjF;AAED;;GAEG;AACH,oBAAY,kBAAkB,GAAG,UAAU,GAAG,qBAAqB,GAAG,GAAG,CAAC;AAE1E,oBAAY,kBAAkB,GAAG,UAAU,GAAG,GAAG,GAAG;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,UAAU,CAAC,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,GAAG,CAAA;CAAE,CAAC;AAEnH,oBAAY,kBAAkB,GAAG,UAAU,GAAG,GAAG,GAAG;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,QAAQ,EAAE,GAAG,CAAA;CAAE,CAAC"}
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.9.0",
4
+ "version": "0.12.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -18,11 +18,13 @@
18
18
  "templates"
19
19
  ],
20
20
  "dependencies": {
21
+ "@xmldom/xmldom": "0.8.2",
21
22
  "ejs": "3.1.7",
22
23
  "mem-fs": "2.1.0",
23
24
  "mem-fs-editor": "9.4.0",
24
- "xml-js": "1.6.11",
25
- "semver": "7.3.5"
25
+ "semver": "7.3.5",
26
+ "xml-formatter": "2.6.1",
27
+ "xpath": "0.0.32"
26
28
  },
27
29
  "devDependencies": {
28
30
  "@types/ejs": "3.1.0",
@@ -2,7 +2,8 @@
2
2
  "<%- name %>": {
3
3
  "press": "<%- settings.eventHandler %>",
4
4
  "visible": <%- settings.visible -%>,
5
- "enabled": <%- settings.enabled -%>,
5
+ "enabled": <%- settings.enabled -%><%if (settings.requiresSelection !== undefined) {%>,
6
+ "requiresSelection": <%- settings.requiresSelection -%><% } %>,
6
7
  "text": "<%- settings.text %>"<%if (settings.position) {%>,
7
8
  "position": {
8
9
  "placement": "<%- settings.position.placement %>",
@@ -0,0 +1,9 @@
1
+ <<%- macrosNamespace %>:Chart
2
+ id="<%- data.id %>"<% if (data.metaPath) { %>
3
+ metaPath="<%- data.metaPath %>"<% } %><% if (data.contextPath) { %>
4
+ contextPath="<%- data.contextPath %>"<% } %><% if (data.filterBar) { %>
5
+ filterBar="<%- data.filterBar %>"<% } %><% if (data.personalization) { %>
6
+ personalization="<%- data.personalization %>"<% } %><% if (data.selectionMode) { %>
7
+ selectionMode="<%- data.selectionMode %>"<% } %><% if (data.selectionChange) { %>
8
+ selectionChange="<%- data.selectionChange %>"<% } %>
9
+ />
@@ -0,0 +1,8 @@
1
+ <<%- macrosNamespace %>:Field
2
+ id="<%- data.id %>"<% if (data.metaPath) { %>
3
+ metaPath="<%- data.metaPath %>"<% } %><% if (data.contextPath) { %>
4
+ contextPath="<%- data.contextPath %>"<% } %><% if (data.formatOptions) { %>
5
+ formatOptions="<%- data.formatOptions %>"<% } %><% if (data.readOnly) { %>
6
+ readOnly="<%- data.readOnly %>"<% } %><% if (data.semanticObject) { %>
7
+ semanticObject="<%- data.semanticObject %>"<% } %>
8
+ />
@@ -0,0 +1,7 @@
1
+ <<%- macrosNamespace %>:FilterBar
2
+ id="<%- data.id %>"<% if (data.metaPath) { %>
3
+ metaPath="<%- data.metaPath %>"<% } %><% if (data.contextPath) { %>
4
+ contextPath="<%- data.contextPath %>"<% } %><% if (data.search) { %>
5
+ search="<%- data.search %>"<% } %><% if (data.filterChanged) { %>
6
+ filterChanged="<%- data.filterChanged %>"<% } %>
7
+ />