@sap-ux/preview-middleware 0.19.29 → 0.19.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/dist/base/flp.d.ts +2 -2
  2. package/dist/base/flp.js +3 -3
  3. package/dist/client/adp/add-fragment.js +48 -0
  4. package/dist/client/adp/add-fragment.ts +51 -0
  5. package/dist/client/adp/api-handler.js +155 -153
  6. package/dist/client/adp/api-handler.ts +2 -2
  7. package/dist/client/adp/command-executor.js +75 -75
  8. package/dist/client/adp/control-utils.js +44 -44
  9. package/dist/client/adp/controllers/AddFragment.controller.js +26 -86
  10. package/dist/client/adp/controllers/AddFragment.controller.ts +29 -113
  11. package/dist/client/adp/controllers/ControllerExtension.controller.js +210 -210
  12. package/dist/client/adp/controllers/ExtensionPoint.controller.js +139 -139
  13. package/dist/client/adp/controllers/FileExistsDialog.controller.js +66 -66
  14. package/dist/client/adp/dialog-factory.js +135 -135
  15. package/dist/client/adp/dialog-factory.ts +21 -13
  16. package/dist/client/adp/extension-point.js +3 -3
  17. package/dist/client/adp/extension-point.ts +3 -3
  18. package/dist/client/adp/init-dialogs.js +163 -138
  19. package/dist/client/adp/init-dialogs.ts +13 -8
  20. package/dist/client/adp/init.js +2 -0
  21. package/dist/client/adp/init.ts +5 -0
  22. package/dist/client/adp/quick-actions/add-new-subpage-quick-action-base.js +96 -96
  23. package/dist/client/adp/quick-actions/common/add-controller-to-page.js +60 -60
  24. package/dist/client/adp/quick-actions/common/create-page-action.js +54 -54
  25. package/dist/client/adp/quick-actions/common/op-add-custom-section.js +39 -39
  26. package/dist/client/adp/quick-actions/common/op-add-header-field.js +67 -67
  27. package/dist/client/adp/quick-actions/common/utils.js +18 -18
  28. package/dist/client/adp/quick-actions/control-types.js +23 -23
  29. package/dist/client/adp/quick-actions/dialog-enablement-validator.js +24 -24
  30. package/dist/client/adp/quick-actions/enablement-validator.js +4 -4
  31. package/dist/client/adp/quick-actions/fe-v2/add-new-subpage.js +81 -81
  32. package/dist/client/adp/quick-actions/fe-v2/change-table-actions.js +67 -67
  33. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +101 -101
  34. package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +107 -107
  35. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +99 -99
  36. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +78 -78
  37. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +77 -77
  38. package/dist/client/adp/quick-actions/fe-v2/lr-enable-variant-management.js +69 -69
  39. package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +59 -59
  40. package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +93 -93
  41. package/dist/client/adp/quick-actions/fe-v2/op-enable-variant-management.js +84 -84
  42. package/dist/client/adp/quick-actions/fe-v2/registry.js +77 -77
  43. package/dist/client/adp/quick-actions/fe-v2/utils.js +116 -116
  44. package/dist/client/adp/quick-actions/fe-v4/add-new-subpage.js +138 -138
  45. package/dist/client/adp/quick-actions/fe-v4/change-table-actions.js +79 -79
  46. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +75 -75
  47. package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +53 -53
  48. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +49 -49
  49. package/dist/client/adp/quick-actions/fe-v4/enable-variant-management.js +81 -81
  50. package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +56 -56
  51. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +84 -84
  52. package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +53 -53
  53. package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +89 -89
  54. package/dist/client/adp/quick-actions/fe-v4/registry.js +60 -60
  55. package/dist/client/adp/quick-actions/fe-v4/utils.js +72 -72
  56. package/dist/client/adp/quick-actions/load.js +44 -44
  57. package/dist/client/adp/quick-actions/quick-action-base.js +64 -64
  58. package/dist/client/adp/utils.js +218 -218
  59. package/dist/client/cpe/additional-change-info/add-xml-additional-info.js +77 -0
  60. package/dist/client/cpe/additional-change-info/add-xml-additional-info.ts +84 -0
  61. package/dist/client/cpe/changes/index.js +10 -10
  62. package/dist/client/cpe/changes/service.js +5 -2
  63. package/dist/client/cpe/changes/service.ts +2 -0
  64. package/dist/client/cpe/changes/validator.js +39 -39
  65. package/dist/client/cpe/connector-service.js +2 -1
  66. package/dist/client/cpe/connector-service.ts +8 -4
  67. package/dist/client/cpe/documentation.js +164 -164
  68. package/dist/client/cpe/feature-service.js +36 -36
  69. package/dist/client/cpe/logger.js +30 -30
  70. package/dist/client/cpe/outline/editable.js +37 -37
  71. package/dist/client/cpe/outline/nodes.js +203 -203
  72. package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
  73. package/dist/client/cpe/quick-actions/registry.js +143 -143
  74. package/dist/client/cpe/quick-actions/utils.js +92 -92
  75. package/dist/client/cpe/types.js +4 -4
  76. package/dist/client/cpe/ui5-utils.js +33 -33
  77. package/dist/client/cpe/utils.js +111 -111
  78. package/dist/client/flp/WorkspaceConnector.js +92 -86
  79. package/dist/client/flp/WorkspaceConnector.ts +10 -2
  80. package/dist/client/flp/common.js +28 -28
  81. package/dist/client/flp/enableFakeConnector.js +89 -83
  82. package/dist/client/flp/enableFakeConnector.ts +11 -2
  83. package/dist/client/flp/homepage/Component.js +14 -14
  84. package/dist/client/flp/initCdm.js +117 -117
  85. package/dist/client/flp/initConnectors.js +28 -28
  86. package/dist/client/flp/initRta.js +178 -178
  87. package/dist/client/i18n.js +56 -56
  88. package/dist/client/utils/additional-change-info.js +43 -0
  89. package/dist/client/utils/additional-change-info.ts +42 -0
  90. package/dist/client/utils/application.js +32 -32
  91. package/dist/client/utils/core.js +84 -84
  92. package/dist/client/utils/error.js +19 -19
  93. package/dist/client/utils/fe-v2.js +56 -56
  94. package/dist/client/utils/fe-v4.js +140 -140
  95. package/dist/client/utils/version.js +104 -104
  96. package/package.json +4 -4
