@sap-ux/preview-middleware 0.17.11 → 0.17.13

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 (73) 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/AddFragment.controller.js +1 -1
  5. package/dist/client/adp/controllers/AddFragment.controller.ts +1 -1
  6. package/dist/client/adp/controllers/BaseDialog.controller.js +187 -187
  7. package/dist/client/adp/controllers/ControllerExtension.controller.js +213 -213
  8. package/dist/client/adp/controllers/ExtensionPoint.controller.js +138 -138
  9. package/dist/client/adp/controllers/FileExistsDialog.controller.js +66 -66
  10. package/dist/client/adp/dialog-factory.js +122 -122
  11. package/dist/client/adp/init-dialogs.js +100 -100
  12. package/dist/client/adp/quick-actions/common/add-controller-to-page.js +55 -55
  13. package/dist/client/adp/quick-actions/common/create-page-action.js +50 -50
  14. package/dist/client/adp/quick-actions/common/op-add-custom-section.js +36 -36
  15. package/dist/client/adp/quick-actions/common/op-add-header-field.js +48 -48
  16. package/dist/client/adp/quick-actions/common/utils.js +18 -18
  17. package/dist/client/adp/quick-actions/control-types.js +21 -21
  18. package/dist/client/adp/quick-actions/dialog-enablement-validator.js +24 -24
  19. package/dist/client/adp/quick-actions/enablement-validator.js +4 -4
  20. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +101 -101
  21. package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +70 -70
  22. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +96 -96
  23. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +78 -78
  24. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +77 -77
  25. package/dist/client/adp/quick-actions/fe-v2/lr-enable-variant-management.js +69 -69
  26. package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +58 -58
  27. package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +93 -93
  28. package/dist/client/adp/quick-actions/fe-v2/op-enable-variant-management.js +81 -81
  29. package/dist/client/adp/quick-actions/fe-v2/registry.js +75 -75
  30. package/dist/client/adp/quick-actions/fe-v2/utils.js +95 -95
  31. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +73 -49
  32. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.ts +46 -20
  33. package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +49 -47
  34. package/dist/client/adp/quick-actions/fe-v4/create-table-action.ts +18 -28
  35. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +46 -46
  36. package/dist/client/adp/quick-actions/fe-v4/enable-variant-management.js +81 -81
  37. package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +55 -55
  38. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +82 -82
  39. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.ts +9 -14
  40. package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +52 -52
  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 +58 -58
  43. package/dist/client/adp/quick-actions/fe-v4/utils.js +47 -47
  44. package/dist/client/adp/quick-actions/load.js +44 -44
  45. package/dist/client/adp/quick-actions/quick-action-base.js +53 -53
  46. package/dist/client/adp/utils.js +160 -160
  47. package/dist/client/cpe/changes/index.js +10 -10
  48. package/dist/client/cpe/changes/validator.js +39 -39
  49. package/dist/client/cpe/documentation.js +164 -164
  50. package/dist/client/cpe/feature-service.js +36 -36
  51. package/dist/client/cpe/logger.js +30 -30
  52. package/dist/client/cpe/outline/editable.js +37 -37
  53. package/dist/client/cpe/outline/nodes.js +222 -222
  54. package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
  55. package/dist/client/cpe/quick-actions/registry.js +143 -143
  56. package/dist/client/cpe/quick-actions/utils.js +92 -92
  57. package/dist/client/cpe/types.js +4 -4
  58. package/dist/client/cpe/ui5-utils.js +33 -33
  59. package/dist/client/cpe/utils.js +138 -138
  60. package/dist/client/flp/WorkspaceConnector.js +86 -86
  61. package/dist/client/flp/common.js +28 -28
  62. package/dist/client/flp/enableFakeConnector.js +83 -83
  63. package/dist/client/flp/initConnectors.js +30 -30
  64. package/dist/client/flp/initRta.js +178 -178
  65. package/dist/client/i18n.js +56 -56
  66. package/dist/client/utils/application.js +32 -32
  67. package/dist/client/utils/core.js +68 -68
  68. package/dist/client/utils/error.js +19 -19
  69. package/dist/client/utils/fe-v4.js +118 -118
  70. package/dist/client/utils/version.js +102 -102
  71. package/package.json +7 -7
  72. package/dist/client/adp/quick-actions/fe-v4/table-quick-action-base.js +0 -67
  73. package/dist/client/adp/quick-actions/fe-v4/table-quick-action-base.ts +0 -75
