@sap-ux/preview-middleware 0.19.28 → 0.19.30

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 (97) 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/adp/utils.ts +2 -2
  60. package/dist/client/cpe/additional-change-info/add-xml-additional-info.js +77 -0
  61. package/dist/client/cpe/additional-change-info/add-xml-additional-info.ts +84 -0
  62. package/dist/client/cpe/changes/index.js +10 -10
  63. package/dist/client/cpe/changes/service.js +5 -2
  64. package/dist/client/cpe/changes/service.ts +2 -0
  65. package/dist/client/cpe/changes/validator.js +39 -39
  66. package/dist/client/cpe/connector-service.js +2 -1
  67. package/dist/client/cpe/connector-service.ts +8 -4
  68. package/dist/client/cpe/documentation.js +164 -164
  69. package/dist/client/cpe/feature-service.js +36 -36
  70. package/dist/client/cpe/logger.js +30 -30
  71. package/dist/client/cpe/outline/editable.js +37 -37
  72. package/dist/client/cpe/outline/nodes.js +203 -203
  73. package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
  74. package/dist/client/cpe/quick-actions/registry.js +143 -143
  75. package/dist/client/cpe/quick-actions/utils.js +92 -92
  76. package/dist/client/cpe/types.js +4 -4
  77. package/dist/client/cpe/ui5-utils.js +33 -33
  78. package/dist/client/cpe/utils.js +111 -111
  79. package/dist/client/flp/WorkspaceConnector.js +92 -86
  80. package/dist/client/flp/WorkspaceConnector.ts +10 -2
  81. package/dist/client/flp/common.js +28 -28
  82. package/dist/client/flp/enableFakeConnector.js +89 -83
  83. package/dist/client/flp/enableFakeConnector.ts +11 -2
  84. package/dist/client/flp/homepage/Component.js +14 -14
  85. package/dist/client/flp/initCdm.js +117 -117
  86. package/dist/client/flp/initConnectors.js +28 -28
  87. package/dist/client/flp/initRta.js +178 -178
  88. package/dist/client/i18n.js +56 -56
  89. package/dist/client/utils/additional-change-info.js +43 -0
  90. package/dist/client/utils/additional-change-info.ts +42 -0
  91. package/dist/client/utils/application.js +32 -32
  92. package/dist/client/utils/core.js +84 -84
  93. package/dist/client/utils/error.js +19 -19
  94. package/dist/client/utils/fe-v2.js +56 -56
  95. package/dist/client/utils/fe-v4.js +140 -140
  96. package/dist/client/utils/version.js +104 -104
  97. package/package.json +3 -3
