@sap-ux/preview-middleware 0.16.79 → 0.16.80
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/base/config.js +8 -8
- package/dist/base/flex.d.ts +0 -1
- package/dist/base/flex.js +3 -4
- package/dist/base/flp.d.ts +0 -1
- package/dist/base/flp.js +2 -2
- package/dist/base/test.d.ts +0 -1
- package/dist/base/test.js +2 -3
- package/dist/client/adp/api-handler.js +142 -142
- package/dist/client/adp/command-executor.js +58 -58
- package/dist/client/adp/control-utils.js +44 -44
- package/dist/client/adp/controllers/BaseDialog.controller.js +105 -105
- package/dist/client/adp/controllers/ControllerExtension.controller.js +213 -213
- package/dist/client/adp/controllers/ExtensionPoint.controller.js +138 -138
- package/dist/client/adp/init-dialogs.js +159 -159
- package/dist/client/adp/quick-actions/common/add-controller-to-page.js +54 -54
- package/dist/client/adp/quick-actions/common/op-add-custom-section.js +35 -35
- package/dist/client/adp/quick-actions/common/op-add-header-field.js +47 -47
- package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +98 -98
- package/dist/client/adp/quick-actions/fe-v2/create-page-action.js +35 -35
- package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +69 -69
- package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +57 -57
- package/dist/client/adp/quick-actions/fe-v2/registry.js +60 -60
- package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +79 -79
- package/dist/client/adp/quick-actions/fe-v4/registry.js +50 -50
- package/dist/client/adp/quick-actions/fe-v4/utils.js +52 -52
- package/dist/client/adp/quick-actions/load.js +48 -48
- package/dist/client/adp/utils.js +160 -160
- package/dist/client/cpe/changes/flex-change.js +51 -51
- package/dist/client/cpe/changes/index.js +10 -10
- package/dist/client/cpe/changes/validator.js +34 -34
- package/dist/client/cpe/documentation.js +164 -164
- package/dist/client/cpe/logger.js +30 -30
- package/dist/client/cpe/outline/editable.js +37 -37
- package/dist/client/cpe/outline/nodes.js +187 -187
- 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 +97 -97
- package/dist/client/flp/WorkspaceConnector.js +87 -87
- package/dist/client/flp/common.js +28 -28
- package/dist/client/flp/enableFakeConnector.js +84 -84
- package/dist/client/flp/initConnectors.js +30 -30
- package/dist/client/flp/initRta.js +178 -178
- package/dist/client/i18n.js +56 -56
- package/dist/client/thirdparty/@sap-ux-private/control-property-editor-common.js +5 -8
- package/dist/client/tsconfig.tsbuildinfo +1 -0
- package/dist/client/utils/application.js +32 -32
- package/dist/client/utils/core.js +68 -68
- package/dist/client/utils/error.js +19 -19
- package/dist/client/utils/version.js +68 -68
- package/package.json +4 -4
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["../../../utils/core", "sap/ui/dt/OverlayRegistry", "../../init-dialogs", "./table-quick-action-base"], function (_____utils_core, OverlayRegistry, ____init_dialogs, ___table_quick_action_base) {
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
const getControlById = _____utils_core["getControlById"];
|
|
7
|
-
const isA = _____utils_core["isA"];
|
|
8
|
-
const DialogNames = ____init_dialogs["DialogNames"];
|
|
9
|
-
const handler = ____init_dialogs["handler"];
|
|
10
|
-
const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
|
|
11
|
-
const CREATE_TABLE_ACTION = 'create-table-action';
|
|
12
|
-
const SMART_TABLE_TYPE = 'sap.ui.comp.smarttable.SmartTable';
|
|
13
|
-
const M_TABLE_TYPE = 'sap.m.Table';
|
|
14
|
-
// maintain order if action id
|
|
15
|
-
|
|
16
|
-
const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, 'sap.ui.table.TreeTable', 'sap.ui.table.Table'];
|
|
17
|
-
class AddTableActionQuickAction extends TableQuickActionDefinitionBase {
|
|
18
|
-
constructor(context) {
|
|
19
|
-
super(CREATE_TABLE_ACTION, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION', context);
|
|
20
|
-
}
|
|
21
|
-
async execute(path) {
|
|
22
|
-
const {
|
|
23
|
-
table,
|
|
24
|
-
iconTabBarFilterKey,
|
|
25
|
-
sectionInfo
|
|
26
|
-
} = this.tableMap[path];
|
|
27
|
-
if (!table) {
|
|
28
|
-
return [];
|
|
29
|
-
}
|
|
30
|
-
if (sectionInfo) {
|
|
31
|
-
const {
|
|
32
|
-
layout,
|
|
33
|
-
section,
|
|
34
|
-
subSection
|
|
35
|
-
} = sectionInfo;
|
|
36
|
-
layout?.setSelectedSection(section);
|
|
37
|
-
section.setSelectedSubSection(subSection);
|
|
38
|
-
this.selectOverlay(table);
|
|
39
|
-
} else {
|
|
40
|
-
getControlById(table.getId())?.getDomRef()?.scrollIntoView();
|
|
41
|
-
this.selectOverlay(table);
|
|
42
|
-
}
|
|
43
|
-
if (this.iconTabBar && iconTabBarFilterKey) {
|
|
44
|
-
this.iconTabBar.setSelectedKey(iconTabBarFilterKey);
|
|
45
|
-
}
|
|
46
|
-
let headerToolbar;
|
|
47
|
-
if (isA(SMART_TABLE_TYPE, table)) {
|
|
48
|
-
headerToolbar = table.getAggregation('items')[0].getAggregation('headerToolbar');
|
|
49
|
-
} else if (isA(M_TABLE_TYPE, table)) {
|
|
50
|
-
headerToolbar = table.getAggregation('headerToolbar');
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// open dialogBox to add, and content is selected ByDefault
|
|
54
|
-
if (headerToolbar) {
|
|
55
|
-
const overlay = OverlayRegistry.getOverlay(headerToolbar) || [];
|
|
56
|
-
await handler(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
|
|
57
|
-
aggregation: 'content',
|
|
58
|
-
title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION'
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
return [];
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
var __exports = {
|
|
65
|
-
__esModule: true
|
|
66
|
-
};
|
|
67
|
-
__exports.CREATE_TABLE_ACTION = CREATE_TABLE_ACTION;
|
|
68
|
-
__exports.AddTableActionQuickAction = AddTableActionQuickAction;
|
|
69
|
-
return __exports;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["../../../utils/core", "sap/ui/dt/OverlayRegistry", "../../init-dialogs", "./table-quick-action-base"], function (_____utils_core, OverlayRegistry, ____init_dialogs, ___table_quick_action_base) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const getControlById = _____utils_core["getControlById"];
|
|
7
|
+
const isA = _____utils_core["isA"];
|
|
8
|
+
const DialogNames = ____init_dialogs["DialogNames"];
|
|
9
|
+
const handler = ____init_dialogs["handler"];
|
|
10
|
+
const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
|
|
11
|
+
const CREATE_TABLE_ACTION = 'create-table-action';
|
|
12
|
+
const SMART_TABLE_TYPE = 'sap.ui.comp.smarttable.SmartTable';
|
|
13
|
+
const M_TABLE_TYPE = 'sap.m.Table';
|
|
14
|
+
// maintain order if action id
|
|
15
|
+
|
|
16
|
+
const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, 'sap.ui.table.TreeTable', 'sap.ui.table.Table'];
|
|
17
|
+
class AddTableActionQuickAction extends TableQuickActionDefinitionBase {
|
|
18
|
+
constructor(context) {
|
|
19
|
+
super(CREATE_TABLE_ACTION, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION', context);
|
|
20
|
+
}
|
|
21
|
+
async execute(path) {
|
|
22
|
+
const {
|
|
23
|
+
table,
|
|
24
|
+
iconTabBarFilterKey,
|
|
25
|
+
sectionInfo
|
|
26
|
+
} = this.tableMap[path];
|
|
27
|
+
if (!table) {
|
|
28
|
+
return [];
|
|
29
|
+
}
|
|
30
|
+
if (sectionInfo) {
|
|
31
|
+
const {
|
|
32
|
+
layout,
|
|
33
|
+
section,
|
|
34
|
+
subSection
|
|
35
|
+
} = sectionInfo;
|
|
36
|
+
layout?.setSelectedSection(section);
|
|
37
|
+
section.setSelectedSubSection(subSection);
|
|
38
|
+
this.selectOverlay(table);
|
|
39
|
+
} else {
|
|
40
|
+
getControlById(table.getId())?.getDomRef()?.scrollIntoView();
|
|
41
|
+
this.selectOverlay(table);
|
|
42
|
+
}
|
|
43
|
+
if (this.iconTabBar && iconTabBarFilterKey) {
|
|
44
|
+
this.iconTabBar.setSelectedKey(iconTabBarFilterKey);
|
|
45
|
+
}
|
|
46
|
+
let headerToolbar;
|
|
47
|
+
if (isA(SMART_TABLE_TYPE, table)) {
|
|
48
|
+
headerToolbar = table.getAggregation('items')[0].getAggregation('headerToolbar');
|
|
49
|
+
} else if (isA(M_TABLE_TYPE, table)) {
|
|
50
|
+
headerToolbar = table.getAggregation('headerToolbar');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// open dialogBox to add, and content is selected ByDefault
|
|
54
|
+
if (headerToolbar) {
|
|
55
|
+
const overlay = OverlayRegistry.getOverlay(headerToolbar) || [];
|
|
56
|
+
await handler(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
|
|
57
|
+
aggregation: 'content',
|
|
58
|
+
title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION'
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
return [];
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
var __exports = {
|
|
65
|
+
__esModule: true
|
|
66
|
+
};
|
|
67
|
+
__exports.CREATE_TABLE_ACTION = CREATE_TABLE_ACTION;
|
|
68
|
+
__exports.AddTableActionQuickAction = AddTableActionQuickAction;
|
|
69
|
+
return __exports;
|
|
70
70
|
});
|
|
71
71
|
//# sourceMappingURL=create-table-action.js.map
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["sap/ui/rta/command/CommandFactory", "../../../cpe/quick-actions/utils", "../../../utils/core", "../simple-quick-action-base"], function (CommandFactory, _____cpe_quick_actions_utils, _____utils_core, ___simple_quick_action_base) {
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
|
|
7
|
-
const getControlById = _____utils_core["getControlById"];
|
|
8
|
-
const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
|
|
9
|
-
const ENABLE_CLEAR_FILTER_BAR_TYPE = 'enable-clear-filter-bar';
|
|
10
|
-
const PROPERTY_NAME = 'showClearOnFB';
|
|
11
|
-
const CONTROL_TYPE = 'sap.ui.comp.smartfilterbar.SmartFilterBar';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Quick Action for toggling the visibility of "clear filter bar" button in List Report page.
|
|
15
|
-
*/
|
|
16
|
-
class ToggleClearFilterBarQuickAction extends SimpleQuickActionDefinitionBase {
|
|
17
|
-
constructor(context) {
|
|
18
|
-
super(ENABLE_CLEAR_FILTER_BAR_TYPE, [], '', context);
|
|
19
|
-
}
|
|
20
|
-
isClearButtonEnabled = false;
|
|
21
|
-
initialize() {
|
|
22
|
-
const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
|
|
23
|
-
for (const control of controls) {
|
|
24
|
-
const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
|
|
25
|
-
const modifiedControl = getControlById(control.controlId);
|
|
26
|
-
if (isActionApplicable && modifiedControl) {
|
|
27
|
-
this.isClearButtonEnabled = modifiedControl.getShowClearOnFB();
|
|
28
|
-
this.control = modifiedControl;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
get textKey() {
|
|
33
|
-
return this.isClearButtonEnabled ? 'V2_QUICK_ACTION_LR_DISABLE_CLEAR_FILTER_BAR' : 'V2_QUICK_ACTION_LR_ENABLE_CLEAR_FILTER_BAR';
|
|
34
|
-
}
|
|
35
|
-
async execute() {
|
|
36
|
-
if (this.control) {
|
|
37
|
-
const {
|
|
38
|
-
flexSettings
|
|
39
|
-
} = this.context;
|
|
40
|
-
const modifiedValue = {
|
|
41
|
-
generator: flexSettings.generator,
|
|
42
|
-
propertyName: PROPERTY_NAME,
|
|
43
|
-
newValue: !this.isClearButtonEnabled
|
|
44
|
-
};
|
|
45
|
-
const command = await CommandFactory.getCommandFor(this.control, 'Property', modifiedValue, null, flexSettings);
|
|
46
|
-
this.isClearButtonEnabled = !this.isClearButtonEnabled;
|
|
47
|
-
return [command];
|
|
48
|
-
}
|
|
49
|
-
return [];
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
var __exports = {
|
|
53
|
-
__esModule: true
|
|
54
|
-
};
|
|
55
|
-
__exports.ENABLE_CLEAR_FILTER_BAR_TYPE = ENABLE_CLEAR_FILTER_BAR_TYPE;
|
|
56
|
-
__exports.ToggleClearFilterBarQuickAction = ToggleClearFilterBarQuickAction;
|
|
57
|
-
return __exports;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/ui/rta/command/CommandFactory", "../../../cpe/quick-actions/utils", "../../../utils/core", "../simple-quick-action-base"], function (CommandFactory, _____cpe_quick_actions_utils, _____utils_core, ___simple_quick_action_base) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
|
|
7
|
+
const getControlById = _____utils_core["getControlById"];
|
|
8
|
+
const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
|
|
9
|
+
const ENABLE_CLEAR_FILTER_BAR_TYPE = 'enable-clear-filter-bar';
|
|
10
|
+
const PROPERTY_NAME = 'showClearOnFB';
|
|
11
|
+
const CONTROL_TYPE = 'sap.ui.comp.smartfilterbar.SmartFilterBar';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Quick Action for toggling the visibility of "clear filter bar" button in List Report page.
|
|
15
|
+
*/
|
|
16
|
+
class ToggleClearFilterBarQuickAction extends SimpleQuickActionDefinitionBase {
|
|
17
|
+
constructor(context) {
|
|
18
|
+
super(ENABLE_CLEAR_FILTER_BAR_TYPE, [], '', context);
|
|
19
|
+
}
|
|
20
|
+
isClearButtonEnabled = false;
|
|
21
|
+
initialize() {
|
|
22
|
+
const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
|
|
23
|
+
for (const control of controls) {
|
|
24
|
+
const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
|
|
25
|
+
const modifiedControl = getControlById(control.controlId);
|
|
26
|
+
if (isActionApplicable && modifiedControl) {
|
|
27
|
+
this.isClearButtonEnabled = modifiedControl.getShowClearOnFB();
|
|
28
|
+
this.control = modifiedControl;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
get textKey() {
|
|
33
|
+
return this.isClearButtonEnabled ? 'V2_QUICK_ACTION_LR_DISABLE_CLEAR_FILTER_BAR' : 'V2_QUICK_ACTION_LR_ENABLE_CLEAR_FILTER_BAR';
|
|
34
|
+
}
|
|
35
|
+
async execute() {
|
|
36
|
+
if (this.control) {
|
|
37
|
+
const {
|
|
38
|
+
flexSettings
|
|
39
|
+
} = this.context;
|
|
40
|
+
const modifiedValue = {
|
|
41
|
+
generator: flexSettings.generator,
|
|
42
|
+
propertyName: PROPERTY_NAME,
|
|
43
|
+
newValue: !this.isClearButtonEnabled
|
|
44
|
+
};
|
|
45
|
+
const command = await CommandFactory.getCommandFor(this.control, 'Property', modifiedValue, null, flexSettings);
|
|
46
|
+
this.isClearButtonEnabled = !this.isClearButtonEnabled;
|
|
47
|
+
return [command];
|
|
48
|
+
}
|
|
49
|
+
return [];
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
var __exports = {
|
|
53
|
+
__esModule: true
|
|
54
|
+
};
|
|
55
|
+
__exports.ENABLE_CLEAR_FILTER_BAR_TYPE = ENABLE_CLEAR_FILTER_BAR_TYPE;
|
|
56
|
+
__exports.ToggleClearFilterBarQuickAction = ToggleClearFilterBarQuickAction;
|
|
57
|
+
return __exports;
|
|
58
58
|
});
|
|
59
59
|
//# sourceMappingURL=lr-toggle-clear-filter-bar.js.map
|
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["sap/ui/core/mvc/XMLView", "sap/ui/core/ComponentContainer", "../../../cpe/quick-actions/registry", "../common/add-controller-to-page", "./lr-toggle-clear-filter-bar", "./change-table-columns", "../common/op-add-header-field", "../common/op-add-custom-section", "../fe-v2/create-table-action", "../fe-v2/create-page-action"], function (XMLView, ComponentContainer, _____cpe_quick_actions_registry, ___common_add_controller_to_page, ___lr_toggle_clear_filter_bar, ___change_table_columns, ___common_op_add_header_field, ___common_op_add_custom_section, ___fe_v2_create_table_action, ___fe_v2_create_page_action) {
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
const QuickActionDefinitionRegistry = _____cpe_quick_actions_registry["QuickActionDefinitionRegistry"];
|
|
7
|
-
const AddControllerToPageQuickAction = ___common_add_controller_to_page["AddControllerToPageQuickAction"];
|
|
8
|
-
const ToggleClearFilterBarQuickAction = ___lr_toggle_clear_filter_bar["ToggleClearFilterBarQuickAction"];
|
|
9
|
-
const ChangeTableColumnsQuickAction = ___change_table_columns["ChangeTableColumnsQuickAction"];
|
|
10
|
-
const AddHeaderFieldQuickAction = ___common_op_add_header_field["AddHeaderFieldQuickAction"];
|
|
11
|
-
const AddCustomSectionQuickAction = ___common_op_add_custom_section["AddCustomSectionQuickAction"];
|
|
12
|
-
const AddTableActionQuickAction = ___fe_v2_create_table_action["AddTableActionQuickAction"];
|
|
13
|
-
const AddPageActionQuickAction = ___fe_v2_create_page_action["AddPageActionQuickAction"];
|
|
14
|
-
const OBJECT_PAGE_TYPE = 'sap.suite.ui.generic.template.ObjectPage.view.Details';
|
|
15
|
-
const LIST_REPORT_TYPE = 'sap.suite.ui.generic.template.ListReport.view.ListReport';
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Quick Action provider for SAP Fiori Elements V2 applications.
|
|
19
|
-
*/
|
|
20
|
-
class FEV2QuickActionRegistry extends QuickActionDefinitionRegistry {
|
|
21
|
-
PAGE_NAME_MAP = {
|
|
22
|
-
[LIST_REPORT_TYPE]: 'listReport',
|
|
23
|
-
[OBJECT_PAGE_TYPE]: 'objectPage'
|
|
24
|
-
};
|
|
25
|
-
getDefinitions(context) {
|
|
26
|
-
const activePages = this.getActivePageContent(context.controlIndex);
|
|
27
|
-
const definitionGroups = [];
|
|
28
|
-
for (let index = 0; index < activePages.length; index++) {
|
|
29
|
-
const {
|
|
30
|
-
name,
|
|
31
|
-
view
|
|
32
|
-
} = activePages[index];
|
|
33
|
-
if (name === 'listReport') {
|
|
34
|
-
definitionGroups.push({
|
|
35
|
-
title: 'LIST REPORT',
|
|
36
|
-
definitions: [ToggleClearFilterBarQuickAction, AddControllerToPageQuickAction, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddPageActionQuickAction],
|
|
37
|
-
view,
|
|
38
|
-
key: name + index
|
|
39
|
-
});
|
|
40
|
-
} else if (name === 'objectPage') {
|
|
41
|
-
definitionGroups.push({
|
|
42
|
-
title: 'OBJECT PAGE',
|
|
43
|
-
definitions: [AddControllerToPageQuickAction, ChangeTableColumnsQuickAction, AddHeaderFieldQuickAction, AddCustomSectionQuickAction, AddTableActionQuickAction, AddPageActionQuickAction],
|
|
44
|
-
view,
|
|
45
|
-
key: name + index
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return definitionGroups;
|
|
50
|
-
}
|
|
51
|
-
getComponentContainerFromPage(page) {
|
|
52
|
-
// in ui5 version 1.71 there is no XMLView wrapper around ComponentContainer
|
|
53
|
-
const componentContainer = page instanceof XMLView ? page.getContent()[0] : page;
|
|
54
|
-
if (componentContainer instanceof ComponentContainer) {
|
|
55
|
-
return componentContainer;
|
|
56
|
-
}
|
|
57
|
-
return undefined;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
return FEV2QuickActionRegistry;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/ui/core/mvc/XMLView", "sap/ui/core/ComponentContainer", "../../../cpe/quick-actions/registry", "../common/add-controller-to-page", "./lr-toggle-clear-filter-bar", "./change-table-columns", "../common/op-add-header-field", "../common/op-add-custom-section", "../fe-v2/create-table-action", "../fe-v2/create-page-action"], function (XMLView, ComponentContainer, _____cpe_quick_actions_registry, ___common_add_controller_to_page, ___lr_toggle_clear_filter_bar, ___change_table_columns, ___common_op_add_header_field, ___common_op_add_custom_section, ___fe_v2_create_table_action, ___fe_v2_create_page_action) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const QuickActionDefinitionRegistry = _____cpe_quick_actions_registry["QuickActionDefinitionRegistry"];
|
|
7
|
+
const AddControllerToPageQuickAction = ___common_add_controller_to_page["AddControllerToPageQuickAction"];
|
|
8
|
+
const ToggleClearFilterBarQuickAction = ___lr_toggle_clear_filter_bar["ToggleClearFilterBarQuickAction"];
|
|
9
|
+
const ChangeTableColumnsQuickAction = ___change_table_columns["ChangeTableColumnsQuickAction"];
|
|
10
|
+
const AddHeaderFieldQuickAction = ___common_op_add_header_field["AddHeaderFieldQuickAction"];
|
|
11
|
+
const AddCustomSectionQuickAction = ___common_op_add_custom_section["AddCustomSectionQuickAction"];
|
|
12
|
+
const AddTableActionQuickAction = ___fe_v2_create_table_action["AddTableActionQuickAction"];
|
|
13
|
+
const AddPageActionQuickAction = ___fe_v2_create_page_action["AddPageActionQuickAction"];
|
|
14
|
+
const OBJECT_PAGE_TYPE = 'sap.suite.ui.generic.template.ObjectPage.view.Details';
|
|
15
|
+
const LIST_REPORT_TYPE = 'sap.suite.ui.generic.template.ListReport.view.ListReport';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Quick Action provider for SAP Fiori Elements V2 applications.
|
|
19
|
+
*/
|
|
20
|
+
class FEV2QuickActionRegistry extends QuickActionDefinitionRegistry {
|
|
21
|
+
PAGE_NAME_MAP = {
|
|
22
|
+
[LIST_REPORT_TYPE]: 'listReport',
|
|
23
|
+
[OBJECT_PAGE_TYPE]: 'objectPage'
|
|
24
|
+
};
|
|
25
|
+
getDefinitions(context) {
|
|
26
|
+
const activePages = this.getActivePageContent(context.controlIndex);
|
|
27
|
+
const definitionGroups = [];
|
|
28
|
+
for (let index = 0; index < activePages.length; index++) {
|
|
29
|
+
const {
|
|
30
|
+
name,
|
|
31
|
+
view
|
|
32
|
+
} = activePages[index];
|
|
33
|
+
if (name === 'listReport') {
|
|
34
|
+
definitionGroups.push({
|
|
35
|
+
title: 'LIST REPORT',
|
|
36
|
+
definitions: [ToggleClearFilterBarQuickAction, AddControllerToPageQuickAction, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddPageActionQuickAction],
|
|
37
|
+
view,
|
|
38
|
+
key: name + index
|
|
39
|
+
});
|
|
40
|
+
} else if (name === 'objectPage') {
|
|
41
|
+
definitionGroups.push({
|
|
42
|
+
title: 'OBJECT PAGE',
|
|
43
|
+
definitions: [AddControllerToPageQuickAction, ChangeTableColumnsQuickAction, AddHeaderFieldQuickAction, AddCustomSectionQuickAction, AddTableActionQuickAction, AddPageActionQuickAction],
|
|
44
|
+
view,
|
|
45
|
+
key: name + index
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return definitionGroups;
|
|
50
|
+
}
|
|
51
|
+
getComponentContainerFromPage(page) {
|
|
52
|
+
// in ui5 version 1.71 there is no XMLView wrapper around ComponentContainer
|
|
53
|
+
const componentContainer = page instanceof XMLView ? page.getContent()[0] : page;
|
|
54
|
+
if (componentContainer instanceof ComponentContainer) {
|
|
55
|
+
return componentContainer;
|
|
56
|
+
}
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return FEV2QuickActionRegistry;
|
|
61
61
|
});
|
|
62
62
|
//# sourceMappingURL=registry.js.map
|
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["sap/ui/rta/command/CommandFactory", "../../../cpe/quick-actions/utils", "../../../utils/core", "./utils", "../simple-quick-action-base"], function (CommandFactory, _____cpe_quick_actions_utils, _____utils_core, ___utils, ___simple_quick_action_base) {
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
|
|
7
|
-
const getControlById = _____utils_core["getControlById"];
|
|
8
|
-
const getAppComponent = ___utils["getAppComponent"];
|
|
9
|
-
const getPageName = ___utils["getPageName"];
|
|
10
|
-
const getReference = ___utils["getReference"];
|
|
11
|
-
const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
|
|
12
|
-
const ENABLE_CLEAR_FILTER_BAR_TYPE = 'enable-clear-filter-bar';
|
|
13
|
-
const PROPERTY_PATH = 'controlConfiguration/@com.sap.vocabularies.UI.v1.SelectionFields/showClearButton';
|
|
14
|
-
const CONTROL_TYPE = 'sap.fe.macros.controls.FilterBar';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Quick Action for toggling the visibility of "clear filter bar" button in List Report page.
|
|
18
|
-
*/
|
|
19
|
-
class ToggleClearFilterBarQuickAction extends SimpleQuickActionDefinitionBase {
|
|
20
|
-
constructor(context) {
|
|
21
|
-
super(ENABLE_CLEAR_FILTER_BAR_TYPE, [], '', context);
|
|
22
|
-
}
|
|
23
|
-
forceRefreshAfterExecution = true;
|
|
24
|
-
isClearButtonEnabled = false;
|
|
25
|
-
initialize() {
|
|
26
|
-
const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
|
|
27
|
-
for (const control of controls) {
|
|
28
|
-
const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
|
|
29
|
-
const filterBar = getControlById(control.controlId);
|
|
30
|
-
if (isActionApplicable && filterBar) {
|
|
31
|
-
this.control = filterBar;
|
|
32
|
-
this.isClearButtonEnabled = filterBar.getShowClearButton();
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
get textKey() {
|
|
37
|
-
return this.isClearButtonEnabled ? 'V4_QUICK_ACTION_LR_DISABLE_CLEAR_FILTER_BAR' : 'V4_QUICK_ACTION_LR_ENABLE_CLEAR_FILTER_BAR';
|
|
38
|
-
}
|
|
39
|
-
async execute() {
|
|
40
|
-
const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
|
|
41
|
-
const control = controls[0];
|
|
42
|
-
if (control) {
|
|
43
|
-
const modifiedControl = getControlById(control.controlId);
|
|
44
|
-
if (!modifiedControl) {
|
|
45
|
-
return [];
|
|
46
|
-
}
|
|
47
|
-
const {
|
|
48
|
-
flexSettings
|
|
49
|
-
} = this.context;
|
|
50
|
-
const parent = modifiedControl.getParent();
|
|
51
|
-
if (!parent) {
|
|
52
|
-
return [];
|
|
53
|
-
}
|
|
54
|
-
const modifiedValue = {
|
|
55
|
-
reference: getReference(modifiedControl),
|
|
56
|
-
appComponent: getAppComponent(modifiedControl),
|
|
57
|
-
changeType: 'appdescr_fe_changePageConfiguration',
|
|
58
|
-
parameters: {
|
|
59
|
-
page: getPageName(parent),
|
|
60
|
-
entityPropertyChange: {
|
|
61
|
-
propertyPath: PROPERTY_PATH,
|
|
62
|
-
propertyValue: !this.isClearButtonEnabled,
|
|
63
|
-
operation: 'UPSERT'
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
const command = await CommandFactory.getCommandFor(modifiedControl, 'appDescriptor', modifiedValue, null, flexSettings);
|
|
68
|
-
this.isClearButtonEnabled = !this.isClearButtonEnabled;
|
|
69
|
-
return [command];
|
|
70
|
-
}
|
|
71
|
-
return [];
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
var __exports = {
|
|
75
|
-
__esModule: true
|
|
76
|
-
};
|
|
77
|
-
__exports.ENABLE_CLEAR_FILTER_BAR_TYPE = ENABLE_CLEAR_FILTER_BAR_TYPE;
|
|
78
|
-
__exports.ToggleClearFilterBarQuickAction = ToggleClearFilterBarQuickAction;
|
|
79
|
-
return __exports;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/ui/rta/command/CommandFactory", "../../../cpe/quick-actions/utils", "../../../utils/core", "./utils", "../simple-quick-action-base"], function (CommandFactory, _____cpe_quick_actions_utils, _____utils_core, ___utils, ___simple_quick_action_base) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
|
|
7
|
+
const getControlById = _____utils_core["getControlById"];
|
|
8
|
+
const getAppComponent = ___utils["getAppComponent"];
|
|
9
|
+
const getPageName = ___utils["getPageName"];
|
|
10
|
+
const getReference = ___utils["getReference"];
|
|
11
|
+
const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
|
|
12
|
+
const ENABLE_CLEAR_FILTER_BAR_TYPE = 'enable-clear-filter-bar';
|
|
13
|
+
const PROPERTY_PATH = 'controlConfiguration/@com.sap.vocabularies.UI.v1.SelectionFields/showClearButton';
|
|
14
|
+
const CONTROL_TYPE = 'sap.fe.macros.controls.FilterBar';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Quick Action for toggling the visibility of "clear filter bar" button in List Report page.
|
|
18
|
+
*/
|
|
19
|
+
class ToggleClearFilterBarQuickAction extends SimpleQuickActionDefinitionBase {
|
|
20
|
+
constructor(context) {
|
|
21
|
+
super(ENABLE_CLEAR_FILTER_BAR_TYPE, [], '', context);
|
|
22
|
+
}
|
|
23
|
+
forceRefreshAfterExecution = true;
|
|
24
|
+
isClearButtonEnabled = false;
|
|
25
|
+
initialize() {
|
|
26
|
+
const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
|
|
27
|
+
for (const control of controls) {
|
|
28
|
+
const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
|
|
29
|
+
const filterBar = getControlById(control.controlId);
|
|
30
|
+
if (isActionApplicable && filterBar) {
|
|
31
|
+
this.control = filterBar;
|
|
32
|
+
this.isClearButtonEnabled = filterBar.getShowClearButton();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
get textKey() {
|
|
37
|
+
return this.isClearButtonEnabled ? 'V4_QUICK_ACTION_LR_DISABLE_CLEAR_FILTER_BAR' : 'V4_QUICK_ACTION_LR_ENABLE_CLEAR_FILTER_BAR';
|
|
38
|
+
}
|
|
39
|
+
async execute() {
|
|
40
|
+
const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
|
|
41
|
+
const control = controls[0];
|
|
42
|
+
if (control) {
|
|
43
|
+
const modifiedControl = getControlById(control.controlId);
|
|
44
|
+
if (!modifiedControl) {
|
|
45
|
+
return [];
|
|
46
|
+
}
|
|
47
|
+
const {
|
|
48
|
+
flexSettings
|
|
49
|
+
} = this.context;
|
|
50
|
+
const parent = modifiedControl.getParent();
|
|
51
|
+
if (!parent) {
|
|
52
|
+
return [];
|
|
53
|
+
}
|
|
54
|
+
const modifiedValue = {
|
|
55
|
+
reference: getReference(modifiedControl),
|
|
56
|
+
appComponent: getAppComponent(modifiedControl),
|
|
57
|
+
changeType: 'appdescr_fe_changePageConfiguration',
|
|
58
|
+
parameters: {
|
|
59
|
+
page: getPageName(parent),
|
|
60
|
+
entityPropertyChange: {
|
|
61
|
+
propertyPath: PROPERTY_PATH,
|
|
62
|
+
propertyValue: !this.isClearButtonEnabled,
|
|
63
|
+
operation: 'UPSERT'
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
const command = await CommandFactory.getCommandFor(modifiedControl, 'appDescriptor', modifiedValue, null, flexSettings);
|
|
68
|
+
this.isClearButtonEnabled = !this.isClearButtonEnabled;
|
|
69
|
+
return [command];
|
|
70
|
+
}
|
|
71
|
+
return [];
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
var __exports = {
|
|
75
|
+
__esModule: true
|
|
76
|
+
};
|
|
77
|
+
__exports.ENABLE_CLEAR_FILTER_BAR_TYPE = ENABLE_CLEAR_FILTER_BAR_TYPE;
|
|
78
|
+
__exports.ToggleClearFilterBarQuickAction = ToggleClearFilterBarQuickAction;
|
|
79
|
+
return __exports;
|
|
80
80
|
});
|
|
81
81
|
//# sourceMappingURL=lr-toggle-clear-filter-bar.js.map
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["../../../cpe/quick-actions/registry", "../common/add-controller-to-page", "./lr-toggle-clear-filter-bar", "./change-table-columns", "../common/op-add-header-field", "../common/op-add-custom-section"], function (_____cpe_quick_actions_registry, ___common_add_controller_to_page, ___lr_toggle_clear_filter_bar, ___change_table_columns, ___common_op_add_header_field, ___common_op_add_custom_section) {
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
const QuickActionDefinitionRegistry = _____cpe_quick_actions_registry["QuickActionDefinitionRegistry"];
|
|
7
|
-
const AddControllerToPageQuickAction = ___common_add_controller_to_page["AddControllerToPageQuickAction"];
|
|
8
|
-
const ToggleClearFilterBarQuickAction = ___lr_toggle_clear_filter_bar["ToggleClearFilterBarQuickAction"];
|
|
9
|
-
const ChangeTableColumnsQuickAction = ___change_table_columns["ChangeTableColumnsQuickAction"];
|
|
10
|
-
const AddHeaderFieldQuickAction = ___common_op_add_header_field["AddHeaderFieldQuickAction"];
|
|
11
|
-
const AddCustomSectionQuickAction = ___common_op_add_custom_section["AddCustomSectionQuickAction"];
|
|
12
|
-
const LIST_REPORT_TYPE = 'sap.fe.templates.ListReport.ListReport';
|
|
13
|
-
const OBJECT_PAGE_TYPE = 'sap.fe.templates.ObjectPage.ObjectPage';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Quick Action provider for SAP Fiori Elements V4 applications.
|
|
17
|
-
*/
|
|
18
|
-
class FEV4QuickActionRegistry extends QuickActionDefinitionRegistry {
|
|
19
|
-
PAGE_NAME_MAP = {
|
|
20
|
-
[LIST_REPORT_TYPE]: 'listReport',
|
|
21
|
-
[OBJECT_PAGE_TYPE]: 'objectPage'
|
|
22
|
-
};
|
|
23
|
-
getDefinitions(context) {
|
|
24
|
-
const activePages = this.getActivePageContent(context.controlIndex);
|
|
25
|
-
const definitionGroups = [];
|
|
26
|
-
for (let index = 0; index < activePages.length; index++) {
|
|
27
|
-
const {
|
|
28
|
-
name,
|
|
29
|
-
view
|
|
30
|
-
} = activePages[index];
|
|
31
|
-
if (name === 'listReport') {
|
|
32
|
-
definitionGroups.push({
|
|
33
|
-
title: 'LIST REPORT',
|
|
34
|
-
definitions: [ToggleClearFilterBarQuickAction, AddControllerToPageQuickAction, ChangeTableColumnsQuickAction],
|
|
35
|
-
view,
|
|
36
|
-
key: name + index
|
|
37
|
-
});
|
|
38
|
-
} else if (name === 'objectPage') {
|
|
39
|
-
definitionGroups.push({
|
|
40
|
-
title: 'OBJECT PAGE',
|
|
41
|
-
definitions: [AddControllerToPageQuickAction, ChangeTableColumnsQuickAction, AddHeaderFieldQuickAction, AddCustomSectionQuickAction],
|
|
42
|
-
view,
|
|
43
|
-
key: name + index
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return definitionGroups;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return FEV4QuickActionRegistry;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["../../../cpe/quick-actions/registry", "../common/add-controller-to-page", "./lr-toggle-clear-filter-bar", "./change-table-columns", "../common/op-add-header-field", "../common/op-add-custom-section"], function (_____cpe_quick_actions_registry, ___common_add_controller_to_page, ___lr_toggle_clear_filter_bar, ___change_table_columns, ___common_op_add_header_field, ___common_op_add_custom_section) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const QuickActionDefinitionRegistry = _____cpe_quick_actions_registry["QuickActionDefinitionRegistry"];
|
|
7
|
+
const AddControllerToPageQuickAction = ___common_add_controller_to_page["AddControllerToPageQuickAction"];
|
|
8
|
+
const ToggleClearFilterBarQuickAction = ___lr_toggle_clear_filter_bar["ToggleClearFilterBarQuickAction"];
|
|
9
|
+
const ChangeTableColumnsQuickAction = ___change_table_columns["ChangeTableColumnsQuickAction"];
|
|
10
|
+
const AddHeaderFieldQuickAction = ___common_op_add_header_field["AddHeaderFieldQuickAction"];
|
|
11
|
+
const AddCustomSectionQuickAction = ___common_op_add_custom_section["AddCustomSectionQuickAction"];
|
|
12
|
+
const LIST_REPORT_TYPE = 'sap.fe.templates.ListReport.ListReport';
|
|
13
|
+
const OBJECT_PAGE_TYPE = 'sap.fe.templates.ObjectPage.ObjectPage';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Quick Action provider for SAP Fiori Elements V4 applications.
|
|
17
|
+
*/
|
|
18
|
+
class FEV4QuickActionRegistry extends QuickActionDefinitionRegistry {
|
|
19
|
+
PAGE_NAME_MAP = {
|
|
20
|
+
[LIST_REPORT_TYPE]: 'listReport',
|
|
21
|
+
[OBJECT_PAGE_TYPE]: 'objectPage'
|
|
22
|
+
};
|
|
23
|
+
getDefinitions(context) {
|
|
24
|
+
const activePages = this.getActivePageContent(context.controlIndex);
|
|
25
|
+
const definitionGroups = [];
|
|
26
|
+
for (let index = 0; index < activePages.length; index++) {
|
|
27
|
+
const {
|
|
28
|
+
name,
|
|
29
|
+
view
|
|
30
|
+
} = activePages[index];
|
|
31
|
+
if (name === 'listReport') {
|
|
32
|
+
definitionGroups.push({
|
|
33
|
+
title: 'LIST REPORT',
|
|
34
|
+
definitions: [ToggleClearFilterBarQuickAction, AddControllerToPageQuickAction, ChangeTableColumnsQuickAction],
|
|
35
|
+
view,
|
|
36
|
+
key: name + index
|
|
37
|
+
});
|
|
38
|
+
} else if (name === 'objectPage') {
|
|
39
|
+
definitionGroups.push({
|
|
40
|
+
title: 'OBJECT PAGE',
|
|
41
|
+
definitions: [AddControllerToPageQuickAction, ChangeTableColumnsQuickAction, AddHeaderFieldQuickAction, AddCustomSectionQuickAction],
|
|
42
|
+
view,
|
|
43
|
+
key: name + index
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return definitionGroups;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return FEV4QuickActionRegistry;
|
|
51
51
|
});
|
|
52
52
|
//# sourceMappingURL=registry.js.map
|