@sap-ux/preview-middleware 0.19.30 → 0.19.31

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 (76) hide show
  1. package/dist/client/adp/add-fragment.js +46 -46
  2. package/dist/client/adp/api-handler.js +155 -155
  3. package/dist/client/adp/command-executor.js +75 -75
  4. package/dist/client/adp/control-utils.js +44 -44
  5. package/dist/client/adp/controllers/ControllerExtension.controller.js +210 -210
  6. package/dist/client/adp/controllers/ExtensionPoint.controller.js +139 -139
  7. package/dist/client/adp/controllers/FileExistsDialog.controller.js +66 -66
  8. package/dist/client/adp/dialog-factory.js +135 -135
  9. package/dist/client/adp/init-dialogs.js +163 -163
  10. package/dist/client/adp/quick-actions/add-new-subpage-quick-action-base.js +96 -96
  11. package/dist/client/adp/quick-actions/common/add-controller-to-page.js +60 -60
  12. package/dist/client/adp/quick-actions/common/create-page-action.js +54 -54
  13. package/dist/client/adp/quick-actions/common/op-add-custom-section.js +39 -39
  14. package/dist/client/adp/quick-actions/common/op-add-header-field.js +67 -67
  15. package/dist/client/adp/quick-actions/common/utils.js +18 -18
  16. package/dist/client/adp/quick-actions/control-types.js +23 -23
  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/add-new-subpage.js +81 -81
  20. package/dist/client/adp/quick-actions/fe-v2/change-table-actions.js +67 -67
  21. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +101 -101
  22. package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +107 -107
  23. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +99 -99
  24. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +78 -78
  25. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +77 -77
  26. package/dist/client/adp/quick-actions/fe-v2/lr-enable-variant-management.js +69 -69
  27. package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +59 -59
  28. package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +93 -93
  29. package/dist/client/adp/quick-actions/fe-v2/op-enable-variant-management.js +84 -84
  30. package/dist/client/adp/quick-actions/fe-v2/registry.js +77 -77
  31. package/dist/client/adp/quick-actions/fe-v2/utils.js +116 -116
  32. package/dist/client/adp/quick-actions/fe-v4/add-new-subpage.js +138 -138
  33. package/dist/client/adp/quick-actions/fe-v4/change-table-actions.js +79 -79
  34. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +75 -75
  35. package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +53 -53
  36. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +49 -49
  37. package/dist/client/adp/quick-actions/fe-v4/enable-variant-management.js +81 -81
  38. package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +56 -56
  39. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +84 -84
  40. package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +53 -53
  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 +60 -60
  43. package/dist/client/adp/quick-actions/fe-v4/utils.js +72 -72
  44. package/dist/client/adp/quick-actions/load.js +44 -44
  45. package/dist/client/adp/quick-actions/quick-action-base.js +64 -64
  46. package/dist/client/adp/utils.js +218 -218
  47. package/dist/client/cpe/additional-change-info/add-xml-additional-info.js +75 -75
  48. package/dist/client/cpe/changes/index.js +10 -10
  49. package/dist/client/cpe/changes/validator.js +39 -39
  50. package/dist/client/cpe/documentation.js +164 -164
  51. package/dist/client/cpe/feature-service.js +36 -36
  52. package/dist/client/cpe/logger.js +30 -30
  53. package/dist/client/cpe/outline/editable.js +37 -37
  54. package/dist/client/cpe/outline/nodes.js +203 -203
  55. package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
  56. package/dist/client/cpe/quick-actions/registry.js +143 -143
  57. package/dist/client/cpe/quick-actions/utils.js +92 -92
  58. package/dist/client/cpe/types.js +4 -4
  59. package/dist/client/cpe/ui5-utils.js +33 -33
  60. package/dist/client/cpe/utils.js +111 -111
  61. package/dist/client/flp/WorkspaceConnector.js +92 -92
  62. package/dist/client/flp/common.js +28 -28
  63. package/dist/client/flp/enableFakeConnector.js +89 -89
  64. package/dist/client/flp/homepage/Component.js +14 -14
  65. package/dist/client/flp/initCdm.js +117 -117
  66. package/dist/client/flp/initConnectors.js +28 -28
  67. package/dist/client/flp/initRta.js +178 -178
  68. package/dist/client/i18n.js +56 -56
  69. package/dist/client/utils/additional-change-info.js +41 -41
  70. package/dist/client/utils/application.js +32 -32
  71. package/dist/client/utils/core.js +84 -84
  72. package/dist/client/utils/error.js +19 -19
  73. package/dist/client/utils/fe-v2.js +56 -56
  74. package/dist/client/utils/fe-v4.js +140 -140
  75. package/dist/client/utils/version.js +104 -104
  76. package/package.json +3 -3
