@sap-ux/preview-middleware 0.16.170 → 0.16.172

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 (66) 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 +213 -213
  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 +122 -122
  9. package/dist/client/adp/init-dialogs.js +100 -100
  10. package/dist/client/adp/quick-actions/common/add-controller-to-page.js +55 -55
  11. package/dist/client/adp/quick-actions/common/create-page-action.js +50 -50
  12. package/dist/client/adp/quick-actions/common/op-add-custom-section.js +36 -36
  13. package/dist/client/adp/quick-actions/common/op-add-header-field.js +48 -48
  14. package/dist/client/adp/quick-actions/common/utils.js +18 -18
  15. package/dist/client/adp/quick-actions/control-types.js +21 -21
  16. package/dist/client/adp/quick-actions/dialog-enablement-validator.js +24 -24
  17. package/dist/client/adp/quick-actions/enablement-validator.js +4 -4
  18. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +101 -101
  19. package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +70 -70
  20. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +96 -96
  21. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +64 -60
  22. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.ts +15 -5
  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-toggle-clear-filter-bar.js +58 -57
  25. package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.ts +6 -2
  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/registry.js +73 -73
  28. package/dist/client/adp/quick-actions/fe-v2/registry.ts +7 -1
  29. package/dist/client/adp/quick-actions/fe-v2/utils.js +95 -95
  30. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +49 -49
  31. package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +47 -47
  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/lr-enable-semantic-date-range-filter-bar.js +55 -55
  34. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +82 -82
  35. package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +52 -52
  36. package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +89 -89
  37. package/dist/client/adp/quick-actions/fe-v4/registry.js +57 -57
  38. package/dist/client/adp/quick-actions/fe-v4/utils.js +47 -47
  39. package/dist/client/adp/quick-actions/load.js +44 -44
  40. package/dist/client/adp/quick-actions/quick-action-base.js +53 -53
  41. package/dist/client/adp/utils.js +160 -160
  42. package/dist/client/cpe/changes/index.js +10 -10
  43. package/dist/client/cpe/changes/validator.js +34 -34
  44. package/dist/client/cpe/documentation.js +164 -164
  45. package/dist/client/cpe/feature-service.js +36 -36
  46. package/dist/client/cpe/logger.js +30 -30
  47. package/dist/client/cpe/outline/editable.js +37 -37
  48. package/dist/client/cpe/outline/nodes.js +222 -222
  49. package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
  50. package/dist/client/cpe/quick-actions/registry.js +143 -143
  51. package/dist/client/cpe/quick-actions/utils.js +92 -92
  52. package/dist/client/cpe/types.js +4 -4
  53. package/dist/client/cpe/ui5-utils.js +33 -33
  54. package/dist/client/cpe/utils.js +138 -138
  55. package/dist/client/flp/WorkspaceConnector.js +86 -86
  56. package/dist/client/flp/common.js +28 -28
  57. package/dist/client/flp/enableFakeConnector.js +83 -83
  58. package/dist/client/flp/initConnectors.js +30 -30
  59. package/dist/client/flp/initRta.js +178 -178
  60. package/dist/client/i18n.js +56 -56
  61. package/dist/client/utils/application.js +32 -32
  62. package/dist/client/utils/core.js +68 -68
  63. package/dist/client/utils/error.js +19 -19
  64. package/dist/client/utils/fe-v4.js +118 -118
  65. package/dist/client/utils/version.js +102 -102
  66. package/package.json +5 -5
