@sap-ux/preview-middleware 0.16.155 → 0.16.157

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/dist/client/adp/api-handler.js +142 -142
  2. package/dist/client/adp/command-executor.js +75 -75
  3. package/dist/client/adp/control-utils.js +44 -44
  4. package/dist/client/adp/controllers/AddFragment.controller.js +5 -6
  5. package/dist/client/adp/controllers/AddFragment.controller.ts +1 -2
  6. package/dist/client/adp/controllers/AddTableColumnFragments.controller.js +0 -1
  7. package/dist/client/adp/controllers/AddTableColumnFragments.controller.ts +0 -1
  8. package/dist/client/adp/controllers/BaseDialog.controller.js +187 -187
  9. package/dist/client/adp/controllers/BaseDialog.controller.ts +0 -4
  10. package/dist/client/adp/controllers/ControllerExtension.controller.js +213 -213
  11. package/dist/client/adp/controllers/ExtensionPoint.controller.js +138 -138
  12. package/dist/client/adp/dialog-factory.js +115 -0
  13. package/dist/client/adp/dialog-factory.ts +134 -0
  14. package/dist/client/adp/extension-point.js +6 -6
  15. package/dist/client/adp/extension-point.ts +2 -2
  16. package/dist/client/adp/init-dialogs.js +100 -157
  17. package/dist/client/adp/init-dialogs.ts +5 -77
  18. package/dist/client/adp/quick-actions/common/add-controller-to-page.js +55 -54
  19. package/dist/client/adp/quick-actions/common/add-controller-to-page.ts +5 -3
  20. package/dist/client/adp/quick-actions/common/create-page-action.js +50 -49
  21. package/dist/client/adp/quick-actions/common/create-page-action.ts +7 -4
  22. package/dist/client/adp/quick-actions/common/op-add-custom-section.js +36 -35
  23. package/dist/client/adp/quick-actions/common/op-add-custom-section.ts +6 -3
  24. package/dist/client/adp/quick-actions/common/op-add-header-field.js +48 -47
  25. package/dist/client/adp/quick-actions/common/op-add-header-field.ts +7 -4
  26. package/dist/client/adp/quick-actions/common/utils.js +20 -0
  27. package/dist/client/adp/quick-actions/common/utils.ts +7 -0
  28. package/dist/client/adp/quick-actions/control-types.js +23 -0
  29. package/dist/client/adp/quick-actions/control-types.ts +6 -0
  30. package/dist/client/adp/quick-actions/dialog-enablement-validator.js +26 -0
  31. package/dist/client/adp/quick-actions/dialog-enablement-validator.ts +18 -0
  32. package/dist/client/adp/quick-actions/enablement-validator.js +6 -0
  33. package/dist/client/adp/quick-actions/enablement-validator.ts +18 -0
  34. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +101 -100
  35. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.ts +11 -3
  36. package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +70 -69
  37. package/dist/client/adp/quick-actions/fe-v2/create-table-action.ts +6 -3
  38. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +96 -95
  39. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.ts +27 -21
  40. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +60 -56
  41. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.ts +8 -3
  42. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +77 -67
  43. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.ts +37 -16
  44. package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +57 -57
  45. package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +95 -0
  46. package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.ts +99 -0
  47. package/dist/client/adp/quick-actions/fe-v2/registry.js +72 -71
  48. package/dist/client/adp/quick-actions/fe-v2/registry.ts +3 -1
  49. package/dist/client/adp/quick-actions/fe-v2/utils.js +95 -86
  50. package/dist/client/adp/quick-actions/fe-v2/utils.ts +14 -4
  51. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +49 -47
  52. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.ts +5 -1
  53. package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +47 -45
  54. package/dist/client/adp/quick-actions/fe-v4/create-table-action.ts +17 -7
  55. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +46 -45
  56. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.ts +11 -12
  57. package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +55 -55
  58. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +82 -82
  59. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.ts +4 -4
  60. package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +52 -52
  61. package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +91 -0
  62. package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.ts +85 -0
  63. package/dist/client/adp/quick-actions/fe-v4/registry.js +56 -55
  64. package/dist/client/adp/quick-actions/fe-v4/registry.ts +3 -1
  65. package/dist/client/adp/quick-actions/fe-v4/table-quick-action-base.js +11 -17
  66. package/dist/client/adp/quick-actions/fe-v4/table-quick-action-base.ts +17 -18
  67. package/dist/client/adp/quick-actions/fe-v4/utils.js +47 -47
  68. package/dist/client/adp/quick-actions/load.js +44 -44
  69. package/dist/client/adp/quick-actions/quick-action-base.js +55 -0
  70. package/dist/client/adp/quick-actions/quick-action-base.ts +55 -0
  71. package/dist/client/adp/quick-actions/simple-quick-action-base.js +8 -13
  72. package/dist/client/adp/quick-actions/simple-quick-action-base.ts +10 -18
  73. package/dist/client/adp/quick-actions/table-quick-action-base.js +24 -29
  74. package/dist/client/adp/quick-actions/table-quick-action-base.ts +39 -28
  75. package/dist/client/adp/utils.js +160 -160
  76. package/dist/client/cpe/changes/index.js +10 -10
  77. package/dist/client/cpe/changes/service.js +30 -0
  78. package/dist/client/cpe/changes/service.ts +46 -0
  79. package/dist/client/cpe/changes/validator.js +34 -34
  80. package/dist/client/cpe/documentation.js +164 -164
  81. package/dist/client/cpe/feature-service.js +36 -36
  82. package/dist/client/cpe/logger.js +30 -30
  83. package/dist/client/cpe/outline/editable.js +37 -37
  84. package/dist/client/cpe/outline/nodes.js +217 -217
  85. package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
  86. package/dist/client/cpe/quick-actions/quick-action-definition.ts +5 -1
  87. package/dist/client/cpe/quick-actions/quick-action-service.js +10 -4
  88. package/dist/client/cpe/quick-actions/quick-action-service.ts +9 -3
  89. package/dist/client/cpe/quick-actions/registry.js +143 -143
  90. package/dist/client/cpe/quick-actions/utils.js +92 -92
  91. package/dist/client/cpe/types.js +4 -4
  92. package/dist/client/cpe/ui5-utils.js +33 -33
  93. package/dist/client/cpe/utils.js +138 -138
  94. package/dist/client/flp/WorkspaceConnector.js +86 -86
  95. package/dist/client/flp/common.js +28 -28
  96. package/dist/client/flp/enableFakeConnector.js +83 -83
  97. package/dist/client/flp/initConnectors.js +30 -30
  98. package/dist/client/flp/initRta.js +178 -178
  99. package/dist/client/i18n.js +56 -56
  100. package/dist/client/messagebundle.properties +5 -3
  101. package/dist/client/utils/application.js +32 -32
  102. package/dist/client/utils/core.js +68 -68
  103. package/dist/client/utils/error.js +19 -19
  104. package/dist/client/utils/fe-v4.js +118 -114
  105. package/dist/client/utils/fe-v4.ts +19 -11
  106. package/dist/client/utils/version.js +102 -102
  107. package/package.json +4 -4
