@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
@@ -6,6 +6,7 @@ import ManagedObject from 'sap/ui/base/ManagedObject';
6
6
  import { QuickActionContext, NestedQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
7
7
  import { getControlById, isA } from '../../../utils/core';
8
8
  import { TableQuickActionDefinitionBase } from '../table-quick-action-base';
9
+ import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator';
9
10
 
10
11
  export const CHANGE_TABLE_COLUMNS = 'change-table-columns';
11
12
  const SMART_TABLE_TYPE = 'sap.ui.comp.smarttable.SmartTable';
@@ -18,9 +19,16 @@ export class ChangeTableColumnsQuickAction
18
19
  implements NestedQuickActionDefinition
19
20
  {
20
21
  constructor(context: QuickActionContext) {
21
- super(CHANGE_TABLE_COLUMNS, CONTROL_TYPES, 'V2_QUICK_ACTION_CHANGE_TABLE_COLUMNS', context, {
22
- includeServiceAction: true
23
- });
22
+ super(
23
+ CHANGE_TABLE_COLUMNS,
24
+ CONTROL_TYPES,
25
+ 'V2_QUICK_ACTION_CHANGE_TABLE_COLUMNS',
26
+ context,
27
+ {
28
+ includeServiceAction: true
29
+ },
30
+ [DIALOG_ENABLEMENT_VALIDATOR]
31
+ );
24
32
  }
25
33
  async execute(path: string): Promise<FlexCommand[]> {
26
34
  const { table, iconTabBarFilterKey, changeColumnActionId, sectionInfo } = this.tableMap[path];
@@ -1,71 +1,72 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../../utils/core", "../../init-dialogs", "../table-quick-action-base"], function (OverlayRegistry, _____utils_core, ____init_dialogs, ___table_quick_action_base) {
4
- "use strict";
5
-
6
- const getControlById = _____utils_core["getControlById"];
7
- const isA = _____utils_core["isA"];
8
- const DialogNames = ____init_dialogs["DialogNames"];
9
- const handler = ____init_dialogs["handler"];
10
- const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
11
- const CREATE_TABLE_ACTION = 'create-table-action';
12
- const SMART_TABLE_TYPE = 'sap.ui.comp.smarttable.SmartTable';
13
- const M_TABLE_TYPE = 'sap.m.Table';
14
- // maintain order if action id
15
-
16
- const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, 'sap.ui.table.TreeTable', 'sap.ui.table.Table'];
17
- class AddTableActionQuickAction extends TableQuickActionDefinitionBase {
18
- constructor(context) {
19
- super(CREATE_TABLE_ACTION, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION', context);
20
- }
21
- async execute(path) {
22
- const {
23
- table,
24
- iconTabBarFilterKey,
25
- sectionInfo
26
- } = this.tableMap[path];
27
- if (!table) {
28
- return [];
29
- }
30
- if (sectionInfo) {
31
- const {
32
- layout,
33
- section,
34
- subSection
35
- } = sectionInfo;
36
- layout?.setSelectedSection(section);
37
- section.setSelectedSubSection(subSection);
38
- this.selectOverlay(table);
39
- } else {
40
- getControlById(table.getId())?.getDomRef()?.scrollIntoView();
41
- this.selectOverlay(table);
42
- }
43
- if (this.iconTabBar && iconTabBarFilterKey) {
44
- this.iconTabBar.setSelectedKey(iconTabBarFilterKey);
45
- }
46
- let headerToolbar;
47
- if (isA(SMART_TABLE_TYPE, table)) {
48
- headerToolbar = table.getAggregation('items')[0].getAggregation('headerToolbar');
49
- } else if (isA(M_TABLE_TYPE, table)) {
50
- headerToolbar = table.getAggregation('headerToolbar');
51
- }
52
-
53
- // open dialogBox to add, and content is selected ByDefault
54
- if (headerToolbar) {
55
- const overlay = OverlayRegistry.getOverlay(headerToolbar) || [];
56
- await handler(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
57
- aggregation: 'content',
58
- title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION'
59
- });
60
- }
61
- return [];
62
- }
63
- }
64
- var __exports = {
65
- __esModule: true
66
- };
67
- __exports.CREATE_TABLE_ACTION = CREATE_TABLE_ACTION;
68
- __exports.AddTableActionQuickAction = AddTableActionQuickAction;
69
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../../utils/core", "../../dialog-factory", "../table-quick-action-base", "../dialog-enablement-validator"], function (OverlayRegistry, _____utils_core, ____dialog_factory, ___table_quick_action_base, ___dialog_enablement_validator) {
4
+ "use strict";
5
+
6
+ const getControlById = _____utils_core["getControlById"];
7
+ const isA = _____utils_core["isA"];
8
+ const DialogFactory = ____dialog_factory["DialogFactory"];
9
+ const DialogNames = ____dialog_factory["DialogNames"];
10
+ const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
11
+ const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
12
+ const CREATE_TABLE_ACTION = 'create-table-action';
13
+ const SMART_TABLE_TYPE = 'sap.ui.comp.smarttable.SmartTable';
14
+ const M_TABLE_TYPE = 'sap.m.Table';
15
+ // maintain order if action id
16
+
17
+ const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, 'sap.ui.table.TreeTable', 'sap.ui.table.Table'];
18
+ class AddTableActionQuickAction extends TableQuickActionDefinitionBase {
19
+ constructor(context) {
20
+ super(CREATE_TABLE_ACTION, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION', context, undefined, [DIALOG_ENABLEMENT_VALIDATOR]);
21
+ }
22
+ async execute(path) {
23
+ const {
24
+ table,
25
+ iconTabBarFilterKey,
26
+ sectionInfo
27
+ } = this.tableMap[path];
28
+ if (!table) {
29
+ return [];
30
+ }
31
+ if (sectionInfo) {
32
+ const {
33
+ layout,
34
+ section,
35
+ subSection
36
+ } = sectionInfo;
37
+ layout?.setSelectedSection(section);
38
+ section.setSelectedSubSection(subSection);
39
+ this.selectOverlay(table);
40
+ } else {
41
+ getControlById(table.getId())?.getDomRef()?.scrollIntoView();
42
+ this.selectOverlay(table);
43
+ }
44
+ if (this.iconTabBar && iconTabBarFilterKey) {
45
+ this.iconTabBar.setSelectedKey(iconTabBarFilterKey);
46
+ }
47
+ let headerToolbar;
48
+ if (isA(SMART_TABLE_TYPE, table)) {
49
+ headerToolbar = table.getAggregation('items')[0].getAggregation('headerToolbar');
50
+ } else if (isA(M_TABLE_TYPE, table)) {
51
+ headerToolbar = table.getAggregation('headerToolbar');
52
+ }
53
+
54
+ // open dialogBox to add, and content is selected ByDefault
55
+ if (headerToolbar) {
56
+ const overlay = OverlayRegistry.getOverlay(headerToolbar) || [];
57
+ await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
58
+ aggregation: 'content',
59
+ title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION'
60
+ });
61
+ }
62
+ return [];
63
+ }
64
+ }
65
+ var __exports = {
66
+ __esModule: true
67
+ };
68
+ __exports.CREATE_TABLE_ACTION = CREATE_TABLE_ACTION;
69
+ __exports.AddTableActionQuickAction = AddTableActionQuickAction;
70
+ return __exports;
70
71
  });
