@sap-ux/preview-middleware 0.16.155 → 0.16.156

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 (79) 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 -5
  5. package/dist/client/adp/controllers/AddFragment.controller.ts +1 -1
  6. package/dist/client/adp/controllers/BaseDialog.controller.js +187 -187
  7. package/dist/client/adp/controllers/ControllerExtension.controller.js +213 -213
  8. package/dist/client/adp/controllers/ExtensionPoint.controller.js +138 -138
  9. package/dist/client/adp/init-dialogs.js +157 -157
  10. package/dist/client/adp/quick-actions/common/add-controller-to-page.js +54 -54
  11. package/dist/client/adp/quick-actions/common/create-page-action.js +49 -49
  12. package/dist/client/adp/quick-actions/common/op-add-custom-section.js +35 -35
  13. package/dist/client/adp/quick-actions/common/op-add-header-field.js +47 -47
  14. package/dist/client/adp/quick-actions/common/utils.js +20 -0
  15. package/dist/client/adp/quick-actions/common/utils.ts +7 -0
  16. package/dist/client/adp/quick-actions/control-types.js +23 -0
  17. package/dist/client/adp/quick-actions/control-types.ts +6 -0
  18. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +100 -100
  19. package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +69 -69
  20. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +95 -95
  21. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.ts +2 -8
  22. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +56 -56
  23. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +67 -67
  24. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.ts +1 -1
  25. package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +57 -57
  26. package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +95 -0
  27. package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.ts +99 -0
  28. package/dist/client/adp/quick-actions/fe-v2/registry.js +72 -71
  29. package/dist/client/adp/quick-actions/fe-v2/registry.ts +3 -1
  30. package/dist/client/adp/quick-actions/fe-v2/utils.js +95 -86
  31. package/dist/client/adp/quick-actions/fe-v2/utils.ts +14 -4
  32. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +48 -47
  33. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.ts +2 -1
  34. package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +46 -45
  35. package/dist/client/adp/quick-actions/fe-v4/create-table-action.ts +2 -1
  36. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +45 -45
  37. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.ts +3 -7
  38. package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +55 -55
  39. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +82 -82
  40. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.ts +4 -4
  41. package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +52 -52
  42. package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +91 -0
  43. package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.ts +85 -0
  44. package/dist/client/adp/quick-actions/fe-v4/registry.js +56 -55
  45. package/dist/client/adp/quick-actions/fe-v4/registry.ts +3 -1
  46. package/dist/client/adp/quick-actions/fe-v4/table-quick-action-base.js +3 -3
  47. package/dist/client/adp/quick-actions/fe-v4/table-quick-action-base.ts +7 -4
  48. package/dist/client/adp/quick-actions/fe-v4/utils.js +47 -47
  49. package/dist/client/adp/quick-actions/load.js +44 -44
  50. package/dist/client/adp/quick-actions/table-quick-action-base.js +18 -21
  51. package/dist/client/adp/quick-actions/table-quick-action-base.ts +29 -14
  52. package/dist/client/adp/utils.js +160 -160
  53. package/dist/client/cpe/changes/index.js +10 -10
  54. package/dist/client/cpe/changes/validator.js +34 -34
  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 +217 -217
  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 +138 -138
  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/initConnectors.js +30 -30
  70. package/dist/client/flp/initRta.js +178 -178
  71. package/dist/client/i18n.js +56 -56
  72. package/dist/client/messagebundle.properties +4 -3
  73. package/dist/client/utils/application.js +32 -32
  74. package/dist/client/utils/core.js +68 -68
  75. package/dist/client/utils/error.js +19 -19
  76. package/dist/client/utils/fe-v4.js +118 -114
  77. package/dist/client/utils/fe-v4.ts +19 -11
  78. package/dist/client/utils/version.js +102 -102
  79. package/package.json +3 -3