@@ -1,83 +1,83 @@
1
- "use strict";
2
-
3
- sap.ui.define(["../simple-quick-action-base", "sap/ui/core/Component", "../../../utils/version", "../../../utils/fe-v4"], function (___simple_quick_action_base, Component, _____utils_version, _____utils_fe_v4) {
4
- "use strict";
5
-
6
- const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
7
- const getUi5Version = _____utils_version["getUi5Version"];
8
- const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
9
- const createManifestPropertyChange = _____utils_fe_v4["createManifestPropertyChange"];
10
- const ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS = 'enable-variant-management-in-tables-charts';
11
-
12
- // sap.f.DynamicPage for list report and sap.uxap.ObjectPageLayout for object page.
13
- const CONTROL_TYPES = ['sap.f.DynamicPage', 'sap.uxap.ObjectPageLayout'];
14
-
15
- /**
16
- * Quick Action for enabling table filtering using table personalization settings.
17
- */
18
- class EnableVariantManagementQuickAction extends SimpleQuickActionDefinitionBase {
19
- pageSmartVariantManagementMode = '';
20
- constructor(context) {
21
- super(ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLES_AND_CHARTS_VARIANT_MANAGEMENT', context, [{
22
- run: () => {
23
- if (this.control) {
24
- if (this.pageSmartVariantManagementMode === 'Control') {
25
- return {
26
- type: 'error',
27
- message: this.context.resourceBundle.getText('VARIANT_MANAGEMENT_FOR_PAGE_CONTROLS_IS_ALREADY_ENABLED')
28
- };
29
- }
30
- }
31
- return undefined;
32
- }
33
- }]);
34
- }
35
- forceRefreshAfterExecution = true;
36
- async initialize() {
37
- const version = await getUi5Version();
38
- if (isLowerThanMinimalUi5Version(version, {
39
- major: 1,
40
- minor: 131
41
- })) {
42
- return;
43
- }
44
- await super.initialize();
45
- if (this.control) {
46
- this.ownerComponent = Component.getOwnerComponentFor(this.control);
47
- if (!this.ownerComponent?.isA('sap.fe.templates.ListReport.Component') && !this.ownerComponent?.isA('sap.fe.templates.ObjectPage.Component') && !this.ownerComponent?.isA('sap.fe.templates.AnalyticalListPage.Component')) {
48
- this.control = undefined;
49
- } else {
50
- const id = this.control.getId();
51
- if (typeof id !== 'string') {
52
- throw new Error('Could not retrieve configuration property because control id is not valid!');
53
- }
54
- const value = this.context.changeService.getConfigurationPropertyValue(id, 'variantManagement');
55
- this.pageSmartVariantManagementMode = value === undefined ? this.ownerComponent.getVariantManagement() : value;
56
- }
57
- }
58
- }
59
- async execute() {
60
- if (!this.control) {
61
- return [];
62
- }
63
- const {
64
- flexSettings
65
- } = this.context;
66
- const command = await createManifestPropertyChange(this.control, flexSettings, {
67
- variantManagement: 'Control'
68
- });
69
- if (command) {
70
- return [command];
71
- } else {
72
- return [];
73
- }
74
- }
75
- }
76
- var __exports = {
77
- __esModule: true
78
- };
79
- __exports.ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS = ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS;
80
- __exports.EnableVariantManagementQuickAction = EnableVariantManagementQuickAction;
81
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["../simple-quick-action-base", "sap/ui/core/Component", "../../../utils/version", "../../../utils/fe-v4"], function (___simple_quick_action_base, Component, _____utils_version, _____utils_fe_v4) {
4
+ "use strict";
5
+
6
+ const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
7
+ const getUi5Version = _____utils_version["getUi5Version"];
8
+ const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
9
+ const createManifestPropertyChange = _____utils_fe_v4["createManifestPropertyChange"];
10
+ const ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS = 'enable-variant-management-in-tables-charts';
11
+
12
+ // sap.f.DynamicPage for list report and sap.uxap.ObjectPageLayout for object page.
13
+ const CONTROL_TYPES = ['sap.f.DynamicPage', 'sap.uxap.ObjectPageLayout'];
14
+
15
+ /**
16
+ * Quick Action for enabling table filtering using table personalization settings.
17
+ */
18
+ class EnableVariantManagementQuickAction extends SimpleQuickActionDefinitionBase {
19
+ pageSmartVariantManagementMode = '';
20
+ constructor(context) {
21
+ super(ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLES_AND_CHARTS_VARIANT_MANAGEMENT', context, [{
22
+ run: () => {
23
+ if (this.control) {
24
+ if (this.pageSmartVariantManagementMode === 'Control') {
25
+ return {
26
+ type: 'error',
27
+ message: this.context.resourceBundle.getText('VARIANT_MANAGEMENT_FOR_PAGE_CONTROLS_IS_ALREADY_ENABLED')
28
+ };
29
+ }
30
+ }
31
+ return undefined;
32
+ }
33
+ }]);
34
+ }
35
+ forceRefreshAfterExecution = true;
36
+ async initialize() {
37
+ const version = await getUi5Version();
38
+ if (isLowerThanMinimalUi5Version(version, {
39
+ major: 1,
40
+ minor: 131
41
+ })) {
42
+ return;
43
+ }
44
+ await super.initialize();
45
+ if (this.control) {
46
+ this.ownerComponent = Component.getOwnerComponentFor(this.control);
47
+ if (!this.ownerComponent?.isA('sap.fe.templates.ListReport.Component') && !this.ownerComponent?.isA('sap.fe.templates.ObjectPage.Component') && !this.ownerComponent?.isA('sap.fe.templates.AnalyticalListPage.Component')) {
48
+ this.control = undefined;
49
+ } else {
50
+ const id = this.control.getId();
51
+ if (typeof id !== 'string') {
52
+ throw new Error('Could not retrieve configuration property because control id is not valid!');
53
+ }
54
+ const value = this.context.changeService.getConfigurationPropertyValue(id, 'variantManagement');
55
+ this.pageSmartVariantManagementMode = value === undefined ? this.ownerComponent.getVariantManagement() : value;
56
+ }
57
+ }
58
+ }
59
+ async execute() {
60
+ if (!this.control) {
61
+ return [];
62
+ }
63
+ const {
64
+ flexSettings
65
+ } = this.context;
66
+ const command = await createManifestPropertyChange(this.control, flexSettings, {
67
+ variantManagement: 'Control'
68
+ });
69
+ if (command) {
70
+ return [command];
71
+ } else {
72
+ return [];
73
+ }
74
+ }
75
+ }
76
+ var __exports = {
77
+ __esModule: true
78
+ };
79
+ __exports.ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS = ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS;
80
+ __exports.EnableVariantManagementQuickAction = EnableVariantManagementQuickAction;
81
+ return __exports;
82
82
  });
