@sap-ux/preview-middleware 0.17.32 → 0.17.33

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 (66) hide show
  1. package/dist/client/adp/api-handler.js +153 -153
  2. package/dist/client/adp/command-executor.js +75 -75
  3. package/dist/client/adp/control-utils.js +44 -44
  4. package/dist/client/adp/controllers/BaseDialog.controller.js +187 -187
  5. package/dist/client/adp/controllers/ControllerExtension.controller.js +213 -213
  6. package/dist/client/adp/controllers/ExtensionPoint.controller.js +138 -138
  7. package/dist/client/adp/controllers/FileExistsDialog.controller.js +66 -66
  8. package/dist/client/adp/dialog-factory.js +122 -122
  9. package/dist/client/adp/init-dialogs.js +100 -100
  10. package/dist/client/adp/quick-actions/common/add-controller-to-page.js +55 -55
  11. package/dist/client/adp/quick-actions/common/create-page-action.js +50 -50
  12. package/dist/client/adp/quick-actions/common/op-add-custom-section.js +36 -36
  13. package/dist/client/adp/quick-actions/common/op-add-header-field.js +48 -48
  14. package/dist/client/adp/quick-actions/common/utils.js +18 -18
  15. package/dist/client/adp/quick-actions/control-types.js +21 -21
  16. package/dist/client/adp/quick-actions/dialog-enablement-validator.js +24 -24
  17. package/dist/client/adp/quick-actions/enablement-validator.js +4 -4
  18. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +101 -101
  19. package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +70 -70
  20. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +96 -96
  21. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +78 -78
  22. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +77 -77
  23. package/dist/client/adp/quick-actions/fe-v2/lr-enable-variant-management.js +69 -69
  24. package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +58 -58
  25. package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +93 -93
  26. package/dist/client/adp/quick-actions/fe-v2/op-enable-variant-management.js +84 -84
  27. package/dist/client/adp/quick-actions/fe-v2/registry.js +75 -75
  28. package/dist/client/adp/quick-actions/fe-v2/utils.js +116 -116
  29. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +73 -73
  30. package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +49 -49
  31. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +46 -46
  32. package/dist/client/adp/quick-actions/fe-v4/enable-variant-management.js +81 -81
  33. package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +55 -55
  34. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +82 -82
  35. package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +52 -52
  36. package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +89 -89
  37. package/dist/client/adp/quick-actions/fe-v4/registry.js +58 -58
  38. package/dist/client/adp/quick-actions/fe-v4/utils.js +47 -47
  39. package/dist/client/adp/quick-actions/load.js +44 -44
  40. package/dist/client/adp/quick-actions/quick-action-base.js +53 -53
  41. package/dist/client/adp/utils.js +160 -160
  42. package/dist/client/cpe/changes/index.js +10 -10
  43. package/dist/client/cpe/changes/validator.js +39 -39
  44. package/dist/client/cpe/documentation.js +164 -164
  45. package/dist/client/cpe/feature-service.js +36 -36
  46. package/dist/client/cpe/logger.js +30 -30
  47. package/dist/client/cpe/outline/editable.js +37 -37
  48. package/dist/client/cpe/outline/nodes.js +222 -222
  49. package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
  50. package/dist/client/cpe/quick-actions/registry.js +143 -143
  51. package/dist/client/cpe/quick-actions/utils.js +92 -92
  52. package/dist/client/cpe/types.js +4 -4
  53. package/dist/client/cpe/ui5-utils.js +33 -33
  54. package/dist/client/cpe/utils.js +138 -138
  55. package/dist/client/flp/WorkspaceConnector.js +86 -86
  56. package/dist/client/flp/common.js +28 -28
  57. package/dist/client/flp/enableFakeConnector.js +83 -83
  58. package/dist/client/flp/initConnectors.js +30 -30
  59. package/dist/client/flp/initRta.js +178 -178
  60. package/dist/client/i18n.js +56 -56
  61. package/dist/client/utils/application.js +32 -32
  62. package/dist/client/utils/core.js +68 -68
  63. package/dist/client/utils/error.js +19 -19
  64. package/dist/client/utils/fe-v4.js +118 -118
  65. package/dist/client/utils/version.js +102 -102
  66. package/package.json +2 -2