@@ -1,48 +1,48 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../dialog-factory", "../control-types", "../table-quick-action-base", "../fe-v2/create-table-custom-column", "../dialog-enablement-validator"], function (OverlayRegistry, ____dialog_factory, ___control_types, ___table_quick_action_base, ___fe_v2_create_table_custom_column, ___dialog_enablement_validator) {
4
- "use strict";
5
-
6
- const DialogFactory = ____dialog_factory["DialogFactory"];
7
- const DialogNames = ____dialog_factory["DialogNames"];
8
- const SMART_TABLE_TYPE = ___control_types["SMART_TABLE_TYPE"];
9
- const GRID_TABLE_TYPE = ___control_types["GRID_TABLE_TYPE"];
10
- const MDC_TABLE_TYPE = ___control_types["MDC_TABLE_TYPE"];
11
- const TREE_TABLE_TYPE = ___control_types["TREE_TABLE_TYPE"];
12
- const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
13
- const preprocessActionExecution = ___fe_v2_create_table_custom_column["preprocessActionExecution"];
14
- const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
15
- const CREATE_TABLE_CUSTOM_COLUMN = 'create-table-custom-column';
16
- const CONTROL_TYPES = [SMART_TABLE_TYPE, MDC_TABLE_TYPE, TREE_TABLE_TYPE, GRID_TABLE_TYPE];
17
- class AddTableCustomColumnQuickAction extends TableQuickActionDefinitionBase {
18
- constructor(context) {
19
- super(CREATE_TABLE_CUSTOM_COLUMN, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN', context, undefined, [DIALOG_ENABLEMENT_VALIDATOR]);
20
- }
21
- async execute(path) {
22
- const {
23
- table,
24
- iconTabBarFilterKey,
25
- sectionInfo
26
- } = this.tableMap[path];
27
- if (!table) {
28
- return [];
29
- }
30
- preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
31
- this.selectOverlay(table);
32
- const overlay = OverlayRegistry.getOverlay(table);
33
- await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
34
- aggregation: 'columns',
35
- title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN'
36
- });
37
- return [];
38
- }
39
- }
40
- var __exports = {
41
- __esModule: true
42
- };
43
- __exports.CREATE_TABLE_CUSTOM_COLUMN = CREATE_TABLE_CUSTOM_COLUMN;
44
- __exports.CONTROL_TYPES = CONTROL_TYPES;
45
- __exports.AddTableCustomColumnQuickAction = AddTableCustomColumnQuickAction;
46
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../dialog-factory", "../control-types", "../table-quick-action-base", "../fe-v2/create-table-custom-column", "../dialog-enablement-validator"], function (OverlayRegistry, ____dialog_factory, ___control_types, ___table_quick_action_base, ___fe_v2_create_table_custom_column, ___dialog_enablement_validator) {
4
+ "use strict";
5
+
6
+ const DialogFactory = ____dialog_factory["DialogFactory"];
7
+ const DialogNames = ____dialog_factory["DialogNames"];
8
+ const SMART_TABLE_TYPE = ___control_types["SMART_TABLE_TYPE"];
9
+ const GRID_TABLE_TYPE = ___control_types["GRID_TABLE_TYPE"];
10
+ const MDC_TABLE_TYPE = ___control_types["MDC_TABLE_TYPE"];
11
+ const TREE_TABLE_TYPE = ___control_types["TREE_TABLE_TYPE"];
12
+ const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
13
+ const preprocessActionExecution = ___fe_v2_create_table_custom_column["preprocessActionExecution"];
14
+ const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
15
+ const CREATE_TABLE_CUSTOM_COLUMN = 'create-table-custom-column';
16
+ const CONTROL_TYPES = [SMART_TABLE_TYPE, MDC_TABLE_TYPE, TREE_TABLE_TYPE, GRID_TABLE_TYPE];
17
+ class AddTableCustomColumnQuickAction extends TableQuickActionDefinitionBase {
18
+ constructor(context) {
19
+ super(CREATE_TABLE_CUSTOM_COLUMN, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN', context, undefined, [DIALOG_ENABLEMENT_VALIDATOR]);
20
+ }
21
+ async execute(path) {
22
+ const {
23
+ table,
24
+ iconTabBarFilterKey,
25
+ sectionInfo
26
+ } = this.tableMap[path];
27
+ if (!table) {
28
+ return [];
29
+ }
30
+ preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
31
+ this.selectOverlay(table);
32
+ const overlay = OverlayRegistry.getOverlay(table);
33
+ await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
34
+ aggregation: 'columns',
35
+ title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN'
36
+ });
37
+ return [];
38
+ }
39
+ }
40
+ var __exports = {
41
+ __esModule: true
42
+ };
43
+ __exports.CREATE_TABLE_CUSTOM_COLUMN = CREATE_TABLE_CUSTOM_COLUMN;
44
+ __exports.CONTROL_TYPES = CONTROL_TYPES;
45
+ __exports.AddTableCustomColumnQuickAction = AddTableCustomColumnQuickAction;
46
+ return __exports;
47
47
  });
