@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
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
sap.ui.define([
|
|
3
3
|
'open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common',
|
|
4
4
|
'sap/ui/fl/Utils',
|
|
5
|
-
'
|
|
6
|
-
|
|
5
|
+
'./utils',
|
|
6
|
+
'sap/ui/base/DataType',
|
|
7
|
+
'../utils/fe-v4'
|
|
8
|
+
], function (___sap_ux_private_control_property_editor_common, Utils, ___utils, DataType, ___utils_fe_v4) {
|
|
7
9
|
'use strict';
|
|
8
10
|
const BOOLEAN_VALUE_TYPE = ___sap_ux_private_control_property_editor_common['BOOLEAN_VALUE_TYPE'];
|
|
9
11
|
const CHECKBOX_EDITOR_TYPE = ___sap_ux_private_control_property_editor_common['CHECKBOX_EDITOR_TYPE'];
|
|
@@ -11,8 +13,11 @@ sap.ui.define([
|
|
|
11
13
|
const FLOAT_VALUE_TYPE = ___sap_ux_private_control_property_editor_common['FLOAT_VALUE_TYPE'];
|
|
12
14
|
const INPUT_EDITOR_TYPE = ___sap_ux_private_control_property_editor_common['INPUT_EDITOR_TYPE'];
|
|
13
15
|
const INTEGER_VALUE_TYPE = ___sap_ux_private_control_property_editor_common['INTEGER_VALUE_TYPE'];
|
|
16
|
+
const PropertyType = ___sap_ux_private_control_property_editor_common['PropertyType'];
|
|
14
17
|
const STRING_VALUE_TYPE = ___sap_ux_private_control_property_editor_common['STRING_VALUE_TYPE'];
|
|
15
18
|
const convertCamelCaseToPascalCase = ___sap_ux_private_control_property_editor_common['convertCamelCaseToPascalCase'];
|
|
19
|
+
const getManifestProperties = ___utils['getManifestProperties'];
|
|
20
|
+
const getV4PageType = ___utils_fe_v4['getV4PageType'];
|
|
16
21
|
function isPropertyEnabled(analyzedType) {
|
|
17
22
|
return !(analyzedType.isArray || analyzedType.primitiveType === 'any');
|
|
18
23
|
}
|
|
@@ -69,6 +74,34 @@ sap.ui.define([
|
|
|
69
74
|
}
|
|
70
75
|
return analyzedType;
|
|
71
76
|
}
|
|
77
|
+
function analyzeManifestProperty(property) {
|
|
78
|
+
const analyzedType = {
|
|
79
|
+
primitiveType: 'any',
|
|
80
|
+
ui5Type: null,
|
|
81
|
+
enumValues: undefined,
|
|
82
|
+
isArray: false
|
|
83
|
+
};
|
|
84
|
+
const propertyType = property.type;
|
|
85
|
+
if (!propertyType) {
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
|
88
|
+
if ([
|
|
89
|
+
'boolean',
|
|
90
|
+
'string',
|
|
91
|
+
'int',
|
|
92
|
+
'float'
|
|
93
|
+
].includes(propertyType)) {
|
|
94
|
+
analyzedType.primitiveType = propertyType;
|
|
95
|
+
}
|
|
96
|
+
if (property.enums) {
|
|
97
|
+
analyzedType.primitiveType = 'enum';
|
|
98
|
+
analyzedType.enumValues = property.enums.reduce((acc, item) => {
|
|
99
|
+
acc[item.id] = item.name;
|
|
100
|
+
return acc;
|
|
101
|
+
}, {});
|
|
102
|
+
}
|
|
103
|
+
return analyzedType;
|
|
104
|
+
}
|
|
72
105
|
function normalizeObjectPropertyValue(rawValue) {
|
|
73
106
|
if (typeof rawValue === 'object' && rawValue instanceof Object && !Array.isArray(rawValue)) {
|
|
74
107
|
try {
|
|
@@ -85,38 +118,71 @@ sap.ui.define([
|
|
|
85
118
|
return rawValue;
|
|
86
119
|
}
|
|
87
120
|
}
|
|
88
|
-
function buildControlData(control, controlOverlay) {
|
|
121
|
+
function buildControlData(control, changeService, controlOverlay) {
|
|
89
122
|
const controlMetadata = control.getMetadata();
|
|
90
123
|
const selectedControlName = controlMetadata.getName();
|
|
91
124
|
const hasStableId = Utils.checkControlId(control);
|
|
92
|
-
const
|
|
93
|
-
const
|
|
125
|
+
const overlayData = controlOverlay?.getDesignTimeMetadata().getData();
|
|
126
|
+
const controlProperties = controlOverlay ? overlayData?.properties : undefined;
|
|
127
|
+
const manifestProperties = getManifestProperties(control, changeService, controlOverlay);
|
|
128
|
+
const allProperties = {
|
|
129
|
+
...controlMetadata.getAllProperties(),
|
|
130
|
+
...manifestProperties
|
|
131
|
+
};
|
|
132
|
+
let propertyType;
|
|
94
133
|
const propertyNames = Object.keys(allProperties);
|
|
95
134
|
const properties = [];
|
|
96
135
|
for (const propertyName of propertyNames) {
|
|
97
136
|
const property = allProperties[propertyName];
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
137
|
+
let analyzedType;
|
|
138
|
+
let isEnabled = false;
|
|
139
|
+
let value;
|
|
140
|
+
if (property && 'configuration' in property) {
|
|
141
|
+
propertyType = PropertyType.Configuration;
|
|
142
|
+
analyzedType = analyzeManifestProperty(property);
|
|
143
|
+
if (!analyzedType || property?.restrictedTo?.length && !property?.restrictedTo?.includes(getV4PageType(control))) {
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
isEnabled = true;
|
|
147
|
+
value = property.value;
|
|
148
|
+
} else {
|
|
149
|
+
propertyType = PropertyType.ControlProperty;
|
|
150
|
+
analyzedType = analyzePropertyType(property);
|
|
151
|
+
if (!analyzedType) {
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
let ignore = false;
|
|
155
|
+
if (controlProperties?.[property.name]) {
|
|
156
|
+
ignore = controlProperties[property.name].ignore;
|
|
157
|
+
}
|
|
158
|
+
const controlNewData = {
|
|
159
|
+
id: control.getId(),
|
|
160
|
+
name: property.name,
|
|
161
|
+
newValue: control.getProperty(property.name)
|
|
162
|
+
};
|
|
163
|
+
const bindingInfo = control.getBindingInfo(controlNewData.name);
|
|
164
|
+
if (bindingInfo?.bindingString !== undefined) {
|
|
165
|
+
controlNewData.newValue = bindingInfo.bindingString;
|
|
166
|
+
}
|
|
167
|
+
isEnabled = isControlEnabled(analyzedType, hasStableId, ignore, controlOverlay);
|
|
168
|
+
value = normalizeObjectPropertyValue(controlNewData.newValue);
|
|
114
169
|
}
|
|
115
|
-
const isEnabled = isControlEnabled(analyzedType, hasStableId, ignore, controlOverlay);
|
|
116
|
-
const value = normalizeObjectPropertyValue(controlNewData.newValue);
|
|
117
170
|
const isIcon = testIconPattern(property.name) && selectedControlName !== 'sap.m.Image' && analyzedType.ui5Type === 'sap.ui.core.URI';
|
|
118
171
|
const ui5Type = analyzedType.ui5Type || undefined;
|
|
119
172
|
const readableName = convertCamelCaseToPascalCase(property.name);
|
|
173
|
+
let docu;
|
|
174
|
+
if ('configuration' in property) {
|
|
175
|
+
const defValue = [
|
|
176
|
+
'undefined',
|
|
177
|
+
'null'
|
|
178
|
+
].includes(String(property.defaultValue)) ? '-' : String(property.defaultValue);
|
|
179
|
+
docu = {
|
|
180
|
+
description: property.description,
|
|
181
|
+
propertyName: property.id,
|
|
182
|
+
type: property.type,
|
|
183
|
+
defaultValue: defValue || '-'
|
|
184
|
+
};
|
|
185
|
+
}
|
|
120
186
|
switch (analyzedType.primitiveType) {
|
|
121
187
|
case 'enum': {
|
|
122
188
|
const values = analyzedType.enumValues ?? {};
|
|
@@ -127,12 +193,14 @@ sap.ui.define([
|
|
|
127
193
|
properties.push({
|
|
128
194
|
type: STRING_VALUE_TYPE,
|
|
129
195
|
editor: DROPDOWN_EDITOR_TYPE,
|
|
196
|
+
propertyType,
|
|
130
197
|
name: property.name,
|
|
131
198
|
readableName,
|
|
132
199
|
value: value,
|
|
133
200
|
isEnabled,
|
|
134
201
|
ui5Type,
|
|
135
|
-
options
|
|
202
|
+
options,
|
|
203
|
+
...docu && { documentation: docu }
|
|
136
204
|
});
|
|
137
205
|
break;
|
|
138
206
|
}
|
|
@@ -140,12 +208,14 @@ sap.ui.define([
|
|
|
140
208
|
properties.push({
|
|
141
209
|
type: STRING_VALUE_TYPE,
|
|
142
210
|
editor: INPUT_EDITOR_TYPE,
|
|
211
|
+
propertyType,
|
|
143
212
|
name: property.name,
|
|
144
213
|
readableName,
|
|
145
214
|
value: value,
|
|
146
215
|
isEnabled,
|
|
147
216
|
isIcon,
|
|
148
|
-
ui5Type
|
|
217
|
+
ui5Type,
|
|
218
|
+
...docu && { documentation: docu }
|
|
149
219
|
});
|
|
150
220
|
break;
|
|
151
221
|
}
|
|
@@ -153,11 +223,13 @@ sap.ui.define([
|
|
|
153
223
|
properties.push({
|
|
154
224
|
type: INTEGER_VALUE_TYPE,
|
|
155
225
|
editor: INPUT_EDITOR_TYPE,
|
|
226
|
+
propertyType,
|
|
156
227
|
name: property.name,
|
|
157
228
|
readableName,
|
|
158
229
|
value: value,
|
|
159
230
|
isEnabled,
|
|
160
|
-
ui5Type
|
|
231
|
+
ui5Type,
|
|
232
|
+
...docu && { documentation: docu }
|
|
161
233
|
});
|
|
162
234
|
break;
|
|
163
235
|
}
|
|
@@ -165,11 +237,13 @@ sap.ui.define([
|
|
|
165
237
|
properties.push({
|
|
166
238
|
type: FLOAT_VALUE_TYPE,
|
|
167
239
|
editor: INPUT_EDITOR_TYPE,
|
|
240
|
+
propertyType,
|
|
168
241
|
name: property.name,
|
|
169
242
|
readableName,
|
|
170
243
|
value: value,
|
|
171
244
|
isEnabled,
|
|
172
|
-
ui5Type
|
|
245
|
+
ui5Type,
|
|
246
|
+
...docu && { documentation: docu }
|
|
173
247
|
});
|
|
174
248
|
break;
|
|
175
249
|
}
|
|
@@ -177,11 +251,13 @@ sap.ui.define([
|
|
|
177
251
|
properties.push({
|
|
178
252
|
type: BOOLEAN_VALUE_TYPE,
|
|
179
253
|
editor: CHECKBOX_EDITOR_TYPE,
|
|
254
|
+
propertyType,
|
|
180
255
|
name: property.name,
|
|
181
256
|
readableName,
|
|
182
257
|
value: value,
|
|
183
258
|
isEnabled,
|
|
184
|
-
ui5Type
|
|
259
|
+
ui5Type,
|
|
260
|
+
...docu && { documentation: docu }
|
|
185
261
|
});
|
|
186
262
|
break;
|
|
187
263
|
}
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
FLOAT_VALUE_TYPE,
|
|
7
7
|
INPUT_EDITOR_TYPE,
|
|
8
8
|
INTEGER_VALUE_TYPE,
|
|
9
|
+
PropertyType,
|
|
9
10
|
STRING_VALUE_TYPE,
|
|
10
11
|
convertCamelCaseToPascalCase
|
|
11
12
|
} from '@sap-ux-private/control-property-editor-common';
|
|
@@ -13,9 +14,12 @@ import {
|
|
|
13
14
|
import Utils from 'sap/ui/fl/Utils';
|
|
14
15
|
import type ManagedObject from 'sap/ui/base/ManagedObject';
|
|
15
16
|
import type ElementOverlay from 'sap/ui/dt/ElementOverlay';
|
|
16
|
-
import type
|
|
17
|
+
import { getManifestProperties, MergedSetting, type ManagedObjectMetadataProperties } from './utils';
|
|
17
18
|
import { UI5ControlProperty } from './types';
|
|
18
19
|
import DataType from 'sap/ui/base/DataType';
|
|
20
|
+
import { getV4PageType } from '../utils/fe-v4';
|
|
21
|
+
import { ChangeService } from './changes';
|
|
22
|
+
import { TemplateType } from 'sap/ui/dt/DesignTimeMetadata';
|
|
19
23
|
|
|
20
24
|
type AnalyzedType = Pick<UI5ControlProperty, 'isArray' | 'primitiveType' | 'ui5Type' | 'enumValues'>;
|
|
21
25
|
|
|
@@ -124,6 +128,35 @@ function analyzePropertyType(property: ManagedObjectMetadataProperties): Analyze
|
|
|
124
128
|
return analyzedType;
|
|
125
129
|
}
|
|
126
130
|
|
|
131
|
+
function analyzeManifestProperty(property: MergedSetting): AnalyzedType | undefined {
|
|
132
|
+
const analyzedType: AnalyzedType = {
|
|
133
|
+
primitiveType: 'any',
|
|
134
|
+
ui5Type: null,
|
|
135
|
+
enumValues: undefined,
|
|
136
|
+
isArray: false
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
const propertyType = property.type;
|
|
140
|
+
|
|
141
|
+
if (!propertyType) {
|
|
142
|
+
return undefined;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
if (['boolean', 'string', 'int', 'float'].includes(propertyType)) {
|
|
146
|
+
analyzedType.primitiveType = propertyType;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (property.enums) {
|
|
150
|
+
analyzedType.primitiveType = 'enum';
|
|
151
|
+
analyzedType.enumValues = property.enums.reduce<Record<string, string>>((acc, item) => {
|
|
152
|
+
acc[item.id] = item.name;
|
|
153
|
+
return acc;
|
|
154
|
+
}, {});
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return analyzedType;
|
|
158
|
+
}
|
|
159
|
+
|
|
127
160
|
/**
|
|
128
161
|
* If rawValue is anything except an object like {} or a function, return it as-is,
|
|
129
162
|
* If it is an object, stringify it.
|
|
@@ -170,65 +203,113 @@ interface NewControlData {
|
|
|
170
203
|
* Build control data.
|
|
171
204
|
*
|
|
172
205
|
* @param control - ui5 control
|
|
206
|
+
* @param changeService - Changeservice for change stack event handling.
|
|
173
207
|
* @param controlOverlay - element overlay
|
|
174
208
|
* @param includeDocumentation - include documentation flag
|
|
175
209
|
* @returns Promise<Control>
|
|
176
210
|
*/
|
|
177
|
-
export function buildControlData(
|
|
211
|
+
export function buildControlData(
|
|
212
|
+
control: ManagedObject,
|
|
213
|
+
changeService: ChangeService,
|
|
214
|
+
controlOverlay?: ElementOverlay
|
|
215
|
+
): Control {
|
|
178
216
|
const controlMetadata = control.getMetadata();
|
|
179
217
|
const selectedControlName = controlMetadata.getName();
|
|
180
218
|
const hasStableId = Utils.checkControlId(control);
|
|
181
|
-
const
|
|
219
|
+
const overlayData = controlOverlay?.getDesignTimeMetadata().getData();
|
|
182
220
|
|
|
183
|
-
|
|
184
|
-
const
|
|
185
|
-
|
|
221
|
+
const controlProperties = controlOverlay ? overlayData?.properties : undefined;
|
|
222
|
+
const manifestProperties = getManifestProperties(control, changeService, controlOverlay);
|
|
223
|
+
// Add the control's properties/manifest properties
|
|
224
|
+
const allProperties = {
|
|
225
|
+
...(controlMetadata.getAllProperties() as unknown as {
|
|
226
|
+
[name: string]: ManagedObjectMetadataProperties;
|
|
227
|
+
}),
|
|
228
|
+
...manifestProperties
|
|
186
229
|
};
|
|
230
|
+
let propertyType;
|
|
187
231
|
const propertyNames = Object.keys(allProperties);
|
|
188
232
|
const properties: ControlProperty[] = [];
|
|
189
233
|
for (const propertyName of propertyNames) {
|
|
190
234
|
const property = allProperties[propertyName];
|
|
235
|
+
let analyzedType;
|
|
236
|
+
let isEnabled = false;
|
|
237
|
+
let value: unknown;
|
|
238
|
+
if (property && 'configuration' in property) {
|
|
239
|
+
propertyType = PropertyType.Configuration;
|
|
240
|
+
analyzedType = analyzeManifestProperty(property);
|
|
241
|
+
if (
|
|
242
|
+
!analyzedType ||
|
|
243
|
+
(property?.restrictedTo?.length &&
|
|
244
|
+
!property?.restrictedTo?.includes(getV4PageType(control) as TemplateType))
|
|
245
|
+
) {
|
|
246
|
+
continue;
|
|
247
|
+
}
|
|
248
|
+
isEnabled = true;
|
|
249
|
+
value = property.value;
|
|
250
|
+
} else {
|
|
251
|
+
propertyType = PropertyType.ControlProperty;
|
|
252
|
+
// the default behavior is that the property is enabled
|
|
253
|
+
// meaning it's not ignored during design time
|
|
254
|
+
analyzedType = analyzePropertyType(property);
|
|
255
|
+
if (!analyzedType) {
|
|
256
|
+
continue;
|
|
257
|
+
}
|
|
258
|
+
let ignore = false;
|
|
259
|
+
if (controlProperties?.[property.name]) {
|
|
260
|
+
// check whether the property should be ignored in design time or not
|
|
261
|
+
// if it's 'undefined' then it's not considered when building isEnabled because it's 'true'
|
|
262
|
+
ignore = controlProperties[property.name].ignore;
|
|
263
|
+
}
|
|
191
264
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
//updating i18n text for the control if bindingInfo has bindingString
|
|
206
|
-
const controlNewData: NewControlData = {
|
|
207
|
-
id: control.getId(),
|
|
208
|
-
name: property.name,
|
|
209
|
-
newValue: control.getProperty(property.name)
|
|
210
|
-
};
|
|
211
|
-
const bindingInfo: { bindingString?: string } = control.getBindingInfo(controlNewData.name) as {
|
|
212
|
-
bindingString?: string;
|
|
213
|
-
};
|
|
214
|
-
if (bindingInfo?.bindingString !== undefined) {
|
|
215
|
-
controlNewData.newValue = bindingInfo.bindingString;
|
|
216
|
-
}
|
|
265
|
+
//updating i18n text for the control if bindingInfo has bindingString
|
|
266
|
+
const controlNewData: NewControlData = {
|
|
267
|
+
id: control.getId(),
|
|
268
|
+
name: property.name,
|
|
269
|
+
newValue: control.getProperty(property.name)
|
|
270
|
+
};
|
|
271
|
+
const bindingInfo: { bindingString?: string } = control.getBindingInfo(controlNewData.name) as {
|
|
272
|
+
bindingString?: string;
|
|
273
|
+
};
|
|
274
|
+
if (bindingInfo?.bindingString !== undefined) {
|
|
275
|
+
controlNewData.newValue = bindingInfo.bindingString;
|
|
276
|
+
}
|
|
217
277
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
278
|
+
// A property is enabled if:
|
|
279
|
+
// 1. The property supports changes
|
|
280
|
+
// 2. The control has stable ID
|
|
281
|
+
// 3. It is not configured to be ignored in design time
|
|
282
|
+
// 4. And control overlay is selectable
|
|
283
|
+
isEnabled = isControlEnabled(analyzedType, hasStableId, ignore, controlOverlay);
|
|
224
284
|
|
|
225
|
-
|
|
285
|
+
value = normalizeObjectPropertyValue(controlNewData.newValue);
|
|
286
|
+
}
|
|
226
287
|
const isIcon =
|
|
227
288
|
testIconPattern(property.name) &&
|
|
228
289
|
selectedControlName !== 'sap.m.Image' &&
|
|
229
290
|
analyzedType.ui5Type === 'sap.ui.core.URI';
|
|
230
291
|
const ui5Type = analyzedType.ui5Type || undefined;
|
|
231
292
|
const readableName = convertCamelCaseToPascalCase(property.name);
|
|
293
|
+
let docu:
|
|
294
|
+
| {
|
|
295
|
+
defaultValue: string;
|
|
296
|
+
description: string;
|
|
297
|
+
propertyName: string;
|
|
298
|
+
type?: string;
|
|
299
|
+
propertyType?: string;
|
|
300
|
+
}
|
|
301
|
+
| undefined;
|
|
302
|
+
if ('configuration' in property) {
|
|
303
|
+
const defValue = ['undefined', 'null'].includes(String(property.defaultValue))
|
|
304
|
+
? '-'
|
|
305
|
+
: String(property.defaultValue);
|
|
306
|
+
docu = {
|
|
307
|
+
description: property.description,
|
|
308
|
+
propertyName: property.id,
|
|
309
|
+
type: property.type,
|
|
310
|
+
defaultValue: defValue || '-'
|
|
311
|
+
};
|
|
312
|
+
}
|
|
232
313
|
switch (analyzedType.primitiveType) {
|
|
233
314
|
case 'enum': {
|
|
234
315
|
const values = analyzedType.enumValues ?? {};
|
|
@@ -239,12 +320,14 @@ export function buildControlData(control: ManagedObject, controlOverlay?: Elemen
|
|
|
239
320
|
properties.push({
|
|
240
321
|
type: STRING_VALUE_TYPE,
|
|
241
322
|
editor: DROPDOWN_EDITOR_TYPE,
|
|
323
|
+
propertyType,
|
|
242
324
|
name: property.name,
|
|
243
325
|
readableName,
|
|
244
326
|
value: value as string,
|
|
245
327
|
isEnabled,
|
|
246
328
|
ui5Type,
|
|
247
|
-
options
|
|
329
|
+
options,
|
|
330
|
+
...(docu && { documentation: docu })
|
|
248
331
|
});
|
|
249
332
|
break;
|
|
250
333
|
}
|
|
@@ -252,12 +335,14 @@ export function buildControlData(control: ManagedObject, controlOverlay?: Elemen
|
|
|
252
335
|
properties.push({
|
|
253
336
|
type: STRING_VALUE_TYPE,
|
|
254
337
|
editor: INPUT_EDITOR_TYPE,
|
|
338
|
+
propertyType,
|
|
255
339
|
name: property.name,
|
|
256
340
|
readableName,
|
|
257
341
|
value: value as string,
|
|
258
342
|
isEnabled,
|
|
259
343
|
isIcon,
|
|
260
|
-
ui5Type
|
|
344
|
+
ui5Type,
|
|
345
|
+
...(docu && { documentation: docu })
|
|
261
346
|
});
|
|
262
347
|
break;
|
|
263
348
|
}
|
|
@@ -265,11 +350,13 @@ export function buildControlData(control: ManagedObject, controlOverlay?: Elemen
|
|
|
265
350
|
properties.push({
|
|
266
351
|
type: INTEGER_VALUE_TYPE,
|
|
267
352
|
editor: INPUT_EDITOR_TYPE,
|
|
353
|
+
propertyType,
|
|
268
354
|
name: property.name,
|
|
269
355
|
readableName,
|
|
270
356
|
value: value as number,
|
|
271
357
|
isEnabled,
|
|
272
|
-
ui5Type
|
|
358
|
+
ui5Type,
|
|
359
|
+
...(docu && { documentation: docu })
|
|
273
360
|
});
|
|
274
361
|
break;
|
|
275
362
|
}
|
|
@@ -277,11 +364,13 @@ export function buildControlData(control: ManagedObject, controlOverlay?: Elemen
|
|
|
277
364
|
properties.push({
|
|
278
365
|
type: FLOAT_VALUE_TYPE,
|
|
279
366
|
editor: INPUT_EDITOR_TYPE,
|
|
367
|
+
propertyType,
|
|
280
368
|
name: property.name,
|
|
281
369
|
readableName,
|
|
282
370
|
value: value as number,
|
|
283
371
|
isEnabled,
|
|
284
|
-
ui5Type
|
|
372
|
+
ui5Type,
|
|
373
|
+
...(docu && { documentation: docu })
|
|
285
374
|
});
|
|
286
375
|
break;
|
|
287
376
|
}
|
|
@@ -289,11 +378,13 @@ export function buildControlData(control: ManagedObject, controlOverlay?: Elemen
|
|
|
289
378
|
properties.push({
|
|
290
379
|
type: BOOLEAN_VALUE_TYPE,
|
|
291
380
|
editor: CHECKBOX_EDITOR_TYPE,
|
|
381
|
+
propertyType,
|
|
292
382
|
name: property.name,
|
|
293
383
|
readableName,
|
|
294
384
|
value: value as boolean,
|
|
295
385
|
isEnabled,
|
|
296
|
-
ui5Type
|
|
386
|
+
ui5Type,
|
|
387
|
+
...(docu && { documentation: docu })
|
|
297
388
|
});
|
|
298
389
|
break;
|
|
299
390
|
}
|
package/dist/client/cpe/init.js
CHANGED
|
@@ -37,10 +37,10 @@ sap.ui.define([
|
|
|
37
37
|
function subscribe(handler) {
|
|
38
38
|
CommunicationService.subscribe(handler);
|
|
39
39
|
}
|
|
40
|
-
const selectionService = new SelectionService(rta);
|
|
41
|
-
const changesService = new ChangeService({ rta }, selectionService);
|
|
42
|
-
const connectorService = new WorkspaceConnectorService();
|
|
43
40
|
const rtaService = new RtaService(rta);
|
|
41
|
+
const changesService = new ChangeService({ rta });
|
|
42
|
+
const selectionService = new SelectionService(rta, changesService);
|
|
43
|
+
const connectorService = new WorkspaceConnectorService();
|
|
44
44
|
const outlineService = new OutlineService(rta, changesService);
|
|
45
45
|
const quickActionService = new QuickActionService(rta, outlineService, registries);
|
|
46
46
|
const services = [
|
package/dist/client/cpe/init.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import Log from 'sap/base/Log';
|
|
2
2
|
import type RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring';
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
iconsLoaded,
|
|
6
|
-
enableTelemetry,
|
|
7
|
-
appLoaded
|
|
8
|
-
} from '@sap-ux-private/control-property-editor-common';
|
|
4
|
+
import { iconsLoaded, enableTelemetry, appLoaded } from '@sap-ux-private/control-property-editor-common';
|
|
9
5
|
|
|
10
6
|
import type { ActionHandler, Service } from './types';
|
|
11
7
|
import { OutlineService } from './outline/service';
|
|
@@ -40,11 +36,12 @@ export default function init(
|
|
|
40
36
|
CommunicationService.subscribe(handler);
|
|
41
37
|
}
|
|
42
38
|
|
|
43
|
-
const
|
|
39
|
+
const rtaService = new RtaService(rta);
|
|
40
|
+
|
|
41
|
+
const changesService = new ChangeService({ rta });
|
|
42
|
+
const selectionService = new SelectionService(rta, changesService);
|
|
44
43
|
|
|
45
|
-
const changesService = new ChangeService({ rta }, selectionService);
|
|
46
44
|
const connectorService = new WorkspaceConnectorService();
|
|
47
|
-
const rtaService = new RtaService(rta);
|
|
48
45
|
const outlineService = new OutlineService(rta, changesService);
|
|
49
46
|
const quickActionService = new QuickActionService(rta, outlineService, registries);
|
|
50
47
|
const services: Service[] = [
|
|
@@ -6,8 +6,8 @@ sap.ui.define(["../control-data", "../utils", "sap/ui/dt/OverlayUtil", "sap/ui/d
|
|
|
6
6
|
const buildControlData = ___control_data["buildControlData"];
|
|
7
7
|
const getRuntimeControl = ___utils["getRuntimeControl"];
|
|
8
8
|
const getComponent = ____utils_core["getComponent"];
|
|
9
|
-
const isEditable = function () {
|
|
10
|
-
let id = arguments.length >
|
|
9
|
+
const isEditable = function (changeService) {
|
|
10
|
+
let id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
11
11
|
let editable = false;
|
|
12
12
|
const control = sap.ui.getCore().byId(id);
|
|
13
13
|
if (!control) {
|
|
@@ -23,7 +23,7 @@ sap.ui.define(["../control-data", "../utils", "sap/ui/dt/OverlayUtil", "sap/ui/d
|
|
|
23
23
|
}
|
|
24
24
|
if (controlOverlay) {
|
|
25
25
|
const runtimeControl = getRuntimeControl(controlOverlay);
|
|
26
|
-
const controlData = buildControlData(runtimeControl, controlOverlay);
|
|
26
|
+
const controlData = buildControlData(runtimeControl, changeService, controlOverlay);
|
|
27
27
|
const prop = controlData.properties.find(item => item.isEnabled === true);
|
|
28
28
|
editable = prop !== undefined;
|
|
29
29
|
}
|
|
@@ -3,8 +3,9 @@ import { getRuntimeControl } from '../utils';
|
|
|
3
3
|
import OverlayUtil from 'sap/ui/dt/OverlayUtil';
|
|
4
4
|
import OverlayRegistry from 'sap/ui/dt/OverlayRegistry';
|
|
5
5
|
import { getComponent } from '../../utils/core';
|
|
6
|
+
import { ChangeService } from '../changes';
|
|
6
7
|
|
|
7
|
-
export const isEditable = (id = ''): boolean => {
|
|
8
|
+
export const isEditable = (changeService: ChangeService, id = ''): boolean => {
|
|
8
9
|
let editable = false;
|
|
9
10
|
const control = sap.ui.getCore().byId(id);
|
|
10
11
|
if (!control) {
|
|
@@ -20,7 +21,7 @@ export const isEditable = (id = ''): boolean => {
|
|
|
20
21
|
}
|
|
21
22
|
if (controlOverlay) {
|
|
22
23
|
const runtimeControl = getRuntimeControl(controlOverlay);
|
|
23
|
-
const controlData = buildControlData(runtimeControl, controlOverlay);
|
|
24
|
+
const controlData = buildControlData(runtimeControl, changeService, controlOverlay);
|
|
24
25
|
const prop = controlData.properties.find((item) => item.isEnabled === true);
|
|
25
26
|
editable = prop !== undefined;
|
|
26
27
|
}
|