83
83
  //# sourceMappingURL=enable-variant-management.js.map
@@ -1,58 +1,58 @@
1
- "use strict";
2
-
3
- sap.ui.define(["../../../cpe/quick-actions/utils", "../../../utils/core", "./utils", "../simple-quick-action-base"], function (_____cpe_quick_actions_utils, _____utils_core, ___utils, ___simple_quick_action_base) {
4
- "use strict";
5
-
6
- const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
7
- const getControlById = _____utils_core["getControlById"];
8
- const executeToggleAction = ___utils["executeToggleAction"];
9
- const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
10
- const ENABLE_SEMANTIC_DATE_RANGE = 'enable-semantic-date-range';
11
- const PROPERTY_NAME = 'useSemanticDateRange';
12
- const PROPERTY_PATH = `controlConfiguration/@com.sap.vocabularies.UI.v1.SelectionFields/${PROPERTY_NAME}`;
13
- const CONTROL_TYPE = 'sap.fe.macros.controls.FilterBar';
14
- const boolMap = {
15
- 'true': true,
16
- 'false': false
17
- };
18
- /**
19
- * Quick Action for toggling the visibility of "Semantic date range" for filter bar fields in LR.
20
- */
21
- class ToggleSemanticDateRangeFilterBar extends SimpleQuickActionDefinitionBase {
22
- constructor(context) {
23
- super(ENABLE_SEMANTIC_DATE_RANGE, [], '', context);
24
- }
25
- forceRefreshAfterExecution = true;
26
- isUseDateRangeTypeEnabled = false;
27
- initialize() {
28
- const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
29
- for (const control of controls) {
30
- const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
31
- const filterBar = getControlById(control.controlId);
32
- if (isActionApplicable && filterBar) {
33
- this.control = filterBar;
34
- const value = this.context.changeService.getConfigurationPropertyValue(control.controlId, PROPERTY_NAME);
35
- this.isUseDateRangeTypeEnabled = value === undefined ? boolMap[this.control.data('useSemanticDateRange')] : value;
36
- }
37
- }
38
- return Promise.resolve();
39
- }
40
- get textKey() {
41
- return this.isUseDateRangeTypeEnabled ? 'QUICK_ACTION_LR_DISABLE_SEMANTIC_DATE_RANGE_FILTER_BAR' : 'QUICK_ACTION_LR_ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR';
42
- }
43
- async execute() {
44
- const command = await executeToggleAction(this.context, this.isUseDateRangeTypeEnabled, CONTROL_TYPE, PROPERTY_PATH);
45
- if (command.length) {
46
- this.isUseDateRangeTypeEnabled = !this.isUseDateRangeTypeEnabled;
47
- }
48
- return command;
49
- }
50
- }
51
- var __exports = {
52
- __esModule: true
53
- };
54
- __exports.ENABLE_SEMANTIC_DATE_RANGE = ENABLE_SEMANTIC_DATE_RANGE;
55
- __exports.ToggleSemanticDateRangeFilterBar = ToggleSemanticDateRangeFilterBar;
56
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["../../../cpe/quick-actions/utils", "../../../utils/core", "./utils", "../simple-quick-action-base"], function (_____cpe_quick_actions_utils, _____utils_core, ___utils, ___simple_quick_action_base) {
4
+ "use strict";
5
+
6
+ const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
7
+ const getControlById = _____utils_core["getControlById"];
8
+ const executeToggleAction = ___utils["executeToggleAction"];
9
+ const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
10
+ const ENABLE_SEMANTIC_DATE_RANGE = 'enable-semantic-date-range';
11
+ const PROPERTY_NAME = 'useSemanticDateRange';
12
+ const PROPERTY_PATH = `controlConfiguration/@com.sap.vocabularies.UI.v1.SelectionFields/${PROPERTY_NAME}`;
13
+ const CONTROL_TYPE = 'sap.fe.macros.controls.FilterBar';
14
+ const boolMap = {
15
+ 'true': true,
16
+ 'false': false
17
+ };
18
+ /**
19
+ * Quick Action for toggling the visibility of "Semantic date range" for filter bar fields in LR.
20
+ */
21
+ class ToggleSemanticDateRangeFilterBar extends SimpleQuickActionDefinitionBase {
22
+ constructor(context) {
23
+ super(ENABLE_SEMANTIC_DATE_RANGE, [], '', context);
24
+ }
25
+ forceRefreshAfterExecution = true;
26
+ isUseDateRangeTypeEnabled = false;
27
+ initialize() {
28
+ const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
29
+ for (const control of controls) {
30
+ const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
31
+ const filterBar = getControlById(control.controlId);
32
+ if (isActionApplicable && filterBar) {
33
+ this.control = filterBar;
34
+ const value = this.context.changeService.getConfigurationPropertyValue(control.controlId, PROPERTY_NAME);
35
+ this.isUseDateRangeTypeEnabled = value === undefined ? boolMap[this.control.data('useSemanticDateRange')] : value;
36
+ }
37
+ }
38
+ return Promise.resolve();
39
+ }
40
+ get textKey() {
41
+ return this.isUseDateRangeTypeEnabled ? 'QUICK_ACTION_LR_DISABLE_SEMANTIC_DATE_RANGE_FILTER_BAR' : 'QUICK_ACTION_LR_ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR';
42
+ }
43
+ async execute() {
44
+ const command = await executeToggleAction(this.context, this.isUseDateRangeTypeEnabled, CONTROL_TYPE, PROPERTY_PATH);
45
+ if (command.length) {
46
+ this.isUseDateRangeTypeEnabled = !this.isUseDateRangeTypeEnabled;
47
+ }
48
+ return command;
49
+ }
50
+ }
51
+ var __exports = {
52
+ __esModule: true
53
+ };
54
+ __exports.ENABLE_SEMANTIC_DATE_RANGE = ENABLE_SEMANTIC_DATE_RANGE;
55
+ __exports.ToggleSemanticDateRangeFilterBar = ToggleSemanticDateRangeFilterBar;
56
+ return __exports;
57
57
  });
58
58
  //# sourceMappingURL=lr-enable-semantic-date-range-filter-bar.js.map
@@ -1,86 +1,86 @@
1
- "use strict";
2
-
3
- sap.ui.define(["../table-quick-action-base", "../../../cpe/quick-actions/utils", "../../../utils/fe-v4", "../../../utils/version", "../control-types"], function (___table_quick_action_base, _____cpe_quick_actions_utils, _____utils_fe_v4, _____utils_version, ___control_types) {
4
- "use strict";
5
-
6
- const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
7
- const getRelevantControlFromActivePage = _____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
8
- const createManifestPropertyChange = _____utils_fe_v4["createManifestPropertyChange"];
9
- const getUi5Version = _____utils_version["getUi5Version"];
10
- const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
11
- const MDC_TABLE_TYPE = ___control_types["MDC_TABLE_TYPE"];
12
- const ENABLE_TABLE_FILTERING = 'enable-table-filtering';
13
- /**
14
- * Quick Action for enabling table filtering using table personalization settings.
15
- */
16
- class EnableTableFilteringQuickAction extends TableQuickActionDefinitionBase {
17
- constructor(context) {
18
- super(ENABLE_TABLE_FILTERING, [MDC_TABLE_TYPE], 'QUICK_ACTION_ENABLE_TABLE_FILTERING', context);
19
- }
20
- forceRefreshAfterExecution = true;
21
- async initialize() {
22
- const version = await getUi5Version();
23
- if (isLowerThanMinimalUi5Version(version, {
24
- major: 1,
25
- minor: 131
26
- })) {
27
- this.isApplicable = false;
28
- return;
29
- }
30
- const tooltipText = this.context.resourceBundle.getText('TABLE_FILTERING_CHANGE_HAS_ALREADY_BEEN_MADE');
31
- for (const smartTable of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, [MDC_TABLE_TYPE])) {
32
- const personalizationData = smartTable.getP13nMode();
33
- const value = this.context.changeService.getConfigurationPropertyValue(smartTable.getId(), 'personalization');
34
- const isFilterEnabled = value?.filter === undefined ? personalizationData.includes('Filter') : value.filter;
35
- const path = this.children.length.toString();
36
- this.children.push({
37
- path,
38
- label: `'${smartTable.getHeader()}' table`,
39
- enabled: !isFilterEnabled,
40
- tooltip: isFilterEnabled ? tooltipText : undefined,
41
- children: []
42
- });
43
- this.tableMap[path] = {
44
- table: smartTable,
45
- tableUpdateEventAttachedOnce: false
46
- };
47
- }
48
- if (this.children.length > 0) {
49
- this.isApplicable = true;
50
- }
51
- }
52
- async execute(path) {
53
- const {
54
- flexSettings
55
- } = this.context;
56
- const {
57
- table
58
- } = this.tableMap[path];
59
- if (!table) {
60
- return [];
61
- }
62
- const propertyChange = {
63
- personalization: {
64
- sort: true,
65
- column: true,
66
- filter: true,
67
- group: true,
68
- aggregate: true
69
- }
70
- };
71
- const command = await createManifestPropertyChange(table, flexSettings, propertyChange);
72
- if (command) {
73
- return [command];
74
- } else {
75
- return [];
76
- }
77
- }
78
- }
79
- var __exports = {
80
- __esModule: true
81
- };
82
- __exports.ENABLE_TABLE_FILTERING = ENABLE_TABLE_FILTERING;
83
- __exports.EnableTableFilteringQuickAction = EnableTableFilteringQuickAction;
84
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["../table-quick-action-base", "../../../cpe/quick-actions/utils", "../../../utils/fe-v4", "../../../utils/version", "../control-types"], function (___table_quick_action_base, _____cpe_quick_actions_utils, _____utils_fe_v4, _____utils_version, ___control_types) {
4
+ "use strict";
5
+
6
+ const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
7
+ const getRelevantControlFromActivePage = _____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
8
+ const createManifestPropertyChange = _____utils_fe_v4["createManifestPropertyChange"];
9
+ const getUi5Version = _____utils_version["getUi5Version"];
10
+ const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
11
+ const MDC_TABLE_TYPE = ___control_types["MDC_TABLE_TYPE"];
12
+ const ENABLE_TABLE_FILTERING = 'enable-table-filtering';
13
+ /**
14
+ * Quick Action for enabling table filtering using table personalization settings.
15
+ */
16
+ class EnableTableFilteringQuickAction extends TableQuickActionDefinitionBase {
17
+ constructor(context) {
18
+ super(ENABLE_TABLE_FILTERING, [MDC_TABLE_TYPE], 'QUICK_ACTION_ENABLE_TABLE_FILTERING', context);
19
+ }
20
+ forceRefreshAfterExecution = true;
21
+ async initialize() {
22
+ const version = await getUi5Version();
23
+ if (isLowerThanMinimalUi5Version(version, {
24
+ major: 1,
25
+ minor: 131
26
+ })) {
27
+ this.isApplicable = false;
28
+ return;
29
+ }
30
+ const tooltipText = this.context.resourceBundle.getText('TABLE_FILTERING_CHANGE_HAS_ALREADY_BEEN_MADE');
31
+ for (const smartTable of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, [MDC_TABLE_TYPE])) {
32
+ const personalizationData = smartTable.getP13nMode();
33
+ const value = this.context.changeService.getConfigurationPropertyValue(smartTable.getId(), 'personalization');
34
+ const isFilterEnabled = value?.filter === undefined ? personalizationData.includes('Filter') : value.filter;
35
+ const path = this.children.length.toString();
36
+ this.children.push({
37
+ path,
38
+ label: `'${smartTable.getHeader()}' table`,
39
+ enabled: !isFilterEnabled,
40
+ tooltip: isFilterEnabled ? tooltipText : undefined,
41
+ children: []
42
+ });
43
+ this.tableMap[path] = {
44
+ table: smartTable,
45
+ tableUpdateEventAttachedOnce: false
46
+ };
47
+ }
48
+ if (this.children.length > 0) {
49
+ this.isApplicable = true;
50
+ }
51
+ }
52
+ async execute(path) {
53
+ const {
54
+ flexSettings
55
+ } = this.context;
56
+ const {
57
+ table
58
+ } = this.tableMap[path];
59
+ if (!table) {
60
+ return [];
61
+ }
62
+ const propertyChange = {
63
+ personalization: {
64
+ sort: true,
65
+ column: true,
66
+ filter: true,
67
+ group: true,
68
+ aggregate: true
69
+ }
70
+ };
71
+ const command = await createManifestPropertyChange(table, flexSettings, propertyChange);
72
+ if (command) {
73
+ return [command];
74
+ } else {
75
+ return [];
76
+ }
77
+ }
78
+ }
79
+ var __exports = {
80
+ __esModule: true
81
+ };
82
+ __exports.ENABLE_TABLE_FILTERING = ENABLE_TABLE_FILTERING;
83
+ __exports.EnableTableFilteringQuickAction = EnableTableFilteringQuickAction;
84
+ return __exports;
85
85
  });
