@sap-ux/preview-middleware 0.17.11 → 0.17.13

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 (73) 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/AddFragment.controller.js +1 -1
  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/controllers/FileExistsDialog.controller.js +66 -66
  10. package/dist/client/adp/dialog-factory.js +122 -122
  11. package/dist/client/adp/init-dialogs.js +100 -100
  12. package/dist/client/adp/quick-actions/common/add-controller-to-page.js +55 -55
  13. package/dist/client/adp/quick-actions/common/create-page-action.js +50 -50
  14. package/dist/client/adp/quick-actions/common/op-add-custom-section.js +36 -36
  15. package/dist/client/adp/quick-actions/common/op-add-header-field.js +48 -48
  16. package/dist/client/adp/quick-actions/common/utils.js +18 -18
  17. package/dist/client/adp/quick-actions/control-types.js +21 -21
  18. package/dist/client/adp/quick-actions/dialog-enablement-validator.js +24 -24
  19. package/dist/client/adp/quick-actions/enablement-validator.js +4 -4
  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 +70 -70
  22. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +96 -96
  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 +58 -58
  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 +81 -81
  29. package/dist/client/adp/quick-actions/fe-v2/registry.js +75 -75
  30. package/dist/client/adp/quick-actions/fe-v2/utils.js +95 -95
  31. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +73 -49
  32. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.ts +46 -20
  33. package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +49 -47
  34. package/dist/client/adp/quick-actions/fe-v4/create-table-action.ts +18 -28
  35. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +46 -46
  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 +55 -55
  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-enable-table-filtering.ts +9 -14
  40. package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +52 -52
  41. package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +89 -89
  42. package/dist/client/adp/quick-actions/fe-v4/registry.js +58 -58
  43. package/dist/client/adp/quick-actions/fe-v4/utils.js +47 -47
  44. package/dist/client/adp/quick-actions/load.js +44 -44
  45. package/dist/client/adp/quick-actions/quick-action-base.js +53 -53
  46. package/dist/client/adp/utils.js +160 -160
  47. package/dist/client/cpe/changes/index.js +10 -10
  48. package/dist/client/cpe/changes/validator.js +39 -39
  49. package/dist/client/cpe/documentation.js +164 -164
  50. package/dist/client/cpe/feature-service.js +36 -36
  51. package/dist/client/cpe/logger.js +30 -30
  52. package/dist/client/cpe/outline/editable.js +37 -37
  53. package/dist/client/cpe/outline/nodes.js +222 -222
  54. package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
  55. package/dist/client/cpe/quick-actions/registry.js +143 -143
  56. package/dist/client/cpe/quick-actions/utils.js +92 -92
  57. package/dist/client/cpe/types.js +4 -4
  58. package/dist/client/cpe/ui5-utils.js +33 -33
  59. package/dist/client/cpe/utils.js +138 -138
  60. package/dist/client/flp/WorkspaceConnector.js +86 -86
  61. package/dist/client/flp/common.js +28 -28
  62. package/dist/client/flp/enableFakeConnector.js +83 -83
  63. package/dist/client/flp/initConnectors.js +30 -30
  64. package/dist/client/flp/initRta.js +178 -178
  65. package/dist/client/i18n.js +56 -56
  66. package/dist/client/utils/application.js +32 -32
  67. package/dist/client/utils/core.js +68 -68
  68. package/dist/client/utils/error.js +19 -19
  69. package/dist/client/utils/fe-v4.js +118 -118
  70. package/dist/client/utils/version.js +102 -102
  71. package/package.json +7 -7
  72. package/dist/client/adp/quick-actions/fe-v4/table-quick-action-base.js +0 -67
  73. package/dist/client/adp/quick-actions/fe-v4/table-quick-action-base.ts +0 -75
