@sap-ux/preview-middleware 0.16.139 → 0.16.140

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/client/adp/api-handler.js +142 -142
  2. package/dist/client/adp/command-executor.js +75 -75
  3. package/dist/client/adp/control-utils.js +44 -44
  4. package/dist/client/adp/controllers/BaseDialog.controller.js +187 -187
  5. package/dist/client/adp/controllers/ControllerExtension.controller.js +213 -213
  6. package/dist/client/adp/controllers/ExtensionPoint.controller.js +138 -138
  7. package/dist/client/adp/init-dialogs.js +157 -157
  8. package/dist/client/adp/quick-actions/common/add-controller-to-page.js +54 -54
  9. package/dist/client/adp/quick-actions/common/create-page-action.js +49 -49
  10. package/dist/client/adp/quick-actions/common/op-add-custom-section.js +35 -35
  11. package/dist/client/adp/quick-actions/common/op-add-header-field.js +47 -47
  12. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +100 -100
  13. package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +69 -69
  14. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +95 -95
  15. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +56 -56
  16. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +67 -67
  17. package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +57 -57
  18. package/dist/client/adp/quick-actions/fe-v2/registry.js +71 -71
  19. package/dist/client/adp/quick-actions/fe-v2/utils.js +75 -75
  20. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +47 -47
  21. package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +45 -45
  22. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +45 -45
  23. package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +55 -55
  24. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +82 -82
  25. package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +52 -52
  26. package/dist/client/adp/quick-actions/fe-v4/registry.js +55 -55
  27. package/dist/client/adp/quick-actions/fe-v4/utils.js +47 -47
  28. package/dist/client/adp/quick-actions/load.js +44 -44
  29. package/dist/client/adp/utils.js +160 -160
  30. package/dist/client/cpe/changes/index.js +10 -10
  31. package/dist/client/cpe/changes/validator.js +34 -34
  32. package/dist/client/cpe/documentation.js +164 -164
  33. package/dist/client/cpe/feature-service.js +36 -36
  34. package/dist/client/cpe/logger.js +30 -30
  35. package/dist/client/cpe/outline/editable.js +37 -37
  36. package/dist/client/cpe/outline/nodes.js +217 -217
  37. package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
  38. package/dist/client/cpe/quick-actions/registry.js +143 -143
  39. package/dist/client/cpe/quick-actions/utils.js +92 -92
  40. package/dist/client/cpe/types.js +4 -4
  41. package/dist/client/cpe/ui5-utils.js +33 -33
  42. package/dist/client/cpe/utils.js +138 -138
  43. package/dist/client/flp/WorkspaceConnector.js +86 -86
  44. package/dist/client/flp/common.js +28 -28
  45. package/dist/client/flp/enableFakeConnector.js +83 -83
  46. package/dist/client/flp/initConnectors.js +30 -30
  47. package/dist/client/flp/initRta.js +178 -178
  48. package/dist/client/i18n.js +56 -56
  49. package/dist/client/tsconfig.tsbuildinfo +1 -0
  50. package/dist/client/utils/application.js +32 -32
  51. package/dist/client/utils/core.js +68 -68
  52. package/dist/client/utils/error.js +19 -19
  53. package/dist/client/utils/fe-v4.js +114 -114
  54. package/dist/client/utils/version.js +85 -85
  55. package/package.json +3 -3