71
72
  //# sourceMappingURL=create-table-action.js.map
@@ -7,8 +7,9 @@ import UI5Element from 'sap/ui/core/Element';
7
7
 
8
8
  import { QuickActionContext, NestedQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
9
9
  import { getControlById, isA } from '../../../utils/core';
10
- import { DialogNames, handler } from '../../init-dialogs';
10
+ import { DialogFactory, DialogNames } from '../../dialog-factory';
11
11
  import { TableQuickActionDefinitionBase } from '../table-quick-action-base';
12
+ import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator';
12
13
 
13
14
  export const CREATE_TABLE_ACTION = 'create-table-action';
14
15
  const SMART_TABLE_TYPE = 'sap.ui.comp.smarttable.SmartTable';
@@ -19,7 +20,9 @@ const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, 'sap.ui.table.TreeTable',
19
20
 
20
21
  export class AddTableActionQuickAction extends TableQuickActionDefinitionBase implements NestedQuickActionDefinition {
21
22
  constructor(context: QuickActionContext) {
22
- super(CREATE_TABLE_ACTION, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION', context);
23
+ super(CREATE_TABLE_ACTION, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION', context, undefined, [
24
+ DIALOG_ENABLEMENT_VALIDATOR
25
+ ]);
23
26
  }
24
27
 
25
28
  async execute(path: string): Promise<FlexCommand[]> {
@@ -52,7 +55,7 @@ export class AddTableActionQuickAction extends TableQuickActionDefinitionBase im
52
55
  // open dialogBox to add, and content is selected ByDefault
53
56
  if (headerToolbar) {
54
57
  const overlay = OverlayRegistry.getOverlay(headerToolbar as UI5Element) || [];
55
- await handler(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
58
+ await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
56
59
  aggregation: 'content',
57
60
  title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION'
58
61
  });
@@ -1,97 +1,98 @@
1
- "use strict";
2
-
3
- sap.ui.define(["../../../utils/core", "sap/ui/dt/OverlayRegistry", "../../init-dialogs", "../table-quick-action-base", "../../utils", "../../../i18n"], function (_____utils_core, OverlayRegistry, ____init_dialogs, ___table_quick_action_base, ____utils, _____i18n) {
4
- "use strict";
5
-
6
- const getControlById = _____utils_core["getControlById"];
7
- const isA = _____utils_core["isA"];
8
- const DialogNames = ____init_dialogs["DialogNames"];
9
- const handler = ____init_dialogs["handler"];
10
- const ANALYTICAL_TABLE_TYPE = ___table_quick_action_base["ANALYTICAL_TABLE_TYPE"];
11
- const GRID_TABLE_TYPE = ___table_quick_action_base["GRID_TABLE_TYPE"];
12
- const M_TABLE_TYPE = ___table_quick_action_base["M_TABLE_TYPE"];
13
- const SMART_TABLE_TYPE = ___table_quick_action_base["SMART_TABLE_TYPE"];
14
- const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
15
- const TREE_TABLE_TYPE = ___table_quick_action_base["TREE_TABLE_TYPE"];
16
- const notifyUser = ____utils["notifyUser"];
17
- const getTextBundle = _____i18n["getTextBundle"];
18
- const CREATE_TABLE_CUSTOM_COLUMN = 'create-table-custom-column';
19
- const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, TREE_TABLE_TYPE, GRID_TABLE_TYPE];
20
-
21
- /**
22
- * Reusable function which performs some preparation steps before table action execution
23
- *
24
- * @param table - table element
25
- * @param sectionInfo - section data
26
- * @param iconTabBar - icon tab bar element
27
- * @param iconTabBarFilterKey - tab bar key to select a tab
28
- */
29
- function preprocessActionExecution(table, sectionInfo, iconTabBar, iconTabBarFilterKey) {
30
- if (sectionInfo) {
31
- const {
32
- layout,
33
- section,
34
- subSection
35
- } = sectionInfo;
36
- layout?.setSelectedSection(section);
37
- section.setSelectedSubSection(subSection);
38
- } else {
39
- getControlById(table.getId())?.getDomRef()?.scrollIntoView();
40
- }
41
- if (iconTabBar && iconTabBarFilterKey) {
42
- iconTabBar.setSelectedKey(iconTabBarFilterKey);
43
- }
44
- }
45
- class AddTableCustomColumnQuickAction extends TableQuickActionDefinitionBase {
46
- constructor(context) {
47
- super(CREATE_TABLE_CUSTOM_COLUMN, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN', context, {
48
- areTableRowsRequired: true
49
- });
50
- }
51
- async execute(path) {
52
- const {
53
- table,
54
- iconTabBarFilterKey,
55
- sectionInfo
56
- } = this.tableMap[path];
57
- if (!table) {
58
- return [];
59
- }
60
- preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
61
- this.selectOverlay(table);
62
- let tableInternal = table;
63
- if (isA(SMART_TABLE_TYPE, table)) {
64
- const itemsAggregation = table.getAggregation('items');
65
- tableInternal = itemsAggregation.find(item => {
66
- return [M_TABLE_TYPE, TREE_TABLE_TYPE, ANALYTICAL_TABLE_TYPE, GRID_TABLE_TYPE].some(tType => isA(tType, item));
67
- });
68
- if (!tableInternal) {
69
- return [];
70
- }
71
- }
72
- const overlay = OverlayRegistry.getOverlay(tableInternal) || [];
73
- if (!overlay) {
74
- return [];
75
- }
76
- if (isA(M_TABLE_TYPE, tableInternal) && tableInternal.getAggregation('items').length === 0) {
77
- const bundle = await getTextBundle();
78
- notifyUser(bundle.getText('TABLE_ROWS_NEEDED_TO_CREATE_CUSTOM_COLUMN'), 8000);
79
- return [];
80
- }
81
- const dialog = [TREE_TABLE_TYPE, ANALYTICAL_TABLE_TYPE, GRID_TABLE_TYPE].some(type => isA(type, tableInternal)) ? DialogNames.ADD_FRAGMENT : DialogNames.ADD_TABLE_COLUMN_FRAGMENTS;
82
- await handler(overlay, this.context.rta, dialog, undefined, {
83
- aggregation: 'columns',
84
- title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN'
85
- });
86
- return [];
87
- }
88
- }
89
- var __exports = {
90
- __esModule: true
91
- };
92
- __exports.CREATE_TABLE_CUSTOM_COLUMN = CREATE_TABLE_CUSTOM_COLUMN;
93
- __exports.preprocessActionExecution = preprocessActionExecution;
94
- __exports.AddTableCustomColumnQuickAction = AddTableCustomColumnQuickAction;
95
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../../utils/core", "../../dialog-factory", "../control-types", "../table-quick-action-base", "../../utils", "../../../i18n", "../dialog-enablement-validator"], function (OverlayRegistry, _____utils_core, ____dialog_factory, ___control_types, ___table_quick_action_base, ____utils, _____i18n, ___dialog_enablement_validator) {
4
+ "use strict";
5
+
6
+ const getControlById = _____utils_core["getControlById"];
7
+ const isA = _____utils_core["isA"];
8
+ const DialogNames = ____dialog_factory["DialogNames"];
9
+ const DialogFactory = ____dialog_factory["DialogFactory"];
10
+ const ANALYTICAL_TABLE_TYPE = ___control_types["ANALYTICAL_TABLE_TYPE"];
11
+ const GRID_TABLE_TYPE = ___control_types["GRID_TABLE_TYPE"];
12
+ const M_TABLE_TYPE = ___control_types["M_TABLE_TYPE"];
13
+ const SMART_TABLE_TYPE = ___control_types["SMART_TABLE_TYPE"];
14
+ const TREE_TABLE_TYPE = ___control_types["TREE_TABLE_TYPE"];
15
+ const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
16
+ const notifyUser = ____utils["notifyUser"];
17
+ const getTextBundle = _____i18n["getTextBundle"];
18
+ const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
19
+ const CREATE_TABLE_CUSTOM_COLUMN = 'create-table-custom-column';
20
+ const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, TREE_TABLE_TYPE, GRID_TABLE_TYPE];
21
+
22
+ /**
23
+ * Reusable function which performs some preparation steps before table action execution
24
+ *
25
+ * @param table - table element
26
+ * @param sectionInfo - section data
27
+ * @param iconTabBar - icon tab bar element
28
+ * @param iconTabBarFilterKey - tab bar key to select a tab
29
+ */
30
+ function preprocessActionExecution(table, sectionInfo, iconTabBar, iconTabBarFilterKey) {
31
+ if (sectionInfo) {
32
+ const {
33
+ layout,
34
+ section,
35
+ subSection
36
+ } = sectionInfo;
37
+ layout?.setSelectedSection(section);
38
+ section.setSelectedSubSection(subSection);
39
+ } else {
40
+ getControlById(table.getId())?.getDomRef()?.scrollIntoView();
41
+ }
42
+ if (iconTabBar && iconTabBarFilterKey) {
43
+ iconTabBar.setSelectedKey(iconTabBarFilterKey);
44
+ }
45
+ }
46
+ class AddTableCustomColumnQuickAction extends TableQuickActionDefinitionBase {
47
+ constructor(context) {
48
+ super(CREATE_TABLE_CUSTOM_COLUMN, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN', context, {
49
+ areTableRowsRequired: true
50
+ }, [DIALOG_ENABLEMENT_VALIDATOR]);
51
+ }
52
+ async execute(path) {
53
+ const {
54
+ table,
55
+ iconTabBarFilterKey,
56
+ sectionInfo
57
+ } = this.tableMap[path];
58
+ if (!table) {
59
+ return [];
60
+ }
61
+ preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
62
+ this.selectOverlay(table);
63
+ let tableInternal = table;
64
+ if (isA(SMART_TABLE_TYPE, table)) {
65
+ const itemsAggregation = table.getAggregation('items');
66
+ tableInternal = itemsAggregation.find(item => {
67
+ return [M_TABLE_TYPE, TREE_TABLE_TYPE, ANALYTICAL_TABLE_TYPE, GRID_TABLE_TYPE].some(tType => isA(tType, item));
68
+ });
69
+ if (!tableInternal) {
70
+ return [];
71
+ }
72
+ }
73
+ const overlay = OverlayRegistry.getOverlay(tableInternal) || [];
74
+ if (!overlay) {
75
+ return [];
76
+ }
77
+ if (isA(M_TABLE_TYPE, tableInternal) && tableInternal.getAggregation('items').length === 0) {
78
+ const bundle = await getTextBundle();
79
+ notifyUser(bundle.getText('TABLE_ROWS_NEEDED_TO_CREATE_CUSTOM_COLUMN'), 8000);
80
+ return [];
81
+ }
82
+ const dialog = [TREE_TABLE_TYPE, ANALYTICAL_TABLE_TYPE, GRID_TABLE_TYPE].some(type => isA(type, tableInternal)) ? DialogNames.ADD_FRAGMENT : DialogNames.ADD_TABLE_COLUMN_FRAGMENTS;
83
+ await DialogFactory.createDialog(overlay, this.context.rta, dialog, undefined, {
84
+ aggregation: 'columns',
85
+ title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN'
86
+ });
87
+ return [];
88
+ }
89
+ }
90
+ var __exports = {
91
+ __esModule: true
92
+ };
93
+ __exports.CREATE_TABLE_CUSTOM_COLUMN = CREATE_TABLE_CUSTOM_COLUMN;
94
+ __exports.preprocessActionExecution = preprocessActionExecution;
95
+ __exports.AddTableCustomColumnQuickAction = AddTableCustomColumnQuickAction;
96
+ return __exports;
96
97
  });