@@ -1,62 +1,66 @@
1
- "use strict";
2
-
3
- sap.ui.define(["../../../cpe/quick-actions/utils", "../../../utils/core", "../simple-quick-action-base", "./utils"], function (_____cpe_quick_actions_utils, _____utils_core, ___simple_quick_action_base, ___utils) {
4
- "use strict";
5
-
6
- const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
7
- const getControlById = _____utils_core["getControlById"];
8
- const isA = _____utils_core["isA"];
9
- const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
10
- const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
11
- const prepareManifestChange = ___utils["prepareManifestChange"];
12
- const ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR = 'enable-semantic-daterange-filterbar';
13
- const CONTROL_TYPE = 'sap.ui.comp.smartfilterbar.SmartFilterBar';
14
- const COMPONENT = 'sap.suite.ui.generic.template.ListReport';
15
- /**
16
- * Quick Action for toggling the visibility of "semantic date range" for filterbar fields.
17
- */
18
- class ToggleSemanticDateRangeFilterBar extends SimpleQuickActionDefinitionBase {
19
- constructor(context) {
20
- super(ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR, [], '', context);
21
- }
22
- forceRefreshAfterExecution = true;
23
- isUseDateRangeTypeEnabled = false;
24
- async initialize() {
25
- const manifestChangesSupported = await areManifestChangesSupported(this.context.manifest);
26
- if (!manifestChangesSupported) {
27
- return;
28
- }
29
- const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
30
- for (const control of controls) {
31
- const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
32
- const modifiedControl = getControlById(control.controlId);
33
- if (isActionApplicable && modifiedControl) {
34
- this.control = modifiedControl;
35
- const id = this.control.getProperty('persistencyKey') ?? this.control.getId();
36
- if (typeof id !== 'string') {
37
- throw new Error('Could not retrieve configuration property because control id is not valid!');
38
- }
39
- const value = this.context.changeService.getConfigurationPropertyValue(id, 'useDateRange');
40
- this.isUseDateRangeTypeEnabled = value === undefined ? this.control.getUseDateRangeType() : value;
41
- }
42
- }
43
- }
44
- get textKey() {
45
- return this.isUseDateRangeTypeEnabled ? 'QUICK_ACTION_LR_DISABLE_SEMANTIC_DATE_RANGE_FILTER_BAR' : 'QUICK_ACTION_LR_ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR';
46
- }
47
- async execute() {
48
- const entitySet = isA(CONTROL_TYPE, this.control) ? this.control.getEntitySet() : undefined;
49
- const command = await prepareManifestChange(this.context, 'component/settings/filterSettings/dateSettings', this.control, COMPONENT, entitySet, {
50
- useDateRange: !this.isUseDateRangeTypeEnabled
51
- });
52
- return command;
53
- }
54
- }
55
- var __exports = {
56
- __esModule: true
57
- };
58
- __exports.ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR = ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR;
59
- __exports.ToggleSemanticDateRangeFilterBar = ToggleSemanticDateRangeFilterBar;
60
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["../../../cpe/quick-actions/utils", "../../../utils/core", "../simple-quick-action-base", "./utils"], function (_____cpe_quick_actions_utils, _____utils_core, ___simple_quick_action_base, ___utils) {
4
+ "use strict";
5
+
6
+ const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
7
+ const getControlById = _____utils_core["getControlById"];
8
+ const isA = _____utils_core["isA"];
9
+ const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
10
+ const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
11
+ const prepareManifestChange = ___utils["prepareManifestChange"];
12
+ const ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR = 'enable-semantic-daterange-filterbar';
13
+ const CONTROL_TYPE_LR = 'sap.ui.comp.smartfilterbar.SmartFilterBar';
14
+ const CONTROL_TYPE_ALP = 'sap.suite.ui.generic.template.AnalyticalListPage.control.SmartFilterBarExt';
15
+ const COMPONENT_LR = 'sap.suite.ui.generic.template.ListReport';
16
+ const COMPONENT_ALP = 'sap.suite.ui.generic.template.AnalyticalListPage';
17
+
18
+ /**
19
+ * Quick Action for toggling the visibility of "semantic date range" for filterbar fields.
20
+ */
21
+ class ToggleSemanticDateRangeFilterBar extends SimpleQuickActionDefinitionBase {
22
+ constructor(context) {
23
+ super(ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR, [], '', context);
24
+ }
25
+ forceRefreshAfterExecution = true;
26
+ isUseDateRangeTypeEnabled = false;
27
+ async initialize() {
28
+ const manifestChangesSupported = await areManifestChangesSupported(this.context.manifest);
29
+ if (!manifestChangesSupported) {
30
+ return;
31
+ }
32
+ const controls = [...(this.context.controlIndex[CONTROL_TYPE_LR] ?? []), ...(this.context.controlIndex[CONTROL_TYPE_ALP] ?? [])];
33
+ for (const control of controls) {
34
+ const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
35
+ const modifiedControl = getControlById(control.controlId);
36
+ if (isActionApplicable && modifiedControl) {
37
+ this.control = modifiedControl;
38
+ const id = this.control.getProperty('persistencyKey') ?? this.control.getId();
39
+ if (typeof id !== 'string') {
40
+ throw new Error('Could not retrieve configuration property because control id is not valid!');
41
+ }
42
+ const value = this.context.changeService.getConfigurationPropertyValue(id, 'useDateRange');
43
+ this.isUseDateRangeTypeEnabled = value === undefined ? this.control.getUseDateRangeType() : value;
44
+ }
45
+ }
46
+ }
47
+ get textKey() {
48
+ return this.isUseDateRangeTypeEnabled ? 'QUICK_ACTION_LR_DISABLE_SEMANTIC_DATE_RANGE_FILTER_BAR' : 'QUICK_ACTION_LR_ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR';
49
+ }
50
+ async execute() {
51
+ const entitySet = isA(CONTROL_TYPE_LR, this.control) || isA(CONTROL_TYPE_ALP, this.control) ? this.control.getEntitySet() : undefined;
52
+ const viewName = this.context.view.getViewName();
53
+ const command = await prepareManifestChange(this.context, 'component/settings/filterSettings/dateSettings', this.control, viewName.includes('AnalyticalListPage') ? COMPONENT_ALP : COMPONENT_LR, entitySet, {
54
+ useDateRange: !this.isUseDateRangeTypeEnabled
55
+ });
56
+ return command;
57
+ }
58
+ }
59
+ var __exports = {
60
+ __esModule: true
61
+ };
62
+ __exports.ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR = ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR;
63
+ __exports.ToggleSemanticDateRangeFilterBar = ToggleSemanticDateRangeFilterBar;
64
+ return __exports;
61
65
  });
62
66
  //# sourceMappingURL=lr-enable-semantic-date-range-filter-bar.js.map
@@ -7,8 +7,11 @@ import { areManifestChangesSupported, prepareManifestChange } from './utils';
7
7
  import SmartFilterBar from 'sap/ui/comp/smartfilterbar/SmartFilterBar';
8
8
 
9
9
  export const ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR = 'enable-semantic-daterange-filterbar';
10
- const CONTROL_TYPE = 'sap.ui.comp.smartfilterbar.SmartFilterBar';
11
- const COMPONENT = 'sap.suite.ui.generic.template.ListReport';
10
+ const CONTROL_TYPE_LR = 'sap.ui.comp.smartfilterbar.SmartFilterBar';
11
+ const CONTROL_TYPE_ALP = 'sap.suite.ui.generic.template.AnalyticalListPage.control.SmartFilterBarExt';
12
+ const COMPONENT_LR = 'sap.suite.ui.generic.template.ListReport';
13
+ const COMPONENT_ALP = 'sap.suite.ui.generic.template.AnalyticalListPage';
14
+
12
15
  /**
13
16
  * Quick Action for toggling the visibility of "semantic date range" for filterbar fields.
14
17
  */
@@ -27,7 +30,10 @@ export class ToggleSemanticDateRangeFilterBar
27
30
  if (!manifestChangesSupported) {
28
31
  return;
29
32
  }
30
- const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
33
+ const controls = [
34
+ ...(this.context.controlIndex[CONTROL_TYPE_LR] ?? []),
35
+ ...(this.context.controlIndex[CONTROL_TYPE_ALP] ?? [])
36
+ ];
31
37
  for (const control of controls) {
32
38
  const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
33
39
  const modifiedControl = getControlById<SmartFilterBar>(control.controlId);
@@ -52,12 +58,16 @@ export class ToggleSemanticDateRangeFilterBar
52
58
  }
53
59
 
54
60
  async execute(): Promise<FlexCommand[]> {
55
- const entitySet = isA<SmartFilterBar>(CONTROL_TYPE, this.control) ? this.control.getEntitySet() : undefined;
61
+ const entitySet =
62
+ isA<SmartFilterBar>(CONTROL_TYPE_LR, this.control) || isA<SmartFilterBar>(CONTROL_TYPE_ALP, this.control)
63
+ ? this.control.getEntitySet()
64
+ : undefined;
65
+ const viewName = this.context.view.getViewName();
56
66
  const command = await prepareManifestChange(
57
67
  this.context,
58
68
  'component/settings/filterSettings/dateSettings',
59
69
  this.control!,
60
- COMPONENT,
70
+ viewName.includes('AnalyticalListPage') ? COMPONENT_ALP : COMPONENT_LR,
61
71
  entitySet,
62
72
  {
63
73
  useDateRange: !this.isUseDateRangeTypeEnabled
@@ -1,79 +1,79 @@
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;
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;
78
78
  });
79
79
  //# sourceMappingURL=lr-enable-table-filtering.js.map
@@ -1,59 +1,60 @@
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_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
+ }
33
+ get textKey() {
34
+ return this.isClearButtonEnabled ? 'V2_QUICK_ACTION_LR_DISABLE_CLEAR_FILTER_BAR' : 'V2_QUICK_ACTION_LR_ENABLE_CLEAR_FILTER_BAR';
35
+ }
36
+ async execute() {
37
+ if (this.control) {
38
+ const {
39
+ flexSettings
40
+ } = this.context;
41
+ const modifiedValue = {
42
+ generator: flexSettings.generator,
43
+ propertyName: PROPERTY_NAME,
44
+ newValue: !this.isClearButtonEnabled
45
+ };
46
+ const command = await CommandFactory.getCommandFor(this.control, 'Property', modifiedValue, null, flexSettings);
47
+ this.isClearButtonEnabled = !this.isClearButtonEnabled;
48
+ return [command];
49
+ }
50
+ return [];
51
+ }
52
+ }
53
+ var __exports = {
54
+ __esModule: true
55
+ };
56
+ __exports.ENABLE_CLEAR_FILTER_BAR_TYPE = ENABLE_CLEAR_FILTER_BAR_TYPE;
57
+ __exports.ToggleClearFilterBarQuickAction = ToggleClearFilterBarQuickAction;
58
+ return __exports;
58
59
  });
