@sap-ux/preview-middleware 0.19.17 → 0.19.19

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.
Files changed (83) hide show
  1. package/dist/client/adp/api-handler.js +153 -153
  2. package/dist/client/adp/command-executor.js +75 -75
  3. package/dist/client/adp/control-utils.js +44 -44
  4. package/dist/client/adp/controllers/ControllerExtension.controller.js +210 -210
  5. package/dist/client/adp/controllers/ExtensionPoint.controller.js +139 -139
  6. package/dist/client/adp/controllers/FileExistsDialog.controller.js +66 -66
  7. package/dist/client/adp/dialog-factory.js +135 -135
  8. package/dist/client/adp/init-dialogs.js +138 -138
  9. package/dist/client/adp/quick-actions/add-new-subpage-quick-action-base.js +96 -96
  10. package/dist/client/adp/quick-actions/common/add-controller-to-page.js +60 -60
  11. package/dist/client/adp/quick-actions/common/create-page-action.js +54 -54
  12. package/dist/client/adp/quick-actions/common/op-add-custom-section.js +39 -39
  13. package/dist/client/adp/quick-actions/common/op-add-header-field.js +67 -67
  14. package/dist/client/adp/quick-actions/common/utils.js +18 -18
  15. package/dist/client/adp/quick-actions/control-types.js +23 -21
  16. package/dist/client/adp/quick-actions/control-types.ts +1 -0
  17. package/dist/client/adp/quick-actions/dialog-enablement-validator.js +24 -24
  18. package/dist/client/adp/quick-actions/enablement-validator.js +4 -4
  19. package/dist/client/adp/quick-actions/fe-v2/add-new-subpage.js +81 -81
  20. package/dist/client/adp/quick-actions/fe-v2/change-table-actions.js +69 -0
  21. package/dist/client/adp/quick-actions/fe-v2/change-table-actions.ts +71 -0
  22. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +101 -101
  23. package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +107 -107
  24. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +99 -99
  25. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +78 -78
  26. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +77 -77
  27. package/dist/client/adp/quick-actions/fe-v2/lr-enable-variant-management.js +69 -69
  28. package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +59 -59
  29. package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +93 -93
  30. package/dist/client/adp/quick-actions/fe-v2/op-enable-variant-management.js +84 -84
  31. package/dist/client/adp/quick-actions/fe-v2/registry.js +77 -76
  32. package/dist/client/adp/quick-actions/fe-v2/registry.ts +4 -0
  33. package/dist/client/adp/quick-actions/fe-v2/utils.js +116 -116
  34. package/dist/client/adp/quick-actions/fe-v4/add-new-subpage.js +138 -138
  35. package/dist/client/adp/quick-actions/fe-v4/change-table-actions.js +81 -0
  36. package/dist/client/adp/quick-actions/fe-v4/change-table-actions.ts +81 -0
  37. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +73 -73
  38. package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +53 -53
  39. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +49 -49
  40. package/dist/client/adp/quick-actions/fe-v4/enable-variant-management.js +81 -81
  41. package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +56 -56
  42. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +82 -82
  43. package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +53 -53
  44. package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +89 -89
  45. package/dist/client/adp/quick-actions/fe-v4/registry.js +60 -59
  46. package/dist/client/adp/quick-actions/fe-v4/registry.ts +4 -1
  47. package/dist/client/adp/quick-actions/fe-v4/utils.js +72 -72
  48. package/dist/client/adp/quick-actions/load.js +44 -44
  49. package/dist/client/adp/quick-actions/quick-action-base.js +64 -64
  50. package/dist/client/adp/quick-actions/table-quick-action-base.js +16 -2
  51. package/dist/client/adp/quick-actions/table-quick-action-base.ts +21 -3
  52. package/dist/client/adp/utils.js +218 -218
  53. package/dist/client/cpe/changes/index.js +10 -10
  54. package/dist/client/cpe/changes/validator.js +39 -39
  55. package/dist/client/cpe/documentation.js +164 -164
  56. package/dist/client/cpe/feature-service.js +36 -36
  57. package/dist/client/cpe/logger.js +30 -30
  58. package/dist/client/cpe/outline/editable.js +37 -37
  59. package/dist/client/cpe/outline/nodes.js +203 -203
  60. package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
  61. package/dist/client/cpe/quick-actions/registry.js +143 -143
  62. package/dist/client/cpe/quick-actions/utils.js +92 -92
  63. package/dist/client/cpe/types.js +4 -4
  64. package/dist/client/cpe/ui5-utils.js +33 -33
  65. package/dist/client/cpe/utils.js +111 -111
  66. package/dist/client/flp/WorkspaceConnector.js +86 -86
  67. package/dist/client/flp/common.js +28 -28
  68. package/dist/client/flp/enableFakeConnector.js +83 -83
  69. package/dist/client/flp/homepage/Component.js +14 -14
  70. package/dist/client/flp/initCdm.js +117 -117
  71. package/dist/client/flp/initConnectors.js +28 -28
  72. package/dist/client/flp/initRta.js +178 -178
  73. package/dist/client/i18n.js +56 -56
  74. package/dist/client/messagebundle.properties +4 -0
  75. package/dist/client/utils/application.js +32 -32
  76. package/dist/client/utils/core.js +84 -68
  77. package/dist/client/utils/core.ts +19 -0
  78. package/dist/client/utils/error.js +19 -19
  79. package/dist/client/utils/fe-v2.js +56 -56
  80. package/dist/client/utils/fe-v4.js +140 -140
  81. package/dist/client/utils/fe-v4.ts +1 -0
  82. package/dist/client/utils/version.js +104 -104
  83. package/package.json +6 -6
