@sap-ux/preview-middleware 0.16.155 → 0.16.157

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/dist/client/adp/api-handler.js +142 -142
  2. package/dist/client/adp/command-executor.js +75 -75
  3. package/dist/client/adp/control-utils.js +44 -44
  4. package/dist/client/adp/controllers/AddFragment.controller.js +5 -6
  5. package/dist/client/adp/controllers/AddFragment.controller.ts +1 -2
  6. package/dist/client/adp/controllers/AddTableColumnFragments.controller.js +0 -1
  7. package/dist/client/adp/controllers/AddTableColumnFragments.controller.ts +0 -1
  8. package/dist/client/adp/controllers/BaseDialog.controller.js +187 -187
  9. package/dist/client/adp/controllers/BaseDialog.controller.ts +0 -4
  10. package/dist/client/adp/controllers/ControllerExtension.controller.js +213 -213
  11. package/dist/client/adp/controllers/ExtensionPoint.controller.js +138 -138
  12. package/dist/client/adp/dialog-factory.js +115 -0
  13. package/dist/client/adp/dialog-factory.ts +134 -0
  14. package/dist/client/adp/extension-point.js +6 -6
  15. package/dist/client/adp/extension-point.ts +2 -2
  16. package/dist/client/adp/init-dialogs.js +100 -157
  17. package/dist/client/adp/init-dialogs.ts +5 -77
  18. package/dist/client/adp/quick-actions/common/add-controller-to-page.js +55 -54
  19. package/dist/client/adp/quick-actions/common/add-controller-to-page.ts +5 -3
  20. package/dist/client/adp/quick-actions/common/create-page-action.js +50 -49
  21. package/dist/client/adp/quick-actions/common/create-page-action.ts +7 -4
  22. package/dist/client/adp/quick-actions/common/op-add-custom-section.js +36 -35
  23. package/dist/client/adp/quick-actions/common/op-add-custom-section.ts +6 -3
  24. package/dist/client/adp/quick-actions/common/op-add-header-field.js +48 -47
  25. package/dist/client/adp/quick-actions/common/op-add-header-field.ts +7 -4
  26. package/dist/client/adp/quick-actions/common/utils.js +20 -0
  27. package/dist/client/adp/quick-actions/common/utils.ts +7 -0
  28. package/dist/client/adp/quick-actions/control-types.js +23 -0
  29. package/dist/client/adp/quick-actions/control-types.ts +6 -0
  30. package/dist/client/adp/quick-actions/dialog-enablement-validator.js +26 -0
  31. package/dist/client/adp/quick-actions/dialog-enablement-validator.ts +18 -0
  32. package/dist/client/adp/quick-actions/enablement-validator.js +6 -0
  33. package/dist/client/adp/quick-actions/enablement-validator.ts +18 -0
  34. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +101 -100
  35. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.ts +11 -3
  36. package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +70 -69
  37. package/dist/client/adp/quick-actions/fe-v2/create-table-action.ts +6 -3
  38. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +96 -95
  39. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.ts +27 -21
  40. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +60 -56
  41. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.ts +8 -3
  42. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +77 -67
  43. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.ts +37 -16
  44. package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +57 -57
  45. package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +95 -0
  46. package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.ts +99 -0
  47. package/dist/client/adp/quick-actions/fe-v2/registry.js +72 -71
  48. package/dist/client/adp/quick-actions/fe-v2/registry.ts +3 -1
  49. package/dist/client/adp/quick-actions/fe-v2/utils.js +95 -86
  50. package/dist/client/adp/quick-actions/fe-v2/utils.ts +14 -4
  51. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +49 -47
  52. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.ts +5 -1
  53. package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +47 -45
  54. package/dist/client/adp/quick-actions/fe-v4/create-table-action.ts +17 -7
  55. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +46 -45
  56. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.ts +11 -12
  57. package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +55 -55
  58. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +82 -82
  59. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.ts +4 -4
  60. package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +52 -52
  61. package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +91 -0
  62. package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.ts +85 -0
  63. package/dist/client/adp/quick-actions/fe-v4/registry.js +56 -55
  64. package/dist/client/adp/quick-actions/fe-v4/registry.ts +3 -1
  65. package/dist/client/adp/quick-actions/fe-v4/table-quick-action-base.js +11 -17
  66. package/dist/client/adp/quick-actions/fe-v4/table-quick-action-base.ts +17 -18
  67. package/dist/client/adp/quick-actions/fe-v4/utils.js +47 -47
  68. package/dist/client/adp/quick-actions/load.js +44 -44
  69. package/dist/client/adp/quick-actions/quick-action-base.js +55 -0
  70. package/dist/client/adp/quick-actions/quick-action-base.ts +55 -0
  71. package/dist/client/adp/quick-actions/simple-quick-action-base.js +8 -13
  72. package/dist/client/adp/quick-actions/simple-quick-action-base.ts +10 -18
  73. package/dist/client/adp/quick-actions/table-quick-action-base.js +24 -29
  74. package/dist/client/adp/quick-actions/table-quick-action-base.ts +39 -28
  75. package/dist/client/adp/utils.js +160 -160
  76. package/dist/client/cpe/changes/index.js +10 -10
  77. package/dist/client/cpe/changes/service.js +30 -0
  78. package/dist/client/cpe/changes/service.ts +46 -0
  79. package/dist/client/cpe/changes/validator.js +34 -34
  80. package/dist/client/cpe/documentation.js +164 -164
  81. package/dist/client/cpe/feature-service.js +36 -36
  82. package/dist/client/cpe/logger.js +30 -30
  83. package/dist/client/cpe/outline/editable.js +37 -37
  84. package/dist/client/cpe/outline/nodes.js +217 -217
  85. package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
  86. package/dist/client/cpe/quick-actions/quick-action-definition.ts +5 -1
  87. package/dist/client/cpe/quick-actions/quick-action-service.js +10 -4
  88. package/dist/client/cpe/quick-actions/quick-action-service.ts +9 -3
  89. package/dist/client/cpe/quick-actions/registry.js +143 -143
  90. package/dist/client/cpe/quick-actions/utils.js +92 -92
  91. package/dist/client/cpe/types.js +4 -4
  92. package/dist/client/cpe/ui5-utils.js +33 -33
  93. package/dist/client/cpe/utils.js +138 -138
  94. package/dist/client/flp/WorkspaceConnector.js +86 -86
  95. package/dist/client/flp/common.js +28 -28
  96. package/dist/client/flp/enableFakeConnector.js +83 -83
  97. package/dist/client/flp/initConnectors.js +30 -30
  98. package/dist/client/flp/initRta.js +178 -178
  99. package/dist/client/i18n.js +56 -56
  100. package/dist/client/messagebundle.properties +5 -3
  101. package/dist/client/utils/application.js +32 -32
  102. package/dist/client/utils/core.js +68 -68
  103. package/dist/client/utils/error.js +19 -19
  104. package/dist/client/utils/fe-v4.js +118 -114
  105. package/dist/client/utils/fe-v4.ts +19 -11
  106. package/dist/client/utils/version.js +102 -102
  107. package/package.json +4 -4