@@ -1,23 +1,23 @@
1
- "use strict";
2
-
3
- sap.ui.define([], function () {
4
- "use strict";
5
-
6
- const SMART_TABLE_TYPE = 'sap.ui.comp.smarttable.SmartTable';
7
- const M_TABLE_TYPE = 'sap.m.Table';
8
- const MDC_TABLE_TYPE = 'sap.ui.mdc.Table';
9
- const TREE_TABLE_TYPE = 'sap.ui.table.TreeTable';
10
- const GRID_TABLE_TYPE = 'sap.ui.table.Table';
11
- const ANALYTICAL_TABLE_TYPE = 'sap.ui.table.AnalyticalTable';
12
- var __exports = {
13
- __esModule: true
14
- };
15
- __exports.SMART_TABLE_TYPE = SMART_TABLE_TYPE;
16
- __exports.M_TABLE_TYPE = M_TABLE_TYPE;
17
- __exports.MDC_TABLE_TYPE = MDC_TABLE_TYPE;
18
- __exports.TREE_TABLE_TYPE = TREE_TABLE_TYPE;
19
- __exports.GRID_TABLE_TYPE = GRID_TABLE_TYPE;
20
- __exports.ANALYTICAL_TABLE_TYPE = ANALYTICAL_TABLE_TYPE;
21
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define([], function () {
4
+ "use strict";
5
+
6
+ const SMART_TABLE_TYPE = 'sap.ui.comp.smarttable.SmartTable';
7
+ const M_TABLE_TYPE = 'sap.m.Table';
8
+ const MDC_TABLE_TYPE = 'sap.ui.mdc.Table';
9
+ const TREE_TABLE_TYPE = 'sap.ui.table.TreeTable';
10
+ const GRID_TABLE_TYPE = 'sap.ui.table.Table';
11
+ const ANALYTICAL_TABLE_TYPE = 'sap.ui.table.AnalyticalTable';
12
+ var __exports = {
13
+ __esModule: true
14
+ };
15
+ __exports.SMART_TABLE_TYPE = SMART_TABLE_TYPE;
16
+ __exports.M_TABLE_TYPE = M_TABLE_TYPE;
17
+ __exports.MDC_TABLE_TYPE = MDC_TABLE_TYPE;
18
+ __exports.TREE_TABLE_TYPE = TREE_TABLE_TYPE;
19
+ __exports.GRID_TABLE_TYPE = GRID_TABLE_TYPE;
20
+ __exports.ANALYTICAL_TABLE_TYPE = ANALYTICAL_TABLE_TYPE;
21
+ return __exports;
22
22
  });
23
23
  //# sourceMappingURL=control-types.js.map
@@ -1,26 +1,26 @@
1
- "use strict";
2
-
3
- sap.ui.define(["../../i18n", "../dialog-factory"], function (____i18n, ___dialog_factory) {
4
- "use strict";
5
-
6
- const getTextBundle = ____i18n["getTextBundle"];
7
- const DialogFactory = ___dialog_factory["DialogFactory"];
8
- const DIALOG_ENABLEMENT_VALIDATOR = {
9
- run: async () => {
10
- const i18n = await getTextBundle();
11
- if (!DialogFactory.canOpenDialog) {
12
- return {
13
- type: 'error',
14
- message: i18n.getText('ADP_QUICK_ACTION_DIALOG_OPEN_MESSAGE')
15
- };
16
- }
17
- return undefined;
18
- }
19
- };
20
- var __exports = {
21
- __esModule: true
22
- };
23
- __exports.DIALOG_ENABLEMENT_VALIDATOR = DIALOG_ENABLEMENT_VALIDATOR;
24
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["../../i18n", "../dialog-factory"], function (____i18n, ___dialog_factory) {
4
+ "use strict";
5
+
6
+ const getTextBundle = ____i18n["getTextBundle"];
7
+ const DialogFactory = ___dialog_factory["DialogFactory"];
8
+ const DIALOG_ENABLEMENT_VALIDATOR = {
9
+ run: async () => {
10
+ const i18n = await getTextBundle();
11
+ if (!DialogFactory.canOpenDialog) {
12
+ return {
13
+ type: 'error',
14
+ message: i18n.getText('ADP_QUICK_ACTION_DIALOG_OPEN_MESSAGE')
15
+ };
16
+ }
17
+ return undefined;
18
+ }
19
+ };
20
+ var __exports = {
21
+ __esModule: true
22
+ };
23
+ __exports.DIALOG_ENABLEMENT_VALIDATOR = DIALOG_ENABLEMENT_VALIDATOR;
24
+ return __exports;
25
25
  });
26
26
  //# sourceMappingURL=dialog-enablement-validator.js.map
@@ -1,6 +1,6 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
5
  });
6
6
  //# sourceMappingURL=enablement-validator.js.map
@@ -1,103 +1,103 @@
1
- "use strict";
2
-
3
- sap.ui.define(["../../../utils/core", "../table-quick-action-base", "../dialog-enablement-validator"], function (_____utils_core, ___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 TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
9
- const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
10
- const CHANGE_TABLE_COLUMNS = 'change-table-columns';
11
- const SMART_TABLE_TYPE = 'sap.ui.comp.smarttable.SmartTable';
12
- const M_TABLE_TYPE = 'sap.m.Table';
13
- // maintain order if action id
14
- const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, 'sap.ui.table.TreeTable', 'sap.ui.table.Table'];
15
- class ChangeTableColumnsQuickAction extends TableQuickActionDefinitionBase {
16
- constructor(context) {
17
- super(CHANGE_TABLE_COLUMNS, CONTROL_TYPES, 'V2_QUICK_ACTION_CHANGE_TABLE_COLUMNS', context, {
18
- includeServiceAction: true
19
- }, [DIALOG_ENABLEMENT_VALIDATOR]);
20
- }
21
- async execute(path) {
22
- const {
23
- table,
24
- iconTabBarFilterKey,
25
- changeColumnActionId,
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
- if (changeColumnActionId) {
48
- const executeAction = async () => await this.context.actionService.execute(table.getId(), changeColumnActionId);
49
- if (isA(SMART_TABLE_TYPE, table)) {
50
- await executeAction();
51
- } else if (isA(M_TABLE_TYPE, table)) {
52
- // if table is busy, i.e. lazy loading, then we subscribe to 'updateFinished' event and call action service when loading is done
53
- // to avoid reopening the dialog after close
54
- if (this.isTableLoaded(table)) {
55
- await executeAction();
56
- } else {
57
- table.attachEventOnce('updateFinished', executeAction, this);
58
- }
59
- }
60
- }
61
- return [];
62
- }
63
- isAbsoluteAggregationBinding(element, aggregationName) {
64
- const mBindingInfo = element.getBindingInfo(aggregationName);
65
- const path = mBindingInfo?.path;
66
- if (!path) {
67
- return false;
68
- }
69
- return path.indexOf('/') === 0;
70
- }
71
-
72
- /**
73
- * Checks if table is loaded and has binding context available.
74
- * This is needed to properly render change columns dialog.
75
- * Based on {@link https://github.com/SAP/openui5/blob/rel-1.127/src/sap.ui.fl/src/sap/ui/fl/write/_internal/delegates/ODataV2ReadDelegate.js#L269-L271| ODataV2ReadDelegate.getPropertyInfo}.
76
- *
77
- * @param element - Table control.
78
- * @returns True if binding context is available.
79
- */
80
- isTableLoaded(element) {
81
- const aggregationName = 'items';
82
- if (this.isAbsoluteAggregationBinding(element, aggregationName)) {
83
- const bindingInfo = element.getBindingInfo(aggregationName);
84
- // check to be default model binding otherwise return undefined
85
- if (typeof bindingInfo.model === 'string' && bindingInfo.model !== '') {
86
- return false;
87
- }
88
- return bindingInfo.path !== undefined;
89
- } else {
90
- // here we explicitly request the default models binding context
91
- const bindingContext = element.getBindingContext();
92
- return !!bindingContext;
93
- }
94
- }
95
- }
96
- var __exports = {
97
- __esModule: true
98
- };
99
- __exports.CHANGE_TABLE_COLUMNS = CHANGE_TABLE_COLUMNS;
100
- __exports.ChangeTableColumnsQuickAction = ChangeTableColumnsQuickAction;
101
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["../../../utils/core", "../table-quick-action-base", "../dialog-enablement-validator"], function (_____utils_core, ___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 TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
9
+ const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
10
+ const CHANGE_TABLE_COLUMNS = 'change-table-columns';
11
+ const SMART_TABLE_TYPE = 'sap.ui.comp.smarttable.SmartTable';
12
+ const M_TABLE_TYPE = 'sap.m.Table';
13
+ // maintain order if action id
14
+ const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, 'sap.ui.table.TreeTable', 'sap.ui.table.Table'];
15
+ class ChangeTableColumnsQuickAction extends TableQuickActionDefinitionBase {
16
+ constructor(context) {
17
+ super(CHANGE_TABLE_COLUMNS, CONTROL_TYPES, 'V2_QUICK_ACTION_CHANGE_TABLE_COLUMNS', context, {
18
+ includeServiceAction: true
19
+ }, [DIALOG_ENABLEMENT_VALIDATOR]);
20
+ }
21
+ async execute(path) {
22
+ const {
23
+ table,
24
+ iconTabBarFilterKey,
25
+ changeColumnActionId,
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
+ if (changeColumnActionId) {
48
+ const executeAction = async () => await this.context.actionService.execute(table.getId(), changeColumnActionId);
49
+ if (isA(SMART_TABLE_TYPE, table)) {
50
+ await executeAction();
51
+ } else if (isA(M_TABLE_TYPE, table)) {
52
+ // if table is busy, i.e. lazy loading, then we subscribe to 'updateFinished' event and call action service when loading is done
53
+ // to avoid reopening the dialog after close
54
+ if (this.isTableLoaded(table)) {
55
+ await executeAction();
56
+ } else {
57
+ table.attachEventOnce('updateFinished', executeAction, this);
58
+ }
59
+ }
60
+ }
61
+ return [];
62
+ }
63
+ isAbsoluteAggregationBinding(element, aggregationName) {
64
+ const mBindingInfo = element.getBindingInfo(aggregationName);
65
+ const path = mBindingInfo?.path;
66
+ if (!path) {
67
+ return false;
68
+ }
69
+ return path.indexOf('/') === 0;
70
+ }
71
+
72
+ /**
73
+ * Checks if table is loaded and has binding context available.
74
+ * This is needed to properly render change columns dialog.
75
+ * Based on {@link https://github.com/SAP/openui5/blob/rel-1.127/src/sap.ui.fl/src/sap/ui/fl/write/_internal/delegates/ODataV2ReadDelegate.js#L269-L271| ODataV2ReadDelegate.getPropertyInfo}.
76
+ *
77
+ * @param element - Table control.
78
+ * @returns True if binding context is available.
79
+ */
80
+ isTableLoaded(element) {
81
+ const aggregationName = 'items';
82
+ if (this.isAbsoluteAggregationBinding(element, aggregationName)) {
83
+ const bindingInfo = element.getBindingInfo(aggregationName);
84
+ // check to be default model binding otherwise return undefined
85
+ if (typeof bindingInfo.model === 'string' && bindingInfo.model !== '') {
86
+ return false;
87
+ }
88
+ return bindingInfo.path !== undefined;
89
+ } else {
90
+ // here we explicitly request the default models binding context
91
+ const bindingContext = element.getBindingContext();
92
+ return !!bindingContext;
93
+ }
94
+ }
95
+ }
96
+ var __exports = {
97
+ __esModule: true
98
+ };
99
+ __exports.CHANGE_TABLE_COLUMNS = CHANGE_TABLE_COLUMNS;
100
+ __exports.ChangeTableColumnsQuickAction = ChangeTableColumnsQuickAction;
101
+ return __exports;
102
102
  });
103
103
  //# sourceMappingURL=change-table-columns.js.map
@@ -1,72 +1,72 @@
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;
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;
71
71
  });
72
72
  //# sourceMappingURL=create-table-action.js.map
@@ -1,98 +1,98 @@
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;
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;
97
97
  });
98
98
  //# sourceMappingURL=create-table-custom-column.js.map