@@ -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
@@ -8,7 +8,6 @@ sap.ui.define([
8
8
  const NESTED_QUICK_ACTION_KIND = ___sap_ux_private_control_property_editor_common['NESTED_QUICK_ACTION_KIND'];
9
9
  const getRelevantControlFromActivePage = _____cpe_quick_actions_utils['getRelevantControlFromActivePage'];
10
10
  const ACTION_ID = 'CTX_SETTINGS0';
11
- const CONTROL_TYPE = 'sap.ui.mdc.Table';
12
11
  class TableQuickActionDefinitionBase {
13
12
  kind = NESTED_QUICK_ACTION_KIND;
14
13
  get id() {
@@ -25,15 +24,16 @@ sap.ui.define([
25
24
  isClearButtonEnabled = false;
26
25
  children = [];
27
26
  tableMap = {};
28
- constructor(type, defaultTextKey, context, isSkipVariantManagementCheck) {
27
+ constructor(type, controlTypes, defaultTextKey, context, isSkipVariantManagementCheck) {
29
28
  this.type = type;
29
+ this.controlTypes = controlTypes;
30
30
  this.defaultTextKey = defaultTextKey;
31
31
  this.context = context;
32
32
  this.isSkipVariantManagementCheck = isSkipVariantManagementCheck;
33
33
  }
34
34
  async initialize() {
35
35
  let index = 0;
36
- for (const smartTable of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, [CONTROL_TYPE])) {
36
+ for (const smartTable of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, this.controlTypes)) {
37
37
  if (!this.isSkipVariantManagementCheck) {
38
38
  const hasVariantManagement = FlexRuntimeInfoAPI.hasVariantManagement({ element: smartTable });
39
39
  if (!hasVariantManagement) {
@@ -8,7 +8,7 @@ import { QuickActionContext } from '../../../cpe/quick-actions/quick-action-defi
8
8
  import { getRelevantControlFromActivePage } from '../../../cpe/quick-actions/utils';
9
9
 
10
10
  const ACTION_ID = 'CTX_SETTINGS0';
11
- const CONTROL_TYPE = 'sap.ui.mdc.Table';
11
+
12
12
  export abstract class TableQuickActionDefinitionBase {
13
13
  readonly kind = NESTED_QUICK_ACTION_KIND;
14
14
  public get id(): string {
@@ -28,6 +28,7 @@ export abstract class TableQuickActionDefinitionBase {
28
28
  tableMap: Record<string, number> = {};
29
29
  constructor(
30
30
  public readonly type: string,
31
+ protected readonly controlTypes: string[],
31
32
  protected readonly defaultTextKey: string,
32
33
  protected readonly context: QuickActionContext,
33
34
  protected readonly isSkipVariantManagementCheck?: boolean
@@ -35,9 +36,11 @@ export abstract class TableQuickActionDefinitionBase {
35
36
 
36
37
  async initialize(): Promise<void> {
37
38
  let index = 0;
38
- for (const smartTable of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, [
39
- CONTROL_TYPE
40
- ])) {
39
+ for (const smartTable of getRelevantControlFromActivePage(
40
+ this.context.controlIndex,
41
+ this.context.view,
42
+ this.controlTypes
43
+ )) {
41
44
  if (!this.isSkipVariantManagementCheck) {
42
45
  const hasVariantManagement = FlexRuntimeInfoAPI.hasVariantManagement({ element: smartTable });
43
46
  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
@@ -4,8 +4,9 @@ sap.ui.define([
4
4
  'sap/ui/dt/OverlayUtil',
5
5
  '../../cpe/quick-actions/utils',
6
6
  '../../utils/core',
7
- '../../utils/version'
8
- ], function (___sap_ux_private_control_property_editor_common, OverlayUtil, ____cpe_quick_actions_utils, ____utils_core, ____utils_version) {
7
+ '../../utils/version',
8
+ './control-types'
9
+ ], function (___sap_ux_private_control_property_editor_common, OverlayUtil, ____cpe_quick_actions_utils, ____utils_core, ____utils_version, ___control_types) {
9
10
  'use strict';
10
11
  const NESTED_QUICK_ACTION_KIND = ___sap_ux_private_control_property_editor_common['NESTED_QUICK_ACTION_KIND'];
11
12
  const getParentContainer = ____cpe_quick_actions_utils['getParentContainer'];
@@ -15,16 +16,16 @@ sap.ui.define([
15
16
  const isManagedObject = ____utils_core['isManagedObject'];
16
17
  const getUi5Version = ____utils_version['getUi5Version'];
17
18
  const isLowerThanMinimalUi5Version = ____utils_version['isLowerThanMinimalUi5Version'];
19
+ const ANALYTICAL_TABLE_TYPE = ___control_types['ANALYTICAL_TABLE_TYPE'];
20
+ const GRID_TABLE_TYPE = ___control_types['GRID_TABLE_TYPE'];
21
+ const M_TABLE_TYPE = ___control_types['M_TABLE_TYPE'];
22
+ const MDC_TABLE_TYPE = ___control_types['MDC_TABLE_TYPE'];
23
+ const SMART_TABLE_TYPE = ___control_types['SMART_TABLE_TYPE'];
24
+ const TREE_TABLE_TYPE = ___control_types['TREE_TABLE_TYPE'];
18
25
  const SMART_TABLE_ACTION_ID = 'CTX_COMP_VARIANT_CONTENT';
19
26
  const M_TABLE_ACTION_ID = 'CTX_ADD_ELEMENTS_AS_CHILD';
20
27
  const SETTINGS_ID = 'CTX_SETTINGS';
21
28
  const ICON_TAB_BAR_TYPE = 'sap.m.IconTabBar';
22
- const SMART_TABLE_TYPE = 'sap.ui.comp.smarttable.SmartTable';
23
- const M_TABLE_TYPE = 'sap.m.Table';
24
- const MDC_TABLE_TYPE = 'sap.ui.mdc.Table';
25
- const TREE_TABLE_TYPE = 'sap.ui.table.TreeTable';
26
- const GRID_TABLE_TYPE = 'sap.ui.table.Table';
27
- const ANALYTICAL_TABLE_TYPE = 'sap.ui.table.AnalyticalTable';
28
29
  async function getActionId(table) {
29
30
  const {major, minor} = await getUi5Version();
30
31
  if (isA(SMART_TABLE_TYPE, table)) {
@@ -160,20 +161,20 @@ sap.ui.define([
160
161
  layout
161
162
  });
162
163
  } else if (subSections.length > 1) {
163
- const sectionChild = this.children.find(val => val.label === `${ section.getTitle() } section`);
164
- let tableMapIndex = `${ this.children.length - 1 }`;
164
+ const existingChildIdx = this.children.findIndex(val => val.label === `'${ section.getTitle() }' section`);
165
+ let tableMapIndex;
165
166
  const label = this.getTableLabel(table);
166
167
  const child = this.createChild(label, table);
167
- if (!sectionChild) {
168
- tableMapIndex = `${ tableMapIndex }/0`;
168
+ if (existingChildIdx < 0) {
169
169
  this.children.push({
170
170
  label: `'${ section?.getTitle() }' section`,
171
171
  enabled: true,
172
172
  children: [child]
173
173
  });
174
+ tableMapIndex = `${ this.children.length - 1 }/0`;
174
175
  } else {
175
- tableMapIndex = `${ tableMapIndex }/${ sectionChild.children.length - 1 }`;
176
- sectionChild.children.push(child);
176
+ this.children[existingChildIdx].children.push(child);
177
+ tableMapIndex = `${ existingChildIdx.toFixed(0) }/${ this.children[existingChildIdx].children.length - 1 }`;
177
178
  }
178
179
  this.tableMap[tableMapIndex] = {
179
180
  table,
@@ -192,7 +193,9 @@ sap.ui.define([
192
193
  SMART_TABLE_TYPE,
193
194
  M_TABLE_TYPE,
194
195
  MDC_TABLE_TYPE,
195
- TREE_TABLE_TYPE
196
+ TREE_TABLE_TYPE,
197
+ GRID_TABLE_TYPE,
198
+ ANALYTICAL_TABLE_TYPE
196
199
  ].some(type => isA(type, table))) {
197
200
  const label = this.getTableLabel(table);
198
201
  const child = this.createChild(label, table);
@@ -239,12 +242,6 @@ sap.ui.define([
239
242
  }
240
243
  }
241
244
  var __exports = { __esModule: true };
242
- __exports.SMART_TABLE_TYPE = SMART_TABLE_TYPE;
243
- __exports.M_TABLE_TYPE = M_TABLE_TYPE;
244
- __exports.MDC_TABLE_TYPE = MDC_TABLE_TYPE;
245
- __exports.TREE_TABLE_TYPE = TREE_TABLE_TYPE;
246
- __exports.GRID_TABLE_TYPE = GRID_TABLE_TYPE;
247
- __exports.ANALYTICAL_TABLE_TYPE = ANALYTICAL_TABLE_TYPE;
248
245
  __exports.TableQuickActionDefinitionBase = TableQuickActionDefinitionBase;
249
246
  return __exports;
250
247
  });
@@ -15,17 +15,19 @@ import ObjectPageSection from 'sap/uxap/ObjectPageSection';
15
15
  import ObjectPageSubSection from 'sap/uxap/ObjectPageSubSection';
16
16
  import ObjectPageLayout from 'sap/uxap/ObjectPageLayout';
17
17
  import ManagedObject from 'sap/ui/base/ManagedObject';
18
+ import {
19
+ ANALYTICAL_TABLE_TYPE,
20
+ GRID_TABLE_TYPE,
21
+ M_TABLE_TYPE,
22
+ MDC_TABLE_TYPE,
23
+ SMART_TABLE_TYPE,
24
+ TREE_TABLE_TYPE
25
+ } from './control-types';
18
26
 
19
27
  const SMART_TABLE_ACTION_ID = 'CTX_COMP_VARIANT_CONTENT';
20
28
  const M_TABLE_ACTION_ID = 'CTX_ADD_ELEMENTS_AS_CHILD';
21
29
  const SETTINGS_ID = 'CTX_SETTINGS';
22
30
  const ICON_TAB_BAR_TYPE = 'sap.m.IconTabBar';
23
- export const SMART_TABLE_TYPE = 'sap.ui.comp.smarttable.SmartTable';
24
- export const M_TABLE_TYPE = 'sap.m.Table';
25
- export const MDC_TABLE_TYPE = 'sap.ui.mdc.Table';
26
- export const TREE_TABLE_TYPE = 'sap.ui.table.TreeTable';
27
- export const GRID_TABLE_TYPE = 'sap.ui.table.Table';
28
- export const ANALYTICAL_TABLE_TYPE = 'sap.ui.table.AnalyticalTable';
29
31
 
30
32
  async function getActionId(table: UI5Element): Promise<string[]> {
31
33
  const { major, minor } = await getUi5Version();
@@ -229,21 +231,25 @@ export abstract class TableQuickActionDefinitionBase {
229
231
  if (subSections?.length === 1) {
230
232
  this.processTable(table, { section, subSection: subSections[0], layout });
231
233
  } else if (subSections.length > 1) {
232
- const sectionChild = this.children.find((val) => val.label === `${section.getTitle()} section`);
233
- let tableMapIndex = `${this.children.length - 1}`;
234
+ const existingChildIdx = this.children.findIndex(
235
+ (val) => val.label === `'${section.getTitle()}' section`
236
+ );
237
+ let tableMapIndex;
234
238
  const label = this.getTableLabel(table);
235
239
  const child = this.createChild(label, table);
236
- if (!sectionChild) {
237
- tableMapIndex = `${tableMapIndex}/0`;
238
-
240
+ if (existingChildIdx < 0) {
239
241
  this.children.push({
240
242
  label: `'${section?.getTitle()}' section`,
241
243
  enabled: true,
242
244
  children: [child]
243
245
  });
246
+
247
+ tableMapIndex = `${this.children.length - 1}/0`;
244
248
  } else {
245
- tableMapIndex = `${tableMapIndex}/${sectionChild.children.length - 1}`;
246
- sectionChild.children.push(child);
249
+ this.children[existingChildIdx].children.push(child);
250
+ tableMapIndex = `${existingChildIdx.toFixed(0)}/${
251
+ this.children[existingChildIdx].children.length - 1
252
+ }`;
247
253
  }
248
254
 
249
255
  this.tableMap[tableMapIndex] = {
@@ -264,7 +270,16 @@ export abstract class TableQuickActionDefinitionBase {
264
270
  table: UI5Element,
265
271
  sectionInfo?: { section: ObjectPageSection; subSection: ObjectPageSubSection; layout?: ObjectPageLayout }
266
272
  ): void {
267
- if ([SMART_TABLE_TYPE, M_TABLE_TYPE, MDC_TABLE_TYPE, TREE_TABLE_TYPE].some((type) => isA(type, table))) {
273
+ if (
274
+ [
275
+ SMART_TABLE_TYPE,
276
+ M_TABLE_TYPE,
277
+ MDC_TABLE_TYPE,
278
+ TREE_TABLE_TYPE,
279
+ GRID_TABLE_TYPE,
280
+ ANALYTICAL_TABLE_TYPE
281
+ ].some((type) => isA(type, table))
282
+ ) {
268
283
  const label = this.getTableLabel(table);
269
284
  const child = this.createChild(label, table);
270
285
  this.children.push(child);