@sap-ux/preview-middleware 0.19.19 → 0.19.21

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 (75) 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 -23
  16. package/dist/client/adp/quick-actions/dialog-enablement-validator.js +24 -24
  17. package/dist/client/adp/quick-actions/enablement-validator.js +4 -4
  18. package/dist/client/adp/quick-actions/fe-v2/add-new-subpage.js +81 -81
  19. package/dist/client/adp/quick-actions/fe-v2/change-table-actions.js +67 -67
  20. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +101 -101
  21. package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +107 -107
  22. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +99 -99
  23. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +78 -78
  24. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +77 -77
  25. package/dist/client/adp/quick-actions/fe-v2/lr-enable-variant-management.js +69 -69
  26. package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +59 -59
  27. package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +93 -93
  28. package/dist/client/adp/quick-actions/fe-v2/op-enable-variant-management.js +84 -84
  29. package/dist/client/adp/quick-actions/fe-v2/registry.js +77 -77
  30. package/dist/client/adp/quick-actions/fe-v2/utils.js +116 -116
  31. package/dist/client/adp/quick-actions/fe-v4/add-new-subpage.js +138 -138
  32. package/dist/client/adp/quick-actions/fe-v4/change-table-actions.js +79 -79
  33. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +73 -73
  34. package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +53 -53
  35. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +49 -49
  36. package/dist/client/adp/quick-actions/fe-v4/enable-variant-management.js +81 -81
  37. package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +56 -56
  38. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +82 -82
  39. package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +53 -53
  40. package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +89 -89
  41. package/dist/client/adp/quick-actions/fe-v4/registry.js +60 -60
  42. package/dist/client/adp/quick-actions/fe-v4/utils.js +72 -72
  43. package/dist/client/adp/quick-actions/load.js +44 -44
  44. package/dist/client/adp/quick-actions/quick-action-base.js +64 -64
  45. package/dist/client/adp/utils.js +218 -218
  46. package/dist/client/cpe/changes/index.js +10 -10
  47. package/dist/client/cpe/changes/validator.js +39 -39
  48. package/dist/client/cpe/context-menu-service.js +20 -2
  49. package/dist/client/cpe/context-menu-service.ts +16 -0
  50. package/dist/client/cpe/documentation.js +164 -164
  51. package/dist/client/cpe/feature-service.js +36 -36
  52. package/dist/client/cpe/logger.js +30 -30
  53. package/dist/client/cpe/outline/editable.js +37 -37
  54. package/dist/client/cpe/outline/nodes.js +203 -203
  55. package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
  56. package/dist/client/cpe/quick-actions/registry.js +143 -143
  57. package/dist/client/cpe/quick-actions/utils.js +92 -92
  58. package/dist/client/cpe/types.js +4 -4
  59. package/dist/client/cpe/ui5-utils.js +33 -33
  60. package/dist/client/cpe/utils.js +111 -111
  61. package/dist/client/flp/WorkspaceConnector.js +86 -86
  62. package/dist/client/flp/common.js +28 -28
  63. package/dist/client/flp/enableFakeConnector.js +83 -83
  64. package/dist/client/flp/homepage/Component.js +14 -14
  65. package/dist/client/flp/initCdm.js +117 -117
  66. package/dist/client/flp/initConnectors.js +28 -28
  67. package/dist/client/flp/initRta.js +178 -178
  68. package/dist/client/i18n.js +56 -56
  69. package/dist/client/utils/application.js +32 -32
  70. package/dist/client/utils/core.js +84 -84
  71. package/dist/client/utils/error.js +19 -19
  72. package/dist/client/utils/fe-v2.js +56 -56
  73. package/dist/client/utils/fe-v4.js +140 -140
  74. package/dist/client/utils/version.js +104 -104
  75. package/package.json +3 -3