@@ -1,61 +1,62 @@
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", "./create-table-custom-column", "../common/create-page-action", "./create-table-action", "./lr-enable-table-filtering", "./lr-enable-semantic-date-range-filter-bar", "./op-enable-empty-row-mode", "../common/add-new-annotation-file", "./enable-variant-management", "../fe-v4/add-new-subpage"], 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, ___create_table_custom_column, ___common_create_page_action, ___create_table_action, ___lr_enable_table_filtering, ___lr_enable_semantic_date_range_filter_bar, ___op_enable_empty_row_mode, ___common_add_new_annotation_file, ___enable_variant_management, ___fe_v4_add_new_subpage) {
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 AddTableCustomColumnQuickAction = ___create_table_custom_column["AddTableCustomColumnQuickAction"];
13
- const AddPageActionQuickAction = ___common_create_page_action["AddPageActionQuickAction"];
14
- const AddTableActionQuickAction = ___create_table_action["AddTableActionQuickAction"];
15
- const EnableTableFilteringQuickAction = ___lr_enable_table_filtering["EnableTableFilteringQuickAction"];
16
- const ToggleSemanticDateRangeFilterBar = ___lr_enable_semantic_date_range_filter_bar["ToggleSemanticDateRangeFilterBar"];
17
- const EnableTableEmptyRowModeQuickAction = ___op_enable_empty_row_mode["EnableTableEmptyRowModeQuickAction"];
18
- const AddNewAnnotationFile = ___common_add_new_annotation_file["AddNewAnnotationFile"];
19
- const EnableVariantManagementQuickAction = ___enable_variant_management["EnableVariantManagementQuickAction"];
20
- const AddNewSubpage = ___fe_v4_add_new_subpage["AddNewSubpage"];
21
- const LIST_REPORT_TYPE = 'sap.fe.templates.ListReport.ListReport';
22
- const OBJECT_PAGE_TYPE = 'sap.fe.templates.ObjectPage.ObjectPage';
23
-
24
- /**
25
- * Quick Action provider for SAP Fiori Elements V4 applications.
26
- */
27
- class FEV4QuickActionRegistry extends QuickActionDefinitionRegistry {
28
- PAGE_NAME_MAP = {
29
- [LIST_REPORT_TYPE]: 'listReport',
30
- [OBJECT_PAGE_TYPE]: 'objectPage'
31
- };
32
- getDefinitions(context) {
33
- const activePages = this.getActivePageContent(context.controlIndex);
34
- const definitionGroups = [];
35
- for (let index = 0; index < activePages.length; index++) {
36
- const {
37
- name,
38
- view
39
- } = activePages[index];
40
- if (name === 'listReport') {
41
- definitionGroups.push({
42
- title: 'LIST REPORT',
43
- definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, ToggleClearFilterBarQuickAction, ToggleSemanticDateRangeFilterBar, EnableVariantManagementQuickAction, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction, EnableTableFilteringQuickAction, AddNewAnnotationFile, AddNewSubpage],
44
- view,
45
- key: name + index
46
- });
47
- } else if (name === 'objectPage') {
48
- definitionGroups.push({
49
- title: 'OBJECT PAGE',
50
- definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, AddHeaderFieldQuickAction, AddCustomSectionQuickAction, ChangeTableColumnsQuickAction, EnableVariantManagementQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction, EnableTableEmptyRowModeQuickAction, AddNewAnnotationFile, AddNewSubpage],
51
- view,
52
- key: name + index
53
- });
54
- }
55
- }
56
- return definitionGroups;
57
- }
58
- }
59
- 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", "./create-table-custom-column", "../common/create-page-action", "./create-table-action", "./lr-enable-table-filtering", "./lr-enable-semantic-date-range-filter-bar", "./op-enable-empty-row-mode", "../common/add-new-annotation-file", "./enable-variant-management", "../fe-v4/add-new-subpage", "../fe-v4/change-table-actions"], 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, ___create_table_custom_column, ___common_create_page_action, ___create_table_action, ___lr_enable_table_filtering, ___lr_enable_semantic_date_range_filter_bar, ___op_enable_empty_row_mode, ___common_add_new_annotation_file, ___enable_variant_management, ___fe_v4_add_new_subpage, ___fe_v4_change_table_actions) {
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 AddTableCustomColumnQuickAction = ___create_table_custom_column["AddTableCustomColumnQuickAction"];
13
+ const AddPageActionQuickAction = ___common_create_page_action["AddPageActionQuickAction"];
14
+ const AddTableActionQuickAction = ___create_table_action["AddTableActionQuickAction"];
15
+ const EnableTableFilteringQuickAction = ___lr_enable_table_filtering["EnableTableFilteringQuickAction"];
16
+ const ToggleSemanticDateRangeFilterBar = ___lr_enable_semantic_date_range_filter_bar["ToggleSemanticDateRangeFilterBar"];
17
+ const EnableTableEmptyRowModeQuickAction = ___op_enable_empty_row_mode["EnableTableEmptyRowModeQuickAction"];
18
+ const AddNewAnnotationFile = ___common_add_new_annotation_file["AddNewAnnotationFile"];
19
+ const EnableVariantManagementQuickAction = ___enable_variant_management["EnableVariantManagementQuickAction"];
20
+ const AddNewSubpage = ___fe_v4_add_new_subpage["AddNewSubpage"];
21
+ const ChangeTableActionsQuickAction = ___fe_v4_change_table_actions["ChangeTableActionsQuickAction"];
22
+ const LIST_REPORT_TYPE = 'sap.fe.templates.ListReport.ListReport';
23
+ const OBJECT_PAGE_TYPE = 'sap.fe.templates.ObjectPage.ObjectPage';
24
+
25
+ /**
26
+ * Quick Action provider for SAP Fiori Elements V4 applications.
27
+ */
28
+ class FEV4QuickActionRegistry extends QuickActionDefinitionRegistry {
29
+ PAGE_NAME_MAP = {
30
+ [LIST_REPORT_TYPE]: 'listReport',
31
+ [OBJECT_PAGE_TYPE]: 'objectPage'
32
+ };
33
+ getDefinitions(context) {
34
+ const activePages = this.getActivePageContent(context.controlIndex);
35
+ const definitionGroups = [];
36
+ for (let index = 0; index < activePages.length; index++) {
37
+ const {
38
+ name,
39
+ view
40
+ } = activePages[index];
41
+ if (name === 'listReport') {
42
+ definitionGroups.push({
43
+ title: 'LIST REPORT',
44
+ definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, ToggleClearFilterBarQuickAction, ToggleSemanticDateRangeFilterBar, EnableVariantManagementQuickAction, ChangeTableActionsQuickAction, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction, EnableTableFilteringQuickAction, AddNewAnnotationFile, AddNewSubpage],
45
+ view,
46
+ key: name + index
47
+ });
48
+ } else if (name === 'objectPage') {
49
+ definitionGroups.push({
50
+ title: 'OBJECT PAGE',
51
+ definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, AddHeaderFieldQuickAction, AddCustomSectionQuickAction, EnableVariantManagementQuickAction, ChangeTableActionsQuickAction, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction, EnableTableEmptyRowModeQuickAction, AddNewAnnotationFile, AddNewSubpage],
52
+ view,
53
+ key: name + index
54
+ });
55
+ }
56
+ }
57
+ return definitionGroups;
58
+ }
59
+ }
60
+ return FEV4QuickActionRegistry;
60
61
  });
