@sap-ux/preview-middleware 0.18.19 → 0.18.20

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 (68) 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/BaseDialog.controller.js +187 -187
  5. package/dist/client/adp/controllers/ControllerExtension.controller.js +209 -209
  6. package/dist/client/adp/controllers/ExtensionPoint.controller.js +138 -138
  7. package/dist/client/adp/controllers/FileExistsDialog.controller.js +66 -66
  8. package/dist/client/adp/dialog-factory.js +133 -133
  9. package/dist/client/adp/init-dialogs.js +107 -107
  10. package/dist/client/adp/quick-actions/common/add-controller-to-page.js +55 -55
  11. package/dist/client/adp/quick-actions/common/add-new-subpage.js +138 -138
  12. package/dist/client/adp/quick-actions/common/create-page-action.js +51 -51
  13. package/dist/client/adp/quick-actions/common/op-add-custom-section.js +36 -36
  14. package/dist/client/adp/quick-actions/common/op-add-header-field.js +61 -61
  15. package/dist/client/adp/quick-actions/common/utils.js +18 -18
  16. package/dist/client/adp/quick-actions/control-types.js +21 -21
  17. package/dist/client/adp/quick-actions/dialog-enablement-validator.js +24 -24
  18. package/dist/client/adp/quick-actions/enablement-validator.js +4 -4
  19. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +101 -101
  20. package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +104 -104
  21. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +96 -96
  22. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +78 -78
  23. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +77 -77
  24. package/dist/client/adp/quick-actions/fe-v2/lr-enable-variant-management.js +69 -69
  25. package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +59 -59
  26. package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +93 -93
  27. package/dist/client/adp/quick-actions/fe-v2/op-enable-variant-management.js +84 -84
  28. package/dist/client/adp/quick-actions/fe-v2/registry.js +76 -76
  29. package/dist/client/adp/quick-actions/fe-v2/utils.js +116 -116
  30. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +73 -73
  31. package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +50 -50
  32. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +46 -46
  33. package/dist/client/adp/quick-actions/fe-v4/enable-variant-management.js +81 -81
  34. package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +56 -56
  35. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +82 -82
  36. package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +53 -53
  37. package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +89 -89
  38. package/dist/client/adp/quick-actions/fe-v4/registry.js +58 -58
  39. package/dist/client/adp/quick-actions/fe-v4/utils.js +47 -47
  40. package/dist/client/adp/quick-actions/load.js +44 -44
  41. package/dist/client/adp/quick-actions/quick-action-base.js +53 -53
  42. package/dist/client/adp/utils.js +160 -160
  43. package/dist/client/cpe/changes/index.js +10 -10
  44. package/dist/client/cpe/changes/validator.js +39 -39
  45. package/dist/client/cpe/documentation.js +164 -164
  46. package/dist/client/cpe/feature-service.js +36 -36
  47. package/dist/client/cpe/logger.js +30 -30
  48. package/dist/client/cpe/outline/editable.js +37 -37
  49. package/dist/client/cpe/outline/nodes.js +222 -222
  50. package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
  51. package/dist/client/cpe/quick-actions/registry.js +143 -143
  52. package/dist/client/cpe/quick-actions/utils.js +92 -92
  53. package/dist/client/cpe/types.js +4 -4
  54. package/dist/client/cpe/ui5-utils.js +33 -33
  55. package/dist/client/cpe/utils.js +138 -138
  56. package/dist/client/flp/WorkspaceConnector.js +86 -86
  57. package/dist/client/flp/common.js +28 -28
  58. package/dist/client/flp/enableFakeConnector.js +83 -83
  59. package/dist/client/flp/initConnectors.js +28 -28
  60. package/dist/client/flp/initRta.js +178 -178
  61. package/dist/client/i18n.js +56 -56
  62. package/dist/client/utils/application.js +32 -32
  63. package/dist/client/utils/core.js +68 -68
  64. package/dist/client/utils/error.js +19 -19
  65. package/dist/client/utils/fe-v2.js +56 -56
  66. package/dist/client/utils/fe-v4.js +141 -141
  67. package/dist/client/utils/version.js +104 -104
  68. package/package.json +6 -6