@@ -1,58 +1,58 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/base/i18n/ResourceBundle", "sap/ui/model/resource/ResourceModel"], function (ResourceBundle, ResourceModel) {
4
- "use strict";
5
-
6
- const BUNDLE_CACHE = {};
7
- const MODEL_CACHE = {};
8
- async function getResourceBundle(key) {
9
- const cachedBundle = BUNDLE_CACHE[key];
10
- if (cachedBundle) {
11
- return cachedBundle;
12
- }
13
- const bundle = await ResourceBundle.create({
14
- bundleUrl: '/preview/client/messagebundle.properties',
15
- url: '/preview/client/messagebundle.properties',
16
- supportedLocales: [''],
17
- locale: '',
18
- async: true
19
- });
20
- BUNDLE_CACHE[key] = bundle;
21
- return bundle;
22
- }
23
- async function getResourceModel() {
24
- let key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'open.ux.preview.client';
25
- const cachedModel = MODEL_CACHE[key];
26
- if (cachedModel) {
27
- return cachedModel;
28
- }
29
- const bundle = await getResourceBundle(key);
30
- const model = new ResourceModel({
31
- bundle
32
- });
33
- MODEL_CACHE[key] = model;
34
- return model;
35
- }
36
- class TextBundle {
37
- constructor(bundle) {
38
- this.bundle = bundle;
39
- }
40
- getText(key, args) {
41
- return this.bundle.getText(key, args) ?? key;
42
- }
43
- }
44
- async function getTextBundle() {
45
- let key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'open.ux.preview.client';
46
- const bundle = await getResourceBundle(key);
47
- return new TextBundle(bundle);
48
- }
49
- var __exports = {
50
- __esModule: true
51
- };
52
- __exports.getResourceBundle = getResourceBundle;
53
- __exports.getResourceModel = getResourceModel;
54
- __exports.TextBundle = TextBundle;
55
- __exports.getTextBundle = getTextBundle;
56
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/base/i18n/ResourceBundle", "sap/ui/model/resource/ResourceModel"], function (ResourceBundle, ResourceModel) {
4
+ "use strict";
5
+
6
+ const BUNDLE_CACHE = {};
7
+ const MODEL_CACHE = {};
8
+ async function getResourceBundle(key) {
9
+ const cachedBundle = BUNDLE_CACHE[key];
10
+ if (cachedBundle) {
11
+ return cachedBundle;
12
+ }
13
+ const bundle = await ResourceBundle.create({
14
+ bundleUrl: '/preview/client/messagebundle.properties',
15
+ url: '/preview/client/messagebundle.properties',
16
+ supportedLocales: [''],
17
+ locale: '',
18
+ async: true
19
+ });
20
+ BUNDLE_CACHE[key] = bundle;
21
+ return bundle;
22
+ }
23
+ async function getResourceModel() {
24
+ let key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'open.ux.preview.client';
25
+ const cachedModel = MODEL_CACHE[key];
26
+ if (cachedModel) {
27
+ return cachedModel;
28
+ }
29
+ const bundle = await getResourceBundle(key);
30
+ const model = new ResourceModel({
31
+ bundle
32
+ });
33
+ MODEL_CACHE[key] = model;
34
+ return model;
35
+ }
36
+ class TextBundle {
37
+ constructor(bundle) {
38
+ this.bundle = bundle;
39
+ }
40
+ getText(key, args) {
41
+ return this.bundle.getText(key, args) ?? key;
42
+ }
43
+ }
44
+ async function getTextBundle() {
45
+ let key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'open.ux.preview.client';
46
+ const bundle = await getResourceBundle(key);
47
+ return new TextBundle(bundle);
48
+ }
49
+ var __exports = {
50
+ __esModule: true
51
+ };
52
+ __exports.getResourceBundle = getResourceBundle;
53
+ __exports.getResourceModel = getResourceModel;
54
+ __exports.TextBundle = TextBundle;
55
+ __exports.getTextBundle = getTextBundle;
56
+ return __exports;
57
57
  });