@@ -1,97 +1,97 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/ui/rta/command/CommandFactory", "../../../utils/version"], function (CommandFactory, _____utils_version) {
4
- "use strict";
5
-
6
- const getUi5Version = _____utils_version["getUi5Version"];
7
- const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
8
- const isVersionEqualOrHasNewerPatch = _____utils_version["isVersionEqualOrHasNewerPatch"];
9
- /**
10
- * Prepares the change for the manifest setting.
11
- *
12
- * @param context - The context object containing flexSettings.
13
- * @param propertyPath - The path of the property in the manifest.
14
- * @param control - The UI5 element representing the control.
15
- * @param component - component name e.g list report or object page.
16
- * @param entitySet - Entity Set name.
17
- * @param propertyValue - The value to be set for the property.
18
- *
19
- * @returns A Promise resolving to an array of FlexCommand objects.
20
- */
21
- async function prepareManifestChange(context, propertyPath, control, component, entitySet, propertyValue) {
22
- const {
23
- flexSettings
24
- } = context;
25
- const modifiedValue = {
26
- changeType: 'appdescr_ui_generic_app_changePageConfiguration',
27
- reference: flexSettings.projectId,
28
- parameters: {
29
- parentPage: {
30
- component,
31
- entitySet
32
- },
33
- entityPropertyChange: {
34
- propertyPath: propertyPath,
35
- operation: 'UPSERT',
36
- propertyValue: propertyValue
37
- }
38
- }
39
- };
40
- const command = await CommandFactory.getCommandFor(control, 'appDescriptor', modifiedValue, null, flexSettings);
41
- return [command];
42
- }
43
-
44
- /**
45
- * Checks whether the manifest has array structured page definitions
46
- * @param manifest - manifest object
47
- * @returns true if pages are defined as array, false if defined as object
48
- */
49
- function isManifestArrayStructured(manifest) {
50
- return Array.isArray(manifest['sap.ui.generic.app']?.pages);
51
- }
52
-
53
- /**
54
- * Checks if the current UI5 version and manifest structure is supported in v2 applications.
55
- *
56
- * @param manifest - manifest changes of the current application.
57
- *
58
- * Returns `false`
59
- *
60
- * - If the manifest is structured is an array
61
- * - If the UI5 version is not supported
62
- * Otherwise, returns `true`.
63
- *
64
- */
65
- async function areManifestChangesSupported(manifest) {
66
- if (isManifestArrayStructured(manifest)) {
67
- return false;
68
- }
69
- const version = await getUi5Version();
70
- const isAboveOrEqualMinimalVersion = !isLowerThanMinimalUi5Version(version, {
71
- major: 1,
72
- minor: 128
73
- });
74
- const isSupportedPatchVersion = isVersionEqualOrHasNewerPatch(version, {
75
- major: 1,
76
- minor: 96,
77
- patch: 35
78
- }) || isVersionEqualOrHasNewerPatch(version, {
79
- major: 1,
80
- minor: 108,
81
- patch: 38
82
- }) || isVersionEqualOrHasNewerPatch(version, {
83
- major: 1,
84
- minor: 120,
85
- patch: 23
86
- });
87
- return isAboveOrEqualMinimalVersion || isSupportedPatchVersion;
88
- }
89
- var __exports = {
90
- __esModule: true
91
- };
92
- __exports.prepareManifestChange = prepareManifestChange;
93
- __exports.isManifestArrayStructured = isManifestArrayStructured;
94
- __exports.areManifestChangesSupported = areManifestChangesSupported;
95
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/rta/command/CommandFactory", "../../../utils/version"], function (CommandFactory, _____utils_version) {
4
+ "use strict";
5
+
6
+ const getUi5Version = _____utils_version["getUi5Version"];
7
+ const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
8
+ const isVersionEqualOrHasNewerPatch = _____utils_version["isVersionEqualOrHasNewerPatch"];
9
+ /**
10
+ * Prepares the change for the manifest setting.
11
+ *
12
+ * @param context - The context object containing flexSettings.
13
+ * @param propertyPath - The path of the property in the manifest.
14
+ * @param control - The UI5 element representing the control.
15
+ * @param component - component name e.g list report or object page.
16
+ * @param entitySet - Entity Set name.
17
+ * @param propertyValue - The value to be set for the property.
18
+ *
19
+ * @returns A Promise resolving to an array of FlexCommand objects.
20
+ */
21
+ async function prepareManifestChange(context, propertyPath, control, component, entitySet, propertyValue) {
22
+ const {
23
+ flexSettings
24
+ } = context;
25
+ const modifiedValue = {
26
+ changeType: 'appdescr_ui_generic_app_changePageConfiguration',
27
+ reference: flexSettings.projectId,
28
+ parameters: {
29
+ parentPage: {
30
+ component,
31
+ entitySet
32
+ },
33
+ entityPropertyChange: {
34
+ propertyPath: propertyPath,
35
+ operation: 'UPSERT',
36
+ propertyValue: propertyValue
37
+ }
38
+ }
39
+ };
40
+ const command = await CommandFactory.getCommandFor(control, 'appDescriptor', modifiedValue, null, flexSettings);
41
+ return [command];
42
+ }
43
+
44
+ /**
45
+ * Checks whether the manifest has array structured page definitions
46
+ * @param manifest - manifest object
47
+ * @returns true if pages are defined as array, false if defined as object
48
+ */
49
+ function isManifestArrayStructured(manifest) {
50
+ return Array.isArray(manifest['sap.ui.generic.app']?.pages);
51
+ }
52
+
53
+ /**
54
+ * Checks if the current UI5 version and manifest structure is supported in v2 applications.
55
+ *
56
+ * @param manifest - manifest changes of the current application.
57
+ *
58
+ * Returns `false`
59
+ *
60
+ * - If the manifest is structured is an array
61
+ * - If the UI5 version is not supported
62
+ * Otherwise, returns `true`.
63
+ *
64
+ */
65
+ async function areManifestChangesSupported(manifest) {
66
+ if (isManifestArrayStructured(manifest)) {
67
+ return false;
68
+ }
69
+ const version = await getUi5Version();
70
+ const isAboveOrEqualMinimalVersion = !isLowerThanMinimalUi5Version(version, {
71
+ major: 1,
72
+ minor: 128
73
+ });
74
+ const isSupportedPatchVersion = isVersionEqualOrHasNewerPatch(version, {
75
+ major: 1,
76
+ minor: 96,
77
+ patch: 35
78
+ }) || isVersionEqualOrHasNewerPatch(version, {
79
+ major: 1,
80
+ minor: 108,
81
+ patch: 38
82
+ }) || isVersionEqualOrHasNewerPatch(version, {
83
+ major: 1,
84
+ minor: 120,
85
+ patch: 23
86
+ });
87
+ return isAboveOrEqualMinimalVersion || isSupportedPatchVersion;
88
+ }
89
+ var __exports = {
90
+ __esModule: true
91
+ };
92
+ __exports.prepareManifestChange = prepareManifestChange;
93
+ __exports.isManifestArrayStructured = isManifestArrayStructured;
94
+ __exports.areManifestChangesSupported = areManifestChangesSupported;
95
+ return __exports;
96
96
  });