@@ -1,116 +1,116 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/ui/core/Component", "./core", "sap/ui/rta/command/CommandFactory", "../cpe/utils"], function (Component, ___core, CommandFactory, ___cpe_utils) {
4
- "use strict";
5
-
6
- const isA = ___core["isA"];
7
- const getOverlay = ___cpe_utils["getOverlay"];
8
- /**
9
- * Gets app component of a v4 project.
10
- *
11
- * @param control - ManagedObject.
12
- * @returns AppComponent.
13
- */
14
- function getAppComponent(control) {
15
- const ownerComponent = Component.getOwnerComponentFor(control);
16
- if (ownerComponent?.isA('sap.fe.core.TemplateComponent')) {
17
- return ownerComponent.getAppComponent();
18
- }
19
- return undefined;
20
- }
21
-
22
- /**
23
- * Gets reference id of the app.
24
- *
25
- * @param control - ManagedObject.
26
- * @returns string.
27
- */
28
- function getReference(control) {
29
- const manifest = getAppComponent(control)?.getManifest();
30
- return manifest?.['sap.app']?.id ?? '';
31
- }
32
-
33
- /**
34
- * Determines the page type of v4 app.
35
- *
36
- * @param control - ManagedObject.
37
- * @returns 'ObjectPage' | 'ListReport' | undefined.
38
- */
39
- function getV4PageType(control) {
40
- const component = Component.getOwnerComponentFor(control);
41
- if (!component?.isA('sap.fe.core.TemplateComponent')) {
42
- return undefined;
43
- }
44
- const view = component.getRootControl();
45
- const name = view.getViewName();
46
- if (name === 'sap.fe.templates.ObjectPage.ObjectPage') {
47
- return 'ObjectPage';
48
- }
49
- if (name === 'sap.fe.templates.ListReport.ListReport') {
50
- return 'ListReport';
51
- }
52
- return undefined;
53
- }
54
-
55
- /**
56
- * Get the containing page name of a control.
57
- *
58
- * @param control - UI5 control instance.
59
- * @returns Page name to which the control belongs.
60
- */
61
- function getPageName(control) {
62
- const component = Component.getOwnerComponentFor(control);
63
- if (!isA('sap.fe.core.TemplateComponent', component)) {
64
- return undefined;
65
- }
66
- const view = component.getRootControl();
67
- return view.getId().split('::').pop();
68
- }
69
- function getConfigMapControlIdMap(page, propertyPathSegments) {
70
- if (page && !propertyPathSegments.length) {
71
- return page;
72
- }
73
- if (page) {
74
- return `${page}-${propertyPathSegments.join('/')}`;
75
- }
76
- return propertyPathSegments.join('/');
77
- }
78
-
79
- /**
80
- * Get the modified value for a control.
81
- * @param modifiedControl - The modified control.
82
- * @param flexSettings - Flex Settings of the control.
83
- * @param propertyChanges - The change object
84
- *
85
- * @returns A Promise resolving to an array of FlexCommand objects.
86
- */
87
- async function createManifestPropertyChange(modifiedControl, flexSettings, propertyChanges) {
88
- const overlay = getOverlay(modifiedControl);
89
- if (!overlay) {
90
- return undefined;
91
- }
92
- const overlayData = overlay?.getDesignTimeMetadata().getData();
93
- const manifestPropertyPath = overlayData.manifestPropertyPath(modifiedControl);
94
- const [manifestPropertyChange] = overlayData.manifestPropertyChange(propertyChanges, manifestPropertyPath, modifiedControl);
95
- const modifiedValue = {
96
- reference: getReference(modifiedControl),
97
- appComponent: manifestPropertyChange.appComponent,
98
- changeType: manifestPropertyChange.changeSpecificData.appDescriptorChangeType,
99
- parameters: manifestPropertyChange.changeSpecificData.content.parameters,
100
- selector: manifestPropertyChange.selector
101
- };
102
- const command = await CommandFactory.getCommandFor(modifiedControl, 'appDescriptor', modifiedValue, null, flexSettings);
103
- return command;
104
- }
105
- var __exports = {
106
- __esModule: true
107
- };
108
- __exports.getAppComponent = getAppComponent;
109
- __exports.getReference = getReference;
110
- __exports.getV4PageType = getV4PageType;
111
- __exports.getPageName = getPageName;
112
- __exports.getConfigMapControlIdMap = getConfigMapControlIdMap;
113
- __exports.createManifestPropertyChange = createManifestPropertyChange;
114
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/core/Component", "./core", "sap/ui/rta/command/CommandFactory", "../cpe/utils"], function (Component, ___core, CommandFactory, ___cpe_utils) {
4
+ "use strict";
5
+
6
+ const isA = ___core["isA"];
7
+ const getOverlay = ___cpe_utils["getOverlay"];
8
+ /**
9
+ * Gets app component of a v4 project.
10
+ *
11
+ * @param control - ManagedObject.
12
+ * @returns AppComponent.
13
+ */
14
+ function getAppComponent(control) {
15
+ const ownerComponent = Component.getOwnerComponentFor(control);
16
+ if (ownerComponent?.isA('sap.fe.core.TemplateComponent')) {
17
+ return ownerComponent.getAppComponent();
18
+ }
19
+ return undefined;
20
+ }
21
+
22
+ /**
23
+ * Gets reference id of the app.
24
+ *
25
+ * @param control - ManagedObject.
26
+ * @returns string.
27
+ */
28
+ function getReference(control) {
29
+ const manifest = getAppComponent(control)?.getManifest();
30
+ return manifest?.['sap.app']?.id ?? '';
31
+ }
32
+
33
+ /**
34
+ * Determines the page type of v4 app.
35
+ *
36
+ * @param control - ManagedObject.
37
+ * @returns 'ObjectPage' | 'ListReport' | undefined.
38
+ */
39
+ function getV4PageType(control) {
40
+ const component = Component.getOwnerComponentFor(control);
41
+ if (!component?.isA('sap.fe.core.TemplateComponent')) {
42
+ return undefined;
43
+ }
44
+ const view = component.getRootControl();
45
+ const name = view.getViewName();
46
+ if (name === 'sap.fe.templates.ObjectPage.ObjectPage') {
47
+ return 'ObjectPage';
48
+ }
49
+ if (name === 'sap.fe.templates.ListReport.ListReport') {
50
+ return 'ListReport';
51
+ }
52
+ return undefined;
53
+ }
54
+
55
+ /**
56
+ * Get the containing page name of a control.
57
+ *
58
+ * @param control - UI5 control instance.
59
+ * @returns Page name to which the control belongs.
60
+ */
61
+ function getPageName(control) {
62
+ const component = Component.getOwnerComponentFor(control);
63
+ if (!isA('sap.fe.core.TemplateComponent', component)) {
64
+ return undefined;
65
+ }
66
+ const view = component.getRootControl();
67
+ return view.getId().split('::').pop();
68
+ }
69
+ function getConfigMapControlIdMap(page, propertyPathSegments) {
70
+ if (page && !propertyPathSegments.length) {
71
+ return page;
72
+ }
73
+ if (page) {
74
+ return `${page}-${propertyPathSegments.join('/')}`;
75
+ }
76
+ return propertyPathSegments.join('/');
77
+ }
78
+
79
+ /**
80
+ * Get the modified value for a control.
81
+ * @param modifiedControl - The modified control.
82
+ * @param flexSettings - Flex Settings of the control.
83
+ * @param propertyChanges - The change object
84
+ *
85
+ * @returns A Promise resolving to an array of FlexCommand objects.
86
+ */
87
+ async function createManifestPropertyChange(modifiedControl, flexSettings, propertyChanges) {
88
+ const overlay = getOverlay(modifiedControl);
89
+ if (!overlay) {
90
+ return undefined;
91
+ }
92
+ const overlayData = overlay?.getDesignTimeMetadata().getData();
93
+ const manifestPropertyPath = overlayData.manifestPropertyPath(modifiedControl);
94
+ const [manifestPropertyChange] = overlayData.manifestPropertyChange(propertyChanges, manifestPropertyPath, modifiedControl);
95
+ const modifiedValue = {
96
+ reference: getReference(modifiedControl),
97
+ appComponent: manifestPropertyChange.appComponent,
98
+ changeType: manifestPropertyChange.changeSpecificData.appDescriptorChangeType,
99
+ parameters: manifestPropertyChange.changeSpecificData.content.parameters,
100
+ selector: manifestPropertyChange.selector
101
+ };
102
+ const command = await CommandFactory.getCommandFor(modifiedControl, 'appDescriptor', modifiedValue, null, flexSettings);
103
+ return command;
104
+ }
105
+ var __exports = {
106
+ __esModule: true
107
+ };
108
+ __exports.getAppComponent = getAppComponent;
109
+ __exports.getReference = getReference;
110
+ __exports.getV4PageType = getV4PageType;
111
+ __exports.getPageName = getPageName;
112
+ __exports.getConfigMapControlIdMap = getConfigMapControlIdMap;
113
+ __exports.createManifestPropertyChange = createManifestPropertyChange;
114
+ return __exports;
115
115
  });