58
58
  //# sourceMappingURL=i18n.js.map
@@ -6,9 +6,9 @@ QUICK_ACTION_ADD_CUSTOM_PAGE_ACTION=Add Custom Page Action
6
6
  QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION=Add Custom Table Action
7
7
  QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN=Add Custom Table Column
8
8
  QUICK_ACTION_ENABLE_TABLE_FILTERING=Enable Table Filtering for Page Variants
9
+ QUICK_ACTION_ENABLE_TABLE_EMPTY_ROW_MODE=Enable Empty Row Mode for Tables
9
10
 
10
11
  V2_QUICK_ACTION_CHANGE_TABLE_COLUMNS=Change Table Columns
11
-
12
12
  V2_QUICK_ACTION_LR_ENABLE_CLEAR_FILTER_BAR=Enable "Clear" Button in Filter Bar
13
13
  V2_QUICK_ACTION_LR_DISABLE_CLEAR_FILTER_BAR=Disable "Clear" Button in Filter Bar
14
14
 
@@ -16,7 +16,6 @@ QUICK_ACTION_LR_ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR=Enable Semantic Date Range
16
16
  QUICK_ACTION_LR_DISABLE_SEMANTIC_DATE_RANGE_FILTER_BAR=Disable Semantic Date Range in Filter Bar