@@ -1,71 +1,71 @@
1
- "use strict";
2
-
3
- sap.ui.define(["./utils", "../simple-quick-action-base", "sap/ui/core/Component"], function (___utils, ___simple_quick_action_base, Component) {
4
- "use strict";
5
-
6
- const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
7
- const prepareManifestChange = ___utils["prepareManifestChange"];
8
- const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
9
- const ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS = 'enable-variant-management-in-tables-charts';
10
- const CONTROL_TYPES = ['sap.f.DynamicPage'];
11
-
12
- /**
13
- * Quick Action for enabling table filtering using table personalization settings.
14
- */
15
- class EnableListReportVariantManagementQuickAction extends SimpleQuickActionDefinitionBase {
16
- isPageSmartVariantManagementEnabled = false;
17
- forceRefreshAfterExecution = true;
18
- constructor(context) {
19
- super(ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLES_AND_CHARTS_VARIANT_MANAGEMENT', context, [{
20
- run: () => {
21
- if (this.ownerComponent) {
22
- if (!this.isPageSmartVariantManagementEnabled) {
23
- return {
24
- type: 'error',
25
- message: this.context.resourceBundle.getText('VARIANT_MANAGEMENT_FOR_PAGE_CONTROLS_IS_ALREADY_ENABLED')
26
- };
27
- }
28
- }
29
- return undefined;
30
- }
31
- }]);
32
- }
33
- async initialize() {
34
- const manifestChangesSupported = await areManifestChangesSupported(this.context.manifest);
35
- if (!manifestChangesSupported) {
36
- return;
37
- }
38
- await super.initialize();
39
- if (this.control) {
40
- this.ownerComponent = Component.getOwnerComponentFor(this.control);
41
- if (!this.ownerComponent?.isA('sap.suite.ui.generic.template.ListReport.Component') && !this.ownerComponent?.isA('sap.suite.ui.generic.template.AnalyticalListPage.Component')) {
42
- this.control = undefined;
43
- } else {
44
- const id = this.control.getId();
45
- if (typeof id !== 'string') {
46
- throw new Error('Could not retrieve configuration property because control id is not valid!');
47
- }
48
- const value = this.context.changeService.getConfigurationPropertyValue(id, 'smartVariantManagement');
49
- this.isPageSmartVariantManagementEnabled = value === undefined ? this.ownerComponent.getSmartVariantManagement() : value;
50
- }
51
- }
52
- }
53
- async execute() {
54
- if (!this.control) {
55
- return [];
56
- }
57
- const entitySet = this.ownerComponent.getEntitySet();
58
- const command = await prepareManifestChange(this.context, 'component/settings', this.control, this.ownerComponent.getMetadata().getComponentName(), entitySet, {
59
- smartVariantManagement: !this.isPageSmartVariantManagementEnabled
60
- });
61
- return command;
62
- }
63
- }
64
- var __exports = {
65
- __esModule: true
66
- };
67
- __exports.ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS = ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS;
68
- __exports.EnableListReportVariantManagementQuickAction = EnableListReportVariantManagementQuickAction;
69
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["./utils", "../simple-quick-action-base", "sap/ui/core/Component"], function (___utils, ___simple_quick_action_base, Component) {
4
+ "use strict";
5
+
6
+ const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
7
+ const prepareManifestChange = ___utils["prepareManifestChange"];
8
+ const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
9
+ const ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS = 'enable-variant-management-in-tables-charts';
10
+ const CONTROL_TYPES = ['sap.f.DynamicPage'];
11
+
12
+ /**
13
+ * Quick Action for enabling table filtering using table personalization settings.
14
+ */
15
+ class EnableListReportVariantManagementQuickAction extends SimpleQuickActionDefinitionBase {
16
+ isPageSmartVariantManagementEnabled = false;
17
+ forceRefreshAfterExecution = true;
18
+ constructor(context) {
19
+ super(ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLES_AND_CHARTS_VARIANT_MANAGEMENT', context, [{
20
+ run: () => {
21
+ if (this.ownerComponent) {
22
+ if (!this.isPageSmartVariantManagementEnabled) {
23
+ return {
24
+ type: 'error',
25
+ message: this.context.resourceBundle.getText('VARIANT_MANAGEMENT_FOR_PAGE_CONTROLS_IS_ALREADY_ENABLED')
26
+ };
27
+ }
28
+ }
29
+ return undefined;
30
+ }
31
+ }]);
32
+ }
33
+ async initialize() {
34
+ const manifestChangesSupported = await areManifestChangesSupported(this.context.manifest);
35
+ if (!manifestChangesSupported) {
36
+ return;
37
+ }
38
+ await super.initialize();
39
+ if (this.control) {
40
+ this.ownerComponent = Component.getOwnerComponentFor(this.control);
41
+ if (!this.ownerComponent?.isA('sap.suite.ui.generic.template.ListReport.Component') && !this.ownerComponent?.isA('sap.suite.ui.generic.template.AnalyticalListPage.Component')) {
42
+ this.control = undefined;
43
+ } else {
44
+ const id = this.control.getId();
45
+ if (typeof id !== 'string') {
46
+ throw new Error('Could not retrieve configuration property because control id is not valid!');
47
+ }
48
+ const value = this.context.changeService.getConfigurationPropertyValue(id, 'smartVariantManagement');
49
+ this.isPageSmartVariantManagementEnabled = value === undefined ? this.ownerComponent.getSmartVariantManagement() : value;
50
+ }
51
+ }
52
+ }
53
+ async execute() {
54
+ if (!this.control) {
55
+ return [];
56
+ }
57
+ const entitySet = this.ownerComponent.getEntitySet();
58
+ const command = await prepareManifestChange(this.context, 'component/settings', this.control, this.ownerComponent.getMetadata().getComponentName(), entitySet, {
59
+ smartVariantManagement: !this.isPageSmartVariantManagementEnabled
60
+ });
61
+ return command;
62
+ }
63
+ }
64
+ var __exports = {
65
+ __esModule: true
66
+ };
67
+ __exports.ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS = ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS;
68
+ __exports.EnableListReportVariantManagementQuickAction = EnableListReportVariantManagementQuickAction;
69
+ return __exports;
70
70
  });