@@ -1,83 +1,83 @@
1
- "use strict";
2
-
3
- sap.ui.define(["../../../utils/fe-v2", "../add-new-subpage-quick-action-base", "../../../utils/core", "./utils"], function (_____utils_fe_v2, ___add_new_subpage_quick_action_base, _____utils_core, ___utils) {
4
- "use strict";
5
-
6
- const getV2ApplicationPages = _____utils_fe_v2["getV2ApplicationPages"];
7
- const AddNewSubpageBase = ___add_new_subpage_quick_action_base["AddNewSubpageBase"];
8
- const isA = _____utils_core["isA"];
9
- const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
10
- const getV2AppComponent = ___utils["getV2AppComponent"];
11
- const OBJECT_PAGE_COMPONENT_NAME_V2 = 'sap.suite.ui.generic.template.ObjectPage';
12
-
13
- /**
14
- * Quick Action for adding a custom page action.
15
- */
16
- class AddNewSubpage extends AddNewSubpageBase {
17
- get currentPageDescriptor() {
18
- if (!this.entitySet) {
19
- throw new Error('entitySet is not defined');
20
- }
21
- if (!this.pageType) {
22
- throw new Error('pageType is not defined');
23
- }
24
- if (!this.appComponent) {
25
- throw new Error('appComponent is not defined');
26
- }
27
- return {
28
- appType: 'fe-v2',
29
- appComponent: this.appComponent,
30
- entitySet: this.entitySet,
31
- pageType: this.pageType
32
- };
33
- }
34
- getApplicationPages() {
35
- return getV2ApplicationPages(this.context.manifest);
36
- }
37
- isPageExists(targetEntitySet) {
38
- return this.existingPages.some(page => page.entitySet === targetEntitySet);
39
- }
40
- isCurrentObjectPage() {
41
- return this.pageType === OBJECT_PAGE_COMPONENT_NAME_V2;
42
- }
43
- getODataMetaModel() {
44
- return this.context.rta.getRootControlInstance().getModel()?.getMetaModel();
45
- }
46
- getEntitySetNameFromPageComponent(component) {
47
- if (!isA('sap.suite.ui.generic.template.lib.TemplateComponent', component)) {
48
- throw new Error('Unexpected type of page owner component');
49
- }
50
- return Promise.resolve(component.getEntitySet());
51
- }
52
- async prepareNavigationData(metaModel) {
53
- const entitySet = metaModel.getODataEntitySet(this.entitySet);
54
- const entityType = metaModel.getODataEntityType(entitySet.entityType);
55
- for (const navProp of entityType?.navigationProperty ?? []) {
56
- const associationEnd = metaModel.getODataAssociationEnd(entityType, navProp.name);
57
- if (associationEnd?.multiplicity !== '*') {
58
- continue;
59
- }
60
- const entityContainer = metaModel.getODataEntityContainer();
61
- if (!entityContainer?.entitySet?.length) {
62
- continue;
63
- }
64
- const targetEntitySet = entityContainer.entitySet.find(item => item.entityType === associationEnd.type);
65
- await this.addNavigationOptionIfAvailable(metaModel, targetEntitySet?.name, navProp.name);
66
- }
67
- return Promise.resolve();
68
- }
69
- async initialize() {
70
- if (!(await areManifestChangesSupported(this.context.manifest))) {
71
- return Promise.resolve();
72
- }
73
- this.appComponent = getV2AppComponent(this.context.view);
74
- return super.initialize();
75
- }
76
- }
77
- var __exports = {
78
- __esModule: true
79
- };
80
- __exports.AddNewSubpage = AddNewSubpage;
81
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["../../../utils/fe-v2", "../add-new-subpage-quick-action-base", "../../../utils/core", "./utils"], function (_____utils_fe_v2, ___add_new_subpage_quick_action_base, _____utils_core, ___utils) {
4
+ "use strict";
5
+
6
+ const getV2ApplicationPages = _____utils_fe_v2["getV2ApplicationPages"];
7
+ const AddNewSubpageBase = ___add_new_subpage_quick_action_base["AddNewSubpageBase"];
8
+ const isA = _____utils_core["isA"];
9
+ const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
10
+ const getV2AppComponent = ___utils["getV2AppComponent"];
11
+ const OBJECT_PAGE_COMPONENT_NAME_V2 = 'sap.suite.ui.generic.template.ObjectPage';
12
+
13
+ /**
14
+ * Quick Action for adding a custom page action.
15
+ */
16
+ class AddNewSubpage extends AddNewSubpageBase {
17
+ get currentPageDescriptor() {
18
+ if (!this.entitySet) {
19
+ throw new Error('entitySet is not defined');
20
+ }
21
+ if (!this.pageType) {
22
+ throw new Error('pageType is not defined');
23
+ }
24
+ if (!this.appComponent) {
25
+ throw new Error('appComponent is not defined');
26
+ }
27
+ return {
28
+ appType: 'fe-v2',
29
+ appComponent: this.appComponent,
30
+ entitySet: this.entitySet,
31
+ pageType: this.pageType
32
+ };
33
+ }
34
+ getApplicationPages() {
35
+ return getV2ApplicationPages(this.context.manifest);
36
+ }
37
+ isPageExists(targetEntitySet) {
38
+ return this.existingPages.some(page => page.entitySet === targetEntitySet);
39
+ }
40
+ isCurrentObjectPage() {
41
+ return this.pageType === OBJECT_PAGE_COMPONENT_NAME_V2;
42
+ }
43
+ getODataMetaModel() {
44
+ return this.context.rta.getRootControlInstance().getModel()?.getMetaModel();
45
+ }
46
+ getEntitySetNameFromPageComponent(component) {
47
+ if (!isA('sap.suite.ui.generic.template.lib.TemplateComponent', component)) {
48
+ throw new Error('Unexpected type of page owner component');
49
+ }
50
+ return Promise.resolve(component.getEntitySet());
51
+ }
52
+ async prepareNavigationData(metaModel) {
53
+ const entitySet = metaModel.getODataEntitySet(this.entitySet);
54
+ const entityType = metaModel.getODataEntityType(entitySet.entityType);
55
+ for (const navProp of entityType?.navigationProperty ?? []) {
56
+ const associationEnd = metaModel.getODataAssociationEnd(entityType, navProp.name);
57
+ if (associationEnd?.multiplicity !== '*') {
58
+ continue;
59
+ }
60
+ const entityContainer = metaModel.getODataEntityContainer();
61
+ if (!entityContainer?.entitySet?.length) {
62
+ continue;
63
+ }
64
+ const targetEntitySet = entityContainer.entitySet.find(item => item.entityType === associationEnd.type);
65
+ await this.addNavigationOptionIfAvailable(metaModel, targetEntitySet?.name, navProp.name);
66
+ }
67
+ return Promise.resolve();
68
+ }
69
+ async initialize() {
70
+ if (!(await areManifestChangesSupported(this.context.manifest))) {
71
+ return Promise.resolve();
72
+ }
73
+ this.appComponent = getV2AppComponent(this.context.view);
74
+ return super.initialize();
75
+ }
76
+ }
77
+ var __exports = {
78
+ __esModule: true
79
+ };
80
+ __exports.AddNewSubpage = AddNewSubpage;
81
+ return __exports;
82
82
  });
83
83
  //# sourceMappingURL=add-new-subpage.js.map
@@ -1,69 +1,69 @@
1
- "use strict";
2
-
3
- sap.ui.define(["../../../utils/core", "../table-quick-action-base", "../control-types", "../dialog-enablement-validator"], function (_____utils_core, ___table_quick_action_base, ___control_types, ___dialog_enablement_validator) {
4
- "use strict";
5
-
6
- const getControlById = _____utils_core["getControlById"];
7
- const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
8
- const SMART_TABLE_TYPE = ___control_types["SMART_TABLE_TYPE"];
9
- const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
10
- const CHANGE_TABLE_ACTIONS = 'change-table-actions';
11
- const CONTROL_TYPES = [SMART_TABLE_TYPE];
12
- class ChangeTableActionsQuickAction extends TableQuickActionDefinitionBase {
13
- constructor(context) {
14
- super(CHANGE_TABLE_ACTIONS, CONTROL_TYPES, 'V2_QUICK_ACTION_CHANGE_TABLE_ACTIONS', context, {
15
- includeServiceAction: true
16
- }, [DIALOG_ENABLEMENT_VALIDATOR]);
17
- }
18
- async initialize() {
19
- const processChild = (child, mapKey) => {
20
- const tableAction = this.tableMap[mapKey]?.changeToolbarContentAction;
21
- child.enabled = !!tableAction?.enabled;
22
- child.tooltip = child.enabled ? undefined : this.context.resourceBundle.getText('TABLE_HEADER_TOOLBAR_NOT_CHANGEABLE');
23
- child.children.forEach((nestedChild, idx) => processChild(nestedChild, `${mapKey}/${idx}`));
24
- };
25
- await super.initialize();
26
-
27
- // disable nested actions based on conditions
28
- this.children.forEach((nestedChild, idx) => processChild(nestedChild, `${idx}`));
29
- }
30
- async execute(path) {
31
- const {
32
- table,
33
- iconTabBarFilterKey,
34
- changeToolbarContentAction,
35
- sectionInfo
36
- } = this.tableMap[path];
37
- if (!table) {
38
- return [];
39
- }
40
- if (sectionInfo) {
41
- const {
42
- layout,
43
- section,
44
- subSection
45
- } = sectionInfo;
46
- layout?.setSelectedSection(section);
47
- section.setSelectedSubSection(subSection);
48
- this.selectOverlay(table);
49
- } else {
50
- getControlById(table.getId())?.getDomRef()?.scrollIntoView();
51
- this.selectOverlay(table);
52
- }
53
- if (this.iconTabBar && iconTabBarFilterKey) {
54
- this.iconTabBar.setSelectedKey(iconTabBarFilterKey);
55
- }
56
- if (changeToolbarContentAction) {
57
- await this.context.actionService.execute(table.getId(), changeToolbarContentAction.id);
58
- }
59
- return [];
60
- }
61
- }
62
- var __exports = {
63
- __esModule: true
64
- };
65
- __exports.CHANGE_TABLE_ACTIONS = CHANGE_TABLE_ACTIONS;
66
- __exports.ChangeTableActionsQuickAction = ChangeTableActionsQuickAction;
67
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["../../../utils/core", "../table-quick-action-base", "../control-types", "../dialog-enablement-validator"], function (_____utils_core, ___table_quick_action_base, ___control_types, ___dialog_enablement_validator) {
4
+ "use strict";
5
+
6
+ const getControlById = _____utils_core["getControlById"];
7
+ const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
8
+ const SMART_TABLE_TYPE = ___control_types["SMART_TABLE_TYPE"];
9
+ const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
10
+ const CHANGE_TABLE_ACTIONS = 'change-table-actions';
11
+ const CONTROL_TYPES = [SMART_TABLE_TYPE];
12
+ class ChangeTableActionsQuickAction extends TableQuickActionDefinitionBase {
13
+ constructor(context) {
14
+ super(CHANGE_TABLE_ACTIONS, CONTROL_TYPES, 'V2_QUICK_ACTION_CHANGE_TABLE_ACTIONS', context, {
15
+ includeServiceAction: true
16
+ }, [DIALOG_ENABLEMENT_VALIDATOR]);
17
+ }
18
+ async initialize() {
19
+ const processChild = (child, mapKey) => {
20
+ const tableAction = this.tableMap[mapKey]?.changeToolbarContentAction;
21
+ child.enabled = !!tableAction?.enabled;
22
+ child.tooltip = child.enabled ? undefined : this.context.resourceBundle.getText('TABLE_HEADER_TOOLBAR_NOT_CHANGEABLE');
23
+ child.children.forEach((nestedChild, idx) => processChild(nestedChild, `${mapKey}/${idx}`));
24
+ };
25
+ await super.initialize();
26
+
27
+ // disable nested actions based on conditions
28
+ this.children.forEach((nestedChild, idx) => processChild(nestedChild, `${idx}`));
29
+ }
30
+ async execute(path) {
31
+ const {
32
+ table,
33
+ iconTabBarFilterKey,
34
+ changeToolbarContentAction,
35
+ sectionInfo
36
+ } = this.tableMap[path];
37
+ if (!table) {
38
+ return [];
39
+ }
40
+ if (sectionInfo) {
41
+ const {
42
+ layout,
43
+ section,
44
+ subSection
45
+ } = sectionInfo;
46
+ layout?.setSelectedSection(section);
47
+ section.setSelectedSubSection(subSection);
48
+ this.selectOverlay(table);
49
+ } else {
50
+ getControlById(table.getId())?.getDomRef()?.scrollIntoView();
51
+ this.selectOverlay(table);
52
+ }
53
+ if (this.iconTabBar && iconTabBarFilterKey) {
54
+ this.iconTabBar.setSelectedKey(iconTabBarFilterKey);
55
+ }
56
+ if (changeToolbarContentAction) {
57
+ await this.context.actionService.execute(table.getId(), changeToolbarContentAction.id);
58
+ }
59
+ return [];
60
+ }
61
+ }
62
+ var __exports = {
63
+ __esModule: true
64
+ };
65
+ __exports.CHANGE_TABLE_ACTIONS = CHANGE_TABLE_ACTIONS;
66
+ __exports.ChangeTableActionsQuickAction = ChangeTableActionsQuickAction;
67
+ return __exports;
68
68
  });
69
69
  //# sourceMappingURL=change-table-actions.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