17
17
 
18
18
  V4_QUICK_ACTION_CHANGE_TABLE_COLUMNS=Change Table Columns
19
-
20
19
  V4_QUICK_ACTION_LR_ENABLE_CLEAR_FILTER_BAR=Enable "Clear" Button in Filter Bar
21
20
  V4_QUICK_ACTION_LR_DISABLE_CLEAR_FILTER_BAR=Disable "Clear" Button in Filter Bar
22
21
 
@@ -31,7 +30,8 @@ ADP_ADD_FRAGMENT_NOTIFICATION = Note: The "{0}.fragment.xml" fragment will be cr
31
30
  ADP_ADD_FRAGMENT_WITH_TEMPLATE_NOTIFICATION = Note: The "{0}.fragment.xml" fragment will be created once you save the changes.
32
31
  ADP_ADD_TWO_FRAGMENTS_WITH_TEMPLATE_NOTIFICATION = Note: The "{0}.fragment.xml" and "{1}.fragment.xml" fragments will be created once you save the changes.
33
32
  ADP_SYNC_VIEWS_MESSAGE = Synchronous views are detected for this application. Controller extensions are not supported for such views and will be disabled.
34
- ADP_REUSE_COMPONENTS_MESSAGE = Reuse components are detected for some views in this application. Controller extensions and adding fragments are not supported for such views and will be disabled.
33
+ ADP_REUSE_COMPONENTS_MESSAGE = Reuse components are detected for some views in this application. Controller extensions, adding fragments and manifest changes are not supported for such views and will be disabled.
34
+ ADP_QUICK_ACTION_DIALOG_OPEN_MESSAGE = This action is disabled because a dialog is already open
35
35
 
36
36
  CPE_CHANGES_VISIBLE_AFTER_SAVE_AND_RELOAD_MESSAGE = Note: The change will be visible after save and reload.
37
37
 
@@ -41,3 +41,5 @@ HIGHER_LAYER_CHANGES_INFO_MESSAGE=The preview of the project was reloaded due to
41
41
 
42
42
  TABLE_CUSTOM_COLUMN_ACTION_NOT_AVAILABLE=This action has been disabled because the table rows are not available. Please load the table data and try again
43
43
  TABLE_FILTERING_CHANGE_HAS_ALREADY_BEEN_MADE=This option is disabled because table filtering for page variants is already enabled
