@sap-ux/preview-middleware 0.16.155 → 0.16.157

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/dist/client/adp/api-handler.js +142 -142
  2. package/dist/client/adp/command-executor.js +75 -75
  3. package/dist/client/adp/control-utils.js +44 -44
  4. package/dist/client/adp/controllers/AddFragment.controller.js +5 -6
  5. package/dist/client/adp/controllers/AddFragment.controller.ts +1 -2
  6. package/dist/client/adp/controllers/AddTableColumnFragments.controller.js +0 -1
  7. package/dist/client/adp/controllers/AddTableColumnFragments.controller.ts +0 -1
  8. package/dist/client/adp/controllers/BaseDialog.controller.js +187 -187
  9. package/dist/client/adp/controllers/BaseDialog.controller.ts +0 -4
  10. package/dist/client/adp/controllers/ControllerExtension.controller.js +213 -213
  11. package/dist/client/adp/controllers/ExtensionPoint.controller.js +138 -138
  12. package/dist/client/adp/dialog-factory.js +115 -0
  13. package/dist/client/adp/dialog-factory.ts +134 -0
  14. package/dist/client/adp/extension-point.js +6 -6
  15. package/dist/client/adp/extension-point.ts +2 -2
  16. package/dist/client/adp/init-dialogs.js +100 -157
  17. package/dist/client/adp/init-dialogs.ts +5 -77
  18. package/dist/client/adp/quick-actions/common/add-controller-to-page.js +55 -54
  19. package/dist/client/adp/quick-actions/common/add-controller-to-page.ts +5 -3
  20. package/dist/client/adp/quick-actions/common/create-page-action.js +50 -49
  21. package/dist/client/adp/quick-actions/common/create-page-action.ts +7 -4
  22. package/dist/client/adp/quick-actions/common/op-add-custom-section.js +36 -35
  23. package/dist/client/adp/quick-actions/common/op-add-custom-section.ts +6 -3
  24. package/dist/client/adp/quick-actions/common/op-add-header-field.js +48 -47
  25. package/dist/client/adp/quick-actions/common/op-add-header-field.ts +7 -4
  26. package/dist/client/adp/quick-actions/common/utils.js +20 -0
  27. package/dist/client/adp/quick-actions/common/utils.ts +7 -0
  28. package/dist/client/adp/quick-actions/control-types.js +23 -0
  29. package/dist/client/adp/quick-actions/control-types.ts +6 -0
  30. package/dist/client/adp/quick-actions/dialog-enablement-validator.js +26 -0
  31. package/dist/client/adp/quick-actions/dialog-enablement-validator.ts +18 -0
  32. package/dist/client/adp/quick-actions/enablement-validator.js +6 -0
  33. package/dist/client/adp/quick-actions/enablement-validator.ts +18 -0
  34. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +101 -100
  35. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.ts +11 -3
  36. package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +70 -69
  37. package/dist/client/adp/quick-actions/fe-v2/create-table-action.ts +6 -3
  38. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +96 -95
  39. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.ts +27 -21
  40. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +60 -56
  41. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.ts +8 -3
  42. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +77 -67
  43. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.ts +37 -16
  44. package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +57 -57
  45. package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +95 -0
  46. package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.ts +99 -0
  47. package/dist/client/adp/quick-actions/fe-v2/registry.js +72 -71
  48. package/dist/client/adp/quick-actions/fe-v2/registry.ts +3 -1
  49. package/dist/client/adp/quick-actions/fe-v2/utils.js +95 -86
  50. package/dist/client/adp/quick-actions/fe-v2/utils.ts +14 -4
  51. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +49 -47
  52. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.ts +5 -1
  53. package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +47 -45
  54. package/dist/client/adp/quick-actions/fe-v4/create-table-action.ts +17 -7
  55. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +46 -45
  56. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.ts +11 -12
  57. package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +55 -55
  58. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +82 -82
  59. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.ts +4 -4
  60. package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +52 -52
  61. package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +91 -0
  62. package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.ts +85 -0
  63. package/dist/client/adp/quick-actions/fe-v4/registry.js +56 -55
  64. package/dist/client/adp/quick-actions/fe-v4/registry.ts +3 -1
  65. package/dist/client/adp/quick-actions/fe-v4/table-quick-action-base.js +11 -17
  66. package/dist/client/adp/quick-actions/fe-v4/table-quick-action-base.ts +17 -18
  67. package/dist/client/adp/quick-actions/fe-v4/utils.js +47 -47
  68. package/dist/client/adp/quick-actions/load.js +44 -44
  69. package/dist/client/adp/quick-actions/quick-action-base.js +55 -0
  70. package/dist/client/adp/quick-actions/quick-action-base.ts +55 -0
  71. package/dist/client/adp/quick-actions/simple-quick-action-base.js +8 -13
  72. package/dist/client/adp/quick-actions/simple-quick-action-base.ts +10 -18
  73. package/dist/client/adp/quick-actions/table-quick-action-base.js +24 -29
  74. package/dist/client/adp/quick-actions/table-quick-action-base.ts +39 -28
  75. package/dist/client/adp/utils.js +160 -160
  76. package/dist/client/cpe/changes/index.js +10 -10
  77. package/dist/client/cpe/changes/service.js +30 -0
  78. package/dist/client/cpe/changes/service.ts +46 -0
  79. package/dist/client/cpe/changes/validator.js +34 -34
  80. package/dist/client/cpe/documentation.js +164 -164
  81. package/dist/client/cpe/feature-service.js +36 -36
  82. package/dist/client/cpe/logger.js +30 -30
  83. package/dist/client/cpe/outline/editable.js +37 -37
  84. package/dist/client/cpe/outline/nodes.js +217 -217
  85. package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
  86. package/dist/client/cpe/quick-actions/quick-action-definition.ts +5 -1
  87. package/dist/client/cpe/quick-actions/quick-action-service.js +10 -4
  88. package/dist/client/cpe/quick-actions/quick-action-service.ts +9 -3
  89. package/dist/client/cpe/quick-actions/registry.js +143 -143
  90. package/dist/client/cpe/quick-actions/utils.js +92 -92
  91. package/dist/client/cpe/types.js +4 -4
  92. package/dist/client/cpe/ui5-utils.js +33 -33
  93. package/dist/client/cpe/utils.js +138 -138
  94. package/dist/client/flp/WorkspaceConnector.js +86 -86
  95. package/dist/client/flp/common.js +28 -28
  96. package/dist/client/flp/enableFakeConnector.js +83 -83
  97. package/dist/client/flp/initConnectors.js +30 -30
  98. package/dist/client/flp/initRta.js +178 -178
  99. package/dist/client/i18n.js +56 -56
  100. package/dist/client/messagebundle.properties +5 -3
  101. package/dist/client/utils/application.js +32 -32
  102. package/dist/client/utils/core.js +68 -68
  103. package/dist/client/utils/error.js +19 -19
  104. package/dist/client/utils/fe-v4.js +118 -114
  105. package/dist/client/utils/fe-v4.ts +19 -11
  106. package/dist/client/utils/version.js +102 -102
  107. package/package.json +4 -4
