@sap-ux/preview-middleware 0.16.154 → 0.16.155

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 (54) 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/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/init-dialogs.js +157 -157
  8. package/dist/client/adp/quick-actions/common/add-controller-to-page.js +54 -54
  9. package/dist/client/adp/quick-actions/common/create-page-action.js +49 -49
  10. package/dist/client/adp/quick-actions/common/op-add-custom-section.js +35 -35
  11. package/dist/client/adp/quick-actions/common/op-add-header-field.js +47 -47
  12. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +100 -100
  13. package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +69 -69
  14. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +95 -95
  15. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +56 -56
  16. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +67 -67
  17. package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +57 -57
  18. package/dist/client/adp/quick-actions/fe-v2/registry.js +71 -71
  19. package/dist/client/adp/quick-actions/fe-v2/utils.js +86 -86
  20. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +47 -47
  21. package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +45 -45
  22. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +45 -45
  23. package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +55 -55
  24. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +82 -82
  25. package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +52 -52
  26. package/dist/client/adp/quick-actions/fe-v4/registry.js +55 -55
  27. package/dist/client/adp/quick-actions/fe-v4/utils.js +47 -47
  28. package/dist/client/adp/quick-actions/load.js +44 -44
  29. package/dist/client/adp/utils.js +160 -160
  30. package/dist/client/cpe/changes/index.js +10 -10
  31. package/dist/client/cpe/changes/validator.js +34 -34
  32. package/dist/client/cpe/documentation.js +164 -164
  33. package/dist/client/cpe/feature-service.js +36 -36
  34. package/dist/client/cpe/logger.js +30 -30
  35. package/dist/client/cpe/outline/editable.js +37 -37
  36. package/dist/client/cpe/outline/nodes.js +217 -217
  37. package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
  38. package/dist/client/cpe/quick-actions/registry.js +143 -143
  39. package/dist/client/cpe/quick-actions/utils.js +92 -92
  40. package/dist/client/cpe/types.js +4 -4
  41. package/dist/client/cpe/ui5-utils.js +33 -33
  42. package/dist/client/cpe/utils.js +138 -138
  43. package/dist/client/flp/WorkspaceConnector.js +86 -86
  44. package/dist/client/flp/common.js +28 -28
  45. package/dist/client/flp/enableFakeConnector.js +83 -83
  46. package/dist/client/flp/initConnectors.js +30 -30
  47. package/dist/client/flp/initRta.js +178 -178
  48. package/dist/client/i18n.js +56 -56
  49. package/dist/client/utils/application.js +32 -32
  50. package/dist/client/utils/core.js +68 -68
  51. package/dist/client/utils/error.js +19 -19
  52. package/dist/client/utils/fe-v4.js +114 -114
  53. package/dist/client/utils/version.js +102 -102
  54. package/package.json +2 -2
