@sap-ux/preview-middleware 0.19.17 → 0.19.19

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 (83) 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/ControllerExtension.controller.js +210 -210
  5. package/dist/client/adp/controllers/ExtensionPoint.controller.js +139 -139
  6. package/dist/client/adp/controllers/FileExistsDialog.controller.js +66 -66
  7. package/dist/client/adp/dialog-factory.js +135 -135
  8. package/dist/client/adp/init-dialogs.js +138 -138
  9. package/dist/client/adp/quick-actions/add-new-subpage-quick-action-base.js +96 -96
  10. package/dist/client/adp/quick-actions/common/add-controller-to-page.js +60 -60
  11. package/dist/client/adp/quick-actions/common/create-page-action.js +54 -54
  12. package/dist/client/adp/quick-actions/common/op-add-custom-section.js +39 -39
  13. package/dist/client/adp/quick-actions/common/op-add-header-field.js +67 -67
  14. package/dist/client/adp/quick-actions/common/utils.js +18 -18
  15. package/dist/client/adp/quick-actions/control-types.js +23 -21
  16. package/dist/client/adp/quick-actions/control-types.ts +1 -0
  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 +69 -0
  21. package/dist/client/adp/quick-actions/fe-v2/change-table-actions.ts +71 -0
  22. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +101 -101
  23. package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +107 -107
  24. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +99 -99
  25. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +78 -78
  26. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +77 -77
  27. package/dist/client/adp/quick-actions/fe-v2/lr-enable-variant-management.js +69 -69
  28. package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +59 -59
  29. package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +93 -93
  30. package/dist/client/adp/quick-actions/fe-v2/op-enable-variant-management.js +84 -84
  31. package/dist/client/adp/quick-actions/fe-v2/registry.js +77 -76
  32. package/dist/client/adp/quick-actions/fe-v2/registry.ts +4 -0
  33. package/dist/client/adp/quick-actions/fe-v2/utils.js +116 -116
  34. package/dist/client/adp/quick-actions/fe-v4/add-new-subpage.js +138 -138
  35. package/dist/client/adp/quick-actions/fe-v4/change-table-actions.js +81 -0
  36. package/dist/client/adp/quick-actions/fe-v4/change-table-actions.ts +81 -0
  37. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +73 -73
  38. package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +53 -53
  39. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +49 -49
  40. package/dist/client/adp/quick-actions/fe-v4/enable-variant-management.js +81 -81
  41. package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +56 -56
  42. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +82 -82
  43. package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +53 -53
  44. package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +89 -89
  45. package/dist/client/adp/quick-actions/fe-v4/registry.js +60 -59
  46. package/dist/client/adp/quick-actions/fe-v4/registry.ts +4 -1
  47. package/dist/client/adp/quick-actions/fe-v4/utils.js +72 -72
  48. package/dist/client/adp/quick-actions/load.js +44 -44
  49. package/dist/client/adp/quick-actions/quick-action-base.js +64 -64
  50. package/dist/client/adp/quick-actions/table-quick-action-base.js +16 -2
  51. package/dist/client/adp/quick-actions/table-quick-action-base.ts +21 -3
  52. package/dist/client/adp/utils.js +218 -218
  53. package/dist/client/cpe/changes/index.js +10 -10
  54. package/dist/client/cpe/changes/validator.js +39 -39
  55. package/dist/client/cpe/documentation.js +164 -164
  56. package/dist/client/cpe/feature-service.js +36 -36
  57. package/dist/client/cpe/logger.js +30 -30
  58. package/dist/client/cpe/outline/editable.js +37 -37
  59. package/dist/client/cpe/outline/nodes.js +203 -203
  60. package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
  61. package/dist/client/cpe/quick-actions/registry.js +143 -143
  62. package/dist/client/cpe/quick-actions/utils.js +92 -92
  63. package/dist/client/cpe/types.js +4 -4
  64. package/dist/client/cpe/ui5-utils.js +33 -33
  65. package/dist/client/cpe/utils.js +111 -111
  66. package/dist/client/flp/WorkspaceConnector.js +86 -86
  67. package/dist/client/flp/common.js +28 -28
  68. package/dist/client/flp/enableFakeConnector.js +83 -83
  69. package/dist/client/flp/homepage/Component.js +14 -14
  70. package/dist/client/flp/initCdm.js +117 -117
  71. package/dist/client/flp/initConnectors.js +28 -28
  72. package/dist/client/flp/initRta.js +178 -178
  73. package/dist/client/i18n.js +56 -56
  74. package/dist/client/messagebundle.properties +4 -0
  75. package/dist/client/utils/application.js +32 -32
  76. package/dist/client/utils/core.js +84 -68
  77. package/dist/client/utils/core.ts +19 -0
  78. package/dist/client/utils/error.js +19 -19
  79. package/dist/client/utils/fe-v2.js +56 -56
  80. package/dist/client/utils/fe-v4.js +140 -140
  81. package/dist/client/utils/fe-v4.ts +1 -0
  82. package/dist/client/utils/version.js +104 -104
  83. package/package.json +6 -6
