@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.
Files changed (107) hide show
  1. package/dist/client/adp/api-handler.js +142 -142
  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/AddFragment.controller.js +5 -6
  5. package/dist/client/adp/controllers/AddFragment.controller.ts +1 -2
  6. package/dist/client/adp/controllers/AddTableColumnFragments.controller.js +0 -1
  7. package/dist/client/adp/controllers/AddTableColumnFragments.controller.ts +0 -1
  8. package/dist/client/adp/controllers/BaseDialog.controller.js +187 -187
  9. package/dist/client/adp/controllers/BaseDialog.controller.ts +0 -4
  10. package/dist/client/adp/controllers/ControllerExtension.controller.js +213 -213
  11. package/dist/client/adp/controllers/ExtensionPoint.controller.js +138 -138
  12. package/dist/client/adp/dialog-factory.js +115 -0
  13. package/dist/client/adp/dialog-factory.ts +134 -0
  14. package/dist/client/adp/extension-point.js +6 -6
  15. package/dist/client/adp/extension-point.ts +2 -2
  16. package/dist/client/adp/init-dialogs.js +100 -157
  17. package/dist/client/adp/init-dialogs.ts +5 -77
  18. package/dist/client/adp/quick-actions/common/add-controller-to-page.js +55 -54
  19. package/dist/client/adp/quick-actions/common/add-controller-to-page.ts +5 -3
  20. package/dist/client/adp/quick-actions/common/create-page-action.js +50 -49
  21. package/dist/client/adp/quick-actions/common/create-page-action.ts +7 -4
  22. package/dist/client/adp/quick-actions/common/op-add-custom-section.js +36 -35
  23. package/dist/client/adp/quick-actions/common/op-add-custom-section.ts +6 -3
  24. package/dist/client/adp/quick-actions/common/op-add-header-field.js +48 -47
  25. package/dist/client/adp/quick-actions/common/op-add-header-field.ts +7 -4
  26. package/dist/client/adp/quick-actions/common/utils.js +20 -0
  27. package/dist/client/adp/quick-actions/common/utils.ts +7 -0
  28. package/dist/client/adp/quick-actions/control-types.js +23 -0
  29. package/dist/client/adp/quick-actions/control-types.ts +6 -0
  30. package/dist/client/adp/quick-actions/dialog-enablement-validator.js +26 -0
  31. package/dist/client/adp/quick-actions/dialog-enablement-validator.ts +18 -0
  32. package/dist/client/adp/quick-actions/enablement-validator.js +6 -0
  33. package/dist/client/adp/quick-actions/enablement-validator.ts +18 -0
  34. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +101 -100
  35. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.ts +11 -3
  36. package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +70 -69
  37. package/dist/client/adp/quick-actions/fe-v2/create-table-action.ts +6 -3
  38. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +96 -95
  39. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.ts +27 -21
  40. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +60 -56
  41. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.ts +8 -3
  42. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +77 -67
  43. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.ts +37 -16
  44. package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +57 -57
  45. package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +95 -0
  46. package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.ts +99 -0
  47. package/dist/client/adp/quick-actions/fe-v2/registry.js +72 -71
  48. package/dist/client/adp/quick-actions/fe-v2/registry.ts +3 -1
  49. package/dist/client/adp/quick-actions/fe-v2/utils.js +95 -86
  50. package/dist/client/adp/quick-actions/fe-v2/utils.ts +14 -4
  51. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +49 -47
  52. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.ts +5 -1
  53. package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +47 -45
  54. package/dist/client/adp/quick-actions/fe-v4/create-table-action.ts +17 -7
  55. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +46 -45
  56. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.ts +11 -12
  57. package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +55 -55
  58. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +82 -82
  59. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.ts +4 -4
  60. package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +52 -52
  61. package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +91 -0
  62. package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.ts +85 -0
  63. package/dist/client/adp/quick-actions/fe-v4/registry.js +56 -55
  64. package/dist/client/adp/quick-actions/fe-v4/registry.ts +3 -1
  65. package/dist/client/adp/quick-actions/fe-v4/table-quick-action-base.js +11 -17
  66. package/dist/client/adp/quick-actions/fe-v4/table-quick-action-base.ts +17 -18
  67. package/dist/client/adp/quick-actions/fe-v4/utils.js +47 -47
  68. package/dist/client/adp/quick-actions/load.js +44 -44
  69. package/dist/client/adp/quick-actions/quick-action-base.js +55 -0
  70. package/dist/client/adp/quick-actions/quick-action-base.ts +55 -0
  71. package/dist/client/adp/quick-actions/simple-quick-action-base.js +8 -13
  72. package/dist/client/adp/quick-actions/simple-quick-action-base.ts +10 -18
  73. package/dist/client/adp/quick-actions/table-quick-action-base.js +24 -29
  74. package/dist/client/adp/quick-actions/table-quick-action-base.ts +39 -28
  75. package/dist/client/adp/utils.js +160 -160
  76. package/dist/client/cpe/changes/index.js +10 -10
  77. package/dist/client/cpe/changes/service.js +30 -0
  78. package/dist/client/cpe/changes/service.ts +46 -0
  79. package/dist/client/cpe/changes/validator.js +34 -34
  80. package/dist/client/cpe/documentation.js +164 -164
  81. package/dist/client/cpe/feature-service.js +36 -36
  82. package/dist/client/cpe/logger.js +30 -30
  83. package/dist/client/cpe/outline/editable.js +37 -37
  84. package/dist/client/cpe/outline/nodes.js +217 -217
  85. package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
  86. package/dist/client/cpe/quick-actions/quick-action-definition.ts +5 -1
  87. package/dist/client/cpe/quick-actions/quick-action-service.js +10 -4
  88. package/dist/client/cpe/quick-actions/quick-action-service.ts +9 -3
  89. package/dist/client/cpe/quick-actions/registry.js +143 -143
  90. package/dist/client/cpe/quick-actions/utils.js +92 -92
  91. package/dist/client/cpe/types.js +4 -4
  92. package/dist/client/cpe/ui5-utils.js +33 -33
  93. package/dist/client/cpe/utils.js +138 -138
  94. package/dist/client/flp/WorkspaceConnector.js +86 -86
  95. package/dist/client/flp/common.js +28 -28
  96. package/dist/client/flp/enableFakeConnector.js +83 -83
  97. package/dist/client/flp/initConnectors.js +30 -30
  98. package/dist/client/flp/initRta.js +178 -178
  99. package/dist/client/i18n.js +56 -56
  100. package/dist/client/messagebundle.properties +5 -3
  101. package/dist/client/utils/application.js +32 -32
  102. package/dist/client/utils/core.js +68 -68
  103. package/dist/client/utils/error.js +19 -19
  104. package/dist/client/utils/fe-v4.js +118 -114
  105. package/dist/client/utils/fe-v4.ts +19 -11
  106. package/dist/client/utils/version.js +102 -102
  107. package/package.json +4 -4
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+
3
+ sap.ui.define(["../../../utils/fe-v4", "../../../utils/version", "../control-types", "../table-quick-action-base", "../../../utils/core", "../common/utils", "../fe-v2/create-table-custom-column"], function (_____utils_fe_v4, _____utils_version, ___control_types, ___table_quick_action_base, _____utils_core, ___common_utils, ___fe_v2_create_table_custom_column) {
4
+ "use strict";
5
+
6
+ const createManifestPropertyChange = _____utils_fe_v4["createManifestPropertyChange"];
7
+ const getUi5Version = _____utils_version["getUi5Version"];
8
+ const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
9
+ const ANALYTICAL_TABLE_TYPE = ___control_types["ANALYTICAL_TABLE_TYPE"];
10
+ const GRID_TABLE_TYPE = ___control_types["GRID_TABLE_TYPE"];
11
+ const MDC_TABLE_TYPE = ___control_types["MDC_TABLE_TYPE"];
12
+ const TREE_TABLE_TYPE = ___control_types["TREE_TABLE_TYPE"];
13
+ const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
14
+ const isA = _____utils_core["isA"];
15
+ const getTooltipsForTableEmptyRowModeAction = ___common_utils["getTooltipsForTableEmptyRowModeAction"];
16
+ const preprocessActionExecution = ___fe_v2_create_table_custom_column["preprocessActionExecution"];
17
+ const ENABLE_TABLE_EMPTY_ROW_MODE = 'enable-table-empty-row-mode';
18
+ const CONTROL_TYPES = [MDC_TABLE_TYPE, GRID_TABLE_TYPE, ANALYTICAL_TABLE_TYPE, TREE_TABLE_TYPE];
19
+ const UNSUPPORTED_TABLES = [ANALYTICAL_TABLE_TYPE, TREE_TABLE_TYPE];
20
+ const INLINE_CREATION_ROWS_MODE = 'InlineCreationRows';
21
+ /**
22
+ * Quick Action for enabling table filtering using table personalization settings.
23
+ */
24
+ class EnableTableEmptyRowModeQuickAction extends TableQuickActionDefinitionBase {
25
+ constructor(context) {
26
+ super(ENABLE_TABLE_EMPTY_ROW_MODE, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLE_EMPTY_ROW_MODE', context);
27
+ }
28
+ forceRefreshAfterExecution = true;
29
+ async initialize() {
30
+ const version = await getUi5Version();
31
+ if (isLowerThanMinimalUi5Version(version, {
32
+ major: 1,
33
+ minor: 131
34
+ })) {
35
+ this.isApplicable = false;
36
+ return;
37
+ }
38
+ const {
39
+ alreadyEnabledTooltip,
40
+ unsupportedCreationRowsTooltip
41
+ } = getTooltipsForTableEmptyRowModeAction(this.context.resourceBundle);
42
+ const processChild = (child, mapKey) => {
43
+ const table = this.tableMap[mapKey]?.table;
44
+ if (table) {
45
+ if (UNSUPPORTED_TABLES.some(t => isA(t, table))) {
46
+ child.enabled = false;
47
+ child.tooltip = unsupportedCreationRowsTooltip;
48
+ } else if (table.data('creationMode') === INLINE_CREATION_ROWS_MODE) {
49
+ child.enabled = false;
50
+ child.tooltip = alreadyEnabledTooltip;
51
+ }
52
+ }
53
+ child.children.forEach((nestedChild, idx) => processChild(nestedChild, `${mapKey}/${idx.toFixed(0)}`));
54
+ };
55
+ await super.initialize();
56
+
57
+ // disable nested actions based on conditions
58
+ this.children.forEach((nestedChild, idx) => processChild(nestedChild, `${idx.toFixed(0)}`));
59
+ }
60
+ async execute(path) {
61
+ const {
62
+ flexSettings
63
+ } = this.context;
64
+ const {
65
+ table,
66
+ sectionInfo,
67
+ iconTabBarFilterKey
68
+ } = this.tableMap[path];
69
+ if (!table) {
70
+ return [];
71
+ }
72
+ preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
73
+ this.selectOverlay(table);
74
+ const command = await createManifestPropertyChange(table, flexSettings, {
75
+ name: INLINE_CREATION_ROWS_MODE
76
+ }, ['creationMode']);
77
+ if (command) {
78
+ return [command];
79
+ } else {
80
+ return [];
81
+ }
82
+ }
83
+ }
84
+ var __exports = {
85
+ __esModule: true
86
+ };
87
+ __exports.ENABLE_TABLE_EMPTY_ROW_MODE = ENABLE_TABLE_EMPTY_ROW_MODE;
88
+ __exports.EnableTableEmptyRowModeQuickAction = EnableTableEmptyRowModeQuickAction;
89
+ return __exports;
90
+ });
91
+ //# sourceMappingURL=op-enable-empty-row-mode.js.map
@@ -0,0 +1,85 @@
1
+ import FlexCommand from 'sap/ui/rta/command/FlexCommand';
2
+
3
+ import { NestedQuickActionDefinition, QuickActionContext } from '../../../cpe/quick-actions/quick-action-definition';
4
+ import { createManifestPropertyChange } from '../../../utils/fe-v4';
5
+ import { getUi5Version, isLowerThanMinimalUi5Version } from '../../../utils/version';
6
+ import { ANALYTICAL_TABLE_TYPE, GRID_TABLE_TYPE, MDC_TABLE_TYPE, TREE_TABLE_TYPE } from '../control-types';
7
+ import { TableQuickActionDefinitionBase } from '../table-quick-action-base';
8
+ import { isA } from '../../../utils/core';
9
+ import { getTooltipsForTableEmptyRowModeAction } from '../common/utils';
10
+ import { NestedQuickActionChild } from '@sap-ux-private/control-property-editor-common';
11
+ import { preprocessActionExecution } from '../fe-v2/create-table-custom-column';
12
+
13
+ export const ENABLE_TABLE_EMPTY_ROW_MODE = 'enable-table-empty-row-mode';
14
+ const CONTROL_TYPES = [MDC_TABLE_TYPE, GRID_TABLE_TYPE, ANALYTICAL_TABLE_TYPE, TREE_TABLE_TYPE];
15
+ const UNSUPPORTED_TABLES = [ANALYTICAL_TABLE_TYPE, TREE_TABLE_TYPE];
16
+
17
+ const INLINE_CREATION_ROWS_MODE = 'InlineCreationRows';
18
+ /**
19
+ * Quick Action for enabling table filtering using table personalization settings.
20
+ */
21
+ export class EnableTableEmptyRowModeQuickAction
22
+ extends TableQuickActionDefinitionBase
23
+ implements NestedQuickActionDefinition
24
+ {
25
+ constructor(context: QuickActionContext) {
26
+ super(ENABLE_TABLE_EMPTY_ROW_MODE, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLE_EMPTY_ROW_MODE', context);
27
+ }
28
+ readonly forceRefreshAfterExecution = true;
29
+
30
+ async initialize(): Promise<void> {
31
+ const version = await getUi5Version();
32
+ if (isLowerThanMinimalUi5Version(version, { major: 1, minor: 131 })) {
33
+ this.isApplicable = false;
34
+ return;
35
+ }
36
+
37
+ const { alreadyEnabledTooltip, unsupportedCreationRowsTooltip } = getTooltipsForTableEmptyRowModeAction(
38
+ this.context.resourceBundle
39
+ );
40
+
41
+ const processChild = (child: NestedQuickActionChild, mapKey: string) => {
42
+ const table = this.tableMap[mapKey]?.table;
43
+ if (table) {
44
+ if (UNSUPPORTED_TABLES.some((t) => isA(t, table))) {
45
+ child.enabled = false;
46
+ child.tooltip = unsupportedCreationRowsTooltip;
47
+ } else if (table.data('creationMode') === INLINE_CREATION_ROWS_MODE) {
48
+ child.enabled = false;
49
+ child.tooltip = alreadyEnabledTooltip;
50
+ }
51
+ }
52
+ child.children.forEach((nestedChild, idx) => processChild(nestedChild, `${mapKey}/${idx.toFixed(0)}`));
53
+ };
54
+
55
+ await super.initialize();
56
+
57
+ // disable nested actions based on conditions
58
+ this.children.forEach((nestedChild, idx) => processChild(nestedChild, `${idx.toFixed(0)}`));
59
+ }
60
+
61
+ async execute(path: string): Promise<FlexCommand[]> {
62
+ const { flexSettings } = this.context;
63
+ const { table, sectionInfo, iconTabBarFilterKey } = this.tableMap[path];
64
+ if (!table) {
65
+ return [];
66
+ }
67
+
68
+ preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
69
+ this.selectOverlay(table);
70
+
71
+ const command = await createManifestPropertyChange(
72
+ table,
73
+ flexSettings,
74
+ {
75
+ name: INLINE_CREATION_ROWS_MODE
76
+ },
77
+ ['creationMode']
78
+ );
79
+ if (command) {
80
+ return [command];
81
+ } else {
82
+ return [];
83
+ }
84
+ }
85
+ }
@@ -1,57 +1,58 @@
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"], 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) {
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 LIST_REPORT_TYPE = 'sap.fe.templates.ListReport.ListReport';
18
- const OBJECT_PAGE_TYPE = 'sap.fe.templates.ObjectPage.ObjectPage';
19
-
20
- /**
21
- * Quick Action provider for SAP Fiori Elements V4 applications.
22
- */
23
- class FEV4QuickActionRegistry extends QuickActionDefinitionRegistry {
24
- PAGE_NAME_MAP = {
25
- [LIST_REPORT_TYPE]: 'listReport',
26
- [OBJECT_PAGE_TYPE]: 'objectPage'
27
- };
28
- getDefinitions(context) {
29
- const activePages = this.getActivePageContent(context.controlIndex);
30
- const definitionGroups = [];
31
- for (let index = 0; index < activePages.length; index++) {
32
- const {
33
- name,
34
- view
35
- } = activePages[index];
36
- if (name === 'listReport') {
37
- definitionGroups.push({
38
- title: 'LIST REPORT',
39
- definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, ToggleClearFilterBarQuickAction, ToggleSemanticDateRangeFilterBar, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction, EnableTableFilteringQuickAction],
40
- view,
41
- key: name + index
42
- });
43
- } else if (name === 'objectPage') {
44
- definitionGroups.push({
45
- title: 'OBJECT PAGE',
46
- definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, AddHeaderFieldQuickAction, AddCustomSectionQuickAction, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction],
47
- view,
48
- key: name + index
49
- });
50
- }
51
- }
52
- return definitionGroups;
53
- }
54
- }
55
- 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"], 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) {
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 LIST_REPORT_TYPE = 'sap.fe.templates.ListReport.ListReport';
19
+ const OBJECT_PAGE_TYPE = 'sap.fe.templates.ObjectPage.ObjectPage';
20
+
21
+ /**
22
+ * Quick Action provider for SAP Fiori Elements V4 applications.
23
+ */
24
+ class FEV4QuickActionRegistry extends QuickActionDefinitionRegistry {
25
+ PAGE_NAME_MAP = {
26
+ [LIST_REPORT_TYPE]: 'listReport',
27
+ [OBJECT_PAGE_TYPE]: 'objectPage'
28
+ };
29
+ getDefinitions(context) {
30
+ const activePages = this.getActivePageContent(context.controlIndex);
31
+ const definitionGroups = [];
32
+ for (let index = 0; index < activePages.length; index++) {
33
+ const {
34
+ name,
35
+ view
36
+ } = activePages[index];
37
+ if (name === 'listReport') {
38
+ definitionGroups.push({
39
+ title: 'LIST REPORT',
40
+ definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, ToggleClearFilterBarQuickAction, ToggleSemanticDateRangeFilterBar, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction, EnableTableFilteringQuickAction],
41
+ view,
42
+ key: name + index
43
+ });
44
+ } else if (name === 'objectPage') {
45
+ definitionGroups.push({
46
+ title: 'OBJECT PAGE',
47
+ definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, AddHeaderFieldQuickAction, AddCustomSectionQuickAction, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction, EnableTableEmptyRowModeQuickAction],
48
+ view,
49
+ key: name + index
50
+ });
51
+ }
52
+ }
53
+ return definitionGroups;
54
+ }
55
+ }
56
+ return FEV4QuickActionRegistry;
56
57
  });