97
98
  //# sourceMappingURL=create-table-custom-column.js.map
@@ -1,27 +1,26 @@
1
- import FlexCommand from 'sap/ui/rta/command/FlexCommand';
2
- import type SmartTable from 'sap/ui/comp/smarttable/SmartTable';
3
-
4
- import { QuickActionContext, NestedQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
5
- import { getControlById, isA } from '../../../utils/core';
6
- import OverlayRegistry from 'sap/ui/dt/OverlayRegistry';
7
- import { DialogNames, handler } from '../../init-dialogs';
8
- import {
9
- ANALYTICAL_TABLE_TYPE,
10
- GRID_TABLE_TYPE,
11
- M_TABLE_TYPE,
12
- SMART_TABLE_TYPE,
13
- TableQuickActionDefinitionBase,
14
- TREE_TABLE_TYPE
15
- } from '../table-quick-action-base';
16
1
  import ManagedObject from 'sap/ui/base/ManagedObject';
17
2
  import UI5Element from 'sap/ui/core/Element';
18
- import { notifyUser } from '../../utils';
19
- import { getTextBundle } from '../../../i18n';
3
+
4
+ import type FlexCommand from 'sap/ui/rta/command/FlexCommand';
5
+ import OverlayRegistry from 'sap/ui/dt/OverlayRegistry';
6
+
20
7
  import ObjectPageSection from 'sap/uxap/ObjectPageSection';
21
8
  import ObjectPageSubSection from 'sap/uxap/ObjectPageSubSection';
22
9
  import ObjectPageLayout from 'sap/uxap/ObjectPageLayout';
10
+
23
11
  import IconTabBar from 'sap/m/IconTabBar';
24
12
 
13
+ import type SmartTable from 'sap/ui/comp/smarttable/SmartTable';
14
+
15
+ import { QuickActionContext, NestedQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
16
+ import { getControlById, isA } from '../../../utils/core';
17
+ import { DialogNames, DialogFactory } from '../../dialog-factory';
18
+ import { ANALYTICAL_TABLE_TYPE, GRID_TABLE_TYPE, M_TABLE_TYPE, SMART_TABLE_TYPE, TREE_TABLE_TYPE } from '../control-types';
19
+ import { TableQuickActionDefinitionBase } from '../table-quick-action-base';
20
+ import { notifyUser } from '../../utils';
21
+ import { getTextBundle } from '../../../i18n';
22
+ import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator';
23
+
25
24
  export const CREATE_TABLE_CUSTOM_COLUMN = 'create-table-custom-column';
26
25
 
27
26
  const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, TREE_TABLE_TYPE, GRID_TABLE_TYPE];
@@ -64,9 +63,16 @@ export class AddTableCustomColumnQuickAction
64
63
  implements NestedQuickActionDefinition
65
64
  {
66
65
  constructor(context: QuickActionContext) {
67
- super(CREATE_TABLE_CUSTOM_COLUMN, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN', context, {
68
- areTableRowsRequired: true
69
- });
66
+ super(
67
+ CREATE_TABLE_CUSTOM_COLUMN,
68
+ CONTROL_TYPES,
69
+ 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN',
70
+ context,
71
+ {
72
+ areTableRowsRequired: true
73
+ },
74
+ [DIALOG_ENABLEMENT_VALIDATOR]
75
+ );
70
76
  }
71
77
 
72
78
  async execute(path: string): Promise<FlexCommand[]> {
@@ -109,7 +115,7 @@ export class AddTableCustomColumnQuickAction
109
115
  )
110
116
  ? DialogNames.ADD_FRAGMENT
111
117
  : DialogNames.ADD_TABLE_COLUMN_FRAGMENTS;
112
- await handler(overlay, this.context.rta, dialog, undefined, {
118
+ await DialogFactory.createDialog(overlay, this.context.rta, dialog, undefined, {
113
119
  aggregation: 'columns',
114
120
  title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN'
115
121
  });
@@ -1,58 +1,62 @@
1
- "use strict";
2
-
3
- sap.ui.define(["../../../cpe/quick-actions/utils", "../../../utils/core", "../simple-quick-action-base", "./utils"], function (_____cpe_quick_actions_utils, _____utils_core, ___simple_quick_action_base, ___utils) {
4
- "use strict";
5
-
6
- const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
7
- const getControlById = _____utils_core["getControlById"];
8
- const isA = _____utils_core["isA"];
9
- const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
10
- const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
11
- const prepareManifestChange = ___utils["prepareManifestChange"];
12
- const ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR = 'enable-semantic-daterange-filterbar';
13
- const CONTROL_TYPE = 'sap.ui.comp.smartfilterbar.SmartFilterBar';
14
- const COMPONENT = 'sap.suite.ui.generic.template.ListReport';
15
- /**
16
- * Quick Action for toggling the visibility of "semantic date range" for filterbar fields.
17
- */
18
- class ToggleSemanticDateRangeFilterBar extends SimpleQuickActionDefinitionBase {
19
- constructor(context) {
20
- super(ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR, [], '', context);
21
- }
22
- forceRefreshAfterExecution = true;
23
- isUseDateRangeTypeEnabled = false;
24
- async initialize() {
25
- const manifestChangesSupported = await areManifestChangesSupported(this.context.manifest);
26
- if (!manifestChangesSupported) {
27
- return;
28
- }
29
- const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
30
- for (const control of controls) {
31
- const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
32
- const modifiedControl = getControlById(control.controlId);
33
- if (isActionApplicable && modifiedControl) {
34
- this.isUseDateRangeTypeEnabled = modifiedControl.getProperty('useDateRangeType');
35
- this.control = modifiedControl;
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 entitySet = isA(CONTROL_TYPE, this.control) ? this.control.getEntitySet() : undefined;
44
- const command = await prepareManifestChange(this.context, 'component/settings/filterSettings/dateSettings', this.control, COMPONENT, entitySet, {
45
- useDateRange: !this.isUseDateRangeTypeEnabled
46
- });
47
- this.isUseDateRangeTypeEnabled = !this.isUseDateRangeTypeEnabled;
48
- return command;
49
- }
50
- }
51
- var __exports = {
52
- __esModule: true
53
- };
54
- __exports.ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR = ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR;
55
- __exports.ToggleSemanticDateRangeFilterBar = ToggleSemanticDateRangeFilterBar;
56
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["../../../cpe/quick-actions/utils", "../../../utils/core", "../simple-quick-action-base", "./utils"], function (_____cpe_quick_actions_utils, _____utils_core, ___simple_quick_action_base, ___utils) {
4
+ "use strict";
5
+
6
+ const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
7
+ const getControlById = _____utils_core["getControlById"];
8
+ const isA = _____utils_core["isA"];
9
+ const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
10
+ const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
11
+ const prepareManifestChange = ___utils["prepareManifestChange"];
12
+ const ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR = 'enable-semantic-daterange-filterbar';
13
+ const CONTROL_TYPE = 'sap.ui.comp.smartfilterbar.SmartFilterBar';
14
+ const COMPONENT = 'sap.suite.ui.generic.template.ListReport';
15
+ /**
16
+ * Quick Action for toggling the visibility of "semantic date range" for filterbar fields.
17
+ */
18
+ class ToggleSemanticDateRangeFilterBar extends SimpleQuickActionDefinitionBase {
19
+ constructor(context) {
20
+ super(ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR, [], '', context);
21
+ }
22
+ forceRefreshAfterExecution = true;
23
+ isUseDateRangeTypeEnabled = false;
24
+ async initialize() {
25
+ const manifestChangesSupported = await areManifestChangesSupported(this.context.manifest);
26
+ if (!manifestChangesSupported) {
27
+ return;
28
+ }
29
+ const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
30
+ for (const control of controls) {
31
+ const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
32
+ const modifiedControl = getControlById(control.controlId);
33
+ if (isActionApplicable && modifiedControl) {
34
+ this.control = modifiedControl;
35
+ const id = this.control.getProperty('persistencyKey') ?? this.control.getId();
36
+ if (typeof id !== 'string') {
37
+ throw new Error('Could not retrieve configuration property because control id is not valid!');
38
+ }
39
+ const value = this.context.changeService.getConfigurationPropertyValue(id, 'useDateRange');
40
+ this.isUseDateRangeTypeEnabled = value === undefined ? this.control.data('useDateRangeType') : value;
41
+ }
42
+ }
43
+ }
44
+ get textKey() {
45
+ return this.isUseDateRangeTypeEnabled ? 'QUICK_ACTION_LR_DISABLE_SEMANTIC_DATE_RANGE_FILTER_BAR' : 'QUICK_ACTION_LR_ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR';
46
+ }
47
+ async execute() {
48
+ const entitySet = isA(CONTROL_TYPE, this.control) ? this.control.getEntitySet() : undefined;
49
+ const command = await prepareManifestChange(this.context, 'component/settings/filterSettings/dateSettings', this.control, COMPONENT, entitySet, {
50
+ useDateRange: !this.isUseDateRangeTypeEnabled
51
+ });
52
+ return command;
53
+ }
54
+ }
55
+ var __exports = {
56
+ __esModule: true
57
+ };
58
+ __exports.ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR = ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR;
59
+ __exports.ToggleSemanticDateRangeFilterBar = ToggleSemanticDateRangeFilterBar;
60
+ return __exports;
57
61
  });
58
62
  //# sourceMappingURL=lr-enable-semantic-date-range-filter-bar.js.map
@@ -33,8 +33,15 @@ export class ToggleSemanticDateRangeFilterBar
33
33
  const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
34
34
  const modifiedControl = getControlById<FilterBar>(control.controlId);
35
35
  if (isActionApplicable && modifiedControl) {
36
- this.isUseDateRangeTypeEnabled = modifiedControl.getProperty('useDateRangeType');
37
36
  this.control = modifiedControl;
37
+
38
+ const id = (this.control.getProperty('persistencyKey') as unknown) ?? this.control.getId();
39
+ if (typeof id !== 'string') {
40
+ throw new Error('Could not retrieve configuration property because control id is not valid!');
41
+ }
42
+ const value = this.context.changeService.getConfigurationPropertyValue(id, 'useDateRange');
43
+ this.isUseDateRangeTypeEnabled =
44
+ value === undefined ? (this.control.data('useDateRangeType') as boolean) : (value as boolean);
38
45
  }
39
46
  }
40
47
  }
@@ -58,8 +65,6 @@ export class ToggleSemanticDateRangeFilterBar
58
65
  }
59
66
  );
60
67
 
61
- this.isUseDateRangeTypeEnabled = !this.isUseDateRangeTypeEnabled;
62
-
63
68
  return command;
64
69
  }
65
70
  }