@@ -1,69 +1,79 @@
1
- "use strict";
2
-
3
- sap.ui.define(["../../../cpe/quick-actions/utils", "../table-quick-action-base", "./utils", "../simple-quick-action-base", "../../../utils/core"], function (_____cpe_quick_actions_utils, ___table_quick_action_base, ___utils, ___simple_quick_action_base, _____utils_core) {
4
- "use strict";
5
-
6
- const getRelevantControlFromActivePage = _____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
7
- const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
8
- const GRID_TABLE_TYPE = ___table_quick_action_base["GRID_TABLE_TYPE"];
9
- const M_TABLE_TYPE = ___table_quick_action_base["M_TABLE_TYPE"];
10
- const SMART_TABLE_TYPE = ___table_quick_action_base["SMART_TABLE_TYPE"];
11
- const TREE_TABLE_TYPE = ___table_quick_action_base["TREE_TABLE_TYPE"];
12
- const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
13
- const prepareManifestChange = ___utils["prepareManifestChange"];
14
- const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
15
- const isA = _____utils_core["isA"];
16
- const COMPONENT = 'sap.suite.ui.generic.template.ListReport';
17
- const ENABLE_TABLE_FILTERING = 'enable-table-filtering';
18
- const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, TREE_TABLE_TYPE, GRID_TABLE_TYPE];
19
-
20
- /**
21
- * Quick Action for enabling table filtering using table personalization settings.
22
- */
23
- class EnableTableFilteringQuickAction extends SimpleQuickActionDefinitionBase {
24
- constructor(context) {
25
- super(ENABLE_TABLE_FILTERING, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLE_FILTERING', context);
26
- }
27
- forceRefreshAfterExecution = true;
28
- lsTableMap = {};
29
- get tooltip() {
30
- return this.isDisabled ? this.context.resourceBundle.getText('TABLE_FILTERING_CHANGE_HAS_ALREADY_BEEN_MADE') : undefined;
31
- }
32
- async initialize() {
33
- const manifestChangesSupported = await areManifestChangesSupported(this.context.manifest);
34
- if (!manifestChangesSupported) {
35
- return;
36
- }
37
- for (const table of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, CONTROL_TYPES)) {
38
- if (table) {
39
- const isFilterEnabled = table.data('p13nDialogSettings').filter.visible;
40
- const isActionApplicable = pageHasControlId(this.context.view, table.getId());
41
- if (isActionApplicable) {
42
- this.isDisabled = isFilterEnabled;
43
- this.control = table;
44
- break;
45
- }
46
- }
47
- }
48
- return Promise.resolve();
49
- }
50
- async execute() {
51
- if (!this.control) {
52
- return [];
53
- }
54
- const entitySet = isA(SMART_TABLE_TYPE, this.control) ? this.control.getEntitySet() : undefined;
55
- const command = await prepareManifestChange(this.context, 'component/settings', this.control, COMPONENT, entitySet, {
56
- enableTableFilterInPageVariant: !this.isDisabled
57
- });
58
- this.isDisabled = !this.isDisabled;
59
- return command;
60
- }
61
- }
62
- var __exports = {
63
- __esModule: true
64
- };
65
- __exports.ENABLE_TABLE_FILTERING = ENABLE_TABLE_FILTERING;
66
- __exports.EnableTableFilteringQuickAction = EnableTableFilteringQuickAction;
67
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["../../../cpe/quick-actions/utils", "../control-types", "./utils", "../simple-quick-action-base", "../../../utils/core"], function (_____cpe_quick_actions_utils, ___control_types, ___utils, ___simple_quick_action_base, _____utils_core) {
4
+ "use strict";
5
+
6
+ const getRelevantControlFromActivePage = _____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
7
+ const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
8
+ const GRID_TABLE_TYPE = ___control_types["GRID_TABLE_TYPE"];
9
+ const M_TABLE_TYPE = ___control_types["M_TABLE_TYPE"];
10
+ const SMART_TABLE_TYPE = ___control_types["SMART_TABLE_TYPE"];
11
+ const TREE_TABLE_TYPE = ___control_types["TREE_TABLE_TYPE"];
12
+ const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
13
+ const prepareManifestChange = ___utils["prepareManifestChange"];
14
+ const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
15
+ const isA = _____utils_core["isA"];
16
+ const COMPONENT = 'sap.suite.ui.generic.template.ListReport';
17
+ const ENABLE_TABLE_FILTERING = 'enable-table-filtering';
18
+ const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, TREE_TABLE_TYPE, GRID_TABLE_TYPE];
19
+
20
+ /**
21
+ * Quick Action for enabling table filtering using table personalization settings.
22
+ */
23
+ class EnableTableFilteringQuickAction extends SimpleQuickActionDefinitionBase {
24
+ constructor(context) {
25
+ super(ENABLE_TABLE_FILTERING, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLE_FILTERING', context, [{
26
+ run: () => {
27
+ if (this.control) {
28
+ const id = this.control.getProperty('persistencyKey') ?? this.control.getId();
29
+ if (typeof id !== 'string') {
30
+ throw new Error('Could not retrieve configuration property because control id is not valid!');
31
+ }
32
+ const value = this.context.changeService.getConfigurationPropertyValue(id, 'enableTableFilterInPageVariant');
33
+ const isFilterEnabled = value === undefined ? this.control.data('p13nDialogSettings')?.filter?.visible : value;
34
+ if (isFilterEnabled) {
35
+ return {
36
+ type: 'error',
37
+ message: this.context.resourceBundle.getText('TABLE_FILTERING_CHANGE_HAS_ALREADY_BEEN_MADE')
38
+ };
39
+ }
40
+ }
41
+ return undefined;
42
+ }
43
+ }]);
44
+ }
45
+ forceRefreshAfterExecution = true;
46
+ async initialize() {
47
+ const manifestChangesSupported = await areManifestChangesSupported(this.context.manifest);
48
+ if (!manifestChangesSupported) {
49
+ return;
50
+ }
51
+ for (const table of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, CONTROL_TYPES)) {
52
+ if (table) {
53
+ const isActionApplicable = pageHasControlId(this.context.view, table.getId());
54
+ if (isActionApplicable) {
55
+ this.control = table;
56
+ break;
57
+ }
58
+ }
59
+ }
60
+ }
61
+ async execute() {
62
+ if (!this.control) {
63
+ return [];
64
+ }
65
+ const entitySet = isA(SMART_TABLE_TYPE, this.control) ? this.control.getEntitySet() : undefined;
66
+ const command = await prepareManifestChange(this.context, 'component/settings', this.control, COMPONENT, entitySet, {
67
+ enableTableFilterInPageVariant: !this.isDisabled
68
+ });
69
+ return command;
70
+ }
71
+ }
72
+ var __exports = {
73
+ __esModule: true
74
+ };
75
+ __exports.ENABLE_TABLE_FILTERING = ENABLE_TABLE_FILTERING;
76
+ __exports.EnableTableFilteringQuickAction = EnableTableFilteringQuickAction;
77
+ return __exports;
68
78
  });