86
86
  //# sourceMappingURL=lr-enable-table-filtering.js.map
@@ -1,55 +1,55 @@
1
- "use strict";
2
-
3
- sap.ui.define(["../../../cpe/quick-actions/utils", "../../../utils/core", "./utils", "../simple-quick-action-base"], function (_____cpe_quick_actions_utils, _____utils_core, ___utils, ___simple_quick_action_base) {
4
- "use strict";
5
-
6
- const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
7
- const getControlById = _____utils_core["getControlById"];
8
- const executeToggleAction = ___utils["executeToggleAction"];
9
- const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
10
- const ENABLE_CLEAR_FILTER_BAR_TYPE = 'enable-clear-filter-bar';
11
- const PROPERTY_NAME = 'showClearButton';
12
- const PROPERTY_PATH = `controlConfiguration/@com.sap.vocabularies.UI.v1.SelectionFields/${PROPERTY_NAME}`;
13
- const CONTROL_TYPE = 'sap.fe.macros.controls.FilterBar';
14
-
15
- /**
16
- * Quick Action for toggling the visibility of "clear filter bar" button in List Report page.
17
- */
18
- class ToggleClearFilterBarQuickAction extends SimpleQuickActionDefinitionBase {
19
- constructor(context) {
20
- super(ENABLE_CLEAR_FILTER_BAR_TYPE, [], '', context);
21
- }
22
- forceRefreshAfterExecution = true;
23
- isClearButtonEnabled = false;
24
- initialize() {
25
- const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
26
- for (const control of controls) {
27
- const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
28
- const filterBar = getControlById(control.controlId);
29
- if (isActionApplicable && filterBar) {
30
- this.control = filterBar;
31
- const value = this.context.changeService.getConfigurationPropertyValue(control.controlId, PROPERTY_NAME);
32
- this.isClearButtonEnabled = value === undefined ? filterBar.getShowClearButton() : value;
33
- }
34
- }
35
- return Promise.resolve();
36
- }
37
- get textKey() {
38
- return this.isClearButtonEnabled ? 'V4_QUICK_ACTION_LR_DISABLE_CLEAR_FILTER_BAR' : 'V4_QUICK_ACTION_LR_ENABLE_CLEAR_FILTER_BAR';
39
- }
40
- async execute() {
41
- const command = await executeToggleAction(this.context, this.isClearButtonEnabled, CONTROL_TYPE, PROPERTY_PATH);
42
- if (command.length) {
43
- this.isClearButtonEnabled = !this.isClearButtonEnabled;
44
- }
45
- return command;
46
- }
47
- }
48
- var __exports = {
49
- __esModule: true
50
- };
51
- __exports.ENABLE_CLEAR_FILTER_BAR_TYPE = ENABLE_CLEAR_FILTER_BAR_TYPE;
52
- __exports.ToggleClearFilterBarQuickAction = ToggleClearFilterBarQuickAction;
53
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["../../../cpe/quick-actions/utils", "../../../utils/core", "./utils", "../simple-quick-action-base"], function (_____cpe_quick_actions_utils, _____utils_core, ___utils, ___simple_quick_action_base) {
4
+ "use strict";
5
+
6
+ const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
7
+ const getControlById = _____utils_core["getControlById"];
8
+ const executeToggleAction = ___utils["executeToggleAction"];
9
+ const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
10
+ const ENABLE_CLEAR_FILTER_BAR_TYPE = 'enable-clear-filter-bar';
11
+ const PROPERTY_NAME = 'showClearButton';
12
+ const PROPERTY_PATH = `controlConfiguration/@com.sap.vocabularies.UI.v1.SelectionFields/${PROPERTY_NAME}`;
13
+ const CONTROL_TYPE = 'sap.fe.macros.controls.FilterBar';
14
+
15
+ /**
16
+ * Quick Action for toggling the visibility of "clear filter bar" button in List Report page.
17
+ */
18
+ class ToggleClearFilterBarQuickAction extends SimpleQuickActionDefinitionBase {
19
+ constructor(context) {
20
+ super(ENABLE_CLEAR_FILTER_BAR_TYPE, [], '', context);
21
+ }
22
+ forceRefreshAfterExecution = true;
23
+ isClearButtonEnabled = false;
24
+ initialize() {
25
+ const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
26
+ for (const control of controls) {
27
+ const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
28
+ const filterBar = getControlById(control.controlId);
29
+ if (isActionApplicable && filterBar) {
30
+ this.control = filterBar;
31
+ const value = this.context.changeService.getConfigurationPropertyValue(control.controlId, PROPERTY_NAME);
32
+ this.isClearButtonEnabled = value === undefined ? filterBar.getShowClearButton() : value;
33
+ }
34
+ }
35
+ return Promise.resolve();
36
+ }
37
+ get textKey() {
38
+ return this.isClearButtonEnabled ? 'V4_QUICK_ACTION_LR_DISABLE_CLEAR_FILTER_BAR' : 'V4_QUICK_ACTION_LR_ENABLE_CLEAR_FILTER_BAR';
39
+ }
40
+ async execute() {
41
+ const command = await executeToggleAction(this.context, this.isClearButtonEnabled, CONTROL_TYPE, PROPERTY_PATH);
42
+ if (command.length) {
43
+ this.isClearButtonEnabled = !this.isClearButtonEnabled;
44
+ }
45
+ return command;
46
+ }
47
+ }
48
+ var __exports = {
49
+ __esModule: true
50
+ };
51
+ __exports.ENABLE_CLEAR_FILTER_BAR_TYPE = ENABLE_CLEAR_FILTER_BAR_TYPE;
52
+ __exports.ToggleClearFilterBarQuickAction = ToggleClearFilterBarQuickAction;
53
+ return __exports;
54
54
  });
55
55
  //# sourceMappingURL=lr-toggle-clear-filter-bar.js.map