@sap-ux/preview-middleware 0.23.48 → 0.23.49
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/command-executor.js +99 -66
- package/dist/client/adp/controllers/AddCustomFragment.controller.js +120 -102
- package/dist/client/adp/controllers/AddFragment.controller.js +189 -163
- package/dist/client/adp/controllers/AddSubpage.controller.js +146 -137
- package/dist/client/adp/controllers/AddTableColumnFragments.controller.js +230 -188
- package/dist/client/adp/controllers/BaseDialog.controller.js +187 -164
- package/dist/client/adp/controllers/ControllerExtension.controller.js +329 -253
- package/dist/client/adp/controllers/ExtensionPoint.controller.js +158 -114
- package/dist/client/adp/extension-point.js +81 -60
- package/dist/client/adp/init.js +100 -99
- package/dist/client/adp/quick-actions/common/add-new-annotation-file.js +165 -147
- package/dist/client/adp/quick-actions/enablement-validator.js +0 -4
- package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +105 -100
- package/dist/client/adp/quick-actions/simple-quick-action-base.js +44 -40
- package/dist/client/adp/quick-actions/table-quick-action-base.js +309 -266
- package/dist/client/adp/sync-views-utils.js +119 -83
- package/dist/client/cpe/changes/flex-change.js +64 -48
- package/dist/client/cpe/changes/service.js +492 -367
- package/dist/client/cpe/communication-service.js +41 -29
- package/dist/client/cpe/connector-service.js +87 -64
- package/dist/client/cpe/context-menu-service.js +87 -74
- package/dist/client/cpe/control-data.js +353 -263
- package/dist/client/cpe/documentation.js +183 -126
- package/dist/client/cpe/init.js +69 -75
- package/dist/client/cpe/outline/service.js +60 -45
- package/dist/client/cpe/quick-actions/quick-action-definition.js +0 -4
- package/dist/client/cpe/quick-actions/quick-action-service.js +154 -129
- package/dist/client/cpe/rta-service.js +91 -69
- package/dist/client/cpe/selection.js +239 -187
- package/dist/client/cpe/types.js +0 -4
- package/dist/client/flp/init.js +403 -296
- package/dist/client/manifest.json +7 -4
- package/dist/client/thirdparty/@sap-ux-private/control-property-editor-common.js +444 -370
- package/dist/client/utils/info-center-message.js +59 -31
- package/dist/client/utils/version.js +128 -72
- package/package.json +2 -2
|
@@ -1,277 +1,320 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return [SETTINGS_ID];
|
|
39
|
-
} else {
|
|
40
|
-
return [SMART_TABLE_ACTION_ID];
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return [
|
|
44
|
-
M_TABLE_ACTION_ID,
|
|
45
|
-
SETTINGS_ID
|
|
46
|
-
];
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common", "sap/ui/dt/OverlayUtil", "../../cpe/quick-actions/utils", "../../utils/core", "../../utils/version", "./quick-action-base", "./control-types", "./fe-v2/utils"], function (___sap_ux_private_control_property_editor_common, OverlayUtil, ____cpe_quick_actions_utils, ____utils_core, ____utils_version, ___quick_action_base, ___control_types, ___fe_v2_utils) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const NESTED_QUICK_ACTION_KIND = ___sap_ux_private_control_property_editor_common["NESTED_QUICK_ACTION_KIND"];
|
|
7
|
+
const getParentContainer = ____cpe_quick_actions_utils["getParentContainer"];
|
|
8
|
+
const getRelevantControlFromActivePage = ____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
|
|
9
|
+
const getControlById = ____utils_core["getControlById"];
|
|
10
|
+
const isA = ____utils_core["isA"];
|
|
11
|
+
const isManagedObject = ____utils_core["isManagedObject"];
|
|
12
|
+
const getUi5Version = ____utils_version["getUi5Version"];
|
|
13
|
+
const isLowerThanMinimalUi5Version = ____utils_version["isLowerThanMinimalUi5Version"];
|
|
14
|
+
const QuickActionDefinitionBase = ___quick_action_base["QuickActionDefinitionBase"];
|
|
15
|
+
const ANALYTICAL_TABLE_TYPE = ___control_types["ANALYTICAL_TABLE_TYPE"];
|
|
16
|
+
const GRID_TABLE_TYPE = ___control_types["GRID_TABLE_TYPE"];
|
|
17
|
+
const M_TABLE_TYPE = ___control_types["M_TABLE_TYPE"];
|
|
18
|
+
const MDC_TABLE_TYPE = ___control_types["MDC_TABLE_TYPE"];
|
|
19
|
+
const SMART_TABLE_TYPE = ___control_types["SMART_TABLE_TYPE"];
|
|
20
|
+
const TREE_TABLE_TYPE = ___control_types["TREE_TABLE_TYPE"];
|
|
21
|
+
const isVariantManagementEnabledOPPage = ___fe_v2_utils["isVariantManagementEnabledOPPage"];
|
|
22
|
+
const SMART_TABLE_ACTION_ID = 'CTX_COMP_VARIANT_CONTENT';
|
|
23
|
+
const M_TABLE_ACTION_ID = 'CTX_ADD_ELEMENTS_AS_CHILD';
|
|
24
|
+
const SETTINGS_ID = 'CTX_SETTINGS';
|
|
25
|
+
const REARRANGE_TOOLBAR_SETTINGS_ID = 'CTX_SETTINGS0';
|
|
26
|
+
const ICON_TAB_BAR_TYPE = 'sap.m.IconTabBar';
|
|
27
|
+
async function getActionId(table) {
|
|
28
|
+
const {
|
|
29
|
+
major,
|
|
30
|
+
minor
|
|
31
|
+
} = await getUi5Version();
|
|
32
|
+
if (isA(SMART_TABLE_TYPE, table)) {
|
|
33
|
+
if (major === 1 && minor === 96) {
|
|
34
|
+
return [SETTINGS_ID];
|
|
35
|
+
} else {
|
|
36
|
+
return [SMART_TABLE_ACTION_ID];
|
|
37
|
+
}
|
|
47
38
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
39
|
+
return [M_TABLE_ACTION_ID, SETTINGS_ID];
|
|
40
|
+
}
|
|
41
|
+
async function getRearrangeToolbarContentActionId() {
|
|
42
|
+
const {
|
|
43
|
+
major,
|
|
44
|
+
minor
|
|
45
|
+
} = await getUi5Version();
|
|
46
|
+
if (major === 1 && minor <= 127) {
|
|
47
|
+
return SETTINGS_ID;
|
|
54
48
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
].some(tType => isA(tType, item)));
|
|
132
|
-
}
|
|
133
|
-
return tableInternal;
|
|
134
|
-
} catch (error) {
|
|
135
|
-
return undefined;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
getTableLabel(table) {
|
|
139
|
-
if (isA(SMART_TABLE_TYPE, table) || isA(MDC_TABLE_TYPE, table)) {
|
|
140
|
-
const header = table.getHeader();
|
|
141
|
-
if (header) {
|
|
142
|
-
return `'${ header }' table`;
|
|
143
|
-
}
|
|
144
|
-
} else if (isA(M_TABLE_TYPE, table)) {
|
|
145
|
-
const title = table?.getHeaderToolbar()?.getTitleControl()?.getText();
|
|
146
|
-
if (title) {
|
|
147
|
-
return `'${ title }' table`;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
return 'Unnamed table';
|
|
49
|
+
return REARRANGE_TOOLBAR_SETTINGS_ID;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Base class for table quick actions.
|
|
53
|
+
*/
|
|
54
|
+
class TableQuickActionDefinitionBase extends QuickActionDefinitionBase {
|
|
55
|
+
isApplicable = false;
|
|
56
|
+
children = [];
|
|
57
|
+
tableMap = {};
|
|
58
|
+
get textKey() {
|
|
59
|
+
return this.defaultTextKey;
|
|
60
|
+
}
|
|
61
|
+
constructor(type, controlTypes, defaultTextKey, context) {
|
|
62
|
+
let options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
|
63
|
+
let enablementValidators = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : [];
|
|
64
|
+
super(type, NESTED_QUICK_ACTION_KIND, defaultTextKey, context, enablementValidators);
|
|
65
|
+
this.type = type;
|
|
66
|
+
this.controlTypes = controlTypes;
|
|
67
|
+
this.defaultTextKey = defaultTextKey;
|
|
68
|
+
this.context = context;
|
|
69
|
+
this.options = options;
|
|
70
|
+
this.enablementValidators = enablementValidators;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Adds action id to the table map entry, if the service actions are needed.
|
|
75
|
+
* @param table - table element
|
|
76
|
+
* @param tableMapKey - map key
|
|
77
|
+
*/
|
|
78
|
+
async addSettingsActionId(table, tableMapKey) {
|
|
79
|
+
if (this.options.includeServiceAction) {
|
|
80
|
+
const actions = await this.context.actionService.get(table.getId());
|
|
81
|
+
const actionsIds = await getActionId(table);
|
|
82
|
+
const changeColumnActionId = actionsIds.find(actionId => actions.findIndex(action => action.id === actionId) > -1);
|
|
83
|
+
this.tableMap[tableMapKey].changeColumnActionId = changeColumnActionId;
|
|
84
|
+
const changeToolbarContentActionId = await getRearrangeToolbarContentActionId();
|
|
85
|
+
const changeToolbarContentAction = actions.find(action => action.id === changeToolbarContentActionId);
|
|
86
|
+
this.tableMap[tableMapKey].changeToolbarContentAction = changeToolbarContentAction ? {
|
|
87
|
+
id: changeToolbarContentAction.id,
|
|
88
|
+
enabled: changeToolbarContentAction.enabled
|
|
89
|
+
} : undefined;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Initializes action object instance
|
|
95
|
+
*/
|
|
96
|
+
async initialize() {
|
|
97
|
+
// No action found in control design time for version < 1.96
|
|
98
|
+
const version = await getUi5Version();
|
|
99
|
+
if (isLowerThanMinimalUi5Version(version, {
|
|
100
|
+
major: 1,
|
|
101
|
+
minor: 96
|
|
102
|
+
})) {
|
|
103
|
+
this.isApplicable = false;
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
const iconTabBarfilterMap = this.buildIconTabBarFilterMap();
|
|
107
|
+
for (const table of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, this.controlTypes)) {
|
|
108
|
+
const tabKey = Object.keys(iconTabBarfilterMap).find(key => table.getId().endsWith(key));
|
|
109
|
+
const section = getParentContainer(table, 'sap.uxap.ObjectPageSection');
|
|
110
|
+
if (section) {
|
|
111
|
+
await this.collectChildrenInSection(section, table);
|
|
112
|
+
} else if (this.iconTabBar && tabKey) {
|
|
113
|
+
const label = `'${iconTabBarfilterMap[tabKey]}' table`;
|
|
114
|
+
const tableMapKey = this.children.length.toString();
|
|
115
|
+
const child = this.createChild(label, table, tableMapKey);
|
|
116
|
+
this.children.push(child);
|
|
117
|
+
this.tableMap[tableMapKey] = {
|
|
118
|
+
table,
|
|
119
|
+
iconTabBarFilterKey: tabKey,
|
|
120
|
+
tableUpdateEventAttachedOnce: false
|
|
121
|
+
};
|
|
122
|
+
await this.addSettingsActionId(table, tableMapKey);
|
|
123
|
+
} else {
|
|
124
|
+
await this.processTable(table);
|
|
151
125
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
126
|
+
}
|
|
127
|
+
if (this.children.length > 0) {
|
|
128
|
+
this.isApplicable = true;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Retrieves the internal table control from a UI5Element.
|
|
134
|
+
*
|
|
135
|
+
* @param table - The UI5Element instance to analyze.
|
|
136
|
+
* @returns The internal table otherwise undefined.
|
|
137
|
+
*/
|
|
138
|
+
getInternalTable(table) {
|
|
139
|
+
try {
|
|
140
|
+
let tableInternal;
|
|
141
|
+
if (isA(SMART_TABLE_TYPE, table)) {
|
|
142
|
+
const itemsAggregation = table.getAggregation('items');
|
|
143
|
+
tableInternal = itemsAggregation.find(item => [M_TABLE_TYPE, TREE_TABLE_TYPE, ANALYTICAL_TABLE_TYPE, GRID_TABLE_TYPE].some(tType => isA(tType, item)));
|
|
167
144
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
tableMapIndex = `${ this.children.length }/0`;
|
|
185
|
-
const child = this.createChild(label, table, tableMapIndex);
|
|
186
|
-
this.children.push({
|
|
187
|
-
path: this.children.length.toString(),
|
|
188
|
-
label: `'${ section?.getTitle() }' section`,
|
|
189
|
-
enabled: true,
|
|
190
|
-
children: [child]
|
|
191
|
-
});
|
|
192
|
-
} else {
|
|
193
|
-
tableMapIndex = `${ existingChildIdx }/${ this.children[existingChildIdx].children.length }`;
|
|
194
|
-
const child = this.createChild(label, table, tableMapIndex);
|
|
195
|
-
this.children[existingChildIdx].children.push(child);
|
|
196
|
-
}
|
|
197
|
-
this.tableMap[tableMapIndex] = {
|
|
198
|
-
table,
|
|
199
|
-
sectionInfo: {
|
|
200
|
-
section,
|
|
201
|
-
subSection,
|
|
202
|
-
layout
|
|
203
|
-
},
|
|
204
|
-
tableUpdateEventAttachedOnce: false
|
|
205
|
-
};
|
|
206
|
-
await this.addSettingsActionId(table, tableMapIndex);
|
|
207
|
-
}
|
|
208
|
-
}
|
|
145
|
+
return tableInternal;
|
|
146
|
+
} catch (error) {
|
|
147
|
+
return undefined;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Determines table label for the given table element
|
|
153
|
+
* @param table - table element
|
|
154
|
+
* @returns table label if found or 'Unnamed table'
|
|
155
|
+
*/
|
|
156
|
+
getTableLabel(table) {
|
|
157
|
+
if (isA(SMART_TABLE_TYPE, table) || isA(MDC_TABLE_TYPE, table)) {
|
|
158
|
+
const header = table.getHeader();
|
|
159
|
+
if (header) {
|
|
160
|
+
return `'${header}' table`;
|
|
209
161
|
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
M_TABLE_TYPE,
|
|
215
|
-
MDC_TABLE_TYPE,
|
|
216
|
-
TREE_TABLE_TYPE,
|
|
217
|
-
GRID_TABLE_TYPE,
|
|
218
|
-
ANALYTICAL_TABLE_TYPE
|
|
219
|
-
].some(type => isA(type, table))) {
|
|
220
|
-
const label = this.getTableLabel(table);
|
|
221
|
-
const child = this.createChild(label, table, tableMapKey);
|
|
222
|
-
this.children.push(child);
|
|
223
|
-
}
|
|
224
|
-
this.tableMap[tableMapKey] = {
|
|
225
|
-
table,
|
|
226
|
-
sectionInfo: sectionInfo,
|
|
227
|
-
tableUpdateEventAttachedOnce: false
|
|
228
|
-
};
|
|
229
|
-
await this.addSettingsActionId(table, tableMapKey);
|
|
162
|
+
} else if (isA(M_TABLE_TYPE, table)) {
|
|
163
|
+
const title = table?.getHeaderToolbar()?.getTitleControl()?.getText();
|
|
164
|
+
if (title) {
|
|
165
|
+
return `'${title}' table`;
|
|
230
166
|
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
167
|
+
}
|
|
168
|
+
return 'Unnamed table';
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Builds a map kay/tab_name for ICON_TAB_BAR control of the active page, if such exists
|
|
173
|
+
* @returns built map
|
|
174
|
+
*/
|
|
175
|
+
buildIconTabBarFilterMap() {
|
|
176
|
+
const iconTabBarFilterMap = {};
|
|
177
|
+
|
|
178
|
+
// Assumption only a tab bar control per page.
|
|
179
|
+
const tabBar = getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, [ICON_TAB_BAR_TYPE])[0];
|
|
180
|
+
if (tabBar) {
|
|
181
|
+
const control = getControlById(tabBar.getId());
|
|
182
|
+
if (isA(ICON_TAB_BAR_TYPE, control)) {
|
|
183
|
+
this.iconTabBar = control;
|
|
184
|
+
for (const item of control.getItems()) {
|
|
185
|
+
if (isManagedObject(item) && isA('sap.m.IconTabFilter', item)) {
|
|
186
|
+
iconTabBarFilterMap[item.getKey()] = item.getText();
|
|
235
187
|
}
|
|
188
|
+
}
|
|
236
189
|
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
190
|
+
}
|
|
191
|
+
return iconTabBarFilterMap;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Collects subsection data in the table map for the given section and table
|
|
196
|
+
* @param section - object page section
|
|
197
|
+
* @param table - table element
|
|
198
|
+
*/
|
|
199
|
+
async collectChildrenInSection(section, table) {
|
|
200
|
+
const layout = getParentContainer(table, 'sap.uxap.ObjectPageLayout');
|
|
201
|
+
const subSections = section.getSubSections();
|
|
202
|
+
const subSection = getParentContainer(table, 'sap.uxap.ObjectPageSubSection');
|
|
203
|
+
if (subSection) {
|
|
204
|
+
if (subSections?.length === 1) {
|
|
205
|
+
await this.processTable(table, {
|
|
206
|
+
section,
|
|
207
|
+
subSection: subSections[0],
|
|
208
|
+
layout
|
|
209
|
+
});
|
|
210
|
+
} else if (subSections.length > 1) {
|
|
211
|
+
const existingChildIdx = this.children.findIndex(val => val.label === `'${section.getTitle()}' section`);
|
|
212
|
+
let tableMapIndex;
|
|
213
|
+
const label = this.getTableLabel(table);
|
|
214
|
+
if (existingChildIdx < 0) {
|
|
215
|
+
tableMapIndex = `${this.children.length}/0`;
|
|
216
|
+
const child = this.createChild(label, table, tableMapIndex);
|
|
217
|
+
this.children.push({
|
|
218
|
+
path: this.children.length.toString(),
|
|
219
|
+
label: `'${section?.getTitle()}' section`,
|
|
220
|
+
enabled: true,
|
|
221
|
+
children: [child]
|
|
222
|
+
});
|
|
223
|
+
} else {
|
|
224
|
+
tableMapIndex = `${existingChildIdx}/${this.children[existingChildIdx].children.length}`;
|
|
225
|
+
const child = this.createChild(label, table, tableMapIndex);
|
|
226
|
+
this.children[existingChildIdx].children.push(child);
|
|
227
|
+
}
|
|
228
|
+
this.tableMap[tableMapIndex] = {
|
|
229
|
+
table,
|
|
230
|
+
sectionInfo: {
|
|
231
|
+
section,
|
|
232
|
+
subSection,
|
|
233
|
+
layout
|
|
234
|
+
},
|
|
235
|
+
tableUpdateEventAttachedOnce: false
|
|
236
|
+
};
|
|
237
|
+
await this.addSettingsActionId(table, tableMapIndex);
|
|
246
238
|
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Processes table element and pushes table data to the children array
|
|
244
|
+
* @param table - table element
|
|
245
|
+
* @param sectionInfo - section info object
|
|
246
|
+
*/
|
|
247
|
+
async processTable(table, sectionInfo) {
|
|
248
|
+
const tableMapKey = this.children.length.toString();
|
|
249
|
+
if ([SMART_TABLE_TYPE, M_TABLE_TYPE, MDC_TABLE_TYPE, TREE_TABLE_TYPE, GRID_TABLE_TYPE, ANALYTICAL_TABLE_TYPE].some(type => isA(type, table))) {
|
|
250
|
+
const label = this.getTableLabel(table);
|
|
251
|
+
const child = this.createChild(label, table, tableMapKey);
|
|
252
|
+
this.children.push(child);
|
|
253
|
+
}
|
|
254
|
+
this.tableMap[tableMapKey] = {
|
|
255
|
+
table,
|
|
256
|
+
sectionInfo: sectionInfo,
|
|
257
|
+
tableUpdateEventAttachedOnce: false
|
|
258
|
+
};
|
|
259
|
+
await this.addSettingsActionId(table, tableMapKey);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Selects closest overlay for the given table element
|
|
264
|
+
* @param table - table element
|
|
265
|
+
*/
|
|
266
|
+
selectOverlay(table) {
|
|
267
|
+
const controlOverlay = OverlayUtil.getClosestOverlayFor(table);
|
|
268
|
+
if (controlOverlay) {
|
|
269
|
+
controlOverlay.setSelected(true);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Prepares nested quick action object
|
|
275
|
+
* @returns action instance
|
|
276
|
+
*/
|
|
277
|
+
getActionObject() {
|
|
278
|
+
return {
|
|
279
|
+
kind: NESTED_QUICK_ACTION_KIND,
|
|
280
|
+
id: this.id,
|
|
281
|
+
enabled: !this.isDisabled,
|
|
282
|
+
tooltip: this.tooltip,
|
|
283
|
+
title: this.context.resourceBundle.getText(this.textKey),
|
|
284
|
+
children: this.children
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
createChild(label, table, path) {
|
|
288
|
+
const child = {
|
|
289
|
+
path,
|
|
290
|
+
label,
|
|
291
|
+
enabled: true,
|
|
292
|
+
children: []
|
|
293
|
+
};
|
|
294
|
+
if (this.options.validatePageVariantManagement) {
|
|
295
|
+
const variantEnabledV2 = isVariantManagementEnabledOPPage(this.context, table);
|
|
296
|
+
if (variantEnabledV2 === false) {
|
|
297
|
+
child.enabled = false;
|
|
298
|
+
child.tooltip = this.context.resourceBundle.getText('TABLE_ACTION_DISABLED_VARIANT_MANAGEMENT_NOT_AVAILABLE');
|
|
299
|
+
return child;
|
|
272
300
|
}
|
|
301
|
+
}
|
|
302
|
+
if (!this.options.areTableRowsRequired) {
|
|
303
|
+
return child;
|
|
304
|
+
}
|
|
305
|
+
const innerTable = this.getInternalTable(table);
|
|
306
|
+
const tableRows = innerTable?.getAggregation('items') ?? [];
|
|
307
|
+
if (isA(M_TABLE_TYPE, innerTable) && Array.isArray(tableRows) && tableRows.length === 0) {
|
|
308
|
+
child.enabled = false;
|
|
309
|
+
child.tooltip = this.context.resourceBundle.getText('TABLE_ACTION_DISABLED_ROWS_NOT_AVAILABLE');
|
|
310
|
+
}
|
|
311
|
+
return child;
|
|
273
312
|
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
}
|
|
313
|
+
}
|
|
314
|
+
var __exports = {
|
|
315
|
+
__esModule: true
|
|
316
|
+
};
|
|
317
|
+
__exports.TableQuickActionDefinitionBase = TableQuickActionDefinitionBase;
|
|
318
|
+
return __exports;
|
|
319
|
+
});
|
|
320
|
+
//# sourceMappingURL=table-quick-action-base.js.map
|