@adaptabletools/adaptable 12.0.1 → 12.0.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/bundle.cjs.js +90 -90
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +4 -2
- package/src/AdaptableOptions/AdaptableQLOptions.d.ts +1 -1
- package/src/AdaptableOptions/StateOptions.d.ts +9 -23
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +34 -1
- package/src/Api/ChartingApi.d.ts +19 -2
- package/src/Api/FormatColumnApi.d.ts +6 -6
- package/src/Api/GridApi.d.ts +1 -1
- package/src/Api/Implementation/ChartingApiImpl.d.ts +6 -0
- package/src/Api/Implementation/ChartingApiImpl.js +17 -0
- package/src/Api/Implementation/ConfigApiImpl.d.ts +2 -0
- package/src/Api/Implementation/ConfigApiImpl.js +11 -0
- package/src/Api/Implementation/FormatColumnApiImpl.d.ts +3 -3
- package/src/Api/Implementation/FormatColumnApiImpl.js +13 -11
- package/src/Api/Implementation/GridApiImpl.d.ts +1 -1
- package/src/Api/Implementation/GridApiImpl.js +2 -2
- package/src/PredefinedConfig/AdaptableState.d.ts +2 -0
- package/src/PredefinedConfig/CalculatedColumnState.d.ts +0 -5
- package/src/PredefinedConfig/ChartingState.d.ts +20 -0
- package/src/PredefinedConfig/ChartingState.js +2 -0
- package/src/PredefinedConfig/Common/Types.d.ts +1 -1
- package/src/PredefinedConfig/PredefinedConfig.d.ts +5 -0
- package/src/Redux/ActionsReducers/ChartingRedux.d.ts +23 -0
- package/src/Redux/ActionsReducers/ChartingRedux.js +38 -0
- package/src/Redux/Store/AdaptableStore.js +2 -0
- package/src/Strategy/AlertModule.js +3 -3
- package/src/Strategy/ChartingModule.js +1 -1
- package/src/Strategy/FlashingCellModule.js +3 -3
- package/src/Utilities/Helpers/FormatHelper.d.ts +1 -1
- package/src/Utilities/Helpers/FormatHelper.js +6 -2
- package/src/Utilities/ObjectFactory.d.ts +5 -1
- package/src/Utilities/ObjectFactory.js +11 -1
- package/src/Utilities/Services/Interface/IReportService.d.ts +1 -1
- package/src/Utilities/Services/ReportService.d.ts +1 -1
- package/src/Utilities/Services/ReportService.js +5 -5
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +2 -9
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +13 -9
- package/src/agGrid/Adaptable.d.ts +4 -2
- package/src/agGrid/Adaptable.js +36 -20
- package/src/metamodel/adaptable.metamodel.d.ts +75 -1
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +3 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -20,9 +20,12 @@ function NumberFormatter(input, options = {}) {
|
|
|
20
20
|
if (input == null || input == undefined) {
|
|
21
21
|
return undefined;
|
|
22
22
|
}
|
|
23
|
+
if (typeof input === 'string') {
|
|
24
|
+
return input;
|
|
25
|
+
}
|
|
23
26
|
let n = Number(input);
|
|
24
27
|
if (isNaN(n)) {
|
|
25
|
-
return
|
|
28
|
+
return input.toString();
|
|
26
29
|
}
|
|
27
30
|
const fractionsSepatator = options.FractionSeparator ? options.FractionSeparator : '.';
|
|
28
31
|
let multiplier = options.Multiplier ? options.Multiplier : 1;
|
|
@@ -72,13 +75,14 @@ function DateFormatter(input, options) {
|
|
|
72
75
|
return undefined;
|
|
73
76
|
}
|
|
74
77
|
try {
|
|
78
|
+
// not sure if this is right if using a custom formatter...
|
|
75
79
|
if (typeof input === 'string') {
|
|
76
80
|
input = new Date(input);
|
|
77
81
|
}
|
|
78
82
|
return format_1.default(input, options.Pattern || '');
|
|
79
83
|
}
|
|
80
84
|
catch (error) {
|
|
81
|
-
return
|
|
85
|
+
return input;
|
|
82
86
|
}
|
|
83
87
|
}
|
|
84
88
|
exports.DateFormatter = DateFormatter;
|
|
@@ -24,8 +24,10 @@ import { AdaptableMessageType } from '../PredefinedConfig/Common/AdaptableMessag
|
|
|
24
24
|
import { SystemStatusMessageInfo } from '../PredefinedConfig/Common/SystemStatusMessageInfo';
|
|
25
25
|
import { NotificationsOptions } from '../AdaptableOptions/NotificationsOptions';
|
|
26
26
|
import { CellSummmary } from '../PredefinedConfig/Common/CellSummary';
|
|
27
|
-
import { ColumnFilter, FlashingCellDefinition, GridDataChangedInfo, SystemFilterPredicateId } from '../types';
|
|
27
|
+
import { ColumnFilter, CustomDisplayFormatterContext, FlashingCellDefinition, GridDataChangedInfo, SystemFilterPredicateId } from '../types';
|
|
28
28
|
import { ToastOptions } from 'react-toastify';
|
|
29
|
+
import { RowNode } from '@ag-grid-community/all-modules';
|
|
30
|
+
import { AdaptableApi } from '../../types';
|
|
29
31
|
export declare function CreateEmptyCustomSort(): CustomSort;
|
|
30
32
|
export declare function CreateEmptyCalculatedColumn(isFilterable: boolean): CalculatedColumn;
|
|
31
33
|
export declare function CreateEmptyNamedQuery(expression?: string): NamedQuery;
|
|
@@ -61,6 +63,7 @@ export declare function CreateEmptyStyle(): AdaptableStyle;
|
|
|
61
63
|
export declare function CreateSystemStatusMessageInfo(message: string, type: AdaptableMessageType, furtherInfo?: string): SystemStatusMessageInfo;
|
|
62
64
|
export declare function CreateEmptyCellSummmary(): CellSummmary;
|
|
63
65
|
export declare function CreateColumnFilter(ColumnId: string, PredicateId: SystemFilterPredicateId, Inputs: any[]): ColumnFilter;
|
|
66
|
+
export declare function CreateCustomDisplayFormatterContext(value: any, node: RowNode, abColumn: AdaptableColumn, api: AdaptableApi): CustomDisplayFormatterContext;
|
|
64
67
|
export declare function CreateToastOptions(notificationsOptions: NotificationsOptions, { onClose, containerId }: {
|
|
65
68
|
onClose?: VoidFunction;
|
|
66
69
|
containerId: string;
|
|
@@ -100,5 +103,6 @@ export declare const ObjectFactory: {
|
|
|
100
103
|
CreateEmptyGlue42Report: typeof CreateEmptyGlue42Report;
|
|
101
104
|
CreateSystemStatusMessageInfo: typeof CreateSystemStatusMessageInfo;
|
|
102
105
|
CreateToastOptions: typeof CreateToastOptions;
|
|
106
|
+
CreateCustomDisplayFormatterContext: typeof CreateCustomDisplayFormatterContext;
|
|
103
107
|
};
|
|
104
108
|
export default ObjectFactory;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ObjectFactory = exports.CreateToastOptions = exports.CreateColumnFilter = exports.CreateEmptyCellSummmary = exports.CreateSystemStatusMessageInfo = exports.CreateEmptyStyle = exports.CreateEmptyLayout = exports.CreateEmptyFreeTextColumn = exports.CreateEmptyFormatColumn = exports.CreateEmptyConditionalStyle = exports.CreateEmptyShortcut = exports.CreateEmptySchedule = exports.CreateReportSchedule = exports.CreateGlue42Schedule = exports.CreateIPushPullSchedule = exports.CreateEmptyOpenFinSchedule = exports.CreateEmptyGlue42Schedule = exports.CreateEmptyIPushPullSchedule = exports.CreateEmptyOpenFinReport = exports.CreateEmptyGlue42Report = exports.CreateEmptyIPushPullReport = exports.CreateEmptyReportSchedule = exports.CreateEmptyReminderSchedule = exports.CreateEmptyBaseSchedule = exports.CreateEmptyReport = exports.CreateInternalAlertDefinitionForMessages = exports.CreateEmptyFlashingCellDefinition = exports.CreateEmptyAlertDefinition = exports.CreateRowChangedAlert = exports.CreateCellChangedAlert = exports.CreateGenericAlert = exports.CreateEmptyPlusMinusNudge = exports.CreateEmptyNamedQuery = exports.CreateEmptyCalculatedColumn = exports.CreateEmptyCustomSort = void 0;
|
|
3
|
+
exports.ObjectFactory = exports.CreateToastOptions = exports.CreateCustomDisplayFormatterContext = exports.CreateColumnFilter = exports.CreateEmptyCellSummmary = exports.CreateSystemStatusMessageInfo = exports.CreateEmptyStyle = exports.CreateEmptyLayout = exports.CreateEmptyFreeTextColumn = exports.CreateEmptyFormatColumn = exports.CreateEmptyConditionalStyle = exports.CreateEmptyShortcut = exports.CreateEmptySchedule = exports.CreateReportSchedule = exports.CreateGlue42Schedule = exports.CreateIPushPullSchedule = exports.CreateEmptyOpenFinSchedule = exports.CreateEmptyGlue42Schedule = exports.CreateEmptyIPushPullSchedule = exports.CreateEmptyOpenFinReport = exports.CreateEmptyGlue42Report = exports.CreateEmptyIPushPullReport = exports.CreateEmptyReportSchedule = exports.CreateEmptyReminderSchedule = exports.CreateEmptyBaseSchedule = exports.CreateEmptyReport = exports.CreateInternalAlertDefinitionForMessages = exports.CreateEmptyFlashingCellDefinition = exports.CreateEmptyAlertDefinition = exports.CreateRowChangedAlert = exports.CreateCellChangedAlert = exports.CreateGenericAlert = exports.CreateEmptyPlusMinusNudge = exports.CreateEmptyNamedQuery = exports.CreateEmptyCalculatedColumn = exports.CreateEmptyCustomSort = void 0;
|
|
4
4
|
const Enums_1 = require("../PredefinedConfig/Common/Enums");
|
|
5
5
|
const GeneralConstants_1 = require("./Constants/GeneralConstants");
|
|
6
6
|
const Uuid_1 = require("../PredefinedConfig/Uuid");
|
|
@@ -355,6 +355,15 @@ function CreateColumnFilter(ColumnId, PredicateId, Inputs) {
|
|
|
355
355
|
};
|
|
356
356
|
}
|
|
357
357
|
exports.CreateColumnFilter = CreateColumnFilter;
|
|
358
|
+
function CreateCustomDisplayFormatterContext(value, node, abColumn, api) {
|
|
359
|
+
return {
|
|
360
|
+
adaptableColumn: abColumn,
|
|
361
|
+
cellValue: value,
|
|
362
|
+
rowNode: node,
|
|
363
|
+
adaptableApi: api,
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
exports.CreateCustomDisplayFormatterContext = CreateCustomDisplayFormatterContext;
|
|
358
367
|
function CreateToastOptions(notificationsOptions, { onClose, containerId }) {
|
|
359
368
|
const adaptableToastPosition = notificationsOptions.position;
|
|
360
369
|
const position = getToastPosition(adaptableToastPosition);
|
|
@@ -443,5 +452,6 @@ exports.ObjectFactory = {
|
|
|
443
452
|
CreateEmptyGlue42Report,
|
|
444
453
|
CreateSystemStatusMessageInfo,
|
|
445
454
|
CreateToastOptions,
|
|
455
|
+
CreateCustomDisplayFormatterContext,
|
|
446
456
|
};
|
|
447
457
|
exports.default = exports.ObjectFactory;
|
|
@@ -17,6 +17,6 @@ export interface IReportService extends IAdaptableService {
|
|
|
17
17
|
getReportDataAsArray(report: Report, includePrimaryKey?: boolean): any[][];
|
|
18
18
|
convertReportDataToArray(reportData: ReportData): any[][];
|
|
19
19
|
getCellExportValueFromRowNode(rowNode: RowNode, columnId: string): any;
|
|
20
|
-
getCellExportValueFromRawValue(rawValue: any, columnId: string): any;
|
|
20
|
+
getCellExportValueFromRawValue(rowNode: RowNode, rawValue: any, columnId: string): any;
|
|
21
21
|
getReportFileName(reportName: string): string;
|
|
22
22
|
}
|
|
@@ -21,7 +21,7 @@ export declare class ReportService implements IReportService {
|
|
|
21
21
|
getRowObjectForColumnIds(rowNode: RowNode, columnIds: string[]): Record<string, any>;
|
|
22
22
|
PublishLiveLiveDataChangedEvent(reportDestination: 'ipushpull' | 'Glue42', liveDataTrigger: 'Connected' | 'Disconnected' | 'LiveDataStarted' | 'LiveDataStopped' | 'LiveDataUpdated', liveReport?: any): void;
|
|
23
23
|
getCellExportValueFromRowNode(rowNode: RowNode, columnId: string): any;
|
|
24
|
-
getCellExportValueFromRawValue(cellRawValue: any, columnId: string): any;
|
|
24
|
+
getCellExportValueFromRawValue(rowNode: RowNode, cellRawValue: any, columnId: string): any;
|
|
25
25
|
getReportFileName(reportName: string): string;
|
|
26
26
|
destroy(): void;
|
|
27
27
|
private getCustomExportDateFormat;
|
|
@@ -300,9 +300,9 @@ class ReportService {
|
|
|
300
300
|
this.adaptableApi.eventApi.emit('LiveDataChanged', liveDataChangedInfo);
|
|
301
301
|
}
|
|
302
302
|
getCellExportValueFromRowNode(rowNode, columnId) {
|
|
303
|
-
return this.getCellExportValueFromRawValue(this.adaptableApi.gridApi.getRawValueFromRowNode(rowNode, columnId), columnId);
|
|
303
|
+
return this.getCellExportValueFromRawValue(rowNode, this.adaptableApi.gridApi.getRawValueFromRowNode(rowNode, columnId), columnId);
|
|
304
304
|
}
|
|
305
|
-
getCellExportValueFromRawValue(cellRawValue, columnId) {
|
|
305
|
+
getCellExportValueFromRawValue(rowNode, cellRawValue, columnId) {
|
|
306
306
|
if (StringExtensions_1.default.IsNullOrEmpty(cellRawValue)) {
|
|
307
307
|
return cellRawValue;
|
|
308
308
|
}
|
|
@@ -316,7 +316,7 @@ class ReportService {
|
|
|
316
316
|
}
|
|
317
317
|
// otherwise check the general export format types
|
|
318
318
|
let cellExportFormat = this.computeCellExportValueFormat(columnType);
|
|
319
|
-
return this.getCellExportValueFromRawValueByType(cellRawValue, columnId, cellExportFormat);
|
|
319
|
+
return this.getCellExportValueFromRawValueByType(rowNode, cellRawValue, columnId, cellExportFormat);
|
|
320
320
|
}
|
|
321
321
|
getReportFileName(reportName) {
|
|
322
322
|
let fileName = StringExtensions_1.default.ReplaceEmptySpacesWithUnderscore(reportName);
|
|
@@ -333,13 +333,13 @@ class ReportService {
|
|
|
333
333
|
getCustomExportDateFormat() {
|
|
334
334
|
return this.adaptableApi.internalApi.getAdaptableOptions().exportOptions.exportDateFormat;
|
|
335
335
|
}
|
|
336
|
-
getCellExportValueFromRawValueByType(cellRawValue, columnId,
|
|
336
|
+
getCellExportValueFromRawValueByType(rowNode, cellRawValue, columnId,
|
|
337
337
|
// default to rawValue if, for some reason, the configs provide invalid values
|
|
338
338
|
type = 'rawValue') {
|
|
339
339
|
return type === 'rawValue'
|
|
340
340
|
? cellRawValue
|
|
341
341
|
: // type === formattedValue
|
|
342
|
-
this.adaptableApi.gridApi.getFormattedValueFromRawValue(columnId, cellRawValue);
|
|
342
|
+
this.adaptableApi.gridApi.getFormattedValueFromRawValue(rowNode, columnId, cellRawValue);
|
|
343
343
|
}
|
|
344
344
|
computeCellExportValueFormat(columnDataType) {
|
|
345
345
|
const exportOptions = this.adaptableApi.internalApi.getAdaptableOptions().exportOptions;
|
|
@@ -74,7 +74,7 @@ const CalculatedColumnSettingsWizardSection = (props) => {
|
|
|
74
74
|
const ColumnName = data.FriendlyName;
|
|
75
75
|
const ColumnId = data.ColumnId;
|
|
76
76
|
let { DataType: dataType } = (_a = data.CalculatedColumnSettings) !== null && _a !== void 0 ? _a : {};
|
|
77
|
-
const { Width, ShowToolTip, HeaderToolTip
|
|
77
|
+
const { Width, ShowToolTip, HeaderToolTip } = (_b = data.CalculatedColumnSettings) !== null && _b !== void 0 ? _b : {};
|
|
78
78
|
const handleSpecialColumnSettingsChange = (settings) => {
|
|
79
79
|
props.onChange(Object.assign(Object.assign({}, data), { CalculatedColumnSettings: Object.assign(Object.assign({}, data.CalculatedColumnSettings), settings) }));
|
|
80
80
|
};
|
|
@@ -119,14 +119,7 @@ const CalculatedColumnSettingsWizardSection = (props) => {
|
|
|
119
119
|
}) })),
|
|
120
120
|
' ',
|
|
121
121
|
React.createElement(FormLayout_1.FormRow, { label: "" },
|
|
122
|
-
React.createElement(CheckBox_1.CheckBox, { "data-name": "column-show-tooltip", onChange: (checked) => handleSpecialColumnSettingsChange({ ShowToolTip: checked }), checked: ShowToolTip }, "Show Expression as Cell Tooltip")),
|
|
123
|
-
React.createElement(FormLayout_1.FormRow, { label: "" },
|
|
124
|
-
React.createElement(CheckBox_1.CheckBox, { "data-name": "column-external-expression-evaluation", onChange: (checked) => handleSpecialColumnSettingsChange({ ExternallyEvaluatedExpression: checked }), checked: ExternallyEvaluatedExpression }, "Suppress Expression Evaluation"),
|
|
125
|
-
ExternallyEvaluatedExpression && (React.createElement(rebass_1.Box, { "data-name": "note-external-expression-evaluation", p: 2, style: {
|
|
126
|
-
background: 'var(--ab-color-primary)',
|
|
127
|
-
borderRadius: 'var(--ab__border-radius)',
|
|
128
|
-
whiteSpace: 'pre-wrap',
|
|
129
|
-
} }, "The column value is loaded from the row data property with the same name as the ColumnId"))))))),
|
|
122
|
+
React.createElement(CheckBox_1.CheckBox, { "data-name": "column-show-tooltip", onChange: (checked) => handleSpecialColumnSettingsChange({ ShowToolTip: checked }), checked: ShowToolTip }, "Show Expression as Cell Tooltip")))))),
|
|
130
123
|
ErrorMessage ? React.createElement(ErrorBox_1.default, { marginTop: 2 }, ErrorMessage) : null,
|
|
131
124
|
React.createElement(SpecialColumnSettingsWizardStep_1.SpecialColumnSettingsWizardStep, { isEditable: false, settings: data.CalculatedColumnSettings, onChange: handleSpecialColumnSettingsChange })));
|
|
132
125
|
};
|
|
@@ -18,6 +18,7 @@ const Tabs_1 = require("../../../components/Tabs");
|
|
|
18
18
|
const StringExtensions_1 = tslib_1.__importDefault(require("../../../Utilities/Extensions/StringExtensions"));
|
|
19
19
|
const Tag_1 = require("../../../components/Tag");
|
|
20
20
|
const AdaptableContext_1 = require("../../AdaptableContext");
|
|
21
|
+
const FormatHelper_1 = tslib_1.__importDefault(require("../../../Utilities/Helpers/FormatHelper"));
|
|
21
22
|
const DOLLAR_OPTIONS = {
|
|
22
23
|
FractionDigits: 2,
|
|
23
24
|
FractionSeparator: '.',
|
|
@@ -84,13 +85,16 @@ const getFormatColumnFormatSummaryValue = (data, formattedColumnApi) => {
|
|
|
84
85
|
}
|
|
85
86
|
else {
|
|
86
87
|
if (data.DisplayFormat.Formatter === 'NumberFormatter') {
|
|
87
|
-
content =
|
|
88
|
+
content = FormatHelper_1.default.NumberFormatter(12345.6789, data.DisplayFormat.Options);
|
|
89
|
+
//formattedColumnApi.getNumberFormattedValue(12345.6789, data.DisplayFormat.Options);
|
|
88
90
|
}
|
|
89
91
|
if (data.DisplayFormat.Formatter === 'DateFormatter') {
|
|
90
|
-
content =
|
|
92
|
+
content = FormatHelper_1.default.DateFormatter(new Date(), data.DisplayFormat.Options);
|
|
93
|
+
//formattedColumnApi.getDateFormattedValue(new Date(), data.DisplayFormat.Options);
|
|
91
94
|
}
|
|
92
95
|
if (data.DisplayFormat.Formatter === 'StringFormatter') {
|
|
93
|
-
content =
|
|
96
|
+
content = FormatHelper_1.default.StringFormatter('Hello World ', data.DisplayFormat.Options);
|
|
97
|
+
//formattedColumnApi.getStringFormattedValue('Hello World ', data.DisplayFormat.Options);
|
|
94
98
|
}
|
|
95
99
|
}
|
|
96
100
|
return content;
|
|
@@ -169,7 +173,7 @@ const renderDateFormat = (data, _onChange, setFormatOption, customFormatters, fo
|
|
|
169
173
|
React.createElement(FormLayout_1.default, null,
|
|
170
174
|
React.createElement(FormLayout_1.FormRow, { label: "Pattern" },
|
|
171
175
|
React.createElement(Input_1.default, { value: data.DisplayFormat.Options.Pattern, onChange: (e) => setFormatOption('Pattern', e.currentTarget.value), mr: 2 }),
|
|
172
|
-
React.createElement("span", null,
|
|
176
|
+
React.createElement("span", null, FormatHelper_1.default.DateFormatter(new Date(), data.DisplayFormat.Options))),
|
|
173
177
|
customFormatters.map((formatter) => renderCustomFormatter(data, formatter, setFormatOption))))),
|
|
174
178
|
React.createElement(Tabs_1.Tabs, { marginTop: 2 },
|
|
175
179
|
React.createElement(Tabs_1.Tabs.Tab, null, "Presets"),
|
|
@@ -182,7 +186,7 @@ const renderDateFormat = (data, _onChange, setFormatOption, customFormatters, fo
|
|
|
182
186
|
DateFormatPresets.map((Pattern, index) => (React.createElement(AdaptableObjectRow_1.AdaptableObjectRow, { key: index, colItems: [
|
|
183
187
|
{ Content: Pattern, Size: 1 },
|
|
184
188
|
{
|
|
185
|
-
Content:
|
|
189
|
+
Content: FormatHelper_1.default.DateFormatter(new Date(), { Pattern }),
|
|
186
190
|
Size: 1,
|
|
187
191
|
},
|
|
188
192
|
{
|
|
@@ -299,21 +303,21 @@ const renderNumberFormat = (data, onChange, setFormatOption, customFormatters, f
|
|
|
299
303
|
React.createElement(AdaptableObjectRow_1.AdaptableObjectRow, { colItems: [
|
|
300
304
|
{ Content: '12345.6789', Size: 1 },
|
|
301
305
|
{
|
|
302
|
-
Content:
|
|
306
|
+
Content: FormatHelper_1.default.NumberFormatter(12345.6789, data.DisplayFormat.Options),
|
|
303
307
|
Size: 1,
|
|
304
308
|
},
|
|
305
309
|
] }),
|
|
306
310
|
React.createElement(AdaptableObjectRow_1.AdaptableObjectRow, { colItems: [
|
|
307
311
|
{ Content: '-12345.6789', Size: 1 },
|
|
308
312
|
{
|
|
309
|
-
Content:
|
|
313
|
+
Content: FormatHelper_1.default.NumberFormatter(-12345.6789, data.DisplayFormat.Options),
|
|
310
314
|
Size: 1,
|
|
311
315
|
},
|
|
312
316
|
] }),
|
|
313
317
|
React.createElement(AdaptableObjectRow_1.AdaptableObjectRow, { colItems: [
|
|
314
318
|
{ Content: '0.123', Size: 1 },
|
|
315
319
|
{
|
|
316
|
-
Content:
|
|
320
|
+
Content: FormatHelper_1.default.NumberFormatter(0.123, data.DisplayFormat.Options),
|
|
317
321
|
Size: 1,
|
|
318
322
|
},
|
|
319
323
|
] })))));
|
|
@@ -350,7 +354,7 @@ const renderStringFormat = (data, _onChange, setFormatOption, customFormatters,
|
|
|
350
354
|
{ Content: '"Hello World "', Size: 1 },
|
|
351
355
|
{
|
|
352
356
|
Content: '"' +
|
|
353
|
-
|
|
357
|
+
FormatHelper_1.default.StringFormatter('Hello World ', data.DisplayFormat.Options) +
|
|
354
358
|
'"',
|
|
355
359
|
Size: 1,
|
|
356
360
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColDef, ColGroupDef, Column, ExcelStyle, GridOptions, Module, RowNode } from '@ag-grid-community/all-modules';
|
|
1
|
+
import { ChartModel, ChartRef, ColDef, ColGroupDef, Column, ExcelStyle, GridOptions, Module, RowNode } from '@ag-grid-community/all-modules';
|
|
2
2
|
import { AdaptableNoCodeWizardOptions, IAdaptableNoCodeWizard } from '../AdaptableInterfaces/AdaptableNoCodeWizard';
|
|
3
3
|
import { IAdaptable } from '../AdaptableInterfaces/IAdaptable';
|
|
4
4
|
import { AdaptableOptions } from '../AdaptableOptions/AdaptableOptions';
|
|
@@ -186,7 +186,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
186
186
|
getDisplayValue(primaryKey: any, columnId: string): string | undefined;
|
|
187
187
|
getGridCellFromRowNode(rowNode: RowNode, columnId: string): GridCell | undefined;
|
|
188
188
|
getDisplayValueFromRowNode(rowNode: RowNode, columnId: string): string | undefined;
|
|
189
|
-
getDisplayValueFromRawValue(columnId: string, rawValue: any): string | undefined;
|
|
189
|
+
getDisplayValueFromRawValue(rowNode: RowNode, columnId: string, rawValue: any): string | undefined;
|
|
190
190
|
private getFormattedValue;
|
|
191
191
|
private getNormalisedValueFromRowValue;
|
|
192
192
|
getRawValueFromRowNode(rowNode: RowNode, columnId: string): any;
|
|
@@ -354,6 +354,8 @@ export declare class Adaptable implements IAdaptable {
|
|
|
354
354
|
private addSyntheticPrimaryKey;
|
|
355
355
|
private addSyntheticPrimaryKeyIfMissing;
|
|
356
356
|
initLicenseService(): LicenseService;
|
|
357
|
+
showCharts(charts: ChartModel[]): ChartRef[];
|
|
358
|
+
getChartModels(): ChartModel[];
|
|
357
359
|
}
|
|
358
360
|
export declare class AdaptableNoCodeWizard implements IAdaptableNoCodeWizard {
|
|
359
361
|
private init;
|
package/src/agGrid/Adaptable.js
CHANGED
|
@@ -1860,7 +1860,7 @@ class Adaptable {
|
|
|
1860
1860
|
const abColumn = this.api.columnApi.getColumnFromId(columnId);
|
|
1861
1861
|
const pkValue = this.getPrimaryKeyValueFromRowNode(rowNode);
|
|
1862
1862
|
const rawValue = this.getRawValueFromRowNode(rowNode, columnId);
|
|
1863
|
-
const displayValue = this.getDisplayValueFromRawValue(columnId, rawValue);
|
|
1863
|
+
const displayValue = this.getDisplayValueFromRawValue(rowNode, columnId, rawValue);
|
|
1864
1864
|
const normalisedvalue = this.getNormalisedValueFromRowValue(rawValue, abColumn);
|
|
1865
1865
|
return {
|
|
1866
1866
|
rawValue: rawValue,
|
|
@@ -1876,15 +1876,15 @@ class Adaptable {
|
|
|
1876
1876
|
return undefined;
|
|
1877
1877
|
}
|
|
1878
1878
|
const rawValue = this.getRawValueFromRowNode(rowNode, columnId);
|
|
1879
|
-
return this.getDisplayValueFromRawValue(columnId, rawValue);
|
|
1879
|
+
return this.getDisplayValueFromRawValue(rowNode, columnId, rawValue);
|
|
1880
1880
|
}
|
|
1881
|
-
getDisplayValueFromRawValue(columnId, rawValue) {
|
|
1881
|
+
getDisplayValueFromRawValue(rowNode, columnId, rawValue) {
|
|
1882
1882
|
const abColumn = this.api.columnApi.getColumnFromId(columnId);
|
|
1883
1883
|
const isRenderedColumn = this.api.columnApi.isFormatNumericStyleColumn(abColumn);
|
|
1884
1884
|
if (isRenderedColumn) {
|
|
1885
1885
|
const colDef = this.gridOptions.api.getColumnDef(columnId);
|
|
1886
1886
|
if (typeof colDef.valueFormatter == 'function') {
|
|
1887
|
-
return this.getFormattedValue(rawValue, columnId, colDef, colDef.valueFormatter);
|
|
1887
|
+
return this.getFormattedValue(rowNode, rawValue, columnId, colDef, colDef.valueFormatter);
|
|
1888
1888
|
}
|
|
1889
1889
|
return this.agGridHelper.getCleanValue(rawValue);
|
|
1890
1890
|
}
|
|
@@ -1895,7 +1895,7 @@ class Adaptable {
|
|
|
1895
1895
|
const colDef = this.gridOptions.api.getColumnDef(columnId);
|
|
1896
1896
|
if (colDef) {
|
|
1897
1897
|
if (typeof colDef.valueFormatter == 'function') {
|
|
1898
|
-
const formattedValue = this.getFormattedValue(rawValue, columnId, colDef, colDef.valueFormatter);
|
|
1898
|
+
const formattedValue = this.getFormattedValue(rowNode, rawValue, columnId, colDef, colDef.valueFormatter);
|
|
1899
1899
|
// Never use cellRenderer:
|
|
1900
1900
|
// - when a string, you never know if it is HTML or a normal string
|
|
1901
1901
|
// - when an object, cannot be used
|
|
@@ -1910,14 +1910,14 @@ class Adaptable {
|
|
|
1910
1910
|
}
|
|
1911
1911
|
return this.agGridHelper.getCleanValue(rawValue);
|
|
1912
1912
|
}
|
|
1913
|
-
getFormattedValue(rawValue, columnId, colDef, formatterFn) {
|
|
1913
|
+
getFormattedValue(rowNode, rawValue, columnId, colDef, formatterFn) {
|
|
1914
1914
|
const column = this.gridOptions.columnApi
|
|
1915
1915
|
.getAllColumns()
|
|
1916
1916
|
.find((c) => c.getColId() == columnId);
|
|
1917
1917
|
const params = {
|
|
1918
1918
|
value: rawValue,
|
|
1919
|
-
node:
|
|
1920
|
-
data:
|
|
1919
|
+
node: rowNode,
|
|
1920
|
+
data: rowNode.data,
|
|
1921
1921
|
colDef,
|
|
1922
1922
|
column,
|
|
1923
1923
|
api: this.gridOptions.api,
|
|
@@ -2402,6 +2402,7 @@ class Adaptable {
|
|
|
2402
2402
|
? this.adaptableOptions.filterOptions.enableFilterOnSpecialColumns
|
|
2403
2403
|
: true;
|
|
2404
2404
|
const defaultCalculatedColumnSettings = ObjectFactory_1.CreateEmptyCalculatedColumn(specialColumnsAreFilterable).CalculatedColumnSettings;
|
|
2405
|
+
const isExternalEvaluation = !this.api.internalApi.runModuleInAdaptableQL('CalculatedColumn');
|
|
2405
2406
|
return this.api.calculatedColumnApi.getAllCalculatedColumn().map((calculatedColumn) => {
|
|
2406
2407
|
const calculatedColumnSettings = Object.assign(Object.assign({}, defaultCalculatedColumnSettings), calculatedColumn.CalculatedColumnSettings);
|
|
2407
2408
|
if (!calculatedColumnSettings.DataType) {
|
|
@@ -2434,9 +2435,9 @@ class Adaptable {
|
|
|
2434
2435
|
suppressMovable: calculatedColumnSettings.SuppressMovable,
|
|
2435
2436
|
type: columnTypes,
|
|
2436
2437
|
valueGetter: (params) => {
|
|
2437
|
-
var _a
|
|
2438
|
-
if (
|
|
2439
|
-
return (
|
|
2438
|
+
var _a;
|
|
2439
|
+
if (isExternalEvaluation) {
|
|
2440
|
+
return (_a = params.data) === null || _a === void 0 ? void 0 : _a[calculatedColumn.ColumnId];
|
|
2440
2441
|
}
|
|
2441
2442
|
return this.CalculatedColumnExpressionService.evaluateCalculatedColumnQuery(calculatedColumn, params.node);
|
|
2442
2443
|
},
|
|
@@ -3309,28 +3310,29 @@ class Adaptable {
|
|
|
3309
3310
|
}
|
|
3310
3311
|
if (formatColumn.DisplayFormat) {
|
|
3311
3312
|
let valueFormatter;
|
|
3313
|
+
const options = formatColumn.DisplayFormat.Options;
|
|
3312
3314
|
if (formatColumn.DisplayFormat.Formatter === 'NumberFormatter') {
|
|
3313
3315
|
// change the Number format - if the scope allows it
|
|
3314
3316
|
if (this.api.scopeApi.isColumnInNumericScope(abColumn, formatColumn.Scope)) {
|
|
3315
|
-
const options = formatColumn.DisplayFormat.Options;
|
|
3316
3317
|
valueFormatter = (params) => {
|
|
3317
|
-
|
|
3318
|
-
return this.api.formatColumnApi.getNumberFormattedValue(value, options);
|
|
3318
|
+
return this.api.formatColumnApi.getNumberFormattedValue(params.value, params.node, abColumn, options);
|
|
3319
3319
|
};
|
|
3320
3320
|
}
|
|
3321
3321
|
}
|
|
3322
3322
|
if (formatColumn.DisplayFormat.Formatter === 'DateFormatter') {
|
|
3323
3323
|
// change the Date format - if the scope allows it
|
|
3324
3324
|
if (this.api.scopeApi.isColumnInDateScope(abColumn, formatColumn.Scope)) {
|
|
3325
|
-
|
|
3326
|
-
|
|
3325
|
+
valueFormatter = (params) => {
|
|
3326
|
+
return this.api.formatColumnApi.getDateFormattedValue(params.value, params.node, abColumn, options);
|
|
3327
|
+
};
|
|
3327
3328
|
}
|
|
3328
3329
|
}
|
|
3329
3330
|
if (formatColumn.DisplayFormat.Formatter === 'StringFormatter') {
|
|
3330
|
-
// change the
|
|
3331
|
+
// change the String format - if the scope allows it
|
|
3331
3332
|
if (this.api.scopeApi.isColumnInStringsScope(abColumn, formatColumn.Scope)) {
|
|
3332
|
-
|
|
3333
|
-
|
|
3333
|
+
valueFormatter = (params) => {
|
|
3334
|
+
return this.api.formatColumnApi.getStringFormattedValue(params.value, params.node, abColumn, options);
|
|
3335
|
+
};
|
|
3334
3336
|
}
|
|
3335
3337
|
}
|
|
3336
3338
|
return valueFormatter;
|
|
@@ -4533,7 +4535,7 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4533
4535
|
rawValue = numericRawValue;
|
|
4534
4536
|
}
|
|
4535
4537
|
}
|
|
4536
|
-
return this.ReportService.getCellExportValueFromRawValue(rawValue, columnId);
|
|
4538
|
+
return this.ReportService.getCellExportValueFromRawValue(rowNode, rawValue, columnId);
|
|
4537
4539
|
}
|
|
4538
4540
|
hasAutogeneratedPrimaryKey() {
|
|
4539
4541
|
return this.adaptableOptions.autogeneratePrimaryKey;
|
|
@@ -4560,6 +4562,20 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4560
4562
|
publishedAt: publishTimestamp_1.default,
|
|
4561
4563
|
});
|
|
4562
4564
|
}
|
|
4565
|
+
showCharts(charts) {
|
|
4566
|
+
if (!this.gridOptions.api) {
|
|
4567
|
+
LoggingHelper_1.ConsoleLogError('Adaptable must be instantiated before calling showCharts');
|
|
4568
|
+
return [];
|
|
4569
|
+
}
|
|
4570
|
+
return charts.map((chart) => this.gridOptions.api.restoreChart(chart));
|
|
4571
|
+
}
|
|
4572
|
+
getChartModels() {
|
|
4573
|
+
if (!this.gridOptions.api) {
|
|
4574
|
+
LoggingHelper_1.ConsoleLogError('Adaptable must be instantiated before calling getChartModels');
|
|
4575
|
+
return [];
|
|
4576
|
+
}
|
|
4577
|
+
return this.gridOptions.api.getChartModels();
|
|
4578
|
+
}
|
|
4563
4579
|
}
|
|
4564
4580
|
exports.Adaptable = Adaptable;
|
|
4565
4581
|
class AdaptableNoCodeWizard {
|
|
@@ -1353,6 +1353,41 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
1353
1353
|
kind: string;
|
|
1354
1354
|
description: string;
|
|
1355
1355
|
};
|
|
1356
|
+
ChartDefinition: {
|
|
1357
|
+
name: string;
|
|
1358
|
+
kind: string;
|
|
1359
|
+
description: string;
|
|
1360
|
+
properties: {
|
|
1361
|
+
name: string;
|
|
1362
|
+
kind: string;
|
|
1363
|
+
description: string;
|
|
1364
|
+
uiLabel: string;
|
|
1365
|
+
reference: string;
|
|
1366
|
+
}[];
|
|
1367
|
+
};
|
|
1368
|
+
ChartingApi: {
|
|
1369
|
+
name: string;
|
|
1370
|
+
kind: string;
|
|
1371
|
+
description: string;
|
|
1372
|
+
properties: {
|
|
1373
|
+
name: string;
|
|
1374
|
+
kind: string;
|
|
1375
|
+
description: string;
|
|
1376
|
+
uiLabel: string;
|
|
1377
|
+
}[];
|
|
1378
|
+
};
|
|
1379
|
+
ChartingState: {
|
|
1380
|
+
name: string;
|
|
1381
|
+
kind: string;
|
|
1382
|
+
description: string;
|
|
1383
|
+
properties: {
|
|
1384
|
+
name: string;
|
|
1385
|
+
kind: string;
|
|
1386
|
+
description: string;
|
|
1387
|
+
uiLabel: string;
|
|
1388
|
+
isOptional: boolean;
|
|
1389
|
+
}[];
|
|
1390
|
+
};
|
|
1356
1391
|
CheckboxColumnClickedInfo: {
|
|
1357
1392
|
name: string;
|
|
1358
1393
|
kind: string;
|
|
@@ -1796,6 +1831,29 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
1796
1831
|
isOptional?: undefined;
|
|
1797
1832
|
})[];
|
|
1798
1833
|
};
|
|
1834
|
+
CustomDisplayFormatter: {
|
|
1835
|
+
name: string;
|
|
1836
|
+
kind: string;
|
|
1837
|
+
description: string;
|
|
1838
|
+
};
|
|
1839
|
+
CustomDisplayFormatterContext: {
|
|
1840
|
+
name: string;
|
|
1841
|
+
kind: string;
|
|
1842
|
+
description: string;
|
|
1843
|
+
properties: ({
|
|
1844
|
+
name: string;
|
|
1845
|
+
kind: string;
|
|
1846
|
+
description: string;
|
|
1847
|
+
uiLabel: string;
|
|
1848
|
+
reference: string;
|
|
1849
|
+
} | {
|
|
1850
|
+
name: string;
|
|
1851
|
+
kind: string;
|
|
1852
|
+
description: string;
|
|
1853
|
+
uiLabel: string;
|
|
1854
|
+
reference?: undefined;
|
|
1855
|
+
})[];
|
|
1856
|
+
};
|
|
1799
1857
|
CustomFDC3Column: {
|
|
1800
1858
|
name: string;
|
|
1801
1859
|
kind: string;
|
|
@@ -4257,7 +4315,7 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
4257
4315
|
description: string;
|
|
4258
4316
|
uiLabel: string;
|
|
4259
4317
|
isOptional: boolean;
|
|
4260
|
-
defaultValue
|
|
4318
|
+
defaultValue?: undefined;
|
|
4261
4319
|
reference?: undefined;
|
|
4262
4320
|
} | {
|
|
4263
4321
|
name: string;
|
|
@@ -4267,6 +4325,22 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
4267
4325
|
isOptional: boolean;
|
|
4268
4326
|
defaultValue: string;
|
|
4269
4327
|
reference: string;
|
|
4328
|
+
} | {
|
|
4329
|
+
name: string;
|
|
4330
|
+
kind: string;
|
|
4331
|
+
description: string;
|
|
4332
|
+
uiLabel: string;
|
|
4333
|
+
isOptional: boolean;
|
|
4334
|
+
defaultValue: string;
|
|
4335
|
+
reference?: undefined;
|
|
4336
|
+
} | {
|
|
4337
|
+
name: string;
|
|
4338
|
+
kind: string;
|
|
4339
|
+
description: string;
|
|
4340
|
+
uiLabel: string;
|
|
4341
|
+
isOptional: boolean;
|
|
4342
|
+
reference: string;
|
|
4343
|
+
defaultValue?: undefined;
|
|
4270
4344
|
})[];
|
|
4271
4345
|
};
|
|
4272
4346
|
StatusBarState: {
|