@@ -1,109 +1,109 @@
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 initialize() {
23
- const processChild = (child, mapKey) => {
24
- const table = this.tableMap[mapKey]?.table;
25
- if (table) {
26
- const headerToolbar = this.getHeaderToolbar(table);
27
- if (!headerToolbar) {
28
- child.enabled = false;
29
- child.tooltip = this.context.resourceBundle.getText('NO_TABLE_HEADER_TOOLBAR');
30
- }
31
- }
32
- child.children.forEach((nestedChild, idx) => processChild(nestedChild, `${mapKey}/${idx.toFixed(0)}`));
33
- };
34
- await super.initialize();
35
-
36
- // disable nested actions based on conditions
37
- this.children.forEach((nestedChild, idx) => processChild(nestedChild, `${idx.toFixed(0)}`));
38
- }
39
- async execute(path) {
40
- const {
41
- table,
42
- iconTabBarFilterKey,
43
- sectionInfo
44
- } = this.tableMap[path];
45
- if (!table) {
46
- return [];
47
- }
48
- if (sectionInfo) {
49
- const {
50
- layout,
51
- section,
52
- subSection
53
- } = sectionInfo;
54
- layout?.setSelectedSection(section);
55
- section.setSelectedSubSection(subSection);
56
- this.selectOverlay(table);
57
- } else {
58
- getControlById(table.getId())?.getDomRef()?.scrollIntoView();
59
- this.selectOverlay(table);
60
- }
61
- if (this.iconTabBar && iconTabBarFilterKey) {
62
- this.iconTabBar.setSelectedKey(iconTabBarFilterKey);
63
- }
64
- const headerToolbar = this.getHeaderToolbar(table);
65
-
66
- // open dialogBox to add, and content is selected ByDefault
67
- if (headerToolbar) {
68
- const overlay = OverlayRegistry.getOverlay(headerToolbar) || [];
69
- await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
70
- aggregation: 'content',
71
- title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION',
72
- defaultAggregationArrayIndex: 1
73
- }, {
74
- actionName: this.type,
75
- telemetryEventIdentifier: this.getTelemetryIdentifier()
76
- });
77
- }
78
- return [];
79
- }
80
- getHeaderToolbar(table) {
81
- let headerToolbar;
82
- if (isA(SMART_TABLE_TYPE, table)) {
83
- for (const item of table.getAggregation('items')) {
84
- if (item.getAggregation('headerToolbar')) {
85
- headerToolbar = item.getAggregation('headerToolbar');
86
- break;
87
- }
88
- if (isA('sap.m.OverflowToolbar', item)) {
89
- headerToolbar = item;
90
- break;
91
- }
92
- }
93
- if (!headerToolbar) {
94
- headerToolbar = table.getToolbar();
95
- }
96
- } else if (isA(M_TABLE_TYPE, table)) {
97
- headerToolbar = table.getAggregation('headerToolbar');
98
- }
99
- return headerToolbar;
100
- }
101
- }
102
- var __exports = {
103
- __esModule: true
104
- };
105
- __exports.CREATE_TABLE_ACTION = CREATE_TABLE_ACTION;
106
- __exports.AddTableActionQuickAction = AddTableActionQuickAction;
107
- 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 initialize() {
23
+ const processChild = (child, mapKey) => {
24
+ const table = this.tableMap[mapKey]?.table;
25
+ if (table) {
26
+ const headerToolbar = this.getHeaderToolbar(table);
27
+ if (!headerToolbar) {
28
+ child.enabled = false;
29
+ child.tooltip = this.context.resourceBundle.getText('NO_TABLE_HEADER_TOOLBAR');
30
+ }
31
+ }
32
+ child.children.forEach((nestedChild, idx) => processChild(nestedChild, `${mapKey}/${idx.toFixed(0)}`));
33
+ };
34
+ await super.initialize();
35
+
36
+ // disable nested actions based on conditions
37
+ this.children.forEach((nestedChild, idx) => processChild(nestedChild, `${idx.toFixed(0)}`));
38
+ }
39
+ async execute(path) {
40
+ const {
41
+ table,
42
+ iconTabBarFilterKey,
43
+ sectionInfo
44
+ } = this.tableMap[path];
45
+ if (!table) {
46
+ return [];
47
+ }
48
+ if (sectionInfo) {
49
+ const {
50
+ layout,
51
+ section,
52
+ subSection
53
+ } = sectionInfo;
54
+ layout?.setSelectedSection(section);
55
+ section.setSelectedSubSection(subSection);
56
+ this.selectOverlay(table);
57
+ } else {
58
+ getControlById(table.getId())?.getDomRef()?.scrollIntoView();
59
+ this.selectOverlay(table);
60
+ }
61
+ if (this.iconTabBar && iconTabBarFilterKey) {
62
+ this.iconTabBar.setSelectedKey(iconTabBarFilterKey);
63
+ }
64
+ const headerToolbar = this.getHeaderToolbar(table);
65
+
66
+ // open dialogBox to add, and content is selected ByDefault
67
+ if (headerToolbar) {
68
+ const overlay = OverlayRegistry.getOverlay(headerToolbar) || [];
69
+ await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
70
+ aggregation: 'content',
71
+ title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION',
72
+ defaultAggregationArrayIndex: 1
73
+ }, {
74
+ actionName: this.type,
75
+ telemetryEventIdentifier: this.getTelemetryIdentifier()
76
+ });
77
+ }
78
+ return [];
79
+ }
80
+ getHeaderToolbar(table) {
81
+ let headerToolbar;
82
+ if (isA(SMART_TABLE_TYPE, table)) {
83
+ for (const item of table.getAggregation('items')) {
84
+ if (item.getAggregation('headerToolbar')) {
85
+ headerToolbar = item.getAggregation('headerToolbar');
86
+ break;
87
+ }
88
+ if (isA('sap.m.OverflowToolbar', item)) {
89
+ headerToolbar = item;
90
+ break;
91
+ }
92
+ }
93
+ if (!headerToolbar) {
94
+ headerToolbar = table.getToolbar();
95
+ }
96
+ } else if (isA(M_TABLE_TYPE, table)) {
97
+ headerToolbar = table.getAggregation('headerToolbar');
98
+ }
99
+ return headerToolbar;
100
+ }
101
+ }
102
+ var __exports = {
103
+ __esModule: true
104
+ };
105
+ __exports.CREATE_TABLE_ACTION = CREATE_TABLE_ACTION;
106
+ __exports.AddTableActionQuickAction = AddTableActionQuickAction;
107
+ return __exports;
108
108
  });