@@ -1,69 +1,69 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../dialog-factory", "../../../utils/core", "../simple-quick-action-base", "../dialog-enablement-validator", "../../../i18n"], function (OverlayRegistry, ____dialog_factory, _____utils_core, ___simple_quick_action_base, ___dialog_enablement_validator, _____i18n) {
4
- "use strict";
5
-
6
- const DialogFactory = ____dialog_factory["DialogFactory"];
7
- const DialogNames = ____dialog_factory["DialogNames"];
8
- const isA = _____utils_core["isA"];
9
- const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
10
- const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
11
- const getTextBundle = _____i18n["getTextBundle"];
12
- const OP_ADD_HEADER_FIELD_TYPE = 'op-add-header-field';
13
- const CONTROL_TYPES = ['sap.uxap.ObjectPageLayout'];
14
-
15
- /**
16
- * Quick Action for adding a Header Field to an Object Page.
17
- */
18
- class AddHeaderFieldQuickAction extends SimpleQuickActionDefinitionBase {
19
- constructor(context) {
20
- super(OP_ADD_HEADER_FIELD_TYPE, CONTROL_TYPES, 'QUICK_ACTION_OP_ADD_HEADER_FIELD', context, [DIALOG_ENABLEMENT_VALIDATOR, {
21
- run: async () => {
22
- const i18n = await getTextBundle();
23
- if (!this.control?.getShowHeaderContent()) {
24
- return {
25
- type: 'error',
26
- message: i18n.getText('DISABLE_SHOW_HEADER_CONTENT')
27
- };
28
- }
29
- return undefined;
30
- }
31
- }]);
32
- }
33
- async execute() {
34
- if (!this.control) {
35
- return [];
36
- }
37
- const headerContent = this.control.getHeaderContent();
38
-
39
- // check if only flex box exist in the headerContent.
40
- if (headerContent.length === 1 && isA('sap.m.FlexBox', headerContent[0])) {
41
- const overlay = OverlayRegistry.getOverlay(headerContent[0]) || [];
42
- await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
43
- aggregation: 'items',
44
- title: 'QUICK_ACTION_OP_ADD_HEADER_FIELD'
45
- }, {
46
- actionName: this.type,
47
- telemetryEventIdentifier: this.getTelemetryIdentifier()
48
- });
49
- } else if (this.control) {
50
- const overlay = OverlayRegistry.getOverlay(this.control) || [];
51
- await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
52
- aggregation: 'headerContent',
53
- title: 'QUICK_ACTION_OP_ADD_HEADER_FIELD'
54
- }, {
55
- actionName: this.type,
56
- telemetryEventIdentifier: this.getTelemetryIdentifier()
57
- });
58
- }
59
- return [];
60
- }
61
- }
62
- var __exports = {
63
- __esModule: true
64
- };
65
- __exports.OP_ADD_HEADER_FIELD_TYPE = OP_ADD_HEADER_FIELD_TYPE;
66
- __exports.AddHeaderFieldQuickAction = AddHeaderFieldQuickAction;
67
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../dialog-factory", "../../../utils/core", "../simple-quick-action-base", "../dialog-enablement-validator", "../../../i18n"], function (OverlayRegistry, ____dialog_factory, _____utils_core, ___simple_quick_action_base, ___dialog_enablement_validator, _____i18n) {
4
+ "use strict";
5
+
6
+ const DialogFactory = ____dialog_factory["DialogFactory"];
7
+ const DialogNames = ____dialog_factory["DialogNames"];
8
+ const isA = _____utils_core["isA"];
9
+ const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
10
+ const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
11
+ const getTextBundle = _____i18n["getTextBundle"];
12
+ const OP_ADD_HEADER_FIELD_TYPE = 'op-add-header-field';
13
+ const CONTROL_TYPES = ['sap.uxap.ObjectPageLayout'];
14
+
15
+ /**
16
+ * Quick Action for adding a Header Field to an Object Page.
17
+ */
18
+ class AddHeaderFieldQuickAction extends SimpleQuickActionDefinitionBase {
19
+ constructor(context) {
20
+ super(OP_ADD_HEADER_FIELD_TYPE, CONTROL_TYPES, 'QUICK_ACTION_OP_ADD_HEADER_FIELD', context, [DIALOG_ENABLEMENT_VALIDATOR, {
21
+ run: async () => {
22
+ const i18n = await getTextBundle();
23
+ if (!this.control?.getShowHeaderContent()) {
24
+ return {
25
+ type: 'error',
26
+ message: i18n.getText('DISABLE_SHOW_HEADER_CONTENT')
27
+ };
28
+ }
29
+ return undefined;
30
+ }
31
+ }]);
32
+ }
33
+ async execute() {
34
+ if (!this.control) {
35
+ return [];
36
+ }
37
+ const headerContent = this.control.getHeaderContent();
38
+
39
+ // check if only flex box exist in the headerContent.
40
+ if (headerContent.length === 1 && isA('sap.m.FlexBox', headerContent[0])) {
41
+ const overlay = OverlayRegistry.getOverlay(headerContent[0]) || [];
42
+ await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
43
+ aggregation: 'items',
44
+ title: 'QUICK_ACTION_OP_ADD_HEADER_FIELD'
45
+ }, {
46
+ actionName: this.type,
47
+ telemetryEventIdentifier: this.getTelemetryIdentifier()
48
+ });
49
+ } else if (this.control) {
50
+ const overlay = OverlayRegistry.getOverlay(this.control) || [];
51
+ await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
52
+ aggregation: 'headerContent',
53
+ title: 'QUICK_ACTION_OP_ADD_HEADER_FIELD'
54
+ }, {
55
+ actionName: this.type,
56
+ telemetryEventIdentifier: this.getTelemetryIdentifier()
57
+ });
58
+ }
59
+ return [];
60
+ }
61
+ }
62
+ var __exports = {
63
+ __esModule: true
64
+ };
65
+ __exports.OP_ADD_HEADER_FIELD_TYPE = OP_ADD_HEADER_FIELD_TYPE;
66
+ __exports.AddHeaderFieldQuickAction = AddHeaderFieldQuickAction;
67
+ return __exports;
68
68
  });