71
71
  //# sourceMappingURL=lr-enable-variant-management.js.map
@@ -1,61 +1,61 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/ui/rta/command/CommandFactory", "../../../cpe/quick-actions/utils", "../../../utils/core", "../simple-quick-action-base"], function (CommandFactory, _____cpe_quick_actions_utils, _____utils_core, ___simple_quick_action_base) {
4
- "use strict";
5
-
6
- const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
7
- const getControlById = _____utils_core["getControlById"];
8
- const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
9
- const ENABLE_CLEAR_FILTER_BAR_TYPE = 'enable-clear-filter-bar';
10
- const PROPERTY_NAME = 'showClearOnFB';
11
- const CONTROL_TYPE_LR = 'sap.ui.comp.smartfilterbar.SmartFilterBar';
12
- const CONTROL_TYPE_ALP = 'sap.suite.ui.generic.template.AnalyticalListPage.control.SmartFilterBarExt';
13
-
14
- /**
15
- * Quick Action for toggling the visibility of "clear filter bar" button in List Report page.
16
- */
17
- class ToggleClearFilterBarQuickAction extends SimpleQuickActionDefinitionBase {
18
- constructor(context) {
19
- super(ENABLE_CLEAR_FILTER_BAR_TYPE, [], '', context);
20
- }
21
- isClearButtonEnabled = false;
22
- initialize() {
23
- const controls = [...(this.context.controlIndex[CONTROL_TYPE_LR] ?? []), ...(this.context.controlIndex[CONTROL_TYPE_ALP] ?? [])];
24
- for (const control of controls) {
25
- const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
26
- const modifiedControl = getControlById(control.controlId);
27
- if (isActionApplicable && modifiedControl) {
28
- this.isClearButtonEnabled = modifiedControl.getShowClearOnFB();
29
- this.control = modifiedControl;
30
- }
31
- }
32
- return Promise.resolve();
33
- }
34
- get textKey() {
35
- return this.isClearButtonEnabled ? 'V2_QUICK_ACTION_LR_DISABLE_CLEAR_FILTER_BAR' : 'V2_QUICK_ACTION_LR_ENABLE_CLEAR_FILTER_BAR';
36
- }
37
- async execute() {
38
- if (this.control) {
39
- const {
40
- flexSettings
41
- } = this.context;
42
- const modifiedValue = {
43
- generator: flexSettings.generator,
44
- propertyName: PROPERTY_NAME,
45
- newValue: !this.isClearButtonEnabled
46
- };
47
- const command = await CommandFactory.getCommandFor(this.control, 'Property', modifiedValue, null, flexSettings);
48
- this.isClearButtonEnabled = !this.isClearButtonEnabled;
49
- return [command];
50
- }
51
- return [];
52
- }
53
- }
54
- var __exports = {
55
- __esModule: true
56
- };
57
- __exports.ENABLE_CLEAR_FILTER_BAR_TYPE = ENABLE_CLEAR_FILTER_BAR_TYPE;
58
- __exports.ToggleClearFilterBarQuickAction = ToggleClearFilterBarQuickAction;
59
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/rta/command/CommandFactory", "../../../cpe/quick-actions/utils", "../../../utils/core", "../simple-quick-action-base"], function (CommandFactory, _____cpe_quick_actions_utils, _____utils_core, ___simple_quick_action_base) {
4
+ "use strict";
5
+
6
+ const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
7
+ const getControlById = _____utils_core["getControlById"];
8
+ const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
9
+ const ENABLE_CLEAR_FILTER_BAR_TYPE = 'enable-clear-filter-bar';
10
+ const PROPERTY_NAME = 'showClearOnFB';
11
+ const CONTROL_TYPE_LR = 'sap.ui.comp.smartfilterbar.SmartFilterBar';
12
+ const CONTROL_TYPE_ALP = 'sap.suite.ui.generic.template.AnalyticalListPage.control.SmartFilterBarExt';
13
+
14
+ /**
15
+ * Quick Action for toggling the visibility of "clear filter bar" button in List Report page.
16
+ */
17
+ class ToggleClearFilterBarQuickAction extends SimpleQuickActionDefinitionBase {
18
+ constructor(context) {
19
+ super(ENABLE_CLEAR_FILTER_BAR_TYPE, [], '', context);
20
+ }
21
+ isClearButtonEnabled = false;
22
+ initialize() {
23
+ const controls = [...(this.context.controlIndex[CONTROL_TYPE_LR] ?? []), ...(this.context.controlIndex[CONTROL_TYPE_ALP] ?? [])];
24
+ for (const control of controls) {
25
+ const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
26
+ const modifiedControl = getControlById(control.controlId);
27
+ if (isActionApplicable && modifiedControl) {
28
+ this.isClearButtonEnabled = modifiedControl.getShowClearOnFB();
29
+ this.control = modifiedControl;
30
+ }
31
+ }
32
+ return Promise.resolve();
33
+ }
34
+ get textKey() {
35
+ return this.isClearButtonEnabled ? 'V2_QUICK_ACTION_LR_DISABLE_CLEAR_FILTER_BAR' : 'V2_QUICK_ACTION_LR_ENABLE_CLEAR_FILTER_BAR';
36
+ }
37
+ async execute() {
38
+ if (this.control) {
39
+ const {
40
+ flexSettings
41
+ } = this.context;
42
+ const modifiedValue = {
43
+ generator: flexSettings.generator,
44
+ propertyName: PROPERTY_NAME,
45
+ newValue: !this.isClearButtonEnabled
46
+ };
47
+ const command = await CommandFactory.getCommandFor(this.control, 'Property', modifiedValue, null, flexSettings);
48
+ this.isClearButtonEnabled = !this.isClearButtonEnabled;
49
+ return [command];
50
+ }
51
+ return [];
52
+ }
53
+ }
54
+ var __exports = {
55
+ __esModule: true
56
+ };
57
+ __exports.ENABLE_CLEAR_FILTER_BAR_TYPE = ENABLE_CLEAR_FILTER_BAR_TYPE;
58
+ __exports.ToggleClearFilterBarQuickAction = ToggleClearFilterBarQuickAction;
59
+ return __exports;
60
60
  });