109
109
  //# sourceMappingURL=create-table-action.js.map
@@ -1,101 +1,101 @@
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
- actionName: this.type,
88
- telemetryEventIdentifier: this.getTelemetryIdentifier()
89
- });
90
- return [];
91
- }
92
- }
93
- var __exports = {
94
- __esModule: true
95
- };
96
- __exports.CREATE_TABLE_CUSTOM_COLUMN = CREATE_TABLE_CUSTOM_COLUMN;
97
- __exports.preprocessActionExecution = preprocessActionExecution;
98
- __exports.AddTableCustomColumnQuickAction = AddTableCustomColumnQuickAction;
99
- 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
+ actionName: this.type,
88
+ telemetryEventIdentifier: this.getTelemetryIdentifier()
89
+ });
90
+ return [];
91
+ }
92
+ }
93
+ var __exports = {
94
+ __esModule: true
95
+ };
96
+ __exports.CREATE_TABLE_CUSTOM_COLUMN = CREATE_TABLE_CUSTOM_COLUMN;
97
+ __exports.preprocessActionExecution = preprocessActionExecution;
98
+ __exports.AddTableCustomColumnQuickAction = AddTableCustomColumnQuickAction;
99
+ return __exports;
100
100
  });
101
101
  //# sourceMappingURL=create-table-custom-column.js.map
