@adaptabletools/adaptable 18.0.0-canary.17 → 18.0.0-canary.19
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.
- package/package.json +1 -1
- package/src/AdaptableOptions/AdaptableOptions.d.ts +2 -2
- package/src/AdaptableOptions/CommentOptions.d.ts +9 -6
- package/src/AdaptableOptions/GroupingOptions.d.ts +0 -7
- package/src/AdaptableOptions/NoteOptions.d.ts +4 -4
- package/src/Api/Events/GridDataChanged.d.ts +1 -1
- package/src/Api/Implementation/ApiBase.d.ts +2 -1
- package/src/Api/Implementation/ApiBase.js +3 -0
- package/src/Api/Internal/ColumnFilterInternalApi.d.ts +1 -0
- package/src/Api/Internal/ColumnFilterInternalApi.js +12 -0
- package/src/Api/Internal/GridFilterInternalApi.d.ts +5 -0
- package/src/Api/Internal/GridFilterInternalApi.js +6 -0
- package/src/PredefinedConfig/Common/DataUpdateConfig.d.ts +1 -5
- package/src/PredefinedConfig/Common/Menu.d.ts +9 -4
- package/src/PredefinedConfig/Common/Menu.js +61 -35
- package/src/PredefinedConfig/NoteState.d.ts +1 -1
- package/src/Redux/Store/AdaptableStore.js +25 -10
- package/src/Strategy/AdaptableModuleBase.d.ts +5 -5
- package/src/Strategy/AdaptableModuleBase.js +3 -3
- package/src/Strategy/AlertModule.js +1 -1
- package/src/Strategy/CalculatedColumnModule.js +1 -1
- package/src/Strategy/ColumnFilterModule.d.ts +1 -1
- package/src/Strategy/ColumnFilterModule.js +44 -41
- package/src/Strategy/ColumnInfoModule.js +2 -2
- package/src/Strategy/CommentModule.js +7 -16
- package/src/Strategy/CustomSortModule.js +1 -1
- package/src/Strategy/DashboardModule.js +8 -8
- package/src/Strategy/DataImportModule.js +1 -1
- package/src/Strategy/ExportModule.js +3 -3
- package/src/Strategy/Fdc3Module.js +1 -1
- package/src/Strategy/FlashingCellModule.js +4 -4
- package/src/Strategy/FormatColumnModule.js +6 -6
- package/src/Strategy/FreeTextColumnModule.js +1 -1
- package/src/Strategy/GridInfoModule.js +2 -2
- package/src/Strategy/LayoutModule.js +13 -13
- package/src/Strategy/NoteModule.js +8 -11
- package/src/Strategy/PlusMinusModule.js +1 -1
- package/src/Strategy/SettingsPanelModule.js +3 -3
- package/src/Strategy/StyledColumnModule.js +13 -10
- package/src/Strategy/SystemStatusModule.js +1 -1
- package/src/Utilities/MenuItem.d.ts +7 -7
- package/src/View/Comments/CommentsEditor.js +7 -6
- package/src/View/Comments/CommentsPopup.js +2 -1
- package/src/View/Components/Selectors/PermittedValuesSelector.js +1 -1
- package/src/View/Note/NotePopup.js +5 -3
- package/src/agGrid/AdaptableAgGrid.js +0 -20
- package/src/agGrid/defaultAdaptableOptions.js +0 -1
- package/src/agGrid/editors/AdaptableDateEditor/index.d.ts +1 -1
- package/src/agGrid/editors/AdaptableDateEditor/index.js +1 -1
- package/src/components/Select/Select.d.ts +1 -1
- package/src/components/Select/Select.js +1 -1
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +13 -16
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/tsconfig.esm.tsbuildinfo +1 -1
|
@@ -39,6 +39,43 @@ export class ColumnFilterModule extends AdaptableModuleBase {
|
|
|
39
39
|
}
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
+
addColumnMenuItems(column) {
|
|
43
|
+
let filterSubMenuItems = [];
|
|
44
|
+
if (column &&
|
|
45
|
+
column.filterable &&
|
|
46
|
+
this.api.optionsApi.getColumnFilterOptions().useAdaptableColumnFiltering) {
|
|
47
|
+
if (this.api.gridApi.isQuickFilterAvailable()) {
|
|
48
|
+
const isFilterVisible = this.api.columnFilterApi.isQuickFilterVisible();
|
|
49
|
+
if (this.isModuleEditable() &&
|
|
50
|
+
this.api.optionsApi.getColumnFilterOptions().useAdaptableColumnFiltering) {
|
|
51
|
+
filterSubMenuItems.push(this.createMenuItemReduxAction(isFilterVisible ? 'column-filter-bar-hide' : 'column-filter-bar-show', isFilterVisible ? 'Hide Filter Bar' : 'Show Filter Bar', isFilterVisible ? 'unchecked' : 'check', isFilterVisible
|
|
52
|
+
? SystemRedux.SystemQuickFilterBarHide()
|
|
53
|
+
: SystemRedux.SystemQuickFilterBarShow()));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
const existingColumnFilter = this.getExistingColumnFilter(column);
|
|
57
|
+
if (existingColumnFilter) {
|
|
58
|
+
filterSubMenuItems.push(this.createMenuItemReduxAction('column-filter-clear', 'Clear Filter', 'close', LayoutRedux.LayoutColumnFilterClear(existingColumnFilter)));
|
|
59
|
+
filterSubMenuItems.push(this.createMenuItemReduxAction(existingColumnFilter.IsSuspended ? 'column-filter-unsuspend' : 'column-filter-suspend', existingColumnFilter.IsSuspended ? 'Unsuspend Filter' : 'Suspend Filter', existingColumnFilter.IsSuspended ? 'resume' : 'pause', existingColumnFilter.IsSuspended
|
|
60
|
+
? LayoutRedux.LayoutColumnFilterUnSuspend(existingColumnFilter)
|
|
61
|
+
: LayoutRedux.LayoutColumnFilterSuspend(existingColumnFilter)));
|
|
62
|
+
}
|
|
63
|
+
if (ArrayExtensions.IsNotNullOrEmpty(filterSubMenuItems)) {
|
|
64
|
+
return [
|
|
65
|
+
{
|
|
66
|
+
name: 'parent',
|
|
67
|
+
label: this.moduleInfo.FriendlyName,
|
|
68
|
+
isVisible: true,
|
|
69
|
+
module: this.moduleInfo.ModuleName,
|
|
70
|
+
icon: {
|
|
71
|
+
name: this.moduleInfo.Glyph,
|
|
72
|
+
},
|
|
73
|
+
subItems: filterSubMenuItems,
|
|
74
|
+
},
|
|
75
|
+
];
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
42
79
|
addContextMenuItems(menuContext) {
|
|
43
80
|
if (!menuContext.isRowGroupColumn && this.isModuleAvailable()) {
|
|
44
81
|
if (menuContext.adaptableColumn &&
|
|
@@ -57,13 +94,15 @@ export class ColumnFilterModule extends AdaptableModuleBase {
|
|
|
57
94
|
this.api.columnFilterApi.internalApi.createEqualityColumnFilterForCell(menuContext.selectedCellInfo.gridCells[0]);
|
|
58
95
|
};
|
|
59
96
|
return [
|
|
60
|
-
this.
|
|
97
|
+
this.createMenuItemClickFunction('column-filter-on-cell-value', isMultiple ? 'Filter on Cell Values' : 'Filter on Cell Value', this.moduleInfo.Glyph, clickFunction),
|
|
61
98
|
];
|
|
62
99
|
}
|
|
63
100
|
else {
|
|
64
101
|
let filterSubMenuItems = [];
|
|
65
|
-
filterSubMenuItems.push(this.
|
|
66
|
-
filterSubMenuItems.push(this.
|
|
102
|
+
filterSubMenuItems.push(this.createMenuItemReduxAction('column-filter-clear', 'Clear Filter', 'close', LayoutRedux.LayoutColumnFilterClear(existingColumnFilter)));
|
|
103
|
+
filterSubMenuItems.push(this.createMenuItemClickFunction(existingColumnFilter.IsSuspended
|
|
104
|
+
? 'column-filter-unsuspend'
|
|
105
|
+
: 'column-filter-suspend', existingColumnFilter.IsSuspended ? 'Unsuspend Filter' : 'Suspend Filter', existingColumnFilter.IsSuspended ? 'resume' : 'pause', existingColumnFilter.IsSuspended
|
|
67
106
|
? () => {
|
|
68
107
|
this.api.columnFilterApi.unSuspendColumnFilter(existingColumnFilter);
|
|
69
108
|
}
|
|
@@ -71,7 +110,8 @@ export class ColumnFilterModule extends AdaptableModuleBase {
|
|
|
71
110
|
this.api.columnFilterApi.suspendColumnFilter(existingColumnFilter);
|
|
72
111
|
}));
|
|
73
112
|
return [
|
|
74
|
-
{
|
|
113
|
+
{
|
|
114
|
+
name: 'parent',
|
|
75
115
|
label: this.moduleInfo.FriendlyName,
|
|
76
116
|
isVisible: true,
|
|
77
117
|
module: this.moduleInfo.ModuleName,
|
|
@@ -85,43 +125,6 @@ export class ColumnFilterModule extends AdaptableModuleBase {
|
|
|
85
125
|
}
|
|
86
126
|
}
|
|
87
127
|
}
|
|
88
|
-
addColumnMenuItems(column) {
|
|
89
|
-
let filterSubMenuItems = [];
|
|
90
|
-
if (column &&
|
|
91
|
-
column.filterable &&
|
|
92
|
-
this.api.optionsApi.getColumnFilterOptions().useAdaptableColumnFiltering) {
|
|
93
|
-
if (this.api.gridApi.isQuickFilterAvailable()) {
|
|
94
|
-
const isFilterVisible = this.api.columnFilterApi.isQuickFilterVisible();
|
|
95
|
-
if (this.isModuleEditable() &&
|
|
96
|
-
this.api.optionsApi.getColumnFilterOptions().useAdaptableColumnFiltering) {
|
|
97
|
-
filterSubMenuItems.push(this.createColumnMenuItemReduxAction('filter-bar-visbility', isFilterVisible ? 'Hide Filter Bar' : 'Show Filter Bar', isFilterVisible ? 'unchecked' : 'check', isFilterVisible
|
|
98
|
-
? SystemRedux.SystemQuickFilterBarHide()
|
|
99
|
-
: SystemRedux.SystemQuickFilterBarShow()));
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
const existingColumnFilter = this.getExistingColumnFilter(column);
|
|
103
|
-
if (existingColumnFilter) {
|
|
104
|
-
filterSubMenuItems.push(this.createColumnMenuItemReduxAction('filter-clear', 'Clear Filter', 'close', LayoutRedux.LayoutColumnFilterClear(existingColumnFilter)));
|
|
105
|
-
filterSubMenuItems.push(this.createColumnMenuItemReduxAction('filter-suspend', existingColumnFilter.IsSuspended ? 'Unsuspend Filter' : 'Suspend Filter', existingColumnFilter.IsSuspended ? 'resume' : 'pause', existingColumnFilter.IsSuspended
|
|
106
|
-
? LayoutRedux.LayoutColumnFilterUnSuspend(existingColumnFilter)
|
|
107
|
-
: LayoutRedux.LayoutColumnFilterSuspend(existingColumnFilter)));
|
|
108
|
-
}
|
|
109
|
-
if (ArrayExtensions.IsNotNullOrEmpty(filterSubMenuItems)) {
|
|
110
|
-
return [
|
|
111
|
-
{
|
|
112
|
-
name: 'filter',
|
|
113
|
-
label: this.moduleInfo.FriendlyName,
|
|
114
|
-
isVisible: true,
|
|
115
|
-
module: this.moduleInfo.ModuleName,
|
|
116
|
-
icon: {
|
|
117
|
-
name: this.moduleInfo.Glyph,
|
|
118
|
-
},
|
|
119
|
-
subItems: filterSubMenuItems,
|
|
120
|
-
},
|
|
121
|
-
];
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
128
|
getExistingColumnFilter(column) {
|
|
126
129
|
return this.api.columnFilterApi.getColumnFilters().find((x) => x.ColumnId == column.columnId);
|
|
127
130
|
}
|
|
@@ -15,7 +15,7 @@ export class ColumnInfoModule extends AdaptableModuleBase {
|
|
|
15
15
|
};
|
|
16
16
|
return [
|
|
17
17
|
this.createMainMenuItemShowPopup({
|
|
18
|
-
Name: 'column-info',
|
|
18
|
+
Name: 'column-info-show',
|
|
19
19
|
Label: 'Column Info',
|
|
20
20
|
ComponentName: this.moduleInfo.Popup,
|
|
21
21
|
Icon: this.moduleInfo.Glyph,
|
|
@@ -32,7 +32,7 @@ export class ColumnInfoModule extends AdaptableModuleBase {
|
|
|
32
32
|
};
|
|
33
33
|
return [
|
|
34
34
|
this.createMainMenuItemShowPopup({
|
|
35
|
-
Name: 'column-info',
|
|
35
|
+
Name: 'column-info-show',
|
|
36
36
|
Label: 'Column Info',
|
|
37
37
|
ComponentName: this.moduleInfo.Popup,
|
|
38
38
|
Icon: this.moduleInfo.Glyph,
|
|
@@ -4,13 +4,12 @@ import { AdaptableModuleBase } from './AdaptableModuleBase';
|
|
|
4
4
|
export class CommentModule extends AdaptableModuleBase {
|
|
5
5
|
constructor(api) {
|
|
6
6
|
super(ModuleConstants.CommentModuleId, ModuleConstants.CommentFriendlyName, 'comments', 'CommentsPopup', 'comments', api);
|
|
7
|
-
this.adaptable = api.internalApi.getAdaptableInstance();
|
|
8
7
|
}
|
|
9
8
|
onAdaptableReady() {
|
|
10
9
|
this.loadComments();
|
|
11
10
|
}
|
|
12
11
|
isModuleAvailable() {
|
|
13
|
-
const options = this.
|
|
12
|
+
const options = this.api.optionsApi.getCommentOptions();
|
|
14
13
|
if (!options || !options.persistCommentThreads || !options.loadCommentThreads) {
|
|
15
14
|
return false;
|
|
16
15
|
}
|
|
@@ -22,7 +21,7 @@ export class CommentModule extends AdaptableModuleBase {
|
|
|
22
21
|
async loadComments() {
|
|
23
22
|
var _a, _b;
|
|
24
23
|
const commentThreads = await ((_b = (_a = this.api.optionsApi
|
|
25
|
-
.getCommentOptions()) === null || _a === void 0 ? void 0 : _a.loadCommentThreads) === null || _b === void 0 ? void 0 : _b.call(_a, createBaseContext(this.
|
|
24
|
+
.getCommentOptions()) === null || _a === void 0 ? void 0 : _a.loadCommentThreads) === null || _b === void 0 ? void 0 : _b.call(_a, createBaseContext(this.api)));
|
|
26
25
|
this.api.commentApi.loadCommentThreads(commentThreads);
|
|
27
26
|
}
|
|
28
27
|
addContextMenuItems(menuContext) {
|
|
@@ -31,17 +30,9 @@ export class CommentModule extends AdaptableModuleBase {
|
|
|
31
30
|
return undefined;
|
|
32
31
|
}
|
|
33
32
|
const items = [];
|
|
34
|
-
const isCellCommentable = (_b = (_a = this.
|
|
33
|
+
const isCellCommentable = (_b = (_a = this.api.optionsApi) === null || _a === void 0 ? void 0 : _a.getCommentOptions()) === null || _b === void 0 ? void 0 : _b.isCellCommentable;
|
|
35
34
|
if (!isCellCommentable ||
|
|
36
|
-
isCellCommentable({
|
|
37
|
-
adaptableApi: this.adaptable.api,
|
|
38
|
-
cellAddress: {
|
|
39
|
-
PrimaryKeyValue: menuContext.primaryKeyValue,
|
|
40
|
-
ColumnId: menuContext.adaptableColumn.columnId,
|
|
41
|
-
},
|
|
42
|
-
userName: this.adaptable.api.optionsApi.getUserName(),
|
|
43
|
-
adaptableId: this.adaptable.adaptableOptions.adaptableId,
|
|
44
|
-
})) {
|
|
35
|
+
isCellCommentable(Object.assign({ gridCell: menuContext.gridCell }, createBaseContext(this.api)))) {
|
|
45
36
|
items.push(...this.getAddRemoveCommentsMenuItems(menuContext));
|
|
46
37
|
}
|
|
47
38
|
return items;
|
|
@@ -53,17 +44,17 @@ export class CommentModule extends AdaptableModuleBase {
|
|
|
53
44
|
PrimaryKeyValue: menuContext.primaryKeyValue,
|
|
54
45
|
ColumnId: menuContext.adaptableColumn.columnId,
|
|
55
46
|
};
|
|
56
|
-
const comments = this.
|
|
47
|
+
const comments = this.api.commentApi.getComments(cellAddress);
|
|
57
48
|
if (!this.api.commentApi.internalApi.areCommentsAvailable()) {
|
|
58
49
|
return items;
|
|
59
50
|
}
|
|
60
51
|
if (comments) {
|
|
61
|
-
items.push(this.
|
|
52
|
+
items.push(this.createMenuItemClickFunction('comment-remove', 'Remove Comment', this.moduleInfo.Glyph, () => {
|
|
62
53
|
this.api.commentApi.deleteCommentThread(cellAddress);
|
|
63
54
|
}));
|
|
64
55
|
}
|
|
65
56
|
else {
|
|
66
|
-
items.push(this.
|
|
57
|
+
items.push(this.createMenuItemClickFunction('comment-add', 'Add Comment', this.moduleInfo.Glyph, () => {
|
|
67
58
|
// add an empty one
|
|
68
59
|
this.api.commentApi.addCommentThread(Object.assign(Object.assign({}, cellAddress), { Comments: [] }));
|
|
69
60
|
requestAnimationFrame(() => {
|
|
@@ -36,7 +36,7 @@ export class CustomSortModule extends AdaptableModuleBase {
|
|
|
36
36
|
};
|
|
37
37
|
let name = customSort ? 'custom-sort-edit' : 'custom-sort-add';
|
|
38
38
|
return [
|
|
39
|
-
this.
|
|
39
|
+
this.createMenuItemShowPopup(name, label + 'Custom Sort', this.moduleInfo.Popup, this.moduleInfo.Glyph, popupParam),
|
|
40
40
|
];
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -27,29 +27,29 @@ export class DashboardModule extends AdaptableModuleBase {
|
|
|
27
27
|
if (this.isModuleAvailable()) {
|
|
28
28
|
let menuItems = [];
|
|
29
29
|
if (this.isModuleEditable()) {
|
|
30
|
-
menuItems.push(this.
|
|
30
|
+
menuItems.push(this.createMenuItemClickFunction('dashboard-configure', 'Configure', 'settings', () => this.api.dashboardApi.openDashboardSettingsPanel()));
|
|
31
31
|
}
|
|
32
32
|
if (this.api.dashboardApi.getDashboardState().IsCollapsed) {
|
|
33
|
-
menuItems.push(this.
|
|
33
|
+
menuItems.push(this.createMenuItemReduxAction('dashboard-expand', 'Expand', 'expand', DashboardRedux.DashboardSetIsCollapsed(false)));
|
|
34
34
|
}
|
|
35
35
|
else {
|
|
36
|
-
menuItems.push(this.
|
|
36
|
+
menuItems.push(this.createMenuItemReduxAction('dashboard-collapse', 'Collapse', 'collapse', DashboardRedux.DashboardSetIsCollapsed(true)));
|
|
37
37
|
}
|
|
38
38
|
if (this.api.dashboardApi.getDashboardState().IsFloating) {
|
|
39
|
-
menuItems.push(this.
|
|
39
|
+
menuItems.push(this.createMenuItemReduxAction('dashboard-dock', 'Dock', 'dock', DashboardRedux.DashboardSetIsFloating(false)));
|
|
40
40
|
}
|
|
41
41
|
else if (this.api.optionsApi.getDashboardOptions().canFloat) {
|
|
42
|
-
menuItems.push(this.
|
|
42
|
+
menuItems.push(this.createMenuItemReduxAction('dashboard-float', 'Float', 'dock', DashboardRedux.DashboardSetIsFloating(true)));
|
|
43
43
|
}
|
|
44
44
|
if (this.api.dashboardApi.getDashboardState().IsHidden) {
|
|
45
|
-
menuItems.push(this.
|
|
45
|
+
menuItems.push(this.createMenuItemReduxAction('dashboard-show', 'Show', 'visibility-on-bold', DashboardRedux.DashboardSetIsHidden(false)));
|
|
46
46
|
}
|
|
47
47
|
else {
|
|
48
|
-
menuItems.push(this.
|
|
48
|
+
menuItems.push(this.createMenuItemReduxAction('dashboard-hide', 'Hide', 'visibility-off-bold', DashboardRedux.DashboardSetIsHidden(true)));
|
|
49
49
|
}
|
|
50
50
|
return [
|
|
51
51
|
{
|
|
52
|
-
name: '
|
|
52
|
+
name: 'parent',
|
|
53
53
|
label: this.moduleInfo.FriendlyName,
|
|
54
54
|
isVisible: true,
|
|
55
55
|
module: this.moduleInfo.ModuleName,
|
|
@@ -26,6 +26,6 @@ export class DataImportModule extends AdaptableModuleBase {
|
|
|
26
26
|
source: source,
|
|
27
27
|
maxWidth: this.getPopupMaxWidth(),
|
|
28
28
|
};
|
|
29
|
-
return this.
|
|
29
|
+
return this.createMenuItemShowPopup('data-import', 'Import Data', this.moduleInfo.Popup, this.moduleInfo.Glyph, moduleParams);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -86,16 +86,16 @@ export class ExportModule extends AdaptableModuleBase {
|
|
|
86
86
|
buildReportMenuItems(report) {
|
|
87
87
|
const menuItems = [];
|
|
88
88
|
for (const destination of this.api.exportApi.getAvailableExportDestinations()) {
|
|
89
|
-
menuItems.push(this.
|
|
89
|
+
menuItems.push(this.createMenuItemClickFunction(this.getMenuName(destination), destination, this.moduleInfo.Glyph, () => this.export(report, destination)));
|
|
90
90
|
}
|
|
91
91
|
for (const customDestination of this.api.exportApi.getCustomDestinations()) {
|
|
92
|
-
menuItems.push(this.
|
|
92
|
+
menuItems.push(this.createMenuItemClickFunction('export-custom-destination', customDestination.name, this.moduleInfo.Glyph, () => this.export(report, customDestination.name)));
|
|
93
93
|
}
|
|
94
94
|
return menuItems;
|
|
95
95
|
}
|
|
96
96
|
buildExportMenuItem(label, subItems) {
|
|
97
97
|
return {
|
|
98
|
-
name: '
|
|
98
|
+
name: 'parent',
|
|
99
99
|
label: label,
|
|
100
100
|
module: this.moduleInfo.ModuleName,
|
|
101
101
|
isVisible: true,
|
|
@@ -27,7 +27,7 @@ export class Fdc3Module extends AdaptableModuleBase {
|
|
|
27
27
|
contextMenuItems.sort((a, b) => a.label.localeCompare(b.label));
|
|
28
28
|
if (contextMenuItems.length > 1) {
|
|
29
29
|
const groupMenuItem = {
|
|
30
|
-
name: '
|
|
30
|
+
name: 'parent',
|
|
31
31
|
module: this.moduleInfo.ModuleName,
|
|
32
32
|
label: 'FDC3',
|
|
33
33
|
icon: {
|
|
@@ -69,11 +69,11 @@ export class FlashingCellModule extends AdaptableModuleBase {
|
|
|
69
69
|
});
|
|
70
70
|
if (flashingCellForCurrentColumn) {
|
|
71
71
|
return [
|
|
72
|
-
this.
|
|
72
|
+
this.createMenuItemReduxAction('flashing-cell-delete', 'Delete Flashing Cell', this.moduleInfo.Glyph, FlashingCellRedux.FlashingCellDefinitionDelete(flashingCellForCurrentColumn)),
|
|
73
73
|
];
|
|
74
74
|
}
|
|
75
75
|
return [
|
|
76
|
-
this.
|
|
76
|
+
this.createMenuItemReduxAction('flashing-cell-add', 'Add Flashing Cell', this.moduleInfo.Glyph, FlashingCellRedux.FlashingCellDefinitionAdd({
|
|
77
77
|
Scope: {
|
|
78
78
|
ColumnIds: [column.columnId],
|
|
79
79
|
},
|
|
@@ -95,11 +95,11 @@ export class FlashingCellModule extends AdaptableModuleBase {
|
|
|
95
95
|
if (flashingCellForRow.flashTarget === 'row' ||
|
|
96
96
|
(Array.isArray(flashingCellForRow === null || flashingCellForRow === void 0 ? void 0 : flashingCellForRow.flashTarget) &&
|
|
97
97
|
flashingCellForRow.flashTarget.includes('row'))) {
|
|
98
|
-
items.push(this.
|
|
98
|
+
items.push(this.createMenuItemReduxAction('flashing-row-clear', 'Clear Flashing Row', this.moduleInfo.Glyph, SystemRedux.SystemFlashingCellDelete(flashingCellForRow)));
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
else if (flashingCellForCell && flashingCellForCell.flashTarget === 'cell') {
|
|
102
|
-
items.push(this.
|
|
102
|
+
items.push(this.createMenuItemReduxAction('flashing-cell-clear', 'Clear Flashing Cell', this.moduleInfo.Glyph, SystemRedux.SystemFlashingCellDelete(flashingCellForCell)));
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
}
|
|
@@ -45,12 +45,12 @@ export class FormatColumnModule extends AdaptableModuleBase {
|
|
|
45
45
|
action: 'New',
|
|
46
46
|
source: 'ColumnMenu',
|
|
47
47
|
};
|
|
48
|
-
const createFormatColumnMenuItem = this.
|
|
48
|
+
const createFormatColumnMenuItem = this.createMenuItemShowPopup('format-column-add', 'Create', this.moduleInfo.Popup, 'plus', createPopupParam);
|
|
49
49
|
const formatColumnsForColumn = this.api.formatColumnApi.getFormatColumnsForColumnId(column.columnId);
|
|
50
50
|
// .filter((fc) => this.api.scopeApi.isSingleColumnScope(fc.Scope));
|
|
51
51
|
// if no formats then just show Create
|
|
52
52
|
if (ArrayExtensions.IsNullOrEmpty(formatColumnsForColumn)) {
|
|
53
|
-
returnColumnMenuItems.push(this.
|
|
53
|
+
returnColumnMenuItems.push(this.createMenuItemShowPopup('format-column-add', 'Create Format Column', this.moduleInfo.Popup, this.moduleInfo.Glyph, createPopupParam));
|
|
54
54
|
// if 1 format then show a Create and an Edit
|
|
55
55
|
}
|
|
56
56
|
else if (formatColumnsForColumn.length == 1) {
|
|
@@ -60,9 +60,9 @@ export class FormatColumnModule extends AdaptableModuleBase {
|
|
|
60
60
|
value: formatColumnsForColumn[0],
|
|
61
61
|
source: 'ColumnMenu',
|
|
62
62
|
};
|
|
63
|
-
const editFormatColumnMenuItem = this.
|
|
63
|
+
const editFormatColumnMenuItem = this.createMenuItemShowPopup('format-column-edit', 'Edit', this.moduleInfo.Popup, 'edit', editPopupParam);
|
|
64
64
|
returnColumnMenuItems.push({
|
|
65
|
-
name: '
|
|
65
|
+
name: 'parent',
|
|
66
66
|
label: 'Format Column',
|
|
67
67
|
module: this.moduleInfo.ModuleName,
|
|
68
68
|
isVisible: true,
|
|
@@ -77,9 +77,9 @@ export class FormatColumnModule extends AdaptableModuleBase {
|
|
|
77
77
|
const moduleInfo = this.api.internalApi
|
|
78
78
|
.getModuleService()
|
|
79
79
|
.getModuleInfoByModule('FormatColumn');
|
|
80
|
-
const editFormatColumnMenuItem = this.
|
|
80
|
+
const editFormatColumnMenuItem = this.createMenuItemReduxAction('format-column-edit', 'Show Current', this.moduleInfo.Glyph, PopupRedux.PopupShowScreen('FormatColumn', moduleInfo.Popup));
|
|
81
81
|
returnColumnMenuItems.push({
|
|
82
|
-
name: '
|
|
82
|
+
name: 'parent',
|
|
83
83
|
label: 'Format Column',
|
|
84
84
|
module: this.moduleInfo.ModuleName,
|
|
85
85
|
isVisible: true,
|
|
@@ -28,7 +28,7 @@ export class FreeTextColumnModule extends AdaptableModuleBase {
|
|
|
28
28
|
source: 'ColumnMenu',
|
|
29
29
|
};
|
|
30
30
|
return [
|
|
31
|
-
this.
|
|
31
|
+
this.createMenuItemShowPopup('free-text-column-edit', 'Edit Free Text Column', this.moduleInfo.Popup, this.moduleInfo.Glyph, popupParam),
|
|
32
32
|
];
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -11,7 +11,7 @@ export class GridInfoModule extends AdaptableModuleBase {
|
|
|
11
11
|
if (this.isModuleAvailable()) {
|
|
12
12
|
return [
|
|
13
13
|
this.createMainMenuItemShowPopup({
|
|
14
|
-
Name: 'grid-info',
|
|
14
|
+
Name: 'grid-info-show',
|
|
15
15
|
Label: 'Grid Info',
|
|
16
16
|
ComponentName: this.moduleInfo.Popup,
|
|
17
17
|
Icon: this.moduleInfo.Glyph,
|
|
@@ -23,7 +23,7 @@ export class GridInfoModule extends AdaptableModuleBase {
|
|
|
23
23
|
if (this.isModuleAvailable()) {
|
|
24
24
|
return [
|
|
25
25
|
this.createMainMenuItemShowPopup({
|
|
26
|
-
Name: 'grid-info',
|
|
26
|
+
Name: 'grid-info-show',
|
|
27
27
|
Label: 'Grid Info',
|
|
28
28
|
ComponentName: this.moduleInfo.Popup,
|
|
29
29
|
Icon: this.moduleInfo.Glyph,
|
|
@@ -145,7 +145,7 @@ export class LayoutModule extends AdaptableModuleBase {
|
|
|
145
145
|
if (this.isModuleEditable()) {
|
|
146
146
|
const isReadOnlyLayout = this.api.layoutApi.isCurrentLayoutReadOnly();
|
|
147
147
|
if (!isReadOnlyLayout) {
|
|
148
|
-
returnColumnMenuItems.push(this.
|
|
148
|
+
returnColumnMenuItems.push(this.createMenuItemShowPopup('layout-edit', 'Edit Layout', this.moduleInfo.Popup, this.moduleInfo.Glyph, {
|
|
149
149
|
action: 'Edit',
|
|
150
150
|
source: 'ColumnMenu',
|
|
151
151
|
value: this.api.layoutApi.getCurrentLayout(),
|
|
@@ -153,10 +153,10 @@ export class LayoutModule extends AdaptableModuleBase {
|
|
|
153
153
|
}
|
|
154
154
|
if (column) {
|
|
155
155
|
if (!isReadOnlyLayout) {
|
|
156
|
-
returnColumnMenuItems.push(this.
|
|
156
|
+
returnColumnMenuItems.push(this.createMenuItemClickFunction('layout-column-caption-change', 'Change Caption', 'edit', () => this.api.layoutApi.showChangeColumnCaption(column)));
|
|
157
157
|
}
|
|
158
158
|
if (column.hideable) {
|
|
159
|
-
returnColumnMenuItems.push(this.
|
|
159
|
+
returnColumnMenuItems.push(this.createMenuItemClickFunction('layout-column-hide', 'Hide Column', 'visibility-off-bold', () => {
|
|
160
160
|
this.api.columnApi.hideColumn(column.columnId);
|
|
161
161
|
}));
|
|
162
162
|
}
|
|
@@ -165,24 +165,24 @@ export class LayoutModule extends AdaptableModuleBase {
|
|
|
165
165
|
if (column) {
|
|
166
166
|
const hasExistingSelection = (_b = (_a = this.api.gridApi.getSelectedCellInfo()) === null || _a === void 0 ? void 0 : _a.gridCells) === null || _b === void 0 ? void 0 : _b.length;
|
|
167
167
|
if (hasExistingSelection) {
|
|
168
|
-
selectMenuItems.push(this.
|
|
168
|
+
selectMenuItems.push(this.createMenuItemClickFunction('layout-column-select-preserve', 'Column (Preserve Selection)', 'column-add', () => {
|
|
169
169
|
this.api.columnApi.addColumnToSelection(column.columnId);
|
|
170
170
|
}));
|
|
171
|
-
selectMenuItems.push(this.
|
|
171
|
+
selectMenuItems.push(this.createMenuItemClickFunction('layout-column-select-reset', 'Column (Reset Selection)', 'columns', () => {
|
|
172
172
|
this.api.columnApi.selectColumn(column.columnId);
|
|
173
173
|
}));
|
|
174
174
|
}
|
|
175
175
|
else {
|
|
176
|
-
selectMenuItems.push(this.
|
|
176
|
+
selectMenuItems.push(this.createMenuItemClickFunction('layout-column-select', 'Column', 'columns', () => {
|
|
177
177
|
this.api.columnApi.selectColumn(column.columnId);
|
|
178
178
|
}));
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
|
-
selectMenuItems.push(this.
|
|
181
|
+
selectMenuItems.push(this.createMenuItemClickFunction('layout-select-all', 'Whole Grid', this.moduleInfo.Glyph, () => {
|
|
182
182
|
this.api.gridApi.selectAll();
|
|
183
183
|
}));
|
|
184
184
|
returnColumnMenuItems.push({
|
|
185
|
-
name: 'layout-select',
|
|
185
|
+
name: 'layout-select-parent',
|
|
186
186
|
label: 'Select',
|
|
187
187
|
isVisible: true,
|
|
188
188
|
module: this.moduleInfo.ModuleName,
|
|
@@ -197,7 +197,7 @@ export class LayoutModule extends AdaptableModuleBase {
|
|
|
197
197
|
addContextMenuItems(menuContext) {
|
|
198
198
|
let returnColumnMenuItems = [];
|
|
199
199
|
if (this.isModuleEditable() && !this.api.layoutApi.isCurrentLayoutReadOnly()) {
|
|
200
|
-
returnColumnMenuItems.push(this.
|
|
200
|
+
returnColumnMenuItems.push(this.createMenuItemShowPopup('layout-edit', 'Edit Layout', this.moduleInfo.Popup, this.moduleInfo.Glyph, {
|
|
201
201
|
action: 'Edit',
|
|
202
202
|
source: 'ColumnMenu',
|
|
203
203
|
}));
|
|
@@ -209,19 +209,19 @@ export class LayoutModule extends AdaptableModuleBase {
|
|
|
209
209
|
let clickFunction = () => {
|
|
210
210
|
this.api.gridApi.deselectAll();
|
|
211
211
|
};
|
|
212
|
-
returnColumnMenuItems.push(this.
|
|
212
|
+
returnColumnMenuItems.push(this.createMenuItemClickFunction('layout-clear-selection', 'Clear Selected Cells', 'undo', clickFunction));
|
|
213
213
|
if (this.isModuleAvailable()) {
|
|
214
214
|
let gridMenuItems = [];
|
|
215
215
|
let autoSizeFunction = () => {
|
|
216
216
|
this.api.columnApi.autosizeAllColumns();
|
|
217
217
|
};
|
|
218
|
-
gridMenuItems.push(this.
|
|
218
|
+
gridMenuItems.push(this.createMenuItemClickFunction('layout-auto-size', 'Auto Size', 'arrow-expand', autoSizeFunction));
|
|
219
219
|
let clickFunction = () => {
|
|
220
220
|
this.api.gridApi.selectAll();
|
|
221
221
|
};
|
|
222
|
-
gridMenuItems.push(this.
|
|
222
|
+
gridMenuItems.push(this.createMenuItemClickFunction('layout-select-all', 'Select', 'tab-unselected', clickFunction));
|
|
223
223
|
returnColumnMenuItems.push({
|
|
224
|
-
name: 'layout-grid',
|
|
224
|
+
name: 'layout-grid-parent',
|
|
225
225
|
label: 'Grid',
|
|
226
226
|
module: this.moduleInfo.ModuleName,
|
|
227
227
|
isVisible: true,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as ModuleConstants from '../Utilities/Constants/ModuleConstants';
|
|
2
|
+
import { createBaseContext } from '../Utilities/ObjectFactory';
|
|
2
3
|
import { AdaptableModuleBase } from './AdaptableModuleBase';
|
|
3
4
|
export class NoteModule extends AdaptableModuleBase {
|
|
4
5
|
constructor(api) {
|
|
@@ -14,18 +15,14 @@ export class NoteModule extends AdaptableModuleBase {
|
|
|
14
15
|
if (!this.isModuleAvailable()) {
|
|
15
16
|
return undefined;
|
|
16
17
|
}
|
|
18
|
+
const isReadOnly = this.adaptable.api.entitlementApi.getEntitlementAccessLevelForModule(this.moduleInfo.ModuleName) === 'ReadOnly';
|
|
19
|
+
if (isReadOnly) {
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
17
22
|
const items = [];
|
|
18
23
|
const isCellNotable = (_b = (_a = this.adaptable.api.optionsApi) === null || _a === void 0 ? void 0 : _a.getNoteOptions()) === null || _b === void 0 ? void 0 : _b.isCellNotable;
|
|
19
24
|
if (!isCellNotable ||
|
|
20
|
-
isCellNotable({
|
|
21
|
-
adaptableApi: this.adaptable.api,
|
|
22
|
-
address: {
|
|
23
|
-
PrimaryKeyValue: menuContext.primaryKeyValue,
|
|
24
|
-
ColumnId: menuContext.adaptableColumn.columnId,
|
|
25
|
-
},
|
|
26
|
-
userName: this.adaptable.api.optionsApi.getUserName(),
|
|
27
|
-
adaptableId: this.adaptable.adaptableOptions.adaptableId,
|
|
28
|
-
}))
|
|
25
|
+
isCellNotable(Object.assign({ gridCell: menuContext.gridCell }, createBaseContext(this.api))))
|
|
29
26
|
items.push(...this.getAddRemoveNoteMenuItems(menuContext));
|
|
30
27
|
return items;
|
|
31
28
|
}
|
|
@@ -41,12 +38,12 @@ export class NoteModule extends AdaptableModuleBase {
|
|
|
41
38
|
ColumnId: menuContext.adaptableColumn.columnId,
|
|
42
39
|
})) !== null && _a !== void 0 ? _a : [];
|
|
43
40
|
if (note) {
|
|
44
|
-
items.push(this.
|
|
41
|
+
items.push(this.createMenuItemClickFunction('note-remove', 'Remove Note', this.moduleInfo.Glyph, () => {
|
|
45
42
|
this.api.noteApi.deleteNote(note);
|
|
46
43
|
}));
|
|
47
44
|
}
|
|
48
45
|
else {
|
|
49
|
-
items.push(this.
|
|
46
|
+
items.push(this.createMenuItemClickFunction('note-add', 'Add Note', this.moduleInfo.Glyph, () => {
|
|
50
47
|
// add an empty one
|
|
51
48
|
this.api.noteApi.addNote('', menuContext.primaryKeyValue, menuContext.adaptableColumn.columnId);
|
|
52
49
|
this.api.internalApi.getCellPopupService().showPopup({
|
|
@@ -60,7 +60,7 @@ export class PlusMinusModule extends AdaptableModuleBase {
|
|
|
60
60
|
source: 'ColumnMenu',
|
|
61
61
|
};
|
|
62
62
|
return [
|
|
63
|
-
this.
|
|
63
|
+
this.createMenuItemShowPopup('plus-minus-add', 'Create Plus/Minus Rule', this.moduleInfo.Popup, this.moduleInfo.Glyph, popupParam),
|
|
64
64
|
];
|
|
65
65
|
}
|
|
66
66
|
}
|
|
@@ -9,17 +9,17 @@ export class SettingsPanelModule extends AdaptableModuleBase {
|
|
|
9
9
|
addColumnMenuItems(column) {
|
|
10
10
|
return [
|
|
11
11
|
// To do : get the icon and name from settings in case they have changed?
|
|
12
|
-
this.
|
|
12
|
+
this.createMenuItemReduxAction('settings-panel-open', 'Open ' + this.moduleInfo.FriendlyName, this.moduleInfo.Glyph, PopupRedux.PopupShowScreen()),
|
|
13
13
|
];
|
|
14
14
|
}
|
|
15
15
|
addContextMenuItems(menuContext) {
|
|
16
16
|
return [
|
|
17
|
-
this.
|
|
17
|
+
this.createMenuItemReduxAction('settings-panel-open', 'Open ' + this.moduleInfo.FriendlyName, this.moduleInfo.Glyph, PopupRedux.PopupShowScreen()),
|
|
18
18
|
];
|
|
19
19
|
}
|
|
20
20
|
addModuleMenuItem(source) {
|
|
21
21
|
if (this.isModuleAvailable()) {
|
|
22
|
-
return this.
|
|
22
|
+
return this.createMenuItemReduxAction('settings-panel-open', 'Open ' + this.moduleInfo.FriendlyName, this.moduleInfo.Glyph, PopupRedux.PopupShowScreen());
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
}
|