116
116
  //# sourceMappingURL=fe-v4.js.map
@@ -1,87 +1,87 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/ui/VersionInfo", "sap/base/Log"], function (VersionInfo, Log) {
4
- "use strict";
5
-
6
- /**
7
- * Default minimal supported UI5 version
8
- */
9
- const minVersionInfo = {
10
- major: 1,
11
- minor: 71
12
- };
13
-
14
- /**
15
- * Retrieve the UI5 version from sap.ui.core library
16
- *
17
- * @returns Ui5VersionInfo
18
- */
19
- async function getUi5Version() {
20
- let version = (await VersionInfo.load({
21
- library: 'sap.ui.core'
22
- }))?.version;
23
- if (!version) {
24
- Log.error('Could not get UI5 version of application. Using 1.121.0 as fallback.');
25
- version = '1.121.0';
26
- }
27
- const [major, minor, patch] = version.split('.').map(versionPart => parseInt(versionPart, 10));
28
- return {
29
- major: major,
30
- minor: minor,
31
- patch: patch
32
- };
33
- }
34
-
35
- /**
36
- * Checks if the given version is lower than the required minimal version.
37
- * @param ui5VersionInfo to check
38
- * @param minUi5VersionInfo to check against (default is 1.71)
39
- *
40
- * @returns boolean
41
- */
42
- function isLowerThanMinimalUi5Version(ui5VersionInfo) {
43
- let minUi5VersionInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : minVersionInfo;
44
- if (!isNaN(ui5VersionInfo.major) && !isNaN(ui5VersionInfo.minor)) {
45
- if (ui5VersionInfo.major < minUi5VersionInfo.major) {
46
- return true;
47
- }
48
- if (ui5VersionInfo.major === minUi5VersionInfo.major && ui5VersionInfo.minor < minUi5VersionInfo.minor) {
49
- return true;
50
- }
51
- }
52
- return false;
53
- }
54
-
55
- /**
56
- * Checks if the given version is equal to the specified version.
57
- * @param ui5VersionInfo to check
58
- * @param targetUi5VersionInfo to check against (default is 1.71)
59
- *
60
- * @returns boolean
61
- */
62
- function isVersionEqualOrHasNewerPatch(ui5VersionInfo) {
63
- let targetUi5VersionInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : minVersionInfo;
64
- if (!isNaN(ui5VersionInfo.major) && !isNaN(ui5VersionInfo.minor)) {
65
- return ui5VersionInfo.major === targetUi5VersionInfo.major && ui5VersionInfo.minor === targetUi5VersionInfo.minor && (ui5VersionInfo?.patch ?? 0) >= (targetUi5VersionInfo?.patch ?? 0);
66
- }
67
- return false;
68
- }
69
-
70
- /**
71
- * Get UI5 version validation message.
72
- * @param ui5VersionInfo to be mentioned in the message
73
- * @returns string with validation message.
74
- */
75
- function getUI5VersionValidationMessage(ui5VersionInfo) {
76
- return `The current SAPUI5 version set for this Adaptation project is ${ui5VersionInfo.major}.${ui5VersionInfo.minor}. The minimum version to use for SAPUI5 Adaptation Project and its SAPUI5 Visual Editor is ${minVersionInfo.major}.${minVersionInfo.minor}`;
77
- }
78
- var __exports = {
79
- __esModule: true
80
- };
81
- __exports.getUi5Version = getUi5Version;
82
- __exports.isLowerThanMinimalUi5Version = isLowerThanMinimalUi5Version;
83
- __exports.isVersionEqualOrHasNewerPatch = isVersionEqualOrHasNewerPatch;
84
- __exports.getUI5VersionValidationMessage = getUI5VersionValidationMessage;
85
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/VersionInfo", "sap/base/Log"], function (VersionInfo, Log) {
4
+ "use strict";
5
+
6
+ /**
7
+ * Default minimal supported UI5 version
8
+ */
9
+ const minVersionInfo = {
10
+ major: 1,
11
+ minor: 71
12
+ };
13
+
14
+ /**
15
+ * Retrieve the UI5 version from sap.ui.core library
16
+ *
17
+ * @returns Ui5VersionInfo
18
+ */
19
+ async function getUi5Version() {
20
+ let version = (await VersionInfo.load({
21
+ library: 'sap.ui.core'
22
+ }))?.version;
23
+ if (!version) {
24
+ Log.error('Could not get UI5 version of application. Using 1.121.0 as fallback.');
25
+ version = '1.121.0';
26
+ }
27
+ const [major, minor, patch] = version.split('.').map(versionPart => parseInt(versionPart, 10));
28
+ return {
29
+ major: major,
30
+ minor: minor,
31
+ patch: patch
32
+ };
33
+ }
34
+
35
+ /**
36
+ * Checks if the given version is lower than the required minimal version.
37
+ * @param ui5VersionInfo to check
38
+ * @param minUi5VersionInfo to check against (default is 1.71)
39
+ *
40
+ * @returns boolean
41
+ */
42
+ function isLowerThanMinimalUi5Version(ui5VersionInfo) {
43
+ let minUi5VersionInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : minVersionInfo;
44
+ if (!isNaN(ui5VersionInfo.major) && !isNaN(ui5VersionInfo.minor)) {
45
+ if (ui5VersionInfo.major < minUi5VersionInfo.major) {
46
+ return true;
47
+ }
48
+ if (ui5VersionInfo.major === minUi5VersionInfo.major && ui5VersionInfo.minor < minUi5VersionInfo.minor) {
49
+ return true;
50
+ }
51
+ }
52
+ return false;
53
+ }
54
+
55
+ /**
56
+ * Checks if the given version is equal to the specified version.
57
+ * @param ui5VersionInfo to check
58
+ * @param targetUi5VersionInfo to check against (default is 1.71)
59
+ *
60
+ * @returns boolean
61
+ */
62
+ function isVersionEqualOrHasNewerPatch(ui5VersionInfo) {
63
+ let targetUi5VersionInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : minVersionInfo;
64
+ if (!isNaN(ui5VersionInfo.major) && !isNaN(ui5VersionInfo.minor)) {
65
+ return ui5VersionInfo.major === targetUi5VersionInfo.major && ui5VersionInfo.minor === targetUi5VersionInfo.minor && (ui5VersionInfo?.patch ?? 0) >= (targetUi5VersionInfo?.patch ?? 0);
66
+ }
67
+ return false;
68
+ }
69
+
70
+ /**
71
+ * Get UI5 version validation message.
72
+ * @param ui5VersionInfo to be mentioned in the message
73
+ * @returns string with validation message.
74
+ */
75
+ function getUI5VersionValidationMessage(ui5VersionInfo) {
76
+ return `The current SAPUI5 version set for this Adaptation project is ${ui5VersionInfo.major}.${ui5VersionInfo.minor}. The minimum version to use for SAPUI5 Adaptation Project and its SAPUI5 Visual Editor is ${minVersionInfo.major}.${minVersionInfo.minor}`;
77
+ }
78
+ var __exports = {
79
+ __esModule: true
80
+ };
81
+ __exports.getUi5Version = getUi5Version;
82
+ __exports.isLowerThanMinimalUi5Version = isLowerThanMinimalUi5Version;
83
+ __exports.isVersionEqualOrHasNewerPatch = isVersionEqualOrHasNewerPatch;
84
+ __exports.getUI5VersionValidationMessage = getUI5VersionValidationMessage;
85
+ return __exports;
86
86
  });
87
87
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "bugs": {
10
10
  "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Apreview-middleware"
11
11
  },
12
- "version": "0.16.139",
12
+ "version": "0.16.140",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -28,7 +28,7 @@
28
28
  "@sap-ux/logger": "0.6.0",
29
29
  "@sap-ux/feature-toggle": "0.2.3",
30
30
  "@sap-ux/btp-utils": "0.17.1",
31
- "@sap-ux/adp-tooling": "0.12.89",
31
+ "@sap-ux/adp-tooling": "0.12.90",
32
32
  "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.5.28",
33
33
  "@sap-ux/project-access": "1.28.8"
34
34
  },
@@ -47,9 +47,9 @@
47
47
  "@sap-ux-private/playwright": "0.1.0",
48
48
  "dotenv": "16.3.1",
49
49
  "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.11.40",
50
+ "@sap-ux/axios-extension": "1.17.6",
50
51
  "@sap-ux/store": "0.9.3",
51
52
  "@sap-ux/ui5-info": "0.8.3",
52
- "@sap-ux/axios-extension": "1.17.6",
53
53
  "@sap-ux/i18n": "0.2.0"
54
54
  },
55
55
  "peerDependencies": {