@@ -1,71 +1,71 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../../utils/core", "../../init-dialogs", "../table-quick-action-base"], function (OverlayRegistry, _____utils_core, ____init_dialogs, ___table_quick_action_base) {
4
- "use strict";
5
-
6
- const getControlById = _____utils_core["getControlById"];
7
- const isA = _____utils_core["isA"];
8
- const DialogNames = ____init_dialogs["DialogNames"];
9
- const handler = ____init_dialogs["handler"];
10
- const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
11
- const CREATE_TABLE_ACTION = 'create-table-action';
12
- const SMART_TABLE_TYPE = 'sap.ui.comp.smarttable.SmartTable';
13
- const M_TABLE_TYPE = 'sap.m.Table';
14
- // maintain order if action id
15
-
16
- const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, 'sap.ui.table.TreeTable', 'sap.ui.table.Table'];
17
- class AddTableActionQuickAction extends TableQuickActionDefinitionBase {
18
- constructor(context) {
19
- super(CREATE_TABLE_ACTION, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION', context);
20
- }
21
- async execute(path) {
22
- const {
23
- table,
24
- iconTabBarFilterKey,
25
- sectionInfo
26
- } = this.tableMap[path];
27
- if (!table) {
28
- return [];
29
- }
30
- if (sectionInfo) {
31
- const {
32
- layout,
33
- section,
34
- subSection
35
- } = sectionInfo;
36
- layout?.setSelectedSection(section);
37
- section.setSelectedSubSection(subSection);
38
- this.selectOverlay(table);
39
- } else {
40
- getControlById(table.getId())?.getDomRef()?.scrollIntoView();
41
- this.selectOverlay(table);
42
- }
43
- if (this.iconTabBar && iconTabBarFilterKey) {
44
- this.iconTabBar.setSelectedKey(iconTabBarFilterKey);
45
- }
46
- let headerToolbar;
47
- if (isA(SMART_TABLE_TYPE, table)) {
48
- headerToolbar = table.getAggregation('items')[0].getAggregation('headerToolbar');
49
- } else if (isA(M_TABLE_TYPE, table)) {
50
- headerToolbar = table.getAggregation('headerToolbar');
51
- }
52
-
53
- // open dialogBox to add, and content is selected ByDefault
54
- if (headerToolbar) {
55
- const overlay = OverlayRegistry.getOverlay(headerToolbar) || [];
56
- await handler(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
57
- aggregation: 'content',
58
- title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION'
59
- });
60
- }
61
- return [];
62
- }
63
- }
64
- var __exports = {
65
- __esModule: true
66
- };
67
- __exports.CREATE_TABLE_ACTION = CREATE_TABLE_ACTION;
68
- __exports.AddTableActionQuickAction = AddTableActionQuickAction;
69
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../../utils/core", "../../init-dialogs", "../table-quick-action-base"], function (OverlayRegistry, _____utils_core, ____init_dialogs, ___table_quick_action_base) {
4
+ "use strict";
5
+
6
+ const getControlById = _____utils_core["getControlById"];
7
+ const isA = _____utils_core["isA"];
8
+ const DialogNames = ____init_dialogs["DialogNames"];
9
+ const handler = ____init_dialogs["handler"];
10
+ const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
11
+ const CREATE_TABLE_ACTION = 'create-table-action';
12
+ const SMART_TABLE_TYPE = 'sap.ui.comp.smarttable.SmartTable';
13
+ const M_TABLE_TYPE = 'sap.m.Table';
14
+ // maintain order if action id
15
+
16
+ const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, 'sap.ui.table.TreeTable', 'sap.ui.table.Table'];
17
+ class AddTableActionQuickAction extends TableQuickActionDefinitionBase {
18
+ constructor(context) {
19
+ super(CREATE_TABLE_ACTION, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION', context);
20
+ }
21
+ async execute(path) {
22
+ const {
23
+ table,
24
+ iconTabBarFilterKey,
25
+ sectionInfo
26
+ } = this.tableMap[path];
27
+ if (!table) {
28
+ return [];
29
+ }
30
+ if (sectionInfo) {
31
+ const {
32
+ layout,
33
+ section,
34
+ subSection
35
+ } = sectionInfo;
36
+ layout?.setSelectedSection(section);
37
+ section.setSelectedSubSection(subSection);
38
+ this.selectOverlay(table);
39
+ } else {
40
+ getControlById(table.getId())?.getDomRef()?.scrollIntoView();
41
+ this.selectOverlay(table);
42
+ }
43
+ if (this.iconTabBar && iconTabBarFilterKey) {
44
+ this.iconTabBar.setSelectedKey(iconTabBarFilterKey);
45
+ }
46
+ let headerToolbar;
47
+ if (isA(SMART_TABLE_TYPE, table)) {
48
+ headerToolbar = table.getAggregation('items')[0].getAggregation('headerToolbar');
49
+ } else if (isA(M_TABLE_TYPE, table)) {
50
+ headerToolbar = table.getAggregation('headerToolbar');
51
+ }
52
+
53
+ // open dialogBox to add, and content is selected ByDefault
54
+ if (headerToolbar) {
55
+ const overlay = OverlayRegistry.getOverlay(headerToolbar) || [];
56
+ await handler(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
57
+ aggregation: 'content',
58
+ title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION'
59
+ });
60
+ }
61
+ return [];
62
+ }
63
+ }
64
+ var __exports = {
65
+ __esModule: true
66
+ };
67
+ __exports.CREATE_TABLE_ACTION = CREATE_TABLE_ACTION;
68
+ __exports.AddTableActionQuickAction = AddTableActionQuickAction;
69
+ return __exports;
70
70
  });