97
97
  //# sourceMappingURL=utils.js.map
@@ -1,51 +1,75 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/ui/dt/OverlayUtil", "sap/ui/fl/apply/api/FlexRuntimeInfoAPI", "../../../cpe/quick-actions/utils", "../../../utils/core", "./table-quick-action-base", "../control-types", "../dialog-enablement-validator"], function (OverlayUtil, FlexRuntimeInfoAPI, _____cpe_quick_actions_utils, _____utils_core, ___table_quick_action_base, ___control_types, ___dialog_enablement_validator) {
4
- "use strict";
5
-
6
- const getRelevantControlFromActivePage = _____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
7
- const getControlById = _____utils_core["getControlById"];
8
- const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
9
- const MDC_TABLE_TYPE = ___control_types["MDC_TABLE_TYPE"];
10
- const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
11
- const CHANGE_TABLE_COLUMNS = 'change-table-columns';
12
- const ACTION_ID = 'CTX_SETTINGS0';
13
- const CONTROL_TYPE = 'sap.ui.mdc.Table';
14
-
15
- /**
16
- * Quick Action for changing table columns.
17
- */
18
- class ChangeTableColumnsQuickAction extends TableQuickActionDefinitionBase {
19
- constructor(context) {
20
- super(CHANGE_TABLE_COLUMNS, [MDC_TABLE_TYPE], 'V4_QUICK_ACTION_CHANGE_TABLE_COLUMNS', context, undefined, [DIALOG_ENABLEMENT_VALIDATOR]);
21
- }
22
- async execute(path) {
23
- const index = this.tableMap[path];
24
- const smartTables = getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, [CONTROL_TYPE]);
25
- for (let i = 0; i < smartTables.length; i++) {
26
- if (i === index) {
27
- const section = getControlById(smartTables[i].getId());
28
- const controlOverlay = OverlayUtil.getClosestOverlayFor(section);
29
- if (controlOverlay) {
30
- controlOverlay.setSelected(true);
31
- }
32
- const hasVariantManagement = FlexRuntimeInfoAPI.hasVariantManagement({
33
- element: smartTables[i]
34
- });
35
- if (!hasVariantManagement) {
36
- continue;
37
- }
38
- await this.context.actionService.execute(smartTables[i].getId(), ACTION_ID);
39
- }
40
- }
41
- return [];
42
- }
43
- }
44
- var __exports = {
45
- __esModule: true
46
- };
47
- __exports.CHANGE_TABLE_COLUMNS = CHANGE_TABLE_COLUMNS;
48
- __exports.ChangeTableColumnsQuickAction = ChangeTableColumnsQuickAction;
49
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/dt/OverlayUtil", "sap/ui/fl/apply/api/FlexRuntimeInfoAPI", "../../../utils/core", "../table-quick-action-base", "../control-types", "../dialog-enablement-validator", "../../../cpe/quick-actions/utils"], function (OverlayUtil, FlexRuntimeInfoAPI, _____utils_core, ___table_quick_action_base, ___control_types, ___dialog_enablement_validator, _____cpe_quick_actions_utils) {
4
+ "use strict";
5
+
6
+ const getControlById = _____utils_core["getControlById"];
7
+ const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
8
+ const MDC_TABLE_TYPE = ___control_types["MDC_TABLE_TYPE"];
9
+ const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
10
+ const getRelevantControlFromActivePage = _____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
11
+ const CHANGE_TABLE_COLUMNS = 'change-table-columns';
12
+ const ACTION_ID = 'CTX_SETTINGS0';
13
+
14
+ /**
15
+ * Quick Action for changing table columns.
16
+ */
17
+ class ChangeTableColumnsQuickAction extends TableQuickActionDefinitionBase {
18
+ constructor(context) {
19
+ super(CHANGE_TABLE_COLUMNS, [MDC_TABLE_TYPE], 'V4_QUICK_ACTION_CHANGE_TABLE_COLUMNS', context, undefined, [DIALOG_ENABLEMENT_VALIDATOR]);
20
+ }
21
+ async initialize() {
22
+ for (const smartTable of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, this.controlTypes)) {
23
+ const hasVariantManagement = FlexRuntimeInfoAPI.hasVariantManagement({
24
+ element: smartTable
25
+ });
26
+ if (!hasVariantManagement) {
27
+ continue;
28
+ }
29
+ const actions = await this.context.actionService.get(smartTable.getId());
30
+ const changeColumnAction = actions.find(action => action.id === ACTION_ID);
31
+ if (changeColumnAction) {
32
+ this.children.push({
33
+ label: `'${smartTable.getHeader()}' table`,
34
+ enabled: true,
35
+ children: []
36
+ });
37
+ this.tableMap[`${this.children.length - 1}`] = {
38
+ table: smartTable,
39
+ tableUpdateEventAttachedOnce: false
40
+ };
41
+ }
42
+ }
43
+ if (this.children.length > 0) {
44
+ this.isApplicable = true;
45
+ }
46
+ }
47
+ async execute(path) {
48
+ const {
49
+ table
50
+ } = this.tableMap[path];
51
+ if (!table) {
52
+ return [];
53
+ }
54
+ const tableControl = getControlById(table.getId());
55
+ const controlOverlay = OverlayUtil.getClosestOverlayFor(tableControl);
56
+ if (controlOverlay) {
57
+ controlOverlay.setSelected(true);
58
+ }
59
+ const hasVariantManagement = FlexRuntimeInfoAPI.hasVariantManagement({
60
+ element: table
61
+ });
62
+ if (hasVariantManagement) {
63
+ await this.context.actionService.execute(table.getId(), ACTION_ID);
64
+ }
65
+ return [];
66
+ }
67
+ }
68
+ var __exports = {
69
+ __esModule: true
70
+ };
71
+ __exports.CHANGE_TABLE_COLUMNS = CHANGE_TABLE_COLUMNS;
72
+ __exports.ChangeTableColumnsQuickAction = ChangeTableColumnsQuickAction;
73
+ return __exports;
50
74
  });