61
62
  //# sourceMappingURL=registry.js.map
@@ -18,6 +18,7 @@ import { EnableTableEmptyRowModeQuickAction } from './op-enable-empty-row-mode';
18
18
  import { AddNewAnnotationFile } from '../common/add-new-annotation-file';
19
19
  import { EnableVariantManagementQuickAction } from './enable-variant-management';
20
20
  import { AddNewSubpage } from '../fe-v4/add-new-subpage';
21
+ import { ChangeTableActionsQuickAction } from '../fe-v4/change-table-actions';
21
22
 
22
23
  type PageName = 'listReport' | 'objectPage';
23
24
 
@@ -47,6 +48,7 @@ export default class FEV4QuickActionRegistry extends QuickActionDefinitionRegist
47
48
  ToggleClearFilterBarQuickAction,
48
49
  ToggleSemanticDateRangeFilterBar,
49
50
  EnableVariantManagementQuickAction,
51
+ ChangeTableActionsQuickAction,
50
52
  ChangeTableColumnsQuickAction,
51
53
  AddTableActionQuickAction,
52
54
  AddTableCustomColumnQuickAction,
@@ -65,8 +67,9 @@ export default class FEV4QuickActionRegistry extends QuickActionDefinitionRegist
65
67
  AddPageActionQuickAction,