44
+ EMPTY_ROW_MODE_IS_ALREADY_ENABLED=This option has been disabled because empty row mode is already enabled for this table
45
+ EMPTY_ROW_MODE_IS_NOT_SUPPORTED=This action is disabled because empty row mode is not supported for analytical and tree tables
@@ -1,34 +1,34 @@
1
- "use strict";
2
-
3
- sap.ui.define([], function () {
4
- "use strict";
5
-
6
- /**
7
- * Determines application type based on the manifest.json.
8
- *
9
- * @param manifest - Application Manifest.
10
- * @returns Application type.
11
- */
12
- function getApplicationType(manifest) {
13
- if (manifest['sap.ui.generic.app'] || manifest['sap.ovp']) {
14
- return 'fe-v2';
15
- } else if (manifest['sap.ui5']?.routing?.targets) {
16
- let hasV4pPages = false;
17
- Object.keys(manifest?.['sap.ui5']?.routing?.targets ?? []).forEach(target => {
18
- if (manifest?.['sap.ui5']?.routing?.targets?.[target]?.name?.startsWith('sap.fe.templates.')) {
19
- hasV4pPages = true;
20
- }
21
- });
22
- if (hasV4pPages) {
23
- return 'fe-v4';
24
- }
25
- }
26
- return 'freestyle';
27
- }
28
- var __exports = {
29
- __esModule: true
30
- };
31
- __exports.getApplicationType = getApplicationType;
32
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define([], function () {
4
+ "use strict";
5
+
6
+ /**
7
+ * Determines application type based on the manifest.json.
8
+ *
9
+ * @param manifest - Application Manifest.
10
+ * @returns Application type.
11
+ */
12
+ function getApplicationType(manifest) {
13
+ if (manifest['sap.ui.generic.app'] || manifest['sap.ovp']) {
14
+ return 'fe-v2';
15
+ } else if (manifest['sap.ui5']?.routing?.targets) {
16
+ let hasV4pPages = false;
17
+ Object.keys(manifest?.['sap.ui5']?.routing?.targets ?? []).forEach(target => {
18
+ if (manifest?.['sap.ui5']?.routing?.targets?.[target]?.name?.startsWith('sap.fe.templates.')) {
19
+ hasV4pPages = true;
20
+ }
21
+ });
22
+ if (hasV4pPages) {
23
+ return 'fe-v4';
24
+ }
25
+ }
26
+ return 'freestyle';
27
+ }
28
+ var __exports = {
29
+ __esModule: true
30
+ };
31
+ __exports.getApplicationType = getApplicationType;
32
+ return __exports;
33
33
  });
34
34
  //# sourceMappingURL=application.js.map
@@ -1,70 +1,70 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/ui/core/Component", "sap/ui/core/Element"], function (Component, Element) {
4
- "use strict";
5
-
6
- /**
7
- * Gets Component by id.
8
- *
9
- * @param id - unique identifier for control
10
- * @returns Component | undefined
11
- */
12
- function getComponent(id) {
13
- if (Component?.getComponentById) {
14
- return Component.getComponentById(id);
15
- } else if (Component?.get) {
16
- // Older version must be still supported until maintenance period.
17
- return Component.get(id); // NOSONAR
18
- } else {
19
- // Older version must be still supported until maintenance period.
20
- return sap.ui.getCore().getComponent(id); // NOSONAR
21
- }
22
- }
23
-
24
- /**
25
- * Returns control by its global ID.
26
- *
27
- * @param id Id of the control.
28
- * @returns Control instance if it exists.
29
- */
30
- function getControlById(id) {
31
- if (typeof Element.getElementById === 'function') {
32
- return Element.getElementById(id);
33
- } else {
34
- return sap.ui.getCore().byId(id);
35
- }
36
- }
37
-
38
- /**
39
- * Checks wether this object is an instance of a ManagedObject.
40
- *
41
- * @param element An object.
42
- * @returns True if element is an instance of a ManagedObject.
43
- */
44
- function isManagedObject(element) {
45
- if (typeof element?.isA === 'function') {
46
- return element.isA('sap.ui.base.ManagedObject');
47
- }
48
- return false;
49
- }
50
-
51
- /**
52
- * Checks whether this object is an instance of the named type.
53
- *
54
- * @param type - Type to check for.
55
- * @param element - Object to check
56
- * @returns Whether this object is an instance of the given type.
57
- */
58
- function isA(type, element) {
59
- return !!element?.isA(type);
60
- }
61
- var __exports = {
62
- __esModule: true
63
- };
64
- __exports.getComponent = getComponent;
65
- __exports.getControlById = getControlById;
66
- __exports.isManagedObject = isManagedObject;
67
- __exports.isA = isA;
68
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/core/Component", "sap/ui/core/Element"], function (Component, Element) {
4
+ "use strict";
5
+
6
+ /**
7
+ * Gets Component by id.
8
+ *
9
+ * @param id - unique identifier for control
10
+ * @returns Component | undefined
11
+ */
12
+ function getComponent(id) {
13
+ if (Component?.getComponentById) {
14
+ return Component.getComponentById(id);
15
+ } else if (Component?.get) {
16
+ // Older version must be still supported until maintenance period.
17
+ return Component.get(id); // NOSONAR
18
+ } else {
19
+ // Older version must be still supported until maintenance period.
20
+ return sap.ui.getCore().getComponent(id); // NOSONAR
21
+ }
22
+ }
23
+
24
+ /**
25
+ * Returns control by its global ID.
26
+ *
27
+ * @param id Id of the control.
28
+ * @returns Control instance if it exists.
29
+ */
30
+ function getControlById(id) {
31
+ if (typeof Element.getElementById === 'function') {
32
+ return Element.getElementById(id);
33
+ } else {
34
+ return sap.ui.getCore().byId(id);
35
+ }
36
+ }
37
+
38
+ /**
39
+ * Checks wether this object is an instance of a ManagedObject.
40
+ *
41
+ * @param element An object.
42
+ * @returns True if element is an instance of a ManagedObject.
43
+ */
44
+ function isManagedObject(element) {
45
+ if (typeof element?.isA === 'function') {
46
+ return element.isA('sap.ui.base.ManagedObject');
47
+ }
48
+ return false;
49
+ }
50
+
51
+ /**
52
+ * Checks whether this object is an instance of the named type.
53
+ *
54
+ * @param type - Type to check for.
55
+ * @param element - Object to check
56
+ * @returns Whether this object is an instance of the given type.
57
+ */
58
+ function isA(type, element) {
59
+ return !!element?.isA(type);
60
+ }
61
+ var __exports = {
62
+ __esModule: true
63
+ };
64
+ __exports.getComponent = getComponent;
65
+ __exports.getControlById = getControlById;
66
+ __exports.isManagedObject = isManagedObject;
67
+ __exports.isA = isA;
68
+ return __exports;
69
69
  });