@@ -1,11 +1,13 @@
1
1
  import OverlayUtil from 'sap/ui/dt/OverlayUtil';
2
- import FlexCommand from 'sap/ui/rta/command/FlexCommand';
2
+ import type FlexCommand from 'sap/ui/rta/command/FlexCommand';
3
3
 
4
4
  import { QuickActionContext, NestedQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
5
5
  import { getRelevantControlFromActivePage } from '../../../cpe/quick-actions/utils';
6
6
  import { getControlById } from '../../../utils/core';
7
- import { DialogNames, handler } from '../../init-dialogs';
7
+ import { DialogFactory, DialogNames } from '../../dialog-factory';
8
+ import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator';
8
9
  import { TableQuickActionDefinitionBase } from './table-quick-action-base';
10
+ import { MDC_TABLE_TYPE } from '../control-types';
9
11
 
10
12
  export const CREATE_TABLE_ACTION = 'create_table_action';
11
13
  const TOOLBAR_ACTION = 'sap.ui.mdc.ActionToolbar';
@@ -15,7 +17,9 @@ const TOOLBAR_ACTION = 'sap.ui.mdc.ActionToolbar';
15
17
  */
16
18
  export class AddTableActionQuickAction extends TableQuickActionDefinitionBase implements NestedQuickActionDefinition {
17
19
  constructor(context: QuickActionContext) {
18
- super(CREATE_TABLE_ACTION, 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION', context, true);
20
+ super(CREATE_TABLE_ACTION, [MDC_TABLE_TYPE], 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION', context, true, [
21
+ DIALOG_ENABLEMENT_VALIDATOR
22
+ ]);
19
23
  }
20
24
 
21
25
  async execute(path: string): Promise<FlexCommand[]> {
@@ -31,10 +35,16 @@ export class AddTableActionQuickAction extends TableQuickActionDefinitionBase im
31
35
  const controlOverlay = OverlayUtil.getClosestOverlayFor(section);
32
36
  if (controlOverlay) {
33
37
  controlOverlay.setSelected(true);
34
- await handler(controlOverlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
35
- aggregation: 'actions',
36
- title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION'
37
- });
38
+ await DialogFactory.createDialog(
39
+ controlOverlay,
40
+ this.context.rta,
41
+ DialogNames.ADD_FRAGMENT,
42
+ undefined,
43
+ {
44
+ aggregation: 'actions',
45
+ title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION'
46
+ }
47
+ );
38
48
  }
39
49
  }
40
50
  }
