@adaptabletools/adaptable 12.1.1 → 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 +80 -80
- 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/FormatColumnModule.js +1 -1
- package/src/Strategy/LayoutModule.js +2 -2
- package/src/Utilities/Services/MetamodelService.js +2 -1
- package/src/View/Alert/Wizard/AlertBehaviourWizardSection.d.ts +1 -0
- package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +6 -2
- package/src/View/Alert/Wizard/AlertWizard.js +1 -1
- package/src/View/Components/RangesComponent.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.d.ts +2 -2
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +3 -3
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.d.ts +1 -0
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +6 -1
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +2 -2
- package/src/View/Layout/Wizard/LayoutWizard.js +11 -4
- package/src/View/Layout/Wizard/sections/AggregationsSection.js +1 -1
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +7 -3
- 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/View/Wizard/OnePageAdaptableWizard.d.ts +1 -1
- package/src/agGrid/Adaptable.d.ts +1 -1
- package/src/agGrid/Adaptable.js +12 -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,7 +247,7 @@ class FormatColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
247
247
|
},
|
|
248
248
|
{
|
|
249
249
|
name: 'Display Format',
|
|
250
|
-
values: [FormatColumnFormatWizardSection_1.getFormatColumnFormatSummaryValue(formatColumn
|
|
250
|
+
values: [FormatColumnFormatWizardSection_1.getFormatColumnFormatSummaryValue(formatColumn)],
|
|
251
251
|
},
|
|
252
252
|
getFormatColumnSettingsViewItems_1.getFormatColumnSettingsViewItems(formatColumn),
|
|
253
253
|
getObjectTagsViewItems_1.getObjectTagsViewItems(formatColumn, this.api),
|
|
@@ -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',
|
|
@@ -46,7 +46,8 @@ class MetamodelService {
|
|
|
46
46
|
}
|
|
47
47
|
validateOptionsObject(validationErrors, optionsObjectName, optionsObject, optionsObjectMetamodel, optionsObjectDefaultValues) {
|
|
48
48
|
Object.entries(optionsObject).forEach(([optionKey, optionValue]) => {
|
|
49
|
-
|
|
49
|
+
var _a;
|
|
50
|
+
const optionMetamodel = (_a = optionsObjectMetamodel === null || optionsObjectMetamodel === void 0 ? void 0 : optionsObjectMetamodel.properties) === null || _a === void 0 ? void 0 : _a.find((metamodelProperty) => metamodelProperty.name === optionKey);
|
|
50
51
|
if (!optionMetamodel) {
|
|
51
52
|
validationErrors.push(`${optionsObjectName}.${optionKey} (value=${optionValue}) :: unknown/unsupported property, will be ignored`);
|
|
52
53
|
return;
|
|
@@ -4,6 +4,7 @@ import { AdaptableApi } from '../../../types';
|
|
|
4
4
|
declare type AlertBehaviourWizardSectionProps = {
|
|
5
5
|
onChange: (data: AlertDefinition) => void;
|
|
6
6
|
};
|
|
7
|
+
export declare const renderAlertBehaviourWizardSummary: (alertDefinition: AlertDefinition) => JSX.Element;
|
|
7
8
|
export declare const renderAlertBehaviourSummary: (alert: AlertDefinition, api: AdaptableApi, allowWrap?: boolean) => JSX.Element;
|
|
8
9
|
export declare const AlertBehaviourWizardSection: (props: AlertBehaviourWizardSectionProps) => JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AlertBehaviourWizardSection = exports.renderAlertBehaviourSummary = void 0;
|
|
3
|
+
exports.AlertBehaviourWizardSection = exports.renderAlertBehaviourSummary = exports.renderAlertBehaviourWizardSummary = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const Tabs_1 = require("../../../components/Tabs");
|
|
@@ -47,7 +47,11 @@ const HighlightStyle = (props) => {
|
|
|
47
47
|
props.onChange(style);
|
|
48
48
|
} }))))));
|
|
49
49
|
};
|
|
50
|
-
|
|
50
|
+
const renderAlertBehaviourWizardSummary = (alertDefinition) => {
|
|
51
|
+
const { api } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
|
|
52
|
+
return exports.renderAlertBehaviourSummary(alertDefinition, api);
|
|
53
|
+
};
|
|
54
|
+
exports.renderAlertBehaviourWizardSummary = renderAlertBehaviourWizardSummary;
|
|
51
55
|
const renderAlertBehaviourSummary = (alert, api, allowWrap = false) => {
|
|
52
56
|
const { AlertProperties = {} } = alert;
|
|
53
57
|
const values = [
|
|
@@ -158,7 +158,7 @@ const AlertWizard = (props) => {
|
|
|
158
158
|
title: behaviourSpelling,
|
|
159
159
|
render: () => (React.createElement(rebass_1.Box, { padding: 2 },
|
|
160
160
|
React.createElement(AlertBehaviourWizardSection_1.AlertBehaviourWizardSection, { onChange: setAlertDefinition }))),
|
|
161
|
-
renderSummary: AlertBehaviourWizardSection_1.
|
|
161
|
+
renderSummary: AlertBehaviourWizardSection_1.renderAlertBehaviourWizardSummary,
|
|
162
162
|
},
|
|
163
163
|
{
|
|
164
164
|
details: 'Select Alert tags',
|
|
@@ -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
|
}),
|
|
@@ -10,7 +10,7 @@ export interface FormatColumnFormatWizardState {
|
|
|
10
10
|
DisplayFormat: AdaptableFormat;
|
|
11
11
|
NumericFormat?: 'Percent' | 'Thousand' | 'Million' | 'Dollar' | 'Sterling' | undefined;
|
|
12
12
|
}
|
|
13
|
-
export declare const getFormatColumnFormatSummaryValue: (data: FormatColumn
|
|
14
|
-
export declare const renderFormatColumnFormatSummary: (data: FormatColumn
|
|
13
|
+
export declare const getFormatColumnFormatSummaryValue: (data: FormatColumn) => string;
|
|
14
|
+
export declare const renderFormatColumnFormatSummary: (data: FormatColumn) => JSX.Element;
|
|
15
15
|
export declare const getFormatDisplayTypeForScope: (scope: AdaptableScope, api: AdaptableApi) => 'Number' | 'Date' | 'String' | undefined;
|
|
16
16
|
export declare const FormatColumnFormatWizardSection: (props: FormatColumnFormatWizardSectionProps) => JSX.Element;
|
|
@@ -78,7 +78,7 @@ const DateFormatPresets = [
|
|
|
78
78
|
'yyyyMMdd',
|
|
79
79
|
'HH:mm:ss',
|
|
80
80
|
];
|
|
81
|
-
const getFormatColumnFormatSummaryValue = (data
|
|
81
|
+
const getFormatColumnFormatSummaryValue = (data) => {
|
|
82
82
|
let content = 'N/A';
|
|
83
83
|
if (!data.DisplayFormat) {
|
|
84
84
|
content = 'N/A';
|
|
@@ -112,8 +112,8 @@ const renderCustomFormatter = (data, customFormatter, setFormatOption) => {
|
|
|
112
112
|
setFormatOption('CustomDisplayFormats', newCustomFormats);
|
|
113
113
|
} })));
|
|
114
114
|
};
|
|
115
|
-
const renderFormatColumnFormatSummary = (data
|
|
116
|
-
return React.createElement(Tag_1.Tag, null, exports.getFormatColumnFormatSummaryValue(data
|
|
115
|
+
const renderFormatColumnFormatSummary = (data) => {
|
|
116
|
+
return React.createElement(Tag_1.Tag, null, exports.getFormatColumnFormatSummaryValue(data));
|
|
117
117
|
};
|
|
118
118
|
exports.renderFormatColumnFormatSummary = renderFormatColumnFormatSummary;
|
|
119
119
|
const getFormatDisplayTypeForScope = (scope, api) => {
|
|
@@ -5,6 +5,7 @@ export declare const isFormatColumnStyleValid: (data: FormatColumn, api: Adaptab
|
|
|
5
5
|
declare type FormatColumnStyleWizardSectionProps = {
|
|
6
6
|
onChange: (data: FormatColumn) => void;
|
|
7
7
|
};
|
|
8
|
+
export declare const renderFormatColumnStyleWizardSummary: (data: FormatColumn) => any;
|
|
8
9
|
export declare const renderFormatColumnStyleSummary: (data: FormatColumn, api: AdaptableApi) => any;
|
|
9
10
|
export declare function FormatColumnStyleWizardSection(props: FormatColumnStyleWizardSectionProps): JSX.Element;
|
|
10
11
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FormatColumnStyleWizardSection = exports.renderFormatColumnStyleSummary = exports.isFormatColumnStyleValid = void 0;
|
|
3
|
+
exports.FormatColumnStyleWizardSection = exports.renderFormatColumnStyleSummary = exports.renderFormatColumnStyleWizardSummary = exports.isFormatColumnStyleValid = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const rebass_1 = require("rebass");
|
|
@@ -76,6 +76,11 @@ const getColumnComparison = (columnComparison, api) => {
|
|
|
76
76
|
ForeColor: columnComparison.Color,
|
|
77
77
|
} })));
|
|
78
78
|
};
|
|
79
|
+
const renderFormatColumnStyleWizardSummary = (data) => {
|
|
80
|
+
const { api } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
|
|
81
|
+
return exports.renderFormatColumnStyleSummary(data, api);
|
|
82
|
+
};
|
|
83
|
+
exports.renderFormatColumnStyleWizardSummary = renderFormatColumnStyleWizardSummary;
|
|
79
84
|
const renderFormatColumnStyleSummary = (data, api) => {
|
|
80
85
|
if (data.ColumnStyle) {
|
|
81
86
|
if (data.ColumnStyle.CheckBoxStyle) {
|
|
@@ -117,7 +117,7 @@ function FormatColumnWizard(props) {
|
|
|
117
117
|
title: 'Style',
|
|
118
118
|
details: 'Format Column Style',
|
|
119
119
|
isValid: FormatColumnStyleWizardSection_1.isFormatColumnStyleValid,
|
|
120
|
-
renderSummary: FormatColumnStyleWizardSection_1.
|
|
120
|
+
renderSummary: FormatColumnStyleWizardSection_1.renderFormatColumnStyleWizardSummary,
|
|
121
121
|
render: () => {
|
|
122
122
|
return (React.createElement(rebass_1.Box, { padding: 2 },
|
|
123
123
|
React.createElement(FormatColumnStyleWizardSection_1.FormatColumnStyleWizardSection, { onChange: setFormatColumn })));
|
|
@@ -125,7 +125,7 @@ function FormatColumnWizard(props) {
|
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
127
|
title: 'Display Format',
|
|
128
|
-
renderSummary: (data) => FormatColumnFormatWizardSection_1.renderFormatColumnFormatSummary(data
|
|
128
|
+
renderSummary: (data) => FormatColumnFormatWizardSection_1.renderFormatColumnFormatSummary(data),
|
|
129
129
|
render: () => {
|
|
130
130
|
return React.createElement(FormatColumnFormatWizardSection_1.FormatColumnFormatWizardSection, { onChange: setFormatColumn });
|
|
131
131
|
},
|
|
@@ -26,14 +26,21 @@ const LayoutWizard = (props) => {
|
|
|
26
26
|
const initialLayout = (_a = props.data) !== null && _a !== void 0 ? _a : (_b = props.popupParams) === null || _b === void 0 ? void 0 : _b.value;
|
|
27
27
|
const [layout, setLayout] = react_1.useState(() => {
|
|
28
28
|
var _a;
|
|
29
|
+
let preparedLayout = null;
|
|
29
30
|
if (initialLayout) {
|
|
30
|
-
|
|
31
|
+
preparedLayout = Helper_1.cloneObject(initialLayout);
|
|
31
32
|
if (((_a = props === null || props === void 0 ? void 0 : props.popupParams) === null || _a === void 0 ? void 0 : _a.action) === 'Clone') {
|
|
32
33
|
preparedLayout.Name = '';
|
|
33
34
|
}
|
|
34
|
-
return preparedLayout;
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
else {
|
|
37
|
+
preparedLayout = ObjectFactory_1.default.CreateEmptyLayout({ Name: '' });
|
|
38
|
+
}
|
|
39
|
+
if (preparedLayout.SuppressAggFuncInHeader === undefined) {
|
|
40
|
+
preparedLayout.SuppressAggFuncInHeader =
|
|
41
|
+
!!adaptable.api.internalApi.getAgGridInstance().suppressAggFuncInHeader;
|
|
42
|
+
}
|
|
43
|
+
return preparedLayout;
|
|
37
44
|
});
|
|
38
45
|
const handleFinish = () => {
|
|
39
46
|
var _a;
|
|
@@ -117,7 +124,7 @@ const LayoutWizard = (props) => {
|
|
|
117
124
|
},
|
|
118
125
|
{
|
|
119
126
|
title: 'Filters',
|
|
120
|
-
details: 'Column Filters',
|
|
127
|
+
details: 'View Column Filters',
|
|
121
128
|
renderSummary: () => React.createElement(FilterSection_1.FilterSectionSummary, null),
|
|
122
129
|
render: () => (React.createElement(rebass_1.Box, { p: 2, style: { height: '100%' } },
|
|
123
130
|
React.createElement(FilterSection_1.FilterSection, { onChange: (newLayout) => setLayout(newLayout) }))),
|
|
@@ -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 }) }));
|
|
@@ -214,7 +218,7 @@ const ColumnsSection = (props) => {
|
|
|
214
218
|
React.createElement(ColumnLabels_1.ColumnLabels, { flexDirection: "row", showBoth: false, labels: {
|
|
215
219
|
Sortable: 'Sortable',
|
|
216
220
|
Filterable: 'Filterable',
|
|
217
|
-
Aggregatable: '
|
|
221
|
+
Aggregatable: 'Aggregatable',
|
|
218
222
|
Groupable: 'Groupable',
|
|
219
223
|
Moveable: 'Moveable',
|
|
220
224
|
Pivotable: 'Pivotable',
|
|
@@ -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) => {
|
|
@@ -22,7 +22,7 @@ export interface OnePageAdaptableWizardSection<ENTITY> {
|
|
|
22
22
|
isValid?: (data: ENTITY, api: AdaptableApi, context: OnePageAdaptableWizardContextType<ENTITY>) => true | string;
|
|
23
23
|
isVisible?: (data: ENTITY, api: AdaptableApi, context: OnePageAdaptableWizardContextType<ENTITY>) => boolean;
|
|
24
24
|
render: (data: ENTITY, index: number) => React.ReactNode;
|
|
25
|
-
renderSummary?: (data: ENTITY
|
|
25
|
+
renderSummary?: (data: ENTITY) => React.ReactNode;
|
|
26
26
|
}
|
|
27
27
|
export interface OnePageAdaptableWizardProps<ENTITY> {
|
|
28
28
|
moduleInfo: ModuleInfo;
|
|
@@ -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;
|