@adaptabletools/adaptable 12.1.3 → 12.1.4
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/bundle.cjs.js +57 -57
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/Api/ColumnApi.d.ts +6 -0
- package/src/Api/Events/SearchChanged.d.ts +1 -0
- package/src/Api/FormatColumnApi.d.ts +5 -3
- package/src/Api/Implementation/ColumnApiImpl.d.ts +2 -0
- package/src/Api/Implementation/ColumnApiImpl.js +14 -0
- package/src/Api/Implementation/FormatColumnApiImpl.d.ts +5 -3
- package/src/Api/Implementation/FormatColumnApiImpl.js +40 -11
- package/src/PredefinedConfig/FormatColumnState.d.ts +2 -2
- package/src/Redux/Store/AdaptableStore.js +8 -0
- package/src/Strategy/LayoutModule.js +2 -2
- package/src/View/Components/RangesComponent.js +1 -1
- package/src/View/Layout/Wizard/sections/AggregationsSection.js +1 -1
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +6 -2
- package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +3 -2
- package/src/View/Layout/Wizard/sections/RowGroupingSection.js +1 -1
- package/src/View/Layout/Wizard/sections/SettingsSection.js +2 -2
- package/src/View/Layout/Wizard/sections/SortSection.js +1 -1
- package/src/agGrid/Adaptable.d.ts +1 -1
- package/src/agGrid/Adaptable.js +10 -9
- package/src/agGrid/PercentBarRenderer.d.ts +2 -1
- package/src/agGrid/PercentBarRenderer.js +3 -3
- package/src/agGrid/agGridHelper.d.ts +1 -1
- package/src/agGrid/agGridHelper.js +2 -2
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable",
|
|
3
|
-
"version": "12.1.
|
|
3
|
+
"version": "12.1.4",
|
|
4
4
|
"description": "Powerful data-agnostic HTML5 datagrid add-on that sits on top of an underlying grid component and provides all the rich functionality that advanced users expect from their DataGrids and Data Tables",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components",
|
package/publishTimestamp.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: 1659024589656;
|
|
2
2
|
export default _default;
|
package/publishTimestamp.js
CHANGED
package/src/Api/ColumnApi.d.ts
CHANGED
|
@@ -303,5 +303,11 @@ export interface ColumnApi {
|
|
|
303
303
|
* @param columnId Column to Check
|
|
304
304
|
*/
|
|
305
305
|
isActionRowButtonColumn(columnId: string): boolean;
|
|
306
|
+
/**
|
|
307
|
+
* Returns the default Aggregation Function for a Column
|
|
308
|
+
* @param columnId Column to Check
|
|
309
|
+
*/
|
|
306
310
|
getDefaultAggFunc(columnId: string): string;
|
|
311
|
+
getMinValueForNumericColumn(column: AdaptableColumn): number | undefined;
|
|
312
|
+
getMaxValueForNumericColumn(column: AdaptableColumn): number | undefined;
|
|
307
313
|
}
|
|
@@ -2,6 +2,7 @@ import { BaseEventInfo } from './BaseEventInfo';
|
|
|
2
2
|
import { AdaptableSortState } from '../../types';
|
|
3
3
|
import { AdaptableSearchState } from './AdaptableSearchState';
|
|
4
4
|
/**
|
|
5
|
+
* Deprecated Search Changed Event - use `QueryRun` or `FilterApplied` instead
|
|
5
6
|
* @deprecated Use QueryRun and or FilterApplied
|
|
6
7
|
*/
|
|
7
8
|
export interface SearchChangedInfo extends BaseEventInfo {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormatColumnState, FormatColumn, ColumnStyle, ColumnComparison } from '../PredefinedConfig/FormatColumnState';
|
|
1
|
+
import { FormatColumnState, FormatColumn, ColumnStyle, ColumnComparison, CellColorRange } from '../PredefinedConfig/FormatColumnState';
|
|
2
2
|
import { AdaptableColumn, AdaptableFormat } from '../types';
|
|
3
3
|
import { RowNode } from '@ag-grid-community/all-modules';
|
|
4
4
|
/**
|
|
@@ -156,14 +156,16 @@ export interface FormatColumnApi {
|
|
|
156
156
|
* @param rowNode current Row Node
|
|
157
157
|
* @param cellValue current Cell Value
|
|
158
158
|
*/
|
|
159
|
-
getNumericStyleMinValue(numericStyle: ColumnStyle, rowNode: RowNode, cellValue: any): number;
|
|
159
|
+
getNumericStyleMinValue(numericStyle: ColumnStyle, column: AdaptableColumn, rowNode: RowNode, cellValue: any): number;
|
|
160
160
|
/**
|
|
161
161
|
* Gets the Maximum Value to display for a Numeric Style
|
|
162
162
|
* @param numericStyle Numeric Style to check
|
|
163
163
|
* @param rowNode current Row Node
|
|
164
164
|
* @param cellValue current Cell Value
|
|
165
165
|
*/
|
|
166
|
-
getNumericStyleMaxValue(numericStyle: ColumnStyle, rowNode: RowNode, cellValue: any): number;
|
|
166
|
+
getNumericStyleMaxValue(numericStyle: ColumnStyle, column: AdaptableColumn, rowNode: RowNode, cellValue: any): number;
|
|
167
|
+
getCellColorRangeMinValue(range: CellColorRange, column: AdaptableColumn): number | undefined;
|
|
168
|
+
getCellColorRangeMaxValue(range: CellColorRange, column: AdaptableColumn): number | undefined;
|
|
167
169
|
/**
|
|
168
170
|
* Returns first Format Column that contains checkbox style
|
|
169
171
|
* @param columnId column to check
|
|
@@ -70,4 +70,6 @@ export declare class ColumnApiImpl extends ApiBase implements ColumnApi {
|
|
|
70
70
|
isColumnReferencedInExpression(columnId: string, expression: string): boolean;
|
|
71
71
|
isActionRowButtonColumn(columnId: string): boolean;
|
|
72
72
|
getDefaultAggFunc(columnId: string): string;
|
|
73
|
+
getMinValueForNumericColumn(column: AdaptableColumn): number | undefined;
|
|
74
|
+
getMaxValueForNumericColumn(column: AdaptableColumn): number | undefined;
|
|
73
75
|
}
|
|
@@ -420,5 +420,19 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
420
420
|
const agColumn = (_b = (_a = this.getAgGridColumnForAdaptableColumn(columnId)) === null || _a === void 0 ? void 0 : _a.getColDef) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
421
421
|
return (_c = agColumn === null || agColumn === void 0 ? void 0 : agColumn.defaultAggFunc) !== null && _c !== void 0 ? _c : availableAggregationFunctions[0];
|
|
422
422
|
}
|
|
423
|
+
getMinValueForNumericColumn(column) {
|
|
424
|
+
if (column.dataType !== 'Number') {
|
|
425
|
+
return undefined;
|
|
426
|
+
}
|
|
427
|
+
// can we cache this in some way?
|
|
428
|
+
return Math.min(...this.getDistinctRawValuesForColumn(column.columnId));
|
|
429
|
+
}
|
|
430
|
+
getMaxValueForNumericColumn(column) {
|
|
431
|
+
if (column.dataType !== 'Number') {
|
|
432
|
+
return undefined;
|
|
433
|
+
}
|
|
434
|
+
// can we cache this in some way?
|
|
435
|
+
return Math.max(...this.getDistinctRawValuesForColumn(column.columnId));
|
|
436
|
+
}
|
|
423
437
|
}
|
|
424
438
|
exports.ColumnApiImpl = ColumnApiImpl;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AdaptableStyle } from '../../PredefinedConfig/Common/AdaptableStyle';
|
|
2
2
|
import { ApiBase, LayoutAssociatedObjectLoadConfig } from './ApiBase';
|
|
3
3
|
import { FormatColumnApi } from '../FormatColumnApi';
|
|
4
|
-
import { FormatColumnState, FormatColumn, ColumnStyle, ColumnComparison } from '../../PredefinedConfig/FormatColumnState';
|
|
4
|
+
import { FormatColumnState, FormatColumn, ColumnStyle, CellColorRange, ColumnComparison } from '../../PredefinedConfig/FormatColumnState';
|
|
5
5
|
import { AdaptableColumn } from '../../PredefinedConfig/Common/AdaptableColumn';
|
|
6
6
|
import { RowNode } from '@ag-grid-community/all-modules';
|
|
7
7
|
import { AdaptableFormat } from '../../types';
|
|
@@ -39,8 +39,10 @@ export declare class FormatColumnApiImpl extends ApiBase implements FormatColumn
|
|
|
39
39
|
getFormatColumnsWithAllScope(formatColumns: FormatColumn[]): FormatColumn[] | undefined;
|
|
40
40
|
getFormatColumnsWithDataTypeScope(formatColumns: FormatColumn[]): FormatColumn[] | undefined;
|
|
41
41
|
getFormatColumnsWithColumnScope(formatColumns: FormatColumn[]): FormatColumn[] | undefined;
|
|
42
|
-
getNumericStyleMinValue(numericStyle: ColumnStyle, rowNode: RowNode, cellValue: any): number;
|
|
43
|
-
getNumericStyleMaxValue(numericStyle: ColumnStyle, rowNode: RowNode, cellValue: any): number | undefined;
|
|
42
|
+
getNumericStyleMinValue(numericStyle: ColumnStyle, column: AdaptableColumn, rowNode: RowNode, cellValue: any): number;
|
|
43
|
+
getNumericStyleMaxValue(numericStyle: ColumnStyle, column: AdaptableColumn, rowNode: RowNode, cellValue: any): number | undefined;
|
|
44
|
+
getCellColorRangeMinValue(range: CellColorRange, column: AdaptableColumn): number | undefined;
|
|
45
|
+
getCellColorRangeMaxValue(range: CellColorRange, column: AdaptableColumn): number | undefined;
|
|
44
46
|
getCheckBoxStyleFormatColumn(column: AdaptableColumn): FormatColumn | undefined;
|
|
45
47
|
isCheckBoxStyleFormatColumn(column: AdaptableColumn): boolean;
|
|
46
48
|
fireCheckboxColumnClickedEvent(columnId: string, rowData: any, primaryKeyValue: any, isChecked: boolean): void;
|
|
@@ -180,7 +180,7 @@ class FormatColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
180
180
|
getFormatColumnsWithColumnScope(formatColumns) {
|
|
181
181
|
return formatColumns.filter((fc) => this.adaptable.api.scopeApi.scopeHasColumns(fc.Scope));
|
|
182
182
|
}
|
|
183
|
-
getNumericStyleMinValue(numericStyle, rowNode, cellValue) {
|
|
183
|
+
getNumericStyleMinValue(numericStyle, column, rowNode, cellValue) {
|
|
184
184
|
var _a, _b;
|
|
185
185
|
const columnComparison = numericStyle.GradientStyle
|
|
186
186
|
? numericStyle.GradientStyle.ColumnComparison
|
|
@@ -199,24 +199,28 @@ class FormatColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
|
-
// for
|
|
202
|
+
// for Gradient Column we want just the range that contains cell value
|
|
203
203
|
if (numericStyle.GradientStyle) {
|
|
204
204
|
let range;
|
|
205
205
|
numericStyle.GradientStyle.CellRanges.forEach((cellRange) => {
|
|
206
|
-
if (!range
|
|
207
|
-
|
|
206
|
+
if (!range) {
|
|
207
|
+
if ((cellRange.Min == 'Col-Min' || cellValue >= cellRange.Min) &&
|
|
208
|
+
(cellRange.Max == 'Col-Max' || cellValue <= cellRange.Max)) {
|
|
209
|
+
range = cellRange;
|
|
210
|
+
}
|
|
208
211
|
}
|
|
209
212
|
});
|
|
210
|
-
return range
|
|
213
|
+
return this.getCellColorRangeMinValue(range, column);
|
|
211
214
|
}
|
|
215
|
+
// for percentbar we want to get the whole Ranges
|
|
212
216
|
if (numericStyle.PercentBarStyle) {
|
|
213
217
|
const ranges = (_b = numericStyle.PercentBarStyle) === null || _b === void 0 ? void 0 : _b.CellRanges;
|
|
214
218
|
if (ranges) {
|
|
215
|
-
return ranges[0]
|
|
219
|
+
return this.getCellColorRangeMinValue(ranges[0], column);
|
|
216
220
|
}
|
|
217
221
|
}
|
|
218
222
|
}
|
|
219
|
-
getNumericStyleMaxValue(numericStyle, rowNode, cellValue) {
|
|
223
|
+
getNumericStyleMaxValue(numericStyle, column, rowNode, cellValue) {
|
|
220
224
|
var _a, _b;
|
|
221
225
|
const columnComparison = numericStyle.GradientStyle
|
|
222
226
|
? numericStyle.GradientStyle.ColumnComparison
|
|
@@ -238,19 +242,44 @@ class FormatColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
238
242
|
if (numericStyle.GradientStyle) {
|
|
239
243
|
let range;
|
|
240
244
|
numericStyle.GradientStyle.CellRanges.forEach((cellRange) => {
|
|
241
|
-
if (!range
|
|
242
|
-
|
|
245
|
+
if (!range) {
|
|
246
|
+
if ((cellRange.Min == 'Col-Min' || cellValue >= cellRange.Min) &&
|
|
247
|
+
(cellRange.Max == 'Col-Max' || cellValue <= cellRange.Max)) {
|
|
248
|
+
range = cellRange;
|
|
249
|
+
}
|
|
243
250
|
}
|
|
244
251
|
});
|
|
245
|
-
return range
|
|
252
|
+
return this.getCellColorRangeMaxValue(range, column);
|
|
246
253
|
}
|
|
247
254
|
if (numericStyle.PercentBarStyle) {
|
|
248
255
|
const ranges = (_b = numericStyle.PercentBarStyle) === null || _b === void 0 ? void 0 : _b.CellRanges;
|
|
249
256
|
if (ranges) {
|
|
250
|
-
return ranges[ranges.length - 1]
|
|
257
|
+
return this.getCellColorRangeMaxValue(ranges[ranges.length - 1], column);
|
|
251
258
|
}
|
|
252
259
|
}
|
|
253
260
|
}
|
|
261
|
+
getCellColorRangeMinValue(range, column) {
|
|
262
|
+
if (!range) {
|
|
263
|
+
return undefined;
|
|
264
|
+
}
|
|
265
|
+
if (range.Min == undefined) {
|
|
266
|
+
return undefined;
|
|
267
|
+
}
|
|
268
|
+
return range.Min == 'Col-Min'
|
|
269
|
+
? this.getAdaptableApi().columnApi.getMinValueForNumericColumn(column)
|
|
270
|
+
: range.Min;
|
|
271
|
+
}
|
|
272
|
+
getCellColorRangeMaxValue(range, column) {
|
|
273
|
+
if (!range) {
|
|
274
|
+
return undefined;
|
|
275
|
+
}
|
|
276
|
+
if (range.Max == undefined) {
|
|
277
|
+
return undefined;
|
|
278
|
+
}
|
|
279
|
+
return range.Max == 'Col-Max'
|
|
280
|
+
? this.getAdaptableApi().columnApi.getMaxValueForNumericColumn(column)
|
|
281
|
+
: range.Max;
|
|
282
|
+
}
|
|
254
283
|
getCheckBoxStyleFormatColumn(column) {
|
|
255
284
|
var _a;
|
|
256
285
|
if (column.dataType != 'Boolean') {
|
|
@@ -111,11 +111,11 @@ export interface CellColorRange {
|
|
|
111
111
|
/**
|
|
112
112
|
* Start number of Range
|
|
113
113
|
*/
|
|
114
|
-
Min: number;
|
|
114
|
+
Min: number | 'Col-Min';
|
|
115
115
|
/**
|
|
116
116
|
* End number of Range
|
|
117
117
|
*/
|
|
118
|
-
Max: number;
|
|
118
|
+
Max: number | 'Col-Max';
|
|
119
119
|
/**
|
|
120
120
|
* Cell colour to use for values that fall inside Range
|
|
121
121
|
*/
|
|
@@ -899,6 +899,14 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
|
|
|
899
899
|
}
|
|
900
900
|
}
|
|
901
901
|
}
|
|
902
|
+
// when changing current layout via the api, the layout should update
|
|
903
|
+
if (returnAction.type == LayoutRedux.LAYOUT_SAVE) {
|
|
904
|
+
const currentLayout = adaptable.api.layoutApi.getCurrentLayout();
|
|
905
|
+
const savingLayout = returnAction.layout;
|
|
906
|
+
if (currentLayout.Name === savingLayout.Name) {
|
|
907
|
+
adaptable.setLayout(savingLayout);
|
|
908
|
+
}
|
|
909
|
+
}
|
|
902
910
|
return returnAction;
|
|
903
911
|
}
|
|
904
912
|
/*******************
|
|
@@ -247,8 +247,8 @@ class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
247
247
|
values: [layout.Name],
|
|
248
248
|
},
|
|
249
249
|
{
|
|
250
|
-
name: '
|
|
251
|
-
values: [(layout === null || layout === void 0 ? void 0 : layout.EnablePivot) ? '
|
|
250
|
+
name: 'Layout Grid Type',
|
|
251
|
+
values: [(layout === null || layout === void 0 ? void 0 : layout.EnablePivot) ? 'Pivot' : 'Table'],
|
|
252
252
|
},
|
|
253
253
|
{
|
|
254
254
|
name: 'Columns',
|
|
@@ -147,7 +147,7 @@ class RangesComponent extends React.Component {
|
|
|
147
147
|
addRange() {
|
|
148
148
|
const lastRange = this.state.ranges[this.state.ranges.length - 1];
|
|
149
149
|
this.state.ranges.push({
|
|
150
|
-
Min: lastRange.Max,
|
|
150
|
+
Min: lastRange.Max == 'Col-Max' ? 0 : lastRange.Max,
|
|
151
151
|
Max: lastRange.Max,
|
|
152
152
|
Color: UIHelper_1.getHexForName(UIHelper_1.GRAY),
|
|
153
153
|
}),
|
|
@@ -58,7 +58,7 @@ const AggregationsSection = (props) => {
|
|
|
58
58
|
const allColumns = adaptable.api.columnApi.getColumns();
|
|
59
59
|
const sortedAggregableColumns = React.useMemo(() => {
|
|
60
60
|
var _a, _b;
|
|
61
|
-
return sortWithOrder_1.sortWithOrderArray(allAggregableColumns.map((col) => col.columnId), (_b = Object.keys((_a = layout.AggregationColumns) !== null && _a !== void 0 ? _a : {})) !== null && _b !== void 0 ? _b : [], { sortUnorderedItems:
|
|
61
|
+
return sortWithOrder_1.sortWithOrderArray(allAggregableColumns.map((col) => col.columnId), (_b = Object.keys((_a = layout.AggregationColumns) !== null && _a !== void 0 ? _a : {})) !== null && _b !== void 0 ? _b : [], { sortUnorderedItems: false }).map((colId) => adaptable.api.columnApi.getColumnFromId(colId));
|
|
62
62
|
}, [layout, allAggregableColumns]);
|
|
63
63
|
const handleColumnsSelectionChange = React.useCallback((columnIds) => {
|
|
64
64
|
props.onChange(Object.assign(Object.assign({}, layout), { AggregationColumns: columnIds.reduce((acc, colId) => {
|
|
@@ -31,6 +31,10 @@ const ColumnsSectionSummary = () => {
|
|
|
31
31
|
const data = React.useMemo(() => {
|
|
32
32
|
return layout.Columns.map((columnId) => {
|
|
33
33
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
34
|
+
if (adaptable.api.columnApi.isAutoPivotColumn(columnId) ||
|
|
35
|
+
adaptable.api.columnApi.isAutoRowGroupColumn(columnId)) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
34
38
|
const friendlyName = adaptable.api.columnApi.getFriendlyNameFromColumnId(columnId);
|
|
35
39
|
const header = (_b = (_a = layout.ColumnHeadersMap) === null || _a === void 0 ? void 0 : _a[columnId]) !== null && _b !== void 0 ? _b : '';
|
|
36
40
|
const columnWidth = (_c = layout.ColumnWidthMap) === null || _c === void 0 ? void 0 : _c[columnId];
|
|
@@ -57,7 +61,7 @@ const ColumnsSectionSummary = () => {
|
|
|
57
61
|
grouping,
|
|
58
62
|
filter,
|
|
59
63
|
};
|
|
60
|
-
});
|
|
64
|
+
}).filter(Boolean);
|
|
61
65
|
}, [layout]);
|
|
62
66
|
const columns = React.useMemo(() => {
|
|
63
67
|
return {
|
|
@@ -187,7 +191,7 @@ const ColumnsSection = (props) => {
|
|
|
187
191
|
const { data: layout } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
|
|
188
192
|
const allColumns = adaptable.api.columnApi.getColumns();
|
|
189
193
|
const sortedColumns = React.useMemo(() => {
|
|
190
|
-
return sortWithOrder_1.sortWithOrderArray(allColumns.map((col) => col.columnId), layout.Columns, { sortUnorderedItems:
|
|
194
|
+
return sortWithOrder_1.sortWithOrderArray(allColumns.map((col) => col.columnId), layout.Columns, { sortUnorderedItems: false }).map((colId) => adaptable.api.columnApi.getColumnFromId(colId));
|
|
191
195
|
}, [layout, allColumns]);
|
|
192
196
|
const handlePinChange = (columnId, pinning) => {
|
|
193
197
|
props.onChange(Object.assign(Object.assign({}, layout), { PinnedColumnsMap: Object.assign(Object.assign({}, layout.PinnedColumnsMap), { [columnId]: pinning }) }));
|
|
@@ -12,9 +12,10 @@ const ValueSelector_1 = require("../../../Components/ValueSelector");
|
|
|
12
12
|
const OnePageAdaptableWizard_1 = require("../../../Wizard/OnePageAdaptableWizard");
|
|
13
13
|
const Utilities_1 = require("./Utilities");
|
|
14
14
|
const PivotColumnsSectionSummary = () => {
|
|
15
|
+
var _a;
|
|
15
16
|
const adaptable = AdaptableContext_1.useAdaptable();
|
|
16
17
|
const { data: layout } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
|
|
17
|
-
return (React.createElement(rebass_1.Box, { p: 2, style: { borderRadius: 'var(--ab__border-radius)' }, backgroundColor: "var(--ab-color-defaultbackground)" }, layout.PivotColumns.length ? (layout.PivotColumns.map((columnId) => (React.createElement(Tag_1.Tag, { mr: 1, key: columnId }, adaptable.api.columnApi.getFriendlyNameFromColumnId(columnId))))) : (React.createElement(Tag_1.Tag, null, "No Column Pivoting"))));
|
|
18
|
+
return (React.createElement(rebass_1.Box, { p: 2, style: { borderRadius: 'var(--ab__border-radius)' }, backgroundColor: "var(--ab-color-defaultbackground)" }, ((_a = layout.PivotColumns) === null || _a === void 0 ? void 0 : _a.length) ? (layout.PivotColumns.map((columnId) => (React.createElement(Tag_1.Tag, { mr: 1, key: columnId }, adaptable.api.columnApi.getFriendlyNameFromColumnId(columnId))))) : (React.createElement(Tag_1.Tag, null, "No Column Pivoting"))));
|
|
18
19
|
};
|
|
19
20
|
exports.PivotColumnsSectionSummary = PivotColumnsSectionSummary;
|
|
20
21
|
const PivotColumnsSection = (props) => {
|
|
@@ -24,7 +25,7 @@ const PivotColumnsSection = (props) => {
|
|
|
24
25
|
const allPivotColumns = adaptable.api.columnApi.getPivotableColumns();
|
|
25
26
|
const sortedPivotColumns = React.useMemo(() => {
|
|
26
27
|
var _a;
|
|
27
|
-
return sortWithOrder_1.sortWithOrderArray(allPivotColumns.map((col) => col.columnId), (_a = layout.PivotColumns) !== null && _a !== void 0 ? _a : [], { sortUnorderedItems:
|
|
28
|
+
return sortWithOrder_1.sortWithOrderArray(allPivotColumns.map((col) => col.columnId), (_a = layout.PivotColumns) !== null && _a !== void 0 ? _a : [], { sortUnorderedItems: false }).map((colId) => adaptable.api.columnApi.getColumnFromId(colId));
|
|
28
29
|
}, [layout, allPivotColumns]);
|
|
29
30
|
const handleColumnsChange = (columnIds) => {
|
|
30
31
|
props.onChange(Object.assign(Object.assign({}, layout), { PivotColumns: columnIds }));
|
|
@@ -26,7 +26,7 @@ const RowGroupingSection = (props) => {
|
|
|
26
26
|
const allGroupableColumns = adaptable.api.columnApi.getGroupableColumns();
|
|
27
27
|
const sortedGroupableColumns = React.useMemo(() => {
|
|
28
28
|
var _a;
|
|
29
|
-
return sortWithOrder_1.sortWithOrderArray(allGroupableColumns.map((col) => col.columnId), (_a = layout.RowGroupedColumns) !== null && _a !== void 0 ? _a : [], { sortUnorderedItems:
|
|
29
|
+
return sortWithOrder_1.sortWithOrderArray(allGroupableColumns.map((col) => col.columnId), (_a = layout.RowGroupedColumns) !== null && _a !== void 0 ? _a : [], { sortUnorderedItems: false }).map((colId) => adaptable.api.columnApi.getColumnFromId(colId));
|
|
30
30
|
}, [layout, allGroupableColumns]);
|
|
31
31
|
const handleColumnsChange = (columnIds) => {
|
|
32
32
|
props.onChange(Object.assign(Object.assign({}, layout), { RowGroupedColumns: columnIds }));
|
|
@@ -17,8 +17,8 @@ const SettingsSectionSummary = () => {
|
|
|
17
17
|
"Layout Name: ",
|
|
18
18
|
layout.Name),
|
|
19
19
|
React.createElement(Tag_1.Tag, { mr: 2 },
|
|
20
|
-
"
|
|
21
|
-
layout.EnablePivot ? '
|
|
20
|
+
"Layout Grid Type: ",
|
|
21
|
+
layout.EnablePivot ? 'Pivot' : 'Table'),
|
|
22
22
|
React.createElement(Tag_1.Tag, { mr: 2 },
|
|
23
23
|
"Suppress Aggregation Function in Header: ",
|
|
24
24
|
layout.SuppressAggFuncInHeader ? 'Yes' : 'No')));
|
|
@@ -38,7 +38,7 @@ const SortSection = (props) => {
|
|
|
38
38
|
});
|
|
39
39
|
const sortedSortColumns = React.useMemo(() => {
|
|
40
40
|
var _a;
|
|
41
|
-
return sortWithOrder_1.sortWithOrderArray(allSortableColumns.map((col) => col.columnId), ((_a = layout.ColumnSorts) !== null && _a !== void 0 ? _a : []).map((sort) => sort.ColumnId), { sortUnorderedItems:
|
|
41
|
+
return sortWithOrder_1.sortWithOrderArray(allSortableColumns.map((col) => col.columnId), ((_a = layout.ColumnSorts) !== null && _a !== void 0 ? _a : []).map((sort) => sort.ColumnId), { sortUnorderedItems: false }).map((colId) => adaptable.api.columnApi.getColumnFromId(colId));
|
|
42
42
|
}, [layout, allSortableColumns]);
|
|
43
43
|
const handleColumnsSelectionChange = React.useCallback((columnIds) => {
|
|
44
44
|
props.onChange(Object.assign(Object.assign({}, layout), { ColumnSorts: (columnIds || []).map((columnId) => {
|
|
@@ -259,7 +259,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
259
259
|
getExcelClassNameForCell(colId: string, primaryKeyValue: any): string;
|
|
260
260
|
setupColumnCellEditor({ colId, col }: ColumnSetupInfo): void;
|
|
261
261
|
setupColumnCellRenderer({ col, colId, abColumn }: ColumnSetupInfo): void;
|
|
262
|
-
setupColumnTooltipValueGetter({ col, colId }: ColumnSetupInfo): void;
|
|
262
|
+
setupColumnTooltipValueGetter({ col, colId, abColumn }: ColumnSetupInfo): void;
|
|
263
263
|
setupColumnQuickFilerText({ col, abColumn }: ColumnSetupInfo): void;
|
|
264
264
|
setupColumnHeader({ col, abColumn }: ColumnSetupInfo): boolean;
|
|
265
265
|
setupColumnFilter({ col, colDef }: ColumnSetupInfo): void;
|
package/src/agGrid/Adaptable.js
CHANGED
|
@@ -893,7 +893,7 @@ class Adaptable {
|
|
|
893
893
|
this.gridOptions.api.setColumnDefs(colDefs);
|
|
894
894
|
this.updateColumnsIntoStore(); // todo remove this from here!!!
|
|
895
895
|
}
|
|
896
|
-
getFormatColumnCellStyle(formatColumn, params) {
|
|
896
|
+
getFormatColumnCellStyle(abColumn, formatColumn, params) {
|
|
897
897
|
if (!formatColumn.IncludeGroupedRows && this.isGroupRowNode(params.node)) {
|
|
898
898
|
return;
|
|
899
899
|
}
|
|
@@ -906,8 +906,8 @@ class Adaptable {
|
|
|
906
906
|
if (columnStyle) {
|
|
907
907
|
const gradientStyle = columnStyle === null || columnStyle === void 0 ? void 0 : columnStyle.GradientStyle;
|
|
908
908
|
if (gradientStyle) {
|
|
909
|
-
const min = this.api.formatColumnApi.getNumericStyleMinValue(columnStyle, params.node, params.value);
|
|
910
|
-
const max = this.api.formatColumnApi.getNumericStyleMaxValue(columnStyle, params.node, params.value);
|
|
909
|
+
const min = this.api.formatColumnApi.getNumericStyleMinValue(columnStyle, abColumn, params.node, params.value);
|
|
910
|
+
const max = this.api.formatColumnApi.getNumericStyleMaxValue(columnStyle, abColumn, params.node, params.value);
|
|
911
911
|
const clampedValue = clamp_1.default(params.value, min, max);
|
|
912
912
|
let cellBackColor;
|
|
913
913
|
let reverseGradient = false;
|
|
@@ -915,7 +915,8 @@ class Adaptable {
|
|
|
915
915
|
cellBackColor = gradientStyle.ColumnComparison.Color;
|
|
916
916
|
}
|
|
917
917
|
else {
|
|
918
|
-
const matchingRange = gradientStyle.CellRanges.find((r) => r.Min
|
|
918
|
+
const matchingRange = gradientStyle.CellRanges.find((r) => (r.Min == 'Col-Min' || r.Min <= clampedValue) &&
|
|
919
|
+
(r.Max == 'Col-Max' || r.Max >= clampedValue));
|
|
919
920
|
if (matchingRange) {
|
|
920
921
|
cellBackColor = matchingRange.Color;
|
|
921
922
|
reverseGradient = matchingRange.ReverseGradient;
|
|
@@ -3129,7 +3130,7 @@ class Adaptable {
|
|
|
3129
3130
|
const hasQuickSearchStyle = quickSearchStyle != undefined;
|
|
3130
3131
|
const cellStyle = (params) => {
|
|
3131
3132
|
const formatColumnCellStyle = formatColumn
|
|
3132
|
-
? this.getFormatColumnCellStyle(formatColumn, params)
|
|
3133
|
+
? this.getFormatColumnCellStyle(abColumn, formatColumn, params)
|
|
3133
3134
|
: undefined;
|
|
3134
3135
|
const isQuickSearchActive = hasQuickSearchStyle && this.isQuickSearchActive(abColumn, params);
|
|
3135
3136
|
const result = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, defaultCellStyle), this.getReadOnlyCellStyle(abColumn, params)), this.getEditableCellStyle(abColumn, params)), (typeof userCellStyle === 'function' ? userCellStyle(params) : userCellStyle)), formatColumnCellStyle), this.getConditionalStyleCellStyle(conditionalStyles, abColumn, params)), (isQuickSearchActive ? quickSearchStyle : undefined)), this.getAlertCellStyle(abColumn, params)), this.getFlashingCellStyle(abColumn, params)), this.getCellHighlightStyle(abColumn, params));
|
|
@@ -3221,7 +3222,7 @@ class Adaptable {
|
|
|
3221
3222
|
const formatColumn = this.api.formatColumnApi.getActiveFormatColumnForColumn(abColumn);
|
|
3222
3223
|
if (formatColumn && !(formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.IsSuspended) && formatColumn.ColumnStyle) {
|
|
3223
3224
|
if (formatColumn.ColumnStyle.PercentBarStyle) {
|
|
3224
|
-
return this.agGridHelper.createPercentBarRendererComp(formatColumn);
|
|
3225
|
+
return this.agGridHelper.createPercentBarRendererComp(formatColumn, abColumn);
|
|
3225
3226
|
}
|
|
3226
3227
|
if (formatColumn.ColumnStyle.CheckBoxStyle) {
|
|
3227
3228
|
return this.agGridHelper.createCheckboxRendererComp(abColumn.columnId, abColumn.readOnly);
|
|
@@ -3229,7 +3230,7 @@ class Adaptable {
|
|
|
3229
3230
|
}
|
|
3230
3231
|
});
|
|
3231
3232
|
}
|
|
3232
|
-
setupColumnTooltipValueGetter({ col, colId }) {
|
|
3233
|
+
setupColumnTooltipValueGetter({ col, colId, abColumn }) {
|
|
3233
3234
|
this.setColDefProperty(col, 'tooltipValueGetter', () => {
|
|
3234
3235
|
var _a;
|
|
3235
3236
|
const formatColumn = this.api.formatColumnApi.getFormatColumnForColumnId(colId);
|
|
@@ -3240,8 +3241,8 @@ class Adaptable {
|
|
|
3240
3241
|
formatColumn.ColumnStyle.PercentBarStyle.ToolTipText) {
|
|
3241
3242
|
if ((_a = formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.ColumnStyle) === null || _a === void 0 ? void 0 : _a.PercentBarStyle) {
|
|
3242
3243
|
return (params) => {
|
|
3243
|
-
const min = this.api.formatColumnApi.getNumericStyleMinValue(formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.ColumnStyle, params.node, params.value);
|
|
3244
|
-
const max = this.api.formatColumnApi.getNumericStyleMaxValue(formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.ColumnStyle, params.node, params.value);
|
|
3244
|
+
const min = this.api.formatColumnApi.getNumericStyleMinValue(formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.ColumnStyle, abColumn, params.node, params.value);
|
|
3245
|
+
const max = this.api.formatColumnApi.getNumericStyleMaxValue(formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.ColumnStyle, abColumn, params.node, params.value);
|
|
3245
3246
|
const textOptions = formatColumn.ColumnStyle.PercentBarStyle.ToolTipText;
|
|
3246
3247
|
let returnValue = '';
|
|
3247
3248
|
if (textOptions.includes('CellValue')) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { FormatColumn } from '../PredefinedConfig/FormatColumnState';
|
|
2
2
|
import { AdaptableApi } from '../Api/AdaptableApi';
|
|
3
|
-
|
|
3
|
+
import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
|
|
4
|
+
export declare const getPercentBarRendererForColumn: (formatColumn: FormatColumn, abColumn: AdaptableColumn, api: AdaptableApi) => any;
|
|
@@ -5,7 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const Helper_1 = tslib_1.__importDefault(require("../Utilities/Helpers/Helper"));
|
|
6
6
|
const clamp_1 = tslib_1.__importDefault(require("lodash/clamp"));
|
|
7
7
|
const FormatHelper_1 = tslib_1.__importDefault(require("../Utilities/Helpers/FormatHelper"));
|
|
8
|
-
const getPercentBarRendererForColumn = (formatColumn, api) => {
|
|
8
|
+
const getPercentBarRendererForColumn = (formatColumn, abColumn, api) => {
|
|
9
9
|
var _a;
|
|
10
10
|
if (!((_a = formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.ColumnStyle) === null || _a === void 0 ? void 0 : _a.PercentBarStyle)) {
|
|
11
11
|
return;
|
|
@@ -15,8 +15,8 @@ const getPercentBarRendererForColumn = (formatColumn, api) => {
|
|
|
15
15
|
if (!formatColumn.IncludeGroupedRows && api.gridApi.isGroupRowNode(params.node)) {
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
|
-
const min = api.formatColumnApi.getNumericStyleMinValue(formatColumn.ColumnStyle, params.node, params.value);
|
|
19
|
-
const max = api.formatColumnApi.getNumericStyleMaxValue(formatColumn.ColumnStyle, params.node, params.value);
|
|
18
|
+
const min = api.formatColumnApi.getNumericStyleMinValue(formatColumn.ColumnStyle, abColumn, params.node, params.value);
|
|
19
|
+
const max = api.formatColumnApi.getNumericStyleMaxValue(formatColumn.ColumnStyle, abColumn, params.node, params.value);
|
|
20
20
|
let value = params.value;
|
|
21
21
|
if (Helper_1.default.objectNotExists(value)) {
|
|
22
22
|
value = 0;
|
|
@@ -21,7 +21,7 @@ export declare class agGridHelper {
|
|
|
21
21
|
setUpModules(): Map<AdaptableModule, IModule>;
|
|
22
22
|
TrySetUpNodeIds(hasAutogeneratedPrimaryKey: boolean): boolean;
|
|
23
23
|
createCheckboxRendererComp(columnId: string, isColumnReadOnly: boolean): ICellRendererFunc | undefined;
|
|
24
|
-
createPercentBarRendererComp(formatColumn: FormatColumn): ICellRendererFunc;
|
|
24
|
+
createPercentBarRendererComp(formatColumn: FormatColumn, abColumn: AdaptableColumn): ICellRendererFunc;
|
|
25
25
|
getCleanValue(value: string): string | undefined;
|
|
26
26
|
getRenderedValue(colDef: ColDef, valueToRender: any): any;
|
|
27
27
|
createAdaptableColumnFromAgGridColumn(agGridColumn: Column, colsToGroups: Record<string, AdaptableColumnGroup>): AdaptableColumn;
|
|
@@ -148,8 +148,8 @@ class agGridHelper {
|
|
|
148
148
|
createCheckboxRendererComp(columnId, isColumnReadOnly) {
|
|
149
149
|
return CheckboxRenderer_1.getCheckboxRendererForColumn(columnId, isColumnReadOnly, this.adaptable.api);
|
|
150
150
|
}
|
|
151
|
-
createPercentBarRendererComp(formatColumn) {
|
|
152
|
-
return PercentBarRenderer_1.getPercentBarRendererForColumn(formatColumn, this.adaptable.api);
|
|
151
|
+
createPercentBarRendererComp(formatColumn, abColumn) {
|
|
152
|
+
return PercentBarRenderer_1.getPercentBarRendererForColumn(formatColumn, abColumn, this.adaptable.api);
|
|
153
153
|
}
|
|
154
154
|
getCleanValue(value) {
|
|
155
155
|
if (value == null || value == 'null' || value == undefined || value == 'undefined') {
|