71
71
  //# sourceMappingURL=create-table-action.js.map
@@ -1,97 +1,97 @@
1
- "use strict";
2
-
3
- sap.ui.define(["../../../utils/core", "sap/ui/dt/OverlayRegistry", "../../init-dialogs", "../table-quick-action-base", "../../utils", "../../../i18n"], function (_____utils_core, OverlayRegistry, ____init_dialogs, ___table_quick_action_base, ____utils, _____i18n) {
4
- "use strict";
5
-
6
- const getControlById = _____utils_core["getControlById"];
7
- const isA = _____utils_core["isA"];
8
- const DialogNames = ____init_dialogs["DialogNames"];
9
- const handler = ____init_dialogs["handler"];
10
- const ANALYTICAL_TABLE_TYPE = ___table_quick_action_base["ANALYTICAL_TABLE_TYPE"];
11
- const GRID_TABLE_TYPE = ___table_quick_action_base["GRID_TABLE_TYPE"];
12
- const M_TABLE_TYPE = ___table_quick_action_base["M_TABLE_TYPE"];
13
- const SMART_TABLE_TYPE = ___table_quick_action_base["SMART_TABLE_TYPE"];
14
- const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
15
- const TREE_TABLE_TYPE = ___table_quick_action_base["TREE_TABLE_TYPE"];
16
- const notifyUser = ____utils["notifyUser"];
17
- const getTextBundle = _____i18n["getTextBundle"];
18
- const CREATE_TABLE_CUSTOM_COLUMN = 'create-table-custom-column';
19
- const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, TREE_TABLE_TYPE, GRID_TABLE_TYPE];
20
-
21
- /**
22
- * Reusable function which performs some preparation steps before table action execution
23
- *
24
- * @param table - table element
25
- * @param sectionInfo - section data
26
- * @param iconTabBar - icon tab bar element
27
- * @param iconTabBarFilterKey - tab bar key to select a tab
28
- */
29
- function preprocessActionExecution(table, sectionInfo, iconTabBar, iconTabBarFilterKey) {
30
- if (sectionInfo) {
31
- const {
32
- layout,
33
- section,
34
- subSection
35
- } = sectionInfo;
36
- layout?.setSelectedSection(section);
37
- section.setSelectedSubSection(subSection);
38
- } else {
39
- getControlById(table.getId())?.getDomRef()?.scrollIntoView();
40
- }
41
- if (iconTabBar && iconTabBarFilterKey) {
42
- iconTabBar.setSelectedKey(iconTabBarFilterKey);
43
- }
44
- }
45
- class AddTableCustomColumnQuickAction extends TableQuickActionDefinitionBase {
46
- constructor(context) {
47
- super(CREATE_TABLE_CUSTOM_COLUMN, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN', context, {
48
- areTableRowsRequired: true
49
- });
50
- }
51
- async execute(path) {
52
- const {
53
- table,
54
- iconTabBarFilterKey,
55
- sectionInfo
56
- } = this.tableMap[path];
57
- if (!table) {
58
- return [];
59
- }
60
- preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
61
- this.selectOverlay(table);
62
- let tableInternal = table;
63
- if (isA(SMART_TABLE_TYPE, table)) {
64
- const itemsAggregation = table.getAggregation('items');
65
- tableInternal = itemsAggregation.find(item => {
66
- return [M_TABLE_TYPE, TREE_TABLE_TYPE, ANALYTICAL_TABLE_TYPE, GRID_TABLE_TYPE].some(tType => isA(tType, item));
67
- });
68
- if (!tableInternal) {
69
- return [];
70
- }
71
- }
72
- const overlay = OverlayRegistry.getOverlay(tableInternal) || [];
73
- if (!overlay) {
74
- return [];
75
- }
76
- if (isA(M_TABLE_TYPE, tableInternal) && tableInternal.getAggregation('items').length === 0) {
77
- const bundle = await getTextBundle();
78
- notifyUser(bundle.getText('TABLE_ROWS_NEEDED_TO_CREATE_CUSTOM_COLUMN'), 8000);
79
- return [];
80
- }
81
- const dialog = [TREE_TABLE_TYPE, ANALYTICAL_TABLE_TYPE, GRID_TABLE_TYPE].some(type => isA(type, tableInternal)) ? DialogNames.ADD_FRAGMENT : DialogNames.ADD_TABLE_COLUMN_FRAGMENTS;
82
- await handler(overlay, this.context.rta, dialog, undefined, {
83
- aggregation: 'columns',
84
- title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN'
85
- });
86
- return [];
87
- }
88
- }
89
- var __exports = {
90
- __esModule: true
91
- };
92
- __exports.CREATE_TABLE_CUSTOM_COLUMN = CREATE_TABLE_CUSTOM_COLUMN;
93
- __exports.preprocessActionExecution = preprocessActionExecution;
94
- __exports.AddTableCustomColumnQuickAction = AddTableCustomColumnQuickAction;
95
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["../../../utils/core", "sap/ui/dt/OverlayRegistry", "../../init-dialogs", "../table-quick-action-base", "../../utils", "../../../i18n"], function (_____utils_core, OverlayRegistry, ____init_dialogs, ___table_quick_action_base, ____utils, _____i18n) {
4
+ "use strict";
5
+
6
+ const getControlById = _____utils_core["getControlById"];
7
+ const isA = _____utils_core["isA"];
8
+ const DialogNames = ____init_dialogs["DialogNames"];
9
+ const handler = ____init_dialogs["handler"];
10
+ const ANALYTICAL_TABLE_TYPE = ___table_quick_action_base["ANALYTICAL_TABLE_TYPE"];
11
+ const GRID_TABLE_TYPE = ___table_quick_action_base["GRID_TABLE_TYPE"];
12
+ const M_TABLE_TYPE = ___table_quick_action_base["M_TABLE_TYPE"];
13
+ const SMART_TABLE_TYPE = ___table_quick_action_base["SMART_TABLE_TYPE"];
14
+ const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
15
+ const TREE_TABLE_TYPE = ___table_quick_action_base["TREE_TABLE_TYPE"];
16
+ const notifyUser = ____utils["notifyUser"];
17
+ const getTextBundle = _____i18n["getTextBundle"];
18
+ const CREATE_TABLE_CUSTOM_COLUMN = 'create-table-custom-column';
19
+ const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, TREE_TABLE_TYPE, GRID_TABLE_TYPE];
20
+
21
+ /**
22
+ * Reusable function which performs some preparation steps before table action execution
23
+ *
24
+ * @param table - table element
25
+ * @param sectionInfo - section data
26
+ * @param iconTabBar - icon tab bar element
27
+ * @param iconTabBarFilterKey - tab bar key to select a tab
28
+ */
29
+ function preprocessActionExecution(table, sectionInfo, iconTabBar, iconTabBarFilterKey) {
30
+ if (sectionInfo) {
31
+ const {
32
+ layout,
33
+ section,
34
+ subSection
35
+ } = sectionInfo;
36
+ layout?.setSelectedSection(section);
37
+ section.setSelectedSubSection(subSection);
38
+ } else {
39
+ getControlById(table.getId())?.getDomRef()?.scrollIntoView();
40
+ }
41
+ if (iconTabBar && iconTabBarFilterKey) {
42
+ iconTabBar.setSelectedKey(iconTabBarFilterKey);
43
+ }
44
+ }
45
+ class AddTableCustomColumnQuickAction extends TableQuickActionDefinitionBase {
46
+ constructor(context) {
47
+ super(CREATE_TABLE_CUSTOM_COLUMN, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN', context, {
48
+ areTableRowsRequired: true
49
+ });
50
+ }
51
+ async execute(path) {
52
+ const {
53
+ table,
54
+ iconTabBarFilterKey,
55
+ sectionInfo
56
+ } = this.tableMap[path];
57
+ if (!table) {
58
+ return [];
59
+ }
60
+ preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
61
+ this.selectOverlay(table);
62
+ let tableInternal = table;
63
+ if (isA(SMART_TABLE_TYPE, table)) {
64
+ const itemsAggregation = table.getAggregation('items');
65
+ tableInternal = itemsAggregation.find(item => {
66
+ return [M_TABLE_TYPE, TREE_TABLE_TYPE, ANALYTICAL_TABLE_TYPE, GRID_TABLE_TYPE].some(tType => isA(tType, item));
67
+ });
68
+ if (!tableInternal) {
69
+ return [];
70
+ }
71
+ }
72
+ const overlay = OverlayRegistry.getOverlay(tableInternal) || [];
73
+ if (!overlay) {
74
+ return [];
75
+ }
76
+ if (isA(M_TABLE_TYPE, tableInternal) && tableInternal.getAggregation('items').length === 0) {
77
+ const bundle = await getTextBundle();
78
+ notifyUser(bundle.getText('TABLE_ROWS_NEEDED_TO_CREATE_CUSTOM_COLUMN'), 8000);
79
+ return [];
80
+ }
81
+ const dialog = [TREE_TABLE_TYPE, ANALYTICAL_TABLE_TYPE, GRID_TABLE_TYPE].some(type => isA(type, tableInternal)) ? DialogNames.ADD_FRAGMENT : DialogNames.ADD_TABLE_COLUMN_FRAGMENTS;
82
+ await handler(overlay, this.context.rta, dialog, undefined, {
83
+ aggregation: 'columns',
84
+ title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN'
85
+ });
86
+ return [];
87
+ }
88
+ }
89
+ var __exports = {
90
+ __esModule: true
91
+ };
92
+ __exports.CREATE_TABLE_CUSTOM_COLUMN = CREATE_TABLE_CUSTOM_COLUMN;
93
+ __exports.preprocessActionExecution = preprocessActionExecution;
94
+ __exports.AddTableCustomColumnQuickAction = AddTableCustomColumnQuickAction;
95
+ return __exports;
96
96
  });