@@ -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,84 +1,84 @@
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
- this.children.push({
36
- label: `'${smartTable.getHeader()}' table`,
37
- enabled: !isFilterEnabled,
38
- tooltip: isFilterEnabled ? tooltipText : undefined,
39
- children: []
40
- });
41
- this.tableMap[`${this.children.length - 1}`] = {
42
- table: smartTable,
43
- tableUpdateEventAttachedOnce: false
44
- };
45
- }
46
- if (this.children.length > 0) {
47
- this.isApplicable = true;
48
- }
49
- }
50
- async execute(path) {
51
- const {
52
- flexSettings
53
- } = this.context;
54
- const {
55
- table
56
- } = this.tableMap[path];
57
- if (!table) {
58
- return [];
59
- }
60
- const propertyChange = {
61
- personalization: {
62
- sort: true,
63
- column: true,
64
- filter: true,
65
- group: true,
66
- aggregate: true
67
- }
68
- };
69
- const command = await createManifestPropertyChange(table, flexSettings, propertyChange);
70
- if (command) {
71
- return [command];
72
- } else {
73
- return [];
74
- }
75
- }
76
- }
77
- var __exports = {
78
- __esModule: true
79
- };
80
- __exports.ENABLE_TABLE_FILTERING = ENABLE_TABLE_FILTERING;
81
- __exports.EnableTableFilteringQuickAction = EnableTableFilteringQuickAction;
82
- 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
+ this.children.push({
36
+ label: `'${smartTable.getHeader()}' table`,
37
+ enabled: !isFilterEnabled,
38
+ tooltip: isFilterEnabled ? tooltipText : undefined,
39
+ children: []
40
+ });
41
+ this.tableMap[`${this.children.length - 1}`] = {
42
+ table: smartTable,
43
+ tableUpdateEventAttachedOnce: false
44
+ };
45
+ }
46
+ if (this.children.length > 0) {
47
+ this.isApplicable = true;
48
+ }
49
+ }
50
+ async execute(path) {
51
+ const {
52
+ flexSettings
53
+ } = this.context;
54
+ const {
55
+ table
56
+ } = this.tableMap[path];
57
+ if (!table) {
58
+ return [];
59
+ }
60
+ const propertyChange = {
61
+ personalization: {
62
+ sort: true,
63
+ column: true,
64
+ filter: true,
65
+ group: true,
66
+ aggregate: true
67
+ }
68
+ };
69
+ const command = await createManifestPropertyChange(table, flexSettings, propertyChange);
70
+ if (command) {
71
+ return [command];
72
+ } else {
73
+ return [];
74
+ }
75
+ }
76
+ }
77
+ var __exports = {
78
+ __esModule: true
79
+ };
80
+ __exports.ENABLE_TABLE_FILTERING = ENABLE_TABLE_FILTERING;
81
+ __exports.EnableTableFilteringQuickAction = EnableTableFilteringQuickAction;
82
+ return __exports;
83
83
  });
84
84
  //# 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