51
75
  //# sourceMappingURL=change-table-columns.js.map
@@ -2,15 +2,15 @@ import OverlayUtil from 'sap/ui/dt/OverlayUtil';
2
2
  import FlexCommand from 'sap/ui/rta/command/FlexCommand';
3
3
  import FlexRuntimeInfoAPI from 'sap/ui/fl/apply/api/FlexRuntimeInfoAPI';
4
4
  import { QuickActionContext, NestedQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
5
- import { getRelevantControlFromActivePage } from '../../../cpe/quick-actions/utils';
6
5
  import { getControlById } from '../../../utils/core';
7
- import { TableQuickActionDefinitionBase } from './table-quick-action-base';
6
+ import { TableQuickActionDefinitionBase } from '../table-quick-action-base';
8
7
  import { MDC_TABLE_TYPE } from '../control-types';
9
8
  import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator';
9
+ import { getRelevantControlFromActivePage } from '../../../cpe/quick-actions/utils';
10
+ import Table from 'sap/ui/mdc/Table';
10
11
 
11
12
  export const CHANGE_TABLE_COLUMNS = 'change-table-columns';
12
13
  const ACTION_ID = 'CTX_SETTINGS0';
13
- const CONTROL_TYPE = 'sap.ui.mdc.Table';
14
14
 
15
15
  /**
16
16
  * Quick Action for changing table columns.
@@ -25,24 +25,50 @@ export class ChangeTableColumnsQuickAction
25
25
  ]);
26
26
  }
27
27
 
28
- async execute(path: string): Promise<FlexCommand[]> {
29
- const index = this.tableMap[path];
30
- const smartTables = getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, [
31
- CONTROL_TYPE
32
- ]);
33
- for (let i = 0; i < smartTables.length; i++) {
34
- if (i === index) {
35
- const section = getControlById(smartTables[i].getId());
36
- const controlOverlay = OverlayUtil.getClosestOverlayFor(section);
37
- if (controlOverlay) {
38
- controlOverlay.setSelected(true);
39
- }
40
- const hasVariantManagement = FlexRuntimeInfoAPI.hasVariantManagement({ element: smartTables[i] });
41
- if (!hasVariantManagement) {
42
- continue;
43
- }
44
- await this.context.actionService.execute(smartTables[i].getId(), ACTION_ID);
28
+ async initialize(): Promise<void> {
29
+ for (const smartTable of getRelevantControlFromActivePage(
30
+ this.context.controlIndex,
31
+ this.context.view,
32
+ this.controlTypes
33
+ )) {
34
+ const hasVariantManagement = FlexRuntimeInfoAPI.hasVariantManagement({ element: smartTable });
35
+ if (!hasVariantManagement) {
36
+ continue;
45
37
  }
38
+
39
+ const actions = await this.context.actionService.get(smartTable.getId());
40
+ const changeColumnAction = actions.find((action) => action.id === ACTION_ID);
41
+ if (changeColumnAction) {
42
+ this.children.push({
43
+ label: `'${(smartTable as Table).getHeader()}' table`,
44
+ enabled: true,
45
+ children: []
46
+ });
47
+ this.tableMap[`${this.children.length - 1}`] = {
48
+ table: smartTable,
49
+ tableUpdateEventAttachedOnce: false
50
+ };
51
+ }
52
+ }
53
+
54
+ if (this.children.length > 0) {
55
+ this.isApplicable = true;
56
+ }
57
+ }
58
+
59
+ async execute(path: string): Promise<FlexCommand[]> {
60
+ const { table } = this.tableMap[path];
61
+ if (!table) {
62
+ return [];
63
+ }
64
+ const tableControl = getControlById(table.getId());
65
+ const controlOverlay = OverlayUtil.getClosestOverlayFor(tableControl);
66
+ if (controlOverlay) {
67
+ controlOverlay.setSelected(true);
68
+ }
69
+ const hasVariantManagement = FlexRuntimeInfoAPI.hasVariantManagement({ element: table });
70
+ if (hasVariantManagement) {
71
+ await this.context.actionService.execute(table.getId(), ACTION_ID);
46
72
  }
47
73
 
48
74
  return [];
@@ -1,49 +1,51 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/ui/dt/OverlayUtil", "../../../cpe/quick-actions/utils", "../../../utils/core", "../../dialog-factory", "../dialog-enablement-validator", "./table-quick-action-base", "../control-types"], function (OverlayUtil, _____cpe_quick_actions_utils, _____utils_core, ____dialog_factory, ___dialog_enablement_validator, ___table_quick_action_base, ___control_types) {
4
- "use strict";
5
-
6
- const getRelevantControlFromActivePage = _____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
7
- const getControlById = _____utils_core["getControlById"];
8
- const DialogFactory = ____dialog_factory["DialogFactory"];
9
- const DialogNames = ____dialog_factory["DialogNames"];
10
- const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
11
- const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
12
- const MDC_TABLE_TYPE = ___control_types["MDC_TABLE_TYPE"];
13
- const CREATE_TABLE_ACTION = 'create_table_action';
14
- const TOOLBAR_ACTION = 'sap.ui.mdc.ActionToolbar';
15
-
16
- /**
17
- * Quick Action for creating table action.
18
- */
19
- class AddTableActionQuickAction extends TableQuickActionDefinitionBase {
20
- constructor(context) {
21
- super(CREATE_TABLE_ACTION, [MDC_TABLE_TYPE], 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION', context, true, [DIALOG_ENABLEMENT_VALIDATOR]);
22
- }
23
- async execute(path) {
24
- const index = this.tableMap[path];
25
- const smartTablesToolbarAction = getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, [TOOLBAR_ACTION]);
26
- for (let i = 0; i < smartTablesToolbarAction.length; i++) {
27
- if (i === index) {
28
- const section = getControlById(smartTablesToolbarAction[i].getId());
29
- const controlOverlay = OverlayUtil.getClosestOverlayFor(section);
30
- if (controlOverlay) {
31
- controlOverlay.setSelected(true);
32
- await DialogFactory.createDialog(controlOverlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
33
- aggregation: 'actions',
34
- title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION'
35
- });
36
- }
37
- }
38
- }
39
- return [];
40
- }
41
- }
42
- var __exports = {
43
- __esModule: true
44
- };
45
- __exports.CREATE_TABLE_ACTION = CREATE_TABLE_ACTION;
46
- __exports.AddTableActionQuickAction = AddTableActionQuickAction;
47
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/dt/OverlayUtil", "../../../utils/core", "../../dialog-factory", "../dialog-enablement-validator", "../table-quick-action-base", "../control-types", "../fe-v2/create-table-custom-column"], function (OverlayUtil, _____utils_core, ____dialog_factory, ___dialog_enablement_validator, ___table_quick_action_base, ___control_types, ___fe_v2_create_table_custom_column) {
4
+ "use strict";
5
+
6
+ const getControlById = _____utils_core["getControlById"];
7
+ const DialogFactory = ____dialog_factory["DialogFactory"];
8
+ const DialogNames = ____dialog_factory["DialogNames"];
9
+ const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
10
+ const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
11
+ const MDC_TABLE_TYPE = ___control_types["MDC_TABLE_TYPE"];
12
+ const preprocessActionExecution = ___fe_v2_create_table_custom_column["preprocessActionExecution"];
13
+ const CREATE_TABLE_ACTION = 'create_table_action';
14
+
15
+ /**
16
+ * Quick Action for creating table action.
17
+ */
18
+ class AddTableActionQuickAction extends TableQuickActionDefinitionBase {
19
+ constructor(context) {
20
+ super(CREATE_TABLE_ACTION, [MDC_TABLE_TYPE], 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION', context, undefined, [DIALOG_ENABLEMENT_VALIDATOR]);
21
+ }
22
+ async execute(path) {
23
+ const {
24
+ table,
25
+ sectionInfo,
26
+ iconTabBarFilterKey
27
+ } = this.tableMap[path];
28
+ if (!table) {
29
+ return [];
30
+ }
31
+ preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
32
+ const tableControl = getControlById(table.getId());
33
+ const controlOverlay = OverlayUtil.getClosestOverlayFor(tableControl);
34
+ if (controlOverlay) {
35
+ controlOverlay.setSelected(true);
36
+ await DialogFactory.createDialog(controlOverlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
37
+ aggregation: 'actions',
38
+ title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION'
39
+ });
40
+ }
41
+ return [];
42
+ }
43
+ }
44
+ var __exports = {
45
+ __esModule: true
46
+ };
47
+ __exports.CREATE_TABLE_ACTION = CREATE_TABLE_ACTION;
48
+ __exports.AddTableActionQuickAction = AddTableActionQuickAction;
49
+ return __exports;
48
50
  });
