@adaptabletools/adaptable-cjs 18.0.0-canary.22 → 18.0.0-canary.23
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 +2 -0
- package/base.css.map +1 -1
- package/index.css +4 -0
- package/index.css.map +1 -1
- package/package.json +1 -1
- package/src/AdaptableOptions/CommentOptions.d.ts +3 -3
- package/src/AdaptableOptions/DataImportOptions.d.ts +2 -2
- package/src/AdaptableOptions/GroupingOptions.d.ts +0 -15
- package/src/Api/CommentApi.d.ts +12 -13
- package/src/Api/Implementation/CommentsApiImpl.d.ts +3 -3
- package/src/Api/Implementation/CommentsApiImpl.js +5 -5
- package/src/Redux/ActionsReducers/CommentsRedux.d.ts +0 -4
- package/src/Redux/ActionsReducers/CommentsRedux.js +1 -39
- package/src/Redux/Store/AdaptableStore.js +4 -4
- package/src/Strategy/CommentModule.d.ts +0 -1
- package/src/Strategy/CommentModule.js +7 -7
- package/src/View/Comments/CommentsEditor.js +4 -6
- package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +9 -1
- package/src/agGrid/AdaptableAgGrid.d.ts +1 -10
- package/src/agGrid/AdaptableAgGrid.js +9 -39
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +0 -10
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +1 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { AdaptableColumn, BaseContext } from '../../types';
|
|
2
|
-
import { KeyCreatorParams } from '@ag-grid-community/core';
|
|
3
1
|
/**
|
|
4
2
|
* Options for managing Row and Column Groups in AdapTable
|
|
5
3
|
*/
|
|
@@ -19,16 +17,3 @@ export interface GroupingOptions<TData = any> {
|
|
|
19
17
|
*/
|
|
20
18
|
autoOrderGroupedColumns?: boolean;
|
|
21
19
|
}
|
|
22
|
-
/**
|
|
23
|
-
* Context used when setting a value for Balanced Row Groups
|
|
24
|
-
*/
|
|
25
|
-
export interface BalancedGroupsKeyContext<TData = any> extends BaseContext {
|
|
26
|
-
/**
|
|
27
|
-
* AdapTable Column being grouped
|
|
28
|
-
*/
|
|
29
|
-
adaptableColumn: AdaptableColumn<TData>;
|
|
30
|
-
/**
|
|
31
|
-
* AG Grid's Key Creator Params
|
|
32
|
-
*/
|
|
33
|
-
params: KeyCreatorParams<TData>;
|
|
34
|
-
}
|
package/src/Api/CommentApi.d.ts
CHANGED
|
@@ -24,34 +24,33 @@ export interface CommentApi {
|
|
|
24
24
|
*/
|
|
25
25
|
deleteComment(comment: AdaptableComment, cellAddress: CellAddress): void;
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
27
|
+
* Create a new Comment Thread
|
|
28
|
+
*
|
|
29
|
+
* @param commentThread
|
|
29
30
|
*/
|
|
30
|
-
|
|
31
|
+
addCommentThread(commentThread: CommentThread): void;
|
|
31
32
|
/**
|
|
32
33
|
* Delete all Comments for a particular cell
|
|
33
34
|
* @param cellAddress
|
|
34
35
|
*/
|
|
35
36
|
deleteCommentThread(cellAddress: CellAddress): void;
|
|
36
37
|
/**
|
|
37
|
-
* Return
|
|
38
|
+
* Return the Comment Thread for a particular cell
|
|
38
39
|
* @param cellAddress
|
|
39
40
|
*/
|
|
40
41
|
getCommentThread(cellAddress: CellAddress): CommentThread | undefined;
|
|
41
42
|
/**
|
|
42
|
-
* Return all Comment Threads
|
|
43
|
+
* Return all Comment Threads in the grid
|
|
43
44
|
*/
|
|
44
|
-
|
|
45
|
+
getGridComments(): CommentThread[];
|
|
45
46
|
/**
|
|
46
|
-
*
|
|
47
|
+
* Sets the Comment Threads in the grid
|
|
47
48
|
*
|
|
48
|
-
* @param
|
|
49
|
+
* @param commentThreads new cell comments
|
|
49
50
|
*/
|
|
50
|
-
|
|
51
|
+
setGridComments(commentThreads: CommentThread[]): void;
|
|
51
52
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* @param commentThreads new cell comments
|
|
53
|
+
* Clear all Comment Threads in the grid
|
|
55
54
|
*/
|
|
56
|
-
|
|
55
|
+
clearGridComments(): void;
|
|
57
56
|
}
|
|
@@ -6,13 +6,13 @@ import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
|
|
|
6
6
|
export declare class CommentsApiImpl extends ApiBase implements CommentApi {
|
|
7
7
|
internalApi: CommentsInternalApi;
|
|
8
8
|
constructor(adaptable: IAdaptable);
|
|
9
|
-
getComments(address: CellAddress): AdaptableComment[];
|
|
10
9
|
getCommentThread(address: CellAddress): CommentThread | undefined;
|
|
11
|
-
|
|
10
|
+
getGridComments(): CommentThread[];
|
|
12
11
|
editComment(comment: AdaptableComment, address: CellAddress): void;
|
|
13
12
|
deleteComment(comment: AdaptableComment, address: CellAddress): void;
|
|
14
13
|
addComment(commentText: AdaptableComment['Value'], address: CellAddress): void;
|
|
15
14
|
addCommentThread(commentThread: CommentThread): void;
|
|
16
15
|
deleteCommentThread(cellAddress: CellAddress): void;
|
|
17
|
-
|
|
16
|
+
setGridComments(cellComments: CommentThread[]): void;
|
|
17
|
+
clearGridComments(): void;
|
|
18
18
|
}
|
|
@@ -12,13 +12,10 @@ class CommentsApiImpl extends ApiBase_1.ApiBase {
|
|
|
12
12
|
super(adaptable);
|
|
13
13
|
this.internalApi = new CommentsInternalApi_1.CommentsInternalApi(adaptable);
|
|
14
14
|
}
|
|
15
|
-
getComments(address) {
|
|
16
|
-
return CommentRedux.GetCommentsSelector(this.getAdaptableState().Comment, address);
|
|
17
|
-
}
|
|
18
15
|
getCommentThread(address) {
|
|
19
16
|
return CommentRedux.GetCellCommentSelector(this.getAdaptableState().Comment, address);
|
|
20
17
|
}
|
|
21
|
-
|
|
18
|
+
getGridComments() {
|
|
22
19
|
var _a;
|
|
23
20
|
return (_a = this.getAdaptableState().Comment.CommentThreads) !== null && _a !== void 0 ? _a : [];
|
|
24
21
|
}
|
|
@@ -45,8 +42,11 @@ class CommentsApiImpl extends ApiBase_1.ApiBase {
|
|
|
45
42
|
deleteCommentThread(cellAddress) {
|
|
46
43
|
this.dispatchAction(CommentRedux.CommentsCellDelete({ cellAddress }));
|
|
47
44
|
}
|
|
48
|
-
|
|
45
|
+
setGridComments(cellComments) {
|
|
49
46
|
this.dispatchAction(CommentRedux.CommentsSet({ commentThread: cellComments }));
|
|
50
47
|
}
|
|
48
|
+
clearGridComments() {
|
|
49
|
+
this.setGridComments([]);
|
|
50
|
+
}
|
|
51
51
|
}
|
|
52
52
|
exports.CommentsApiImpl = CommentsApiImpl;
|
|
@@ -71,9 +71,5 @@ export declare const CommentsDelete: ({ commentUuid, cellAddress, }: {
|
|
|
71
71
|
commentUuid: AdaptableComment['Uuid'];
|
|
72
72
|
cellAddress: CellAddress;
|
|
73
73
|
}) => AdaptableCommentsDeleteAction;
|
|
74
|
-
export declare const CommentsReady: (commentstate: CommentState) => NoteReadyAction;
|
|
75
|
-
export declare const GetGridCellCommentsSelector: (state: CommentState, address: CellAddress) => CommentThread;
|
|
76
|
-
export declare const GetCommentsSelector: (state: CommentState, address: CellAddress) => AdaptableComment[] | undefined;
|
|
77
|
-
export declare const GetGetCommentsByUuidSelector: (state: CommentState, uuid: string) => AdaptableComment | undefined;
|
|
78
74
|
export declare const GetCellCommentSelector: (state: CommentState, address: CellAddress) => CommentThread | undefined;
|
|
79
75
|
export declare const CommentsReducer: Redux.Reducer<CommentState>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CommentsReducer = exports.GetCellCommentSelector = exports.
|
|
3
|
+
exports.CommentsReducer = exports.GetCellCommentSelector = exports.CommentsDelete = exports.CommentsEdit = exports.CommentsCellDelete = exports.CommentsCellAdd = exports.CommentsAdd = exports.CommentsSet = exports.COMMENTS_LOAD = exports.COMMENTS_READY = exports.COMMENTS_DELETE = exports.COMMENTS_EDIT = exports.COMMENTS_CELL_DELETE = exports.COMMENTS_CELL_ADD = exports.COMMENTS_ADD = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
|
|
6
6
|
const ObjectFactory_1 = tslib_1.__importDefault(require("../../Utilities/ObjectFactory"));
|
|
@@ -63,44 +63,6 @@ const CommentsDelete = ({ commentUuid, cellAddress, }) => ({
|
|
|
63
63
|
commentUuid,
|
|
64
64
|
});
|
|
65
65
|
exports.CommentsDelete = CommentsDelete;
|
|
66
|
-
const CommentsReady = (commentstate) => ({
|
|
67
|
-
type: exports.COMMENTS_READY,
|
|
68
|
-
commentState: commentstate,
|
|
69
|
-
});
|
|
70
|
-
exports.CommentsReady = CommentsReady;
|
|
71
|
-
const GetGridCellCommentsSelector = (state, address) => {
|
|
72
|
-
var _a;
|
|
73
|
-
if (!address) {
|
|
74
|
-
return null;
|
|
75
|
-
}
|
|
76
|
-
return ((_a = state === null || state === void 0 ? void 0 : state.CommentThreads) !== null && _a !== void 0 ? _a : []).find((cellComments) => {
|
|
77
|
-
return CellPopupService_1.CellPopupService.isSameAddress(cellComments, address);
|
|
78
|
-
});
|
|
79
|
-
};
|
|
80
|
-
exports.GetGridCellCommentsSelector = GetGridCellCommentsSelector;
|
|
81
|
-
const GetCommentsSelector = (state, address) => {
|
|
82
|
-
var _a, _b;
|
|
83
|
-
if (!address) {
|
|
84
|
-
return [];
|
|
85
|
-
}
|
|
86
|
-
const comments = (_b = ((_a = state === null || state === void 0 ? void 0 : state.CommentThreads) !== null && _a !== void 0 ? _a : []).find((cellComments) => {
|
|
87
|
-
return CellPopupService_1.CellPopupService.isSameAddress(cellComments, address);
|
|
88
|
-
})) === null || _b === void 0 ? void 0 : _b.Comments;
|
|
89
|
-
return comments;
|
|
90
|
-
};
|
|
91
|
-
exports.GetCommentsSelector = GetCommentsSelector;
|
|
92
|
-
const GetGetCommentsByUuidSelector = (state, uuid) => {
|
|
93
|
-
var _a;
|
|
94
|
-
for (const commentThread of (_a = state.CommentThreads) !== null && _a !== void 0 ? _a : []) {
|
|
95
|
-
for (const comment of commentThread.Comments) {
|
|
96
|
-
if (comment.Uuid === uuid) {
|
|
97
|
-
return comment;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
return undefined;
|
|
102
|
-
};
|
|
103
|
-
exports.GetGetCommentsByUuidSelector = GetGetCommentsByUuidSelector;
|
|
104
66
|
const GetCellCommentSelector = (state, address) => {
|
|
105
67
|
var _a;
|
|
106
68
|
if (!address) {
|
|
@@ -913,8 +913,8 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
913
913
|
adaptable.refreshCells([node], [columnId], true);
|
|
914
914
|
requestAnimationFrame(() => {
|
|
915
915
|
var _a, _b;
|
|
916
|
-
const commentThreads = adaptable.api.commentApi.
|
|
917
|
-
adaptable.api.eventApi.emit('CommentChanged', adaptable.api.commentApi.
|
|
916
|
+
const commentThreads = adaptable.api.commentApi.getGridComments();
|
|
917
|
+
adaptable.api.eventApi.emit('CommentChanged', adaptable.api.commentApi.getGridComments());
|
|
918
918
|
(_b = (_a = adaptable.api.optionsApi
|
|
919
919
|
.getCommentOptions()) === null || _a === void 0 ? void 0 : _a.persistCommentThreads) === null || _b === void 0 ? void 0 : _b.call(_a, commentThreads);
|
|
920
920
|
});
|
|
@@ -922,9 +922,9 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
922
922
|
return returnAction;
|
|
923
923
|
}
|
|
924
924
|
case CommentsRedux.COMMENTS_LOAD: {
|
|
925
|
-
const previousCommentThreads = adaptable.api.commentApi.
|
|
925
|
+
const previousCommentThreads = adaptable.api.commentApi.getGridComments();
|
|
926
926
|
let returnAction = next(action);
|
|
927
|
-
const newCommentThreads = (_j = adaptable.api.commentApi.
|
|
927
|
+
const newCommentThreads = (_j = adaptable.api.commentApi.getGridComments()) !== null && _j !== void 0 ? _j : [];
|
|
928
928
|
requestAnimationFrame(() => {
|
|
929
929
|
let addedCommentThreads = [];
|
|
930
930
|
let deletedCommentThreads = [];
|
|
@@ -3,7 +3,6 @@ import { AdaptableMenuItem, ContextMenuContext } from '../PredefinedConfig/Commo
|
|
|
3
3
|
import { AdaptableModuleBase } from './AdaptableModuleBase';
|
|
4
4
|
import { IModule } from './Interface/IModule';
|
|
5
5
|
export declare class CommentModule extends AdaptableModuleBase implements IModule {
|
|
6
|
-
private adaptable;
|
|
7
6
|
constructor(api: AdaptableApi);
|
|
8
7
|
onAdaptableReady(): void;
|
|
9
8
|
isModuleAvailable(): boolean;
|
|
@@ -26,7 +26,7 @@ class CommentModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
26
26
|
var _a, _b;
|
|
27
27
|
const commentThreads = await ((_b = (_a = this.api.optionsApi
|
|
28
28
|
.getCommentOptions()) === null || _a === void 0 ? void 0 : _a.loadCommentThreads) === null || _b === void 0 ? void 0 : _b.call(_a, (0, ObjectFactory_1.createBaseContext)(this.api)));
|
|
29
|
-
this.api.commentApi.
|
|
29
|
+
this.api.commentApi.setGridComments(commentThreads);
|
|
30
30
|
}
|
|
31
31
|
addContextMenuItems(menuContext) {
|
|
32
32
|
var _a, _b;
|
|
@@ -42,17 +42,17 @@ class CommentModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
42
42
|
return items;
|
|
43
43
|
}
|
|
44
44
|
getAddRemoveCommentsMenuItems(menuContext) {
|
|
45
|
+
var _a;
|
|
45
46
|
const items = [];
|
|
46
|
-
|
|
47
|
+
if (!this.api.commentApi.internalApi.areCommentsAvailable()) {
|
|
48
|
+
return items;
|
|
49
|
+
}
|
|
47
50
|
const cellAddress = {
|
|
48
51
|
PrimaryKeyValue: menuContext.primaryKeyValue,
|
|
49
52
|
ColumnId: menuContext.adaptableColumn.columnId,
|
|
50
53
|
};
|
|
51
|
-
const
|
|
52
|
-
if (
|
|
53
|
-
return items;
|
|
54
|
-
}
|
|
55
|
-
if (comments) {
|
|
54
|
+
const cellComments = (_a = this.api.commentApi.getCommentThread(cellAddress)) === null || _a === void 0 ? void 0 : _a.Comments;
|
|
55
|
+
if (cellComments) {
|
|
56
56
|
items.push(this.createMenuItemClickFunction('comment-remove', 'Remove Comment', this.moduleInfo.Glyph, () => {
|
|
57
57
|
this.api.commentApi.deleteCommentThread(cellAddress);
|
|
58
58
|
}));
|
|
@@ -66,13 +66,11 @@ const CommentsEditor = (props) => {
|
|
|
66
66
|
const isOwnComment = ((_a = comment === null || comment === void 0 ? void 0 : comment.Author) === null || _a === void 0 ? void 0 : _a.UserName)
|
|
67
67
|
? ((_b = comment === null || comment === void 0 ? void 0 : comment.Author) === null || _b === void 0 ? void 0 : _b.UserName) === userId
|
|
68
68
|
: true; // no owner means it's the current user
|
|
69
|
-
return (React.createElement(rebass_1.Box, { p: 2, key: (_c = comment.Uuid) !== null && _c !== void 0 ? _c : index,
|
|
70
|
-
borderBottom: '1px solid var(--ab-color-primarydark)',
|
|
71
|
-
} },
|
|
69
|
+
return (React.createElement(rebass_1.Box, { p: 2, key: (_c = comment.Uuid) !== null && _c !== void 0 ? _c : index, className: "ab-Comment" },
|
|
72
70
|
React.createElement(rebass_1.Flex, { mb: 2, alignItems: "center" },
|
|
73
71
|
React.createElement(rebass_1.Box, null,
|
|
74
|
-
React.createElement(rebass_1.Box, { fontSize: 3, fontWeight: "bold" }, (_d = comment === null || comment === void 0 ? void 0 : comment.Author) === null || _d === void 0 ? void 0 : _d.UserName),
|
|
75
|
-
comment.Timestamp && (React.createElement(rebass_1.Box, { fontSize: 2 }, (0, dateUtils_1.formatDate)(comment.Timestamp, 'MM.DD.YYYY HH:mm')))),
|
|
72
|
+
React.createElement(rebass_1.Box, { "data-name": "comment-username", fontSize: 3, fontWeight: "bold" }, (_d = comment === null || comment === void 0 ? void 0 : comment.Author) === null || _d === void 0 ? void 0 : _d.UserName),
|
|
73
|
+
comment.Timestamp && (React.createElement(rebass_1.Box, { "data-name": "comment-timestamp", fontSize: 2 }, (0, dateUtils_1.formatDate)(comment.Timestamp, 'MM.DD.YYYY HH:mm')))),
|
|
76
74
|
React.createElement(rebass_1.Box, { flex: 1 }),
|
|
77
75
|
React.createElement(SimpleButton_1.default, { variant: "text", icon: "edit", disabled: !isOwnComment || isReadOnlyModule, onClick: () => setActiveEditingComment(comment.Uuid) }),
|
|
78
76
|
React.createElement(SimpleButton_1.default, { variant: "text", icon: "delete", disabled: !isOwnComment || isReadOnlyModule, onClick: () => {
|
|
@@ -87,7 +85,7 @@ const CommentsEditor = (props) => {
|
|
|
87
85
|
}
|
|
88
86
|
}, onChange: (event) => {
|
|
89
87
|
adaptable.api.commentApi.editComment(Object.assign(Object.assign({}, comment), { Value: event.target.value }), cellAddress);
|
|
90
|
-
} })) : (React.createElement(rebass_1.Text,
|
|
88
|
+
} })) : (React.createElement(rebass_1.Text, { "data-name": "comment-text" }, comment.Value)))));
|
|
91
89
|
})),
|
|
92
90
|
React.createElement(AdaptableInput_1.default, { autoFocus: !comments || comments.length === 0, value: newCommentText, disabled: isReadOnlyModule, onChange: (event) => {
|
|
93
91
|
setNewCommentText(event.target.value);
|
|
@@ -24,7 +24,7 @@ const useMenuItems = () => {
|
|
|
24
24
|
item.module !== 'CustomSettingsPanel' &&
|
|
25
25
|
!DefaultSettingsPanel_1.STANDALONE_MODULE_POPUPS.includes(item.module) &&
|
|
26
26
|
item.isVisible);
|
|
27
|
-
|
|
27
|
+
let navItems = navigationItems
|
|
28
28
|
.map((moduleName) => {
|
|
29
29
|
var _a, _b;
|
|
30
30
|
if (moduleName === '-') {
|
|
@@ -44,6 +44,14 @@ const useMenuItems = () => {
|
|
|
44
44
|
return customPanelMenuItem || visibleItems.find((item) => item.module === moduleName);
|
|
45
45
|
})
|
|
46
46
|
.filter(Boolean);
|
|
47
|
+
// remove sequential '-' items
|
|
48
|
+
navItems = navItems.filter((item, index) => {
|
|
49
|
+
if (item === '-' && navItems[index - 1] === '-') {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
return true;
|
|
53
|
+
});
|
|
54
|
+
return navItems;
|
|
47
55
|
}, [allMenuItems]);
|
|
48
56
|
};
|
|
49
57
|
exports.useMenuItems = useMenuItems;
|
|
@@ -58,7 +58,7 @@ export declare class AdaptableAgGrid implements IAdaptable {
|
|
|
58
58
|
* once layouts are properly handled with the new aggrid methods & events
|
|
59
59
|
* we can remove this hack
|
|
60
60
|
*/
|
|
61
|
-
private
|
|
61
|
+
private previousAgGridLayoutState;
|
|
62
62
|
_rawAdaptableOptions: AdaptableOptions;
|
|
63
63
|
adaptableOptions: AdaptableOptions;
|
|
64
64
|
_isDetailGrid: boolean;
|
|
@@ -310,15 +310,6 @@ export declare class AdaptableAgGrid implements IAdaptable {
|
|
|
310
310
|
getChartRef(chartId: string): ChartRef;
|
|
311
311
|
setLayout(layout?: Layout): void;
|
|
312
312
|
private getActiveAdaptableAggFuncForCol;
|
|
313
|
-
/**
|
|
314
|
-
* Setting layout works by modifing the column state.
|
|
315
|
-
* The column state is based on the current existing columns.
|
|
316
|
-
* At this point the column groups do not exist, and the widths from layout are not applied.
|
|
317
|
-
*
|
|
318
|
-
* After the col sate is applied and the column groups are created we need
|
|
319
|
-
* to apply the state again to update the widths of the group columns.
|
|
320
|
-
*/
|
|
321
|
-
private applyGroupColumnWidth;
|
|
322
313
|
private onRowDataChanged;
|
|
323
314
|
private onCellDataChanged;
|
|
324
315
|
private isUndoChange;
|
|
@@ -148,7 +148,7 @@ class AdaptableAgGrid {
|
|
|
148
148
|
* once layouts are properly handled with the new aggrid methods & events
|
|
149
149
|
* we can remove this hack
|
|
150
150
|
*/
|
|
151
|
-
this.
|
|
151
|
+
this.previousAgGridLayoutState = '';
|
|
152
152
|
this.columnMinMaxValuesCache = {};
|
|
153
153
|
this.renderReactRoot = (node, container) => (0, renderReactRoot_1.renderReactRoot)(node, container);
|
|
154
154
|
/**
|
|
@@ -2929,7 +2929,7 @@ class AdaptableAgGrid {
|
|
|
2929
2929
|
else {
|
|
2930
2930
|
(_b = this.agGridAdapter.getAgGridApi()) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
2931
2931
|
}
|
|
2932
|
-
this.
|
|
2932
|
+
this.previousAgGridLayoutState = '';
|
|
2933
2933
|
const gridContainerElement = this.getAgGridContainerElement();
|
|
2934
2934
|
if (gridContainerElement) {
|
|
2935
2935
|
gridContainerElement.removeEventListener('keydown', this.agGridListenerKeydown);
|
|
@@ -3319,14 +3319,13 @@ class AdaptableAgGrid {
|
|
|
3319
3319
|
// as otherwise column order is not preserved properly when
|
|
3320
3320
|
// going from pivoted to unpivoted layout
|
|
3321
3321
|
if (shouldUpdatePivoted) {
|
|
3322
|
-
this.agGridAdapter.
|
|
3322
|
+
this.agGridAdapter.setGridOption('pivotMode', pivoted);
|
|
3323
3323
|
}
|
|
3324
3324
|
const perfApplyColumnState = this.logger.beginPerf('applyColumnState (layout.isChanged)');
|
|
3325
3325
|
this.agGridAdapter.getAgGridApi().applyColumnState({
|
|
3326
3326
|
state: newColumnsState,
|
|
3327
3327
|
applyOrder: true,
|
|
3328
3328
|
});
|
|
3329
|
-
this.applyGroupColumnWidth(layout);
|
|
3330
3329
|
perfApplyColumnState.end();
|
|
3331
3330
|
this.api.gridApi.setColumnSorts(layout.ColumnSorts);
|
|
3332
3331
|
this.agGridAdapter.getAgGridApi().setPivotColumns(layout.PivotColumns || []);
|
|
@@ -3383,38 +3382,6 @@ class AdaptableAgGrid {
|
|
|
3383
3382
|
}
|
|
3384
3383
|
return null;
|
|
3385
3384
|
}
|
|
3386
|
-
/**
|
|
3387
|
-
* Setting layout works by modifing the column state.
|
|
3388
|
-
* The column state is based on the current existing columns.
|
|
3389
|
-
* At this point the column groups do not exist, and the widths from layout are not applied.
|
|
3390
|
-
*
|
|
3391
|
-
* After the col sate is applied and the column groups are created we need
|
|
3392
|
-
* to apply the state again to update the widths of the group columns.
|
|
3393
|
-
*/
|
|
3394
|
-
applyGroupColumnWidth(layout) {
|
|
3395
|
-
if (!layout.RowGroupedColumns || !layout.RowGroupedColumns.length) {
|
|
3396
|
-
return;
|
|
3397
|
-
}
|
|
3398
|
-
const groupColumnWithDifferentWidths = this.agGridAdapter
|
|
3399
|
-
.getAgGridApi()
|
|
3400
|
-
.getColumnState()
|
|
3401
|
-
.reduce((acc, col) => {
|
|
3402
|
-
var _a;
|
|
3403
|
-
if (this.api.columnApi.isAutoRowGroupColumn(col.colId)) {
|
|
3404
|
-
const widthInLayout = (_a = layout.ColumnWidthMap) === null || _a === void 0 ? void 0 : _a[col.colId];
|
|
3405
|
-
if (widthInLayout && widthInLayout !== col.width) {
|
|
3406
|
-
acc.push(Object.assign(Object.assign({}, col), { width: widthInLayout }));
|
|
3407
|
-
}
|
|
3408
|
-
}
|
|
3409
|
-
return acc;
|
|
3410
|
-
}, []);
|
|
3411
|
-
if (groupColumnWithDifferentWidths.length === 0) {
|
|
3412
|
-
return;
|
|
3413
|
-
}
|
|
3414
|
-
this.agGridAdapter.getAgGridApi().applyColumnState({
|
|
3415
|
-
state: groupColumnWithDifferentWidths,
|
|
3416
|
-
});
|
|
3417
|
-
}
|
|
3418
3385
|
onRowDataChanged({ rowNode, oldData, newData, }) {
|
|
3419
3386
|
if (oldData == null || oldData == undefined) {
|
|
3420
3387
|
return;
|
|
@@ -3711,15 +3678,18 @@ class AdaptableAgGrid {
|
|
|
3711
3678
|
var _a, _b;
|
|
3712
3679
|
const agGridApi = this.agGridAdapter.getAgGridApi();
|
|
3713
3680
|
const columnState = agGridApi.getColumnState();
|
|
3681
|
+
const expandedState = agGridApi.getState().rowGroupExpansion || { expandedRowGroupIds: [] };
|
|
3682
|
+
const currentLayoutState = { columnState, expandedState };
|
|
3714
3683
|
try {
|
|
3715
|
-
|
|
3716
|
-
|
|
3684
|
+
// TODO
|
|
3685
|
+
const stringifiedLayoutState = JSON.stringify(currentLayoutState);
|
|
3686
|
+
if (stringifiedLayoutState === this.previousAgGridLayoutState) {
|
|
3717
3687
|
// same grid column state as a previous,
|
|
3718
3688
|
// so no need to update, as the layout has already been updated
|
|
3719
3689
|
// for this grid column state
|
|
3720
3690
|
return;
|
|
3721
3691
|
}
|
|
3722
|
-
this.
|
|
3692
|
+
this.previousAgGridLayoutState = stringifiedLayoutState;
|
|
3723
3693
|
}
|
|
3724
3694
|
catch (ex) {
|
|
3725
3695
|
this.logger.consoleError('Error stringifying column state', ex);
|
package/src/env.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = {
|
|
4
4
|
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" || '',
|
|
5
|
-
PUBLISH_TIMESTAMP:
|
|
6
|
-
VERSION: "18.0.0-canary.
|
|
5
|
+
PUBLISH_TIMESTAMP: 1712304088550 || Date.now(),
|
|
6
|
+
VERSION: "18.0.0-canary.23" || '--current-version--',
|
|
7
7
|
};
|
|
@@ -1358,16 +1358,6 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
1358
1358
|
kind: string;
|
|
1359
1359
|
desc: string;
|
|
1360
1360
|
};
|
|
1361
|
-
BalancedGroupsKeyContext: {
|
|
1362
|
-
name: string;
|
|
1363
|
-
kind: string;
|
|
1364
|
-
desc: string;
|
|
1365
|
-
props: {
|
|
1366
|
-
name: string;
|
|
1367
|
-
kind: string;
|
|
1368
|
-
desc: string;
|
|
1369
|
-
}[];
|
|
1370
|
-
};
|
|
1371
1361
|
BaseContext: {
|
|
1372
1362
|
name: string;
|
|
1373
1363
|
kind: string;
|