@sap-ux/preview-middleware 0.16.155 → 0.16.157
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/api-handler.js +142 -142
- package/dist/client/adp/command-executor.js +75 -75
- package/dist/client/adp/control-utils.js +44 -44
- package/dist/client/adp/controllers/AddFragment.controller.js +5 -6
- package/dist/client/adp/controllers/AddFragment.controller.ts +1 -2
- package/dist/client/adp/controllers/AddTableColumnFragments.controller.js +0 -1
- package/dist/client/adp/controllers/AddTableColumnFragments.controller.ts +0 -1
- package/dist/client/adp/controllers/BaseDialog.controller.js +187 -187
- package/dist/client/adp/controllers/BaseDialog.controller.ts +0 -4
- package/dist/client/adp/controllers/ControllerExtension.controller.js +213 -213
- package/dist/client/adp/controllers/ExtensionPoint.controller.js +138 -138
- package/dist/client/adp/dialog-factory.js +115 -0
- package/dist/client/adp/dialog-factory.ts +134 -0
- package/dist/client/adp/extension-point.js +6 -6
- package/dist/client/adp/extension-point.ts +2 -2
- package/dist/client/adp/init-dialogs.js +100 -157
- package/dist/client/adp/init-dialogs.ts +5 -77
- package/dist/client/adp/quick-actions/common/add-controller-to-page.js +55 -54
- package/dist/client/adp/quick-actions/common/add-controller-to-page.ts +5 -3
- package/dist/client/adp/quick-actions/common/create-page-action.js +50 -49
- package/dist/client/adp/quick-actions/common/create-page-action.ts +7 -4
- package/dist/client/adp/quick-actions/common/op-add-custom-section.js +36 -35
- package/dist/client/adp/quick-actions/common/op-add-custom-section.ts +6 -3
- package/dist/client/adp/quick-actions/common/op-add-header-field.js +48 -47
- package/dist/client/adp/quick-actions/common/op-add-header-field.ts +7 -4
- package/dist/client/adp/quick-actions/common/utils.js +20 -0
- package/dist/client/adp/quick-actions/common/utils.ts +7 -0
- package/dist/client/adp/quick-actions/control-types.js +23 -0
- package/dist/client/adp/quick-actions/control-types.ts +6 -0
- package/dist/client/adp/quick-actions/dialog-enablement-validator.js +26 -0
- package/dist/client/adp/quick-actions/dialog-enablement-validator.ts +18 -0
- package/dist/client/adp/quick-actions/enablement-validator.js +6 -0
- package/dist/client/adp/quick-actions/enablement-validator.ts +18 -0
- package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +101 -100
- package/dist/client/adp/quick-actions/fe-v2/change-table-columns.ts +11 -3
- package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +70 -69
- package/dist/client/adp/quick-actions/fe-v2/create-table-action.ts +6 -3
- package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +96 -95
- package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.ts +27 -21
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +60 -56
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.ts +8 -3
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +77 -67
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.ts +37 -16
- package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +57 -57
- package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +95 -0
- package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.ts +99 -0
- package/dist/client/adp/quick-actions/fe-v2/registry.js +72 -71
- package/dist/client/adp/quick-actions/fe-v2/registry.ts +3 -1
- package/dist/client/adp/quick-actions/fe-v2/utils.js +95 -86
- package/dist/client/adp/quick-actions/fe-v2/utils.ts +14 -4
- package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +49 -47
- package/dist/client/adp/quick-actions/fe-v4/change-table-columns.ts +5 -1
- package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +47 -45
- package/dist/client/adp/quick-actions/fe-v4/create-table-action.ts +17 -7
- package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +46 -45
- package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.ts +11 -12
- package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +55 -55
- package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +82 -82
- package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.ts +4 -4
- package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +52 -52
- package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +91 -0
- package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.ts +85 -0
- package/dist/client/adp/quick-actions/fe-v4/registry.js +56 -55
- package/dist/client/adp/quick-actions/fe-v4/registry.ts +3 -1
- package/dist/client/adp/quick-actions/fe-v4/table-quick-action-base.js +11 -17
- package/dist/client/adp/quick-actions/fe-v4/table-quick-action-base.ts +17 -18
- package/dist/client/adp/quick-actions/fe-v4/utils.js +47 -47
- package/dist/client/adp/quick-actions/load.js +44 -44
- package/dist/client/adp/quick-actions/quick-action-base.js +55 -0
- package/dist/client/adp/quick-actions/quick-action-base.ts +55 -0
- package/dist/client/adp/quick-actions/simple-quick-action-base.js +8 -13
- package/dist/client/adp/quick-actions/simple-quick-action-base.ts +10 -18
- package/dist/client/adp/quick-actions/table-quick-action-base.js +24 -29
- package/dist/client/adp/quick-actions/table-quick-action-base.ts +39 -28
- package/dist/client/adp/utils.js +160 -160
- package/dist/client/cpe/changes/index.js +10 -10
- package/dist/client/cpe/changes/service.js +30 -0
- package/dist/client/cpe/changes/service.ts +46 -0
- package/dist/client/cpe/changes/validator.js +34 -34
- package/dist/client/cpe/documentation.js +164 -164
- package/dist/client/cpe/feature-service.js +36 -36
- package/dist/client/cpe/logger.js +30 -30
- package/dist/client/cpe/outline/editable.js +37 -37
- package/dist/client/cpe/outline/nodes.js +217 -217
- package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
- package/dist/client/cpe/quick-actions/quick-action-definition.ts +5 -1
- package/dist/client/cpe/quick-actions/quick-action-service.js +10 -4
- package/dist/client/cpe/quick-actions/quick-action-service.ts +9 -3
- 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 +138 -138
- package/dist/client/flp/WorkspaceConnector.js +86 -86
- package/dist/client/flp/common.js +28 -28
- package/dist/client/flp/enableFakeConnector.js +83 -83
- 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/messagebundle.properties +5 -3
- 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/fe-v4.js +118 -114
- package/dist/client/utils/fe-v4.ts +19 -11
- package/dist/client/utils/version.js +102 -102
- package/package.json +4 -4
|
@@ -6,6 +6,7 @@ import ManagedObject from 'sap/ui/base/ManagedObject';
|
|
|
6
6
|
import { QuickActionContext, NestedQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
|
|
7
7
|
import { getControlById, isA } from '../../../utils/core';
|
|
8
8
|
import { TableQuickActionDefinitionBase } from '../table-quick-action-base';
|
|
9
|
+
import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator';
|
|
9
10
|
|
|
10
11
|
export const CHANGE_TABLE_COLUMNS = 'change-table-columns';
|
|
11
12
|
const SMART_TABLE_TYPE = 'sap.ui.comp.smarttable.SmartTable';
|
|
@@ -18,9 +19,16 @@ export class ChangeTableColumnsQuickAction
|
|
|
18
19
|
implements NestedQuickActionDefinition
|
|
19
20
|
{
|
|
20
21
|
constructor(context: QuickActionContext) {
|
|
21
|
-
super(
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
super(
|
|
23
|
+
CHANGE_TABLE_COLUMNS,
|
|
24
|
+
CONTROL_TYPES,
|
|
25
|
+
'V2_QUICK_ACTION_CHANGE_TABLE_COLUMNS',
|
|
26
|
+
context,
|
|
27
|
+
{
|
|
28
|
+
includeServiceAction: true
|
|
29
|
+
},
|
|
30
|
+
[DIALOG_ENABLEMENT_VALIDATOR]
|
|
31
|
+
);
|
|
24
32
|
}
|
|
25
33
|
async execute(path: string): Promise<FlexCommand[]> {
|
|
26
34
|
const { table, iconTabBarFilterKey, changeColumnActionId, sectionInfo } = this.tableMap[path];
|
|
@@ -1,71 +1,72 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../../utils/core", "../../
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
const getControlById = _____utils_core["getControlById"];
|
|
7
|
-
const isA = _____utils_core["isA"];
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
section
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
__exports.
|
|
69
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../../utils/core", "../../dialog-factory", "../table-quick-action-base", "../dialog-enablement-validator"], function (OverlayRegistry, _____utils_core, ____dialog_factory, ___table_quick_action_base, ___dialog_enablement_validator) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const getControlById = _____utils_core["getControlById"];
|
|
7
|
+
const isA = _____utils_core["isA"];
|
|
8
|
+
const DialogFactory = ____dialog_factory["DialogFactory"];
|
|
9
|
+
const DialogNames = ____dialog_factory["DialogNames"];
|
|
10
|
+
const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
|
|
11
|
+
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
|
|
12
|
+
const CREATE_TABLE_ACTION = 'create-table-action';
|
|
13
|
+
const SMART_TABLE_TYPE = 'sap.ui.comp.smarttable.SmartTable';
|
|
14
|
+
const M_TABLE_TYPE = 'sap.m.Table';
|
|
15
|
+
// maintain order if action id
|
|
16
|
+
|
|
17
|
+
const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, 'sap.ui.table.TreeTable', 'sap.ui.table.Table'];
|
|
18
|
+
class AddTableActionQuickAction extends TableQuickActionDefinitionBase {
|
|
19
|
+
constructor(context) {
|
|
20
|
+
super(CREATE_TABLE_ACTION, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION', context, undefined, [DIALOG_ENABLEMENT_VALIDATOR]);
|
|
21
|
+
}
|
|
22
|
+
async execute(path) {
|
|
23
|
+
const {
|
|
24
|
+
table,
|
|
25
|
+
iconTabBarFilterKey,
|
|
26
|
+
sectionInfo
|
|
27
|
+
} = this.tableMap[path];
|
|
28
|
+
if (!table) {
|
|
29
|
+
return [];
|
|
30
|
+
}
|
|
31
|
+
if (sectionInfo) {
|
|
32
|
+
const {
|
|
33
|
+
layout,
|
|
34
|
+
section,
|
|
35
|
+
subSection
|
|
36
|
+
} = sectionInfo;
|
|
37
|
+
layout?.setSelectedSection(section);
|
|
38
|
+
section.setSelectedSubSection(subSection);
|
|
39
|
+
this.selectOverlay(table);
|
|
40
|
+
} else {
|
|
41
|
+
getControlById(table.getId())?.getDomRef()?.scrollIntoView();
|
|
42
|
+
this.selectOverlay(table);
|
|
43
|
+
}
|
|
44
|
+
if (this.iconTabBar && iconTabBarFilterKey) {
|
|
45
|
+
this.iconTabBar.setSelectedKey(iconTabBarFilterKey);
|
|
46
|
+
}
|
|
47
|
+
let headerToolbar;
|
|
48
|
+
if (isA(SMART_TABLE_TYPE, table)) {
|
|
49
|
+
headerToolbar = table.getAggregation('items')[0].getAggregation('headerToolbar');
|
|
50
|
+
} else if (isA(M_TABLE_TYPE, table)) {
|
|
51
|
+
headerToolbar = table.getAggregation('headerToolbar');
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// open dialogBox to add, and content is selected ByDefault
|
|
55
|
+
if (headerToolbar) {
|
|
56
|
+
const overlay = OverlayRegistry.getOverlay(headerToolbar) || [];
|
|
57
|
+
await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
|
|
58
|
+
aggregation: 'content',
|
|
59
|
+
title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION'
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return [];
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
var __exports = {
|
|
66
|
+
__esModule: true
|
|
67
|
+
};
|
|
68
|
+
__exports.CREATE_TABLE_ACTION = CREATE_TABLE_ACTION;
|
|
69
|
+
__exports.AddTableActionQuickAction = AddTableActionQuickAction;
|
|
70
|
+
return __exports;
|
|
70
71
|
});
|
|
71
72
|
//# sourceMappingURL=create-table-action.js.map
|
|
@@ -7,8 +7,9 @@ import UI5Element from 'sap/ui/core/Element';
|
|
|
7
7
|
|
|
8
8
|
import { QuickActionContext, NestedQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
|
|
9
9
|
import { getControlById, isA } from '../../../utils/core';
|
|
10
|
-
import {
|
|
10
|
+
import { DialogFactory, DialogNames } from '../../dialog-factory';
|
|
11
11
|
import { TableQuickActionDefinitionBase } from '../table-quick-action-base';
|
|
12
|
+
import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator';
|
|
12
13
|
|
|
13
14
|
export const CREATE_TABLE_ACTION = 'create-table-action';
|
|
14
15
|
const SMART_TABLE_TYPE = 'sap.ui.comp.smarttable.SmartTable';
|
|
@@ -19,7 +20,9 @@ const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, 'sap.ui.table.TreeTable',
|
|
|
19
20
|
|
|
20
21
|
export class AddTableActionQuickAction extends TableQuickActionDefinitionBase implements NestedQuickActionDefinition {
|
|
21
22
|
constructor(context: QuickActionContext) {
|
|
22
|
-
super(CREATE_TABLE_ACTION, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION', context
|
|
23
|
+
super(CREATE_TABLE_ACTION, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION', context, undefined, [
|
|
24
|
+
DIALOG_ENABLEMENT_VALIDATOR
|
|
25
|
+
]);
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
async execute(path: string): Promise<FlexCommand[]> {
|
|
@@ -52,7 +55,7 @@ export class AddTableActionQuickAction extends TableQuickActionDefinitionBase im
|
|
|
52
55
|
// open dialogBox to add, and content is selected ByDefault
|
|
53
56
|
if (headerToolbar) {
|
|
54
57
|
const overlay = OverlayRegistry.getOverlay(headerToolbar as UI5Element) || [];
|
|
55
|
-
await
|
|
58
|
+
await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
|
|
56
59
|
aggregation: 'content',
|
|
57
60
|
title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION'
|
|
58
61
|
});
|
|
@@ -1,97 +1,98 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
const getControlById = _____utils_core["getControlById"];
|
|
7
|
-
const isA = _____utils_core["isA"];
|
|
8
|
-
const DialogNames =
|
|
9
|
-
const
|
|
10
|
-
const ANALYTICAL_TABLE_TYPE =
|
|
11
|
-
const GRID_TABLE_TYPE =
|
|
12
|
-
const M_TABLE_TYPE =
|
|
13
|
-
const SMART_TABLE_TYPE =
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const notifyUser = ____utils["notifyUser"];
|
|
17
|
-
const getTextBundle = _____i18n["getTextBundle"];
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* @param
|
|
26
|
-
* @param
|
|
27
|
-
* @param
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
section
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
this.
|
|
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
|
-
__exports.
|
|
94
|
-
__exports.
|
|
95
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../../utils/core", "../../dialog-factory", "../control-types", "../table-quick-action-base", "../../utils", "../../../i18n", "../dialog-enablement-validator"], function (OverlayRegistry, _____utils_core, ____dialog_factory, ___control_types, ___table_quick_action_base, ____utils, _____i18n, ___dialog_enablement_validator) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const getControlById = _____utils_core["getControlById"];
|
|
7
|
+
const isA = _____utils_core["isA"];
|
|
8
|
+
const DialogNames = ____dialog_factory["DialogNames"];
|
|
9
|
+
const DialogFactory = ____dialog_factory["DialogFactory"];
|
|
10
|
+
const ANALYTICAL_TABLE_TYPE = ___control_types["ANALYTICAL_TABLE_TYPE"];
|
|
11
|
+
const GRID_TABLE_TYPE = ___control_types["GRID_TABLE_TYPE"];
|
|
12
|
+
const M_TABLE_TYPE = ___control_types["M_TABLE_TYPE"];
|
|
13
|
+
const SMART_TABLE_TYPE = ___control_types["SMART_TABLE_TYPE"];
|
|
14
|
+
const TREE_TABLE_TYPE = ___control_types["TREE_TABLE_TYPE"];
|
|
15
|
+
const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
|
|
16
|
+
const notifyUser = ____utils["notifyUser"];
|
|
17
|
+
const getTextBundle = _____i18n["getTextBundle"];
|
|
18
|
+
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
|
|
19
|
+
const CREATE_TABLE_CUSTOM_COLUMN = 'create-table-custom-column';
|
|
20
|
+
const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, TREE_TABLE_TYPE, GRID_TABLE_TYPE];
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Reusable function which performs some preparation steps before table action execution
|
|
24
|
+
*
|
|
25
|
+
* @param table - table element
|
|
26
|
+
* @param sectionInfo - section data
|
|
27
|
+
* @param iconTabBar - icon tab bar element
|
|
28
|
+
* @param iconTabBarFilterKey - tab bar key to select a tab
|
|
29
|
+
*/
|
|
30
|
+
function preprocessActionExecution(table, sectionInfo, iconTabBar, iconTabBarFilterKey) {
|
|
31
|
+
if (sectionInfo) {
|
|
32
|
+
const {
|
|
33
|
+
layout,
|
|
34
|
+
section,
|
|
35
|
+
subSection
|
|
36
|
+
} = sectionInfo;
|
|
37
|
+
layout?.setSelectedSection(section);
|
|
38
|
+
section.setSelectedSubSection(subSection);
|
|
39
|
+
} else {
|
|
40
|
+
getControlById(table.getId())?.getDomRef()?.scrollIntoView();
|
|
41
|
+
}
|
|
42
|
+
if (iconTabBar && iconTabBarFilterKey) {
|
|
43
|
+
iconTabBar.setSelectedKey(iconTabBarFilterKey);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
class AddTableCustomColumnQuickAction extends TableQuickActionDefinitionBase {
|
|
47
|
+
constructor(context) {
|
|
48
|
+
super(CREATE_TABLE_CUSTOM_COLUMN, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN', context, {
|
|
49
|
+
areTableRowsRequired: true
|
|
50
|
+
}, [DIALOG_ENABLEMENT_VALIDATOR]);
|
|
51
|
+
}
|
|
52
|
+
async execute(path) {
|
|
53
|
+
const {
|
|
54
|
+
table,
|
|
55
|
+
iconTabBarFilterKey,
|
|
56
|
+
sectionInfo
|
|
57
|
+
} = this.tableMap[path];
|
|
58
|
+
if (!table) {
|
|
59
|
+
return [];
|
|
60
|
+
}
|
|
61
|
+
preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
|
|
62
|
+
this.selectOverlay(table);
|
|
63
|
+
let tableInternal = table;
|
|
64
|
+
if (isA(SMART_TABLE_TYPE, table)) {
|
|
65
|
+
const itemsAggregation = table.getAggregation('items');
|
|
66
|
+
tableInternal = itemsAggregation.find(item => {
|
|
67
|
+
return [M_TABLE_TYPE, TREE_TABLE_TYPE, ANALYTICAL_TABLE_TYPE, GRID_TABLE_TYPE].some(tType => isA(tType, item));
|
|
68
|
+
});
|
|
69
|
+
if (!tableInternal) {
|
|
70
|
+
return [];
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
const overlay = OverlayRegistry.getOverlay(tableInternal) || [];
|
|
74
|
+
if (!overlay) {
|
|
75
|
+
return [];
|
|
76
|
+
}
|
|
77
|
+
if (isA(M_TABLE_TYPE, tableInternal) && tableInternal.getAggregation('items').length === 0) {
|
|
78
|
+
const bundle = await getTextBundle();
|
|
79
|
+
notifyUser(bundle.getText('TABLE_ROWS_NEEDED_TO_CREATE_CUSTOM_COLUMN'), 8000);
|
|
80
|
+
return [];
|
|
81
|
+
}
|
|
82
|
+
const dialog = [TREE_TABLE_TYPE, ANALYTICAL_TABLE_TYPE, GRID_TABLE_TYPE].some(type => isA(type, tableInternal)) ? DialogNames.ADD_FRAGMENT : DialogNames.ADD_TABLE_COLUMN_FRAGMENTS;
|
|
83
|
+
await DialogFactory.createDialog(overlay, this.context.rta, dialog, undefined, {
|
|
84
|
+
aggregation: 'columns',
|
|
85
|
+
title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN'
|
|
86
|
+
});
|
|
87
|
+
return [];
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
var __exports = {
|
|
91
|
+
__esModule: true
|
|
92
|
+
};
|
|
93
|
+
__exports.CREATE_TABLE_CUSTOM_COLUMN = CREATE_TABLE_CUSTOM_COLUMN;
|
|
94
|
+
__exports.preprocessActionExecution = preprocessActionExecution;
|
|
95
|
+
__exports.AddTableCustomColumnQuickAction = AddTableCustomColumnQuickAction;
|
|
96
|
+
return __exports;
|
|
96
97
|
});
|
|
97
98
|
//# sourceMappingURL=create-table-custom-column.js.map
|
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
import FlexCommand from 'sap/ui/rta/command/FlexCommand';
|
|
2
|
-
import type SmartTable from 'sap/ui/comp/smarttable/SmartTable';
|
|
3
|
-
|
|
4
|
-
import { QuickActionContext, NestedQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
|
|
5
|
-
import { getControlById, isA } from '../../../utils/core';
|
|
6
|
-
import OverlayRegistry from 'sap/ui/dt/OverlayRegistry';
|
|
7
|
-
import { DialogNames, handler } from '../../init-dialogs';
|
|
8
|
-
import {
|
|
9
|
-
ANALYTICAL_TABLE_TYPE,
|
|
10
|
-
GRID_TABLE_TYPE,
|
|
11
|
-
M_TABLE_TYPE,
|
|
12
|
-
SMART_TABLE_TYPE,
|
|
13
|
-
TableQuickActionDefinitionBase,
|
|
14
|
-
TREE_TABLE_TYPE
|
|
15
|
-
} from '../table-quick-action-base';
|
|
16
1
|
import ManagedObject from 'sap/ui/base/ManagedObject';
|
|
17
2
|
import UI5Element from 'sap/ui/core/Element';
|
|
18
|
-
|
|
19
|
-
import
|
|
3
|
+
|
|
4
|
+
import type FlexCommand from 'sap/ui/rta/command/FlexCommand';
|
|
5
|
+
import OverlayRegistry from 'sap/ui/dt/OverlayRegistry';
|
|
6
|
+
|
|
20
7
|
import ObjectPageSection from 'sap/uxap/ObjectPageSection';
|
|
21
8
|
import ObjectPageSubSection from 'sap/uxap/ObjectPageSubSection';
|
|
22
9
|
import ObjectPageLayout from 'sap/uxap/ObjectPageLayout';
|
|
10
|
+
|
|
23
11
|
import IconTabBar from 'sap/m/IconTabBar';
|
|
24
12
|
|
|
13
|
+
import type SmartTable from 'sap/ui/comp/smarttable/SmartTable';
|
|
14
|
+
|
|
15
|
+
import { QuickActionContext, NestedQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
|
|
16
|
+
import { getControlById, isA } from '../../../utils/core';
|
|
17
|
+
import { DialogNames, DialogFactory } from '../../dialog-factory';
|
|
18
|
+
import { ANALYTICAL_TABLE_TYPE, GRID_TABLE_TYPE, M_TABLE_TYPE, SMART_TABLE_TYPE, TREE_TABLE_TYPE } from '../control-types';
|
|
19
|
+
import { TableQuickActionDefinitionBase } from '../table-quick-action-base';
|
|
20
|
+
import { notifyUser } from '../../utils';
|
|
21
|
+
import { getTextBundle } from '../../../i18n';
|
|
22
|
+
import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator';
|
|
23
|
+
|
|
25
24
|
export const CREATE_TABLE_CUSTOM_COLUMN = 'create-table-custom-column';
|
|
26
25
|
|
|
27
26
|
const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, TREE_TABLE_TYPE, GRID_TABLE_TYPE];
|
|
@@ -64,9 +63,16 @@ export class AddTableCustomColumnQuickAction
|
|
|
64
63
|
implements NestedQuickActionDefinition
|
|
65
64
|
{
|
|
66
65
|
constructor(context: QuickActionContext) {
|
|
67
|
-
super(
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
super(
|
|
67
|
+
CREATE_TABLE_CUSTOM_COLUMN,
|
|
68
|
+
CONTROL_TYPES,
|
|
69
|
+
'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN',
|
|
70
|
+
context,
|
|
71
|
+
{
|
|
72
|
+
areTableRowsRequired: true
|
|
73
|
+
},
|
|
74
|
+
[DIALOG_ENABLEMENT_VALIDATOR]
|
|
75
|
+
);
|
|
70
76
|
}
|
|
71
77
|
|
|
72
78
|
async execute(path: string): Promise<FlexCommand[]> {
|
|
@@ -109,7 +115,7 @@ export class AddTableCustomColumnQuickAction
|
|
|
109
115
|
)
|
|
110
116
|
? DialogNames.ADD_FRAGMENT
|
|
111
117
|
: DialogNames.ADD_TABLE_COLUMN_FRAGMENTS;
|
|
112
|
-
await
|
|
118
|
+
await DialogFactory.createDialog(overlay, this.context.rta, dialog, undefined, {
|
|
113
119
|
aggregation: 'columns',
|
|
114
120
|
title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN'
|
|
115
121
|
});
|
|
@@ -1,58 +1,62 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["../../../cpe/quick-actions/utils", "../../../utils/core", "../simple-quick-action-base", "./utils"], function (_____cpe_quick_actions_utils, _____utils_core, ___simple_quick_action_base, ___utils) {
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
|
|
7
|
-
const getControlById = _____utils_core["getControlById"];
|
|
8
|
-
const isA = _____utils_core["isA"];
|
|
9
|
-
const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
|
|
10
|
-
const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
|
|
11
|
-
const prepareManifestChange = ___utils["prepareManifestChange"];
|
|
12
|
-
const ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR = 'enable-semantic-daterange-filterbar';
|
|
13
|
-
const CONTROL_TYPE = 'sap.ui.comp.smartfilterbar.SmartFilterBar';
|
|
14
|
-
const COMPONENT = 'sap.suite.ui.generic.template.ListReport';
|
|
15
|
-
/**
|
|
16
|
-
* Quick Action for toggling the visibility of "semantic date range" for filterbar fields.
|
|
17
|
-
*/
|
|
18
|
-
class ToggleSemanticDateRangeFilterBar extends SimpleQuickActionDefinitionBase {
|
|
19
|
-
constructor(context) {
|
|
20
|
-
super(ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR, [], '', context);
|
|
21
|
-
}
|
|
22
|
-
forceRefreshAfterExecution = true;
|
|
23
|
-
isUseDateRangeTypeEnabled = false;
|
|
24
|
-
async initialize() {
|
|
25
|
-
const manifestChangesSupported = await areManifestChangesSupported(this.context.manifest);
|
|
26
|
-
if (!manifestChangesSupported) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
|
|
30
|
-
for (const control of controls) {
|
|
31
|
-
const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
|
|
32
|
-
const modifiedControl = getControlById(control.controlId);
|
|
33
|
-
if (isActionApplicable && modifiedControl) {
|
|
34
|
-
this.
|
|
35
|
-
this.control
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
__exports
|
|
56
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["../../../cpe/quick-actions/utils", "../../../utils/core", "../simple-quick-action-base", "./utils"], function (_____cpe_quick_actions_utils, _____utils_core, ___simple_quick_action_base, ___utils) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
|
|
7
|
+
const getControlById = _____utils_core["getControlById"];
|
|
8
|
+
const isA = _____utils_core["isA"];
|
|
9
|
+
const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
|
|
10
|
+
const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
|
|
11
|
+
const prepareManifestChange = ___utils["prepareManifestChange"];
|
|
12
|
+
const ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR = 'enable-semantic-daterange-filterbar';
|
|
13
|
+
const CONTROL_TYPE = 'sap.ui.comp.smartfilterbar.SmartFilterBar';
|
|
14
|
+
const COMPONENT = 'sap.suite.ui.generic.template.ListReport';
|
|
15
|
+
/**
|
|
16
|
+
* Quick Action for toggling the visibility of "semantic date range" for filterbar fields.
|
|
17
|
+
*/
|
|
18
|
+
class ToggleSemanticDateRangeFilterBar extends SimpleQuickActionDefinitionBase {
|
|
19
|
+
constructor(context) {
|
|
20
|
+
super(ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR, [], '', context);
|
|
21
|
+
}
|
|
22
|
+
forceRefreshAfterExecution = true;
|
|
23
|
+
isUseDateRangeTypeEnabled = false;
|
|
24
|
+
async initialize() {
|
|
25
|
+
const manifestChangesSupported = await areManifestChangesSupported(this.context.manifest);
|
|
26
|
+
if (!manifestChangesSupported) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
|
|
30
|
+
for (const control of controls) {
|
|
31
|
+
const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
|
|
32
|
+
const modifiedControl = getControlById(control.controlId);
|
|
33
|
+
if (isActionApplicable && modifiedControl) {
|
|
34
|
+
this.control = modifiedControl;
|
|
35
|
+
const id = this.control.getProperty('persistencyKey') ?? this.control.getId();
|
|
36
|
+
if (typeof id !== 'string') {
|
|
37
|
+
throw new Error('Could not retrieve configuration property because control id is not valid!');
|
|
38
|
+
}
|
|
39
|
+
const value = this.context.changeService.getConfigurationPropertyValue(id, 'useDateRange');
|
|
40
|
+
this.isUseDateRangeTypeEnabled = value === undefined ? this.control.data('useDateRangeType') : value;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
get textKey() {
|
|
45
|
+
return this.isUseDateRangeTypeEnabled ? 'QUICK_ACTION_LR_DISABLE_SEMANTIC_DATE_RANGE_FILTER_BAR' : 'QUICK_ACTION_LR_ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR';
|
|
46
|
+
}
|
|
47
|
+
async execute() {
|
|
48
|
+
const entitySet = isA(CONTROL_TYPE, this.control) ? this.control.getEntitySet() : undefined;
|
|
49
|
+
const command = await prepareManifestChange(this.context, 'component/settings/filterSettings/dateSettings', this.control, COMPONENT, entitySet, {
|
|
50
|
+
useDateRange: !this.isUseDateRangeTypeEnabled
|
|
51
|
+
});
|
|
52
|
+
return command;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
var __exports = {
|
|
56
|
+
__esModule: true
|
|
57
|
+
};
|
|
58
|
+
__exports.ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR = ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR;
|
|
59
|
+
__exports.ToggleSemanticDateRangeFilterBar = ToggleSemanticDateRangeFilterBar;
|
|
60
|
+
return __exports;
|
|
57
61
|
});
|
|
58
62
|
//# sourceMappingURL=lr-enable-semantic-date-range-filter-bar.js.map
|
|
@@ -33,8 +33,15 @@ export class ToggleSemanticDateRangeFilterBar
|
|
|
33
33
|
const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
|
|
34
34
|
const modifiedControl = getControlById<FilterBar>(control.controlId);
|
|
35
35
|
if (isActionApplicable && modifiedControl) {
|
|
36
|
-
this.isUseDateRangeTypeEnabled = modifiedControl.getProperty('useDateRangeType');
|
|
37
36
|
this.control = modifiedControl;
|
|
37
|
+
|
|
38
|
+
const id = (this.control.getProperty('persistencyKey') as unknown) ?? this.control.getId();
|
|
39
|
+
if (typeof id !== 'string') {
|
|
40
|
+
throw new Error('Could not retrieve configuration property because control id is not valid!');
|
|
41
|
+
}
|
|
42
|
+
const value = this.context.changeService.getConfigurationPropertyValue(id, 'useDateRange');
|
|
43
|
+
this.isUseDateRangeTypeEnabled =
|
|
44
|
+
value === undefined ? (this.control.data('useDateRangeType') as boolean) : (value as boolean);
|
|
38
45
|
}
|
|
39
46
|
}
|
|
40
47
|
}
|
|
@@ -58,8 +65,6 @@ export class ToggleSemanticDateRangeFilterBar
|
|
|
58
65
|
}
|
|
59
66
|
);
|
|
60
67
|
|
|
61
|
-
this.isUseDateRangeTypeEnabled = !this.isUseDateRangeTypeEnabled;
|
|
62
|
-
|
|
63
68
|
return command;
|
|
64
69
|
}
|
|
65
70
|
}
|