@@ -1,80 +1,80 @@
1
- "use strict";
2
-
3
- sap.ui.define(["../../../cpe/quick-actions/utils", "../../../utils/core", "../simple-quick-action-base", "./utils", "../../../utils/version"], function (_____cpe_quick_actions_utils, _____utils_core, ___simple_quick_action_base, ___utils, _____utils_version) {
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 getUi5Version = _____utils_version["getUi5Version"];
13
- const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
14
- const ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR = 'enable-semantic-daterange-filterbar';
15
- const CONTROL_TYPE_LR = 'sap.ui.comp.smartfilterbar.SmartFilterBar';
16
- const CONTROL_TYPE_ALP = 'sap.suite.ui.generic.template.AnalyticalListPage.control.SmartFilterBarExt';
17
- const COMPONENT_LR = 'sap.suite.ui.generic.template.ListReport';
18
- const COMPONENT_ALP = 'sap.suite.ui.generic.template.AnalyticalListPage';
19
-
20
- /**
21
- * Quick Action for toggling the visibility of "semantic date range" for filterbar fields.
22
- */
23
- class ToggleSemanticDateRangeFilterBar extends SimpleQuickActionDefinitionBase {
24
- constructor(context) {
25
- super(ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR, [], '', context);
26
- }
27
- forceRefreshAfterExecution = true;
28
- isUseDateRangeTypeEnabled = false;
29
- async initialize() {
30
- const manifestChangesSupported = await areManifestChangesSupported(this.context.manifest);
31
- if (!manifestChangesSupported) {
32
- return;
33
- }
34
- const controls = [...(this.context.controlIndex[CONTROL_TYPE_LR] ?? []), ...(this.context.controlIndex[CONTROL_TYPE_ALP] ?? [])];
35
- for (const control of controls) {
36
- const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
37
- const modifiedControl = getControlById(control.controlId);
38
- if (isActionApplicable && modifiedControl) {
39
- this.control = modifiedControl;
40
- const id = this.control.getProperty('persistencyKey') ?? this.control.getId();
41
- if (typeof id !== 'string') {
42
- throw new Error('Could not retrieve configuration property because control id is not valid!');
43
- }
44
- const value = this.context.changeService.getConfigurationPropertyValue(id, 'useDateRange');
45
- this.isUseDateRangeTypeEnabled = value === undefined ? this.control.getUseDateRangeType() : value;
46
- }
47
- }
48
- }
49
- get textKey() {
50
- return this.isUseDateRangeTypeEnabled ? 'QUICK_ACTION_LR_DISABLE_SEMANTIC_DATE_RANGE_FILTER_BAR' : 'QUICK_ACTION_LR_ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR';
51
- }
52
- async execute() {
53
- const version = await getUi5Version();
54
- const isLowerMinimalVersion = isLowerThanMinimalUi5Version(version, {
55
- major: 1,
56
- minor: 126
57
- });
58
- let entitySet;
59
- if (isLowerMinimalVersion && isA(CONTROL_TYPE_LR, this.control)) {
60
- // In older versions of UI5, the getEntitySet method is unavailable, so this workaround has been introduced.
61
- const regex = /::([^:]+)--/;
62
- entitySet = regex.exec(this.control?.getId() ?? '')?.[1];
63
- } else {
64
- entitySet = isA(CONTROL_TYPE_LR, this.control) || isA(CONTROL_TYPE_ALP, this.control) ? this.control.getEntitySet() : undefined;
65
- }
66
- const viewName = this.context.view.getViewName();
67
- const command = await prepareManifestChange(this.context, 'component/settings/filterSettings/dateSettings', this.control, viewName.includes('AnalyticalListPage') ? COMPONENT_ALP : COMPONENT_LR, entitySet, {
68
- useDateRange: !this.isUseDateRangeTypeEnabled
69
- });
70
- return command;
71
- }
72
- }
73
- var __exports = {
74
- __esModule: true
75
- };
76
- __exports.ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR = ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR;
77
- __exports.ToggleSemanticDateRangeFilterBar = ToggleSemanticDateRangeFilterBar;
78
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["../../../cpe/quick-actions/utils", "../../../utils/core", "../simple-quick-action-base", "./utils", "../../../utils/version"], function (_____cpe_quick_actions_utils, _____utils_core, ___simple_quick_action_base, ___utils, _____utils_version) {
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 getUi5Version = _____utils_version["getUi5Version"];
13
+ const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
14
+ const ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR = 'enable-semantic-daterange-filterbar';
15
+ const CONTROL_TYPE_LR = 'sap.ui.comp.smartfilterbar.SmartFilterBar';
16
+ const CONTROL_TYPE_ALP = 'sap.suite.ui.generic.template.AnalyticalListPage.control.SmartFilterBarExt';
17
+ const COMPONENT_LR = 'sap.suite.ui.generic.template.ListReport';
18
+ const COMPONENT_ALP = 'sap.suite.ui.generic.template.AnalyticalListPage';
19
+
20
+ /**
21
+ * Quick Action for toggling the visibility of "semantic date range" for filterbar fields.
22
+ */
23
+ class ToggleSemanticDateRangeFilterBar extends SimpleQuickActionDefinitionBase {
24
+ constructor(context) {
25
+ super(ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR, [], '', context);
26
+ }
27
+ forceRefreshAfterExecution = true;
28
+ isUseDateRangeTypeEnabled = false;
29
+ async initialize() {
30
+ const manifestChangesSupported = await areManifestChangesSupported(this.context.manifest);
31
+ if (!manifestChangesSupported) {
32
+ return;
33
+ }
34
+ const controls = [...(this.context.controlIndex[CONTROL_TYPE_LR] ?? []), ...(this.context.controlIndex[CONTROL_TYPE_ALP] ?? [])];
35
+ for (const control of controls) {
36
+ const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
37
+ const modifiedControl = getControlById(control.controlId);
38
+ if (isActionApplicable && modifiedControl) {
39
+ this.control = modifiedControl;
40
+ const id = this.control.getProperty('persistencyKey') ?? this.control.getId();
41
+ if (typeof id !== 'string') {
42
+ throw new Error('Could not retrieve configuration property because control id is not valid!');
43
+ }
44
+ const value = this.context.changeService.getConfigurationPropertyValue(id, 'useDateRange');
45
+ this.isUseDateRangeTypeEnabled = value === undefined ? this.control.getUseDateRangeType() : value;
46
+ }
47
+ }
48
+ }
49
+ get textKey() {
50
+ return this.isUseDateRangeTypeEnabled ? 'QUICK_ACTION_LR_DISABLE_SEMANTIC_DATE_RANGE_FILTER_BAR' : 'QUICK_ACTION_LR_ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR';
51
+ }
52
+ async execute() {
53
+ const version = await getUi5Version();
54
+ const isLowerMinimalVersion = isLowerThanMinimalUi5Version(version, {
55
+ major: 1,
56
+ minor: 126
57
+ });
58
+ let entitySet;
59
+ if (isLowerMinimalVersion && isA(CONTROL_TYPE_LR, this.control)) {
60
+ // In older versions of UI5, the getEntitySet method is unavailable, so this workaround has been introduced.
61
+ const regex = /::([^:]+)--/;
62
+ entitySet = regex.exec(this.control?.getId() ?? '')?.[1];
63
+ } else {
64
+ entitySet = isA(CONTROL_TYPE_LR, this.control) || isA(CONTROL_TYPE_ALP, this.control) ? this.control.getEntitySet() : undefined;
65
+ }
66
+ const viewName = this.context.view.getViewName();
67
+ const command = await prepareManifestChange(this.context, 'component/settings/filterSettings/dateSettings', this.control, viewName.includes('AnalyticalListPage') ? COMPONENT_ALP : COMPONENT_LR, entitySet, {
68
+ useDateRange: !this.isUseDateRangeTypeEnabled
69
+ });
70
+ return command;
71
+ }
72
+ }
73
+ var __exports = {
74
+ __esModule: true
75
+ };
76
+ __exports.ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR = ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR;
77
+ __exports.ToggleSemanticDateRangeFilterBar = ToggleSemanticDateRangeFilterBar;
78
+ return __exports;
79
79
  });
80
80
  //# sourceMappingURL=lr-enable-semantic-date-range-filter-bar.js.map