48
48
  //# sourceMappingURL=create-table-custom-column.js.map
@@ -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
- 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
+ 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,57 +1,57 @@
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
- }
39
- get textKey() {
40
- return this.isUseDateRangeTypeEnabled ? 'QUICK_ACTION_LR_DISABLE_SEMANTIC_DATE_RANGE_FILTER_BAR' : 'QUICK_ACTION_LR_ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR';
41
- }
42
- async execute() {
43
- const command = await executeToggleAction(this.context, this.isUseDateRangeTypeEnabled, CONTROL_TYPE, PROPERTY_PATH);
44
- if (command.length) {
45
- this.isUseDateRangeTypeEnabled = !this.isUseDateRangeTypeEnabled;
46
- }
47
- return command;
48
- }
49
- }
50
- var __exports = {
51
- __esModule: true
52
- };
53
- __exports.ENABLE_SEMANTIC_DATE_RANGE = ENABLE_SEMANTIC_DATE_RANGE;
54
- __exports.ToggleSemanticDateRangeFilterBar = ToggleSemanticDateRangeFilterBar;
55
- 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
+ }
39
+ get textKey() {
40
+ return this.isUseDateRangeTypeEnabled ? 'QUICK_ACTION_LR_DISABLE_SEMANTIC_DATE_RANGE_FILTER_BAR' : 'QUICK_ACTION_LR_ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR';
41
+ }
42
+ async execute() {
43
+ const command = await executeToggleAction(this.context, this.isUseDateRangeTypeEnabled, CONTROL_TYPE, PROPERTY_PATH);
44
+ if (command.length) {
45
+ this.isUseDateRangeTypeEnabled = !this.isUseDateRangeTypeEnabled;
46
+ }
47
+ return command;
48
+ }
49
+ }
50
+ var __exports = {
51
+ __esModule: true
52
+ };
53
+ __exports.ENABLE_SEMANTIC_DATE_RANGE = ENABLE_SEMANTIC_DATE_RANGE;
54
+ __exports.ToggleSemanticDateRangeFilterBar = ToggleSemanticDateRangeFilterBar;
55
+ return __exports;
56
56
  });
57
57
  //# 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
