@sap-ux/fe-fpm-writer 0.22.2 → 0.23.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/dist/action/index.js +4 -1
- package/dist/column/index.js +4 -1
- package/dist/common/defaults.d.ts +2 -1
- package/dist/common/defaults.js +12 -2
- package/dist/common/event-handler.d.ts +12 -4
- package/dist/common/event-handler.js +4 -6
- package/dist/filter/index.js +5 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +9 -5
- package/dist/section/index.d.ts +10 -1
- package/dist/section/index.js +57 -5
- package/dist/section/types.d.ts +41 -1
- package/dist/section/types.js +16 -0
- package/dist/view/index.js +4 -1
- package/package.json +3 -3
- package/templates/header-section/1.85/manifest.json +43 -0
- package/templates/header-section/1.86/manifest.json +45 -0
package/dist/action/index.js
CHANGED
|
@@ -78,7 +78,10 @@ function generateCustomAction(basePath, actionConfig, fs) {
|
|
|
78
78
|
const config = enhanceConfig(actionConfig, manifestPath, manifest);
|
|
79
79
|
// Apply event handler
|
|
80
80
|
if (config.eventHandler) {
|
|
81
|
-
config.eventHandler = (0, event_handler_1.applyEventHandlerConfiguration)(fs, config, config.eventHandler,
|
|
81
|
+
config.eventHandler = (0, event_handler_1.applyEventHandlerConfiguration)(fs, config, config.eventHandler, {
|
|
82
|
+
controllerSuffix: false,
|
|
83
|
+
typescript: config.typescript
|
|
84
|
+
}, event_handler_1.contextParameter);
|
|
82
85
|
}
|
|
83
86
|
// enhance manifest with action definition and controller reference
|
|
84
87
|
const actions = enhanceManifestAndGetActionsElementReference(manifest, config.target);
|
package/dist/column/index.js
CHANGED
|
@@ -45,7 +45,10 @@ function enhanceConfig(fs, data, manifestPath, manifest) {
|
|
|
45
45
|
(0, defaults_1.setCommonDefaults)(config, manifestPath, manifest);
|
|
46
46
|
// Apply event handler
|
|
47
47
|
if (config.eventHandler) {
|
|
48
|
-
config.eventHandler = (0, event_handler_1.applyEventHandlerConfiguration)(fs, config, config.eventHandler,
|
|
48
|
+
config.eventHandler = (0, event_handler_1.applyEventHandlerConfiguration)(fs, config, config.eventHandler, {
|
|
49
|
+
controllerSuffix: false,
|
|
50
|
+
typescript: config.typescript
|
|
51
|
+
});
|
|
49
52
|
}
|
|
50
53
|
// generate column content
|
|
51
54
|
const content = config.properties && config.properties.length > 0
|
|
@@ -17,7 +17,8 @@ export declare function setCommonDefaults<T extends CustomElement & Partial<Inte
|
|
|
17
17
|
* if value is passed then "Button" control with 'press' event would be generated
|
|
18
18
|
* if value is not passed then "Text" control would be generated
|
|
19
19
|
* @param {boolean} isController - controls if `controller` should be added to handler path
|
|
20
|
+
* @param {boolean} prefferInput - controls if `input` element should be added to default fragment content
|
|
20
21
|
* @returns default content for fragment
|
|
21
22
|
*/
|
|
22
|
-
export declare function getDefaultFragmentContent(text: string, eventHandler?: string, isController?: boolean): string;
|
|
23
|
+
export declare function getDefaultFragmentContent(text: string, eventHandler?: string, isController?: boolean, prefferInput?: boolean): string;
|
|
23
24
|
//# sourceMappingURL=defaults.d.ts.map
|
package/dist/common/defaults.js
CHANGED
|
@@ -28,15 +28,25 @@ exports.setCommonDefaults = setCommonDefaults;
|
|
|
28
28
|
* if value is passed then "Button" control with 'press' event would be generated
|
|
29
29
|
* if value is not passed then "Text" control would be generated
|
|
30
30
|
* @param {boolean} isController - controls if `controller` should be added to handler path
|
|
31
|
+
* @param {boolean} prefferInput - controls if `input` element should be added to default fragment content
|
|
31
32
|
* @returns default content for fragment
|
|
32
33
|
*/
|
|
33
|
-
function getDefaultFragmentContent(text, eventHandler, isController = false) {
|
|
34
|
+
function getDefaultFragmentContent(text, eventHandler, isController = false, prefferInput = false) {
|
|
34
35
|
let content;
|
|
35
36
|
if (eventHandler) {
|
|
36
37
|
const parts = eventHandler.split('.');
|
|
37
38
|
const method = parts.pop();
|
|
38
39
|
const handler = `${parts.join('/')}${isController ? '.controller' : ''}`;
|
|
39
|
-
|
|
40
|
+
const requireAttr = `core:require="{ handler: '${handler}'}"`;
|
|
41
|
+
if (prefferInput) {
|
|
42
|
+
content = `<Input ${requireAttr} label="${text}" change="handler.${method}" />`;
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
content = `<Button ${requireAttr} text="${text}" press="handler.${method}" />`;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
else if (prefferInput) {
|
|
49
|
+
content = `<Input label="${text}" />`;
|
|
40
50
|
}
|
|
41
51
|
else {
|
|
42
52
|
content = `<Text text="${text}" />`;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import type { Editor } from 'mem-fs-editor';
|
|
2
2
|
import type { EventHandlerConfiguration, InternalCustomElement } from '../common/types';
|
|
3
|
+
/**
|
|
4
|
+
* Interface to describe event handler configuration options used during creation.
|
|
5
|
+
*/
|
|
6
|
+
interface EventHandlerConfigurationOptions {
|
|
7
|
+
controllerSuffix?: boolean;
|
|
8
|
+
typescript?: boolean;
|
|
9
|
+
templatePath?: string;
|
|
10
|
+
eventHandlerFnName?: string;
|
|
11
|
+
}
|
|
3
12
|
/**
|
|
4
13
|
* Interface to describe the input parameters for the generated event handler function.
|
|
5
14
|
*/
|
|
@@ -23,11 +32,10 @@ export declare const contextParameter: EventHandlerTypescriptParameters;
|
|
|
23
32
|
* @param fs - the memfs editor instance
|
|
24
33
|
* @param config - configuration
|
|
25
34
|
* @param eventHandler - eventHandler for creation
|
|
26
|
-
* @param
|
|
27
|
-
* @param typescript - create Typescript file instead of Javascript
|
|
35
|
+
* @param eventHandlerOptions - eventHandler options
|
|
28
36
|
* @param parameters - parameter configurations for the event handler
|
|
29
|
-
* @param templatePath - path to the template without the extension
|
|
30
37
|
* @returns {string} full namespace path to method
|
|
31
38
|
*/
|
|
32
|
-
export declare function applyEventHandlerConfiguration(fs: Editor, config: Partial<InternalCustomElement>, eventHandler: EventHandlerConfiguration | true | string,
|
|
39
|
+
export declare function applyEventHandlerConfiguration(fs: Editor, config: Partial<InternalCustomElement>, eventHandler: EventHandlerConfiguration | true | string, eventHandlerOptions: EventHandlerConfigurationOptions, parameters?: EventHandlerTypescriptParameters): string;
|
|
40
|
+
export {};
|
|
33
41
|
//# sourceMappingURL=event-handler.d.ts.map
|
|
@@ -28,19 +28,17 @@ exports.contextParameter = {
|
|
|
28
28
|
* @param fs - the memfs editor instance
|
|
29
29
|
* @param config - configuration
|
|
30
30
|
* @param eventHandler - eventHandler for creation
|
|
31
|
-
* @param
|
|
32
|
-
* @param typescript - create Typescript file instead of Javascript
|
|
31
|
+
* @param eventHandlerOptions - eventHandler options
|
|
33
32
|
* @param parameters - parameter configurations for the event handler
|
|
34
|
-
* @param templatePath - path to the template without the extension
|
|
35
33
|
* @returns {string} full namespace path to method
|
|
36
34
|
*/
|
|
37
|
-
function applyEventHandlerConfiguration(fs, config, eventHandler,
|
|
35
|
+
function applyEventHandlerConfiguration(fs, config, eventHandler, eventHandlerOptions, parameters = exports.defaultParameter) {
|
|
36
|
+
const { controllerSuffix, typescript, templatePath = 'common/EventHandler' } = eventHandlerOptions;
|
|
37
|
+
let { eventHandlerFnName = 'onPress' } = eventHandlerOptions;
|
|
38
38
|
if (typeof eventHandler === 'string') {
|
|
39
39
|
// Existing event handler is passed - no need for file creation/update
|
|
40
40
|
return eventHandler;
|
|
41
41
|
}
|
|
42
|
-
// New event handler function name - 'onPress' is default
|
|
43
|
-
let eventHandlerFnName = 'onPress';
|
|
44
42
|
let insertScript;
|
|
45
43
|
// By default - use config name for created file name
|
|
46
44
|
let fileName = config.name;
|
package/dist/filter/index.js
CHANGED
|
@@ -53,7 +53,11 @@ function generateCustomFilter(basePath, filterConfig, fs) {
|
|
|
53
53
|
const config = enhanceConfig(filterConfig, manifestPath, manifest);
|
|
54
54
|
// Apply event handler
|
|
55
55
|
if (config.eventHandler) {
|
|
56
|
-
config.eventHandler = (0, event_handler_1.applyEventHandlerConfiguration)(fs, config, config.eventHandler,
|
|
56
|
+
config.eventHandler = (0, event_handler_1.applyEventHandlerConfiguration)(fs, config, config.eventHandler, {
|
|
57
|
+
controllerSuffix: false,
|
|
58
|
+
typescript: config.typescript,
|
|
59
|
+
templatePath: 'filter/Controller'
|
|
60
|
+
}, event_handler_1.contextParameter);
|
|
57
61
|
}
|
|
58
62
|
// enhance manifest with the filter definition and controller reference
|
|
59
63
|
const filters = enhanceManifestAndGetFiltersReference(manifest);
|
package/dist/index.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ export { CustomAction, TargetControl } from './action/types';
|
|
|
4
4
|
export { generateCustomAction } from './action';
|
|
5
5
|
export { CustomTableColumn } from './column/types';
|
|
6
6
|
export { generateCustomColumn } from './column';
|
|
7
|
-
export { CustomSection, CustomSubSection } from './section/types';
|
|
8
|
-
export { generateCustomSection, generateCustomSubSection } from './section';
|
|
7
|
+
export { CustomHeaderSection, CustomSection, CustomSubSection, RequestGroupId, DesignTime } from './section/types';
|
|
8
|
+
export { generateCustomSection, generateCustomSubSection, generateCustomHeaderSection } from './section';
|
|
9
9
|
export { CustomFilter } from './filter/types';
|
|
10
10
|
export { generateCustomFilter } from './filter';
|
|
11
11
|
export { CustomView } from './view/types';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.generateControllerExtension = exports.ControllerExtensionPageType = exports.generateBuildingBlock = exports.BuildingBlockType = exports.validateVersion = exports.validateBasePath = exports.enableFPM = exports.generateCustomView = exports.generateCustomFilter = exports.generateCustomSubSection = exports.generateCustomSection = exports.generateCustomColumn = exports.generateCustomAction = exports.TargetControl = exports.generateListReport = exports.generateObjectPage = exports.generateCustomPage = void 0;
|
|
3
|
+
exports.generateControllerExtension = exports.ControllerExtensionPageType = exports.generateBuildingBlock = exports.BuildingBlockType = exports.validateVersion = exports.validateBasePath = exports.enableFPM = exports.generateCustomView = exports.generateCustomFilter = exports.generateCustomHeaderSection = exports.generateCustomSubSection = exports.generateCustomSection = exports.DesignTime = exports.RequestGroupId = 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; } });
|
|
@@ -11,9 +11,13 @@ var action_1 = require("./action");
|
|
|
11
11
|
Object.defineProperty(exports, "generateCustomAction", { enumerable: true, get: function () { return action_1.generateCustomAction; } });
|
|
12
12
|
var column_1 = require("./column");
|
|
13
13
|
Object.defineProperty(exports, "generateCustomColumn", { enumerable: true, get: function () { return column_1.generateCustomColumn; } });
|
|
14
|
+
var types_2 = require("./section/types");
|
|
15
|
+
Object.defineProperty(exports, "RequestGroupId", { enumerable: true, get: function () { return types_2.RequestGroupId; } });
|
|
16
|
+
Object.defineProperty(exports, "DesignTime", { enumerable: true, get: function () { return types_2.DesignTime; } });
|
|
14
17
|
var section_1 = require("./section");
|
|
15
18
|
Object.defineProperty(exports, "generateCustomSection", { enumerable: true, get: function () { return section_1.generateCustomSection; } });
|
|
16
19
|
Object.defineProperty(exports, "generateCustomSubSection", { enumerable: true, get: function () { return section_1.generateCustomSubSection; } });
|
|
20
|
+
Object.defineProperty(exports, "generateCustomHeaderSection", { enumerable: true, get: function () { return section_1.generateCustomHeaderSection; } });
|
|
17
21
|
var filter_1 = require("./filter");
|
|
18
22
|
Object.defineProperty(exports, "generateCustomFilter", { enumerable: true, get: function () { return filter_1.generateCustomFilter; } });
|
|
19
23
|
var view_1 = require("./view");
|
|
@@ -23,12 +27,12 @@ Object.defineProperty(exports, "enableFPM", { enumerable: true, get: function ()
|
|
|
23
27
|
var validate_1 = require("./common/validate");
|
|
24
28
|
Object.defineProperty(exports, "validateBasePath", { enumerable: true, get: function () { return validate_1.validateBasePath; } });
|
|
25
29
|
Object.defineProperty(exports, "validateVersion", { enumerable: true, get: function () { return validate_1.validateVersion; } });
|
|
26
|
-
var
|
|
27
|
-
Object.defineProperty(exports, "BuildingBlockType", { enumerable: true, get: function () { return
|
|
30
|
+
var types_3 = require("./building-block/types");
|
|
31
|
+
Object.defineProperty(exports, "BuildingBlockType", { enumerable: true, get: function () { return types_3.BuildingBlockType; } });
|
|
28
32
|
var building_block_1 = require("./building-block");
|
|
29
33
|
Object.defineProperty(exports, "generateBuildingBlock", { enumerable: true, get: function () { return building_block_1.generateBuildingBlock; } });
|
|
30
|
-
var
|
|
31
|
-
Object.defineProperty(exports, "ControllerExtensionPageType", { enumerable: true, get: function () { return
|
|
34
|
+
var types_4 = require("./controller-extension/types");
|
|
35
|
+
Object.defineProperty(exports, "ControllerExtensionPageType", { enumerable: true, get: function () { return types_4.ControllerExtensionPageType; } });
|
|
32
36
|
var controller_extension_1 = require("./controller-extension");
|
|
33
37
|
Object.defineProperty(exports, "generateControllerExtension", { enumerable: true, get: function () { return controller_extension_1.generateControllerExtension; } });
|
|
34
38
|
//# sourceMappingURL=index.js.map
|
package/dist/section/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Editor } from 'mem-fs-editor';
|
|
2
|
-
import type { CustomSection, CustomSubSection } from './types';
|
|
2
|
+
import type { CustomHeaderSection, CustomSection, CustomSubSection } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* Get the template folder for the given UI5 version.
|
|
5
5
|
*
|
|
@@ -8,6 +8,15 @@ import type { CustomSection, CustomSubSection } from './types';
|
|
|
8
8
|
* @returns path to the template folder containing the manifest.json ejs template
|
|
9
9
|
*/
|
|
10
10
|
export declare function getManifestRoot(folderName: string, ui5Version?: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Add a custom header section to an existing UI5 application.
|
|
13
|
+
*
|
|
14
|
+
* @param {string} basePath - the base path
|
|
15
|
+
* @param {CustomHeaderSection} customHeaderSection - the custom header section configuration
|
|
16
|
+
* @param {Editor} [fs] - the mem-fs editor instance
|
|
17
|
+
* @returns {Promise<Editor>} the updated mem-fs editor instance
|
|
18
|
+
*/
|
|
19
|
+
export declare function generateCustomHeaderSection(basePath: string, customHeaderSection: CustomHeaderSection, fs?: Editor): Editor;
|
|
11
20
|
/**
|
|
12
21
|
* Add a custom section to an existing UI5 application.
|
|
13
22
|
*
|
package/dist/section/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.generateCustomSubSection = exports.generateCustomSection = exports.getManifestRoot = void 0;
|
|
3
|
+
exports.generateCustomSubSection = exports.generateCustomSection = exports.generateCustomHeaderSection = exports.getManifestRoot = void 0;
|
|
4
4
|
const mem_fs_1 = require("mem-fs");
|
|
5
5
|
const mem_fs_editor_1 = require("mem-fs-editor");
|
|
6
6
|
const path_1 = require("path");
|
|
@@ -52,7 +52,10 @@ function enhanceConfig(fs, data, manifestPath, manifest) {
|
|
|
52
52
|
(0, defaults_1.setCommonDefaults)(config, manifestPath, manifest);
|
|
53
53
|
// Apply event handler
|
|
54
54
|
if (config.eventHandler) {
|
|
55
|
-
config.eventHandler = (0, event_handler_1.applyEventHandlerConfiguration)(fs, config, config.eventHandler,
|
|
55
|
+
config.eventHandler = (0, event_handler_1.applyEventHandlerConfiguration)(fs, config, config.eventHandler, {
|
|
56
|
+
controllerSuffix: false,
|
|
57
|
+
typescript: config.typescript
|
|
58
|
+
});
|
|
56
59
|
}
|
|
57
60
|
// generate section content
|
|
58
61
|
config.content = config.control || (0, defaults_1.getDefaultFragmentContent)(config.name, config.eventHandler);
|
|
@@ -91,8 +94,57 @@ function generate(basePath, customSection, manifestTemplateRoot, fs) {
|
|
|
91
94
|
if (!fs.exists(viewPath)) {
|
|
92
95
|
fs.copyTpl((0, templates_1.getTemplatePath)('common/FragmentWithVBox.xml'), viewPath, completeSection);
|
|
93
96
|
}
|
|
94
|
-
return fs;
|
|
97
|
+
return { editor: fs, section: completeSection };
|
|
95
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* Add a custom header section to an existing UI5 application.
|
|
101
|
+
*
|
|
102
|
+
* @param {string} basePath - the base path
|
|
103
|
+
* @param {CustomHeaderSection} customHeaderSection - the custom header section configuration
|
|
104
|
+
* @param {Editor} [fs] - the mem-fs editor instance
|
|
105
|
+
* @returns {Promise<Editor>} the updated mem-fs editor instance
|
|
106
|
+
*/
|
|
107
|
+
function generateCustomHeaderSection(basePath, customHeaderSection, fs) {
|
|
108
|
+
var _a;
|
|
109
|
+
if (!fs) {
|
|
110
|
+
fs = (0, mem_fs_editor_1.create)((0, mem_fs_1.create)());
|
|
111
|
+
}
|
|
112
|
+
const manifestRoot = getManifestRoot('header-section', customHeaderSection.minUI5Version);
|
|
113
|
+
const minVersion = (0, semver_1.coerce)(customHeaderSection.minUI5Version);
|
|
114
|
+
let editSection;
|
|
115
|
+
// Prepare 'templateEdit' - apply namespace and folder path resolution
|
|
116
|
+
if (customHeaderSection.edit && (!minVersion || (0, semver_1.gte)(minVersion, '1.86.0'))) {
|
|
117
|
+
editSection = customHeaderSection.edit;
|
|
118
|
+
const manifestPath = (0, path_1.join)(basePath, 'webapp/manifest.json');
|
|
119
|
+
const manifest = fs.readJSON(manifestPath);
|
|
120
|
+
// Set folder, ns and path for edit fragment
|
|
121
|
+
(0, defaults_1.setCommonDefaults)(editSection, manifestPath, manifest);
|
|
122
|
+
}
|
|
123
|
+
// Call standard custom section generation
|
|
124
|
+
const { editor, section } = generate(basePath, customHeaderSection, manifestRoot, fs);
|
|
125
|
+
// Handle 'templateEdit' - edit fragment details
|
|
126
|
+
if (editSection) {
|
|
127
|
+
// Apply event handler for edit fragment
|
|
128
|
+
if (editSection.eventHandler) {
|
|
129
|
+
editSection.eventHandler = (0, event_handler_1.applyEventHandlerConfiguration)(editor, editSection, editSection.eventHandler, {
|
|
130
|
+
controllerSuffix: false,
|
|
131
|
+
typescript: section.typescript,
|
|
132
|
+
eventHandlerFnName: 'onChange'
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
// Generate edit fragment content
|
|
136
|
+
editSection.content =
|
|
137
|
+
(_a = editSection.control) !== null && _a !== void 0 ? _a : (0, defaults_1.getDefaultFragmentContent)(editSection.name, editSection.eventHandler, false, true);
|
|
138
|
+
if (editSection.path) {
|
|
139
|
+
const viewPath = (0, path_1.join)(editSection.path, `${editSection.name}.fragment.xml`);
|
|
140
|
+
if (!editor.exists(viewPath)) {
|
|
141
|
+
editor.copyTpl((0, templates_1.getTemplatePath)('common/FragmentWithVBox.xml'), viewPath, editSection);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return editor;
|
|
146
|
+
}
|
|
147
|
+
exports.generateCustomHeaderSection = generateCustomHeaderSection;
|
|
96
148
|
/**
|
|
97
149
|
* Add a custom section to an existing UI5 application.
|
|
98
150
|
*
|
|
@@ -103,7 +155,7 @@ function generate(basePath, customSection, manifestTemplateRoot, fs) {
|
|
|
103
155
|
*/
|
|
104
156
|
function generateCustomSection(basePath, customSection, fs) {
|
|
105
157
|
const manifestRoot = getManifestRoot('section', customSection.minUI5Version);
|
|
106
|
-
return generate(basePath, customSection, manifestRoot, fs);
|
|
158
|
+
return generate(basePath, customSection, manifestRoot, fs).editor;
|
|
107
159
|
}
|
|
108
160
|
exports.generateCustomSection = generateCustomSection;
|
|
109
161
|
/**
|
|
@@ -116,7 +168,7 @@ exports.generateCustomSection = generateCustomSection;
|
|
|
116
168
|
*/
|
|
117
169
|
function generateCustomSubSection(basePath, customSubSection, fs) {
|
|
118
170
|
const manifestRoot = getManifestRoot('subsection', customSubSection.minUI5Version);
|
|
119
|
-
return generate(basePath, customSubSection, manifestRoot, fs);
|
|
171
|
+
return generate(basePath, customSubSection, manifestRoot, fs).editor;
|
|
120
172
|
}
|
|
121
173
|
exports.generateCustomSubSection = generateCustomSubSection;
|
|
122
174
|
//# sourceMappingURL=index.js.map
|
package/dist/section/types.d.ts
CHANGED
|
@@ -17,14 +17,54 @@ export interface CustomSection extends CustomElement, EventHandler {
|
|
|
17
17
|
*/
|
|
18
18
|
control?: string;
|
|
19
19
|
}
|
|
20
|
-
export interface InternalCustomSection extends CustomSection, CustomSubSection, InternalCustomElement {
|
|
20
|
+
export interface InternalCustomSection extends CustomHeaderSection, CustomSection, CustomSubSection, InternalCustomElement {
|
|
21
21
|
content: string;
|
|
22
22
|
dependencies?: string;
|
|
23
23
|
}
|
|
24
|
+
export type HeaderSectionEditProperty = Pick<CustomElement, 'name' | 'folder'> & EventHandler;
|
|
25
|
+
export declare enum RequestGroupId {
|
|
26
|
+
Heroes = "Heroes",
|
|
27
|
+
Decoration = "Decoration",
|
|
28
|
+
Workers = "Workers",
|
|
29
|
+
LongRunners = "LongRunners"
|
|
30
|
+
}
|
|
31
|
+
export declare enum DesignTime {
|
|
32
|
+
Default = "Default",
|
|
33
|
+
NotAdaptableVisibility = "not-adaptable-visibility",
|
|
34
|
+
NotAdaptable = "not-adaptable",
|
|
35
|
+
NotAdaptableTree = "not-adaptable-tree",
|
|
36
|
+
NotRemovable = "not-removable"
|
|
37
|
+
}
|
|
38
|
+
interface FlexSettings {
|
|
39
|
+
designtime: DesignTime;
|
|
40
|
+
}
|
|
41
|
+
export interface CustomHeaderSection extends CustomSection {
|
|
42
|
+
/**
|
|
43
|
+
* Sub title of header section.
|
|
44
|
+
*/
|
|
45
|
+
subTitle?: string;
|
|
46
|
+
/**
|
|
47
|
+
* The fragment for the editable version of the header facet.
|
|
48
|
+
*/
|
|
49
|
+
edit?: HeaderSectionEditProperty;
|
|
50
|
+
/**
|
|
51
|
+
* Defines if the header facet is stashed in personalization.
|
|
52
|
+
*/
|
|
53
|
+
stashed?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Defines the Loading Behavior of Object Page Headers.
|
|
56
|
+
*/
|
|
57
|
+
requestGroupId: RequestGroupId;
|
|
58
|
+
/**
|
|
59
|
+
* Defines the key user adaptation behavior of the header facet.
|
|
60
|
+
*/
|
|
61
|
+
flexSettings: FlexSettings;
|
|
62
|
+
}
|
|
24
63
|
export interface CustomSubSection extends CustomSection {
|
|
25
64
|
/**
|
|
26
65
|
* Id of parent section.
|
|
27
66
|
*/
|
|
28
67
|
parentSection: string;
|
|
29
68
|
}
|
|
69
|
+
export {};
|
|
30
70
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/section/types.js
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DesignTime = exports.RequestGroupId = void 0;
|
|
4
|
+
var RequestGroupId;
|
|
5
|
+
(function (RequestGroupId) {
|
|
6
|
+
RequestGroupId["Heroes"] = "Heroes";
|
|
7
|
+
RequestGroupId["Decoration"] = "Decoration";
|
|
8
|
+
RequestGroupId["Workers"] = "Workers";
|
|
9
|
+
RequestGroupId["LongRunners"] = "LongRunners";
|
|
10
|
+
})(RequestGroupId = exports.RequestGroupId || (exports.RequestGroupId = {}));
|
|
11
|
+
var DesignTime;
|
|
12
|
+
(function (DesignTime) {
|
|
13
|
+
DesignTime["Default"] = "Default";
|
|
14
|
+
DesignTime["NotAdaptableVisibility"] = "not-adaptable-visibility";
|
|
15
|
+
DesignTime["NotAdaptable"] = "not-adaptable";
|
|
16
|
+
DesignTime["NotAdaptableTree"] = "not-adaptable-tree";
|
|
17
|
+
DesignTime["NotRemovable"] = "not-removable";
|
|
18
|
+
})(DesignTime = exports.DesignTime || (exports.DesignTime = {}));
|
|
3
19
|
//# sourceMappingURL=types.js.map
|
package/dist/view/index.js
CHANGED
|
@@ -56,7 +56,10 @@ function enhanceConfig(fs, data, manifestPath, manifest) {
|
|
|
56
56
|
(0, defaults_1.setCommonDefaults)(config, manifestPath, manifest);
|
|
57
57
|
// apply event handler
|
|
58
58
|
if (config.eventHandler) {
|
|
59
|
-
config.eventHandler = (0, event_handler_1.applyEventHandlerConfiguration)(fs, config, config.eventHandler,
|
|
59
|
+
config.eventHandler = (0, event_handler_1.applyEventHandlerConfiguration)(fs, config, config.eventHandler, {
|
|
60
|
+
controllerSuffix: true,
|
|
61
|
+
typescript: config.typescript
|
|
62
|
+
});
|
|
60
63
|
}
|
|
61
64
|
// fill config.views, merge new data into existing views
|
|
62
65
|
mergeViews(config, manifest);
|
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.
|
|
4
|
+
"version": "0.23.0",
|
|
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.3.9",
|
|
36
|
-
"@sap-ux/project-access": "1.
|
|
36
|
+
"@sap-ux/project-access": "1.12.1"
|
|
37
37
|
},
|
|
38
38
|
"engines": {
|
|
39
39
|
"pnpm": ">=6.26.1 < 7.0.0 || >=7.1.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"scripts": {
|
|
43
43
|
"build": "tsc --build",
|
|
44
44
|
"watch": "tsc --watch",
|
|
45
|
-
"clean": "rimraf dist test/test-output *.tsbuildinfo",
|
|
45
|
+
"clean": "rimraf --glob dist test/test-output *.tsbuildinfo",
|
|
46
46
|
"format": "prettier --write '**/*.{js,json,ts,yaml,yml}' --ignore-path ../../.prettierignore",
|
|
47
47
|
"lint": "eslint . --ext .ts",
|
|
48
48
|
"lint:fix": "eslint . --ext .ts --fix",
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"sap.ui5": {
|
|
3
|
+
"routing": {
|
|
4
|
+
"targets": {
|
|
5
|
+
"<%- target %>": {
|
|
6
|
+
"options": {
|
|
7
|
+
"settings": {
|
|
8
|
+
"content": {
|
|
9
|
+
"header": {
|
|
10
|
+
"facets": {
|
|
11
|
+
"<%- name %>": {
|
|
12
|
+
"name": "<%- ns %>.<%- name %>",
|
|
13
|
+
"type": "XMLFragment",
|
|
14
|
+
<%if (typeof position !== 'undefined') {%>"position": {
|
|
15
|
+
<% if (position.placement) { %>
|
|
16
|
+
"placement": "<%- position.placement %>"<% if (position.anchor) { %>,<% } %>
|
|
17
|
+
<% } %>
|
|
18
|
+
<% if (position.anchor) { %>
|
|
19
|
+
"anchor": "<%- position.anchor %>"
|
|
20
|
+
<% } %>
|
|
21
|
+
},<% } %>
|
|
22
|
+
"title": "<%- title %>",
|
|
23
|
+
<% if (subTitle) { %>
|
|
24
|
+
"subTitle": "<%- subTitle %>",
|
|
25
|
+
<% } %>
|
|
26
|
+
<% if (typeof stashed !== 'undefined') { %>
|
|
27
|
+
"stashed": "<%- stashed %>",
|
|
28
|
+
<% } %>
|
|
29
|
+
"requestGroupId": "<%- requestGroupId %>",
|
|
30
|
+
"flexSettings": {
|
|
31
|
+
"designtime": "<%- flexSettings.designtime %>"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"sap.ui5": {
|
|
3
|
+
"routing": {
|
|
4
|
+
"targets": {
|
|
5
|
+
"<%- target %>": {
|
|
6
|
+
"options": {
|
|
7
|
+
"settings": {
|
|
8
|
+
"content": {
|
|
9
|
+
"header": {
|
|
10
|
+
"facets": {
|
|
11
|
+
"<%- name %>": {
|
|
12
|
+
"template": "<%- ns %>.<%- name %>",
|
|
13
|
+
<% if (typeof edit !== 'undefined') { %>
|
|
14
|
+
"templateEdit": "<%- edit.ns %>.<%- edit.name %>"
|
|
15
|
+
<% } %>,
|
|
16
|
+
<%if (typeof position !== 'undefined') {%>"position": {
|
|
17
|
+
<% if (position.placement) { %>
|
|
18
|
+
"placement": "<%- position.placement %>"<% if (position.anchor) { %>,<% } %>
|
|
19
|
+
<% } %>
|
|
20
|
+
<% if (position.anchor) { %>
|
|
21
|
+
"anchor": "<%- position.anchor %>"
|
|
22
|
+
<% } %>
|
|
23
|
+
},<% } %>
|
|
24
|
+
"title": "<%- title %>",
|
|
25
|
+
<% if (typeof subTitle !== 'undefined') { %>
|
|
26
|
+
"subTitle": "<%- subTitle %>",
|
|
27
|
+
<% } %>
|
|
28
|
+
<% if (typeof stashed !== 'undefined') { %>
|
|
29
|
+
"stashed": "<%- stashed %>",
|
|
30
|
+
<% } %>
|
|
31
|
+
"requestGroupId": "<%- requestGroupId %>",
|
|
32
|
+
"flexSettings": {
|
|
33
|
+
"designtime": "<%- flexSettings.designtime %>"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|