97
97
  //# sourceMappingURL=create-table-custom-column.js.map
@@ -1,58 +1,58 @@
1
- "use strict";
2
-
3
- sap.ui.define(["../../../cpe/quick-actions/utils", "../../../utils/core", "../simple-quick-action-base", "./utils"], function (_____cpe_quick_actions_utils, _____utils_core, ___simple_quick_action_base, ___utils) {
4
- "use strict";
5
-
6
- const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
7
- const getControlById = _____utils_core["getControlById"];
8
- const isA = _____utils_core["isA"];
9
- const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
10
- const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
11
- const prepareManifestChange = ___utils["prepareManifestChange"];
12
- const ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR = 'enable-semantic-daterange-filterbar';
13
- const CONTROL_TYPE = 'sap.ui.comp.smartfilterbar.SmartFilterBar';
14
- const COMPONENT = 'sap.suite.ui.generic.template.ListReport';
15
- /**
16
- * Quick Action for toggling the visibility of "semantic date range" for filterbar fields.
17
- */
18
- class ToggleSemanticDateRangeFilterBar extends SimpleQuickActionDefinitionBase {
19
- constructor(context) {
20
- super(ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR, [], '', context);
21
- }
22
- forceRefreshAfterExecution = true;
23
- isUseDateRangeTypeEnabled = false;
24
- async initialize() {
25
- const manifestChangesSupported = await areManifestChangesSupported(this.context.manifest);
26
- if (!manifestChangesSupported) {
27
- return;
28
- }
29
- const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
30
- for (const control of controls) {
31
- const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
32
- const modifiedControl = getControlById(control.controlId);
33
- if (isActionApplicable && modifiedControl) {
34
- this.isUseDateRangeTypeEnabled = modifiedControl.getProperty('useDateRangeType');
35
- this.control = modifiedControl;
36
- }
37
- }
38
- }
39
- get textKey() {
40
- return this.isUseDateRangeTypeEnabled ? 'QUICK_ACTION_LR_DISABLE_SEMANTIC_DATE_RANGE_FILTER_BAR' : 'QUICK_ACTION_LR_ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR';
41
- }
42
- async execute() {
43
- const entitySet = isA(CONTROL_TYPE, this.control) ? this.control.getEntitySet() : undefined;
44
- const command = await prepareManifestChange(this.context, 'component/settings/filterSettings/dateSettings', this.control, COMPONENT, entitySet, {
45
- useDateRange: !this.isUseDateRangeTypeEnabled
46
- });
47
- this.isUseDateRangeTypeEnabled = !this.isUseDateRangeTypeEnabled;
48
- return command;
49
- }
50
- }
51
- var __exports = {
52
- __esModule: true
53
- };
54
- __exports.ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR = ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR;
55
- __exports.ToggleSemanticDateRangeFilterBar = ToggleSemanticDateRangeFilterBar;
56
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["../../../cpe/quick-actions/utils", "../../../utils/core", "../simple-quick-action-base", "./utils"], function (_____cpe_quick_actions_utils, _____utils_core, ___simple_quick_action_base, ___utils) {
4
+ "use strict";
5
+
6
+ const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
7
+ const getControlById = _____utils_core["getControlById"];
8
+ const isA = _____utils_core["isA"];
9
+ const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
10
+ const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
11
+ const prepareManifestChange = ___utils["prepareManifestChange"];
12
+ const ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR = 'enable-semantic-daterange-filterbar';
13
+ const CONTROL_TYPE = 'sap.ui.comp.smartfilterbar.SmartFilterBar';
14
+ const COMPONENT = 'sap.suite.ui.generic.template.ListReport';
15
+ /**
16
+ * Quick Action for toggling the visibility of "semantic date range" for filterbar fields.
17
+ */
18
+ class ToggleSemanticDateRangeFilterBar extends SimpleQuickActionDefinitionBase {
19
+ constructor(context) {
20
+ super(ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR, [], '', context);
21
+ }
22
+ forceRefreshAfterExecution = true;
23
+ isUseDateRangeTypeEnabled = false;
24
+ async initialize() {
25
+ const manifestChangesSupported = await areManifestChangesSupported(this.context.manifest);
26
+ if (!manifestChangesSupported) {
27
+ return;
28
+ }
29
+ const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
30
+ for (const control of controls) {
31
+ const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
32
+ const modifiedControl = getControlById(control.controlId);
33
+ if (isActionApplicable && modifiedControl) {
34
+ this.isUseDateRangeTypeEnabled = modifiedControl.getProperty('useDateRangeType');
35
+ this.control = modifiedControl;
36
+ }
37
+ }
38
+ }
39
+ get textKey() {
40
+ return this.isUseDateRangeTypeEnabled ? 'QUICK_ACTION_LR_DISABLE_SEMANTIC_DATE_RANGE_FILTER_BAR' : 'QUICK_ACTION_LR_ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR';
41
+ }
42
+ async execute() {
43
+ const entitySet = isA(CONTROL_TYPE, this.control) ? this.control.getEntitySet() : undefined;
44
+ const command = await prepareManifestChange(this.context, 'component/settings/filterSettings/dateSettings', this.control, COMPONENT, entitySet, {
45
+ useDateRange: !this.isUseDateRangeTypeEnabled
46
+ });
47
+ this.isUseDateRangeTypeEnabled = !this.isUseDateRangeTypeEnabled;
48
+ return command;
49
+ }
50
+ }
51
+ var __exports = {
52
+ __esModule: true
53
+ };
54
+ __exports.ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR = ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR;
55
+ __exports.ToggleSemanticDateRangeFilterBar = ToggleSemanticDateRangeFilterBar;
56
+ return __exports;
57
57
  });
58
58
  //# sourceMappingURL=lr-enable-semantic-date-range-filter-bar.js.map
@@ -1,69 +1,69 @@
1
- "use strict";
2
-
3
- sap.ui.define(["../../../cpe/quick-actions/utils", "../table-quick-action-base", "./utils", "../simple-quick-action-base", "../../../utils/core"], function (_____cpe_quick_actions_utils, ___table_quick_action_base, ___utils, ___simple_quick_action_base, _____utils_core) {
4
- "use strict";
5
-
6
- const getRelevantControlFromActivePage = _____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
7
- const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
8
- const GRID_TABLE_TYPE = ___table_quick_action_base["GRID_TABLE_TYPE"];
9
- const M_TABLE_TYPE = ___table_quick_action_base["M_TABLE_TYPE"];
10
- const SMART_TABLE_TYPE = ___table_quick_action_base["SMART_TABLE_TYPE"];
11
- const TREE_TABLE_TYPE = ___table_quick_action_base["TREE_TABLE_TYPE"];
12
- const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
13
- const prepareManifestChange = ___utils["prepareManifestChange"];
14
- const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
15
- const isA = _____utils_core["isA"];
16
- const COMPONENT = 'sap.suite.ui.generic.template.ListReport';
17
- const ENABLE_TABLE_FILTERING = 'enable-table-filtering';
18
- const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, TREE_TABLE_TYPE, GRID_TABLE_TYPE];
19
-
20
- /**
21
- * Quick Action for enabling table filtering using table personalization settings.
22
- */
23
- class EnableTableFilteringQuickAction extends SimpleQuickActionDefinitionBase {
24
- constructor(context) {
25
- super(ENABLE_TABLE_FILTERING, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLE_FILTERING', context);
26
- }
27
- forceRefreshAfterExecution = true;
28
- lsTableMap = {};
29
- get tooltip() {
30
- return this.isDisabled ? this.context.resourceBundle.getText('TABLE_FILTERING_CHANGE_HAS_ALREADY_BEEN_MADE') : undefined;
31
- }
32
- async initialize() {
33
- const manifestChangesSupported = await areManifestChangesSupported(this.context.manifest);
34
- if (!manifestChangesSupported) {
35
- return;
36
- }
37
- for (const table of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, CONTROL_TYPES)) {
38
- if (table) {
39
- const isFilterEnabled = table.data('p13nDialogSettings').filter.visible;
40
- const isActionApplicable = pageHasControlId(this.context.view, table.getId());
41
- if (isActionApplicable) {
42
- this.isDisabled = isFilterEnabled;
43
- this.control = table;
44
- break;
45
- }
46
- }
47
- }
48
- return Promise.resolve();
49
- }
50
- async execute() {
51
- if (!this.control) {
52
- return [];
53
- }
54
- const entitySet = isA(SMART_TABLE_TYPE, this.control) ? this.control.getEntitySet() : undefined;
55
- const command = await prepareManifestChange(this.context, 'component/settings', this.control, COMPONENT, entitySet, {
56
- enableTableFilterInPageVariant: !this.isDisabled
57
- });
58
- this.isDisabled = !this.isDisabled;
59
- return command;
60
- }
61
- }
62
- var __exports = {
63
- __esModule: true
64
- };
65
- __exports.ENABLE_TABLE_FILTERING = ENABLE_TABLE_FILTERING;
66
- __exports.EnableTableFilteringQuickAction = EnableTableFilteringQuickAction;
67
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["../../../cpe/quick-actions/utils", "../table-quick-action-base", "./utils", "../simple-quick-action-base", "../../../utils/core"], function (_____cpe_quick_actions_utils, ___table_quick_action_base, ___utils, ___simple_quick_action_base, _____utils_core) {
4
+ "use strict";
5
+
6
+ const getRelevantControlFromActivePage = _____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
7
+ const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
8
+ const GRID_TABLE_TYPE = ___table_quick_action_base["GRID_TABLE_TYPE"];
9
+ const M_TABLE_TYPE = ___table_quick_action_base["M_TABLE_TYPE"];
10
+ const SMART_TABLE_TYPE = ___table_quick_action_base["SMART_TABLE_TYPE"];
11
+ const TREE_TABLE_TYPE = ___table_quick_action_base["TREE_TABLE_TYPE"];
12
+ const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
13
+ const prepareManifestChange = ___utils["prepareManifestChange"];
14
+ const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
15
+ const isA = _____utils_core["isA"];
16
+ const COMPONENT = 'sap.suite.ui.generic.template.ListReport';
17
+ const ENABLE_TABLE_FILTERING = 'enable-table-filtering';
18
+ const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, TREE_TABLE_TYPE, GRID_TABLE_TYPE];
19
+
20
+ /**
21
+ * Quick Action for enabling table filtering using table personalization settings.
22
+ */
23
+ class EnableTableFilteringQuickAction extends SimpleQuickActionDefinitionBase {
24
+ constructor(context) {
25
+ super(ENABLE_TABLE_FILTERING, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLE_FILTERING', context);
26
+ }
27
+ forceRefreshAfterExecution = true;
28
+ lsTableMap = {};
29
+ get tooltip() {
30
+ return this.isDisabled ? this.context.resourceBundle.getText('TABLE_FILTERING_CHANGE_HAS_ALREADY_BEEN_MADE') : undefined;
31
+ }
32
+ async initialize() {
33
+ const manifestChangesSupported = await areManifestChangesSupported(this.context.manifest);
34
+ if (!manifestChangesSupported) {
35
+ return;
36
+ }
37
+ for (const table of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, CONTROL_TYPES)) {
38
+ if (table) {
39
+ const isFilterEnabled = table.data('p13nDialogSettings').filter.visible;
40
+ const isActionApplicable = pageHasControlId(this.context.view, table.getId());
41
+ if (isActionApplicable) {
42
+ this.isDisabled = isFilterEnabled;
43
+ this.control = table;
44
+ break;
45
+ }
46
+ }
47
+ }
48
+ return Promise.resolve();
49
+ }
50
+ async execute() {
51
+ if (!this.control) {
52
+ return [];
53
+ }
54
+ const entitySet = isA(SMART_TABLE_TYPE, this.control) ? this.control.getEntitySet() : undefined;
55
+ const command = await prepareManifestChange(this.context, 'component/settings', this.control, COMPONENT, entitySet, {
56
+ enableTableFilterInPageVariant: !this.isDisabled
57
+ });
58
+ this.isDisabled = !this.isDisabled;
59
+ return command;
60
+ }
61
+ }
62
+ var __exports = {
63
+ __esModule: true
64
+ };
65
+ __exports.ENABLE_TABLE_FILTERING = ENABLE_TABLE_FILTERING;
66
+ __exports.EnableTableFilteringQuickAction = EnableTableFilteringQuickAction;
67
+ return __exports;
68
68
  });
69
69
  //# sourceMappingURL=lr-enable-table-filtering.js.map