61
61
  //# sourceMappingURL=lr-toggle-clear-filter-bar.js.map
@@ -1,95 +1,95 @@
1
- "use strict";
2
-
3
- sap.ui.define(["../table-quick-action-base", "../control-types", "./utils", "../../../utils/version", "../../../utils/core", "../common/utils", "./create-table-custom-column"], function (___table_quick_action_base, ___control_types, ___utils, _____utils_version, _____utils_core, ___common_utils, ___create_table_custom_column) {
4
- "use strict";
5
-
6
- const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
7
- const ANALYTICAL_TABLE_TYPE = ___control_types["ANALYTICAL_TABLE_TYPE"];
8
- const SMART_TABLE_TYPE = ___control_types["SMART_TABLE_TYPE"];
9
- const TREE_TABLE_TYPE = ___control_types["TREE_TABLE_TYPE"];
10
- const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
11
- const prepareManifestChange = ___utils["prepareManifestChange"];
12
- const getUi5Version = _____utils_version["getUi5Version"];
13
- const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
14
- const isA = _____utils_core["isA"];
15
- const getTooltipsForTableEmptyRowModeAction = ___common_utils["getTooltipsForTableEmptyRowModeAction"];
16
- const preprocessActionExecution = ___create_table_custom_column["preprocessActionExecution"];
17
- const ENABLE_TABLE_EMPTY_ROW_MODE = 'enable-table-empty-row-mode';
18
- const CONTROL_TYPES = [SMART_TABLE_TYPE];
19
- const UNSUPPORTED_TABLES = [ANALYTICAL_TABLE_TYPE, TREE_TABLE_TYPE];
20
- const CREATION_ROWS_MODE = 'creationRows';
21
- const OBJECT_PAGE_COMPONENT_NAME = 'sap.suite.ui.generic.template.ObjectPage';
22
- class EnableTableEmptyRowModeQuickAction extends TableQuickActionDefinitionBase {
23
- forceRefreshAfterExecution = true;
24
- constructor(context) {
25
- super(ENABLE_TABLE_EMPTY_ROW_MODE, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLE_EMPTY_ROW_MODE', context);
26
- }
27
- async initialize() {
28
- const version = await getUi5Version();
29
- if (!(await areManifestChangesSupported(this.context.manifest))) {
30
- return;
31
- }
32
- if (isLowerThanMinimalUi5Version(version, {
33
- major: 1,
34
- minor: 120,
35
- patch: 23
36
- })) {
37
- this.isApplicable = false;
38
- return;
39
- }
40
- const {
41
- alreadyEnabledTooltip,
42
- unsupportedCreationRowsTooltip
43
- } = getTooltipsForTableEmptyRowModeAction(this.context.resourceBundle);
44
- const processChild = (child, mapKey) => {
45
- const table = this.tableMap[mapKey]?.table;
46
- if (table) {
47
- const innerTable = this.getInternalTable(table);
48
- if (innerTable) {
49
- if (UNSUPPORTED_TABLES.some(t => isA(t, innerTable))) {
50
- child.enabled = false;
51
- child.tooltip = unsupportedCreationRowsTooltip;
52
- } else if (table.data('creationMode') === CREATION_ROWS_MODE) {
53
- child.enabled = false;
54
- child.tooltip = alreadyEnabledTooltip;
55
- }
56
- }
57
- }
58
- child.children.forEach((nestedChild, idx) => processChild(nestedChild, `${mapKey}/${idx.toFixed(0)}`));
59
- };
60
- await super.initialize();
61
-
62
- // disable nested actions based on conditions
63
- this.children.forEach((nestedChild, idx) => processChild(nestedChild, `${idx.toFixed(0)}`));
64
- }
65
- async execute(path) {
66
- const {
67
- table,
68
- sectionInfo,
69
- iconTabBarFilterKey
70
- } = this.tableMap[path];
71
- if (!table) {
72
- throw Error('Internal error. Table element not found');
73
- }
74
- const sectionId = table.data('sectionId');
75
- if (!sectionId) {
76
- throw Error('Internal error. Table sectionId property not found');
77
- }
78
- const entitySet = this.context.view.getParent()?.getProperty('entitySet');
79
- if (!entitySet) {
80
- throw Error('Internal error. Object Page entity set not found');
81
- }
82
- preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
83
- this.selectOverlay(table);
84
- const commands = await prepareManifestChange(this.context, `component/settings/sections/${sectionId}/createMode`, table, OBJECT_PAGE_COMPONENT_NAME, entitySet, CREATION_ROWS_MODE);
85
- return commands ?? [];
86
- }
87
- }
88
- var __exports = {
89
- __esModule: true
90
- };
91
- __exports.ENABLE_TABLE_EMPTY_ROW_MODE = ENABLE_TABLE_EMPTY_ROW_MODE;
92
- __exports.EnableTableEmptyRowModeQuickAction = EnableTableEmptyRowModeQuickAction;
93
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["../table-quick-action-base", "../control-types", "./utils", "../../../utils/version", "../../../utils/core", "../common/utils", "./create-table-custom-column"], function (___table_quick_action_base, ___control_types, ___utils, _____utils_version, _____utils_core, ___common_utils, ___create_table_custom_column) {
4
+ "use strict";
5
+
6
+ const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
7
+ const ANALYTICAL_TABLE_TYPE = ___control_types["ANALYTICAL_TABLE_TYPE"];
8
+ const SMART_TABLE_TYPE = ___control_types["SMART_TABLE_TYPE"];
9
+ const TREE_TABLE_TYPE = ___control_types["TREE_TABLE_TYPE"];
10
+ const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
11
+ const prepareManifestChange = ___utils["prepareManifestChange"];
12
+ const getUi5Version = _____utils_version["getUi5Version"];
13
+ const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
14
+ const isA = _____utils_core["isA"];
15
+ const getTooltipsForTableEmptyRowModeAction = ___common_utils["getTooltipsForTableEmptyRowModeAction"];
16
+ const preprocessActionExecution = ___create_table_custom_column["preprocessActionExecution"];
17
+ const ENABLE_TABLE_EMPTY_ROW_MODE = 'enable-table-empty-row-mode';
18
+ const CONTROL_TYPES = [SMART_TABLE_TYPE];
19
+ const UNSUPPORTED_TABLES = [ANALYTICAL_TABLE_TYPE, TREE_TABLE_TYPE];
20
+ const CREATION_ROWS_MODE = 'creationRows';
21
+ const OBJECT_PAGE_COMPONENT_NAME = 'sap.suite.ui.generic.template.ObjectPage';
22
+ class EnableTableEmptyRowModeQuickAction extends TableQuickActionDefinitionBase {
23
+ forceRefreshAfterExecution = true;
24
+ constructor(context) {
25
+ super(ENABLE_TABLE_EMPTY_ROW_MODE, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLE_EMPTY_ROW_MODE', context);
26
+ }
27
+ async initialize() {
28
+ const version = await getUi5Version();
29
+ if (!(await areManifestChangesSupported(this.context.manifest))) {
30
+ return;
31
+ }
32
+ if (isLowerThanMinimalUi5Version(version, {
33
+ major: 1,
34
+ minor: 120,
35
+ patch: 23
36
+ })) {
37
+ this.isApplicable = false;
38
+ return;
39
+ }
40
+ const {
41
+ alreadyEnabledTooltip,
42
+ unsupportedCreationRowsTooltip
43
+ } = getTooltipsForTableEmptyRowModeAction(this.context.resourceBundle);
44
+ const processChild = (child, mapKey) => {
45
+ const table = this.tableMap[mapKey]?.table;
46
+ if (table) {
47
+ const innerTable = this.getInternalTable(table);
48
+ if (innerTable) {
49
+ if (UNSUPPORTED_TABLES.some(t => isA(t, innerTable))) {
50
+ child.enabled = false;
51
+ child.tooltip = unsupportedCreationRowsTooltip;
52
+ } else if (table.data('creationMode') === CREATION_ROWS_MODE) {
53
+ child.enabled = false;
54
+ child.tooltip = alreadyEnabledTooltip;
55
+ }
56
+ }
57
+ }
58
+ child.children.forEach((nestedChild, idx) => processChild(nestedChild, `${mapKey}/${idx.toFixed(0)}`));
59
+ };
60
+ await super.initialize();
61
+
62
+ // disable nested actions based on conditions
63
+ this.children.forEach((nestedChild, idx) => processChild(nestedChild, `${idx.toFixed(0)}`));
64
+ }
65
+ async execute(path) {
66
+ const {
67
+ table,
68
+ sectionInfo,
69
+ iconTabBarFilterKey
70
+ } = this.tableMap[path];
71
+ if (!table) {
72
+ throw Error('Internal error. Table element not found');
73
+ }
74
+ const sectionId = table.data('sectionId');
75
+ if (!sectionId) {
76
+ throw Error('Internal error. Table sectionId property not found');
77
+ }
78
+ const entitySet = this.context.view.getParent()?.getProperty('entitySet');
79
+ if (!entitySet) {
80
+ throw Error('Internal error. Object Page entity set not found');
81
+ }
82
+ preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
83
+ this.selectOverlay(table);
84
+ const commands = await prepareManifestChange(this.context, `component/settings/sections/${sectionId}/createMode`, table, OBJECT_PAGE_COMPONENT_NAME, entitySet, CREATION_ROWS_MODE);
85
+ return commands ?? [];
86
+ }
87
+ }
88
+ var __exports = {
89
+ __esModule: true
90
+ };
91
+ __exports.ENABLE_TABLE_EMPTY_ROW_MODE = ENABLE_TABLE_EMPTY_ROW_MODE;
92
+ __exports.EnableTableEmptyRowModeQuickAction = EnableTableEmptyRowModeQuickAction;
93
+ return __exports;
94
94
  });
95
95
  //# sourceMappingURL=op-enable-empty-row-mode.js.map
@@ -1,86 +1,86 @@
1
- "use strict";
2
-
3
- sap.ui.define(["../table-quick-action-base", "../control-types", "./utils", "./create-table-custom-column"], function (___table_quick_action_base, ___control_types, ___utils, ___create_table_custom_column) {
4
- "use strict";
5
-
6
- const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
7
- const SMART_TABLE_TYPE = ___control_types["SMART_TABLE_TYPE"];
8
- const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
9
- const prepareManifestChange = ___utils["prepareManifestChange"];
10
- const preprocessActionExecution = ___create_table_custom_column["preprocessActionExecution"];
11
- const ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS = 'enable-variant-management-in-tables-charts';
12
- const CONTROL_TYPES = [SMART_TABLE_TYPE];
13
- const OBJECT_PAGE_COMPONENT_NAME = 'sap.suite.ui.generic.template.ObjectPage';
14
- class EnableObjectPageVariantManagementQuickAction extends TableQuickActionDefinitionBase {
15
- forceRefreshAfterExecution = true;
16
- constructor(context) {
17
- super(ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLES_AND_VARIANT_MANAGEMENT', context);
18
- }
19
- async initialize() {
20
- if (!(await areManifestChangesSupported(this.context.manifest))) {
21
- this.isApplicable = false;
22
- return;
23
- }
24
- await super.initialize();
25
- const processChild = (child, mapKey) => {
26
- const alreadyEnabledTooltip = this.context.resourceBundle.getText('VARIANT_MANAGEMENT_FOR_TABLE_CONTROLS_IS_ALREADY_ENABLED', [child.label]);
27
- const vmSetupNotSupported = this.context.resourceBundle.getText('VARIANT_MANAGEMENT_FOR_CUSTOM_TABLES_NOT_SUPPORTED', [child.label]);
28
- const table = this.tableMap[mapKey]?.table;
29
- if (table) {
30
- const id = table.getId();
31
- if (typeof id !== 'string') {
32
- throw new Error('Could not retrieve configuration property because control id is not valid!');
33
- }
34
- let value = this.context.changeService.getConfigurationPropertyValue(id, 'variantManagement');
35
- if (value === undefined) {
36
- value = !!table.getVariantManagement();
37
- }
38
- const sectionId = table.data('sectionId');
39
- let tooltip;
40
- if (!sectionId) {
41
- tooltip = vmSetupNotSupported;
42
- } else if (value) {
43
- tooltip = alreadyEnabledTooltip;
44
- }
45
- if (value || !sectionId) {
46
- child.enabled = false;
47
- child.tooltip = tooltip;
48
- }
49
- }
50
- child.children.forEach((nestedChild, idx) => processChild(nestedChild, `${mapKey}/${idx.toFixed(0)}`));
51
- };
52
- this.children.forEach((nestedChild, idx) => processChild(nestedChild, `${idx.toFixed(0)}`));
53
- }
54
- async execute(path) {
55
- const {
56
- table,
57
- sectionInfo,
58
- iconTabBarFilterKey
59
- } = this.tableMap[path];
60
- if (!table) {
61
- throw Error('Internal error. Table element not found');
62
- }
63
- const entitySet = this.context.view.getParent()?.getProperty('entitySet');
64
- if (!entitySet) {
65
- throw Error('Internal error. Object Page entity set not found');
66
- }
67
- const sectionId = table.data('sectionId');
68
- if (!sectionId) {
69
- throw Error('Internal error. Table sectionId property not found');
70
- }
71
- preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
72
- this.selectOverlay(table);
73
- const commands = await prepareManifestChange(this.context, `component/settings/sections/${sectionId}/tableSettings`, table, OBJECT_PAGE_COMPONENT_NAME, entitySet, {
74
- 'variantManagement': true
75
- });
76
- return commands ?? [];
77
- }
78
- }
79
- var __exports = {
80
- __esModule: true
81
- };
82
- __exports.ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS = ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS;
83
- __exports.EnableObjectPageVariantManagementQuickAction = EnableObjectPageVariantManagementQuickAction;
84
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["../table-quick-action-base", "../control-types", "./utils", "./create-table-custom-column"], function (___table_quick_action_base, ___control_types, ___utils, ___create_table_custom_column) {
4
+ "use strict";
5
+
6
+ const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
7
+ const SMART_TABLE_TYPE = ___control_types["SMART_TABLE_TYPE"];
8
+ const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
9
+ const prepareManifestChange = ___utils["prepareManifestChange"];
10
+ const preprocessActionExecution = ___create_table_custom_column["preprocessActionExecution"];
11
+ const ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS = 'enable-variant-management-in-tables-charts';
12
+ const CONTROL_TYPES = [SMART_TABLE_TYPE];
13
+ const OBJECT_PAGE_COMPONENT_NAME = 'sap.suite.ui.generic.template.ObjectPage';
14
+ class EnableObjectPageVariantManagementQuickAction extends TableQuickActionDefinitionBase {
15
+ forceRefreshAfterExecution = true;
16
+ constructor(context) {
17
+ super(ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLES_AND_VARIANT_MANAGEMENT', context);
18
+ }
19
+ async initialize() {
20
+ if (!(await areManifestChangesSupported(this.context.manifest))) {
21
+ this.isApplicable = false;
22
+ return;
23
+ }
24
+ await super.initialize();
25
+ const processChild = (child, mapKey) => {
26
+ const alreadyEnabledTooltip = this.context.resourceBundle.getText('VARIANT_MANAGEMENT_FOR_TABLE_CONTROLS_IS_ALREADY_ENABLED', [child.label]);
27
+ const vmSetupNotSupported = this.context.resourceBundle.getText('VARIANT_MANAGEMENT_FOR_CUSTOM_TABLES_NOT_SUPPORTED', [child.label]);
28
+ const table = this.tableMap[mapKey]?.table;
29
+ if (table) {
30
+ const id = table.getId();
31
+ if (typeof id !== 'string') {
32
+ throw new Error('Could not retrieve configuration property because control id is not valid!');
33
+ }
34
+ let value = this.context.changeService.getConfigurationPropertyValue(id, 'variantManagement');
35
+ if (value === undefined) {
36
+ value = !!table.getVariantManagement();
37
+ }
38
+ const sectionId = table.data('sectionId');
39
+ let tooltip;
40
+ if (!sectionId) {
41
+ tooltip = vmSetupNotSupported;
42
+ } else if (value) {
43
+ tooltip = alreadyEnabledTooltip;
44
+ }
45
+ if (value || !sectionId) {
46
+ child.enabled = false;
47
+ child.tooltip = tooltip;
48
+ }
49
+ }
50
+ child.children.forEach((nestedChild, idx) => processChild(nestedChild, `${mapKey}/${idx.toFixed(0)}`));
51
+ };
52
+ this.children.forEach((nestedChild, idx) => processChild(nestedChild, `${idx.toFixed(0)}`));
53
+ }
54
+ async execute(path) {
55
+ const {
56
+ table,
57
+ sectionInfo,
58
+ iconTabBarFilterKey
59
+ } = this.tableMap[path];
60
+ if (!table) {
61
+ throw Error('Internal error. Table element not found');
62
+ }
63
+ const entitySet = this.context.view.getParent()?.getProperty('entitySet');
64
+ if (!entitySet) {
65
+ throw Error('Internal error. Object Page entity set not found');
66
+ }
67
+ const sectionId = table.data('sectionId');
68
+ if (!sectionId) {
69
+ throw Error('Internal error. Table sectionId property not found');
70
+ }
71
+ preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
72
+ this.selectOverlay(table);
73
+ const commands = await prepareManifestChange(this.context, `component/settings/sections/${sectionId}/tableSettings`, table, OBJECT_PAGE_COMPONENT_NAME, entitySet, {
74
+ 'variantManagement': true
75
+ });
76
+ return commands ?? [];
77
+ }
78
+ }
79
+ var __exports = {
80
+ __esModule: true
81
+ };
82
+ __exports.ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS = ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS;
83
+ __exports.EnableObjectPageVariantManagementQuickAction = EnableObjectPageVariantManagementQuickAction;
84
+ return __exports;
85
85
  });
86
86
  //# sourceMappingURL=op-enable-variant-management.js.map