@@ -1,47 +1,48 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../init-dialogs", "../table-quick-action-base", "../fe-v2/create-table-custom-column"], function (OverlayRegistry, ____init_dialogs, ___table_quick_action_base, ___fe_v2_create_table_custom_column) {
4
- "use strict";
5
-
6
- const DialogNames = ____init_dialogs["DialogNames"];
7
- const handler = ____init_dialogs["handler"];
8
- const SMART_TABLE_TYPE = ___table_quick_action_base["SMART_TABLE_TYPE"];
9
- const GRID_TABLE_TYPE = ___table_quick_action_base["GRID_TABLE_TYPE"];
10
- const MDC_TABLE_TYPE = ___table_quick_action_base["MDC_TABLE_TYPE"];
11
- const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
12
- const TREE_TABLE_TYPE = ___table_quick_action_base["TREE_TABLE_TYPE"];
13
- const preprocessActionExecution = ___fe_v2_create_table_custom_column["preprocessActionExecution"];
14
- const CREATE_TABLE_CUSTOM_COLUMN = 'create-table-custom-column';
15
- const CONTROL_TYPES = [SMART_TABLE_TYPE, MDC_TABLE_TYPE, TREE_TABLE_TYPE, GRID_TABLE_TYPE];
16
- class AddTableCustomColumnQuickAction extends TableQuickActionDefinitionBase {
17
- constructor(context) {
18
- super(CREATE_TABLE_CUSTOM_COLUMN, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN', context);
19
- }
20
- async execute(path) {
21
- const {
22
- table,
23
- iconTabBarFilterKey,
24
- sectionInfo
25
- } = this.tableMap[path];
26
- if (!table) {
27
- return [];
28
- }
29
- preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
30
- this.selectOverlay(table);
31
- const overlay = OverlayRegistry.getOverlay(table);
32
- await handler(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
33
- aggregation: 'columns',
34
- title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN'
35
- });
36
- return [];
37
- }
38
- }
39
- var __exports = {
40
- __esModule: true
41
- };
42
- __exports.CREATE_TABLE_CUSTOM_COLUMN = CREATE_TABLE_CUSTOM_COLUMN;
43
- __exports.CONTROL_TYPES = CONTROL_TYPES;
44
- __exports.AddTableCustomColumnQuickAction = AddTableCustomColumnQuickAction;
45
- 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;
46
47
  });
47
48
  //# sourceMappingURL=create-table-custom-column.js.map
@@ -1,16 +1,13 @@
1
- import FlexCommand from 'sap/ui/rta/command/FlexCommand';
1
+ import type FlexCommand from 'sap/ui/rta/command/FlexCommand';
2
+ import OverlayRegistry from 'sap/ui/dt/OverlayRegistry';
2
3
 
3
4
  import { QuickActionContext, NestedQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
4
- import OverlayRegistry from 'sap/ui/dt/OverlayRegistry';
5
- import { DialogNames, handler } from '../../init-dialogs';
6
- import {
7
- SMART_TABLE_TYPE,
8
- GRID_TABLE_TYPE,
9
- MDC_TABLE_TYPE,
10
- TableQuickActionDefinitionBase,
11
- TREE_TABLE_TYPE
12
- } from '../table-quick-action-base';
5
+ import { DialogFactory, DialogNames } from '../../dialog-factory';
6
+ import { SMART_TABLE_TYPE, GRID_TABLE_TYPE, MDC_TABLE_TYPE, TREE_TABLE_TYPE } from '../control-types';
7
+ import { TableQuickActionDefinitionBase } from '../table-quick-action-base';
8
+
13
9
  import { preprocessActionExecution } from '../fe-v2/create-table-custom-column';
10
+ import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator';
14
11
 
15
12
  export const CREATE_TABLE_CUSTOM_COLUMN = 'create-table-custom-column';
16
13
 
@@ -21,7 +18,9 @@ export class AddTableCustomColumnQuickAction
21
18
  implements NestedQuickActionDefinition
22
19
  {
23
20
  constructor(context: QuickActionContext) {
24
- super(CREATE_TABLE_CUSTOM_COLUMN, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN', context);
21
+ super(CREATE_TABLE_CUSTOM_COLUMN, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN', context, undefined, [
22
+ DIALOG_ENABLEMENT_VALIDATOR
23
+ ]);
25
24
  }
26
25
 
27
26
  async execute(path: string): Promise<FlexCommand[]> {
@@ -34,7 +33,7 @@ export class AddTableCustomColumnQuickAction
34
33
  this.selectOverlay(table);
35
34
 
36
35
  const overlay = OverlayRegistry.getOverlay(table);
37
- await handler(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
36
+ await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
38
37
  aggregation: 'columns',
39
38
  title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN'
40
39
  });
@@ -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"], function (___table_quick_action_base, _____cpe_quick_actions_utils, _____utils_fe_v4, _____utils_version) {
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 ENABLE_TABLE_FILTERING = 'enable-table-filtering';
12
- const CONTROL_TYPE = 'sap.ui.mdc.Table';
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, '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, [CONTROL_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, [CONTROL_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
+ 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;
83
83
  });