@@ -1,91 +1,91 @@
1
- "use strict";
2
-
3
- sap.ui.define(["../../../utils/fe-v4", "../../../utils/version", "../control-types", "../table-quick-action-base", "../../../utils/core", "../common/utils", "../fe-v2/create-table-custom-column"], function (_____utils_fe_v4, _____utils_version, ___control_types, ___table_quick_action_base, _____utils_core, ___common_utils, ___fe_v2_create_table_custom_column) {
4
- "use strict";
5
-
6
- const createManifestPropertyChange = _____utils_fe_v4["createManifestPropertyChange"];
7
- const getUi5Version = _____utils_version["getUi5Version"];
8
- const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
9
- const ANALYTICAL_TABLE_TYPE = ___control_types["ANALYTICAL_TABLE_TYPE"];
10
- const GRID_TABLE_TYPE = ___control_types["GRID_TABLE_TYPE"];
11
- const MDC_TABLE_TYPE = ___control_types["MDC_TABLE_TYPE"];
12
- const TREE_TABLE_TYPE = ___control_types["TREE_TABLE_TYPE"];
13
- const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
14
- const isA = _____utils_core["isA"];
15
- const getTooltipsForTableEmptyRowModeAction = ___common_utils["getTooltipsForTableEmptyRowModeAction"];
16
- const preprocessActionExecution = ___fe_v2_create_table_custom_column["preprocessActionExecution"];
17
- const ENABLE_TABLE_EMPTY_ROW_MODE = 'enable-table-empty-row-mode';
18
- const CONTROL_TYPES = [MDC_TABLE_TYPE, GRID_TABLE_TYPE, ANALYTICAL_TABLE_TYPE, TREE_TABLE_TYPE];
19
- const UNSUPPORTED_TABLES = [ANALYTICAL_TABLE_TYPE, TREE_TABLE_TYPE];
20
- const INLINE_CREATION_ROWS_MODE = 'InlineCreationRows';
21
- /**
22
- * Quick Action for enabling table filtering using table personalization settings.
23
- */
24
- class EnableTableEmptyRowModeQuickAction extends TableQuickActionDefinitionBase {
25
- constructor(context) {
26
- super(ENABLE_TABLE_EMPTY_ROW_MODE, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLE_EMPTY_ROW_MODE', context);
27
- }
28
- forceRefreshAfterExecution = true;
29
- async initialize() {
30
- const version = await getUi5Version();
31
- if (isLowerThanMinimalUi5Version(version, {
32
- major: 1,
33
- minor: 131
34
- })) {
35
- this.isApplicable = false;
36
- return;
37
- }
38
- const {
39
- alreadyEnabledTooltip,
40
- unsupportedCreationRowsTooltip
41
- } = getTooltipsForTableEmptyRowModeAction(this.context.resourceBundle);
42
- const processChild = (child, mapKey) => {
43
- const table = this.tableMap[mapKey]?.table;
44
- if (table) {
45
- if (UNSUPPORTED_TABLES.some(t => isA(t, table))) {
46
- child.enabled = false;
47
- child.tooltip = unsupportedCreationRowsTooltip;
48
- } else if (table.data('creationMode') === INLINE_CREATION_ROWS_MODE) {
49
- child.enabled = false;
50
- child.tooltip = alreadyEnabledTooltip;
51
- }
52
- }
53
- child.children.forEach((nestedChild, idx) => processChild(nestedChild, `${mapKey}/${idx.toFixed(0)}`));
54
- };
55
- await super.initialize();
56
-
57
- // disable nested actions based on conditions
58
- this.children.forEach((nestedChild, idx) => processChild(nestedChild, `${idx.toFixed(0)}`));
59
- }
60
- async execute(path) {
61
- const {
62
- flexSettings
63
- } = this.context;
64
- const {
65
- table,
66
- sectionInfo,
67
- iconTabBarFilterKey
68
- } = this.tableMap[path];
69
- if (!table) {
70
- return [];
71
- }
72
- preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
73
- this.selectOverlay(table);
74
- const command = await createManifestPropertyChange(table, flexSettings, {
75
- name: INLINE_CREATION_ROWS_MODE
76
- }, ['creationMode']);
77
- if (command) {
78
- return [command];
79
- } else {
80
- return [];
81
- }
82
- }
83
- }
84
- var __exports = {
85
- __esModule: true
86
- };
87
- __exports.ENABLE_TABLE_EMPTY_ROW_MODE = ENABLE_TABLE_EMPTY_ROW_MODE;
88
- __exports.EnableTableEmptyRowModeQuickAction = EnableTableEmptyRowModeQuickAction;
89
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["../../../utils/fe-v4", "../../../utils/version", "../control-types", "../table-quick-action-base", "../../../utils/core", "../common/utils", "../fe-v2/create-table-custom-column"], function (_____utils_fe_v4, _____utils_version, ___control_types, ___table_quick_action_base, _____utils_core, ___common_utils, ___fe_v2_create_table_custom_column) {
4
+ "use strict";
5
+
6
+ const createManifestPropertyChange = _____utils_fe_v4["createManifestPropertyChange"];
7
+ const getUi5Version = _____utils_version["getUi5Version"];
8
+ const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
9
+ const ANALYTICAL_TABLE_TYPE = ___control_types["ANALYTICAL_TABLE_TYPE"];
10
+ const GRID_TABLE_TYPE = ___control_types["GRID_TABLE_TYPE"];
11
+ const MDC_TABLE_TYPE = ___control_types["MDC_TABLE_TYPE"];
12
+ const TREE_TABLE_TYPE = ___control_types["TREE_TABLE_TYPE"];
13
+ const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
14
+ const isA = _____utils_core["isA"];
15
+ const getTooltipsForTableEmptyRowModeAction = ___common_utils["getTooltipsForTableEmptyRowModeAction"];
16
+ const preprocessActionExecution = ___fe_v2_create_table_custom_column["preprocessActionExecution"];
17
+ const ENABLE_TABLE_EMPTY_ROW_MODE = 'enable-table-empty-row-mode';
18
+ const CONTROL_TYPES = [MDC_TABLE_TYPE, GRID_TABLE_TYPE, ANALYTICAL_TABLE_TYPE, TREE_TABLE_TYPE];
19
+ const UNSUPPORTED_TABLES = [ANALYTICAL_TABLE_TYPE, TREE_TABLE_TYPE];
20
+ const INLINE_CREATION_ROWS_MODE = 'InlineCreationRows';
21
+ /**
22
+ * Quick Action for enabling table filtering using table personalization settings.
23
+ */
24
+ class EnableTableEmptyRowModeQuickAction extends TableQuickActionDefinitionBase {
25
+ constructor(context) {
26
+ super(ENABLE_TABLE_EMPTY_ROW_MODE, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLE_EMPTY_ROW_MODE', context);
27
+ }
28
+ forceRefreshAfterExecution = true;
29
+ async initialize() {
30
+ const version = await getUi5Version();
31
+ if (isLowerThanMinimalUi5Version(version, {
32
+ major: 1,
33
+ minor: 131
34
+ })) {
35
+ this.isApplicable = false;
36
+ return;
37
+ }
38
+ const {
39
+ alreadyEnabledTooltip,
40
+ unsupportedCreationRowsTooltip
41
+ } = getTooltipsForTableEmptyRowModeAction(this.context.resourceBundle);
42
+ const processChild = (child, mapKey) => {
43
+ const table = this.tableMap[mapKey]?.table;
44
+ if (table) {
45
+ if (UNSUPPORTED_TABLES.some(t => isA(t, table))) {
46
+ child.enabled = false;
47
+ child.tooltip = unsupportedCreationRowsTooltip;
48
+ } else if (table.data('creationMode') === INLINE_CREATION_ROWS_MODE) {
49
+ child.enabled = false;
50
+ child.tooltip = alreadyEnabledTooltip;
51
+ }
52
+ }
53
+ child.children.forEach((nestedChild, idx) => processChild(nestedChild, `${mapKey}/${idx.toFixed(0)}`));
54
+ };
55
+ await super.initialize();
56
+
57
+ // disable nested actions based on conditions
58
+ this.children.forEach((nestedChild, idx) => processChild(nestedChild, `${idx.toFixed(0)}`));
59
+ }
60
+ async execute(path) {
61
+ const {
62
+ flexSettings
63
+ } = this.context;
64
+ const {
65
+ table,
66
+ sectionInfo,
67
+ iconTabBarFilterKey
68
+ } = this.tableMap[path];
69
+ if (!table) {
70
+ return [];
71
+ }
72
+ preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
73
+ this.selectOverlay(table);
74
+ const command = await createManifestPropertyChange(table, flexSettings, {
75
+ name: INLINE_CREATION_ROWS_MODE
76
+ }, ['creationMode']);
77
+ if (command) {
78
+ return [command];
79
+ } else {
80
+ return [];
81
+ }
82
+ }
83
+ }
84
+ var __exports = {
85
+ __esModule: true
86
+ };
87
+ __exports.ENABLE_TABLE_EMPTY_ROW_MODE = ENABLE_TABLE_EMPTY_ROW_MODE;
88
+ __exports.EnableTableEmptyRowModeQuickAction = EnableTableEmptyRowModeQuickAction;
89
+ return __exports;
90
90
  });
91
91
  //# sourceMappingURL=op-enable-empty-row-mode.js.map