49
51
  //# sourceMappingURL=create-table-action.js.map
@@ -2,51 +2,41 @@ import OverlayUtil from 'sap/ui/dt/OverlayUtil';
2
2
  import type FlexCommand from 'sap/ui/rta/command/FlexCommand';
3
3
 
4
4
  import { QuickActionContext, NestedQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
5
- import { getRelevantControlFromActivePage } from '../../../cpe/quick-actions/utils';
6
5
  import { getControlById } from '../../../utils/core';
7
6
  import { DialogFactory, DialogNames } from '../../dialog-factory';
8
7
  import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator';
9
- import { TableQuickActionDefinitionBase } from './table-quick-action-base';
8
+ import { TableQuickActionDefinitionBase } from '../table-quick-action-base';
10
9
  import { MDC_TABLE_TYPE } from '../control-types';
10
+ import { preprocessActionExecution } from '../fe-v2/create-table-custom-column';
11
11
 
12
12
  export const CREATE_TABLE_ACTION = 'create_table_action';
13
- const TOOLBAR_ACTION = 'sap.ui.mdc.ActionToolbar';
14
13
 
15
14
  /**
16
15
  * Quick Action for creating table action.
17
16
  */
18
17
  export class AddTableActionQuickAction extends TableQuickActionDefinitionBase implements NestedQuickActionDefinition {
19
18
  constructor(context: QuickActionContext) {
20
- super(CREATE_TABLE_ACTION, [MDC_TABLE_TYPE], 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION', context, true, [
19
+ super(CREATE_TABLE_ACTION, [MDC_TABLE_TYPE], 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION', context, undefined, [
21
20
  DIALOG_ENABLEMENT_VALIDATOR
22
21
  ]);
23
22
  }
24
23
 
25
24
  async execute(path: string): Promise<FlexCommand[]> {
26
- const index = this.tableMap[path];
27
- const smartTablesToolbarAction = getRelevantControlFromActivePage(
28
- this.context.controlIndex,
29
- this.context.view,
30
- [TOOLBAR_ACTION]
31
- );
32
- for (let i = 0; i < smartTablesToolbarAction.length; i++) {
33
- if (i === index) {
34
- const section = getControlById(smartTablesToolbarAction[i].getId());
35
- const controlOverlay = OverlayUtil.getClosestOverlayFor(section);
36
- if (controlOverlay) {
37
- controlOverlay.setSelected(true);
38
- await DialogFactory.createDialog(
39
- controlOverlay,
40
- this.context.rta,
41
- DialogNames.ADD_FRAGMENT,
42
- undefined,
43
- {
44
- aggregation: 'actions',
45
- title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION'
46
- }
47
- );
48
- }
49
- }
25
+ const { table, sectionInfo, iconTabBarFilterKey } = this.tableMap[path];
26
+ if (!table) {
27
+ return [];
28
+ }
29
+
30
+ preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
31
+ const tableControl = getControlById(table.getId());
32
+ const controlOverlay = OverlayUtil.getClosestOverlayFor(tableControl);
33
+ if (controlOverlay) {
34
+ controlOverlay.setSelected(true);
35
+
36
+ await DialogFactory.createDialog(controlOverlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
37
+ aggregation: 'actions',
38
+ title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION'
39
+ });
50
40
  }
51
41
 
52
42
  return [];