59
60
  //# sourceMappingURL=lr-toggle-clear-filter-bar.js.map
@@ -9,7 +9,8 @@ import { SimpleQuickActionDefinitionBase } from '../simple-quick-action-base';
9
9
 
10
10
  export const ENABLE_CLEAR_FILTER_BAR_TYPE = 'enable-clear-filter-bar';
11
11
  const PROPERTY_NAME = 'showClearOnFB';
12
- const CONTROL_TYPE = 'sap.ui.comp.smartfilterbar.SmartFilterBar';
12
+ const CONTROL_TYPE_LR = 'sap.ui.comp.smartfilterbar.SmartFilterBar';
13
+ const CONTROL_TYPE_ALP = 'sap.suite.ui.generic.template.AnalyticalListPage.control.SmartFilterBarExt';
13
14
 
14
15
  /**
15
16
  * Quick Action for toggling the visibility of "clear filter bar" button in List Report page.
@@ -25,7 +26,10 @@ export class ToggleClearFilterBarQuickAction
25
26
  private isClearButtonEnabled = false;
26
27
 
27
28
  initialize(): void {
28
- const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
29
+ const controls = [
30
+ ...(this.context.controlIndex[CONTROL_TYPE_LR] ?? []),
31
+ ...(this.context.controlIndex[CONTROL_TYPE_ALP] ?? [])
32
+ ];
29
33
  for (const control of controls) {
30
34
  const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
31
35
  const modifiedControl = getControlById<FilterBar>(control.controlId);