69
69
  //# sourceMappingURL=op-add-header-field.js.map
@@ -1,20 +1,20 @@
1
- "use strict";
2
-
3
- sap.ui.define([], function () {
4
- "use strict";
5
-
6
- function getTooltipsForTableEmptyRowModeAction(resourceBundle) {
7
- const alreadyEnabledTooltip = resourceBundle.getText('EMPTY_ROW_MODE_IS_ALREADY_ENABLED');
8
- const unsupportedCreationRowsTooltip = resourceBundle.getText('EMPTY_ROW_MODE_IS_NOT_SUPPORTED');
9
- return {
10
- alreadyEnabledTooltip,
11
- unsupportedCreationRowsTooltip
12
- };
13
- }
14
- var __exports = {
15
- __esModule: true
16
- };
17
- __exports.getTooltipsForTableEmptyRowModeAction = getTooltipsForTableEmptyRowModeAction;
18
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define([], function () {
4
+ "use strict";
5
+
6
+ function getTooltipsForTableEmptyRowModeAction(resourceBundle) {
7
+ const alreadyEnabledTooltip = resourceBundle.getText('EMPTY_ROW_MODE_IS_ALREADY_ENABLED');
8
+ const unsupportedCreationRowsTooltip = resourceBundle.getText('EMPTY_ROW_MODE_IS_NOT_SUPPORTED');
9
+ return {
10
+ alreadyEnabledTooltip,
11
+ unsupportedCreationRowsTooltip
12
+ };
13
+ }
14
+ var __exports = {
15
+ __esModule: true
16
+ };
17
+ __exports.getTooltipsForTableEmptyRowModeAction = getTooltipsForTableEmptyRowModeAction;
18
+ return __exports;
19
19
  });
20
20
  //# sourceMappingURL=utils.js.map
@@ -1,25 +1,25 @@
1
- "use strict";
2
-
3
- sap.ui.define([], function () {
4
- "use strict";
5
-
6
- const SMART_TABLE_TYPE = 'sap.ui.comp.smarttable.SmartTable';
7
- const M_TABLE_TYPE = 'sap.m.Table';
8
- const MDC_TABLE_TYPE = 'sap.ui.mdc.Table';
9
- const TREE_TABLE_TYPE = 'sap.ui.table.TreeTable';
10
- const GRID_TABLE_TYPE = 'sap.ui.table.Table';
11
- const ANALYTICAL_TABLE_TYPE = 'sap.ui.table.AnalyticalTable';
12
- const MDC_ACTION_TOOLBAR_TYPE = 'sap.ui.mdc.ActionToolbar';
13
- var __exports = {
14
- __esModule: true
15
- };
16
- __exports.SMART_TABLE_TYPE = SMART_TABLE_TYPE;
17
- __exports.M_TABLE_TYPE = M_TABLE_TYPE;
18
- __exports.MDC_TABLE_TYPE = MDC_TABLE_TYPE;
19
- __exports.TREE_TABLE_TYPE = TREE_TABLE_TYPE;
20
- __exports.GRID_TABLE_TYPE = GRID_TABLE_TYPE;
21
- __exports.ANALYTICAL_TABLE_TYPE = ANALYTICAL_TABLE_TYPE;
22
- __exports.MDC_ACTION_TOOLBAR_TYPE = MDC_ACTION_TOOLBAR_TYPE;
23
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define([], function () {
4
+ "use strict";
5
+
6
+ const SMART_TABLE_TYPE = 'sap.ui.comp.smarttable.SmartTable';
7
+ const M_TABLE_TYPE = 'sap.m.Table';
8
+ const MDC_TABLE_TYPE = 'sap.ui.mdc.Table';
9
+ const TREE_TABLE_TYPE = 'sap.ui.table.TreeTable';
10
+ const GRID_TABLE_TYPE = 'sap.ui.table.Table';
11
+ const ANALYTICAL_TABLE_TYPE = 'sap.ui.table.AnalyticalTable';
12
+ const MDC_ACTION_TOOLBAR_TYPE = 'sap.ui.mdc.ActionToolbar';
13
+ var __exports = {
14
+ __esModule: true
15
+ };
16
+ __exports.SMART_TABLE_TYPE = SMART_TABLE_TYPE;
17
+ __exports.M_TABLE_TYPE = M_TABLE_TYPE;
18
+ __exports.MDC_TABLE_TYPE = MDC_TABLE_TYPE;
19
+ __exports.TREE_TABLE_TYPE = TREE_TABLE_TYPE;
20
+ __exports.GRID_TABLE_TYPE = GRID_TABLE_TYPE;
21
+ __exports.ANALYTICAL_TABLE_TYPE = ANALYTICAL_TABLE_TYPE;
22
+ __exports.MDC_ACTION_TOOLBAR_TYPE = MDC_ACTION_TOOLBAR_TYPE;
23
+ return __exports;
24
24
  });
25
25
  //# sourceMappingURL=control-types.js.map
@@ -1,26 +1,26 @@
1
- "use strict";
2
-
3
- sap.ui.define(["../../i18n", "../dialog-factory"], function (____i18n, ___dialog_factory) {
4
- "use strict";
5
-
6
- const getTextBundle = ____i18n["getTextBundle"];
7
- const DialogFactory = ___dialog_factory["DialogFactory"];
8
- const DIALOG_ENABLEMENT_VALIDATOR = {
9
- run: async () => {
10
- const i18n = await getTextBundle();
11
- if (!DialogFactory.canOpenDialog) {
12
- return {
13
- type: 'error',
14
- message: i18n.getText('ADP_QUICK_ACTION_DIALOG_OPEN_MESSAGE')
15
- };
16
- }
17
- return undefined;
18
- }
19
- };
20
- var __exports = {
21
- __esModule: true
22
- };
23
- __exports.DIALOG_ENABLEMENT_VALIDATOR = DIALOG_ENABLEMENT_VALIDATOR;
24
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["../../i18n", "../dialog-factory"], function (____i18n, ___dialog_factory) {
4
+ "use strict";
5
+
6
+ const getTextBundle = ____i18n["getTextBundle"];
7
+ const DialogFactory = ___dialog_factory["DialogFactory"];
8
+ const DIALOG_ENABLEMENT_VALIDATOR = {
9
+ run: async () => {
10
+ const i18n = await getTextBundle();
11
+ if (!DialogFactory.canOpenDialog) {
12
+ return {
13
+ type: 'error',
14
+ message: i18n.getText('ADP_QUICK_ACTION_DIALOG_OPEN_MESSAGE')
15
+ };
16
+ }
17
+ return undefined;
18
+ }
19
+ };
20
+ var __exports = {
21
+ __esModule: true
22
+ };
23
+ __exports.DIALOG_ENABLEMENT_VALIDATOR = DIALOG_ENABLEMENT_VALIDATOR;
24
+ return __exports;
25
25
  });
26
26
  //# sourceMappingURL=dialog-enablement-validator.js.map
@@ -1,6 +1,6 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
5
  });
6
6
  //# sourceMappingURL=enablement-validator.js.map
@@ -1,83 +1,83 @@
1
- "use strict";
2
-
3
- sap.ui.define(["../../../utils/fe-v2", "../add-new-subpage-quick-action-base", "../../../utils/core", "./utils"], function (_____utils_fe_v2, ___add_new_subpage_quick_action_base, _____utils_core, ___utils) {
4
- "use strict";
5
-
6
- const getV2ApplicationPages = _____utils_fe_v2["getV2ApplicationPages"];
7
- const AddNewSubpageBase = ___add_new_subpage_quick_action_base["AddNewSubpageBase"];
8
- const isA = _____utils_core["isA"];
9
- const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
10
- const getV2AppComponent = ___utils["getV2AppComponent"];
11
- const OBJECT_PAGE_COMPONENT_NAME_V2 = 'sap.suite.ui.generic.template.ObjectPage';
12
-
13
- /**
14
- * Quick Action for adding a custom page action.
15
- */
16
- class AddNewSubpage extends AddNewSubpageBase {
17
- get currentPageDescriptor() {
18
- if (!this.entitySet) {
19
- throw new Error('entitySet is not defined');
20
- }
21
- if (!this.pageType) {
22
- throw new Error('pageType is not defined');
23
- }
24
- if (!this.appComponent) {
25
- throw new Error('appComponent is not defined');
26
- }
27
- return {
28
- appType: 'fe-v2',
29
- appComponent: this.appComponent,
30
- entitySet: this.entitySet,
31
- pageType: this.pageType
32
- };
33
- }
34
- getApplicationPages() {
35
- return getV2ApplicationPages(this.context.manifest);
36
- }
37
- isPageExists(targetEntitySet) {
38
- return this.existingPages.some(page => page.entitySet === targetEntitySet);
39
- }
40
- isCurrentObjectPage() {
41
- return this.pageType === OBJECT_PAGE_COMPONENT_NAME_V2;
42
- }
43
- getODataMetaModel() {
44
- return this.context.rta.getRootControlInstance().getModel()?.getMetaModel();
45
- }
46
- getEntitySetNameFromPageComponent(component) {
47
- if (!isA('sap.suite.ui.generic.template.lib.TemplateComponent', component)) {
48
- throw new Error('Unexpected type of page owner component');
49
- }
50
- return Promise.resolve(component.getEntitySet());
51
- }
52
- async prepareNavigationData(metaModel) {
53
- const entitySet = metaModel.getODataEntitySet(this.entitySet);
54
- const entityType = metaModel.getODataEntityType(entitySet.entityType);
55
- for (const navProp of entityType?.navigationProperty ?? []) {
56
- const associationEnd = metaModel.getODataAssociationEnd(entityType, navProp.name);
57
- if (associationEnd?.multiplicity !== '*') {
58
- continue;
59
- }
60
- const entityContainer = metaModel.getODataEntityContainer();
61
- if (!entityContainer?.entitySet?.length) {
62
- continue;
63
- }
64
- const targetEntitySet = entityContainer.entitySet.find(item => item.entityType === associationEnd.type);
65
- await this.addNavigationOptionIfAvailable(metaModel, targetEntitySet?.name, navProp.name);
66
- }
67
- return Promise.resolve();
68
- }
69
- async initialize() {
70
- if (!(await areManifestChangesSupported(this.context.manifest))) {
71
- return Promise.resolve();
72
- }
73
- this.appComponent = getV2AppComponent(this.context.view);
74
- return super.initialize();
75
- }
76
- }
77
- var __exports = {
78
- __esModule: true
79
- };
80
- __exports.AddNewSubpage = AddNewSubpage;
81
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["../../../utils/fe-v2", "../add-new-subpage-quick-action-base", "../../../utils/core", "./utils"], function (_____utils_fe_v2, ___add_new_subpage_quick_action_base, _____utils_core, ___utils) {
4
+ "use strict";
5
+
6
+ const getV2ApplicationPages = _____utils_fe_v2["getV2ApplicationPages"];
7
+ const AddNewSubpageBase = ___add_new_subpage_quick_action_base["AddNewSubpageBase"];
8
+ const isA = _____utils_core["isA"];
9
+ const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
10
+ const getV2AppComponent = ___utils["getV2AppComponent"];
11
+ const OBJECT_PAGE_COMPONENT_NAME_V2 = 'sap.suite.ui.generic.template.ObjectPage';
12
+
13
+ /**
14
+ * Quick Action for adding a custom page action.
15
+ */
16
+ class AddNewSubpage extends AddNewSubpageBase {
17
+ get currentPageDescriptor() {
18
+ if (!this.entitySet) {
19
+ throw new Error('entitySet is not defined');
20
+ }
21
+ if (!this.pageType) {
22
+ throw new Error('pageType is not defined');
23
+ }
24
+ if (!this.appComponent) {
25
+ throw new Error('appComponent is not defined');
26
+ }
27
+ return {
28
+ appType: 'fe-v2',
29
+ appComponent: this.appComponent,
30
+ entitySet: this.entitySet,
31
+ pageType: this.pageType
32
+ };
33
+ }
34
+ getApplicationPages() {
35
+ return getV2ApplicationPages(this.context.manifest);
36
+ }
37
+ isPageExists(targetEntitySet) {
38
+ return this.existingPages.some(page => page.entitySet === targetEntitySet);
39
+ }
40
+ isCurrentObjectPage() {
41
+ return this.pageType === OBJECT_PAGE_COMPONENT_NAME_V2;
42
+ }
43
+ getODataMetaModel() {
44
+ return this.context.rta.getRootControlInstance().getModel()?.getMetaModel();
45
+ }
46
+ getEntitySetNameFromPageComponent(component) {
47
+ if (!isA('sap.suite.ui.generic.template.lib.TemplateComponent', component)) {
48
+ throw new Error('Unexpected type of page owner component');
49
+ }
50
+ return Promise.resolve(component.getEntitySet());
51
+ }
52
+ async prepareNavigationData(metaModel) {
53
+ const entitySet = metaModel.getODataEntitySet(this.entitySet);
54
+ const entityType = metaModel.getODataEntityType(entitySet.entityType);
55
+ for (const navProp of entityType?.navigationProperty ?? []) {
56
+ const associationEnd = metaModel.getODataAssociationEnd(entityType, navProp.name);
57
+ if (associationEnd?.multiplicity !== '*') {
58
+ continue;
59
+ }
60
+ const entityContainer = metaModel.getODataEntityContainer();
61
+ if (!entityContainer?.entitySet?.length) {
62
+ continue;
63
+ }
64
+ const targetEntitySet = entityContainer.entitySet.find(item => item.entityType === associationEnd.type);
65
+ await this.addNavigationOptionIfAvailable(metaModel, targetEntitySet?.name, navProp.name);
66
+ }
67
+ return Promise.resolve();
68
+ }
69
+ async initialize() {
70
+ if (!(await areManifestChangesSupported(this.context.manifest))) {
71
+ return Promise.resolve();
72
+ }
73
+ this.appComponent = getV2AppComponent(this.context.view);
74
+ return super.initialize();
75
+ }
76
+ }
77
+ var __exports = {
78
+ __esModule: true
79
+ };
80
+ __exports.AddNewSubpage = AddNewSubpage;
81
+ return __exports;
82
82
  });
83
83
  //# sourceMappingURL=add-new-subpage.js.map
@@ -1,69 +1,69 @@
1
- "use strict";
2
-
3
- sap.ui.define(["../../../utils/core", "../table-quick-action-base", "../control-types", "../dialog-enablement-validator"], function (_____utils_core, ___table_quick_action_base, ___control_types, ___dialog_enablement_validator) {
4
- "use strict";
5
-
6
- const getControlById = _____utils_core["getControlById"];
7
- const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
8
- const SMART_TABLE_TYPE = ___control_types["SMART_TABLE_TYPE"];
9
- const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
10
- const CHANGE_TABLE_ACTIONS = 'change-table-actions';
11
- const CONTROL_TYPES = [SMART_TABLE_TYPE];
12
- class ChangeTableActionsQuickAction extends TableQuickActionDefinitionBase {
13
- constructor(context) {
14
- super(CHANGE_TABLE_ACTIONS, CONTROL_TYPES, 'V2_QUICK_ACTION_CHANGE_TABLE_ACTIONS', context, {
15
- includeServiceAction: true
16
- }, [DIALOG_ENABLEMENT_VALIDATOR]);
17
- }
18
- async initialize() {
19
- const processChild = (child, mapKey) => {
20
- const tableAction = this.tableMap[mapKey]?.changeToolbarContentAction;
21
- child.enabled = !!tableAction?.enabled;
22
- child.tooltip = child.enabled ? undefined : this.context.resourceBundle.getText('TABLE_HEADER_TOOLBAR_NOT_CHANGEABLE');
23
- child.children.forEach((nestedChild, idx) => processChild(nestedChild, `${mapKey}/${idx}`));
24
- };
25
- await super.initialize();
26
-
27
- // disable nested actions based on conditions
28
- this.children.forEach((nestedChild, idx) => processChild(nestedChild, `${idx}`));
29
- }
30
- async execute(path) {
31
- const {
32
- table,
33
- iconTabBarFilterKey,
34
- changeToolbarContentAction,
35
- sectionInfo
36
- } = this.tableMap[path];
37
- if (!table) {
38
- return [];
39
- }
40
- if (sectionInfo) {
41
- const {
42
- layout,
43
- section,
44
- subSection
45
- } = sectionInfo;
46
- layout?.setSelectedSection(section);
47
- section.setSelectedSubSection(subSection);
48
- this.selectOverlay(table);
49
- } else {
50
- getControlById(table.getId())?.getDomRef()?.scrollIntoView();
51
- this.selectOverlay(table);
52
- }
53
- if (this.iconTabBar && iconTabBarFilterKey) {
54
- this.iconTabBar.setSelectedKey(iconTabBarFilterKey);
55
- }
56
- if (changeToolbarContentAction) {
57
- await this.context.actionService.execute(table.getId(), changeToolbarContentAction.id);
58
- }
59
- return [];
60
- }
61
- }
62
- var __exports = {
63
- __esModule: true
64
- };
65
- __exports.CHANGE_TABLE_ACTIONS = CHANGE_TABLE_ACTIONS;
66
- __exports.ChangeTableActionsQuickAction = ChangeTableActionsQuickAction;
67
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["../../../utils/core", "../table-quick-action-base", "../control-types", "../dialog-enablement-validator"], function (_____utils_core, ___table_quick_action_base, ___control_types, ___dialog_enablement_validator) {
4
+ "use strict";
5
+
6
+ const getControlById = _____utils_core["getControlById"];
7
+ const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
8
+ const SMART_TABLE_TYPE = ___control_types["SMART_TABLE_TYPE"];
9
+ const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
10
+ const CHANGE_TABLE_ACTIONS = 'change-table-actions';
11
+ const CONTROL_TYPES = [SMART_TABLE_TYPE];
12
+ class ChangeTableActionsQuickAction extends TableQuickActionDefinitionBase {
13
+ constructor(context) {
14
+ super(CHANGE_TABLE_ACTIONS, CONTROL_TYPES, 'V2_QUICK_ACTION_CHANGE_TABLE_ACTIONS', context, {
15
+ includeServiceAction: true
16
+ }, [DIALOG_ENABLEMENT_VALIDATOR]);
17
+ }
18
+ async initialize() {
19
+ const processChild = (child, mapKey) => {
20
+ const tableAction = this.tableMap[mapKey]?.changeToolbarContentAction;
21
+ child.enabled = !!tableAction?.enabled;
22
+ child.tooltip = child.enabled ? undefined : this.context.resourceBundle.getText('TABLE_HEADER_TOOLBAR_NOT_CHANGEABLE');
23
+ child.children.forEach((nestedChild, idx) => processChild(nestedChild, `${mapKey}/${idx}`));
24
+ };
25
+ await super.initialize();
26
+
27
+ // disable nested actions based on conditions
28
+ this.children.forEach((nestedChild, idx) => processChild(nestedChild, `${idx}`));
29
+ }
30
+ async execute(path) {
31
+ const {
32
+ table,
33
+ iconTabBarFilterKey,
34
+ changeToolbarContentAction,
35
+ sectionInfo
36
+ } = this.tableMap[path];
37
+ if (!table) {
38
+ return [];
39
+ }
40
+ if (sectionInfo) {
41
+ const {
42
+ layout,
43
+ section,
44
+ subSection
45
+ } = sectionInfo;
46
+ layout?.setSelectedSection(section);
47
+ section.setSelectedSubSection(subSection);
48
+ this.selectOverlay(table);
49
+ } else {
50
+ getControlById(table.getId())?.getDomRef()?.scrollIntoView();
51
+ this.selectOverlay(table);
52
+ }
53
+ if (this.iconTabBar && iconTabBarFilterKey) {
54
+ this.iconTabBar.setSelectedKey(iconTabBarFilterKey);
55
+ }
56
+ if (changeToolbarContentAction) {
57
+ await this.context.actionService.execute(table.getId(), changeToolbarContentAction.id);
58
+ }
59
+ return [];
60
+ }
61
+ }
62
+ var __exports = {
63
+ __esModule: true
64
+ };
65
+ __exports.CHANGE_TABLE_ACTIONS = CHANGE_TABLE_ACTIONS;
66
+ __exports.ChangeTableActionsQuickAction = ChangeTableActionsQuickAction;
67
+ return __exports;
68
68
  });
69
69
  //# sourceMappingURL=change-table-actions.js.map