57
58
  //# sourceMappingURL=registry.js.map
@@ -14,6 +14,7 @@ import { AddPageActionQuickAction } from '../common/create-page-action';
14
14
  import { AddTableActionQuickAction } from './create-table-action';
15
15
  import { EnableTableFilteringQuickAction } from './lr-enable-table-filtering';
16
16
  import { ToggleSemanticDateRangeFilterBar } from './lr-enable-semantic-date-range-filter-bar';
17
+ import { EnableTableEmptyRowModeQuickAction } from './op-enable-empty-row-mode';
17
18
 
18
19
  type PageName = 'listReport' | 'objectPage';
19
20
 
@@ -60,7 +61,8 @@ export default class FEV4QuickActionRegistry extends QuickActionDefinitionRegist
60
61
  AddCustomSectionQuickAction,
61
62
  ChangeTableColumnsQuickAction,
62
63
  AddTableActionQuickAction,
63
- AddTableCustomColumnQuickAction
64
+ AddTableCustomColumnQuickAction,
65
+ EnableTableEmptyRowModeQuickAction
64
66
  ],
65
67
  view,
66
68
  key: name + index
@@ -2,38 +2,32 @@
2
2
  sap.ui.define([
3
3
  'sap/ui/fl/apply/api/FlexRuntimeInfoAPI',
4
4
  'open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common',
5
- '../../../cpe/quick-actions/utils'
6
- ], function (FlexRuntimeInfoAPI, ___sap_ux_private_control_property_editor_common, _____cpe_quick_actions_utils) {
5
+ '../../../cpe/quick-actions/utils',
6
+ '../quick-action-base'
7
+ ], function (FlexRuntimeInfoAPI, ___sap_ux_private_control_property_editor_common, _____cpe_quick_actions_utils, ___quick_action_base) {
7
8
  'use strict';
8
9
  const NESTED_QUICK_ACTION_KIND = ___sap_ux_private_control_property_editor_common['NESTED_QUICK_ACTION_KIND'];
9
10
  const getRelevantControlFromActivePage = _____cpe_quick_actions_utils['getRelevantControlFromActivePage'];
11
+ const QuickActionDefinitionBase = ___quick_action_base['QuickActionDefinitionBase'];
10
12
  const ACTION_ID = 'CTX_SETTINGS0';
11
- const CONTROL_TYPE = 'sap.ui.mdc.Table';
12
- class TableQuickActionDefinitionBase {
13
- kind = NESTED_QUICK_ACTION_KIND;
14
- get id() {
15
- return `${ this.context.key }-${ this.type }`;
16
- }
17
- get textKey() {
18
- return this.defaultTextKey;
19
- }
13
+ class TableQuickActionDefinitionBase extends QuickActionDefinitionBase {
20
14
  isApplicable = false;
21
- isDisabled = false;
22
- get tooltip() {
23
- return undefined;
24
- }
25
15
  isClearButtonEnabled = false;
26
16
  children = [];
27
17
  tableMap = {};
28
- constructor(type, defaultTextKey, context, isSkipVariantManagementCheck) {
18
+ constructor(type, controlTypes, defaultTextKey, context, isSkipVariantManagementCheck) {
19
+ let enablementValidators = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : [];
20
+ super(type, NESTED_QUICK_ACTION_KIND, defaultTextKey, context, enablementValidators);
29
21
  this.type = type;
22
+ this.controlTypes = controlTypes;
30
23
  this.defaultTextKey = defaultTextKey;
31
24
  this.context = context;
32
25
  this.isSkipVariantManagementCheck = isSkipVariantManagementCheck;
26
+ this.enablementValidators = enablementValidators;
33
27
  }
34
28
  async initialize() {
35
29
  let index = 0;
36
- for (const smartTable of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, [CONTROL_TYPE])) {
30
+ for (const smartTable of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, this.controlTypes)) {
37
31
  if (!this.isSkipVariantManagementCheck) {
38
32
  const hasVariantManagement = FlexRuntimeInfoAPI.hasVariantManagement({ element: smartTable });
39
33
  if (!hasVariantManagement) {
@@ -6,38 +6,37 @@ import { NESTED_QUICK_ACTION_KIND } from '@sap-ux-private/control-property-edito
6
6
 
7
7
  import { QuickActionContext } from '../../../cpe/quick-actions/quick-action-definition';
8
8
  import { getRelevantControlFromActivePage } from '../../../cpe/quick-actions/utils';
9
+ import { EnablementValidator } from '../enablement-validator';
10
+ import { QuickActionDefinitionBase } from '../quick-action-base';
9
11
 
10
12
  const ACTION_ID = 'CTX_SETTINGS0';
11
- const CONTROL_TYPE = 'sap.ui.mdc.Table';
12
- export abstract class TableQuickActionDefinitionBase {
13
- readonly kind = NESTED_QUICK_ACTION_KIND;
14
- public get id(): string {
15
- return `${this.context.key}-${this.type}`;
16
- }
17
- protected get textKey(): string {
18
- return this.defaultTextKey;
19
- }
13
+
14
+ export abstract class TableQuickActionDefinitionBase extends QuickActionDefinitionBase<
15
+ typeof NESTED_QUICK_ACTION_KIND
16
+ > {
20
17
  isApplicable = false;
21
- protected isDisabled = false;
22
- public get tooltip(): string | undefined {
23
- return undefined;
24
- }
25
18
 
26
19
  isClearButtonEnabled = false;
27
20
  children: NestedQuickActionChild[] = [];
28
21
  tableMap: Record<string, number> = {};
29
22
  constructor(
30
23
  public readonly type: string,
24
+ protected readonly controlTypes: string[],
31
25
  protected readonly defaultTextKey: string,
32
26
  protected readonly context: QuickActionContext,
33
- protected readonly isSkipVariantManagementCheck?: boolean
34
- ) {}
27
+ protected readonly isSkipVariantManagementCheck?: boolean,
28
+ protected readonly enablementValidators: EnablementValidator[] = []
29
+ ) {
30
+ super(type, NESTED_QUICK_ACTION_KIND, defaultTextKey, context, enablementValidators);
31
+ }
35
32
 
36
33
  async initialize(): Promise<void> {
37
34
  let index = 0;
38
- for (const smartTable of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, [
39
- CONTROL_TYPE
40
- ])) {
35
+ for (const smartTable of getRelevantControlFromActivePage(
36
+ this.context.controlIndex,
37
+ this.context.view,
38
+ this.controlTypes
39
+ )) {
41
40
  if (!this.isSkipVariantManagementCheck) {
42
41
  const hasVariantManagement = FlexRuntimeInfoAPI.hasVariantManagement({ element: smartTable });
43
42
  if (!hasVariantManagement) {
@@ -1,49 +1,49 @@
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 getAppComponent = _____utils_fe_v4["getAppComponent"];
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: getAppComponent(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
- var __exports = {
44
- __esModule: true
45
- };
46
- __exports.executeToggleAction = executeToggleAction;
47
- 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 getAppComponent = _____utils_fe_v4["getAppComponent"];
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: getAppComponent(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
+ var __exports = {
44
+ __esModule: true
45
+ };
46
+ __exports.executeToggleAction = executeToggleAction;
47
+ return __exports;
48
48
  });
49
49
  //# 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