69
79
  //# sourceMappingURL=lr-enable-table-filtering.js.map
@@ -1,12 +1,15 @@
1
- import FlexCommand from 'sap/ui/rta/command/FlexCommand';
1
+ import SmartTable from 'sap/ui/comp/smarttable/SmartTable';
2
+
3
+ import type FlexCommand from 'sap/ui/rta/command/FlexCommand';
4
+
2
5
  import { QuickActionContext, SimpleQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
3
6
  import { getRelevantControlFromActivePage, pageHasControlId } from '../../../cpe/quick-actions/utils';
4
- import { GRID_TABLE_TYPE, M_TABLE_TYPE, SMART_TABLE_TYPE, TREE_TABLE_TYPE } from '../table-quick-action-base';
7
+ import { GRID_TABLE_TYPE, M_TABLE_TYPE, SMART_TABLE_TYPE, TREE_TABLE_TYPE } from '../control-types';
5
8
  import { areManifestChangesSupported, prepareManifestChange } from './utils';
6
9
 
7
10
  import { SimpleQuickActionDefinitionBase } from '../simple-quick-action-base';
8
11
  import { isA } from '../../../utils/core';
9
- import SmartTable from 'sap/ui/comp/smarttable/SmartTable';
12
+
10
13
  const COMPONENT = 'sap.suite.ui.generic.template.ListReport';
11
14
 
12
15
  export const ENABLE_TABLE_FILTERING = 'enable-table-filtering';
@@ -21,15 +24,39 @@ export class EnableTableFilteringQuickAction
21
24
  implements SimpleQuickActionDefinition
22
25
  {
23
26
  constructor(context: QuickActionContext) {
24
- super(ENABLE_TABLE_FILTERING, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLE_FILTERING', context);
27
+ super(ENABLE_TABLE_FILTERING, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLE_FILTERING', context, [
28
+ {
29
+ run: () => {
30
+ if (this.control) {
31
+ const id = (this.control.getProperty('persistencyKey') as unknown) ?? this.control.getId();
32
+ if (typeof id !== 'string') {
33
+ throw new Error(
34
+ 'Could not retrieve configuration property because control id is not valid!'
35
+ );
36
+ }
37
+ const value = this.context.changeService.getConfigurationPropertyValue(
38
+ id,
39
+ 'enableTableFilterInPageVariant'
40
+ );
41
+ const isFilterEnabled: boolean =
42
+ value === undefined
43
+ ? (this.control.data('p13nDialogSettings')?.filter?.visible as boolean)
44
+ : (value as boolean);
45
+ if (isFilterEnabled) {
46
+ return {
47
+ type: 'error',
48
+ message: this.context.resourceBundle.getText(
49
+ 'TABLE_FILTERING_CHANGE_HAS_ALREADY_BEEN_MADE'
50
+ )
51
+ };
52
+ }
53
+ }
54
+ return undefined;
55
+ }
56
+ }
57
+ ]);
25
58
  }
26
- isActive: boolean;
27
59
  readonly forceRefreshAfterExecution = true;
28
- lsTableMap: Record<string, number> = {};
29
- public get tooltip(): string | undefined {
30
- return this.isDisabled ? this.context.resourceBundle.getText('TABLE_FILTERING_CHANGE_HAS_ALREADY_BEEN_MADE') : undefined;
31
- }
32
-
33
60
  async initialize(): Promise<void> {
34
61
  const manifestChangesSupported = await areManifestChangesSupported(this.context.manifest);
35
62
  if (!manifestChangesSupported) {
@@ -41,17 +68,13 @@ export class EnableTableFilteringQuickAction
41
68
  CONTROL_TYPES
42
69
  )) {
43
70
  if (table) {
44
- const isFilterEnabled = table.data('p13nDialogSettings').filter.visible;
45
71
  const isActionApplicable = pageHasControlId(this.context.view, table.getId());
46
72
  if (isActionApplicable) {
47
- this.isDisabled = isFilterEnabled;
48
73
  this.control = table;
49
74
  break;
50
75
  }
51
76
  }
52
77
  }
53
-
54
- return Promise.resolve();
55
78
  }
56
79
 
57
80
  async execute(): Promise<FlexCommand[]> {
@@ -71,8 +94,6 @@ export class EnableTableFilteringQuickAction
71
94
  }
72
95
  );
