@adaptabletools/adaptable-cjs 20.0.5 → 20.0.7-canary.0
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 +20 -0
- package/base.css.map +1 -1
- package/index.css +16 -0
- package/index.css.map +1 -1
- package/package.json +1 -1
- package/src/AdaptableOptions/ColumnOptions.d.ts +173 -2
- package/src/AdaptableState/Common/AggregationColumns.d.ts +8 -1
- package/src/AdaptableState/LayoutState.d.ts +12 -0
- package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -0
- package/src/Api/Implementation/ColumnApiImpl.js +13 -2
- package/src/Api/Implementation/LayoutHelpers.js +25 -2
- package/src/Api/Internal/ColumnInternalApi.d.ts +3 -1
- package/src/Api/Internal/ColumnInternalApi.js +201 -0
- package/src/Utilities/Constants/GeneralConstants.d.ts +1 -0
- package/src/Utilities/Constants/GeneralConstants.js +3 -2
- package/src/Utilities/Extensions/StringExtensions.js +11 -3
- package/src/Utilities/adaptableOverrideCheck.d.ts +2 -0
- package/src/Utilities/adaptableOverrideCheck.js +13 -0
- package/src/agGrid/AdaptableAgGrid.js +29 -0
- package/src/agGrid/AgGridAdapter.js +1 -0
- package/src/agGrid/AgGridColumnAdapter.d.ts +1 -1
- package/src/agGrid/AgGridColumnAdapter.js +6 -12
- package/src/components/Select/Select.js +3 -3
- package/src/env.js +2 -2
- package/src/layout-manager/src/LayoutManagerModel.d.ts +23 -20
- package/src/layout-manager/src/destructurePivotColumnId.d.ts +10 -0
- package/src/layout-manager/src/destructurePivotColumnId.js +84 -0
- package/src/layout-manager/src/index.d.ts +5 -0
- package/src/layout-manager/src/index.js +167 -1
- package/src/layout-manager/src/isPivotGroupTotalColumn.d.ts +2 -0
- package/src/layout-manager/src/isPivotGroupTotalColumn.js +9 -0
- package/src/layout-manager/src/isPivotTotalColumn.d.ts +2 -0
- package/src/layout-manager/src/isPivotTotalColumn.js +7 -0
- package/src/layout-manager/src/normalizeLayoutModel.js +3 -0
- package/src/metamodel/adaptable.metamodel.d.ts +12 -4
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
|
@@ -209,12 +209,16 @@ const pivotLayoutToPivotLayoutModel = (pivotLayout) => {
|
|
|
209
209
|
ColumnPinning: pivotLayout.ColumnPinning,
|
|
210
210
|
PivotColumns: pivotLayout.PivotColumns,
|
|
211
211
|
PivotExpandLevel: pivotLayout.PivotExpandLevel,
|
|
212
|
-
PivotAggregationColumns: (pivotLayout.PivotAggregationColumns || []).map(({ ColumnId, AggFunc }) => {
|
|
212
|
+
PivotAggregationColumns: (pivotLayout.PivotAggregationColumns || []).map(({ ColumnId, AggFunc, TotalColumn }) => {
|
|
213
213
|
return {
|
|
214
214
|
ColumnId,
|
|
215
215
|
AggFunc: toAggFunc(AggFunc),
|
|
216
|
+
TotalColumn,
|
|
216
217
|
};
|
|
217
218
|
}),
|
|
219
|
+
GrandTotalRow: pivotLayout.GrandTotalRow,
|
|
220
|
+
GrandTotalColumn: pivotLayout.GrandTotalColumn,
|
|
221
|
+
PivotGroupTotalColumn: pivotLayout.PivotGroupTotalColumn,
|
|
218
222
|
RowGroupValues: pivotLayout.RowGroupValues
|
|
219
223
|
? pivotLayout.RowGroupValues.RowGroupDefaultBehavior === 'always-collapsed' ||
|
|
220
224
|
pivotLayout.RowGroupValues.RowGroupDefaultBehavior === 'always-expanded'
|
|
@@ -340,10 +344,29 @@ const pivotLayoutModelToPivotLayout = (layoutModel, defaults) => {
|
|
|
340
344
|
else {
|
|
341
345
|
delete pivotLayout.RowGroupValues;
|
|
342
346
|
}
|
|
347
|
+
if (layoutModel.GrandTotalRow) {
|
|
348
|
+
pivotLayout.GrandTotalRow = layoutModel.GrandTotalRow;
|
|
349
|
+
}
|
|
350
|
+
else {
|
|
351
|
+
delete pivotLayout.GrandTotalRow;
|
|
352
|
+
}
|
|
353
|
+
if (layoutModel.GrandTotalColumn) {
|
|
354
|
+
pivotLayout.GrandTotalColumn = layoutModel.GrandTotalColumn;
|
|
355
|
+
}
|
|
356
|
+
else {
|
|
357
|
+
delete pivotLayout.GrandTotalColumn;
|
|
358
|
+
}
|
|
359
|
+
if (layoutModel.PivotGroupTotalColumn) {
|
|
360
|
+
pivotLayout.PivotGroupTotalColumn = layoutModel.PivotGroupTotalColumn;
|
|
361
|
+
}
|
|
362
|
+
else {
|
|
363
|
+
delete pivotLayout.PivotGroupTotalColumn;
|
|
364
|
+
}
|
|
343
365
|
if (layoutModel.PivotAggregationColumns) {
|
|
344
|
-
pivotLayout.PivotAggregationColumns = (layoutModel.PivotAggregationColumns || []).map(({ ColumnId, AggFunc }) => ({
|
|
366
|
+
pivotLayout.PivotAggregationColumns = (layoutModel.PivotAggregationColumns || []).map(({ ColumnId, AggFunc, TotalColumn }) => ({
|
|
345
367
|
ColumnId,
|
|
346
368
|
AggFunc: toAggregationColumnValue(AggFunc),
|
|
369
|
+
TotalColumn,
|
|
347
370
|
}));
|
|
348
371
|
}
|
|
349
372
|
else {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApiBase } from '../Implementation/ApiBase';
|
|
2
|
-
import { Column, IRowNode } from 'ag-grid-enterprise';
|
|
2
|
+
import { Column, HeaderValueGetterParams, IRowNode } from 'ag-grid-enterprise';
|
|
3
3
|
import { CustomSort } from '../../AdaptableState/CustomSortState';
|
|
4
4
|
import { ColumnValuesComparer } from '../../AdaptableOptions/CustomSortOptions';
|
|
5
5
|
import { AdaptableColumn } from '../../types';
|
|
@@ -31,4 +31,6 @@ export declare class ColumnInternalApi extends ApiBase {
|
|
|
31
31
|
getAgGridColumnForAdaptableColumn(columnId: string): Column;
|
|
32
32
|
getActiveColumnComparator(columnId: string, customSort?: CustomSort, customSortComparer?: ColumnValuesComparer): (valueA: any, valueB: any, nodeA?: IRowNode, nodeB?: IRowNode, isInverted?: boolean) => number | undefined;
|
|
33
33
|
isSpecialColumn(columnId: string, column?: AdaptableColumn): boolean;
|
|
34
|
+
getColumnHeaderName(params: HeaderValueGetterParams): string;
|
|
35
|
+
private buildColumnHeaderContext;
|
|
34
36
|
}
|
|
@@ -6,6 +6,10 @@ const ApiBase_1 = require("../Implementation/ApiBase");
|
|
|
6
6
|
const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
|
|
7
7
|
const uniq_1 = tslib_1.__importDefault(require("lodash/uniq"));
|
|
8
8
|
const StringExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/StringExtensions"));
|
|
9
|
+
const ColumnApiImpl_1 = require("../Implementation/ColumnApiImpl");
|
|
10
|
+
const destructurePivotColumnId_1 = require("../../layout-manager/src/destructurePivotColumnId");
|
|
11
|
+
const isPivotGroupTotalColumn_1 = require("../../layout-manager/src/isPivotGroupTotalColumn");
|
|
12
|
+
const isPivotTotalColumn_1 = require("../../layout-manager/src/isPivotTotalColumn");
|
|
9
13
|
function getAutoRowGroupColumnIdFor(columnId) {
|
|
10
14
|
return `${GeneralConstants_1.AG_GRID_GROUPED_COLUMN}-${columnId}`;
|
|
11
15
|
}
|
|
@@ -86,5 +90,202 @@ class ColumnInternalApi extends ApiBase_1.ApiBase {
|
|
|
86
90
|
this.getColumnApi().isActionColumn(columnId) ||
|
|
87
91
|
this.getColumnApi().isFdc3Column(columnId));
|
|
88
92
|
}
|
|
93
|
+
getColumnHeaderName(params) {
|
|
94
|
+
// this is the same object, but casting it makes it easier to work with
|
|
95
|
+
const isColumn = !params.columnGroup;
|
|
96
|
+
const columnParams = params;
|
|
97
|
+
const isColumnGroup = !!params.columnGroup;
|
|
98
|
+
const columnGroupParams = params;
|
|
99
|
+
const defaultHeaderName = params.colDef?.headerName ??
|
|
100
|
+
(isColumn ? StringExtensions_1.default.CamelCaseToHumanText(columnParams.colDef?.field) : '') ??
|
|
101
|
+
'';
|
|
102
|
+
// for now we override ONLY the header names
|
|
103
|
+
if (params.location !== 'header') {
|
|
104
|
+
return defaultHeaderName;
|
|
105
|
+
}
|
|
106
|
+
// 1. Layout specific header has the highest priority
|
|
107
|
+
const layoutSpecificCustomHeader = this.getLayoutApi().getCurrentLayout().ColumnHeaders?.[isColumn ? columnParams.column.getColId() : columnGroupParams.columnGroup.getGroupId()];
|
|
108
|
+
if (layoutSpecificCustomHeader) {
|
|
109
|
+
return layoutSpecificCustomHeader;
|
|
110
|
+
}
|
|
111
|
+
// 2. check for custom ColumnOptions.columnHeader
|
|
112
|
+
if (typeof this.getColumnOptions().columnHeader === 'function') {
|
|
113
|
+
const columnHeaderContext = this.buildColumnHeaderContext(params, defaultHeaderName);
|
|
114
|
+
if (columnHeaderContext === 'skip') {
|
|
115
|
+
return defaultHeaderName;
|
|
116
|
+
}
|
|
117
|
+
const customHeader = this.getColumnOptions().columnHeader(columnHeaderContext);
|
|
118
|
+
return customHeader;
|
|
119
|
+
}
|
|
120
|
+
// 3. fallback to default header name
|
|
121
|
+
return defaultHeaderName;
|
|
122
|
+
}
|
|
123
|
+
buildColumnHeaderContext(params, defaultHeaderName) {
|
|
124
|
+
const currentLayoutType = this.getLayoutApi().isCurrentLayoutPivot() ? 'pivot' : 'table';
|
|
125
|
+
const currentLayout = this.getLayoutApi().getCurrentLayout();
|
|
126
|
+
const baseContext = {
|
|
127
|
+
...this.getAdaptableApi().internalApi.buildBaseContext(),
|
|
128
|
+
defaultHeaderName,
|
|
129
|
+
currentLayout,
|
|
130
|
+
currentLayoutName: currentLayout.Name,
|
|
131
|
+
currentLayoutType: currentLayoutType,
|
|
132
|
+
};
|
|
133
|
+
// makes it easier to work with
|
|
134
|
+
const currentTableLayout = currentLayout;
|
|
135
|
+
const currentPivotLayout = currentLayout;
|
|
136
|
+
if (params.column?.getColId() === GeneralConstants_1.AG_GRID_GROUPED_COLUMN) {
|
|
137
|
+
const columnType = 'autoGroupColumn';
|
|
138
|
+
return {
|
|
139
|
+
...baseContext,
|
|
140
|
+
columnType,
|
|
141
|
+
columnId: params.column.getColId(),
|
|
142
|
+
groupedColumnIds: currentLayoutType === 'table'
|
|
143
|
+
? currentTableLayout.RowGroupedColumns ?? []
|
|
144
|
+
: currentPivotLayout.PivotGroupedColumns ?? [],
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
if (params.column?.getColId().startsWith(`${GeneralConstants_1.AG_GRID_GROUPED_COLUMN}-`)) {
|
|
148
|
+
const columnType = 'groupColumn';
|
|
149
|
+
const columnId = params.column.getColId();
|
|
150
|
+
// remove `${AG_GRID_GROUPED_COLUMN}-` from beginning of columnId
|
|
151
|
+
const groupColumnId = columnId.substring(`${GeneralConstants_1.AG_GRID_GROUPED_COLUMN}-`.length);
|
|
152
|
+
return {
|
|
153
|
+
...baseContext,
|
|
154
|
+
columnType,
|
|
155
|
+
columnId,
|
|
156
|
+
groupColumnId,
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
if (baseContext.currentLayoutType === 'table') {
|
|
160
|
+
if (params.columnGroup) {
|
|
161
|
+
const columnType = 'tableColumnGroup';
|
|
162
|
+
if (!params.colDef?.children) {
|
|
163
|
+
// AG Grid created virtual column groups for all columns
|
|
164
|
+
// we want to skip those
|
|
165
|
+
return 'skip';
|
|
166
|
+
}
|
|
167
|
+
return {
|
|
168
|
+
...baseContext,
|
|
169
|
+
columnType,
|
|
170
|
+
groupId: params.columnGroup?.getGroupId(),
|
|
171
|
+
childrenColumnIds: params.columnGroup
|
|
172
|
+
?.getChildren()
|
|
173
|
+
.map((col) => {
|
|
174
|
+
if (col.isColumn) {
|
|
175
|
+
return col.getColId();
|
|
176
|
+
}
|
|
177
|
+
})
|
|
178
|
+
.filter(Boolean),
|
|
179
|
+
state: params.columnGroup?.isExpandable() && !params.columnGroup?.isExpanded()
|
|
180
|
+
? 'collapsed'
|
|
181
|
+
: 'expanded',
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
if (params.column) {
|
|
185
|
+
const columnType = 'tableColumn';
|
|
186
|
+
return {
|
|
187
|
+
...baseContext,
|
|
188
|
+
columnType,
|
|
189
|
+
columnId: params.column?.getColId(),
|
|
190
|
+
aggregation: params.column.getAggFunc(),
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
if (baseContext.currentLayoutType === 'pivot') {
|
|
195
|
+
if (params.columnGroup) {
|
|
196
|
+
if (!params.colDef?.pivotKeys) {
|
|
197
|
+
// we might have user defined colGroups, but we are not interested in them in pivot mode
|
|
198
|
+
return 'skip';
|
|
199
|
+
}
|
|
200
|
+
const columnType = 'pivotColumnGroup';
|
|
201
|
+
return {
|
|
202
|
+
...baseContext,
|
|
203
|
+
columnType,
|
|
204
|
+
groupId: params.columnGroup?.getGroupId(),
|
|
205
|
+
pivotKeys: params.colDef.pivotKeys,
|
|
206
|
+
state: params.columnGroup?.isExpandable() && !params.columnGroup?.isExpanded()
|
|
207
|
+
? 'collapsed'
|
|
208
|
+
: 'expanded',
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
if (params.column) {
|
|
212
|
+
let columnId = params.column.getColId();
|
|
213
|
+
if ((0, ColumnApiImpl_1.isPivotGrandTotalColumn)(columnId)) {
|
|
214
|
+
const columnType = 'pivotGrandTotal';
|
|
215
|
+
const pivotValueCol = params.colDef.pivotValueColumn;
|
|
216
|
+
const aggregatedColumnId = pivotValueCol?.getColId();
|
|
217
|
+
const currentLayoutAggCols = currentPivotLayout.PivotAggregationColumns?.map((col) => col.ColumnId);
|
|
218
|
+
if (!currentLayoutAggCols?.includes(aggregatedColumnId)) {
|
|
219
|
+
// this column is not an aggregation column
|
|
220
|
+
return 'skip';
|
|
221
|
+
}
|
|
222
|
+
return {
|
|
223
|
+
...baseContext,
|
|
224
|
+
columnType,
|
|
225
|
+
aggregatedColumnId,
|
|
226
|
+
aggregation: pivotValueCol.getAggFunc(),
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
if ((0, isPivotGroupTotalColumn_1.isPivotGroupTotalColumn)(params.colDef)) {
|
|
230
|
+
const columnType = 'pivotGroupTotal';
|
|
231
|
+
const pivotColInfo = (0, destructurePivotColumnId_1.destructurePivotColumnId)(params.colDef, {
|
|
232
|
+
pivotColIds: currentPivotLayout.PivotColumns,
|
|
233
|
+
aggColIds: currentPivotLayout.PivotAggregationColumns.map((col) => col.ColumnId),
|
|
234
|
+
}, (message) => this.logWarn(message));
|
|
235
|
+
if (pivotColInfo === '!unknown!') {
|
|
236
|
+
return 'skip';
|
|
237
|
+
}
|
|
238
|
+
const pivotKey = pivotColInfo.pivotKeys[pivotColInfo.pivotKeys.length - 1];
|
|
239
|
+
return {
|
|
240
|
+
...baseContext,
|
|
241
|
+
columnType,
|
|
242
|
+
pivotKey,
|
|
243
|
+
pivotColumnId: pivotColInfo.pivotColumnId,
|
|
244
|
+
aggregation: params.colDef?.pivotValueColumn?.getAggFunc(),
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
if ((0, isPivotTotalColumn_1.isPivotTotalColumn)(params.colDef)) {
|
|
248
|
+
const columnType = 'pivotAggregationTotal';
|
|
249
|
+
const pivotValueCol = params.colDef.pivotValueColumn;
|
|
250
|
+
const pivotColInfo = (0, destructurePivotColumnId_1.destructurePivotColumnId)(params.colDef, {
|
|
251
|
+
pivotColIds: currentPivotLayout.PivotColumns,
|
|
252
|
+
aggColIds: currentPivotLayout.PivotAggregationColumns.map((col) => col.ColumnId),
|
|
253
|
+
}, (message) => this.logWarn(message));
|
|
254
|
+
if (pivotColInfo === '!unknown!') {
|
|
255
|
+
return 'skip';
|
|
256
|
+
}
|
|
257
|
+
const pivotKey = pivotColInfo.pivotKeys[pivotColInfo.pivotKeys.length - 1];
|
|
258
|
+
return {
|
|
259
|
+
...baseContext,
|
|
260
|
+
columnType,
|
|
261
|
+
aggregatedColumnId: pivotValueCol?.getColId(),
|
|
262
|
+
aggregation: pivotValueCol.getAggFunc(),
|
|
263
|
+
pivotColumnId: pivotColInfo.pivotColumnId,
|
|
264
|
+
pivotKey,
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
if ((0, ColumnApiImpl_1.isPivotResultColumn)(columnId)) {
|
|
268
|
+
const columnType = 'pivotAggregationColumn';
|
|
269
|
+
const pivotValueCol = params.colDef.pivotValueColumn;
|
|
270
|
+
const aggregatedColumnId = pivotValueCol?.getColId();
|
|
271
|
+
const currentLayoutAggCols = currentPivotLayout.PivotAggregationColumns?.map((col) => col.ColumnId);
|
|
272
|
+
if (!currentLayoutAggCols?.includes(aggregatedColumnId)) {
|
|
273
|
+
// this column is not an aggregation column
|
|
274
|
+
return 'skip';
|
|
275
|
+
}
|
|
276
|
+
return {
|
|
277
|
+
...baseContext,
|
|
278
|
+
columnType,
|
|
279
|
+
columnId,
|
|
280
|
+
pivotKeys: params.colDef.pivotKeys,
|
|
281
|
+
aggregatedColumnId,
|
|
282
|
+
aggregation: pivotValueCol.getAggFunc(),
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
// if nothing matched, we skip this column[group]
|
|
288
|
+
return 'skip';
|
|
289
|
+
}
|
|
89
290
|
}
|
|
90
291
|
exports.ColumnInternalApi = ColumnInternalApi;
|
|
@@ -24,6 +24,7 @@ export declare const GROUP_PATH_SEPARATOR: string;
|
|
|
24
24
|
export declare const AG_GRID_GROUPED_COLUMN: string;
|
|
25
25
|
export declare const AG_GRID_SELECTION_COLUMN: string;
|
|
26
26
|
export declare const AG_GRID_PIVOT_COLUMN: string;
|
|
27
|
+
export declare const AG_GRID_PIVOT_GRAND_TOTAL_COLUMN: string;
|
|
27
28
|
export declare const AG_GRID_CHART_WINDOW = "AG Grid Window";
|
|
28
29
|
export declare const ADAPTABLE_FDC3_ACTION_COLUMN_FRIENDLY_NAME = "(FDC3ActionColumn)";
|
|
29
30
|
export declare const DEFAULT_DATE_FORMAT_PATTERN = "dd-MM-yyyy";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.OBSERVABLE_EXPRESSION_ROW_REMOVED = exports.OBSERVABLE_EXPRESSION_ROW_ADDED = exports.STANDALONE_MODULE_POPUPS = exports.LAYOUT_DELETE_TOOLTIP = exports.LAYOUT_CLONE_TOOLTIP = exports.LAYOUT_EDIT_TOOLTIP = exports.LAYOUT_SAVE_TOOLTIP = exports.LAYOUT_NEW_TABLE_OR_PIVOT_TOOLTIP = void 0;
|
|
3
|
+
exports.LAYOUT_NEW_TABLE_TOOLTIP = exports.THEME_STYLE = exports.SYSTEM_EXPORT_DESTINATIONS = exports.CLIPBOARD_EXPORT_DESTINATION = exports.DOWNLOAD_EXPORT_DESTINATION = exports.SELECT_REPORT_FORMAT_STRING = exports.SELECT_REPORT_STRING = exports.SYSTEM_REPORT_FORMATS = exports.JSON_FORMAT_REPORT = exports.CSV_FORMAT_REPORT = exports.VISUAL_EXCEL_FORMAT_REPORT = exports.EXCEL_FORMAT_REPORT = exports.SYSTEM_REPORT_NAMES = exports.SELECTED_DATA_REPORT = exports.CURRENT_LAYOUT_REPORT = exports.ALL_DATA_REPORT = exports.SERVER_VALIDATION_MESSAGE_TYPE = exports.SERVER_VALIDATION_HEADER = exports.DEFAULT_LIVE_REPORT_THROTTLE_TIME = exports.MENU_SEPARATOR = exports.QUICK_SEARCH_DEBOUNCE_TIME = exports.DEFAULT_DOUBLE_DISPLAY_VALUE = exports.DEFAULT_INTEGER_DISPLAY_VALUE = exports.DEFAULT_STRING_DISPLAY_VALUE = exports.DEFAULT_DATE_FORMAT_PATTERN_WITH_TIME = exports.DEFAULT_DATE_FORMAT_PATTERN = exports.ADAPTABLE_FDC3_ACTION_COLUMN_FRIENDLY_NAME = exports.AG_GRID_CHART_WINDOW = exports.AG_GRID_PIVOT_GRAND_TOTAL_COLUMN = exports.AG_GRID_PIVOT_COLUMN = exports.AG_GRID_SELECTION_COLUMN = exports.AG_GRID_GROUPED_COLUMN = exports.GROUP_PATH_SEPARATOR = exports.QUARTER_SECOND = exports.HALF_SECOND = exports.EMPTY_ARRAY = exports.EMPTY_STRING = exports.READ_ONLY_STYLE = exports.AGGRID_TOOLPANEL_COLUMNS = exports.AGGRID_TOOLPANEL_FILTERS = exports.ADAPTABLE_TOOLPANEL_COMPONENT = exports.ADAPTABLE_TOOLPANEL_ID = exports.ADAPTABLE_ID = exports.ADAPTABLE = exports.ERROR_LAYOUT = exports.OS_THEME = exports.DARK_THEME = exports.LIGHT_THEME = exports.MISSING_COLUMN = exports.AUTOGENERATED_PK_COLUMN = void 0;
|
|
4
|
+
exports.OBSERVABLE_EXPRESSION_ROW_REMOVED = exports.OBSERVABLE_EXPRESSION_ROW_ADDED = exports.STANDALONE_MODULE_POPUPS = exports.LAYOUT_DELETE_TOOLTIP = exports.LAYOUT_CLONE_TOOLTIP = exports.LAYOUT_EDIT_TOOLTIP = exports.LAYOUT_SAVE_TOOLTIP = exports.LAYOUT_NEW_TABLE_OR_PIVOT_TOOLTIP = exports.LAYOUT_NEW_PIVOT_TOOLTIP = void 0;
|
|
5
5
|
exports.AUTOGENERATED_PK_COLUMN = '__ADAPTABLE_PK__';
|
|
6
6
|
exports.MISSING_COLUMN = ' [MISSING]';
|
|
7
7
|
exports.LIGHT_THEME = 'light';
|
|
@@ -27,6 +27,7 @@ exports.GROUP_PATH_SEPARATOR = '/';
|
|
|
27
27
|
exports.AG_GRID_GROUPED_COLUMN = 'ag-Grid-AutoColumn';
|
|
28
28
|
exports.AG_GRID_SELECTION_COLUMN = 'ag-Grid-SelectionColumn';
|
|
29
29
|
exports.AG_GRID_PIVOT_COLUMN = 'pivot_';
|
|
30
|
+
exports.AG_GRID_PIVOT_GRAND_TOTAL_COLUMN = 'PivotRowTotal_pivot_';
|
|
30
31
|
exports.AG_GRID_CHART_WINDOW = 'AG Grid Window';
|
|
31
32
|
exports.ADAPTABLE_FDC3_ACTION_COLUMN_FRIENDLY_NAME = '(FDC3ActionColumn)';
|
|
32
33
|
// FIXME AFL - load this from DateInputOptions
|
|
@@ -35,13 +35,21 @@ function IsNotNullOrEmptyOrWhiteSpace(stringToCheck) {
|
|
|
35
35
|
return !IsNullOrEmptyOrWhiteSpace(stringToCheck);
|
|
36
36
|
}
|
|
37
37
|
exports.IsNotNullOrEmptyOrWhiteSpace = IsNotNullOrEmptyOrWhiteSpace;
|
|
38
|
-
//
|
|
38
|
+
// clone of A Grid's implementation
|
|
39
|
+
// https://github.com/ag-grid/ag-grid/blob/a5c3d9f56350271ab7e8d42d72aaf5314672719a/packages/ag-grid-community/src/columns/columnNameService.ts#L14
|
|
39
40
|
function CamelCaseToHumanText(camelCase) {
|
|
40
41
|
if (!camelCase || camelCase == null) {
|
|
41
42
|
return null;
|
|
42
43
|
}
|
|
43
|
-
|
|
44
|
-
const
|
|
44
|
+
// either split on a lowercase followed by uppercase ie asHereTo -> as Here To
|
|
45
|
+
const rex = /([a-z])([A-Z])/g;
|
|
46
|
+
// or starts with uppercase and we take all expect the last which is assumed to be part of next word if followed by lowercase HEREToThere -> HERE To There
|
|
47
|
+
const rexCaps = /([A-Z]+)([A-Z])([a-z])/g;
|
|
48
|
+
const words = camelCase
|
|
49
|
+
.replace(rex, '$1 $2')
|
|
50
|
+
.replace(rexCaps, '$1 $2$3')
|
|
51
|
+
.replace(/\./g, ' ')
|
|
52
|
+
.split(' ');
|
|
45
53
|
return words
|
|
46
54
|
.map((word) => word.substring(0, 1).toUpperCase() + (word.length > 1 ? word.substring(1, word.length) : ''))
|
|
47
55
|
.join(' ');
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isProvidedByAdaptable = exports.tagProvidedByAdaptable = void 0;
|
|
4
|
+
const PROVIDED_BY_ADAPTABLE = Symbol('isProvidedByAdaptable');
|
|
5
|
+
function tagProvidedByAdaptable(fn) {
|
|
6
|
+
fn[PROVIDED_BY_ADAPTABLE] = true;
|
|
7
|
+
return fn;
|
|
8
|
+
}
|
|
9
|
+
exports.tagProvidedByAdaptable = tagProvidedByAdaptable;
|
|
10
|
+
function isProvidedByAdaptable(fn) {
|
|
11
|
+
return fn && !!fn[PROVIDED_BY_ADAPTABLE];
|
|
12
|
+
}
|
|
13
|
+
exports.isProvidedByAdaptable = isProvidedByAdaptable;
|
|
@@ -101,6 +101,7 @@ const AdaptableColumn_1 = require("../AdaptableState/Common/AdaptableColumn");
|
|
|
101
101
|
const agGridDataTypeDefinitions_1 = require("./agGridDataTypeDefinitions");
|
|
102
102
|
const AgGridThemeAdapter_1 = require("./AgGridThemeAdapter");
|
|
103
103
|
const VersionUpgrade20_1 = require("../migration/VersionUpgrade20");
|
|
104
|
+
const adaptableOverrideCheck_1 = require("../Utilities/adaptableOverrideCheck");
|
|
104
105
|
const LocalEventService_Prototype = ag_grid_enterprise_1.LocalEventService.prototype;
|
|
105
106
|
const LocalEventService_dispatchEvent = LocalEventService_Prototype.dispatchEvent;
|
|
106
107
|
LocalEventService_Prototype.dispatchEvent = function (event) {
|
|
@@ -614,6 +615,34 @@ You need to define at least one Layout!`);
|
|
|
614
615
|
this.agGridAdapter.setAgGridId(agGridId);
|
|
615
616
|
return agGridId;
|
|
616
617
|
});
|
|
618
|
+
/**
|
|
619
|
+
* `defaultColDef`
|
|
620
|
+
*/
|
|
621
|
+
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'defaultColDef', (original_defaultColDef) => {
|
|
622
|
+
if (original_defaultColDef?.headerValueGetter) {
|
|
623
|
+
this.logger.warn(`defaultColDef.headerValueGetter and overrides the Adaptable custom header mechanism! We recommend using a ColumnOptions.tableColumnHeader instead!`);
|
|
624
|
+
return original_defaultColDef;
|
|
625
|
+
}
|
|
626
|
+
const defaultColDef = original_defaultColDef ?? {};
|
|
627
|
+
defaultColDef.headerValueGetter = (0, adaptableOverrideCheck_1.tagProvidedByAdaptable)((params) => {
|
|
628
|
+
return this.api.columnApi.internalApi.getColumnHeaderName(params);
|
|
629
|
+
});
|
|
630
|
+
return defaultColDef;
|
|
631
|
+
});
|
|
632
|
+
/**
|
|
633
|
+
* `defaultColGroupDef`
|
|
634
|
+
*/
|
|
635
|
+
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'defaultColGroupDef', (original_defaultColGroupDef) => {
|
|
636
|
+
if (original_defaultColGroupDef?.headerValueGetter) {
|
|
637
|
+
this.logger.warn(`defaultColGroupDef.headerValueGetter and overrides the Adaptable custom header mechanism! We recommend using a ColumnOptions.tableColumnHeader instead!`);
|
|
638
|
+
return original_defaultColGroupDef;
|
|
639
|
+
}
|
|
640
|
+
const defaultColGroupDef = original_defaultColGroupDef ?? {};
|
|
641
|
+
defaultColGroupDef.headerValueGetter = (0, adaptableOverrideCheck_1.tagProvidedByAdaptable)((params) => {
|
|
642
|
+
return this.api.columnApi.internalApi.getColumnHeaderName(params);
|
|
643
|
+
});
|
|
644
|
+
return defaultColGroupDef;
|
|
645
|
+
});
|
|
617
646
|
/**
|
|
618
647
|
* `theme`
|
|
619
648
|
*/
|
|
@@ -27,7 +27,7 @@ export declare class AgGridColumnAdapter {
|
|
|
27
27
|
private setupColumnAllowedAggFuncs;
|
|
28
28
|
private setupColumnType;
|
|
29
29
|
private setupColumnCellDataType;
|
|
30
|
-
setupColumnHeader({ col, abColumn }: ColumnSetupInfo):
|
|
30
|
+
setupColumnHeader({ col, abColumn }: ColumnSetupInfo): void;
|
|
31
31
|
private setupColumnFilter;
|
|
32
32
|
setupColumnFloatingFilterTemporarily(initialGridOptions: GridOptions): void;
|
|
33
33
|
private setupColumnFloatingFilter;
|
|
@@ -17,6 +17,7 @@ const AdaptableNumberEditor_1 = require("./editors/AdaptableNumberEditor");
|
|
|
17
17
|
const AdaptableDateEditor_1 = require("./editors/AdaptableDateEditor");
|
|
18
18
|
const AgGridExportAdapter_1 = require("./AgGridExportAdapter");
|
|
19
19
|
const AdaptableHelper_1 = require("../Utilities/Helpers/AdaptableHelper");
|
|
20
|
+
const adaptableOverrideCheck_1 = require("../Utilities/adaptableOverrideCheck");
|
|
20
21
|
function getEditorForColumnDataType(columnDataType, variant) {
|
|
21
22
|
if (columnDataType === 'number') {
|
|
22
23
|
return variant === 'react' ? AdaptableNumberEditor_1.AdaptableReactNumberEditor : AdaptableNumberEditor_1.AdaptableNumberEditor;
|
|
@@ -376,19 +377,12 @@ class AgGridColumnAdapter {
|
|
|
376
377
|
});
|
|
377
378
|
}
|
|
378
379
|
setupColumnHeader({ col, abColumn }) {
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
const layoutCustomHeader = this.adaptableApi.layoutApi.getCurrentLayout().ColumnHeaders?.[col.getColId()];
|
|
385
|
-
if (layoutCustomHeader) {
|
|
386
|
-
resultHeaderName = layoutCustomHeader;
|
|
387
|
-
}
|
|
388
|
-
return resultHeaderName;
|
|
380
|
+
this.setColDefProperty(col, 'headerValueGetter', (original_headerValueGetter) => {
|
|
381
|
+
if (!(0, adaptableOverrideCheck_1.isProvidedByAdaptable)(original_headerValueGetter)) {
|
|
382
|
+
this.adaptableApi.logWarn(`colDef.headerValueGetter is defined for column '${col.getColId()}', and overrides the Adaptable custom header mechanism! We recommend using a ColumnOptions.tableColumnHeader instead!`);
|
|
383
|
+
}
|
|
384
|
+
return original_headerValueGetter;
|
|
389
385
|
});
|
|
390
|
-
const newColumnHeader = col?.getColDef()?.headerName;
|
|
391
|
-
return previousColumnHeader !== newColumnHeader;
|
|
392
386
|
}
|
|
393
387
|
setupColumnFilter({ col, colDef }) {
|
|
394
388
|
this.setColDefProperty(col, 'filter', () => {
|
|
@@ -33,7 +33,7 @@ const INFINITE_COLUMNS_WITH_CHECKBOX = {
|
|
|
33
33
|
resizable: false,
|
|
34
34
|
defaultSortable: false,
|
|
35
35
|
renderSelectionCheckBox: ({ renderBag }) => {
|
|
36
|
-
return
|
|
36
|
+
return renderBag.selectionCheckBox;
|
|
37
37
|
},
|
|
38
38
|
renderHeader: (headerParams) => {
|
|
39
39
|
return (React.createElement(React.Fragment, null,
|
|
@@ -153,7 +153,7 @@ const Select = function (props) {
|
|
|
153
153
|
placeholder: props.placeholder,
|
|
154
154
|
});
|
|
155
155
|
const title = typeof customRenderValue === 'string' ? customRenderValue : '';
|
|
156
|
-
children = customRenderValue ? (React.createElement(rebass_1.Box, { display: 'flex', flexDirection: 'row', flex: 1, flexWrap: 'nowrap', alignItems: 'center', overflow: 'hidden' },
|
|
156
|
+
children = customRenderValue ? (React.createElement(rebass_1.Box, { display: 'flex', flexDirection: 'row', flex: 1, flexWrap: 'nowrap', alignItems: 'center', overflow: 'hidden', height: '100%' },
|
|
157
157
|
React.createElement("span", { title: title, "data-name": "multi-value-text", style: {
|
|
158
158
|
flex: '0 1 auto',
|
|
159
159
|
appearance: 'none',
|
|
@@ -470,7 +470,7 @@ const Select = function (props) {
|
|
|
470
470
|
return {
|
|
471
471
|
...baseStyle,
|
|
472
472
|
...commonStyles(state), // height: 30,
|
|
473
|
-
minHeight: props.size === 'small' ? 0 :
|
|
473
|
+
minHeight: props.size === 'small' ? 0 : '100%',
|
|
474
474
|
boxShadow: state.isFocused ? 'var(--ab-cmp-select-focused__box-shadow)' : 'none',
|
|
475
475
|
outline: state.isFocused ? 'var(--ab-cmp-select-focused__outline)' : 'none',
|
|
476
476
|
border: 'var(--ab-cmp-select__border)',
|
package/src/env.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = {
|
|
4
4
|
NEXT_PUBLIC_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: "20.0.
|
|
5
|
+
PUBLISH_TIMESTAMP: 1745347683994 || Date.now(),
|
|
6
|
+
VERSION: "20.0.7-canary.0" || '--current-version--',
|
|
7
7
|
};
|
|
@@ -62,26 +62,17 @@ export type ColumnAggregationModel = {
|
|
|
62
62
|
aggFunc: string | true;
|
|
63
63
|
weightedColumnId?: string;
|
|
64
64
|
};
|
|
65
|
-
export type
|
|
65
|
+
export type AggregationColumnsModelItem = {
|
|
66
66
|
ColumnId: string;
|
|
67
67
|
AggFunc: ColumnAggregationModel;
|
|
68
|
-
}
|
|
69
|
-
type
|
|
70
|
-
export
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
* Map of Columns with Summary Expressions
|
|
77
|
-
*/
|
|
78
|
-
ColumnsMap: Record<string, string>;
|
|
79
|
-
/**
|
|
80
|
-
* Evaluates only currently filtered rows in the summary
|
|
81
|
-
* @defaultValue true
|
|
82
|
-
*/
|
|
83
|
-
IncludeOnlyFilteredRows?: boolean;
|
|
84
|
-
}
|
|
68
|
+
};
|
|
69
|
+
export type AggregationColumnsModel = AggregationColumnsModelItem[];
|
|
70
|
+
export type PivotAggregationColumnsModel = (AggregationColumnsModelItem & {
|
|
71
|
+
TotalColumn?: boolean | 'before' | 'after' | {
|
|
72
|
+
PivotColumnId: string;
|
|
73
|
+
ShowTotal?: boolean | 'before' | 'after';
|
|
74
|
+
}[];
|
|
75
|
+
})[];
|
|
85
76
|
export interface TableLayoutModel extends BaseLayoutModel {
|
|
86
77
|
TableColumns: string[];
|
|
87
78
|
/**
|
|
@@ -96,6 +87,7 @@ export interface TableLayoutModel extends BaseLayoutModel {
|
|
|
96
87
|
* @defaultValue 'single'
|
|
97
88
|
*/
|
|
98
89
|
RowGroupDisplayType?: 'single' | 'multi';
|
|
90
|
+
PivotAggregationColumns?: never;
|
|
99
91
|
PivotColumns?: never;
|
|
100
92
|
PivotGroupedColumns?: never;
|
|
101
93
|
PivotExpandLevel?: never;
|
|
@@ -110,13 +102,24 @@ export interface PivotLayoutModel extends BaseLayoutModel {
|
|
|
110
102
|
/**
|
|
111
103
|
* Columns showing aggregated values in Group Rows; 1st value in record is Column name, 2nd is either aggfunc (e.g. sum, avg etc.) or 'true' (to use default aggfunc)
|
|
112
104
|
*/
|
|
113
|
-
PivotAggregationColumns?:
|
|
105
|
+
PivotAggregationColumns?: PivotAggregationColumnsModel;
|
|
114
106
|
TableAggregationColumns?: never;
|
|
115
107
|
/**
|
|
116
108
|
* Columns which are row-grouped when the Layout is applied
|
|
117
109
|
*/
|
|
118
110
|
PivotGroupedColumns?: string[];
|
|
119
111
|
RowGroupedColumns?: never;
|
|
112
|
+
/**
|
|
113
|
+
* Display Grand Total Row at the top or bottom of the Pivot Table
|
|
114
|
+
*/
|
|
115
|
+
GrandTotalRow?: 'top' | 'bottom' | boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Display Total of all Pivot Columns before or after the Pivot Columns
|
|
118
|
+
*/
|
|
119
|
+
GrandTotalColumn?: 'before' | 'after' | boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Display automatically calculated Totals within EACH Pivot Column Group, in the position specified
|
|
122
|
+
*/
|
|
123
|
+
PivotGroupTotalColumn?: 'before' | 'after' | boolean;
|
|
120
124
|
}
|
|
121
125
|
export type LayoutModel = TableLayoutModel | PivotLayoutModel;
|
|
122
|
-
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ColDef } from 'ag-grid-enterprise';
|
|
2
|
+
export declare function destructurePivotColumnId(colDef: ColDef, currentModel: {
|
|
3
|
+
pivotColIds: string[];
|
|
4
|
+
aggColIds: string[];
|
|
5
|
+
}, logWarning: (message: string) => void): '!unknown!' | {
|
|
6
|
+
pivotColumnIds: string[];
|
|
7
|
+
pivotKeys: string[];
|
|
8
|
+
pivotColumnId: string;
|
|
9
|
+
aggregationColumnId?: string;
|
|
10
|
+
};
|