- let index = 0;
32
- for (const smartTable of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, [MDC_TABLE_TYPE])) {
33
- const personalizationData = smartTable.getP13nMode();
34
- const value = this.context.changeService.getConfigurationPropertyValue(smartTable.getId(), 'personalization');
35
- const isFilterEnabled = value?.filter === undefined ? personalizationData.includes('Filter') : value.filter;
36
- this.children.push({
37
- label: `'${smartTable.getHeader()}' table`,
38
- enabled: !isFilterEnabled,
39
- tooltip: isFilterEnabled ? tooltipText : undefined,
40
- children: []
41
- });
42
- this.tableMap[`${this.children.length - 1}`] = index;
43
- index++;
44
- }
45
- if (this.children.length > 0) {
46
- this.isApplicable = true;
47
- }
48
- return Promise.resolve();
49
- }
50
- async execute(path) {
51
- const {
52
- flexSettings
53
- } = this.context;
54
- const index = this.tableMap[path];
55
- const smartTables = getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, [MDC_TABLE_TYPE]);
56
- const modifiedControl = smartTables[index];
57
- if (!modifiedControl) {
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(modifiedControl, 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
@@ -2,7 +2,7 @@ import FlexCommand from 'sap/ui/rta/command/FlexCommand';
2
2
 
3
3
  import { NestedQuickActionDefinition, QuickActionContext } from '../../../cpe/quick-actions/quick-action-definition';
4
4
  import Table from 'sap/ui/mdc/Table';
5
- import { TableQuickActionDefinitionBase } from './table-quick-action-base';
5
+ import { TableQuickActionDefinitionBase } from '../table-quick-action-base';
6
6
  import { getRelevantControlFromActivePage } from '../../../cpe/quick-actions/utils';
7
7
  import { createManifestPropertyChange } from '../../../utils/fe-v4';
8
8
  import { getUi5Version, isLowerThanMinimalUi5Version } from '../../../utils/version';
@@ -38,7 +38,7 @@ export class EnableTableFilteringQuickAction
38
38
  }
39
39
 
40
40
  const tooltipText = this.context.resourceBundle.getText('TABLE_FILTERING_CHANGE_HAS_ALREADY_BEEN_MADE');
41
- let index = 0;
41
+
42
42
  for (const smartTable of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, [
43
43
  MDC_TABLE_TYPE
44
44
  ])) {
@@ -54,27 +54,22 @@ export class EnableTableFilteringQuickAction
54
54
  tooltip: isFilterEnabled ? tooltipText : undefined,
55
55
  children: []
56
56
  });
57
- this.tableMap[`${this.children.length - 1}`] = index;
58
- index++;
57
+ this.tableMap[`${this.children.length - 1}`] = {
58
+ table: smartTable,
59
+ tableUpdateEventAttachedOnce: false
60
+ };
59
61
  }
60
62
 
61
63
  if (this.children.length > 0) {
62
64
  this.isApplicable = true;
63
65
  }
64
-
65
- return Promise.resolve();
66
66
  }
67
67
 
68
68
  async execute(path: string): Promise<FlexCommand[]> {
69
69
  const { flexSettings } = this.context;
70
- const index = this.tableMap[path];
71
-
72
- const smartTables = getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, [
73
- MDC_TABLE_TYPE
74
- ]);
70
+ const { table } = this.tableMap[path];
75
71
 
76
- const modifiedControl = smartTables[index];
77
- if (!modifiedControl) {
72
+ if (!table) {
78
73
  return [];
79
74
  }
80
75
  const propertyChange = {
@@ -86,7 +81,7 @@ export class EnableTableFilteringQuickAction
86
81
  aggregate: true
87
82
  }
88
83
  };
89
- const command = await createManifestPropertyChange(modifiedControl, flexSettings, propertyChange);
84
+ const command = await createManifestPropertyChange(table, flexSettings, propertyChange);
90
85
  if (command) {
91
86
  return [command];
92
87
  } else {