@adaptabletools/adaptable-cjs 20.0.12 → 20.0.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/package.json +1 -1
- package/src/AdaptableState/Common/AggregationColumns.d.ts +3 -2
- package/src/AdaptableState/Common/AggregationColumns.js +0 -3
- package/src/AdaptableState/LayoutState.d.ts +6 -2
- package/src/View/Layout/Wizard/sections/PivotAggregationsSection.js +3 -3
- package/src/agGrid/AdaptableAgGrid.js +4 -0
- package/src/agGrid/AgGridColumnAdapter.js +21 -3
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +4 -4
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +1 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable-cjs",
|
|
3
|
-
"version": "20.0.
|
|
3
|
+
"version": "20.0.13",
|
|
4
4
|
"description": "Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Defines which Columns in a Layout display Aggregated values when Row-Grouped
|
|
3
3
|
*/
|
|
4
|
+
import { PivotTotalPosition } from '../LayoutState';
|
|
4
5
|
export type AggregationColumnValue = string | true | WeightedAverageAggregation;
|
|
5
6
|
/**
|
|
6
7
|
* Defines an Aggregated Column in a Table Layout
|
|
@@ -24,9 +25,9 @@ export type PivotAggregationColumns = {
|
|
|
24
25
|
/**
|
|
25
26
|
* Whether to show the total for this column; it can be also customized for specific Pivot Columns
|
|
26
27
|
*/
|
|
27
|
-
Total?:
|
|
28
|
+
Total?: PivotTotalPosition | {
|
|
28
29
|
PivotColumnId: string;
|
|
29
|
-
ShowTotal?:
|
|
30
|
+
ShowTotal?: PivotTotalPosition;
|
|
30
31
|
}[];
|
|
31
32
|
}[];
|
|
32
33
|
export declare const WEIGHTED_AVERAGE_AGG_FN_NAME = "weightedAvg";
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Defines which Columns in a Layout display Aggregated values when Row-Grouped
|
|
4
|
-
*/
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.getAggFuncName = exports.isWeightedAverageAggregation = exports.isWeightedAverageAggFuncName = exports.WEIGHTED_AVERAGE_AGG_FN_NAME = void 0;
|
|
7
4
|
exports.WEIGHTED_AVERAGE_AGG_FN_NAME = 'weightedAvg';
|
|
@@ -155,12 +155,16 @@ export interface PivotLayout extends LayoutBase {
|
|
|
155
155
|
/**
|
|
156
156
|
* Display automatically calculated Totals of all Pivot Columns, in the position specified
|
|
157
157
|
*/
|
|
158
|
-
PivotGrandTotal?:
|
|
158
|
+
PivotGrandTotal?: PivotTotalPosition;
|
|
159
159
|
/**
|
|
160
160
|
* Display automatically calculated Totals within EACH Pivot Column Group, in the position specified
|
|
161
161
|
*/
|
|
162
|
-
PivotColumnTotal?:
|
|
162
|
+
PivotColumnTotal?: PivotTotalPosition;
|
|
163
163
|
}
|
|
164
|
+
/**
|
|
165
|
+
* Defines the position of Pivot Total position - 'before' or 'after' the Value Column(s)
|
|
166
|
+
*/
|
|
167
|
+
export type PivotTotalPosition = 'before' | 'after' | boolean;
|
|
164
168
|
/**
|
|
165
169
|
* Manages how (and which) Row Group values are stored
|
|
166
170
|
*/
|
|
@@ -183,7 +183,7 @@ const PivotColumnRow = (props) => {
|
|
|
183
183
|
' ',
|
|
184
184
|
React.createElement(DropdownButton_1.default, { columns: ['label'], items: numericColumnsOptions, ml: 2 }, weightName))),
|
|
185
185
|
aggValue && (React.createElement(rebass_1.Flex, { backgroundColor: "primary", ml: 3, alignItems: "center" },
|
|
186
|
-
React.createElement(rebass_1.Text, null, "Total
|
|
186
|
+
React.createElement(rebass_1.Text, null, "Total"),
|
|
187
187
|
' ',
|
|
188
188
|
React.createElement(DropdownButton_1.default, { columns: ['label'], items: totalOptions, ml: 2 }, currentTotal)))),
|
|
189
189
|
hasPivotSpecificTotals && (React.createElement(rebass_1.Flex, { ml: 2, pl: 2, flexWrap: "wrap", flex: "1 1 auto", alignItems: "center", style: {
|
|
@@ -339,7 +339,7 @@ const PivotAggregationsSection = (props) => {
|
|
|
339
339
|
GrandTotalRow: value,
|
|
340
340
|
});
|
|
341
341
|
}, isClearable: true })),
|
|
342
|
-
React.createElement(FormLayout_1.FormRow, { label: 'Grand Total
|
|
342
|
+
React.createElement(FormLayout_1.FormRow, { label: 'Pivot Grand Total' },
|
|
343
343
|
React.createElement(Select_1.Select, { style: { width: 120 }, options: ['before', 'after'].map((position) => {
|
|
344
344
|
return {
|
|
345
345
|
label: StringExtensions_1.default.CapitaliseFirstLetter(position),
|
|
@@ -351,7 +351,7 @@ const PivotAggregationsSection = (props) => {
|
|
|
351
351
|
PivotGrandTotal: value,
|
|
352
352
|
});
|
|
353
353
|
}, isClearable: true })),
|
|
354
|
-
React.createElement(FormLayout_1.FormRow, { label: 'Pivot
|
|
354
|
+
React.createElement(FormLayout_1.FormRow, { label: 'Pivot Column Total' }, isPivotColumnTotalEnabled === true ? (React.createElement(Select_1.Select, { style: { width: 120 }, options: ['before', 'after'].map((position) => {
|
|
355
355
|
return {
|
|
356
356
|
label: StringExtensions_1.default.CapitaliseFirstLetter(position),
|
|
357
357
|
value: position,
|
|
@@ -1080,6 +1080,10 @@ You need to define at least one Layout!`);
|
|
|
1080
1080
|
[AdaptableColumn_1.FREE_TEXT_COLUMN_TYPE]: {},
|
|
1081
1081
|
[AdaptableColumn_1.ACTION_COLUMN_TYPE]: {},
|
|
1082
1082
|
[AdaptableColumn_1.FDC3_COLUMN_TYPE]: {},
|
|
1083
|
+
[AdaptableColumn_1.PIVOT_ANY_TOTAL_COLUMN_TYPE]: {},
|
|
1084
|
+
[AdaptableColumn_1.PIVOT_GRAND_TOTAL_COLUMN_TYPE]: {},
|
|
1085
|
+
[AdaptableColumn_1.PIVOT_COLUMN_TOTAL_COLUMN_TYPE]: {},
|
|
1086
|
+
[AdaptableColumn_1.PIVOT_AGGREGATION_TOTAL_COLUMN_TYPE]: {},
|
|
1083
1087
|
};
|
|
1084
1088
|
const patchedColumnTypes = Object.assign({}, providedColumnTypes, adaptableSpecialColumnTypes);
|
|
1085
1089
|
const customColumnTypes = this.api.columnApi.getColumnTypes() ?? [];
|
|
@@ -207,14 +207,32 @@ class AgGridColumnAdapter {
|
|
|
207
207
|
const quickSearchStyle = this.getQuickSearchCellStyle();
|
|
208
208
|
const hasQuickSearchStyle = quickSearchStyle != undefined;
|
|
209
209
|
const cellStyle = (params) => {
|
|
210
|
-
const
|
|
210
|
+
const columnId = params.column.getColId();
|
|
211
|
+
const gridCell = this.adaptableApi.gridApi.getGridCellFromRowNode(params.node, columnId);
|
|
211
212
|
if (!gridCell || !gridCell.column) {
|
|
212
213
|
return {};
|
|
213
214
|
}
|
|
214
215
|
const isQuickSearchActive = hasQuickSearchStyle && this.isQuickSearchActive(gridCell, params);
|
|
215
|
-
|
|
216
|
+
let baseStyles = {};
|
|
217
|
+
// this is required because otherwise, when AG Grid filters, it refershed the pivotResultColDef and the base styles get lost
|
|
218
|
+
// if pivot result col: inherit styles from base column
|
|
219
|
+
if (this.adaptableApi.columnApi.isPivotResultColumn(columnId)) {
|
|
220
|
+
const baseColumn = params.column.getColDef()?.pivotValueColumn;
|
|
221
|
+
if (baseColumn) {
|
|
222
|
+
const baseColDefCellStyle = baseColumn?.getColDef()?.cellStyle;
|
|
223
|
+
const baseColParams = { ...params, column: baseColumn };
|
|
224
|
+
baseStyles =
|
|
225
|
+
typeof baseColDefCellStyle === 'function'
|
|
226
|
+
? baseColDefCellStyle(baseColParams)
|
|
227
|
+
: baseColDefCellStyle;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
// inherit styles from user provided colDef property
|
|
232
|
+
baseStyles = typeof userCellStyle === 'function' ? userCellStyle(params) : userCellStyle;
|
|
233
|
+
}
|
|
216
234
|
const result = {
|
|
217
|
-
...
|
|
235
|
+
...baseStyles,
|
|
218
236
|
...this.getReadOnlyCellStyle(gridCell, params),
|
|
219
237
|
...this.getEditableCellStyle(gridCell, params),
|
|
220
238
|
...this.getEditedCellStyle(gridCell, params),
|
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: 1746196695957 || Date.now(),
|
|
6
|
+
VERSION: "20.0.13" || '--current-version--',
|
|
7
7
|
};
|
|
@@ -4382,18 +4382,18 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
4382
4382
|
kind: string;
|
|
4383
4383
|
desc: string;
|
|
4384
4384
|
isOpt: boolean;
|
|
4385
|
-
ref
|
|
4385
|
+
ref: string;
|
|
4386
4386
|
} | {
|
|
4387
4387
|
name: string;
|
|
4388
4388
|
kind: string;
|
|
4389
4389
|
desc: string;
|
|
4390
|
-
isOpt
|
|
4391
|
-
ref
|
|
4390
|
+
isOpt?: undefined;
|
|
4391
|
+
ref?: undefined;
|
|
4392
4392
|
} | {
|
|
4393
4393
|
name: string;
|
|
4394
4394
|
kind: string;
|
|
4395
4395
|
desc: string;
|
|
4396
|
-
isOpt
|
|
4396
|
+
isOpt: boolean;
|
|
4397
4397
|
ref?: undefined;
|
|
4398
4398
|
})[];
|
|
4399
4399
|
};
|