70
70
  //# sourceMappingURL=core.js.map
@@ -1,21 +1,21 @@
1
- "use strict";
2
-
3
- sap.ui.define([], function () {
4
- "use strict";
5
-
6
- /**
7
- * Returns the Error if the error is an instance of `Error` otherwise a new Error instance with string representation of the error.
8
- *
9
- * @param error {unknown} - the error instance
10
- * @returns {Error} the error
11
- */
12
- function getError(error) {
13
- return error instanceof Error ? error : new Error(JSON.stringify(error));
14
- }
15
- var __exports = {
16
- __esModule: true
17
- };
18
- __exports.getError = getError;
19
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define([], function () {
4
+ "use strict";
5
+
6
+ /**
7
+ * Returns the Error if the error is an instance of `Error` otherwise a new Error instance with string representation of the error.
8
+ *
9
+ * @param error {unknown} - the error instance
10
+ * @returns {Error} the error
11
+ */
12
+ function getError(error) {
13
+ return error instanceof Error ? error : new Error(JSON.stringify(error));
14
+ }
15
+ var __exports = {
16
+ __esModule: true
17
+ };
18
+ __exports.getError = getError;
19
+ return __exports;
20
20
  });
21
21
  //# sourceMappingURL=error.js.map
@@ -1,116 +1,120 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/ui/core/Component", "./core", "sap/ui/rta/command/CommandFactory", "../cpe/utils"], function (Component, ___core, CommandFactory, ___cpe_utils) {
4
- "use strict";
5
-
6
- const isA = ___core["isA"];
7
- const getOverlay = ___cpe_utils["getOverlay"];
8
- /**
9
- * Gets app component of a v4 project.
10
- *
11
- * @param control - ManagedObject.
12
- * @returns AppComponent.
13
- */
14
- function getAppComponent(control) {
15
- const ownerComponent = Component.getOwnerComponentFor(control);
16
- if (ownerComponent?.isA('sap.fe.core.TemplateComponent')) {
17
- return ownerComponent.getAppComponent();
18
- }
19
- return undefined;
20
- }
21
-
22
- /**
23
- * Gets reference id of the app.
24
- *
25
- * @param control - ManagedObject.
26
- * @returns string.
27
- */
28
- function getReference(control) {
29
- const manifest = getAppComponent(control)?.getManifest();
30
- return manifest?.['sap.app']?.id ?? '';
31
- }
32
-
33
- /**
34
- * Determines the page type of v4 app.
35
- *
36
- * @param control - ManagedObject.
37
- * @returns 'ObjectPage' | 'ListReport' | undefined.
38
- */
39
- function getV4PageType(control) {
40
- const component = Component.getOwnerComponentFor(control);
41
- if (!component?.isA('sap.fe.core.TemplateComponent')) {
42
- return undefined;
43
- }
44
- const view = component.getRootControl();
45
- const name = view.getViewName();
46
- if (name === 'sap.fe.templates.ObjectPage.ObjectPage') {
47
- return 'ObjectPage';
48
- }
49
- if (name === 'sap.fe.templates.ListReport.ListReport') {
50
- return 'ListReport';
51
- }
52
- return undefined;
53
- }
54
-
55
- /**
56
- * Get the containing page name of a control.
57
- *
58
- * @param control - UI5 control instance.
59
- * @returns Page name to which the control belongs.
60
- */
61
- function getPageName(control) {
62
- const component = Component.getOwnerComponentFor(control);
63
- if (!isA('sap.fe.core.TemplateComponent', component)) {
64
- return undefined;
65
- }
66
- const view = component.getRootControl();
67
- return view.getId().split('::').pop();
68
- }
69
- function getConfigMapControlIdMap(page, propertyPathSegments) {
70
- if (page && !propertyPathSegments.length) {
71
- return page;
72
- }
73
- if (page) {
74
- return `${page}-${propertyPathSegments.join('/')}`;
75
- }
76
- return propertyPathSegments.join('/');
77
- }
78
-
79
- /**
80
- * Get the modified value for a control.
81
- * @param modifiedControl - The modified control.
82
- * @param flexSettings - Flex Settings of the control.
83
- * @param propertyChanges - The change object
84
- *
85
- * @returns A Promise resolving to an array of FlexCommand objects.
86
- */
87
- async function createManifestPropertyChange(modifiedControl, flexSettings, propertyChanges) {
88
- const overlay = getOverlay(modifiedControl);
89
- if (!overlay) {
90
- return undefined;
91
- }
92
- const overlayData = overlay?.getDesignTimeMetadata().getData();
93
- const manifestPropertyPath = overlayData.manifestPropertyPath(modifiedControl);
94
- const [manifestPropertyChange] = overlayData.manifestPropertyChange(propertyChanges, manifestPropertyPath, modifiedControl);
95
- const modifiedValue = {
96
- reference: getReference(modifiedControl),
97
- appComponent: manifestPropertyChange.appComponent,
98
- changeType: manifestPropertyChange.changeSpecificData.appDescriptorChangeType,
99
- parameters: manifestPropertyChange.changeSpecificData.content.parameters,
100
- selector: manifestPropertyChange.selector
101
- };
102
- const command = await CommandFactory.getCommandFor(modifiedControl, 'appDescriptor', modifiedValue, null, flexSettings);
103
- return command;
104
- }
105
- var __exports = {
106
- __esModule: true
107
- };
108
- __exports.getAppComponent = getAppComponent;
109
- __exports.getReference = getReference;
110
- __exports.getV4PageType = getV4PageType;
111
- __exports.getPageName = getPageName;
112
- __exports.getConfigMapControlIdMap = getConfigMapControlIdMap;
113
- __exports.createManifestPropertyChange = createManifestPropertyChange;
114
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/core/Component", "./core", "sap/ui/rta/command/CommandFactory", "../cpe/utils"], function (Component, ___core, CommandFactory, ___cpe_utils) {
4
+ "use strict";
5
+
6
+ const isA = ___core["isA"];
7
+ const getOverlay = ___cpe_utils["getOverlay"];
8
+ /**
9
+ * Gets app component of a v4 project.
10
+ *
11
+ * @param control - ManagedObject.
12
+ * @returns AppComponent.
13
+ */
14
+ function getAppComponent(control) {
15
+ const ownerComponent = Component.getOwnerComponentFor(control);
16
+ if (ownerComponent?.isA('sap.fe.core.TemplateComponent')) {
17
+ return ownerComponent.getAppComponent();
18
+ }
19
+ return undefined;
20
+ }
21
+
22
+ /**
23
+ * Gets reference id of the app.
24
+ *
25
+ * @param control - ManagedObject.
26
+ * @returns string.
27
+ */
28
+ function getReference(control) {
29
+ const manifest = getAppComponent(control)?.getManifest();
30
+ return manifest?.['sap.app']?.id ?? '';
31
+ }
32
+
33
+ /**
34
+ * Determines the page type of v4 app.
35
+ *
36
+ * @param control - ManagedObject.
37
+ * @returns 'ObjectPage' | 'ListReport' | undefined.
38
+ */
39
+ function getV4PageType(control) {
40
+ const component = Component.getOwnerComponentFor(control);
41
+ if (!component?.isA('sap.fe.core.TemplateComponent')) {
42
+ return undefined;
43
+ }
44
+ const view = component.getRootControl();
45
+ const name = view.getViewName();
46
+ if (name === 'sap.fe.templates.ObjectPage.ObjectPage') {
47
+ return 'ObjectPage';
48
+ }
49
+ if (name === 'sap.fe.templates.ListReport.ListReport') {
50
+ return 'ListReport';
51
+ }
52
+ return undefined;
53
+ }
54
+
55
+ /**
56
+ * Get the containing page name of a control.
57
+ *
58
+ * @param control - UI5 control instance.
59
+ * @returns Page name to which the control belongs.
60
+ */
61
+ function getPageName(control) {
62
+ const component = Component.getOwnerComponentFor(control);
63
+ if (!isA('sap.fe.core.TemplateComponent', component)) {
64
+ return undefined;
65
+ }
66
+ const view = component.getRootControl();
67
+ return view.getId().split('::').pop();
68
+ }
69
+ function getConfigMapControlIdMap(page, propertyPathSegments) {
70
+ if (page && !propertyPathSegments.length) {
71
+ return page;
72
+ }
73
+ if (page) {
74
+ return `${page}-${propertyPathSegments.join('/')}`;
75
+ }
76
+ return propertyPathSegments.join('/');
77
+ }
78
+
79
+ /**
80
+ * Get the modified value for a control.
81
+ * @param modifiedControl - The modified control.
82
+ * @param flexSettings - Flex Settings of the control.
83
+ * @param propertyChanges - The change object
84
+ * @param propertyPathExtraSegments - optional path segments which are added to the default modified control manifest path
85
+ *
86
+ * @returns A Promise resolving to an array of FlexCommand objects.
87
+ */
88
+ async function createManifestPropertyChange(modifiedControl, flexSettings, propertyChanges, propertyPathExtraSegments) {
89
+ const overlay = getOverlay(modifiedControl);
90
+ if (!overlay) {
91
+ return undefined;
92
+ }
93
+ const overlayData = overlay?.getDesignTimeMetadata().getData();
94
+ let manifestPropertyPath = overlayData.manifestPropertyPath(modifiedControl);
95
+ if (propertyPathExtraSegments) {
96
+ manifestPropertyPath += '/' + propertyPathExtraSegments.join('/');
97
+ }
98
+ const [manifestPropertyChange] = overlayData.manifestPropertyChange(propertyChanges, manifestPropertyPath, modifiedControl);
99
+ const modifiedValue = {
100
+ reference: getReference(modifiedControl),
101
+ appComponent: manifestPropertyChange.appComponent,
102
+ changeType: manifestPropertyChange.changeSpecificData.appDescriptorChangeType,
103
+ parameters: manifestPropertyChange.changeSpecificData.content.parameters,
104
+ selector: manifestPropertyChange.selector
105
+ };
106
+ const command = await CommandFactory.getCommandFor(modifiedControl, 'appDescriptor', modifiedValue, null, flexSettings);
107
+ return command;
108
+ }
109
+ var __exports = {
110
+ __esModule: true
111
+ };
112
+ __exports.getAppComponent = getAppComponent;
113
+ __exports.getReference = getReference;
114
+ __exports.getV4PageType = getV4PageType;
115
+ __exports.getPageName = getPageName;
116
+ __exports.getConfigMapControlIdMap = getConfigMapControlIdMap;
117
+ __exports.createManifestPropertyChange = createManifestPropertyChange;
118
+ return __exports;
115
119
  });
116
120
  //# sourceMappingURL=fe-v4.js.map