@adaptabletools/adaptable-cjs 20.0.0-canary.0 → 20.0.0-canary.2
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/AdaptableOptions/ActionColumnOptions.d.ts +2 -2
- package/src/AdaptableOptions/DefaultAdaptableOptions.js +1 -1
- package/src/AdaptableOptions/FilterOptions.d.ts +2 -2
- package/src/Api/ColumnScopeApi.d.ts +2 -2
- package/src/Api/Implementation/ColumnScopeApiImpl.d.ts +1 -1
- package/src/Api/Implementation/ColumnScopeApiImpl.js +1 -1
- package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +5 -5
- package/src/PredefinedConfig/Common/RowSummary.d.ts +1 -1
- package/src/PredefinedConfig/Common/RowSummary.js +3 -3
- package/src/PredefinedConfig/LayoutState.d.ts +5 -1
- package/src/Utilities/Services/RowSummaryService.js +1 -1
- package/src/View/Components/ColumnFilter/utils.js +2 -2
- package/src/View/Layout/Wizard/LayoutWizard.js +1 -1
- package/src/View/Layout/Wizard/sections/RowSummarySection.js +1 -1
- package/src/agGrid/AdaptableAgGrid.js +2 -2
- package/src/agGrid/AgGridColumnAdapter.js +2 -2
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +10 -5
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/migration/VersionUpgrade20.js +3 -3
- package/src/types.d.ts +2 -2
- 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.0-canary.
|
|
3
|
+
"version": "20.0.0-canary.2",
|
|
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",
|
|
@@ -84,9 +84,9 @@ export interface ActionColumnSettings {
|
|
|
84
84
|
/**
|
|
85
85
|
* Button that is displayed inside an Action Column
|
|
86
86
|
*/
|
|
87
|
-
export interface ActionColumnButton<
|
|
87
|
+
export interface ActionColumnButton<T> extends AdaptableButton<ActionColumnContext<T>> {
|
|
88
88
|
/**
|
|
89
|
-
* Command to assign to Button
|
|
89
|
+
* Command to assign to Action Column Button that displays a Row Form
|
|
90
90
|
*/
|
|
91
91
|
command?: ActionButtonCommand;
|
|
92
92
|
}
|
|
@@ -154,7 +154,7 @@ const DefaultAdaptableOptions = {
|
|
|
154
154
|
indicateFilteredColumns: true,
|
|
155
155
|
autoApplyColumnFilter: true,
|
|
156
156
|
defaultNumericColumnFilter: 'Equals',
|
|
157
|
-
|
|
157
|
+
defaultTextColumnFilter: 'Contains',
|
|
158
158
|
defaultDateColumnFilter: 'On',
|
|
159
159
|
hideQuickFilterDropdown: undefined,
|
|
160
160
|
hideQuickFilterInput: undefined,
|
|
@@ -94,12 +94,12 @@ export interface ColumnFilterOptions<TData = any> {
|
|
|
94
94
|
*/
|
|
95
95
|
defaultNumericColumnFilter?: StrictExtract<SystemFilterPredicateId, 'GreaterThan' | 'LessThan' | 'Equals' | 'NotEquals' | 'In'> | ((column: AdaptableColumn) => StrictExtract<SystemFilterPredicateId, 'GreaterThan' | 'LessThan' | 'Equals' | 'NotEquals' | 'In'>);
|
|
96
96
|
/**
|
|
97
|
-
* Default filter type for
|
|
97
|
+
* Default filter type for text Columns
|
|
98
98
|
*
|
|
99
99
|
* @defaultValue Contains
|
|
100
100
|
* @gridInfoItem
|
|
101
101
|
*/
|
|
102
|
-
|
|
102
|
+
defaultTextColumnFilter?: StrictExtract<SystemFilterPredicateId, 'Is' | 'IsNot' | 'Contains' | 'NotContains' | 'StartsWith' | 'EndsWith' | 'Regex' | 'In'> | ((column: AdaptableColumn) => StrictExtract<SystemFilterPredicateId, 'Is' | 'IsNot' | 'Contains' | 'NotContains' | 'StartsWith' | 'EndsWith' | 'Regex' | 'In'>);
|
|
103
103
|
/**
|
|
104
104
|
* Default filter type for date Columns
|
|
105
105
|
*
|
|
@@ -109,11 +109,11 @@ export interface ColumnScopeApi {
|
|
|
109
109
|
*/
|
|
110
110
|
isColumnInNumericScope(column: AdaptableColumn, scope: ColumnScope): boolean;
|
|
111
111
|
/**
|
|
112
|
-
* True if Scope has
|
|
112
|
+
* True if Scope has text DataType containing Column
|
|
113
113
|
* @param column Column to check
|
|
114
114
|
* @param scope Scope to check
|
|
115
115
|
*/
|
|
116
|
-
|
|
116
|
+
isColumnInTextScope(column: AdaptableColumn, scope: ColumnScope): boolean;
|
|
117
117
|
/**
|
|
118
118
|
* True if Scope has Data DataType which contains Column
|
|
119
119
|
* @param column Column to check
|
|
@@ -25,7 +25,7 @@ export declare class ColumnScopeApiImpl extends ApiBase implements ColumnScopeAp
|
|
|
25
25
|
getColumnTypesInScope(scope: ColumnScope): string[] | undefined;
|
|
26
26
|
getDataTypesInScope(scope: ColumnScope): ScopeDataType[] | undefined;
|
|
27
27
|
isColumnInNumericScope(column: AdaptableColumn, scope: ColumnScope): boolean;
|
|
28
|
-
|
|
28
|
+
isColumnInTextScope(column: AdaptableColumn, scope: ColumnScope): boolean;
|
|
29
29
|
isColumnInDateScope(column: AdaptableColumn, scope: ColumnScope): boolean;
|
|
30
30
|
isScopeInScope(a: ColumnScope, b: ColumnScope): boolean;
|
|
31
31
|
createCellColorRangesForScope(scope: ColumnScope): CellColorRange[];
|
|
@@ -187,7 +187,7 @@ class ColumnScopeApiImpl extends ApiBase_1.ApiBase {
|
|
|
187
187
|
}
|
|
188
188
|
return false;
|
|
189
189
|
}
|
|
190
|
-
|
|
190
|
+
isColumnInTextScope(column, scope) {
|
|
191
191
|
// if column is not even string then return false
|
|
192
192
|
if (column == null || column == undefined || column.dataType !== 'text') {
|
|
193
193
|
return false;
|
|
@@ -4,11 +4,11 @@ export type AdaptableColumnDataType = BaseCellDataType | 'textArray' | 'numberAr
|
|
|
4
4
|
/**
|
|
5
5
|
* Column Types recognised by AdapTable; to be set in GridOptions
|
|
6
6
|
*/
|
|
7
|
-
export type
|
|
8
|
-
export declare const CALCULATED_COLUMN_TYPE:
|
|
9
|
-
export declare const FREE_TEXT_COLUMN_TYPE:
|
|
10
|
-
export declare const ACTION_COLUMN_TYPE:
|
|
11
|
-
export declare const FDC3_COLUMN_TYPE:
|
|
7
|
+
export type AdaptableSpecialColumnType = 'calculatedColumn' | 'freeTextColumn' | 'actionColumn' | 'fdc3Column';
|
|
8
|
+
export declare const CALCULATED_COLUMN_TYPE: AdaptableSpecialColumnType;
|
|
9
|
+
export declare const FREE_TEXT_COLUMN_TYPE: AdaptableSpecialColumnType;
|
|
10
|
+
export declare const ACTION_COLUMN_TYPE: AdaptableSpecialColumnType;
|
|
11
|
+
export declare const FDC3_COLUMN_TYPE: AdaptableSpecialColumnType;
|
|
12
12
|
/**
|
|
13
13
|
* Base class for AdapTable Column containing most important properties
|
|
14
14
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SuspendableObject } from './SuspendableObject';
|
|
2
2
|
import { TypeHint } from './Types';
|
|
3
3
|
export declare const ROW_SUMMARY_ROW_ID = "__ROW_SUMMARY_ROW_ID";
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const WEIGHTED_AVERAGE_AGGREGATED_FUNCTION = "WEIGHTED_AVERAGE";
|
|
5
5
|
export declare const summarySupportedExpressions: readonly ["MIN", "MAX", "SUM", "AVG", "COUNT", "MEDIAN", "MODE", "DISTINCT", "ONLY", "STD_DEVIATION", "WEIGHTED_AVERAGE"];
|
|
6
6
|
export type SystemSummarySupportedExpression = (typeof summarySupportedExpressions)[number];
|
|
7
7
|
export type SummarySupportedExpression = TypeHint<string, SystemSummarySupportedExpression>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.summarySupportedExpressions = exports.
|
|
3
|
+
exports.summarySupportedExpressions = exports.WEIGHTED_AVERAGE_AGGREGATED_FUNCTION = exports.ROW_SUMMARY_ROW_ID = void 0;
|
|
4
4
|
exports.ROW_SUMMARY_ROW_ID = '__ROW_SUMMARY_ROW_ID';
|
|
5
|
-
exports.
|
|
5
|
+
exports.WEIGHTED_AVERAGE_AGGREGATED_FUNCTION = 'WEIGHTED_AVERAGE';
|
|
6
6
|
exports.summarySupportedExpressions = [
|
|
7
7
|
'MIN',
|
|
8
8
|
'MAX',
|
|
@@ -14,5 +14,5 @@ exports.summarySupportedExpressions = [
|
|
|
14
14
|
'DISTINCT',
|
|
15
15
|
'ONLY',
|
|
16
16
|
'STD_DEVIATION',
|
|
17
|
-
exports.
|
|
17
|
+
exports.WEIGHTED_AVERAGE_AGGREGATED_FUNCTION,
|
|
18
18
|
];
|
|
@@ -111,6 +111,10 @@ export interface TableLayout extends LayoutBase {
|
|
|
111
111
|
* Pivot Expansions - can NOT be provided
|
|
112
112
|
*/
|
|
113
113
|
PivotExpandLevel?: never;
|
|
114
|
+
/**
|
|
115
|
+
* Pivot Aggregation Columns - can NOT be provided
|
|
116
|
+
*/
|
|
117
|
+
PivotAggregationColumns?: never;
|
|
114
118
|
}
|
|
115
119
|
/**
|
|
116
120
|
* Defines a Pivot-based Layout
|
|
@@ -196,7 +200,7 @@ export interface LayoutOld extends AdaptableObject {
|
|
|
196
200
|
GridFilter?: GridFilter;
|
|
197
201
|
RowGroupedColumns?: string[];
|
|
198
202
|
ExpandedRowGroupValues?: any[];
|
|
199
|
-
|
|
203
|
+
AggregationColumns?: Record<string, string | true | any>;
|
|
200
204
|
EnablePivot?: boolean;
|
|
201
205
|
PivotColumns?: string[];
|
|
202
206
|
PinnedColumnsMap?: {
|
|
@@ -128,7 +128,7 @@ class RowSummaryService {
|
|
|
128
128
|
if (!expressionLiveValue) {
|
|
129
129
|
try {
|
|
130
130
|
let aggregatedScalarExpression = `${expression}([${columnId}])`;
|
|
131
|
-
if (aggregatedScalarExpression.includes(RowSummary_1.
|
|
131
|
+
if (aggregatedScalarExpression.includes(RowSummary_1.WEIGHTED_AVERAGE_AGGREGATED_FUNCTION) &&
|
|
132
132
|
aggColsMap[columnId] &&
|
|
133
133
|
typeof aggColsMap[columnId] === 'object') {
|
|
134
134
|
const weight = aggColsMap[columnId].weightedColumnId;
|
|
@@ -100,8 +100,8 @@ const mapColumnFilterToQlPredicate = (columnFilter, abColumn, qlPredicateDefs, c
|
|
|
100
100
|
: { operator: 'Equals', args: [] };
|
|
101
101
|
break;
|
|
102
102
|
case 'text':
|
|
103
|
-
defaultQlPredicate = columnFilterOptions.
|
|
104
|
-
? { operator: columnFilterOptions.
|
|
103
|
+
defaultQlPredicate = columnFilterOptions.defaultTextColumnFilter
|
|
104
|
+
? { operator: columnFilterOptions.defaultTextColumnFilter, args: [] }
|
|
105
105
|
: { operator: 'Contains', args: [] };
|
|
106
106
|
break;
|
|
107
107
|
case 'date':
|
|
@@ -212,7 +212,7 @@ const LayoutWizard = (props) => {
|
|
|
212
212
|
ColumnsMap: Object.entries(rowSummary.ColumnsMap).reduce((acc, [columnId, aggFunc]) => {
|
|
213
213
|
if (
|
|
214
214
|
// see if it is weighted avg
|
|
215
|
-
aggFunc === RowSummary_1.
|
|
215
|
+
aggFunc === RowSummary_1.WEIGHTED_AVERAGE_AGGREGATED_FUNCTION &&
|
|
216
216
|
// see if we have a weight in the agg columns
|
|
217
217
|
aggColsMap[columnId] &&
|
|
218
218
|
(typeof aggColsMap[columnId] !== 'object' ||
|
|
@@ -175,7 +175,7 @@ const RowSummaryEditor = React.memo(({ rowSummary, onChange, availableScalarExpr
|
|
|
175
175
|
aggregation.weightedColumnId) {
|
|
176
176
|
expressionOptions.push({
|
|
177
177
|
label: 'WEIGHTERD_AVG',
|
|
178
|
-
value: RowSummary_1.
|
|
178
|
+
value: RowSummary_1.WEIGHTED_AVERAGE_AGGREGATED_FUNCTION,
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
181
|
const expression = rowSummary.ColumnsMap[column.columnId];
|
|
@@ -1018,13 +1018,13 @@ You need to define at least one Layout!`);
|
|
|
1018
1018
|
// this will have to go/be heavily extended with https://github.com/AdaptableTools/adaptable/issues/2230
|
|
1019
1019
|
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'columnTypes', (original_columnTypes) => {
|
|
1020
1020
|
const providedColumnTypes = original_columnTypes || {};
|
|
1021
|
-
const
|
|
1021
|
+
const adaptableSpecialColumnTypes = {
|
|
1022
1022
|
[AdaptableColumn_1.CALCULATED_COLUMN_TYPE]: {},
|
|
1023
1023
|
[AdaptableColumn_1.FREE_TEXT_COLUMN_TYPE]: {},
|
|
1024
1024
|
[AdaptableColumn_1.ACTION_COLUMN_TYPE]: {},
|
|
1025
1025
|
[AdaptableColumn_1.FDC3_COLUMN_TYPE]: {},
|
|
1026
1026
|
};
|
|
1027
|
-
const patchedColumnTypes = Object.assign({}, providedColumnTypes,
|
|
1027
|
+
const patchedColumnTypes = Object.assign({}, providedColumnTypes, adaptableSpecialColumnTypes);
|
|
1028
1028
|
const customColumnTypes = this.api.columnApi.getColumnTypes() ?? [];
|
|
1029
1029
|
for (const customColumnType of customColumnTypes) {
|
|
1030
1030
|
if (!patchedColumnTypes[customColumnType]) {
|
|
@@ -396,7 +396,7 @@ class AgGridColumnAdapter {
|
|
|
396
396
|
}
|
|
397
397
|
// required here for the initial layout rendering
|
|
398
398
|
// Removed by JW, 3 october 2023; i don't think we need it and it overrides stuff unnecessarily
|
|
399
|
-
|
|
399
|
+
abColumn.friendlyName = resultHeaderName;
|
|
400
400
|
return resultHeaderName;
|
|
401
401
|
});
|
|
402
402
|
const newColumnHeader = col?.getColDef()?.headerName;
|
|
@@ -484,7 +484,7 @@ class AgGridColumnAdapter {
|
|
|
484
484
|
}
|
|
485
485
|
if (mostRelevantFormatColumn.DisplayFormat.Formatter === 'StringFormatter') {
|
|
486
486
|
// change the String format - if the scope allows it
|
|
487
|
-
if (this.adaptableApi.columnScopeApi.
|
|
487
|
+
if (this.adaptableApi.columnScopeApi.isColumnInTextScope(abColumn, mostRelevantFormatColumn.Scope)) {
|
|
488
488
|
let cellValue = params.value;
|
|
489
489
|
if (typeof params.value?.toNumber === 'function' &&
|
|
490
490
|
typeof params.value?.toString === 'function') {
|
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.0-canary.
|
|
5
|
+
PUBLISH_TIMESTAMP: 1740401889478 || Date.now(),
|
|
6
|
+
VERSION: "20.0.0-canary.2" || '--current-version--',
|
|
7
7
|
};
|
|
@@ -309,11 +309,6 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
309
309
|
isOpt: boolean;
|
|
310
310
|
}[];
|
|
311
311
|
};
|
|
312
|
-
AdaptableColumnType: {
|
|
313
|
-
name: string;
|
|
314
|
-
kind: string;
|
|
315
|
-
desc: string;
|
|
316
|
-
};
|
|
317
312
|
AdaptableComment: {
|
|
318
313
|
name: string;
|
|
319
314
|
kind: string;
|
|
@@ -920,6 +915,11 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
920
915
|
desc: string;
|
|
921
916
|
}[];
|
|
922
917
|
};
|
|
918
|
+
AdaptableSpecialColumnType: {
|
|
919
|
+
name: string;
|
|
920
|
+
kind: string;
|
|
921
|
+
desc: string;
|
|
922
|
+
};
|
|
923
923
|
AdaptableState: {
|
|
924
924
|
name: string;
|
|
925
925
|
kind: string;
|
|
@@ -3010,6 +3010,11 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
3010
3010
|
gridInfo?: undefined;
|
|
3011
3011
|
})[];
|
|
3012
3012
|
};
|
|
3013
|
+
ExportResultData: {
|
|
3014
|
+
name: string;
|
|
3015
|
+
kind: string;
|
|
3016
|
+
desc: string;
|
|
3017
|
+
};
|
|
3013
3018
|
ExportState: {
|
|
3014
3019
|
name: string;
|
|
3015
3020
|
kind: string;
|