@adaptabletools/adaptable-cjs 18.0.0-canary.11 → 18.0.0-canary.13
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 +5 -1
- package/base.css.map +1 -1
- package/index.css +7 -1
- package/index.css.map +1 -1
- package/package.json +1 -1
- package/src/AdaptableOptions/AdaptableOptions.d.ts +2 -2
- package/src/AdaptableOptions/ColumnOptions.d.ts +7 -4
- package/src/AdaptableOptions/CommentOptions.d.ts +9 -7
- package/src/AdaptableOptions/MenuOptions.d.ts +1 -53
- package/src/AdaptableOptions/MenuOptions.js +3 -3
- package/src/AdaptableOptions/NoteOptions.d.ts +4 -1
- package/src/Api/AdaptableApi.d.ts +4 -4
- package/src/Api/ColumnApi.d.ts +4 -0
- package/src/Api/CommentApi.d.ts +11 -12
- package/src/Api/ConfigApi.d.ts +3 -4
- package/src/Api/EventApi.d.ts +7 -9
- package/src/Api/Events/CommentChanged.d.ts +11 -0
- package/src/Api/GridApi.d.ts +6 -1
- package/src/Api/Implementation/ActionColumnApiImpl.js +3 -6
- package/src/Api/Implementation/AdaptableApiImpl.d.ts +2 -2
- package/src/Api/Implementation/AdaptableApiImpl.js +2 -2
- package/src/Api/Implementation/ApiBase.d.ts +2 -2
- package/src/Api/Implementation/ApiBase.js +1 -1
- package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -0
- package/src/Api/Implementation/ColumnApiImpl.js +10 -0
- package/src/Api/Implementation/CommentsApiImpl.d.ts +1 -2
- package/src/Api/Implementation/ConfigApiImpl.d.ts +2 -2
- package/src/Api/Implementation/ConfigApiImpl.js +8 -8
- package/src/Api/Implementation/GridApiImpl.d.ts +3 -1
- package/src/Api/Implementation/GridApiImpl.js +17 -1
- package/src/Api/Implementation/{NotesApiImpl.d.ts → NoteApiImpl.d.ts} +8 -8
- package/src/Api/Implementation/{NotesApiImpl.js → NoteApiImpl.js} +14 -14
- package/src/Api/Implementation/OptionsApiImpl.d.ts +4 -5
- package/src/Api/Implementation/OptionsApiImpl.js +2 -12
- package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +0 -3
- package/src/Api/Implementation/UserInterfaceApiImpl.js +0 -8
- package/src/Api/Internal/ActionRowInternalApi.js +1 -1
- package/src/Api/Internal/AdaptableInternalApi.d.ts +3 -3
- package/src/Api/Internal/AdaptableInternalApi.js +11 -11
- package/src/Api/Internal/CalculatedColumnInternalApi.js +3 -2
- package/src/Api/Internal/ExportInternalApi.d.ts +2 -1
- package/src/Api/Internal/ExportInternalApi.js +4 -1
- package/src/Api/Internal/Fdc3InternalApi.js +2 -2
- package/src/Api/Internal/FreeTextColumnInternalApi.js +3 -2
- package/src/Api/Internal/GridInternalApi.d.ts +2 -0
- package/src/Api/Internal/GridInternalApi.js +15 -0
- package/src/Api/Internal/{NotesInternalApi.d.ts → NoteInternalApi.d.ts} +1 -1
- package/src/Api/Internal/{NotesInternalApi.js → NoteInternalApi.js} +3 -3
- package/src/Api/NoteApi.d.ts +48 -0
- package/src/Api/OptionsApi.d.ts +8 -12
- package/src/Api/UserInterfaceApi.d.ts +0 -11
- package/src/PredefinedConfig/AdaptableState.d.ts +2 -2
- package/src/PredefinedConfig/CommentState.d.ts +27 -23
- package/src/PredefinedConfig/Common/RowSummary.d.ts +6 -0
- package/src/PredefinedConfig/Common/TransposeConfig.d.ts +6 -0
- package/src/PredefinedConfig/Common/Types.d.ts +4 -4
- package/src/PredefinedConfig/Common/Types.js +4 -1
- package/src/PredefinedConfig/{NotesState.d.ts → NoteState.d.ts} +3 -3
- package/src/PredefinedConfig/{CellAddress.js → NoteState.js} +0 -3
- package/src/PredefinedConfig/PredefinedConfig.d.ts +2 -2
- package/src/PredefinedConfig/Selection/GridCell.d.ts +13 -0
- package/src/PredefinedConfig/SystemState.d.ts +2 -3
- package/src/Redux/ActionsReducers/NoteRedux.d.ts +38 -0
- package/src/Redux/ActionsReducers/{NotesRedux.js → NoteRedux.js} +27 -27
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/SystemRedux.js +3 -3
- package/src/Redux/Store/AdaptableStore.js +10 -16
- package/src/Strategy/{CommentsModule.d.ts → CommentModule.d.ts} +1 -5
- package/src/Strategy/{CommentsModule.js → CommentModule.js} +11 -12
- package/src/Strategy/LayoutModule.d.ts +1 -0
- package/src/Strategy/LayoutModule.js +17 -1
- package/src/Strategy/{NotesModule.d.ts → NoteModule.d.ts} +2 -1
- package/src/Strategy/{NotesModule.js → NoteModule.js} +13 -9
- package/src/Strategy/Utilities/getScopeViewItems.js +3 -0
- package/src/Utilities/Constants/ModuleConstants.d.ts +6 -6
- package/src/Utilities/Constants/ModuleConstants.js +7 -7
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +2 -2
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +10 -0
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +3 -3
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.d.ts +1 -1
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +15 -0
- package/src/Utilities/ObjectFactory.d.ts +3 -3
- package/src/Utilities/ObjectFactory.js +4 -24
- package/src/Utilities/Services/AggregatedScalarLiveValue.d.ts +1 -0
- package/src/Utilities/Services/AggregatedScalarLiveValue.js +12 -10
- package/src/Utilities/Services/CellPopupService.js +2 -2
- package/src/Utilities/Services/Interface/IReportService.d.ts +1 -4
- package/src/Utilities/Services/ModuleService.js +4 -0
- package/src/Utilities/Services/QueryLanguageService.js +2 -2
- package/src/Utilities/Services/ReportService.d.ts +7 -5
- package/src/Utilities/Services/ReportService.js +238 -22
- package/src/Utilities/Services/SummaryService.d.ts +1 -1
- package/src/Utilities/adaptableQlUtils.d.ts +2 -0
- package/src/Utilities/adaptableQlUtils.js +18 -0
- package/src/View/AdaptableViewFactory.js +2 -2
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.d.ts +1 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +1 -1
- package/src/View/Comments/CommentsEditor.js +1 -1
- package/src/View/Comments/CommentsPopup.js +8 -4
- package/src/View/Components/NewScopeComponent.js +2 -2
- package/src/View/Components/Popups/GridCellPopup/GridCellPopup.js +6 -6
- package/src/View/Components/ValueSelector/index.d.ts +1 -0
- package/src/View/Components/ValueSelector/index.js +1 -1
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +0 -1
- package/src/View/FreeTextColumn/FreeTextColumnSummary.js +1 -1
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +3 -1
- package/src/View/Layout/LayoutViewPanel.js +2 -1
- package/src/View/Layout/TransposedPopup.js +19 -18
- package/src/View/Layout/Wizard/LayoutWizard.js +11 -2
- package/src/View/Layout/Wizard/sections/RowSummarySection.d.ts +8 -0
- package/src/View/Layout/Wizard/sections/RowSummarySection.js +146 -0
- package/src/View/Note/NotePopup.d.ts +2 -0
- package/src/View/{Notes/NotesPopup.js → Note/NotePopup.js} +8 -8
- package/src/View/SpecialColumnSettingsWizardStep.js +1 -1
- package/src/agGrid/AdaptableAgGrid.d.ts +2 -0
- package/src/agGrid/AdaptableAgGrid.js +97 -58
- package/src/agGrid/AgGridAdapter.d.ts +2 -0
- package/src/agGrid/AgGridAdapter.js +8 -0
- package/src/agGrid/AgGridColumnAdapter.d.ts +1 -1
- package/src/agGrid/AgGridColumnAdapter.js +4 -4
- package/src/agGrid/AgGridOptionsService.d.ts +4 -1
- package/src/agGrid/AgGridOptionsService.js +22 -0
- package/src/agGrid/defaultAdaptableOptions.js +0 -7
- package/src/components/ExpressionEditor/QueryBuilder/QueryPredicateBuilder.js +2 -1
- package/src/components/ExpressionEditor/QueryBuilder/utils.d.ts +0 -1
- package/src/components/ExpressionEditor/QueryBuilder/utils.js +3 -17
- package/src/components/icons/note.js +2 -2
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +77 -14
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/parser/src/parser.js +117 -1257
- package/src/parser/src/predicate/mapExpressionToQlPredicate.js +1 -1
- package/src/parser/src/predicate/mapQlPredicateToExpression.js +2 -1
- package/src/parser/src/types.d.ts +2 -2
- package/src/types.d.ts +23 -20
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/src/Api/Events/CommentsChangedInfo.d.ts +0 -5
- package/src/Api/NotesApi.d.ts +0 -48
- package/src/PredefinedConfig/CellAddress.d.ts +0 -13
- package/src/Redux/ActionsReducers/NotesRedux.d.ts +0 -38
- package/src/View/Notes/NotesPopup.d.ts +0 -2
- /package/src/Api/Events/{CommentsChangedInfo.js → CommentChanged.js} +0 -0
- /package/src/Api/{NotesApi.js → NoteApi.js} +0 -0
- /package/src/PredefinedConfig/{NotesState.js → Common/TransposeConfig.js} +0 -0
- /package/src/View/{Notes → Note}/NoteEditor.d.ts +0 -0
- /package/src/View/{Notes → Note}/NoteEditor.js +0 -0
|
@@ -18,6 +18,7 @@ const AggregationsSection_1 = require("./sections/AggregationsSection");
|
|
|
18
18
|
const SortSection_1 = require("./sections/SortSection");
|
|
19
19
|
const FilterSection_1 = require("./sections/FilterSection");
|
|
20
20
|
const GridFilterSection_1 = require("./sections/GridFilterSection");
|
|
21
|
+
const RowSummarySection_1 = require("./sections/RowSummarySection");
|
|
21
22
|
const LayoutWizard = (props) => {
|
|
22
23
|
var _a, _b;
|
|
23
24
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
@@ -37,8 +38,9 @@ const LayoutWizard = (props) => {
|
|
|
37
38
|
preparedLayout = ObjectFactory_1.default.CreateEmptyLayout({ Name: '' });
|
|
38
39
|
}
|
|
39
40
|
if (preparedLayout.SuppressAggFuncInHeader === undefined) {
|
|
40
|
-
preparedLayout.SuppressAggFuncInHeader =
|
|
41
|
-
|
|
41
|
+
preparedLayout.SuppressAggFuncInHeader = !!adaptable.agGridAdapter
|
|
42
|
+
.getAgGridApi()
|
|
43
|
+
.getGridOption('suppressAggFuncInHeader');
|
|
42
44
|
}
|
|
43
45
|
return preparedLayout;
|
|
44
46
|
});
|
|
@@ -110,6 +112,13 @@ const LayoutWizard = (props) => {
|
|
|
110
112
|
render: () => (React.createElement(rebass_1.Box, { p: 2, style: { height: '100%' } },
|
|
111
113
|
React.createElement(RowGroupingSection_1.RowGroupingSection, { onChange: setLayout }))),
|
|
112
114
|
},
|
|
115
|
+
{
|
|
116
|
+
title: 'Row Summaries',
|
|
117
|
+
details: 'Configure Row Summaries',
|
|
118
|
+
renderSummary: () => React.createElement(RowGroupingSection_1.RowGroupingSectionSummary, null),
|
|
119
|
+
render: () => (React.createElement(rebass_1.Box, { p: 2, style: { height: '100%' } },
|
|
120
|
+
React.createElement(RowSummarySection_1.RowSummarySection, { onChange: setLayout }))),
|
|
121
|
+
},
|
|
113
122
|
{
|
|
114
123
|
title: 'Aggregations',
|
|
115
124
|
isVisible: () => layoutSupportedFeatures.AggregationColumns,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Layout } from '../../../../../types';
|
|
3
|
+
export declare const RowGroupingSectionSummary: React.FunctionComponent;
|
|
4
|
+
interface RowSummarySectionProps {
|
|
5
|
+
onChange: (data: Layout) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const RowSummarySection: React.FunctionComponent<RowSummarySectionProps>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RowSummarySection = exports.RowGroupingSectionSummary = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const rebass_1 = require("rebass");
|
|
7
|
+
const FormLayout_1 = tslib_1.__importStar(require("../../../../components/FormLayout"));
|
|
8
|
+
const Panel_1 = tslib_1.__importDefault(require("../../../../components/Panel"));
|
|
9
|
+
const Select_1 = require("../../../../components/Select");
|
|
10
|
+
const SimpleButton_1 = tslib_1.__importDefault(require("../../../../components/SimpleButton"));
|
|
11
|
+
const Tabs_1 = require("../../../../components/Tabs");
|
|
12
|
+
const Tag_1 = require("../../../../components/Tag");
|
|
13
|
+
const adaptableQlUtils_1 = require("../../../../Utilities/adaptableQlUtils");
|
|
14
|
+
const ModuleConstants_1 = require("../../../../Utilities/Constants/ModuleConstants");
|
|
15
|
+
const SummaryService_1 = require("../../../../Utilities/Services/SummaryService");
|
|
16
|
+
const sortWithOrder_1 = require("../../../../Utilities/sortWithOrder");
|
|
17
|
+
const AdaptableContext_1 = require("../../../AdaptableContext");
|
|
18
|
+
const ValueSelector_1 = require("../../../Components/ValueSelector");
|
|
19
|
+
const OnePageAdaptableWizard_1 = require("../../../Wizard/OnePageAdaptableWizard");
|
|
20
|
+
const Utilities_1 = require("./Utilities");
|
|
21
|
+
const getAvailableExpressionsForColumnType = (columnType, availableScalarExpressions) => {
|
|
22
|
+
const inputType = (0, adaptableQlUtils_1.mapColumnDataTypeToExpressionFunctionType)(columnType);
|
|
23
|
+
return Object.entries(availableScalarExpressions !== null && availableScalarExpressions !== void 0 ? availableScalarExpressions : {})
|
|
24
|
+
.map(([expression, expressionDef]) => {
|
|
25
|
+
var _a, _b;
|
|
26
|
+
let firstArg = null;
|
|
27
|
+
if (!SummaryService_1.summarySupportedExpressions.includes(expression)) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
if (Array.isArray((_a = expressionDef === null || expressionDef === void 0 ? void 0 : expressionDef.inputs) === null || _a === void 0 ? void 0 : _a[0])) {
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
firstArg = (_b = expressionDef.inputs.find((input) => input.includes(inputType))) === null || _b === void 0 ? void 0 : _b[0];
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
firstArg = expressionDef.inputs[0];
|
|
36
|
+
}
|
|
37
|
+
if (inputType === firstArg) {
|
|
38
|
+
return expression;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
})
|
|
44
|
+
.filter(Boolean);
|
|
45
|
+
};
|
|
46
|
+
const RowGroupingSectionSummary = () => {
|
|
47
|
+
var _a;
|
|
48
|
+
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
49
|
+
const { data: layout } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
50
|
+
return (React.createElement(rebass_1.Box, null, ((_a = layout.RowGroupedColumns) === null || _a === void 0 ? void 0 : _a.length) ? (layout.RowGroupedColumns.map((columnId) => (React.createElement(Tag_1.Tag, { mr: 1, key: columnId }, adaptable.api.columnApi.getFriendlyNameForColumnId(columnId))))) : (React.createElement(Tag_1.Tag, null, "No Row Grouping"))));
|
|
51
|
+
};
|
|
52
|
+
exports.RowGroupingSectionSummary = RowGroupingSectionSummary;
|
|
53
|
+
const RowSummaryEditor = ({ rowSummary, onChange, availableScalarExpressions, onDelete, }) => {
|
|
54
|
+
const { data: layout } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
55
|
+
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
56
|
+
const columns = React.useMemo(() => {
|
|
57
|
+
const colIds = adaptable.api.columnApi
|
|
58
|
+
.getColumns()
|
|
59
|
+
.filter((column) => {
|
|
60
|
+
var _a, _b;
|
|
61
|
+
if (!['Number', 'String'].includes(column.dataType))
|
|
62
|
+
return false;
|
|
63
|
+
return (_b = (_a = layout.Columns) === null || _a === void 0 ? void 0 : _a.includes) === null || _b === void 0 ? void 0 : _b.call(_a, column.columnId);
|
|
64
|
+
})
|
|
65
|
+
.map((c) => c.columnId);
|
|
66
|
+
return (0, sortWithOrder_1.sortWithOrderArray)(colIds, Object.keys(rowSummary.ColumnsMap), {
|
|
67
|
+
sortUnorderedItems: false,
|
|
68
|
+
}).map((colId) => adaptable.api.columnApi.getColumnWithColumnId(colId));
|
|
69
|
+
}, [rowSummary.ColumnsMap]);
|
|
70
|
+
return (React.createElement(Panel_1.default, { header: React.createElement(rebass_1.Flex, { style: { width: '100%' } },
|
|
71
|
+
React.createElement(rebass_1.Flex, { flex: 1, alignItems: "center" }, "Row Summary"),
|
|
72
|
+
React.createElement(SimpleButton_1.default, { icon: "delete", onClick: () => {
|
|
73
|
+
onDelete();
|
|
74
|
+
} })), p: 2 },
|
|
75
|
+
React.createElement(FormLayout_1.default, null,
|
|
76
|
+
React.createElement(FormLayout_1.FormRow, { label: "Position" },
|
|
77
|
+
React.createElement(Select_1.Select, { options: [
|
|
78
|
+
{
|
|
79
|
+
label: 'Top',
|
|
80
|
+
value: 'Top',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
label: 'Bottom',
|
|
84
|
+
value: 'Bottom',
|
|
85
|
+
},
|
|
86
|
+
], value: rowSummary.Position, onChange: (position) => {
|
|
87
|
+
onChange(Object.assign(Object.assign({}, rowSummary), { Position: position }));
|
|
88
|
+
} }))),
|
|
89
|
+
React.createElement(rebass_1.Flex, { flexDirection: 'column', mt: 2, mb: 1 },
|
|
90
|
+
React.createElement(rebass_1.Flex, { alignItems: "center", flex: 1, mb: 2 }, "Column Aggregations"),
|
|
91
|
+
React.createElement(Panel_1.default, { bodyProps: { maxHeight: '100%' }, style: { height: 360 } },
|
|
92
|
+
React.createElement(ValueSelector_1.ValueSelector, { style: { maxHeight: '100%' }, showFilterInput: true, filter: Utilities_1.columnFilter, toIdentifier: (column) => column.columnId, toLabel: (option) => { var _a; return (_a = option.friendlyName) !== null && _a !== void 0 ? _a : option.columnId; }, options: columns, xSelectedLabel: () => {
|
|
93
|
+
return 'Active Aggregations:';
|
|
94
|
+
}, toListLabel: (column) => {
|
|
95
|
+
var _a, _b;
|
|
96
|
+
const label = (_a = column.friendlyName) !== null && _a !== void 0 ? _a : column.columnId;
|
|
97
|
+
if (!(column.columnId in ((_b = rowSummary.ColumnsMap) !== null && _b !== void 0 ? _b : {}))) {
|
|
98
|
+
return label;
|
|
99
|
+
}
|
|
100
|
+
const expressionOptions = getAvailableExpressionsForColumnType(column.dataType, availableScalarExpressions).map((expression) => ({
|
|
101
|
+
label: expression,
|
|
102
|
+
value: expression,
|
|
103
|
+
}));
|
|
104
|
+
const expression = rowSummary.ColumnsMap[column.columnId];
|
|
105
|
+
return (React.createElement(rebass_1.Flex, null,
|
|
106
|
+
React.createElement(rebass_1.Flex, { mr: 2, alignItems: 'center' }, label),
|
|
107
|
+
React.createElement(Select_1.Select, { value: expression, options: expressionOptions, onChange: (expression) => {
|
|
108
|
+
onChange(Object.assign(Object.assign({}, rowSummary), { ColumnsMap: Object.assign(Object.assign({}, rowSummary.ColumnsMap), { [column.columnId]: expression }) }));
|
|
109
|
+
} })));
|
|
110
|
+
}, value: Object.keys(rowSummary.ColumnsMap), onChange: (colIds) => {
|
|
111
|
+
const newColumnsMap = {};
|
|
112
|
+
colIds.forEach((colId) => {
|
|
113
|
+
var _a;
|
|
114
|
+
newColumnsMap[colId] = (_a = rowSummary.ColumnsMap[colId]) !== null && _a !== void 0 ? _a : null;
|
|
115
|
+
});
|
|
116
|
+
onChange(Object.assign(Object.assign({}, rowSummary), { ColumnsMap: newColumnsMap }));
|
|
117
|
+
} })))));
|
|
118
|
+
};
|
|
119
|
+
const RowSummarySection = (props) => {
|
|
120
|
+
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
121
|
+
const { data: layout } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
122
|
+
const availableScalarExpressions = React.useMemo(() => {
|
|
123
|
+
return adaptable.api.internalApi
|
|
124
|
+
.getQueryLanguageService()
|
|
125
|
+
.getModuleExpressionFunctionsMap(ModuleConstants_1.LayoutModuleId).aggregatedScalarFunctions;
|
|
126
|
+
}, []);
|
|
127
|
+
return (React.createElement(Tabs_1.Tabs, { style: { height: '100%' } },
|
|
128
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Row Summaries"),
|
|
129
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
130
|
+
React.createElement("div", null,
|
|
131
|
+
React.createElement(rebass_1.Flex, { mb: 1 },
|
|
132
|
+
React.createElement(rebass_1.Flex, { flex: 1 }),
|
|
133
|
+
React.createElement(SimpleButton_1.default, { icon: "plus" }, "Add Row Summary")),
|
|
134
|
+
layout.RowSummaries.map((rowSummary, index) => {
|
|
135
|
+
return (React.createElement(RowSummaryEditor, { key: index, onDelete: () => {
|
|
136
|
+
const newSummaries = [...layout.RowSummaries];
|
|
137
|
+
newSummaries.splice(index, 1);
|
|
138
|
+
props.onChange(Object.assign(Object.assign({}, layout), { RowSummaries: newSummaries }));
|
|
139
|
+
}, availableScalarExpressions: availableScalarExpressions, rowSummary: rowSummary, onChange: (rowSummary) => {
|
|
140
|
+
const newSummaries = [...layout.RowSummaries];
|
|
141
|
+
newSummaries[index] = rowSummary;
|
|
142
|
+
props.onChange(Object.assign(Object.assign({}, layout), { RowSummaries: newSummaries }));
|
|
143
|
+
} }));
|
|
144
|
+
})))));
|
|
145
|
+
};
|
|
146
|
+
exports.RowSummarySection = RowSummarySection;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.NotePopup = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const react_redux_1 = require("react-redux");
|
|
7
7
|
const InfiniteTable_1 = require("../../components/InfiniteTable");
|
|
8
|
-
const
|
|
8
|
+
const NoteRedux_1 = require("../../Redux/ActionsReducers/NoteRedux");
|
|
9
9
|
const AdaptableContext_1 = require("../AdaptableContext");
|
|
10
10
|
const AdaptableButton_1 = require("../Components/AdaptableButton");
|
|
11
11
|
const PopupPanel_1 = require("../Components/Popups/AdaptablePopup/PopupPanel");
|
|
@@ -16,10 +16,10 @@ const tableDOMProps = {
|
|
|
16
16
|
// minHeight: 600,
|
|
17
17
|
},
|
|
18
18
|
};
|
|
19
|
-
const
|
|
19
|
+
const NotePopup = (props) => {
|
|
20
20
|
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
21
21
|
const primaryKeyHeader = adaptable.api.columnApi.getFriendlyNameForColumnId(adaptable.api.columnApi.getPrimaryKeyColumn().columnId);
|
|
22
|
-
const allNotes = (0, react_redux_1.useSelector)((state) => (0,
|
|
22
|
+
const allNotes = (0, react_redux_1.useSelector)((state) => (0, NoteRedux_1.GetAllNotesSelector)(state.Note));
|
|
23
23
|
const columnsMap = React.useMemo(() => {
|
|
24
24
|
const columns = {
|
|
25
25
|
primaryKey: {
|
|
@@ -49,8 +49,8 @@ const NotesPopup = (props) => {
|
|
|
49
49
|
defaultWidth: 50,
|
|
50
50
|
render: (params) => {
|
|
51
51
|
return (React.createElement(AdaptableButton_1.AdaptableButtonComponent, { variant: "text", icon: "delete", onClick: () => {
|
|
52
|
-
const note = adaptable.api.
|
|
53
|
-
adaptable.api.
|
|
52
|
+
const note = adaptable.api.noteApi.getNoteByUuid(params.data.Uuid);
|
|
53
|
+
adaptable.api.noteApi.deleteNote(note);
|
|
54
54
|
} }));
|
|
55
55
|
},
|
|
56
56
|
},
|
|
@@ -66,7 +66,7 @@ const NotesPopup = (props) => {
|
|
|
66
66
|
const data = change.data;
|
|
67
67
|
const prevNote = allNotes.find((x) => x.Uuid === uuid);
|
|
68
68
|
if (prevNote.Text !== data.Text) {
|
|
69
|
-
adaptable.api.
|
|
69
|
+
adaptable.api.noteApi.updateNoteText(data.Text, prevNote);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
}
|
|
@@ -83,4 +83,4 @@ const NotesPopup = (props) => {
|
|
|
83
83
|
alwaysReserveSpaceForSortIcon: false,
|
|
84
84
|
}, rowHeight: 40, columnHeaderHeight: 65, domProps: tableDOMProps, columns: columnsMap }))));
|
|
85
85
|
};
|
|
86
|
-
exports.
|
|
86
|
+
exports.NotePopup = NotePopup;
|
|
@@ -13,7 +13,7 @@ const AdaptableContext_1 = require("./AdaptableContext");
|
|
|
13
13
|
const SpecialColumnSettingsWizardStep = (props) => {
|
|
14
14
|
var _a, _b, _c;
|
|
15
15
|
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
16
|
-
const possibleColumnTypes = (_a = adaptable.api.
|
|
16
|
+
const possibleColumnTypes = (_a = adaptable.api.columnApi.getColumnTypes()) !== null && _a !== void 0 ? _a : [];
|
|
17
17
|
const { Filterable, Resizable, Groupable, Sortable, Pivotable, Aggregatable, SuppressMenu, SuppressMovable, } = (_b = props.settings) !== null && _b !== void 0 ? _b : {};
|
|
18
18
|
const handleColumnTypeChange = (columnType, checked) => {
|
|
19
19
|
var _a, _b, _c;
|
|
@@ -300,6 +300,8 @@ export declare class AdaptableAgGrid implements IAdaptable {
|
|
|
300
300
|
canExportToExcel(): boolean;
|
|
301
301
|
exportToExcel(reportData: ReportData, fileName: string): void;
|
|
302
302
|
exportVisualDataToExcel(): void;
|
|
303
|
+
private processRowGroupForExcelExport;
|
|
304
|
+
private processCellForExcelExport;
|
|
303
305
|
isQuickFilterAvailable(): boolean;
|
|
304
306
|
private hasFloatingFilterOnAtLeastOneColumn;
|
|
305
307
|
getChartRef(chartId: string): ChartRef;
|
|
@@ -63,12 +63,12 @@ const ColumnInfoModule_1 = require("../Strategy/ColumnInfoModule");
|
|
|
63
63
|
const SettingsPanelModule_1 = require("../Strategy/SettingsPanelModule");
|
|
64
64
|
const StatusBarModule_1 = require("../Strategy/StatusBarModule");
|
|
65
65
|
const ChartingModule_1 = require("../Strategy/ChartingModule");
|
|
66
|
-
const
|
|
66
|
+
const NoteModule_1 = require("../Strategy/NoteModule");
|
|
67
67
|
const StyledColumnModule_1 = require("../Strategy/StyledColumnModule");
|
|
68
68
|
const Fdc3Module_1 = require("../Strategy/Fdc3Module");
|
|
69
69
|
const GridFilterModule_1 = require("../Strategy/GridFilterModule");
|
|
70
70
|
const NamedQueryModule_1 = require("../Strategy/NamedQueryModule");
|
|
71
|
-
const
|
|
71
|
+
const CommentModule_1 = require("../Strategy/CommentModule");
|
|
72
72
|
const AdaptableNumberEditor_1 = require("./editors/AdaptableNumberEditor");
|
|
73
73
|
const AdaptableDateEditor_1 = require("./editors/AdaptableDateEditor");
|
|
74
74
|
const Helper_1 = require("../Utilities/Helpers/Helper");
|
|
@@ -364,7 +364,7 @@ class AdaptableAgGrid {
|
|
|
364
364
|
this.api.themeApi.applyCurrentTheme();
|
|
365
365
|
this.validatePrimaryKey();
|
|
366
366
|
this.embedColumnMenu = this.agGridAdapter.isModulePresent(core_1.ModuleNames.MenuModule);
|
|
367
|
-
this.api.internalApi.setTreeMode(this.agGridAdapter.
|
|
367
|
+
this.api.internalApi.setTreeMode(!!this.agGridAdapter.getAgGridApi().getGridOption('treeData'));
|
|
368
368
|
// TODO AFL MIG: we could just patch the defautl Layout on init? instead
|
|
369
369
|
this.checkShouldClearExistingFiltersOrSearches();
|
|
370
370
|
this.applyColumnFiltering();
|
|
@@ -890,6 +890,13 @@ class AdaptableAgGrid {
|
|
|
890
890
|
}
|
|
891
891
|
return original_floatingFiltersHeight;
|
|
892
892
|
});
|
|
893
|
+
/**
|
|
894
|
+
* `excelStyles`
|
|
895
|
+
*/
|
|
896
|
+
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'excelStyles', (original_excelStyles) => {
|
|
897
|
+
// we need this here just to register the original excelStyles in the service
|
|
898
|
+
return original_excelStyles;
|
|
899
|
+
});
|
|
893
900
|
/**
|
|
894
901
|
* `columnTypes`
|
|
895
902
|
*/
|
|
@@ -1062,7 +1069,7 @@ class AdaptableAgGrid {
|
|
|
1062
1069
|
return resultColDefs;
|
|
1063
1070
|
}
|
|
1064
1071
|
useRowNodeLookUp() {
|
|
1065
|
-
return this.agGridAdapter.
|
|
1072
|
+
return this.agGridAdapter.getAgGridApi().getGridOption('getRowId') != undefined;
|
|
1066
1073
|
}
|
|
1067
1074
|
getAgGridContainerElement() {
|
|
1068
1075
|
if (!this.DANGER_USE_GETTER_agGridContainerElement) {
|
|
@@ -1109,8 +1116,8 @@ class AdaptableAgGrid {
|
|
|
1109
1116
|
return selectedRowInfo;
|
|
1110
1117
|
}
|
|
1111
1118
|
isGridSelectable() {
|
|
1112
|
-
|
|
1113
|
-
|
|
1119
|
+
const rowSelection = this.agGridAdapter.getAgGridApi().getGridOption('rowSelection');
|
|
1120
|
+
return rowSelection === 'single' || rowSelection === 'multiple';
|
|
1114
1121
|
}
|
|
1115
1122
|
initAdaptableStore() {
|
|
1116
1123
|
const perfNewAdaptableStore = this.logger.beginPerf(`initAdaptableStore()`);
|
|
@@ -1578,7 +1585,7 @@ class AdaptableAgGrid {
|
|
|
1578
1585
|
modules.set(ModuleConstants.ChartingModuleId, new ChartingModule_1.ChartingModule(this.api));
|
|
1579
1586
|
modules.set(ModuleConstants.ColumnFilterModuleId, new ColumnFilterModule_1.ColumnFilterModule(this.api));
|
|
1580
1587
|
modules.set(ModuleConstants.ColumnInfoModuleId, new ColumnInfoModule_1.ColumnInfoModule(this.api));
|
|
1581
|
-
modules.set(ModuleConstants.
|
|
1588
|
+
modules.set(ModuleConstants.CommentModuleId, new CommentModule_1.CommentModule(this.api));
|
|
1582
1589
|
modules.set(ModuleConstants.CustomSortModuleId, new CustomSortModule_1.CustomSortModule(this.api));
|
|
1583
1590
|
modules.set(ModuleConstants.DashboardModuleId, new DashboardModule_1.DashboardModule(this.api));
|
|
1584
1591
|
modules.set(ModuleConstants.DataChangeHistoryModuleId, new DataChangeHistoryModule_1.DataChangeHistoryModule(this.api));
|
|
@@ -1593,7 +1600,7 @@ class AdaptableAgGrid {
|
|
|
1593
1600
|
modules.set(ModuleConstants.GridInfoModuleId, new GridInfoModule_1.GridInfoModule(this.api));
|
|
1594
1601
|
modules.set(ModuleConstants.LayoutModuleId, new LayoutModule_1.LayoutModule(this.api));
|
|
1595
1602
|
modules.set(ModuleConstants.NamedQueryModuleId, new NamedQueryModule_1.NamedQueryModule(this.api));
|
|
1596
|
-
modules.set(ModuleConstants.
|
|
1603
|
+
modules.set(ModuleConstants.NoteModuleId, new NoteModule_1.NoteModule(this.api));
|
|
1597
1604
|
modules.set(ModuleConstants.PlusMinusModuleId, new PlusMinusModule_1.PlusMinusModule(this.api));
|
|
1598
1605
|
modules.set(ModuleConstants.QuickSearchModuleId, new QuickSearchModule_1.QuickSearchModule(this.api));
|
|
1599
1606
|
modules.set(ModuleConstants.ScheduleModuleId, new ScheduleModule_1.ScheduleModule(this.api));
|
|
@@ -1618,7 +1625,9 @@ class AdaptableAgGrid {
|
|
|
1618
1625
|
this.api.eventApi.on('AdaptableReady', () => {
|
|
1619
1626
|
var _a, _b;
|
|
1620
1627
|
// update status bar state
|
|
1621
|
-
const adaptableStatusPanels = (_b = (_a = this.agGridAdapter
|
|
1628
|
+
const adaptableStatusPanels = (_b = (_a = this.agGridAdapter
|
|
1629
|
+
.getAgGridApi()
|
|
1630
|
+
.getGridOption('statusBar')) === null || _a === void 0 ? void 0 : _a.statusPanels) === null || _b === void 0 ? void 0 : _b.filter((statusPanel) => this.adaptableStatusPanelKeys.includes(statusPanel.key));
|
|
1622
1631
|
const statusBarModule = this.ModuleService.getModuleById(ModuleConstants.StatusBarModuleId);
|
|
1623
1632
|
// need to add only the adaptable panels
|
|
1624
1633
|
statusBarModule.syncStateWithOptions(adaptableStatusPanels);
|
|
@@ -2411,10 +2420,10 @@ class AdaptableAgGrid {
|
|
|
2411
2420
|
});
|
|
2412
2421
|
}
|
|
2413
2422
|
getAgGridRowModelType() {
|
|
2414
|
-
var _a
|
|
2423
|
+
var _a;
|
|
2415
2424
|
// it seems that this can be null so we need explicitly to return "clientSide" in this case
|
|
2416
2425
|
// need to check that for ServerSideRowModel it is ALWAYS returned...
|
|
2417
|
-
return (
|
|
2426
|
+
return (_a = this.agGridAdapter.getAgGridApi().getGridOption('rowModelType')) !== null && _a !== void 0 ? _a : 'clientSide';
|
|
2418
2427
|
}
|
|
2419
2428
|
getAllRowNodes(config) {
|
|
2420
2429
|
let rowNodes = [];
|
|
@@ -2537,7 +2546,7 @@ class AdaptableAgGrid {
|
|
|
2537
2546
|
}
|
|
2538
2547
|
canGenerateCharts() {
|
|
2539
2548
|
return (this.agGridAdapter.isModulePresent(core_1.ModuleNames.GridChartsModule) &&
|
|
2540
|
-
this.agGridAdapter.
|
|
2549
|
+
this.agGridAdapter.getAgGridApi().getGridOption('enableCharts'));
|
|
2541
2550
|
}
|
|
2542
2551
|
canDisplaySparklines() {
|
|
2543
2552
|
return this.agGridAdapter.isModulePresent(core_1.ModuleNames.SparklinesModule);
|
|
@@ -3052,52 +3061,82 @@ class AdaptableAgGrid {
|
|
|
3052
3061
|
ephemeralGridApi.destroy();
|
|
3053
3062
|
}
|
|
3054
3063
|
exportVisualDataToExcel() {
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3064
|
+
try {
|
|
3065
|
+
const exportExcelStyles = this.ReportService.buildExcelStylesForVisualReports();
|
|
3066
|
+
this.agGridOptionsService.CAREFUL_patchGridOptionsProperty('excelStyles', exportExcelStyles);
|
|
3067
|
+
this.agGridAdapter.getAgGridApi().exportDataAsExcel({
|
|
3068
|
+
sheetName: 'Sheet 1',
|
|
3069
|
+
fileName: this.ReportService.getReportFileName(this.adaptableOptions.adaptableId, 'Excel'),
|
|
3070
|
+
// delegate the cell value processing to Adaptable
|
|
3071
|
+
processCellCallback: ({ node, column, value }) => {
|
|
3072
|
+
var _a;
|
|
3073
|
+
const columnId = column.getColId();
|
|
3074
|
+
if ((node === null || node === void 0 ? void 0 : node.group) &&
|
|
3075
|
+
(this.api.columnApi.isAutoRowGroupColumn(columnId) ||
|
|
3076
|
+
// we would still need to process the cell if this is a group row with an aggregated value
|
|
3077
|
+
((_a = node === null || node === void 0 ? void 0 : node.aggData) === null || _a === void 0 ? void 0 : _a[columnId]) == undefined)) {
|
|
3078
|
+
// skip processing of row groups, this was already handled in processRowGroupCallback()
|
|
3079
|
+
return value;
|
|
3080
|
+
}
|
|
3081
|
+
return this.processCellForExcelExport(node, columnId);
|
|
3082
|
+
},
|
|
3083
|
+
processRowGroupCallback: (params) => {
|
|
3084
|
+
var _a;
|
|
3085
|
+
// recreating the standard AG Grid styling for row groups: 'Parent -> Child'
|
|
3086
|
+
// additionally the values are formatted
|
|
3087
|
+
let rowGroupNode = params.node;
|
|
3088
|
+
const isFooterRow = rowGroupNode.footer;
|
|
3089
|
+
const rowGroupSummary = [(_a = this.processRowGroupForExcelExport(rowGroupNode)) !== null && _a !== void 0 ? _a : ''];
|
|
3090
|
+
while (rowGroupNode.parent) {
|
|
3091
|
+
rowGroupNode = rowGroupNode.parent;
|
|
3092
|
+
const formattedParentNode = this.processRowGroupForExcelExport(rowGroupNode);
|
|
3093
|
+
if (formattedParentNode) {
|
|
3094
|
+
rowGroupSummary.push(formattedParentNode);
|
|
3095
|
+
}
|
|
3096
|
+
}
|
|
3097
|
+
let summary = rowGroupSummary.reverse().join(' -> ');
|
|
3098
|
+
if (isFooterRow) {
|
|
3099
|
+
summary = `Total: ${summary}`;
|
|
3100
|
+
}
|
|
3101
|
+
return summary;
|
|
3102
|
+
},
|
|
3103
|
+
});
|
|
3104
|
+
this.agGridOptionsService.revertGridOptionsPropertyToUserValue('excelStyles');
|
|
3105
|
+
}
|
|
3106
|
+
catch (error) {
|
|
3107
|
+
this.logger.consoleError('Error exporting visual data to Excel', error);
|
|
3108
|
+
}
|
|
3109
|
+
}
|
|
3110
|
+
processRowGroupForExcelExport(rowNode) {
|
|
3111
|
+
var _a, _b, _c, _d, _e;
|
|
3112
|
+
const columnId = (_c = (_a = rowNode.field) !== null && _a !== void 0 ? _a : (_b = rowNode.rowGroupColumn) === null || _b === void 0 ? void 0 : _b.getColId()) !== null && _c !== void 0 ? _c : (_e = (_d = rowNode.rowGroupColumn) === null || _d === void 0 ? void 0 : _d.getColDef()) === null || _e === void 0 ? void 0 : _e.field;
|
|
3113
|
+
if (!columnId || !rowNode.key) {
|
|
3114
|
+
return;
|
|
3115
|
+
}
|
|
3116
|
+
let rawValue = rowNode.key;
|
|
3117
|
+
if (this.api.columnApi.getColumnDataTypeForColumnId(columnId) === 'Date' &&
|
|
3118
|
+
typeof rawValue === 'string' &&
|
|
3119
|
+
// rawValue is composed only of digits
|
|
3120
|
+
/^\d+$/.test(rawValue)) {
|
|
3121
|
+
// AG-Grid converts the value to string, we have to reconvert it back
|
|
3122
|
+
const dateRawValue = parseInt(rawValue);
|
|
3123
|
+
if (dateRawValue != undefined) {
|
|
3124
|
+
// @ts-ignore
|
|
3125
|
+
rawValue = dateRawValue;
|
|
3126
|
+
}
|
|
3127
|
+
}
|
|
3128
|
+
return this.ReportService.getCellExportValueFromRawValue(rowNode, rawValue, columnId);
|
|
3129
|
+
}
|
|
3130
|
+
processCellForExcelExport(rowNode, columnId) {
|
|
3131
|
+
if (this.api.exportApi.internalApi.isVisualDataExportInProgress()) {
|
|
3132
|
+
const cellKey = this.agGridColumnAdapter.getExcelClassNameForCell(columnId, this.getPrimaryKeyValueFromRowNode(rowNode));
|
|
3133
|
+
const isoFormattedDate = this.ReportService.getExcelStyleWithFormattedDate(cellKey);
|
|
3134
|
+
if (isoFormattedDate) {
|
|
3135
|
+
// this is a Date cell which will be formatted by Excel
|
|
3136
|
+
return isoFormattedDate;
|
|
3137
|
+
}
|
|
3138
|
+
}
|
|
3139
|
+
return this.ReportService.getCellExportValueFromRowNode(rowNode, columnId);
|
|
3101
3140
|
}
|
|
3102
3141
|
isQuickFilterAvailable() {
|
|
3103
3142
|
if (this.api.layoutApi.getCurrentLayout().EnablePivot) {
|
|
@@ -25,6 +25,7 @@ export declare class AgGridAdapter {
|
|
|
25
25
|
getLiveGridOptions(): GridOptions | undefined;
|
|
26
26
|
updateGridOptions(options: ManagedGridOptions): void;
|
|
27
27
|
setGridOption<Key extends ManagedGridOptionKey>(key: Key, value: GridOptions[Key]): void;
|
|
28
|
+
getUserGridOptionsProperty<T extends keyof GridOptions>(propertyName: T): GridOptions[T];
|
|
28
29
|
updateColumnFilterActiveState(): void;
|
|
29
30
|
deriveSelectedCellInfoFromAgGrid(): SelectedCellInfo;
|
|
30
31
|
deriveSelectedRowInfoFromAgGrid(): SelectedRowInfo;
|
|
@@ -59,4 +60,5 @@ export declare class AgGridAdapter {
|
|
|
59
60
|
* Mutates the colDefs to ensure that each column has a colId
|
|
60
61
|
*/
|
|
61
62
|
assignColumnIdsToColDefs(colDefs?: (ColDef | ColGroupDef)[]): void;
|
|
63
|
+
getDefaultColumnDefinition(): GridOptions['defaultColDef'];
|
|
62
64
|
}
|
|
@@ -68,6 +68,9 @@ class AgGridAdapter {
|
|
|
68
68
|
var _a;
|
|
69
69
|
(_a = this.getAgGridApi()) === null || _a === void 0 ? void 0 : _a.setGridOption(key, value);
|
|
70
70
|
}
|
|
71
|
+
getUserGridOptionsProperty(propertyName) {
|
|
72
|
+
return this.adaptableInstance.agGridOptionsService.getUserGridOptionsProperty(propertyName);
|
|
73
|
+
}
|
|
71
74
|
updateColumnFilterActiveState() {
|
|
72
75
|
var _a;
|
|
73
76
|
const columnFilters = this.adaptableApi.columnFilterApi.getActiveColumnFilters();
|
|
@@ -578,5 +581,10 @@ class AgGridAdapter {
|
|
|
578
581
|
};
|
|
579
582
|
colDefs.forEach((colDef) => assignColId(colDef));
|
|
580
583
|
}
|
|
584
|
+
getDefaultColumnDefinition() {
|
|
585
|
+
var _a, _b;
|
|
586
|
+
// for early init phase, gridApi might not be ready yet
|
|
587
|
+
return (_b = (_a = this.getAgGridApi(true)) === null || _a === void 0 ? void 0 : _a.getGridOption('defaultColDef')) !== null && _b !== void 0 ? _b : {};
|
|
588
|
+
}
|
|
581
589
|
}
|
|
582
590
|
exports.AgGridAdapter = AgGridAdapter;
|
|
@@ -30,7 +30,7 @@ export declare class AgGridColumnAdapter {
|
|
|
30
30
|
private setupColumnEditable;
|
|
31
31
|
private setupColumnValueSetter;
|
|
32
32
|
private setupColumnComparator;
|
|
33
|
-
|
|
33
|
+
getExcelClassNameForCell(colId: string, primaryKeyValue: any, userDefinedCellClass?: string | string[]): string;
|
|
34
34
|
private isQuickSearchActive;
|
|
35
35
|
private getEditableCellClass;
|
|
36
36
|
private getReadonlyCellClass;
|
|
@@ -607,24 +607,24 @@ class AgGridColumnAdapter {
|
|
|
607
607
|
: undefined;
|
|
608
608
|
}
|
|
609
609
|
getNoteCellClassName(gridCell, params) {
|
|
610
|
-
if (!this.adaptableApi.internalApi.getModuleService().isModuleAvailable('
|
|
610
|
+
if (!this.adaptableApi.internalApi.getModuleService().isModuleAvailable('Note')) {
|
|
611
611
|
return;
|
|
612
612
|
}
|
|
613
|
-
if (!this.adaptableApi.
|
|
613
|
+
if (!this.adaptableApi.noteApi.internalApi.areNotesAvailable()) {
|
|
614
614
|
return;
|
|
615
615
|
}
|
|
616
616
|
const cellPosition = {
|
|
617
617
|
PrimaryKeyValue: gridCell.primaryKeyValue,
|
|
618
618
|
ColumnId: gridCell.column.columnId,
|
|
619
619
|
};
|
|
620
|
-
const cellNotes = this.adaptableApi.
|
|
620
|
+
const cellNotes = this.adaptableApi.noteApi.getNotesForCell(cellPosition);
|
|
621
621
|
if (!(cellNotes === null || cellNotes === void 0 ? void 0 : cellNotes.length)) {
|
|
622
622
|
return undefined;
|
|
623
623
|
}
|
|
624
624
|
return 'ab-Cell-Note';
|
|
625
625
|
}
|
|
626
626
|
getCommentCellClassName(gridCell, params) {
|
|
627
|
-
if (!this.adaptableApi.internalApi.getModuleService().isModuleAvailable('
|
|
627
|
+
if (!this.adaptableApi.internalApi.getModuleService().isModuleAvailable('Comment')) {
|
|
628
628
|
return;
|
|
629
629
|
}
|
|
630
630
|
if (!this.adaptableApi.commentApi.internalApi.areCommentsAvailable()) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AdaptableAgGrid } from './AdaptableAgGrid';
|
|
2
|
-
import { GridOptions } from '@ag-grid-community/core';
|
|
2
|
+
import { GridOptions, ManagedGridOptionKey } from '@ag-grid-community/core';
|
|
3
3
|
export declare class AgGridOptionsService {
|
|
4
4
|
private adaptableInstance;
|
|
5
5
|
private gridOptionsPropertyCache;
|
|
@@ -7,6 +7,9 @@ export declare class AgGridOptionsService {
|
|
|
7
7
|
constructor(adaptableInstance: AdaptableAgGrid);
|
|
8
8
|
destroy(): void;
|
|
9
9
|
setGridOptionsProperty<T extends keyof GridOptions>(gridOptions: GridOptions, propertyName: T, propertyGetter: (userPropertyValue: GridOptions[T]) => GridOptions[T] | undefined): GridOptions;
|
|
10
|
+
getUserGridOptionsProperty<T extends keyof GridOptions>(propertyName: T): GridOptions[T];
|
|
11
|
+
revertGridOptionsPropertyToUserValue(propertyName: ManagedGridOptionKey): void;
|
|
12
|
+
CAREFUL_patchGridOptionsProperty<T extends keyof GridOptions>(propertyName: T, value: GridOptions[T]): void;
|
|
10
13
|
revertGridOptionsPropertiesToUserValue<T extends keyof GridOptions>(gridOptions: GridOptions, propertyNames: T[]): void;
|
|
11
14
|
private get agGridAdapter();
|
|
12
15
|
}
|
|
@@ -43,6 +43,28 @@ class AgGridOptionsService {
|
|
|
43
43
|
gridOptions[propertyName] = adaptableValue !== null && adaptableValue !== void 0 ? adaptableValue : userValue;
|
|
44
44
|
return gridOptions;
|
|
45
45
|
}
|
|
46
|
+
getUserGridOptionsProperty(propertyName) {
|
|
47
|
+
const userKey = `user.${propertyName}`;
|
|
48
|
+
return this.gridOptionsPropertyCache.get(userKey);
|
|
49
|
+
}
|
|
50
|
+
revertGridOptionsPropertyToUserValue(propertyName) {
|
|
51
|
+
const userKey = `user.${propertyName}`;
|
|
52
|
+
const userValue = this.gridOptionsPropertyCache.get(userKey);
|
|
53
|
+
this.agGridAdapter.setGridOption(propertyName, userValue);
|
|
54
|
+
}
|
|
55
|
+
CAREFUL_patchGridOptionsProperty(propertyName, value) {
|
|
56
|
+
var _a;
|
|
57
|
+
// @ts-ignore this is required to set gridOptions peroperties which are marked as initial (writable once, before grid is initialised)
|
|
58
|
+
const gos = (_a = this.agGridAdapter.getAgGridApi()) === null || _a === void 0 ? void 0 : _a.gos;
|
|
59
|
+
if (gos) {
|
|
60
|
+
gos.updateGridOptions({
|
|
61
|
+
options: {
|
|
62
|
+
[propertyName]: value,
|
|
63
|
+
},
|
|
64
|
+
source: 'api',
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
46
68
|
revertGridOptionsPropertiesToUserValue(gridOptions, propertyNames) {
|
|
47
69
|
for (const propertyName of propertyNames) {
|
|
48
70
|
// see this.setGridOptionsProperty(...)
|