84
84
  //# sourceMappingURL=lr-enable-table-filtering.js.map
@@ -6,9 +6,9 @@ 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';
9
+ import { MDC_TABLE_TYPE } from '../control-types';
9
10
 
10
11
  export const ENABLE_TABLE_FILTERING = 'enable-table-filtering';
11
- const CONTROL_TYPE = 'sap.ui.mdc.Table';
12
12
 
13
13
  type Personalization = {
14
14
  sort: boolean;
@@ -26,7 +26,7 @@ export class EnableTableFilteringQuickAction
26
26
  implements NestedQuickActionDefinition
27
27
  {
28
28
  constructor(context: QuickActionContext) {
29
- super(ENABLE_TABLE_FILTERING, 'QUICK_ACTION_ENABLE_TABLE_FILTERING', context);
29
+ super(ENABLE_TABLE_FILTERING, [MDC_TABLE_TYPE], 'QUICK_ACTION_ENABLE_TABLE_FILTERING', context);
30
30
  }
31
31
  readonly forceRefreshAfterExecution = true;
32
32
 
@@ -40,7 +40,7 @@ export class EnableTableFilteringQuickAction
40
40
  const tooltipText = this.context.resourceBundle.getText('TABLE_FILTERING_CHANGE_HAS_ALREADY_BEEN_MADE');
41
41
  let index = 0;
42
42
  for (const smartTable of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, [
43
- CONTROL_TYPE
43
+ MDC_TABLE_TYPE
44
44
  ])) {
45
45
  const personalizationData = (smartTable as Table).getP13nMode();
46
46
  const value = this.context.changeService.getConfigurationPropertyValue(
@@ -70,7 +70,7 @@ export class EnableTableFilteringQuickAction
70
70
  const index = this.tableMap[path];
71
71
 
72
72
  const smartTables = getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, [
73
- CONTROL_TYPE
73
+ MDC_TABLE_TYPE
74
74
  ]);
75
75
 
76
76
  const modifiedControl = smartTables[index];
@@ -1,54 +1,54 @@
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
- }
36
- get textKey() {
37
- return this.isClearButtonEnabled ? 'V4_QUICK_ACTION_LR_DISABLE_CLEAR_FILTER_BAR' : 'V4_QUICK_ACTION_LR_ENABLE_CLEAR_FILTER_BAR';
38
- }
39
- async execute() {
40
- const command = await executeToggleAction(this.context, this.isClearButtonEnabled, CONTROL_TYPE, PROPERTY_PATH);
41
- if (command.length) {
42
- this.isClearButtonEnabled = !this.isClearButtonEnabled;
43
- }
44
- return command;
45
- }
46
- }
47
- var __exports = {
48
- __esModule: true
49
- };
50
- __exports.ENABLE_CLEAR_FILTER_BAR_TYPE = ENABLE_CLEAR_FILTER_BAR_TYPE;
51
- __exports.ToggleClearFilterBarQuickAction = ToggleClearFilterBarQuickAction;
52
- 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
+ }
36
+ get textKey() {
37
+ return this.isClearButtonEnabled ? 'V4_QUICK_ACTION_LR_DISABLE_CLEAR_FILTER_BAR' : 'V4_QUICK_ACTION_LR_ENABLE_CLEAR_FILTER_BAR';
38
+ }
39
+ async execute() {
40
+ const command = await executeToggleAction(this.context, this.isClearButtonEnabled, CONTROL_TYPE, PROPERTY_PATH);
41
+ if (command.length) {
42
+ this.isClearButtonEnabled = !this.isClearButtonEnabled;
43
+ }
44
+ return command;
45
+ }
46
+ }
47
+ var __exports = {
48
+ __esModule: true
49
+ };
50
+ __exports.ENABLE_CLEAR_FILTER_BAR_TYPE = ENABLE_CLEAR_FILTER_BAR_TYPE;
51
+ __exports.ToggleClearFilterBarQuickAction = ToggleClearFilterBarQuickAction;
52
+ return __exports;
53
53
  });
54
54
  //# sourceMappingURL=lr-toggle-clear-filter-bar.js.map