@adaptabletools/adaptable 18.0.0-canary.2 → 18.0.0-canary.4
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/base.css +3 -0
- package/base.css.map +1 -1
- package/index.css +5 -0
- package/index.css.map +1 -1
- package/package.json +1 -1
- package/src/AdaptableOptions/AdaptableOptions.d.ts +5 -5
- package/src/AdaptableOptions/ColumnFilterOptions.d.ts +4 -4
- package/src/AdaptableOptions/{CommentsOptions.d.ts → CommentOptions.d.ts} +5 -5
- package/src/AdaptableOptions/MenuOptions.d.ts +1 -1
- package/src/AdaptableOptions/MenuOptions.js +1 -5
- package/src/AdaptableOptions/{NotesOptions.d.ts → NoteOptions.d.ts} +1 -1
- package/src/Api/BulkUpdateApi.d.ts +0 -5
- package/src/Api/ColumnFilterApi.d.ts +5 -0
- package/src/Api/Implementation/ApiBase.js +1 -1
- package/src/Api/Implementation/BulkUpdateApiImpl.d.ts +0 -1
- package/src/Api/Implementation/BulkUpdateApiImpl.js +0 -4
- package/src/Api/Implementation/ColumnFilterApiImpl.d.ts +1 -0
- package/src/Api/Implementation/ColumnFilterApiImpl.js +10 -0
- package/src/Api/Implementation/LayoutApiImpl.d.ts +4 -0
- package/src/Api/Implementation/LayoutApiImpl.js +14 -0
- package/src/Api/Implementation/NotesApiImpl.d.ts +2 -4
- package/src/Api/Implementation/NotesApiImpl.js +4 -8
- package/src/Api/Implementation/OptionsApiImpl.d.ts +1 -1
- package/src/Api/Implementation/OptionsApiImpl.js +2 -2
- package/src/Api/InteropioPluginApi.d.ts +2 -2
- package/src/Api/LayoutApi.d.ts +8 -0
- package/src/Api/OptionsApi.d.ts +1 -1
- package/src/PredefinedConfig/NotesState.d.ts +10 -20
- package/src/PredefinedConfig/PredefinedConfig.d.ts +1 -1
- package/src/Redux/ActionsReducers/NotesRedux.d.ts +3 -4
- package/src/Redux/ActionsReducers/NotesRedux.js +8 -7
- package/src/Strategy/ChartingModule.js +2 -1
- package/src/Utilities/Constants/DocumentationLinkConstants.js +1 -1
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +1 -1
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +5 -4
- package/src/Utilities/Helpers/Helper.d.ts +2 -0
- package/src/Utilities/Helpers/Helper.js +4 -0
- package/src/Utilities/Services/AggregatedScalarLiveValue.js +3 -1
- package/src/View/BulkUpdate/BulkUpdatePopup.js +1 -1
- package/src/View/Comments/CommentsPopup.js +12 -8
- package/src/View/Components/Popups/GridCellPopup/GridCellPopup.js +1 -1
- package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +1 -0
- package/src/View/Components/Popups/WindowPopups/windowFactory.js +3 -0
- package/src/View/Components/Selectors/PermittedValuesSelector.js +1 -1
- package/src/View/Layout/TransposedPopup.d.ts +3 -0
- package/src/View/Layout/TransposedPopup.js +193 -0
- package/src/View/Notes/NotesPopup.js +9 -11
- package/src/View/Theme/ThemeSelector.js +3 -3
- package/src/agGrid/Adaptable.js +2 -2
- package/src/agGrid/agGridMenuHelper.js +4 -4
- package/src/components/Select/Select.d.ts +2 -0
- package/src/components/Select/Select.js +2 -2
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +30 -2
- package/src/metamodel/adaptable.metamodel.js +66 -32
- package/src/types.d.ts +5 -2
- package/tsconfig.esm.tsbuildinfo +1 -1
- /package/src/AdaptableOptions/{CommentsOptions.js → CommentOptions.js} +0 -0
- /package/src/AdaptableOptions/{NotesOptions.js → NoteOptions.js} +0 -0
|
@@ -29,8 +29,8 @@ const CellComments = (props) => {
|
|
|
29
29
|
return formatDate(params.data.Timestamp, 'MM.DD.YYYY HH:mm');
|
|
30
30
|
},
|
|
31
31
|
},
|
|
32
|
-
|
|
33
|
-
header: '
|
|
32
|
+
text: {
|
|
33
|
+
header: 'Text',
|
|
34
34
|
field: 'Value',
|
|
35
35
|
defaultFlex: 3,
|
|
36
36
|
},
|
|
@@ -38,15 +38,19 @@ const CellComments = (props) => {
|
|
|
38
38
|
return columns;
|
|
39
39
|
}, []);
|
|
40
40
|
const cellValue = adaptable.api.gridApi.getCellDisplayValue(props.commentThread.PrimaryKeyValue, props.commentThread.ColumnId);
|
|
41
|
+
const primaryKeyHeader = React.useMemo(() => {
|
|
42
|
+
const primaryKey = adaptable.api.optionsApi.getPrimaryKey();
|
|
43
|
+
return adaptable.api.columnApi.getFriendlyNameForColumnId(primaryKey);
|
|
44
|
+
}, []);
|
|
41
45
|
const columnFriendlyName = adaptable.api.columnApi.getFriendlyNameForColumnId(props.commentThread.ColumnId);
|
|
42
46
|
return (React.createElement(Panel, { mb: 2, header: React.createElement(Flex, { width: "100%", alignItems: "center" },
|
|
43
47
|
React.createElement(Box, { mr: 2 },
|
|
44
48
|
"Cell Value: ",
|
|
45
49
|
cellValue),
|
|
46
50
|
React.createElement(Box, { mr: 2 },
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
primaryKeyHeader,
|
|
52
|
+
": ",
|
|
53
|
+
props.commentThread.PrimaryKeyValue),
|
|
50
54
|
React.createElement(Box, null,
|
|
51
55
|
"Column: ",
|
|
52
56
|
columnFriendlyName),
|
|
@@ -72,11 +76,11 @@ const CellComments = (props) => {
|
|
|
72
76
|
}, rowHeight: 30, columnHeaderHeight: 30, domProps: tableDOMProps, columns: columnsMap }))));
|
|
73
77
|
};
|
|
74
78
|
export const CommentsPopup = (props) => {
|
|
75
|
-
const
|
|
79
|
+
const commentThreads = useSelector((state) => {
|
|
76
80
|
return state.Comment.CommentThreads;
|
|
77
81
|
});
|
|
78
|
-
return (React.createElement(PopupPanel, { headerText: 'Comments', glyphicon: 'comments', infoLink: props.moduleInfo.HelpPage }, (
|
|
82
|
+
return (React.createElement(PopupPanel, { headerText: 'Comments', glyphicon: 'comments', infoLink: props.moduleInfo.HelpPage }, (commentThreads !== null && commentThreads !== void 0 ? commentThreads : []).map((commentThread, index) => {
|
|
79
83
|
var _a;
|
|
80
|
-
return React.createElement(CellComments, { key: (_a =
|
|
84
|
+
return React.createElement(CellComments, { key: (_a = commentThread === null || commentThread === void 0 ? void 0 : commentThread.Uuid) !== null && _a !== void 0 ? _a : index, commentThread: commentThread });
|
|
81
85
|
})));
|
|
82
86
|
};
|
|
@@ -23,7 +23,7 @@ const ConnectedNoteEditor = ({ enableEditMode }) => {
|
|
|
23
23
|
api.notesApi.updateNoteText(value, note);
|
|
24
24
|
}, [note]);
|
|
25
25
|
return (React.createElement(Flex, { onClick: () => enableEditMode(), flexDirection: "column", className: "ab-NotesPopup" },
|
|
26
|
-
React.createElement(NoteEditor, { isReadonly: isReadonly, editMode: editMode, key: note === null || note === void 0 ? void 0 : note.Uuid, onClose: () => cellPopupService.hidePopup(), note: note === null || note === void 0 ? void 0 : note.
|
|
26
|
+
React.createElement(NoteEditor, { isReadonly: isReadonly, editMode: editMode, key: note === null || note === void 0 ? void 0 : note.Uuid, onClose: () => cellPopupService.hidePopup(), note: note === null || note === void 0 ? void 0 : note.Text, onNoteChange: (value) => handleNoteChange(value) })));
|
|
27
27
|
};
|
|
28
28
|
export const GridCellPopup = (props) => {
|
|
29
29
|
const { api } = useAdaptable();
|
|
@@ -4,4 +4,5 @@ export declare const WINDOW_GRID_FILTER_EDITOR = "WINDOW_GRID_FILTER_EDITOR";
|
|
|
4
4
|
export declare const SHOW_PIVOT_COLUMN_DETAILS = "SHOW_PIVOT_COLUMN_DETAILS";
|
|
5
5
|
export declare const SHOW_EXPORT_TABLE = "SHOW_EXPORT_TABLE";
|
|
6
6
|
export declare const SHOW_THEME_EDITOR = "SHOW_THEME_EDITOR";
|
|
7
|
+
export declare const WINDOW_SHOW_TRANSPOSED_VIEW = "WINDOW_SHOW_TRANSPOSED_VIEW";
|
|
7
8
|
export declare const windowFactory: Record<string, React.FunctionComponent<WindowPopupChildProps>>;
|
|
@@ -2,13 +2,16 @@ import { GridFilterWindowPopup } from '../../../GridFilter/GridFilterWindowPopup
|
|
|
2
2
|
import { PivotDetailsPopoup } from '../../../Layout/PivotDetailsPopoup';
|
|
3
3
|
import { ExportTablePopup } from '../../../Export/ExportTablePopup';
|
|
4
4
|
import { ThemeEditorWindow } from '../../../Theme/ThemeEditorWindow';
|
|
5
|
+
import { TransposedPopup } from '../../../Layout/TransposedPopup';
|
|
5
6
|
export const WINDOW_GRID_FILTER_EDITOR = 'WINDOW_GRID_FILTER_EDITOR';
|
|
6
7
|
export const SHOW_PIVOT_COLUMN_DETAILS = 'SHOW_PIVOT_COLUMN_DETAILS';
|
|
7
8
|
export const SHOW_EXPORT_TABLE = 'SHOW_EXPORT_TABLE';
|
|
8
9
|
export const SHOW_THEME_EDITOR = 'SHOW_THEME_EDITOR';
|
|
10
|
+
export const WINDOW_SHOW_TRANSPOSED_VIEW = 'WINDOW_SHOW_TRANSPOSED_VIEW';
|
|
9
11
|
export const windowFactory = {
|
|
10
12
|
[WINDOW_GRID_FILTER_EDITOR]: GridFilterWindowPopup,
|
|
11
13
|
[SHOW_PIVOT_COLUMN_DETAILS]: PivotDetailsPopoup,
|
|
12
14
|
[SHOW_EXPORT_TABLE]: ExportTablePopup,
|
|
13
15
|
[SHOW_THEME_EDITOR]: ThemeEditorWindow,
|
|
16
|
+
[WINDOW_SHOW_TRANSPOSED_VIEW]: TransposedPopup,
|
|
14
17
|
};
|
|
@@ -9,7 +9,7 @@ export const PermittedValuesSelector = function (props) {
|
|
|
9
9
|
const [filter, setFilter] = React.useState('');
|
|
10
10
|
const columnType = React.useMemo(() => {
|
|
11
11
|
return adaptable.api.columnApi.getColumnDataTypeForColumnId(props.columnId);
|
|
12
|
-
}, []);
|
|
12
|
+
}, [props.columnId]);
|
|
13
13
|
React.useEffect(() => {
|
|
14
14
|
if (!props.columnId) {
|
|
15
15
|
setIsLoading(false);
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Box, Flex } from 'rebass';
|
|
3
|
+
import FormLayout, { FormRow } from '../../components/FormLayout';
|
|
4
|
+
import Panel from '../../components/Panel';
|
|
5
|
+
import { useAdaptable } from '../AdaptableContext';
|
|
6
|
+
import { ColumnSelector } from '../Components/Selectors/ColumnSelector';
|
|
7
|
+
export const TransposedPopup = (props) => {
|
|
8
|
+
const adaptable = useAdaptable();
|
|
9
|
+
const rowNodes = React.useMemo(() => {
|
|
10
|
+
return adaptable.api.gridApi.getAllRowNodes();
|
|
11
|
+
}, [
|
|
12
|
+
// can be later triggered by ticking data
|
|
13
|
+
]);
|
|
14
|
+
const { transposedColumnId, hideTransposedColumn = true } = props.popupProps;
|
|
15
|
+
const primaryKey = adaptable.api.optionsApi.getPrimaryKey();
|
|
16
|
+
// Thist must be qunique
|
|
17
|
+
const transposeByColumnId = primaryKey;
|
|
18
|
+
// Only used to show nice values a the top of the grid, istead on the value
|
|
19
|
+
// of the primarykey
|
|
20
|
+
const [synteticTransposedByColumnId, setSynteticTransposedByColumnId] = React.useState(transposedColumnId !== null && transposedColumnId !== void 0 ? transposedColumnId : primaryKey);
|
|
21
|
+
const columns = React.useMemo(() => {
|
|
22
|
+
// customisable
|
|
23
|
+
return adaptable.api.columnApi.getColumns();
|
|
24
|
+
}, []);
|
|
25
|
+
const adaptableContainerId = 'transposed-adaptable-container';
|
|
26
|
+
const agGridContainerId = 'transposed-adaptable-ag-grid-container';
|
|
27
|
+
/**
|
|
28
|
+
* This is used as first field
|
|
29
|
+
*/
|
|
30
|
+
const transposedFirstColumnField = '_transposed_column_value';
|
|
31
|
+
const transposedFirstColumnHeader = '_transposed_column_header';
|
|
32
|
+
const transposedRowsAndColumns = React.useMemo(() => {
|
|
33
|
+
/**
|
|
34
|
+
* transposed column values become primaryKey of the new tarnsposed rows
|
|
35
|
+
* we build row by row, might be easer
|
|
36
|
+
*/
|
|
37
|
+
const transposedColumns = [];
|
|
38
|
+
const transposedRows = [];
|
|
39
|
+
for (const row of rowNodes) {
|
|
40
|
+
// we force the col-ids to be strings, easer to work with
|
|
41
|
+
//row[transposeByColumnId] + '';
|
|
42
|
+
const colId = adaptable.api.gridApi.getNormalisedValueFromRowNode(row, transposeByColumnId) + '';
|
|
43
|
+
//row[synteticTransposedByColumnId] + '';
|
|
44
|
+
const header = adaptable.api.gridApi.getNormalisedValueFromRowNode(row, synteticTransposedByColumnId) + '';
|
|
45
|
+
transposedColumns.push({
|
|
46
|
+
colId,
|
|
47
|
+
header,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
for (const column of columns) {
|
|
51
|
+
/**
|
|
52
|
+
* We can hide the transposed column, if we want
|
|
53
|
+
*/
|
|
54
|
+
if (hideTransposedColumn && column.columnId === synteticTransposedByColumnId) {
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
const transposedRow = {
|
|
58
|
+
// [transposed-by-column-id]: [other column id],
|
|
59
|
+
// the value can be set to friendlyname
|
|
60
|
+
[transposedFirstColumnField]: column.columnId,
|
|
61
|
+
[transposedFirstColumnHeader]: column.friendlyName,
|
|
62
|
+
};
|
|
63
|
+
for (let row of rowNodes) {
|
|
64
|
+
// [transposed-by-column-value[n]]: [other column value[n]]
|
|
65
|
+
const key = adaptable.api.gridApi.getNormalisedValueFromRowNode(row, transposeByColumnId);
|
|
66
|
+
// row[column.field]
|
|
67
|
+
let value = adaptable.api.gridApi.getDisplayValueFromRowNode(row, column.columnId);
|
|
68
|
+
if (value instanceof Date) {
|
|
69
|
+
value = value.toLocaleString();
|
|
70
|
+
}
|
|
71
|
+
transposedRow[key] = value;
|
|
72
|
+
}
|
|
73
|
+
transposedRows.push(transposedRow);
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
transposedColumns,
|
|
77
|
+
transposedRows,
|
|
78
|
+
};
|
|
79
|
+
}, [rowNodes, primaryKey, synteticTransposedByColumnId]);
|
|
80
|
+
React.useEffect(() => {
|
|
81
|
+
// Mounting in an effect, so the nodes are rendered/available
|
|
82
|
+
const hostAdaptableOptions = adaptable.adaptableOptions;
|
|
83
|
+
const adaptableOptions = {
|
|
84
|
+
primaryKey: transposedFirstColumnField,
|
|
85
|
+
licenseKey: hostAdaptableOptions.licenseKey,
|
|
86
|
+
userName: `${hostAdaptableOptions.userName}`,
|
|
87
|
+
adaptableId: `${hostAdaptableOptions.adaptableId}::TransposedView`,
|
|
88
|
+
containerOptions: {
|
|
89
|
+
adaptableContainer: adaptableContainerId,
|
|
90
|
+
agGridContainer: agGridContainerId,
|
|
91
|
+
},
|
|
92
|
+
entitlementOptions: {
|
|
93
|
+
defaultAccessLevel: 'Hidden',
|
|
94
|
+
},
|
|
95
|
+
layoutOptions: {
|
|
96
|
+
createDefaultLayout: false,
|
|
97
|
+
autoSizeColumnsInLayout: false,
|
|
98
|
+
},
|
|
99
|
+
predefinedConfig: {
|
|
100
|
+
Layout: {
|
|
101
|
+
Revision: Date.now(),
|
|
102
|
+
CurrentLayout: 'TransposedView',
|
|
103
|
+
Layouts: [
|
|
104
|
+
{
|
|
105
|
+
Name: 'TransposedView',
|
|
106
|
+
Columns: [
|
|
107
|
+
transposedFirstColumnHeader,
|
|
108
|
+
...transposedRowsAndColumns.transposedColumns.map((c) => c.colId),
|
|
109
|
+
],
|
|
110
|
+
PinnedColumnsMap: {
|
|
111
|
+
[transposedFirstColumnHeader]: 'left',
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
},
|
|
116
|
+
Theme: {
|
|
117
|
+
CurrentTheme: adaptable.api.themeApi.getCurrentTheme(),
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
const firstColumn = {
|
|
122
|
+
field: transposedFirstColumnHeader,
|
|
123
|
+
headerName: adaptable.api.columnApi.getFriendlyNameForColumnId(synteticTransposedByColumnId),
|
|
124
|
+
};
|
|
125
|
+
const agGridOptions = {
|
|
126
|
+
suppressLoadingOverlay: true,
|
|
127
|
+
defaultColDef: {
|
|
128
|
+
floatingFilter: false,
|
|
129
|
+
filter: false,
|
|
130
|
+
sortable: true,
|
|
131
|
+
resizable: true,
|
|
132
|
+
enableRowGroup: false,
|
|
133
|
+
editable: false,
|
|
134
|
+
enablePivot: false,
|
|
135
|
+
enableValue: false,
|
|
136
|
+
lockPinned: true,
|
|
137
|
+
menuTabs: [],
|
|
138
|
+
width: 120,
|
|
139
|
+
},
|
|
140
|
+
columnDefs: [
|
|
141
|
+
{
|
|
142
|
+
field: transposedFirstColumnField,
|
|
143
|
+
hide: true,
|
|
144
|
+
},
|
|
145
|
+
firstColumn,
|
|
146
|
+
...transposedRowsAndColumns.transposedColumns.map((col) => {
|
|
147
|
+
return {
|
|
148
|
+
field: col.colId,
|
|
149
|
+
type: null,
|
|
150
|
+
headerName: col.header,
|
|
151
|
+
};
|
|
152
|
+
}),
|
|
153
|
+
],
|
|
154
|
+
rowData: transposedRowsAndColumns.transposedRows,
|
|
155
|
+
sideBar: false,
|
|
156
|
+
};
|
|
157
|
+
const modules = adaptable.getAgGridRegisteredModules();
|
|
158
|
+
const adaptableInitFn = Object.getPrototypeOf(adaptable).constructor.init;
|
|
159
|
+
const agGridConfig = {
|
|
160
|
+
gridOptions: agGridOptions,
|
|
161
|
+
modules: modules,
|
|
162
|
+
};
|
|
163
|
+
let transposedAdaptableApi;
|
|
164
|
+
(async () => {
|
|
165
|
+
transposedAdaptableApi = await adaptableInitFn(adaptableOptions, agGridConfig);
|
|
166
|
+
adaptable.api.eventApi.on('ThemeChanged', (event) => {
|
|
167
|
+
transposedAdaptableApi.themeApi.loadTheme(typeof event.theme === 'object' ? event.theme.Name : event.theme);
|
|
168
|
+
});
|
|
169
|
+
})();
|
|
170
|
+
return () => {
|
|
171
|
+
if (transposedAdaptableApi) {
|
|
172
|
+
transposedAdaptableApi.destroy();
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
}, [synteticTransposedByColumnId]);
|
|
176
|
+
/**
|
|
177
|
+
* Need to get all data, manualy pivot the grid using the primary key.
|
|
178
|
+
*
|
|
179
|
+
* 1. get the data, and pivot using the primary key
|
|
180
|
+
* 2. create the col definitios, a col definition for each row
|
|
181
|
+
* 3. create the grid
|
|
182
|
+
*/
|
|
183
|
+
return (React.createElement(Flex, { flexDirection: "column", width: "100%", height: "100%" },
|
|
184
|
+
React.createElement(Panel, null,
|
|
185
|
+
React.createElement(FormLayout, null,
|
|
186
|
+
React.createElement(FormRow, { label: "Elevated Column" },
|
|
187
|
+
React.createElement(ColumnSelector, { value: synteticTransposedByColumnId, onChange: (colId) => {
|
|
188
|
+
setSynteticTransposedByColumnId(colId);
|
|
189
|
+
} })))),
|
|
190
|
+
React.createElement(Flex, { height: "100%" },
|
|
191
|
+
React.createElement(Box, { id: "transposed-adaptable-container" }),
|
|
192
|
+
React.createElement(Box, { height: "100%", width: "100%", id: "transposed-adaptable-ag-grid-container" }))));
|
|
193
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useSelector } from 'react-redux';
|
|
3
3
|
import { DataSource, InfiniteTable } from '../../components/InfiniteTable';
|
|
4
|
-
import {
|
|
4
|
+
import { GetAllNotesSelector } from '../../Redux/ActionsReducers/NotesRedux';
|
|
5
5
|
import { useAdaptable } from '../AdaptableContext';
|
|
6
6
|
import { AdaptableButtonComponent } from '../Components/AdaptableButton';
|
|
7
7
|
import { PopupPanel } from '../Components/Popups/AdaptablePopup/PopupPanel';
|
|
@@ -15,7 +15,7 @@ const tableDOMProps = {
|
|
|
15
15
|
export const NotesPopup = (props) => {
|
|
16
16
|
const adaptable = useAdaptable();
|
|
17
17
|
const primaryKeyHeader = adaptable.api.columnApi.getFriendlyNameForColumnId(adaptable.api.columnApi.getPrimaryKeyColumn().columnId);
|
|
18
|
-
const allNotes = useSelector((state) =>
|
|
18
|
+
const allNotes = useSelector((state) => GetAllNotesSelector(state.Notes));
|
|
19
19
|
const columnsMap = React.useMemo(() => {
|
|
20
20
|
const columns = {
|
|
21
21
|
primaryKey: {
|
|
@@ -24,13 +24,14 @@ export const NotesPopup = (props) => {
|
|
|
24
24
|
},
|
|
25
25
|
column: {
|
|
26
26
|
field: 'ColumnId',
|
|
27
|
+
header: 'Column',
|
|
27
28
|
valueGetter: (params) => {
|
|
28
29
|
return adaptable.api.columnApi.getFriendlyNameForColumnId(params.data.ColumnId);
|
|
29
30
|
},
|
|
30
31
|
},
|
|
31
|
-
|
|
32
|
-
field: '
|
|
33
|
-
header: '
|
|
32
|
+
text: {
|
|
33
|
+
field: 'Text',
|
|
34
|
+
header: 'Text',
|
|
34
35
|
defaultEditable: true,
|
|
35
36
|
defaultFlex: 3,
|
|
36
37
|
},
|
|
@@ -40,10 +41,6 @@ export const NotesPopup = (props) => {
|
|
|
40
41
|
return new Date(params.data.Timestamp).toDateString();
|
|
41
42
|
},
|
|
42
43
|
},
|
|
43
|
-
author: {
|
|
44
|
-
header: 'Author',
|
|
45
|
-
valueGetter: (params) => params.data.Author.UserName,
|
|
46
|
-
},
|
|
47
44
|
delete: {
|
|
48
45
|
defaultWidth: 50,
|
|
49
46
|
render: (params) => {
|
|
@@ -64,8 +61,8 @@ export const NotesPopup = (props) => {
|
|
|
64
61
|
if (change.type === 'update') {
|
|
65
62
|
const data = change.data;
|
|
66
63
|
const prevNote = allNotes.find((x) => x.Uuid === uuid);
|
|
67
|
-
if (prevNote.
|
|
68
|
-
adaptable.api.notesApi.updateNoteText(data.
|
|
64
|
+
if (prevNote.Text !== data.Text) {
|
|
65
|
+
adaptable.api.notesApi.updateNoteText(data.Text, prevNote);
|
|
69
66
|
}
|
|
70
67
|
}
|
|
71
68
|
}
|
|
@@ -76,6 +73,7 @@ export const NotesPopup = (props) => {
|
|
|
76
73
|
align: 'start',
|
|
77
74
|
defaultFlex: 1,
|
|
78
75
|
defaultSortable: false,
|
|
76
|
+
style: { fontSize: 'var(--ab-font-size-3)' },
|
|
79
77
|
},
|
|
80
78
|
}, headerOptions: {
|
|
81
79
|
alwaysReserveSpaceForSortIcon: false,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { useDispatch } from 'react-redux';
|
|
2
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
3
3
|
import { Select } from '../../components/Select';
|
|
4
4
|
import * as ThemeRedux from '../../Redux/ActionsReducers/ThemeRedux';
|
|
5
5
|
import { ThemeModuleId } from '../../Utilities/Constants/ModuleConstants';
|
|
@@ -8,6 +8,7 @@ export const ThemeSelector = (props) => {
|
|
|
8
8
|
const adaptable = useAdaptable();
|
|
9
9
|
const dispatch = useDispatch();
|
|
10
10
|
const availableThemes = adaptable.api.themeApi.getThemes();
|
|
11
|
+
const currentTheme = useSelector((state) => state.Theme.CurrentTheme);
|
|
11
12
|
const disabled = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule(ThemeModuleId) === 'ReadOnly';
|
|
12
13
|
const optionThemes = availableThemes.map((theme) => {
|
|
13
14
|
if (typeof theme === 'string') {
|
|
@@ -22,8 +23,7 @@ export const ThemeSelector = (props) => {
|
|
|
22
23
|
label: theme.Description,
|
|
23
24
|
};
|
|
24
25
|
});
|
|
25
|
-
|
|
26
|
-
return (React.createElement(Select, { "data-name": "select-theme-dropdown", options: optionThemes, value: theme.Name, disabled: disabled, size: props.size, onChange: (themeName) => {
|
|
26
|
+
return (React.createElement(Select, { "data-name": "select-theme-dropdown", searchable: false, options: optionThemes, value: currentTheme, disabled: disabled, size: props.size, onChange: (themeName) => {
|
|
27
27
|
dispatch(ThemeRedux.ThemeSelect(themeName));
|
|
28
28
|
} }));
|
|
29
29
|
};
|
package/src/agGrid/Adaptable.js
CHANGED
|
@@ -1923,7 +1923,7 @@ export class Adaptable {
|
|
|
1923
1923
|
if (column.dataType == 'String' && this.api.predicateApi.useCaseSensitivity()) {
|
|
1924
1924
|
uniqueVals = uniqBy(uniqueVals, (d) => d.displayValue.toLowerCase());
|
|
1925
1925
|
}
|
|
1926
|
-
return uniqueVals.slice(0, this.
|
|
1926
|
+
return uniqueVals.slice(0, this.api.columnFilterApi.getMaxFilterValue(column));
|
|
1927
1927
|
}
|
|
1928
1928
|
getGridCellsForPermittedValues(column, distinctValuesParams) {
|
|
1929
1929
|
var _a;
|
|
@@ -2061,7 +2061,7 @@ export class Adaptable {
|
|
|
2061
2061
|
eachFn(rowNode, columnId);
|
|
2062
2062
|
});
|
|
2063
2063
|
}
|
|
2064
|
-
return returnArray.slice(0, this.
|
|
2064
|
+
return returnArray.slice(0, this.api.columnFilterApi.getMaxFilterValue(abColumn));
|
|
2065
2065
|
}
|
|
2066
2066
|
addDistinctColumnValue(rowNode, columnId) {
|
|
2067
2067
|
// we do not return the values of the aggregates when in grouping mode
|
|
@@ -3,7 +3,7 @@ import { iconToString } from '../components/icons';
|
|
|
3
3
|
import flatten from 'lodash/flatten';
|
|
4
4
|
import { isAdaptableElementIcon } from '../components/Icon';
|
|
5
5
|
import { logDeprecation } from '../Utilities/logDeprecation';
|
|
6
|
-
import {
|
|
6
|
+
import { DEFAULT_ADAPTABLE_COLUMN_MENU_STRUCTURE, DEFAULT_ADAPTABLE_CONTEXT_MENU_STRUCTURE, } from '../AdaptableOptions/MenuOptions';
|
|
7
7
|
// tslint:disable-next-line: class-name
|
|
8
8
|
export class agGridMenuHelper {
|
|
9
9
|
constructor(adaptable, gridOptions) {
|
|
@@ -65,7 +65,7 @@ export class agGridMenuHelper {
|
|
|
65
65
|
const menuContext = this.createColumnMenuContextObject(adaptableColumn, params.column);
|
|
66
66
|
const adaptableMenuItems = this.createAdaptableColumnMenuItems(menuContext);
|
|
67
67
|
// sort Adaptable menu items by default order
|
|
68
|
-
const structuredAdaptableMenuItems = this.buildGroupedModuleItems(
|
|
68
|
+
const structuredAdaptableMenuItems = this.buildGroupedModuleItems(DEFAULT_ADAPTABLE_COLUMN_MENU_STRUCTURE, adaptableMenuItems);
|
|
69
69
|
// 1. first check if there is a custom column menu defined
|
|
70
70
|
if (typeof menuOptions.customColumnMenu === 'function') {
|
|
71
71
|
const defaultAgGridMenuItems = agGridMenuItems.map((itemName) => ({
|
|
@@ -334,8 +334,8 @@ export class agGridMenuHelper {
|
|
|
334
334
|
const adaptableMenuItems = this.getAdaptableMenuItemsColumnHeader(adaptableColumn, menuContext);
|
|
335
335
|
// sort Adaptable menu items by default order
|
|
336
336
|
adaptableMenuItems.sort((first, second) => {
|
|
337
|
-
const firstPriority =
|
|
338
|
-
const secondPriority =
|
|
337
|
+
const firstPriority = DEFAULT_ADAPTABLE_COLUMN_MENU_STRUCTURE.indexOf(first.module);
|
|
338
|
+
const secondPriority = DEFAULT_ADAPTABLE_COLUMN_MENU_STRUCTURE.indexOf(second.module);
|
|
339
339
|
return firstPriority - secondPriority;
|
|
340
340
|
});
|
|
341
341
|
// And then convert them into Menu Item Defs
|
|
@@ -10,6 +10,8 @@ export type SelectProps<SelectValue extends unknown, IsMulti extends boolean = f
|
|
|
10
10
|
options: readonly SelectOption<SelectValue>[] | SelectOption<SelectValue>[];
|
|
11
11
|
disabled?: boolean;
|
|
12
12
|
menuPosition?: 'fixed' | 'absolute';
|
|
13
|
+
menuPlacement?: 'auto' | 'bottom' | 'top';
|
|
14
|
+
searchable?: boolean;
|
|
13
15
|
isClearable?: boolean;
|
|
14
16
|
isMulti?: IsMulti;
|
|
15
17
|
onChange: (value: IsMulti extends true ? SelectValue[] : SelectValue) => void;
|
|
@@ -12,7 +12,7 @@ const commonStyles = ({ isFocused, isDisabled, }) => {
|
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
export const Select = function (props) {
|
|
15
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
15
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
16
16
|
const doesOptionMatchValue = function (option) {
|
|
17
17
|
if (typeof option.value === 'object' && option.value instanceof Date) {
|
|
18
18
|
return isSameDay(option.value, props.value);
|
|
@@ -80,7 +80,7 @@ export const Select = function (props) {
|
|
|
80
80
|
React.createElement(Icon, { name: "triangle-down", style: { height: 20, width: 20 } })));
|
|
81
81
|
};
|
|
82
82
|
}, []);
|
|
83
|
-
return (React.createElement(SelectComponent, { onInputChange: props.onInputChange, onFocus: props.onFocus, isLoading: props.isLoding, options: props.options, className: props.className, isDisabled: disabled, isMulti: props.isMulti, value: selectedOption, menuPosition: (
|
|
83
|
+
return (React.createElement(SelectComponent, { onInputChange: props.onInputChange, onFocus: props.onFocus, isLoading: props.isLoding, options: props.options, className: props.className, isDisabled: disabled, menuPlacement: (_g = props.menuPlacement) !== null && _g !== void 0 ? _g : 'auto', isSearchable: props.searchable, isMulti: props.isMulti, value: selectedOption, menuPosition: (_h = props.menuPosition) !== null && _h !== void 0 ? _h : 'absolute',
|
|
84
84
|
// This needed so the menu is not clipped by overflow: hidden
|
|
85
85
|
menuPortalTarget: document.body, isClearable: props.isClearable, onChange: (option) => {
|
|
86
86
|
if (props.isMulti) {
|
package/src/env.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
INFINITE_TABLE_LICENSE_KEY: "StartDate=2021-06-29|EndDate=2030-01-01|Owner=Adaptable|Type=distribution|TS=1624971462479|C=137829811,1004007071,2756196225,1839832928,3994409405,636616862" || '',
|
|
3
|
-
PUBLISH_TIMESTAMP:
|
|
4
|
-
VERSION: "18.0.0-canary.
|
|
3
|
+
PUBLISH_TIMESTAMP: 1710512529508 || Date.now(),
|
|
4
|
+
VERSION: "18.0.0-canary.4" || '--current-version--',
|
|
5
5
|
};
|
|
@@ -1927,6 +1927,22 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
1927
1927
|
ref: string;
|
|
1928
1928
|
})[];
|
|
1929
1929
|
};
|
|
1930
|
+
CommentableCellContext: {
|
|
1931
|
+
name: string;
|
|
1932
|
+
kind: string;
|
|
1933
|
+
desc: string;
|
|
1934
|
+
};
|
|
1935
|
+
CommentsOptions: {
|
|
1936
|
+
name: string;
|
|
1937
|
+
kind: string;
|
|
1938
|
+
desc: string;
|
|
1939
|
+
props: {
|
|
1940
|
+
name: string;
|
|
1941
|
+
kind: string;
|
|
1942
|
+
desc: string;
|
|
1943
|
+
isOpt: boolean;
|
|
1944
|
+
}[];
|
|
1945
|
+
};
|
|
1930
1946
|
CompatibleContext: {
|
|
1931
1947
|
name: string;
|
|
1932
1948
|
kind: string;
|
|
@@ -3659,6 +3675,18 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
3659
3675
|
kind: string;
|
|
3660
3676
|
desc: string;
|
|
3661
3677
|
};
|
|
3678
|
+
InteropioPluginOptions: {
|
|
3679
|
+
name: string;
|
|
3680
|
+
kind: string;
|
|
3681
|
+
desc: string;
|
|
3682
|
+
props: {
|
|
3683
|
+
name: string;
|
|
3684
|
+
kind: string;
|
|
3685
|
+
desc: string;
|
|
3686
|
+
isOpt: boolean;
|
|
3687
|
+
defVal: string;
|
|
3688
|
+
}[];
|
|
3689
|
+
};
|
|
3662
3690
|
IPushPullDomain: {
|
|
3663
3691
|
name: string;
|
|
3664
3692
|
kind: string;
|
|
@@ -3955,7 +3983,7 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
3955
3983
|
isOpt: boolean;
|
|
3956
3984
|
}[];
|
|
3957
3985
|
};
|
|
3958
|
-
|
|
3986
|
+
NotesState: {
|
|
3959
3987
|
name: string;
|
|
3960
3988
|
kind: string;
|
|
3961
3989
|
desc: string;
|
|
@@ -4512,7 +4540,7 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
4512
4540
|
isOpt?: undefined;
|
|
4513
4541
|
})[];
|
|
4514
4542
|
};
|
|
4515
|
-
|
|
4543
|
+
Report: {
|
|
4516
4544
|
name: string;
|
|
4517
4545
|
kind: string;
|
|
4518
4546
|
desc: string;
|