@sap-ux/preview-middleware 0.16.112 → 0.16.113
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/quick-actions/common/create-page-action.js +2 -3
- package/dist/client/adp/quick-actions/common/create-page-action.ts +1 -5
- package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +1 -8
- package/dist/client/adp/quick-actions/fe-v2/change-table-columns.ts +1 -10
- package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +1 -8
- package/dist/client/adp/quick-actions/fe-v2/create-table-action.ts +0 -8
- package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +1 -12
- package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.ts +0 -11
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +5 -1
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.ts +5 -1
- package/dist/client/adp/quick-actions/fe-v2/registry.js +2 -2
- package/dist/client/adp/quick-actions/fe-v2/registry.ts +6 -5
- package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +1 -12
- package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.ts +0 -11
- package/dist/client/adp/quick-actions/fe-v4/registry.js +2 -2
- package/dist/client/adp/quick-actions/fe-v4/registry.ts +6 -6
- package/dist/client/adp/quick-actions/fe-v4/utils.js +4 -44
- package/dist/client/adp/quick-actions/fe-v4/utils.ts +2 -47
- package/dist/client/cpe/changes/flex-change.js +60 -51
- package/dist/client/cpe/changes/flex-change.ts +59 -26
- package/dist/client/cpe/changes/service.js +150 -34
- package/dist/client/cpe/changes/service.ts +239 -54
- package/dist/client/cpe/control-data.js +104 -28
- package/dist/client/cpe/control-data.ts +134 -43
- package/dist/client/cpe/init.js +3 -3
- package/dist/client/cpe/init.ts +5 -8
- package/dist/client/cpe/outline/editable.js +3 -3
- package/dist/client/cpe/outline/editable.ts +3 -2
- package/dist/client/cpe/outline/nodes.js +39 -9
- package/dist/client/cpe/outline/nodes.ts +61 -10
- package/dist/client/cpe/outline/service.js +3 -2
- package/dist/client/cpe/outline/service.ts +11 -3
- package/dist/client/cpe/selection.js +29 -16
- package/dist/client/cpe/selection.ts +38 -20
- package/dist/client/cpe/utils.js +42 -1
- package/dist/client/cpe/utils.ts +74 -0
- package/dist/client/thirdparty/@sap-ux-private/control-property-editor-common.js +7 -1
- package/dist/client/tsconfig.tsbuildinfo +1 -1
- package/dist/client/utils/fe-v4.js +87 -0
- package/dist/client/utils/fe-v4.ts +81 -0
- package/package.json +5 -5
package/dist/client/cpe/utils.ts
CHANGED
|
@@ -9,6 +9,11 @@ import UIComponent from 'sap/ui/core/UIComponent';
|
|
|
9
9
|
|
|
10
10
|
import { getComponent } from '../utils/core';
|
|
11
11
|
import { isLowerThanMinimalUi5Version, Ui5VersionInfo } from '../utils/version';
|
|
12
|
+
import { DesigntimeSetting } from 'sap/ui/dt/DesignTimeMetadata';
|
|
13
|
+
import { ChangeService } from './changes';
|
|
14
|
+
import UI5Element from 'sap/ui/core/Element';
|
|
15
|
+
import OverlayRegistry from 'sap/ui/dt/OverlayRegistry';
|
|
16
|
+
import OverlayUtil from 'sap/ui/dt/OverlayUtil';
|
|
12
17
|
|
|
13
18
|
export interface PropertiesInfo {
|
|
14
19
|
defaultValue: string;
|
|
@@ -30,6 +35,16 @@ export interface ManagedObjectMetadataProperties {
|
|
|
30
35
|
getDefaultValue: () => unknown;
|
|
31
36
|
}
|
|
32
37
|
|
|
38
|
+
export interface MergedSetting extends DesigntimeSetting {
|
|
39
|
+
defaultValue: unknown;
|
|
40
|
+
value: unknown;
|
|
41
|
+
configuration: boolean;
|
|
42
|
+
name: string;
|
|
43
|
+
readableName: string;
|
|
44
|
+
manifestPropertyPath: string;
|
|
45
|
+
type: 'string' | 'int' | 'boolean' | 'undefined';
|
|
46
|
+
}
|
|
47
|
+
|
|
33
48
|
/**
|
|
34
49
|
* Get runtime control.
|
|
35
50
|
*
|
|
@@ -112,3 +127,62 @@ export function getRootControlFromComponentContainer(container?: ComponentContai
|
|
|
112
127
|
}
|
|
113
128
|
return undefined;
|
|
114
129
|
}
|
|
130
|
+
|
|
131
|
+
export function getManifestProperties(
|
|
132
|
+
control: ManagedObject,
|
|
133
|
+
changeService: ChangeService,
|
|
134
|
+
controlOverlay?: ElementOverlay
|
|
135
|
+
): {
|
|
136
|
+
[key: string]: MergedSetting;
|
|
137
|
+
} {
|
|
138
|
+
const overlayData = controlOverlay?.getDesignTimeMetadata().getData();
|
|
139
|
+
if (!controlOverlay || !overlayData?.manifestSettings) {
|
|
140
|
+
return {};
|
|
141
|
+
}
|
|
142
|
+
const manifestPropertiesValue = overlayData?.manifestSettingsValues(
|
|
143
|
+
overlayData?.manifestSettings(control),
|
|
144
|
+
control
|
|
145
|
+
);
|
|
146
|
+
const manifestProperties = overlayData?.manifestSettings(control).reduce(
|
|
147
|
+
(
|
|
148
|
+
acc: {
|
|
149
|
+
[key: string]: MergedSetting;
|
|
150
|
+
},
|
|
151
|
+
item: DesigntimeSetting
|
|
152
|
+
) => {
|
|
153
|
+
const propertyId = item.id;
|
|
154
|
+
const value = changeService.getConfigurationPropertyValue(control.getId(), propertyId);
|
|
155
|
+
let propertyValue = value === 0 || value === false || value ? value : manifestPropertiesValue[propertyId];
|
|
156
|
+
if (item?.type && ['boolean', 'number', 'string'].includes(item?.type)) {
|
|
157
|
+
if (propertyValue === undefined) {
|
|
158
|
+
propertyValue = item.value as string | boolean | number; // set default value of property
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
if (!acc[propertyId]) {
|
|
162
|
+
acc[propertyId] = {
|
|
163
|
+
...item,
|
|
164
|
+
defaultValue: item.value,
|
|
165
|
+
configuration: true,
|
|
166
|
+
name: item.id,
|
|
167
|
+
readableName: item.name,
|
|
168
|
+
manifestPropertyPath: `${overlayData?.manifestPropertyPath(control)}/${propertyId}`,
|
|
169
|
+
type: item.type === 'number' ? 'int' : (item.type as 'string' | 'boolean' | 'undefined'),
|
|
170
|
+
value: propertyValue
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
return acc;
|
|
174
|
+
},
|
|
175
|
+
{}
|
|
176
|
+
);
|
|
177
|
+
return manifestProperties;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export const getOverlay = (control: UI5Element): ElementOverlay | undefined => {
|
|
181
|
+
let controlOverlay = OverlayRegistry.getOverlay(control);
|
|
182
|
+
if (!controlOverlay?.getDomRef()) {
|
|
183
|
+
//look for closest control
|
|
184
|
+
controlOverlay = OverlayUtil.getClosestOverlayFor(control);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return controlOverlay;
|
|
188
|
+
};
|
|
@@ -8,7 +8,7 @@ sap.ui.define((function () { 'use strict';
|
|
|
8
8
|
|
|
9
9
|
(function (exports) {
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.setApplicationRequiresReload = exports.executeQuickAction = exports.updateQuickAction = exports.quickActionListChanged = exports.save = exports.redo = exports.undo = exports.appLoaded = exports.setSaveEnablement = exports.setUndoRedoEnablement = exports.applicationModeChanged = exports.setAppMode = exports.storageFileChanged = exports.reloadApplication = exports.showMessage = exports.changeStackModified = exports.propertyChangeFailed = exports.propertyChanged = exports.changeProperty = exports.outlineChanged = exports.deletePropertyChanges = exports.addExtensionPoint = exports.selectControl = exports.controlSelected = exports.iconsLoaded = exports.EXTERNAL_ACTION_PREFIX = exports.NESTED_QUICK_ACTION_KIND = exports.SIMPLE_QUICK_ACTION_KIND = exports.CONTROL_CHANGE_KIND = exports.UNKNOWN_CHANGE_KIND = exports.PROPERTY_CHANGE_KIND = exports.SAVED_CHANGE_TYPE = exports.PENDING_CHANGE_TYPE = exports.SCENARIO = exports.CHECKBOX_EDITOR_TYPE = exports.DROPDOWN_EDITOR_TYPE = exports.INPUT_EDITOR_TYPE = exports.STRING_VALUE_TYPE = exports.FLOAT_VALUE_TYPE = exports.INTEGER_VALUE_TYPE = exports.BOOLEAN_VALUE_TYPE = void 0;
|
|
11
|
+
exports.setApplicationRequiresReload = exports.executeQuickAction = exports.updateQuickAction = exports.quickActionListChanged = exports.save = exports.redo = exports.undo = exports.appLoaded = exports.setSaveEnablement = exports.setUndoRedoEnablement = exports.applicationModeChanged = exports.setAppMode = exports.storageFileChanged = exports.reloadApplication = exports.showMessage = exports.changeStackModified = exports.propertyChangeFailed = exports.propertyChanged = exports.changeProperty = exports.outlineChanged = exports.deletePropertyChanges = exports.addExtensionPoint = exports.selectControl = exports.controlSelected = exports.iconsLoaded = exports.EXTERNAL_ACTION_PREFIX = exports.NESTED_QUICK_ACTION_KIND = exports.SIMPLE_QUICK_ACTION_KIND = exports.CONTROL_CHANGE_KIND = exports.UNKNOWN_CHANGE_KIND = exports.CONFIGURATION_CHANGE_KIND = exports.PROPERTY_CHANGE_KIND = exports.SAVED_CHANGE_TYPE = exports.PENDING_CHANGE_TYPE = exports.PropertyType = exports.SCENARIO = exports.CHECKBOX_EDITOR_TYPE = exports.DROPDOWN_EDITOR_TYPE = exports.INPUT_EDITOR_TYPE = exports.STRING_VALUE_TYPE = exports.FLOAT_VALUE_TYPE = exports.INTEGER_VALUE_TYPE = exports.BOOLEAN_VALUE_TYPE = void 0;
|
|
12
12
|
exports.BOOLEAN_VALUE_TYPE = 'boolean';
|
|
13
13
|
exports.INTEGER_VALUE_TYPE = 'integer';
|
|
14
14
|
exports.FLOAT_VALUE_TYPE = 'float';
|
|
@@ -23,9 +23,15 @@ sap.ui.define((function () { 'use strict';
|
|
|
23
23
|
FioriElementsFromScratch: 'FE_FROM_SCRATCH',
|
|
24
24
|
UiAdaptation: 'UI_ADAPTATION'
|
|
25
25
|
};
|
|
26
|
+
var PropertyType;
|
|
27
|
+
(function (PropertyType) {
|
|
28
|
+
PropertyType["Configuration"] = "configuration";
|
|
29
|
+
PropertyType["ControlProperty"] = "controlProperty";
|
|
30
|
+
})(PropertyType || (exports.PropertyType = PropertyType = {}));
|
|
26
31
|
exports.PENDING_CHANGE_TYPE = 'pending';
|
|
27
32
|
exports.SAVED_CHANGE_TYPE = 'saved';
|
|
28
33
|
exports.PROPERTY_CHANGE_KIND = 'property';
|
|
34
|
+
exports.CONFIGURATION_CHANGE_KIND = 'configuration';
|
|
29
35
|
exports.UNKNOWN_CHANGE_KIND = 'unknown';
|
|
30
36
|
exports.CONTROL_CHANGE_KIND = 'control';
|
|
31
37
|
exports.SIMPLE_QUICK_ACTION_KIND = 'simple';
|