73
96
 
74
- this.isDisabled = !this.isDisabled;
75
-
76
97
  return command;
77
98
  }
78
99
  }
@@ -1,59 +1,59 @@
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 = 'sap.ui.comp.smartfilterbar.SmartFilterBar';
12
-
13
- /**
14
- * Quick Action for toggling the visibility of "clear filter bar" button in List Report page.
15
- */
16
- class ToggleClearFilterBarQuickAction extends SimpleQuickActionDefinitionBase {
17
- constructor(context) {
18
- super(ENABLE_CLEAR_FILTER_BAR_TYPE, [], '', context);
19
- }
20
- isClearButtonEnabled = false;
21
- initialize() {
22
- const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
23
- for (const control of controls) {
24
- const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
25
- const modifiedControl = getControlById(control.controlId);
26
- if (isActionApplicable && modifiedControl) {
27
- this.isClearButtonEnabled = modifiedControl.getShowClearOnFB();
28
- this.control = modifiedControl;
29
- }
30
- }
31
- }
32
- get textKey() {
33
- return this.isClearButtonEnabled ? 'V2_QUICK_ACTION_LR_DISABLE_CLEAR_FILTER_BAR' : 'V2_QUICK_ACTION_LR_ENABLE_CLEAR_FILTER_BAR';
34
- }
35
- async execute() {
36
- if (this.control) {
37
- const {
38
- flexSettings
39
- } = this.context;
40
- const modifiedValue = {
41
- generator: flexSettings.generator,
42
- propertyName: PROPERTY_NAME,
43
- newValue: !this.isClearButtonEnabled
44
- };
45
- const command = await CommandFactory.getCommandFor(this.control, 'Property', modifiedValue, null, flexSettings);
46
- this.isClearButtonEnabled = !this.isClearButtonEnabled;
47
- return [command];
48
- }
49
- return [];
50
- }
51
- }
52
- var __exports = {
53
- __esModule: true
54
- };
55
- __exports.ENABLE_CLEAR_FILTER_BAR_TYPE = ENABLE_CLEAR_FILTER_BAR_TYPE;
56
- __exports.ToggleClearFilterBarQuickAction = ToggleClearFilterBarQuickAction;
57
- 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 = 'sap.ui.comp.smartfilterbar.SmartFilterBar';
12
+
13
+ /**
14
+ * Quick Action for toggling the visibility of "clear filter bar" button in List Report page.
15
+ */
16
+ class ToggleClearFilterBarQuickAction extends SimpleQuickActionDefinitionBase {
17
+ constructor(context) {
18
+ super(ENABLE_CLEAR_FILTER_BAR_TYPE, [], '', context);
19
+ }
20
+ isClearButtonEnabled = false;
21
+ initialize() {
22
+ const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
23
+ for (const control of controls) {
24
+ const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
25
+ const modifiedControl = getControlById(control.controlId);
26
+ if (isActionApplicable && modifiedControl) {
27
+ this.isClearButtonEnabled = modifiedControl.getShowClearOnFB();
28
+ this.control = modifiedControl;
29
+ }
30
+ }
31
+ }
32
+ get textKey() {
33
+ return this.isClearButtonEnabled ? 'V2_QUICK_ACTION_LR_DISABLE_CLEAR_FILTER_BAR' : 'V2_QUICK_ACTION_LR_ENABLE_CLEAR_FILTER_BAR';
34
+ }
35
+ async execute() {
36
+ if (this.control) {
37
+ const {
38
+ flexSettings
39
+ } = this.context;
40
+ const modifiedValue = {
41
+ generator: flexSettings.generator,
42
+ propertyName: PROPERTY_NAME,
43
+ newValue: !this.isClearButtonEnabled
44
+ };
45
+ const command = await CommandFactory.getCommandFor(this.control, 'Property', modifiedValue, null, flexSettings);
46
+ this.isClearButtonEnabled = !this.isClearButtonEnabled;
47
+ return [command];
48
+ }
49
+ return [];
50
+ }
51
+ }
52
+ var __exports = {
53
+ __esModule: true
54
+ };
55
+ __exports.ENABLE_CLEAR_FILTER_BAR_TYPE = ENABLE_CLEAR_FILTER_BAR_TYPE;
56
+ __exports.ToggleClearFilterBarQuickAction = ToggleClearFilterBarQuickAction;
57
+ return __exports;
58
58
  });
