@sap-ux/preview-middleware 0.20.0 → 0.20.2
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/client/adp/add-fragment.js +46 -46
- package/dist/client/adp/api-handler.js +159 -159
- package/dist/client/adp/command-executor.js +75 -75
- package/dist/client/adp/command-executor.ts +4 -4
- package/dist/client/adp/control-utils.js +44 -44
- package/dist/client/adp/controllers/AddFragment.controller.js +1 -1
- package/dist/client/adp/controllers/AddFragment.controller.ts +2 -2
- package/dist/client/adp/controllers/AddTableColumnFragments.controller.js +1 -1
- package/dist/client/adp/controllers/AddTableColumnFragments.controller.ts +2 -2
- package/dist/client/adp/controllers/BaseDialog.controller.js +2 -13
- package/dist/client/adp/controllers/BaseDialog.controller.ts +7 -25
- package/dist/client/adp/controllers/ControllerExtension.controller.js +268 -210
- package/dist/client/adp/controllers/ControllerExtension.controller.ts +110 -22
- package/dist/client/adp/controllers/ExtensionPoint.controller.js +139 -139
- package/dist/client/adp/controllers/FileExistsDialog.controller.js +66 -66
- package/dist/client/adp/dialog-factory.js +135 -135
- package/dist/client/adp/dialog-factory.ts +3 -1
- package/dist/client/adp/extend-controller.js +48 -0
- package/dist/client/adp/extend-controller.ts +49 -0
- package/dist/client/adp/init-dialogs.js +143 -163
- package/dist/client/adp/init-dialogs.ts +42 -20
- package/dist/client/adp/init.js +9 -1
- package/dist/client/adp/init.ts +6 -1
- package/dist/client/adp/quick-actions/add-new-subpage-quick-action-base.js +96 -96
- package/dist/client/adp/quick-actions/common/add-controller-to-page.js +74 -60
- package/dist/client/adp/quick-actions/common/add-controller-to-page.ts +25 -3
- package/dist/client/adp/quick-actions/common/create-page-action.js +54 -54
- package/dist/client/adp/quick-actions/common/op-add-custom-section.js +39 -39
- package/dist/client/adp/quick-actions/common/op-add-header-field.js +67 -67
- package/dist/client/adp/quick-actions/common/utils.js +18 -18
- package/dist/client/adp/quick-actions/control-types.js +23 -23
- package/dist/client/adp/quick-actions/dialog-enablement-validator.js +24 -24
- package/dist/client/adp/quick-actions/enablement-validator.js +4 -4
- package/dist/client/adp/quick-actions/fe-v2/add-new-subpage.js +81 -81
- package/dist/client/adp/quick-actions/fe-v2/change-table-actions.js +67 -67
- package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +101 -101
- package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +107 -107
- package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +99 -99
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +78 -78
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +77 -77
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-variant-management.js +69 -69
- package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +59 -59
- package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +93 -93
- package/dist/client/adp/quick-actions/fe-v2/op-enable-variant-management.js +84 -84
- package/dist/client/adp/quick-actions/fe-v2/registry.js +77 -77
- package/dist/client/adp/quick-actions/fe-v2/utils.js +116 -116
- package/dist/client/adp/quick-actions/fe-v4/add-new-subpage.js +138 -138
- package/dist/client/adp/quick-actions/fe-v4/change-table-actions.js +79 -79
- package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +75 -75
- package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +53 -53
- package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +49 -49
- package/dist/client/adp/quick-actions/fe-v4/enable-variant-management.js +81 -81
- package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +56 -56
- package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +84 -84
- package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +53 -53
- package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +89 -89
- package/dist/client/adp/quick-actions/fe-v4/registry.js +60 -60
- package/dist/client/adp/quick-actions/fe-v4/utils.js +72 -72
- package/dist/client/adp/quick-actions/load.js +44 -44
- package/dist/client/adp/quick-actions/quick-action-base.js +64 -64
- package/dist/client/adp/ui/ControllerExtension.fragment.xml +14 -3
- package/dist/client/adp/utils.js +259 -218
- package/dist/client/adp/utils.ts +55 -7
- package/dist/client/cpe/additional-change-info/add-xml-additional-info.js +75 -75
- package/dist/client/cpe/changes/generic-change.js +326 -326
- package/dist/client/cpe/changes/index.js +10 -10
- package/dist/client/cpe/changes/validator.js +39 -39
- package/dist/client/cpe/connector-service.ts +1 -0
- package/dist/client/cpe/documentation.js +164 -164
- package/dist/client/cpe/feature-service.js +36 -36
- package/dist/client/cpe/logger.js +30 -30
- package/dist/client/cpe/outline/editable.js +37 -37
- package/dist/client/cpe/outline/nodes.js +203 -203
- package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
- package/dist/client/cpe/quick-actions/registry.js +143 -143
- package/dist/client/cpe/quick-actions/utils.js +92 -92
- package/dist/client/cpe/types.js +4 -4
- package/dist/client/cpe/ui5-utils.js +33 -33
- package/dist/client/cpe/utils.js +111 -111
- package/dist/client/flp/WorkspaceConnector.js +92 -92
- package/dist/client/flp/common.js +28 -28
- package/dist/client/flp/enableFakeConnector.js +89 -89
- package/dist/client/flp/homepage/Component.js +14 -14
- package/dist/client/flp/initCdm.js +117 -117
- package/dist/client/flp/initConnectors.js +28 -28
- package/dist/client/flp/initRta.js +178 -178
- package/dist/client/i18n.js +56 -56
- package/dist/client/messagebundle.properties +5 -0
- package/dist/client/utils/additional-change-info.js +54 -54
- package/dist/client/utils/application.js +32 -32
- package/dist/client/utils/core.js +84 -84
- package/dist/client/utils/error.js +19 -19
- package/dist/client/utils/fe-v2.js +56 -56
- package/dist/client/utils/fe-v4.js +140 -140
- package/dist/client/utils/version.js +104 -104
- package/package.json +4 -4
package/dist/client/adp/utils.ts
CHANGED
|
@@ -9,6 +9,7 @@ import FlexUtils from 'sap/ui/fl/Utils';
|
|
|
9
9
|
import IsReuseComponentApi from 'sap/ui/rta/util/isReuseComponent';
|
|
10
10
|
import { getControlById } from '../utils/core';
|
|
11
11
|
import type { Manifest } from 'sap/ui/rta/RuntimeAuthoring';
|
|
12
|
+
import RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring';
|
|
12
13
|
|
|
13
14
|
import { getError } from '../utils/error';
|
|
14
15
|
import { isLowerThanMinimalUi5Version, Ui5VersionInfo } from '../utils/version';
|
|
@@ -60,19 +61,66 @@ export function createDeferred<T>(): Deferred<T> {
|
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
/**
|
|
63
|
-
* Checks
|
|
64
|
+
* Checks for the existence of a change associated with a specific fragment name in the RTA command stack.
|
|
65
|
+
*
|
|
66
|
+
* @param {RuntimeAuthoring} rta - The RuntimeAuthoring instance to check for existing changes.
|
|
67
|
+
* @param {string} commandName - The name of the fragment to check for existing changes.
|
|
68
|
+
* @param {string} propertyPath - The path to the property as string separated by dot in the change definition to check.
|
|
69
|
+
* @param {string} propertyValue - The value to match against the specified property.
|
|
70
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if a matching change is found, otherwise `false`.
|
|
71
|
+
*/
|
|
72
|
+
export function checkForExistingChange(
|
|
73
|
+
rta: RuntimeAuthoring,
|
|
74
|
+
commandName: string,
|
|
75
|
+
propertyPath: string,
|
|
76
|
+
propertyValue: string
|
|
77
|
+
): boolean {
|
|
78
|
+
const allCommands = rta.getCommandStack().getCommands();
|
|
79
|
+
|
|
80
|
+
return allCommands.some((command: FlexCommand) => {
|
|
81
|
+
if (typeof command.getCommands === 'function') {
|
|
82
|
+
const subCommand = command.getCommands().find((c: FlexCommand) => c?.getProperty('name') === commandName);
|
|
83
|
+
|
|
84
|
+
return subCommand && matchesChangeProperty(subCommand, propertyPath, propertyValue);
|
|
85
|
+
} else {
|
|
86
|
+
return matchesChangeProperty(command, propertyPath, propertyValue);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Retrieves the value of a nested property from an object based on a dot-separated path.
|
|
93
|
+
*
|
|
94
|
+
* @param obj - The object from which to retrieve the nested property.
|
|
95
|
+
* @param path - A dot-separated string representing the path to the desired property.
|
|
96
|
+
* For example, "a.b.c" will attempt to access `obj.a.b.c`.
|
|
97
|
+
* @returns The value of the nested property if it exists, or `undefined` if any part of the path is invalid.
|
|
98
|
+
*/
|
|
99
|
+
export function getNestedProperty(obj: object, path: string): unknown {
|
|
100
|
+
return path.split('.').reduce((acc: unknown, key) => {
|
|
101
|
+
return (acc as Record<string, unknown>)?.[key];
|
|
102
|
+
}, obj);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Checks if a specific property in the command's change matches the given value.
|
|
64
107
|
*
|
|
65
108
|
* @param {FlexCommand} command - The command object containing the prepared change to be examined.
|
|
66
|
-
* @param {string}
|
|
67
|
-
* @
|
|
68
|
-
*
|
|
109
|
+
* @param {string} propertyPath - The path to the property in the change definition to check.
|
|
110
|
+
* @param {string} propertyValue - The value to match against the specified property.
|
|
111
|
+
* @returns {boolean} Returns true if the command's change contains the specified property with the matching value; otherwise, returns false.
|
|
69
112
|
*/
|
|
70
|
-
export function
|
|
113
|
+
export function matchesChangeProperty(command: FlexCommand, propertyPath: string, propertyValue: string): boolean {
|
|
71
114
|
if (typeof command.getPreparedChange !== 'function') {
|
|
72
115
|
return false;
|
|
73
116
|
}
|
|
74
|
-
const change = command.getPreparedChange()
|
|
75
|
-
|
|
117
|
+
const change = command.getPreparedChange()?.getDefinition?.();
|
|
118
|
+
if (!change) {
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const nestedProperty = getNestedProperty(change, propertyPath);
|
|
123
|
+
return typeof nestedProperty === 'string' ? nestedProperty.includes(propertyValue) : false;
|
|
76
124
|
}
|
|
77
125
|
|
|
78
126
|
/**
|
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["../../utils/core", "../../adp/quick-actions/control-types"], function (____utils_core, ____adp_quick_actions_control_types) {
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
const getControlById = ____utils_core["getControlById"];
|
|
7
|
-
const ANALYTICAL_TABLE_TYPE = ____adp_quick_actions_control_types["ANALYTICAL_TABLE_TYPE"];
|
|
8
|
-
const GRID_TABLE_TYPE = ____adp_quick_actions_control_types["GRID_TABLE_TYPE"];
|
|
9
|
-
const MDC_TABLE_TYPE = ____adp_quick_actions_control_types["MDC_TABLE_TYPE"];
|
|
10
|
-
const TREE_TABLE_TYPE = ____adp_quick_actions_control_types["TREE_TABLE_TYPE"];
|
|
11
|
-
function getAddXMLAdditionalInfo(change) {
|
|
12
|
-
const selectorId = change.getSelector()?.id ?? '';
|
|
13
|
-
const targetAggregation = change.getContent()?.targetAggregation ?? '';
|
|
14
|
-
const templateName = getFragmentTemplateName(selectorId, targetAggregation);
|
|
15
|
-
if (templateName) {
|
|
16
|
-
return {
|
|
17
|
-
templateName
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
return undefined;
|
|
21
|
-
}
|
|
22
|
-
function getFragmentTemplateName(selectorId, targetAggregation) {
|
|
23
|
-
const control = getControlById(selectorId);
|
|
24
|
-
if (!control) {
|
|
25
|
-
return '';
|
|
26
|
-
}
|
|
27
|
-
const controlName = control.getMetadata().getName();
|
|
28
|
-
if (controlName === 'sap.uxap.ObjectPageLayout' && targetAggregation === 'sections') {
|
|
29
|
-
return 'OBJECT_PAGE_CUSTOM_SECTION';
|
|
30
|
-
} else if (isCustomAction(controlName, targetAggregation)) {
|
|
31
|
-
return 'CUSTOM_ACTION';
|
|
32
|
-
} else if (isObjectPageHeaderField(control, controlName, targetAggregation)) {
|
|
33
|
-
return 'OBJECT_PAGE_HEADER_FIELD';
|
|
34
|
-
} else if (targetAggregation === 'columns') {
|
|
35
|
-
switch (controlName) {
|
|
36
|
-
case MDC_TABLE_TYPE:
|
|
37
|
-
return 'V4_MDC_TABLE_COLUMN';
|
|
38
|
-
case TREE_TABLE_TYPE:
|
|
39
|
-
case GRID_TABLE_TYPE:
|
|
40
|
-
return 'GRID_TREE_TABLE_COLUMN';
|
|
41
|
-
case ANALYTICAL_TABLE_TYPE:
|
|
42
|
-
return 'ANALYTICAL_TABLE_COLUMN';
|
|
43
|
-
default:
|
|
44
|
-
return '';
|
|
45
|
-
}
|
|
46
|
-
} else if (controlName === 'sap.ui.mdc.Table' && targetAggregation === 'actions') {
|
|
47
|
-
return 'TABLE_ACTION';
|
|
48
|
-
}
|
|
49
|
-
return '';
|
|
50
|
-
}
|
|
51
|
-
function isCustomAction(controlName, targetAggregation) {
|
|
52
|
-
if (['sap.f.DynamicPageTitle', 'sap.uxap.ObjectPageHeader', 'sap.uxap.ObjectPageDynamicHeaderTitle'].includes(controlName)) {
|
|
53
|
-
return targetAggregation === 'actions';
|
|
54
|
-
} else if (controlName === 'sap.m.OverflowToolbar' || controlName === 'sap.m.Toolbar') {
|
|
55
|
-
return targetAggregation === 'content';
|
|
56
|
-
}
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
function isObjectPageHeaderField(control, controlName, targetAggregation) {
|
|
60
|
-
if (controlName === 'sap.uxap.ObjectPageLayout') {
|
|
61
|
-
return targetAggregation === 'headerContent';
|
|
62
|
-
} else if (controlName === 'sap.m.FlexBox') {
|
|
63
|
-
const parentName = control.getParent()?.getMetadata().getName();
|
|
64
|
-
if (parentName === 'sap.uxap.ObjectPageDynamicHeaderContent' || parentName === 'sap.uxap.ObjectPageLayout') {
|
|
65
|
-
return targetAggregation === 'items';
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return false;
|
|
69
|
-
}
|
|
70
|
-
var __exports = {
|
|
71
|
-
__esModule: true
|
|
72
|
-
};
|
|
73
|
-
__exports.getAddXMLAdditionalInfo = getAddXMLAdditionalInfo;
|
|
74
|
-
__exports.getFragmentTemplateName = getFragmentTemplateName;
|
|
75
|
-
return __exports;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["../../utils/core", "../../adp/quick-actions/control-types"], function (____utils_core, ____adp_quick_actions_control_types) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const getControlById = ____utils_core["getControlById"];
|
|
7
|
+
const ANALYTICAL_TABLE_TYPE = ____adp_quick_actions_control_types["ANALYTICAL_TABLE_TYPE"];
|
|
8
|
+
const GRID_TABLE_TYPE = ____adp_quick_actions_control_types["GRID_TABLE_TYPE"];
|
|
9
|
+
const MDC_TABLE_TYPE = ____adp_quick_actions_control_types["MDC_TABLE_TYPE"];
|
|
10
|
+
const TREE_TABLE_TYPE = ____adp_quick_actions_control_types["TREE_TABLE_TYPE"];
|
|
11
|
+
function getAddXMLAdditionalInfo(change) {
|
|
12
|
+
const selectorId = change.getSelector()?.id ?? '';
|
|
13
|
+
const targetAggregation = change.getContent()?.targetAggregation ?? '';
|
|
14
|
+
const templateName = getFragmentTemplateName(selectorId, targetAggregation);
|
|
15
|
+
if (templateName) {
|
|
16
|
+
return {
|
|
17
|
+
templateName
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
function getFragmentTemplateName(selectorId, targetAggregation) {
|
|
23
|
+
const control = getControlById(selectorId);
|
|
24
|
+
if (!control) {
|
|
25
|
+
return '';
|
|
26
|
+
}
|
|
27
|
+
const controlName = control.getMetadata().getName();
|
|
28
|
+
if (controlName === 'sap.uxap.ObjectPageLayout' && targetAggregation === 'sections') {
|
|
29
|
+
return 'OBJECT_PAGE_CUSTOM_SECTION';
|
|
30
|
+
} else if (isCustomAction(controlName, targetAggregation)) {
|
|
31
|
+
return 'CUSTOM_ACTION';
|
|
32
|
+
} else if (isObjectPageHeaderField(control, controlName, targetAggregation)) {
|
|
33
|
+
return 'OBJECT_PAGE_HEADER_FIELD';
|
|
34
|
+
} else if (targetAggregation === 'columns') {
|
|
35
|
+
switch (controlName) {
|
|
36
|
+
case MDC_TABLE_TYPE:
|
|
37
|
+
return 'V4_MDC_TABLE_COLUMN';
|
|
38
|
+
case TREE_TABLE_TYPE:
|
|
39
|
+
case GRID_TABLE_TYPE:
|
|
40
|
+
return 'GRID_TREE_TABLE_COLUMN';
|
|
41
|
+
case ANALYTICAL_TABLE_TYPE:
|
|
42
|
+
return 'ANALYTICAL_TABLE_COLUMN';
|
|
43
|
+
default:
|
|
44
|
+
return '';
|
|
45
|
+
}
|
|
46
|
+
} else if (controlName === 'sap.ui.mdc.Table' && targetAggregation === 'actions') {
|
|
47
|
+
return 'TABLE_ACTION';
|
|
48
|
+
}
|
|
49
|
+
return '';
|
|
50
|
+
}
|
|
51
|
+
function isCustomAction(controlName, targetAggregation) {
|
|
52
|
+
if (['sap.f.DynamicPageTitle', 'sap.uxap.ObjectPageHeader', 'sap.uxap.ObjectPageDynamicHeaderTitle'].includes(controlName)) {
|
|
53
|
+
return targetAggregation === 'actions';
|
|
54
|
+
} else if (controlName === 'sap.m.OverflowToolbar' || controlName === 'sap.m.Toolbar') {
|
|
55
|
+
return targetAggregation === 'content';
|
|
56
|
+
}
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
function isObjectPageHeaderField(control, controlName, targetAggregation) {
|
|
60
|
+
if (controlName === 'sap.uxap.ObjectPageLayout') {
|
|
61
|
+
return targetAggregation === 'headerContent';
|
|
62
|
+
} else if (controlName === 'sap.m.FlexBox') {
|
|
63
|
+
const parentName = control.getParent()?.getMetadata().getName();
|
|
64
|
+
if (parentName === 'sap.uxap.ObjectPageDynamicHeaderContent' || parentName === 'sap.uxap.ObjectPageLayout') {
|
|
65
|
+
return targetAggregation === 'items';
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
var __exports = {
|
|
71
|
+
__esModule: true
|
|
72
|
+
};
|
|
73
|
+
__exports.getAddXMLAdditionalInfo = getAddXMLAdditionalInfo;
|
|
74
|
+
__exports.getFragmentTemplateName = getFragmentTemplateName;
|
|
75
|
+
return __exports;
|
|
76
76
|
});
|
|
77
77
|
//# sourceMappingURL=add-xml-additional-info.js.map
|