66
68
  AddHeaderFieldQuickAction,
67
69
  AddCustomSectionQuickAction,
68
- ChangeTableColumnsQuickAction,
69
70
  EnableVariantManagementQuickAction,
71
+ ChangeTableActionsQuickAction,
72
+ ChangeTableColumnsQuickAction,
70
73
  AddTableActionQuickAction,
71
74
  AddTableCustomColumnQuickAction,
72
75
  EnableTableEmptyRowModeQuickAction,
@@ -1,74 +1,74 @@
1
- "use strict";
2
-
3
- sap.ui.define(["../../../utils/core", "sap/ui/rta/command/CommandFactory", "../../../utils/fe-v4"], function (_____utils_core, CommandFactory, _____utils_fe_v4) {
4
- "use strict";
5
-
6
- const getControlById = _____utils_core["getControlById"];
7
- const getV4AppComponent = _____utils_fe_v4["getV4AppComponent"];
8
- const getPageName = _____utils_fe_v4["getPageName"];
9
- const getReference = _____utils_fe_v4["getReference"];
10
- async function executeToggleAction(context, isButtonEnabled, controlType, propertyPath) {
11
- const controls = context.controlIndex[controlType] ?? [];
12
- const control = controls[0];
13
- if (control) {
14
- const modifiedControl = getControlById(control.controlId);
15
- if (!modifiedControl) {
16
- return [];
17
- }
18
- const {
19
- flexSettings
20
- } = context;
21
- const parent = modifiedControl.getParent();
22
- if (!parent) {
23
- return [];
24
- }
25
- const modifiedValue = {
26
- reference: getReference(modifiedControl),
27
- appComponent: getV4AppComponent(modifiedControl),
28
- changeType: 'appdescr_fe_changePageConfiguration',
29
- parameters: {
30
- page: getPageName(parent),
31
- entityPropertyChange: {
32
- propertyPath: propertyPath,
33
- propertyValue: !isButtonEnabled,
34
- operation: 'UPSERT'
35
- }
36
- }
37
- };
38
- const command = await CommandFactory.getCommandFor(modifiedControl, 'appDescriptor', modifiedValue, null, flexSettings);
39
- return [command];
40
- }
41
- return [];
42
- }
43
- const PATTERN_SUFFIX = ':?query:';
44
-
45
- /**
46
- * Generates the pattern for a new route based on the input.
47
- *
48
- * @param sourceRoutePattern source page route pattern
49
- * @param navProperty navigation property name (used to build nav pattern for nested OP )
50
- * @param targetEntitySet navigation target entity set
51
- * @returns the generated pattern as string
52
- */
53
- function generateRoutePattern(sourceRoutePattern, navProperty, targetEntitySet) {
54
- const parts = [];
55
- const basePattern = sourceRoutePattern.replace(PATTERN_SUFFIX, '');
56
- if (basePattern) {
57
- parts.push(basePattern);
58
- parts.push('/');
59
- parts.push(navProperty);
60
- } else {
61
- parts.push(targetEntitySet);
62
- }
63
- parts.push(`({${targetEntitySet}Key})`);
64
- parts.push(PATTERN_SUFFIX);
65
- return parts.join('');
66
- }
67
- var __exports = {
68
- __esModule: true
69
- };
70
- __exports.executeToggleAction = executeToggleAction;
71
- __exports.generateRoutePattern = generateRoutePattern;
72
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["../../../utils/core", "sap/ui/rta/command/CommandFactory", "../../../utils/fe-v4"], function (_____utils_core, CommandFactory, _____utils_fe_v4) {
4
+ "use strict";
5
+
6
+ const getControlById = _____utils_core["getControlById"];
7
+ const getV4AppComponent = _____utils_fe_v4["getV4AppComponent"];
8
+ const getPageName = _____utils_fe_v4["getPageName"];
9
+ const getReference = _____utils_fe_v4["getReference"];
10
+ async function executeToggleAction(context, isButtonEnabled, controlType, propertyPath) {
11
+ const controls = context.controlIndex[controlType] ?? [];
12
+ const control = controls[0];
13
+ if (control) {
14
+ const modifiedControl = getControlById(control.controlId);
15
+ if (!modifiedControl) {
16
+ return [];
17
+ }
18
+ const {
19
+ flexSettings
20
+ } = context;
21
+ const parent = modifiedControl.getParent();
22
+ if (!parent) {
23
+ return [];
24
+ }
25
+ const modifiedValue = {
26
+ reference: getReference(modifiedControl),
27
+ appComponent: getV4AppComponent(modifiedControl),
28
+ changeType: 'appdescr_fe_changePageConfiguration',
29
+ parameters: {
30
+ page: getPageName(parent),
31
+ entityPropertyChange: {
32
+ propertyPath: propertyPath,
33
+ propertyValue: !isButtonEnabled,
34
+ operation: 'UPSERT'
35
+ }
36
+ }
37
+ };
38
+ const command = await CommandFactory.getCommandFor(modifiedControl, 'appDescriptor', modifiedValue, null, flexSettings);
39
+ return [command];
40
+ }
41
+ return [];
42
+ }
43
+ const PATTERN_SUFFIX = ':?query:';
44
+
45
+ /**
46
+ * Generates the pattern for a new route based on the input.
47
+ *
48
+ * @param sourceRoutePattern source page route pattern
49
+ * @param navProperty navigation property name (used to build nav pattern for nested OP )
50
+ * @param targetEntitySet navigation target entity set
51
+ * @returns the generated pattern as string
52
+ */
53
+ function generateRoutePattern(sourceRoutePattern, navProperty, targetEntitySet) {
54
+ const parts = [];
55
+ const basePattern = sourceRoutePattern.replace(PATTERN_SUFFIX, '');
56
+ if (basePattern) {
57
+ parts.push(basePattern);
58
+ parts.push('/');
59
+ parts.push(navProperty);
60
+ } else {
61
+ parts.push(targetEntitySet);
62
+ }
63
+ parts.push(`({${targetEntitySet}Key})`);
64
+ parts.push(PATTERN_SUFFIX);
65
+ return parts.join('');
66
+ }
67
+ var __exports = {
68
+ __esModule: true
69
+ };
70
+ __exports.executeToggleAction = executeToggleAction;
71
+ __exports.generateRoutePattern = generateRoutePattern;
72
+ return __exports;
73
73
  });
74
74
  //# sourceMappingURL=utils.js.map
@@ -1,46 +1,46 @@
1
- "use strict";
2
-
3
- sap.ui.define([], function () {
4
- "use strict";
5
-
6
- function __ui5_require_async(path) {
7
- return new Promise(function (resolve, reject) {
8
- sap.ui.require([path], function (module) {
9
- if (!(module && module.__esModule)) {
10
- module = module === null || !(typeof module === "object" && path.endsWith("/library")) ? {
11
- default: module
12
- } : module;
13
- Object.defineProperty(module, "__esModule", {
14
- value: true
15
- });
16
- }
17
- resolve(module);
18
- }, function (err) {
19
- reject(err);
20
- });
21
- });
22
- }
23
- /**
24
- * Loads the appropriate Quick Action registries for the given application type.
25
- *
26
- * @param appType - Application type.
27
- * @returns Quick Action registries.
28
- */
29
- async function loadDefinitions(appType) {
30
- if (appType === 'fe-v2') {
31
- const FEV2QuickActionRegistry = (await __ui5_require_async('open/ux/preview/client/adp/quick-actions/fe-v2/registry')).default;
32
- return [new FEV2QuickActionRegistry()];
33
- }
34
- if (appType === 'fe-v4') {
35
- const FEV4QuickActionRegistry = (await __ui5_require_async('open/ux/preview/client/adp/quick-actions/fe-v4/registry')).default;
36
- return [new FEV4QuickActionRegistry()];
37
- }
38
- return [];
39
- }
40
- var __exports = {
41
- __esModule: true
42
- };
43
- __exports.loadDefinitions = loadDefinitions;
44
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define([], function () {
4
+ "use strict";
5
+
6
+ function __ui5_require_async(path) {
7
+ return new Promise(function (resolve, reject) {
8
+ sap.ui.require([path], function (module) {
9
+ if (!(module && module.__esModule)) {
10
+ module = module === null || !(typeof module === "object" && path.endsWith("/library")) ? {
11
+ default: module
12
+ } : module;
13
+ Object.defineProperty(module, "__esModule", {
14
+ value: true
15
+ });
16
+ }
17
+ resolve(module);
18
+ }, function (err) {
19
+ reject(err);
20
+ });
21
+ });
22
+ }
23
+ /**
24
+ * Loads the appropriate Quick Action registries for the given application type.
25
+ *
26
+ * @param appType - Application type.
27
+ * @returns Quick Action registries.
28
+ */
29
+ async function loadDefinitions(appType) {
30
+ if (appType === 'fe-v2') {
31
+ const FEV2QuickActionRegistry = (await __ui5_require_async('open/ux/preview/client/adp/quick-actions/fe-v2/registry')).default;
32
+ return [new FEV2QuickActionRegistry()];
33
+ }
34
+ if (appType === 'fe-v4') {
35
+ const FEV4QuickActionRegistry = (await __ui5_require_async('open/ux/preview/client/adp/quick-actions/fe-v4/registry')).default;
36
+ return [new FEV4QuickActionRegistry()];
37
+ }
38
+ return [];
39
+ }
40
+ var __exports = {
41
+ __esModule: true
42
+ };
43
+ __exports.loadDefinitions = loadDefinitions;
44
+ return __exports;
45
45
  });
46
46
  //# sourceMappingURL=load.js.map
@@ -1,66 +1,66 @@
1
- "use strict";
2
-
3
- sap.ui.define(["./dialog-enablement-validator"], function (___dialog_enablement_validator) {
4
- "use strict";
5
-
6
- const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
7
- /**
8
- * Base class for all quick actions.
9
- */
10
- class QuickActionDefinitionBase {
11
- get id() {
12
- return `${this.context.key}-${this.type}`;
13
- }
14
- getTelemetryIdentifier() {
15
- let update = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
16
- if (update === true) {
17
- this.telemetryIdentifier = new Date().toISOString();
18
- }
19
- return this.telemetryIdentifier;
20
- }
21
- get quickActionSteps() {
22
- return this.enablementValidators.find(item => item === DIALOG_ENABLEMENT_VALIDATOR) ? 2 : 1;
23
- }
24
-
25
- /**
26
- * Quick Actions tooltip.
27
- */
28
- get tooltip() {
29
- if (this.validationResult) {
30
- const validationErrors = this.validationResult.filter(result => result?.type === 'error');
31
- if (validationErrors.length > 0) {
32
- const error = validationErrors[0];
33
- return error.message;
34
- }
35
- }
36
- return undefined;
37
- }
38
- get isDisabled() {
39
- if (this.validationResult === undefined) {
40
- return false;
41
- }
42
- const validationErrors = this.validationResult.filter(result => result?.type === 'error');
43
- return validationErrors.length > 0;
44
- }
45
- get textKey() {
46
- return this.defaultTextKey;
47
- }
48
- constructor(type, kind, defaultTextKey, context) {
49
- let enablementValidators = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
50
- this.type = type;
51
- this.kind = kind;
52
- this.defaultTextKey = defaultTextKey;
53
- this.context = context;
54
- this.enablementValidators = enablementValidators;
55
- }
56
- async runEnablementValidators() {
57
- this.validationResult = await Promise.all(this.enablementValidators.map(async validator => await validator.run()));
58
- }
59
- }
60
- var __exports = {
61
- __esModule: true
62
- };
63
- __exports.QuickActionDefinitionBase = QuickActionDefinitionBase;
64
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["./dialog-enablement-validator"], function (___dialog_enablement_validator) {
4
+ "use strict";
5
+
6
+ const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
7
+ /**
8
+ * Base class for all quick actions.
9
+ */
10
+ class QuickActionDefinitionBase {
11
+ get id() {
12
+ return `${this.context.key}-${this.type}`;
13
+ }
14
+ getTelemetryIdentifier() {
15
+ let update = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
16
+ if (update === true) {
17
+ this.telemetryIdentifier = new Date().toISOString();
18
+ }
19
+ return this.telemetryIdentifier;
20
+ }
21
+ get quickActionSteps() {
22
+ return this.enablementValidators.find(item => item === DIALOG_ENABLEMENT_VALIDATOR) ? 2 : 1;
23
+ }
24
+
25
+ /**
26
+ * Quick Actions tooltip.
27
+ */
28
+ get tooltip() {
29
+ if (this.validationResult) {
30
+ const validationErrors = this.validationResult.filter(result => result?.type === 'error');
31
+ if (validationErrors.length > 0) {
32
+ const error = validationErrors[0];
33
+ return error.message;
34
+ }
35
+ }
36
+ return undefined;
37
+ }
38
+ get isDisabled() {
39
+ if (this.validationResult === undefined) {
40
+ return false;
41
+ }
42
+ const validationErrors = this.validationResult.filter(result => result?.type === 'error');
43
+ return validationErrors.length > 0;
44
+ }
45
+ get textKey() {
46
+ return this.defaultTextKey;
47
+ }
48
+ constructor(type, kind, defaultTextKey, context) {
49
+ let enablementValidators = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
50
+ this.type = type;
51
+ this.kind = kind;
52
+ this.defaultTextKey = defaultTextKey;
53
+ this.context = context;
54
+ this.enablementValidators = enablementValidators;
55
+ }
56
+ async runEnablementValidators() {
57
+ this.validationResult = await Promise.all(this.enablementValidators.map(async validator => await validator.run()));
58
+ }
59
+ }
60
+ var __exports = {
61
+ __esModule: true
62
+ };
63
+ __exports.QuickActionDefinitionBase = QuickActionDefinitionBase;
64
+ return __exports;
65
65
  });
66
66
  //# sourceMappingURL=quick-action-base.js.map
@@ -27,6 +27,7 @@ sap.ui.define([
27
27
  const SMART_TABLE_ACTION_ID = 'CTX_COMP_VARIANT_CONTENT';
28
28
  const M_TABLE_ACTION_ID = 'CTX_ADD_ELEMENTS_AS_CHILD';
29
29
  const SETTINGS_ID = 'CTX_SETTINGS';
30
+ const REARRANGE_TOOLBAR_SETTINGS_ID = 'CTX_SETTINGS0';
30
31
  const ICON_TAB_BAR_TYPE = 'sap.m.IconTabBar';
31
32
  async function getActionId(table) {
32
33
  const {major, minor} = await getUi5Version();
@@ -42,6 +43,13 @@ sap.ui.define([
42
43
  SETTINGS_ID
43
44
  ];
44
45
  }
46
+ async function getRearrangeToolbarContentActionId() {
47
+ const {major, minor} = await getUi5Version();
48
+ if (major === 1 && minor <= 127) {
49
+ return SETTINGS_ID;
50
+ }
51
+ return REARRANGE_TOOLBAR_SETTINGS_ID;
52
+ }
45
53
  class TableQuickActionDefinitionBase extends QuickActionDefinitionBase {
46
54
  isApplicable = false;
47
55
  children = [];
@@ -64,8 +72,14 @@ sap.ui.define([
64
72
  if (this.options.includeServiceAction) {
65
73
  const actions = await this.context.actionService.get(table.getId());
66
74
  const actionsIds = await getActionId(table);
67
- const changeColumnAction = actionsIds.find(actionId => actions.findIndex(action => action.id === actionId) > -1);
68
- this.tableMap[tableMapKey].changeColumnActionId = changeColumnAction;
75
+ const changeColumnActionId = actionsIds.find(actionId => actions.findIndex(action => action.id === actionId) > -1);
76
+ this.tableMap[tableMapKey].changeColumnActionId = changeColumnActionId;
77
+ const changeToolbarContentActionId = await getRearrangeToolbarContentActionId();
78
+ const changeToolbarContentAction = actions.find(action => action.id === changeToolbarContentActionId);
79
+ this.tableMap[tableMapKey].changeToolbarContentAction = changeToolbarContentAction ? {
80
+ id: changeToolbarContentAction.id,
81
+ enabled: changeToolbarContentAction.enabled
82
+ } : undefined;
69
83
  }
70
84
  }
71
85
  async initialize() {
@@ -29,6 +29,7 @@ import {
29
29
  const SMART_TABLE_ACTION_ID = 'CTX_COMP_VARIANT_CONTENT';
30
30
  const M_TABLE_ACTION_ID = 'CTX_ADD_ELEMENTS_AS_CHILD';
31
31
  const SETTINGS_ID = 'CTX_SETTINGS';
32
+ const REARRANGE_TOOLBAR_SETTINGS_ID = 'CTX_SETTINGS0';
32
33
  const ICON_TAB_BAR_TYPE = 'sap.m.IconTabBar';
33
34
 
34
35
  async function getActionId(table: UI5Element): Promise<string[]> {
@@ -44,6 +45,15 @@ async function getActionId(table: UI5Element): Promise<string[]> {
44
45
 
45
46
  return [M_TABLE_ACTION_ID, SETTINGS_ID];
46
47
  }
48
+
49
+ async function getRearrangeToolbarContentActionId(): Promise<string> {
50
+ const { major, minor } = await getUi5Version();
51
+ if (major === 1 && minor <= 127) {
52
+ return SETTINGS_ID;
53
+ }
54
+ return REARRANGE_TOOLBAR_SETTINGS_ID;
55
+ }
56
+
47
57
  export type TableQuickActionsOptions = {
48
58
  includeServiceAction?: boolean;
49
59
  areTableRowsRequired?: boolean;
@@ -65,6 +75,7 @@ export abstract class TableQuickActionDefinitionBase extends QuickActionDefiniti
65
75
  tableUpdateEventAttachedOnce: boolean;
66
76
  iconTabBarFilterKey?: string;
67
77
  changeColumnActionId?: string;
78
+ changeToolbarContentAction?: { id: string; enabled: boolean };
68
79
  sectionInfo?: {
69
80
  section: ObjectPageSection;
70
81
  subSection: ObjectPageSubSection;
@@ -100,11 +111,18 @@ export abstract class TableQuickActionDefinitionBase extends QuickActionDefiniti
100
111
  if (this.options.includeServiceAction) {
101
112
  const actions = await this.context.actionService.get(table.getId());
102
113
  const actionsIds = await getActionId(table);
103
-
104
- const changeColumnAction = actionsIds.find(
114
+ const changeColumnActionId = actionsIds.find(
105
115
  (actionId) => actions.findIndex((action) => action.id === actionId) > -1
106
116
  );
107
- this.tableMap[tableMapKey].changeColumnActionId = changeColumnAction;
117
+ this.tableMap[tableMapKey].changeColumnActionId = changeColumnActionId;
118
+ const changeToolbarContentActionId = await getRearrangeToolbarContentActionId();
119
+ const changeToolbarContentAction = actions.find((action) => action.id === changeToolbarContentActionId);
120
+ this.tableMap[tableMapKey].changeToolbarContentAction = changeToolbarContentAction
121
+ ? {
122
+ id: changeToolbarContentAction.id,
123
+ enabled: changeToolbarContentAction.enabled
124
+ }
125
+ : undefined;
108
126
  }
109
127
  }
110
128