59
59
  //# sourceMappingURL=lr-toggle-clear-filter-bar.js.map
@@ -0,0 +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;
94
+ });
95
+ //# sourceMappingURL=op-enable-empty-row-mode.js.map
@@ -0,0 +1,99 @@
1
+ import FlexCommand from 'sap/ui/rta/command/FlexCommand';
2
+
3
+ import { QuickActionContext, NestedQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
4
+ import { TableQuickActionDefinitionBase } from '../table-quick-action-base';
5
+ import { ANALYTICAL_TABLE_TYPE, SMART_TABLE_TYPE, TREE_TABLE_TYPE } from '../control-types';
6
+
7
+ import { NestedQuickActionChild } from '@sap-ux-private/control-property-editor-common';
8
+ import { areManifestChangesSupported, prepareManifestChange } from './utils';
9
+ import { getUi5Version, isLowerThanMinimalUi5Version } from '../../../utils/version';
10
+ import { isA } from '../../../utils/core';
11
+ import { getTooltipsForTableEmptyRowModeAction } from '../common/utils';
12
+ import { preprocessActionExecution } from './create-table-custom-column';
13
+
14
+ export const ENABLE_TABLE_EMPTY_ROW_MODE = 'enable-table-empty-row-mode';
15
+
16
+ const CONTROL_TYPES = [SMART_TABLE_TYPE];
17
+ const UNSUPPORTED_TABLES = [ANALYTICAL_TABLE_TYPE, TREE_TABLE_TYPE];
18
+ const CREATION_ROWS_MODE = 'creationRows';
19
+ const OBJECT_PAGE_COMPONENT_NAME = 'sap.suite.ui.generic.template.ObjectPage';
20
+
21
+ export class EnableTableEmptyRowModeQuickAction
22
+ extends TableQuickActionDefinitionBase
23
+ implements NestedQuickActionDefinition
24
+ {
25
+ readonly forceRefreshAfterExecution = true;
26
+
27
+ constructor(context: QuickActionContext) {
28
+ super(ENABLE_TABLE_EMPTY_ROW_MODE, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLE_EMPTY_ROW_MODE', context);
29
+ }
30
+
31
+ async initialize(): Promise<void> {
32
+ const version = await getUi5Version();
33
+ if (!(await areManifestChangesSupported(this.context.manifest))) {
34
+ return;
35
+ }
36
+
37
+ if (isLowerThanMinimalUi5Version(version, { major: 1, minor: 120, patch: 23 })) {
38
+ this.isApplicable = false;
39
+ return;
40
+ }
41
+
42
+ const { alreadyEnabledTooltip, unsupportedCreationRowsTooltip } = getTooltipsForTableEmptyRowModeAction(
43
+ this.context.resourceBundle
44
+ );
45
+
46
+ const processChild = (child: NestedQuickActionChild, mapKey: string) => {
47
+ const table = this.tableMap[mapKey]?.table;
48
+ if (table) {
49
+ const innerTable = this.getInternalTable(table);
50
+ if (innerTable) {
51
+ if (UNSUPPORTED_TABLES.some((t) => isA(t, innerTable))) {
52
+ child.enabled = false;
53
+ child.tooltip = unsupportedCreationRowsTooltip;
54
+ } else if (table.data('creationMode') === CREATION_ROWS_MODE) {
55
+ child.enabled = false;
56
+ child.tooltip = alreadyEnabledTooltip;
57
+ }
58
+ }
59
+ }
60
+ child.children.forEach((nestedChild, idx) => processChild(nestedChild, `${mapKey}/${idx.toFixed(0)}`));
61
+ };
62
+
63
+ await super.initialize();
64
+
65
+ // disable nested actions based on conditions
66
+ this.children.forEach((nestedChild, idx) => processChild(nestedChild, `${idx.toFixed(0)}`));
67
+ }
68
+
69
+ async execute(path: string): Promise<FlexCommand[]> {
70
+ const { table, sectionInfo, iconTabBarFilterKey } = this.tableMap[path];
71
+ if (!table) {
72
+ throw Error('Internal error. Table element not found');
73
+ }
74
+
75
+ const sectionId = table.data('sectionId') as string | undefined | null;
76
+ if (!sectionId) {
77
+ throw Error('Internal error. Table sectionId property not found');
78
+ }
79
+
80
+ const entitySet = this.context.view.getParent()?.getProperty('entitySet') as string | undefined;
81
+ if (!entitySet) {
82
+ throw Error('Internal error. Object Page entity set not found');
83
+ }
84
+
85
+ preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
86
+ this.selectOverlay(table);
87
+
88
+ const commands = await prepareManifestChange(
89
+ this.context,
90
+ `component/settings/sections/${sectionId}/createMode`,
91
+ table,
92
+ OBJECT_PAGE_COMPONENT_NAME,
93
+ entitySet,
94
+ CREATION_ROWS_MODE
95
+ );
96
+
97
+ return commands ?? [];
98
+ }
99
+ }