@adaptabletools/adaptable 11.2.4-canary.0 → 11.2.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 +92 -92
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableOptions/AdaptableOptions.d.ts +7 -0
- package/src/AdaptableOptions/FinancePluginOptions.d.ts +33 -3
- package/src/AdaptableOptions/FormatColumnOptions.d.ts +9 -0
- package/src/AdaptableOptions/FormatColumnOptions.js +2 -0
- package/src/Api/ColumnApi.d.ts +4 -1
- package/src/Api/FinanceApi.d.ts +3 -2
- package/src/Api/FormatColumnApi.d.ts +22 -1
- package/src/Api/Implementation/ColumnApiImpl.js +4 -1
- package/src/Api/Implementation/FilterApiImpl.js +2 -7
- package/src/Api/Implementation/FormatColumnApiImpl.d.ts +5 -0
- package/src/Api/Implementation/FormatColumnApiImpl.js +29 -0
- package/src/PredefinedConfig/Common/AdaptableFormat.d.ts +8 -3
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +17 -1
- package/src/PredefinedConfig/Common/FDC3Context.d.ts +5 -1
- package/src/Strategy/FormatColumnModule.js +1 -1
- package/src/Strategy/LayoutModule.js +4 -4
- package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +2 -4
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +1 -1
- package/src/View/Components/FilterForm/FilterForm.d.ts +4 -1
- package/src/View/Components/FilterForm/ListBoxFilterForm.d.ts +4 -1
- package/src/View/Components/FilterForm/ListBoxFilterForm.js +7 -7
- package/src/View/Components/FilterForm/QuickFilterForm.js +15 -2
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.d.ts +3 -2
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +53 -22
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +1 -1
- package/src/agGrid/Adaptable.js +21 -21
- package/src/metamodel/adaptable.metamodel.d.ts +17 -2
- package/src/metamodel/adaptable.metamodel.js +62 -6
- package/src/types.d.ts +2 -2
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -10,7 +10,6 @@ const HelpBlock_1 = tslib_1.__importDefault(require("../../../components/HelpBlo
|
|
|
10
10
|
const Input_1 = tslib_1.__importDefault(require("../../../components/Input"));
|
|
11
11
|
const SimpleButton_1 = tslib_1.__importDefault(require("../../../components/SimpleButton"));
|
|
12
12
|
const CheckBox_1 = require("../../../components/CheckBox");
|
|
13
|
-
const FormatHelper_1 = tslib_1.__importDefault(require("../../../Utilities/Helpers/FormatHelper"));
|
|
14
13
|
const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
|
|
15
14
|
const AdaptableObjectRow_1 = require("../../Components/AdaptableObjectRow");
|
|
16
15
|
const Radio_1 = tslib_1.__importDefault(require("../../../components/Radio"));
|
|
@@ -18,6 +17,7 @@ const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
|
18
17
|
const Tabs_1 = require("../../../components/Tabs");
|
|
19
18
|
const StringExtensions_1 = tslib_1.__importDefault(require("../../../Utilities/Extensions/StringExtensions"));
|
|
20
19
|
const Tag_1 = require("../../../components/Tag");
|
|
20
|
+
const AdaptableContext_1 = require("../../AdaptableContext");
|
|
21
21
|
const DOLLAR_OPTIONS = {
|
|
22
22
|
FractionDigits: 2,
|
|
23
23
|
FractionSeparator: '.',
|
|
@@ -77,26 +77,45 @@ const DateFormatPresets = [
|
|
|
77
77
|
'yyyyMMdd',
|
|
78
78
|
'HH:mm:ss',
|
|
79
79
|
];
|
|
80
|
-
exports.getFormatColumnFormatSummaryValue = (data) => {
|
|
80
|
+
exports.getFormatColumnFormatSummaryValue = (data, formattedColumnApi) => {
|
|
81
81
|
let content = 'N/A';
|
|
82
82
|
if (!data.DisplayFormat) {
|
|
83
83
|
content = 'N/A';
|
|
84
84
|
}
|
|
85
85
|
else {
|
|
86
86
|
if (data.DisplayFormat.Formatter === 'NumberFormatter') {
|
|
87
|
-
content =
|
|
87
|
+
content = formattedColumnApi.getNumberFormattedValue(12345.6789, data.DisplayFormat.Options);
|
|
88
88
|
}
|
|
89
89
|
if (data.DisplayFormat.Formatter === 'DateFormatter') {
|
|
90
|
-
content =
|
|
90
|
+
content = formattedColumnApi.getDateFormattedValue(new Date(), data.DisplayFormat.Options);
|
|
91
91
|
}
|
|
92
92
|
if (data.DisplayFormat.Formatter === 'StringFormatter') {
|
|
93
|
-
content =
|
|
93
|
+
content = formattedColumnApi.getStringFormattedValue('Hello World ', data.DisplayFormat.Options);
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
return content;
|
|
97
97
|
};
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
function splitArrayInTwo(arr) {
|
|
99
|
+
const half = Math.floor(arr.length - 1 / 2);
|
|
100
|
+
return [arr.slice(0, half), arr.slice(half)];
|
|
101
|
+
}
|
|
102
|
+
const renderCustomFormatter = (data, customFormatter, setFormatOption) => {
|
|
103
|
+
var _a, _b, _c;
|
|
104
|
+
return (React.createElement(FormLayout_1.FormRow, { key: customFormatter.id, label: (_a = customFormatter.label) !== null && _a !== void 0 ? _a : customFormatter.id },
|
|
105
|
+
React.createElement(CheckBox_1.CheckBox, { checked: (_c = (_b = data.DisplayFormat.Options.CustomDisplayFormats) === null || _b === void 0 ? void 0 : _b.some) === null || _c === void 0 ? void 0 : _c.call(_b, (item) => item.Id === customFormatter.id), onChange: (checked) => {
|
|
106
|
+
var _a, _b, _c;
|
|
107
|
+
let newCustomFormats = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.DisplayFormat) === null || _a === void 0 ? void 0 : _a.Options) === null || _b === void 0 ? void 0 : _b.CustomDisplayFormats) !== null && _c !== void 0 ? _c : [];
|
|
108
|
+
if (checked) {
|
|
109
|
+
newCustomFormats = [...newCustomFormats, { Id: customFormatter.id }];
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
newCustomFormats = newCustomFormats.filter((item) => item.Id !== customFormatter.id);
|
|
113
|
+
}
|
|
114
|
+
setFormatOption('CustomDisplayFormats', newCustomFormats);
|
|
115
|
+
} })));
|
|
116
|
+
};
|
|
117
|
+
exports.renderFormatColumnFormatSummary = (data, api) => {
|
|
118
|
+
return React.createElement(Tag_1.Tag, null, exports.getFormatColumnFormatSummaryValue(data, api.formatColumnApi));
|
|
100
119
|
};
|
|
101
120
|
exports.getFormatDisplayTypeForScope = (scope, api) => {
|
|
102
121
|
if (scope == undefined) {
|
|
@@ -131,7 +150,7 @@ exports.getFormatDisplayTypeForScope = (scope, api) => {
|
|
|
131
150
|
}
|
|
132
151
|
return undefined;
|
|
133
152
|
};
|
|
134
|
-
const renderDateFormat = (data, _onChange, setFormatOption) => {
|
|
153
|
+
const renderDateFormat = (data, _onChange, setFormatOption, customFormatters, formatColumnApi) => {
|
|
135
154
|
if (data.DisplayFormat.Formatter !== 'DateFormatter') {
|
|
136
155
|
return null;
|
|
137
156
|
}
|
|
@@ -147,7 +166,8 @@ const renderDateFormat = (data, _onChange, setFormatOption) => {
|
|
|
147
166
|
React.createElement(FormLayout_1.default, null,
|
|
148
167
|
React.createElement(FormLayout_1.FormRow, { label: "Pattern" },
|
|
149
168
|
React.createElement(Input_1.default, { value: data.DisplayFormat.Options.Pattern, onChange: (e) => setFormatOption('Pattern', e.currentTarget.value), mr: 2 }),
|
|
150
|
-
React.createElement("span", null,
|
|
169
|
+
React.createElement("span", null, formatColumnApi.getDateFormattedValue(new Date(), data.DisplayFormat.Options))),
|
|
170
|
+
customFormatters.map((formatter) => renderCustomFormatter(data, formatter, setFormatOption))))),
|
|
151
171
|
React.createElement(Tabs_1.Tabs, { marginTop: 2 },
|
|
152
172
|
React.createElement(Tabs_1.Tabs.Tab, null, "Presets"),
|
|
153
173
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
@@ -159,7 +179,7 @@ const renderDateFormat = (data, _onChange, setFormatOption) => {
|
|
|
159
179
|
DateFormatPresets.map((Pattern, index) => (React.createElement(AdaptableObjectRow_1.AdaptableObjectRow, { key: index, colItems: [
|
|
160
180
|
{ Content: Pattern, Size: 1 },
|
|
161
181
|
{
|
|
162
|
-
Content:
|
|
182
|
+
Content: formatColumnApi.getDateFormattedValue(new Date(), { Pattern }),
|
|
163
183
|
Size: 1,
|
|
164
184
|
},
|
|
165
185
|
{
|
|
@@ -168,7 +188,7 @@ const renderDateFormat = (data, _onChange, setFormatOption) => {
|
|
|
168
188
|
},
|
|
169
189
|
] })))))));
|
|
170
190
|
};
|
|
171
|
-
const renderNumberFormat = (data, onChange, setFormatOption) => {
|
|
191
|
+
const renderNumberFormat = (data, onChange, setFormatOption, customFormatters, formatColumnApi) => {
|
|
172
192
|
if (data.DisplayFormat.Formatter !== 'NumberFormatter') {
|
|
173
193
|
return null;
|
|
174
194
|
}
|
|
@@ -220,6 +240,7 @@ const renderNumberFormat = (data, onChange, setFormatOption) => {
|
|
|
220
240
|
data.DisplayFormat.Options.Multiplier === MILLION_OPTIONS.Multiplier; //isEqual(data.DisplayFormat.Options, MILLION_OPTIONS);
|
|
221
241
|
const IS_DOLLAR = data.DisplayFormat.Options.Prefix === '$'; //isEqual(data.DisplayFormat.Options, DOLLAR_OPTIONS);
|
|
222
242
|
const IS_STERLING = data.DisplayFormat.Options.Prefix === '£'; //isEqual(data.DisplayFormat, STERLING_OPTIONS);
|
|
243
|
+
const [leftCustomFormatters, rightCustomFormatters] = splitArrayInTwo(customFormatters);
|
|
223
244
|
return (React.createElement(rebass_1.Box, { "data-name": 'format-column-display-format', padding: 2 },
|
|
224
245
|
React.createElement(Tabs_1.Tabs, null,
|
|
225
246
|
React.createElement(Tabs_1.Tabs.Tab, null, "Format"),
|
|
@@ -233,7 +254,8 @@ const renderNumberFormat = (data, onChange, setFormatOption) => {
|
|
|
233
254
|
React.createElement(FormLayout_1.FormRow, { label: "Prefix" },
|
|
234
255
|
React.createElement(Input_1.default, { value: data.DisplayFormat.Options.Prefix, onChange: (e) => setFormatOption('Prefix', e.currentTarget.value) })),
|
|
235
256
|
React.createElement(FormLayout_1.FormRow, { label: "Suffix" },
|
|
236
|
-
React.createElement(Input_1.default, { value: data.DisplayFormat.Options.Suffix, onChange: (e) => setFormatOption('Suffix', e.currentTarget.value) }))
|
|
257
|
+
React.createElement(Input_1.default, { value: data.DisplayFormat.Options.Suffix, onChange: (e) => setFormatOption('Suffix', e.currentTarget.value) })),
|
|
258
|
+
leftCustomFormatters.map((formatter) => renderCustomFormatter(data, formatter, setFormatOption))),
|
|
237
259
|
React.createElement(FormLayout_1.default, null,
|
|
238
260
|
React.createElement(FormLayout_1.FormRow, { label: "Fraction Digits" },
|
|
239
261
|
React.createElement(Input_1.default, { type: "number", min: "0",
|
|
@@ -250,7 +272,8 @@ const renderNumberFormat = (data, onChange, setFormatOption) => {
|
|
|
250
272
|
React.createElement(FormLayout_1.FormRow, { label: "Parentheses" },
|
|
251
273
|
React.createElement(CheckBox_1.CheckBox, { checked: data.DisplayFormat.Options.Parentheses, onChange: (checked) => setFormatOption('Parentheses', checked) })),
|
|
252
274
|
React.createElement(FormLayout_1.FormRow, { label: "Truncate" },
|
|
253
|
-
React.createElement(CheckBox_1.CheckBox, { checked: data.DisplayFormat.Options.Truncate, onChange: (checked) => setFormatOption('Truncate', checked) }))
|
|
275
|
+
React.createElement(CheckBox_1.CheckBox, { checked: data.DisplayFormat.Options.Truncate, onChange: (checked) => setFormatOption('Truncate', checked) })),
|
|
276
|
+
rightCustomFormatters.map((formatter) => renderCustomFormatter(data, formatter, setFormatOption)))))),
|
|
254
277
|
React.createElement(Tabs_1.Tabs, { marginTop: 2, autoFocus: false, keyboardNavigation: false },
|
|
255
278
|
React.createElement(Tabs_1.Tabs.Tab, null, "Presets"),
|
|
256
279
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
@@ -273,26 +296,26 @@ const renderNumberFormat = (data, onChange, setFormatOption) => {
|
|
|
273
296
|
React.createElement(AdaptableObjectRow_1.AdaptableObjectRow, { colItems: [
|
|
274
297
|
{ Content: '12345.6789', Size: 1 },
|
|
275
298
|
{
|
|
276
|
-
Content:
|
|
299
|
+
Content: formatColumnApi.getNumberFormattedValue(12345.6789, data.DisplayFormat.Options),
|
|
277
300
|
Size: 1,
|
|
278
301
|
},
|
|
279
302
|
] }),
|
|
280
303
|
React.createElement(AdaptableObjectRow_1.AdaptableObjectRow, { colItems: [
|
|
281
304
|
{ Content: '-12345.6789', Size: 1 },
|
|
282
305
|
{
|
|
283
|
-
Content:
|
|
306
|
+
Content: formatColumnApi.getNumberFormattedValue(-12345.6789, data.DisplayFormat.Options),
|
|
284
307
|
Size: 1,
|
|
285
308
|
},
|
|
286
309
|
] }),
|
|
287
310
|
React.createElement(AdaptableObjectRow_1.AdaptableObjectRow, { colItems: [
|
|
288
311
|
{ Content: '0.123', Size: 1 },
|
|
289
312
|
{
|
|
290
|
-
Content:
|
|
313
|
+
Content: formatColumnApi.getNumberFormattedValue(0.123, data.DisplayFormat.Options),
|
|
291
314
|
Size: 1,
|
|
292
315
|
},
|
|
293
316
|
] })))));
|
|
294
317
|
};
|
|
295
|
-
const renderStringFormat = (data, _onChange, setFormatOption) => {
|
|
318
|
+
const renderStringFormat = (data, _onChange, setFormatOption, customFormatters, formatColumnApi) => {
|
|
296
319
|
if (data.DisplayFormat.Formatter !== 'StringFormatter') {
|
|
297
320
|
return null;
|
|
298
321
|
}
|
|
@@ -311,7 +334,8 @@ const renderStringFormat = (data, _onChange, setFormatOption) => {
|
|
|
311
334
|
React.createElement(FormLayout_1.FormRow, { label: "Prefix" },
|
|
312
335
|
React.createElement(Input_1.default, { value: data.DisplayFormat.Options.Prefix, onChange: (e) => setFormatOption('Prefix', e.currentTarget.value) })),
|
|
313
336
|
React.createElement(FormLayout_1.FormRow, { label: "Suffix" },
|
|
314
|
-
React.createElement(Input_1.default, { value: data.DisplayFormat.Options.Suffix, onChange: (e) => setFormatOption('Suffix', e.currentTarget.value) }))
|
|
337
|
+
React.createElement(Input_1.default, { value: data.DisplayFormat.Options.Suffix, onChange: (e) => setFormatOption('Suffix', e.currentTarget.value) })),
|
|
338
|
+
customFormatters.map((formatter) => renderCustomFormatter(data, formatter, setFormatOption)))))),
|
|
315
339
|
React.createElement(Tabs_1.Tabs, { marginTop: 2, keyboardNavigation: false },
|
|
316
340
|
React.createElement(Tabs_1.Tabs.Tab, null, "Example"),
|
|
317
341
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
@@ -323,14 +347,18 @@ const renderStringFormat = (data, _onChange, setFormatOption) => {
|
|
|
323
347
|
{ Content: '"Hello World "', Size: 1 },
|
|
324
348
|
{
|
|
325
349
|
Content: '"' +
|
|
326
|
-
|
|
350
|
+
formatColumnApi.getStringFormattedValue('Hello World ', data.DisplayFormat.Options) +
|
|
327
351
|
'"',
|
|
328
352
|
Size: 1,
|
|
329
353
|
},
|
|
330
354
|
] })))));
|
|
331
355
|
};
|
|
332
356
|
exports.FormatColumnFormatWizardSection = (props) => {
|
|
357
|
+
var _a, _b, _c;
|
|
333
358
|
const { data } = OnePageAdaptableWizard_1.useOnePageWizardContext();
|
|
359
|
+
const adaptable = AdaptableContext_1.useAdaptable();
|
|
360
|
+
const formatColumnApi = adaptable.api.formatColumnApi;
|
|
361
|
+
const customDisplayFormatters = (_c = (_b = (_a = adaptable.adaptableOptions) === null || _a === void 0 ? void 0 : _a.formatColumnOptions) === null || _b === void 0 ? void 0 : _b.customDisplayFormatters) !== null && _c !== void 0 ? _c : [];
|
|
334
362
|
const update = (updated) => {
|
|
335
363
|
props.onChange(Object.assign(Object.assign({}, data), updated));
|
|
336
364
|
};
|
|
@@ -342,13 +370,16 @@ exports.FormatColumnFormatWizardSection = (props) => {
|
|
|
342
370
|
};
|
|
343
371
|
const Type = data.DisplayFormat && data.DisplayFormat.Formatter;
|
|
344
372
|
if (Type === 'NumberFormatter') {
|
|
345
|
-
|
|
373
|
+
const customNumberFormatters = customDisplayFormatters.filter((displayFormatter) => displayFormatter.type === 'Number');
|
|
374
|
+
return renderNumberFormat(data, update, setFormatOption, customNumberFormatters, formatColumnApi);
|
|
346
375
|
}
|
|
347
376
|
if (Type === 'DateFormatter') {
|
|
348
|
-
|
|
377
|
+
const customNumberFormatters = customDisplayFormatters.filter((displayFormatter) => displayFormatter.type === 'Date');
|
|
378
|
+
return renderDateFormat(data, update, setFormatOption, customNumberFormatters, formatColumnApi);
|
|
349
379
|
}
|
|
350
380
|
if (Type === 'StringFormatter') {
|
|
351
|
-
|
|
381
|
+
const customNumberFormatters = customDisplayFormatters.filter((displayFormatter) => displayFormatter.type === 'String');
|
|
382
|
+
return renderStringFormat(data, update, setFormatOption, customNumberFormatters, formatColumnApi);
|
|
352
383
|
}
|
|
353
384
|
return (React.createElement(HelpBlock_1.default, { margin: 3 },
|
|
354
385
|
"Setting a Display Format is only available if ",
|
|
@@ -125,7 +125,7 @@ function FormatColumnWizard(props) {
|
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
127
|
title: 'Display Format',
|
|
128
|
-
renderSummary: FormatColumnFormatWizardSection_1.renderFormatColumnFormatSummary,
|
|
128
|
+
renderSummary: (data) => FormatColumnFormatWizardSection_1.renderFormatColumnFormatSummary(data, api),
|
|
129
129
|
render: () => {
|
|
130
130
|
return React.createElement(FormatColumnFormatWizardSection_1.FormatColumnFormatWizardSection, { onChange: setFormatColumn });
|
|
131
131
|
},
|
package/src/agGrid/Adaptable.js
CHANGED
|
@@ -26,7 +26,7 @@ const AdaptableHelper_1 = tslib_1.__importDefault(require("../Utilities/Helpers/
|
|
|
26
26
|
const FormatHelper_1 = tslib_1.__importDefault(require("../Utilities/Helpers/FormatHelper"));
|
|
27
27
|
const Helper_1 = require("../Utilities/Helpers/Helper");
|
|
28
28
|
const LoggingHelper_1 = require("../Utilities/Helpers/LoggingHelper");
|
|
29
|
-
const ObjectFactory_1 =
|
|
29
|
+
const ObjectFactory_1 = require("../Utilities/ObjectFactory");
|
|
30
30
|
// services
|
|
31
31
|
const CalculatedColumnExpressionService_1 = require("../Utilities/Services/CalculatedColumnExpressionService");
|
|
32
32
|
const DataService_1 = require("../Utilities/Services/DataService");
|
|
@@ -1106,6 +1106,7 @@ class Adaptable {
|
|
|
1106
1106
|
return isCellReadonly ? readonlyCellStyle.ClassName : null;
|
|
1107
1107
|
}
|
|
1108
1108
|
isQuickSearchActive(abColumn, params) {
|
|
1109
|
+
var _a;
|
|
1109
1110
|
if (abColumn.isExcludedFromQuickSearch) {
|
|
1110
1111
|
return false;
|
|
1111
1112
|
}
|
|
@@ -1116,8 +1117,11 @@ class Adaptable {
|
|
|
1116
1117
|
if (StringExtensions_1.StringExtensions.IsNullOrEmpty(quickSearchValue)) {
|
|
1117
1118
|
return false;
|
|
1118
1119
|
}
|
|
1119
|
-
const
|
|
1120
|
-
|
|
1120
|
+
const displayValue = (_a = this.api.gridApi.getDisplayValueFromRowNode(params.node, abColumn.columnId)) !== null && _a !== void 0 ? _a : '';
|
|
1121
|
+
const ignoreCase = !this.api.internalApi.isTextComparisonCaseSensitive();
|
|
1122
|
+
const v = ignoreCase ? String(displayValue).toLocaleLowerCase() : String(displayValue);
|
|
1123
|
+
const i = ignoreCase ? String(quickSearchValue).toLocaleLowerCase() : String(quickSearchValue);
|
|
1124
|
+
return v.indexOf(i) !== -1;
|
|
1121
1125
|
}
|
|
1122
1126
|
getPrimaryKeyValueFromRowNode(rowNode) {
|
|
1123
1127
|
var _a;
|
|
@@ -1807,7 +1811,7 @@ class Adaptable {
|
|
|
1807
1811
|
const pkValue = this.getPrimaryKeyValueFromRowNode(rowNode);
|
|
1808
1812
|
const rawValue = this.getRawValueFromRowNode(rowNode, columnId);
|
|
1809
1813
|
const displayValue = this.getDisplayValueFromRawValue(columnId, rawValue);
|
|
1810
|
-
const normalisedvalue = this.getNormalisedValueFromRowValue(rawValue,
|
|
1814
|
+
const normalisedvalue = this.getNormalisedValueFromRowValue(rawValue, abColumn);
|
|
1811
1815
|
return {
|
|
1812
1816
|
rawValue: rawValue,
|
|
1813
1817
|
displayValue: displayValue,
|
|
@@ -1872,35 +1876,28 @@ class Adaptable {
|
|
|
1872
1876
|
};
|
|
1873
1877
|
return formatterFn(params);
|
|
1874
1878
|
}
|
|
1875
|
-
getNormalisedValueFromRowValue(rawValue,
|
|
1876
|
-
// not sure if the current implementation is correct:
|
|
1877
|
-
// the returned "normalised value" is actually the displayed value in almost all cases?!
|
|
1878
|
-
// ex. how to read the following: if 'rawValue' is NOT a number, return normalised version of rawValue, but if rawValue IS a number, return displayedValue of it (which will almost certainly will NOT be a number)
|
|
1879
|
-
// if (dataType === 'Number') {
|
|
1880
|
-
// return typeof rawValue !== 'number' ? Number(rawValue) : returnValue;
|
|
1881
|
-
// }
|
|
1882
|
-
// anyway, it seems to work so far (as of v11.1.3), so I'm leaving it for now :)
|
|
1879
|
+
getNormalisedValueFromRowValue(rawValue, column) {
|
|
1883
1880
|
if (!column) {
|
|
1884
1881
|
return rawValue;
|
|
1885
1882
|
}
|
|
1886
|
-
|
|
1887
|
-
if (
|
|
1883
|
+
// prevents from null
|
|
1884
|
+
if (rawValue === undefined || rawValue === null) {
|
|
1888
1885
|
return rawValue;
|
|
1889
1886
|
}
|
|
1890
1887
|
const dataType = column.dataType;
|
|
1891
1888
|
if (dataType === 'String') {
|
|
1892
|
-
return typeof rawValue !== 'string' ? String(rawValue) :
|
|
1889
|
+
return typeof rawValue !== 'string' ? String(rawValue) : rawValue;
|
|
1893
1890
|
}
|
|
1894
1891
|
if (dataType === 'Number') {
|
|
1895
|
-
return typeof rawValue !== 'number' ? Number(rawValue) :
|
|
1892
|
+
return typeof rawValue !== 'number' ? Number(rawValue) : rawValue;
|
|
1896
1893
|
}
|
|
1897
1894
|
if (dataType === 'Boolean') {
|
|
1898
|
-
return typeof rawValue !== 'boolean' ? Boolean(rawValue) :
|
|
1895
|
+
return typeof rawValue !== 'boolean' ? Boolean(rawValue) : rawValue;
|
|
1899
1896
|
}
|
|
1900
1897
|
if (dataType === 'Date') {
|
|
1901
1898
|
return rawValue instanceof Date ? rawValue : DateHelper_1.parseDateValue(rawValue);
|
|
1902
1899
|
}
|
|
1903
|
-
return
|
|
1900
|
+
return rawValue;
|
|
1904
1901
|
}
|
|
1905
1902
|
getRawValueFromRowNode(rowNode, columnId) {
|
|
1906
1903
|
if (rowNode == null) {
|
|
@@ -3168,21 +3165,24 @@ class Adaptable {
|
|
|
3168
3165
|
// change the Number format - if the scope allows it
|
|
3169
3166
|
if (this.api.scopeApi.isColumnInNumericScope(abColumn, formatColumn.Scope)) {
|
|
3170
3167
|
const options = formatColumn.DisplayFormat.Options;
|
|
3171
|
-
valueFormatter = (params) =>
|
|
3168
|
+
valueFormatter = (params) => {
|
|
3169
|
+
let value = params.value;
|
|
3170
|
+
return this.api.formatColumnApi.getNumberFormattedValue(value, options);
|
|
3171
|
+
};
|
|
3172
3172
|
}
|
|
3173
3173
|
}
|
|
3174
3174
|
if (formatColumn.DisplayFormat.Formatter === 'DateFormatter') {
|
|
3175
3175
|
// change the Date format - if the scope allows it
|
|
3176
3176
|
if (this.api.scopeApi.isColumnInDateScope(abColumn, formatColumn.Scope)) {
|
|
3177
3177
|
const options = formatColumn.DisplayFormat.Options;
|
|
3178
|
-
valueFormatter = (params) =>
|
|
3178
|
+
valueFormatter = (params) => this.api.formatColumnApi.getDateFormattedValue(params.value, options);
|
|
3179
3179
|
}
|
|
3180
3180
|
}
|
|
3181
3181
|
if (formatColumn.DisplayFormat.Formatter === 'StringFormatter') {
|
|
3182
3182
|
// change the Date format - if the scope allows it
|
|
3183
3183
|
if (this.api.scopeApi.isColumnInStringsScope(abColumn, formatColumn.Scope)) {
|
|
3184
3184
|
const options = formatColumn.DisplayFormat.Options;
|
|
3185
|
-
valueFormatter = (params) =>
|
|
3185
|
+
valueFormatter = (params) => this.api.formatColumnApi.getStringFormattedValue(params.value, options);
|
|
3186
3186
|
}
|
|
3187
3187
|
}
|
|
3188
3188
|
return valueFormatter;
|
|
@@ -240,7 +240,7 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
240
240
|
description: string;
|
|
241
241
|
uiLabel: string;
|
|
242
242
|
isOptional: boolean;
|
|
243
|
-
reference
|
|
243
|
+
reference?: undefined;
|
|
244
244
|
})[];
|
|
245
245
|
};
|
|
246
246
|
AdaptableFlashingCell: {
|
|
@@ -1522,6 +1522,22 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
1522
1522
|
isOptional?: undefined;
|
|
1523
1523
|
})[];
|
|
1524
1524
|
};
|
|
1525
|
+
CustomFDC3Column: {
|
|
1526
|
+
name: string;
|
|
1527
|
+
kind: string;
|
|
1528
|
+
description: string;
|
|
1529
|
+
properties: {
|
|
1530
|
+
name: string;
|
|
1531
|
+
kind: string;
|
|
1532
|
+
description: string;
|
|
1533
|
+
uiLabel: string;
|
|
1534
|
+
}[];
|
|
1535
|
+
};
|
|
1536
|
+
CustomFDC3Intent: {
|
|
1537
|
+
name: string;
|
|
1538
|
+
kind: string;
|
|
1539
|
+
description: string;
|
|
1540
|
+
};
|
|
1525
1541
|
CustomReport: {
|
|
1526
1542
|
name: string;
|
|
1527
1543
|
kind: string;
|
|
@@ -3495,7 +3511,6 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
3495
3511
|
kind: string;
|
|
3496
3512
|
description: string;
|
|
3497
3513
|
uiLabel: string;
|
|
3498
|
-
reference: string;
|
|
3499
3514
|
}[];
|
|
3500
3515
|
};
|
|
3501
3516
|
ReactFrameworkComponent: {
|
|
@@ -741,11 +741,10 @@ exports.ADAPTABLE_METAMODEL = {
|
|
|
741
741
|
},
|
|
742
742
|
{
|
|
743
743
|
"name": "intent",
|
|
744
|
-
"kind": "
|
|
744
|
+
"kind": "unknown",
|
|
745
745
|
"description": "The FDC3 Intent which caused Event to fire (if type is `RaiseIntent`)",
|
|
746
746
|
"uiLabel": "Intent",
|
|
747
|
-
"isOptional": true
|
|
748
|
-
"reference": "FDC3Intent"
|
|
747
|
+
"isOptional": true
|
|
749
748
|
}
|
|
750
749
|
]
|
|
751
750
|
},
|
|
@@ -1139,6 +1138,15 @@ exports.ADAPTABLE_METAMODEL = {
|
|
|
1139
1138
|
"gridInfo": "container",
|
|
1140
1139
|
"reference": "FlashingCellOptions"
|
|
1141
1140
|
},
|
|
1141
|
+
{
|
|
1142
|
+
"name": "formatColumnOptions",
|
|
1143
|
+
"kind": "REFERENCE",
|
|
1144
|
+
"description": "Options for managing format columns",
|
|
1145
|
+
"uiLabel": "Format Column Options",
|
|
1146
|
+
"isOptional": true,
|
|
1147
|
+
"gridInfo": "container",
|
|
1148
|
+
"reference": "unknown"
|
|
1149
|
+
},
|
|
1142
1150
|
{
|
|
1143
1151
|
"name": "generalOptions",
|
|
1144
1152
|
"kind": "REFERENCE",
|
|
@@ -4024,6 +4032,30 @@ exports.ADAPTABLE_METAMODEL = {
|
|
|
4024
4032
|
}
|
|
4025
4033
|
]
|
|
4026
4034
|
},
|
|
4035
|
+
"CustomFDC3Column": {
|
|
4036
|
+
"name": "CustomFDC3Column",
|
|
4037
|
+
"kind": "Interface",
|
|
4038
|
+
"description": "A Column which will be defined as Custom FDC3 (can be any datatype)",
|
|
4039
|
+
"properties": [
|
|
4040
|
+
{
|
|
4041
|
+
"name": "createContext",
|
|
4042
|
+
"kind": "unknown",
|
|
4043
|
+
"description": "Function which creates FDC3 context for the current column and row",
|
|
4044
|
+
"uiLabel": "Create Context"
|
|
4045
|
+
},
|
|
4046
|
+
{
|
|
4047
|
+
"name": "intents",
|
|
4048
|
+
"kind": "unknown",
|
|
4049
|
+
"description": "Custom FDC3 Intents available to the column",
|
|
4050
|
+
"uiLabel": "Intents"
|
|
4051
|
+
}
|
|
4052
|
+
]
|
|
4053
|
+
},
|
|
4054
|
+
"CustomFDC3Intent": {
|
|
4055
|
+
"name": "CustomFDC3Intent",
|
|
4056
|
+
"kind": "TypeAlias",
|
|
4057
|
+
"description": "Custom FDC3 Intent - just a string value"
|
|
4058
|
+
},
|
|
4027
4059
|
"CustomReport": {
|
|
4028
4060
|
"name": "CustomReport",
|
|
4029
4061
|
"kind": "Interface",
|
|
@@ -5801,6 +5833,13 @@ exports.ADAPTABLE_METAMODEL = {
|
|
|
5801
5833
|
"description": "Id of Column defined as FDC3",
|
|
5802
5834
|
"uiLabel": "Column Id"
|
|
5803
5835
|
},
|
|
5836
|
+
{
|
|
5837
|
+
"name": "getIconForIntent",
|
|
5838
|
+
"kind": "unknown",
|
|
5839
|
+
"description": "Returns the icon to display in the Raise Intent Context Menu Item",
|
|
5840
|
+
"uiLabel": "Get Icon For Intent",
|
|
5841
|
+
"isOptional": true
|
|
5842
|
+
},
|
|
5804
5843
|
{
|
|
5805
5844
|
"name": "intentContextMenuLabel",
|
|
5806
5845
|
"kind": "unknown",
|
|
@@ -6794,6 +6833,12 @@ exports.ADAPTABLE_METAMODEL = {
|
|
|
6794
6833
|
"description": "Returns any ColumnIds referenced in a Column Comparison",
|
|
6795
6834
|
"uiLabel": "Get Column Ids From Column Comparison"
|
|
6796
6835
|
},
|
|
6836
|
+
{
|
|
6837
|
+
"name": "getDateFormattedValue",
|
|
6838
|
+
"kind": "function",
|
|
6839
|
+
"description": "Format value according to format options.",
|
|
6840
|
+
"uiLabel": "Get Date Formatted Value"
|
|
6841
|
+
},
|
|
6797
6842
|
{
|
|
6798
6843
|
"name": "getFormatColumnById",
|
|
6799
6844
|
"kind": "function",
|
|
@@ -6842,6 +6887,12 @@ exports.ADAPTABLE_METAMODEL = {
|
|
|
6842
6887
|
"description": "Gets Format Column if any for given Column which includes Style element",
|
|
6843
6888
|
"uiLabel": "Get Format Column With Style For Column"
|
|
6844
6889
|
},
|
|
6890
|
+
{
|
|
6891
|
+
"name": "getNumberFormattedValue",
|
|
6892
|
+
"kind": "function",
|
|
6893
|
+
"description": "Format value according to format options.",
|
|
6894
|
+
"uiLabel": "Get Number Formatted Value"
|
|
6895
|
+
},
|
|
6845
6896
|
{
|
|
6846
6897
|
"name": "getNumericStyleMaxValue",
|
|
6847
6898
|
"kind": "function",
|
|
@@ -6854,6 +6905,12 @@ exports.ADAPTABLE_METAMODEL = {
|
|
|
6854
6905
|
"description": "Gets the Minimum Value to display for a Numeric Style",
|
|
6855
6906
|
"uiLabel": "Get Numeric Style Min Value"
|
|
6856
6907
|
},
|
|
6908
|
+
{
|
|
6909
|
+
"name": "getStringFormattedValue",
|
|
6910
|
+
"kind": "function",
|
|
6911
|
+
"description": "Format value according to format options.",
|
|
6912
|
+
"uiLabel": "Get String Formatted Value"
|
|
6913
|
+
},
|
|
6857
6914
|
{
|
|
6858
6915
|
"name": "hasStyleFormatColumns",
|
|
6859
6916
|
"kind": "function",
|
|
@@ -10473,10 +10530,9 @@ exports.ADAPTABLE_METAMODEL = {
|
|
|
10473
10530
|
"properties": [
|
|
10474
10531
|
{
|
|
10475
10532
|
"name": "intent",
|
|
10476
|
-
"kind": "
|
|
10533
|
+
"kind": "unknown",
|
|
10477
10534
|
"description": "FDC3 Intent that was raised",
|
|
10478
|
-
"uiLabel": "Intent"
|
|
10479
|
-
"reference": "FDC3Intent"
|
|
10535
|
+
"uiLabel": "Intent"
|
|
10480
10536
|
}
|
|
10481
10537
|
]
|
|
10482
10538
|
},
|
package/src/types.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export type { Glue42PluginOptions } from './AdaptableOptions/Glue42PluginOptions
|
|
|
19
19
|
export type { IPushPullPluginOptions } from './AdaptableOptions/IPushPullPluginOptions';
|
|
20
20
|
export type { LayoutOptions, LayoutViewOptions, LayoutTagOptions, LayoutAvailableContext, AutoGenerateTagsForLayoutsContext, LayoutAssociatedObject, } from './AdaptableOptions/LayoutOptions';
|
|
21
21
|
export type { OpenFinPluginOptions } from './AdaptableOptions/OpenFinPluginOptions';
|
|
22
|
-
export type { FinancePluginOptions, WeightedAverageColumn, FDC3Column, InstrumentColumn, PositionColumn, CountryColumn, InstrumentIntent, InstrumentIntents, PositionIntent, PositionIntents, ContactIntent, ContactIntents, CountryIntent, CountryIntents, ContactColumn, OrganizationColumn, OrganizationIntent, OrganizationIntents, FDC3Intent, RaiseFDC3IntentContext, } from './AdaptableOptions/FinancePluginOptions';
|
|
22
|
+
export type { FinancePluginOptions, WeightedAverageColumn, FDC3Column, InstrumentColumn, PositionColumn, CountryColumn, InstrumentIntent, InstrumentIntents, PositionIntent, PositionIntents, ContactIntent, ContactIntents, CountryIntent, CountryIntents, ContactColumn, OrganizationColumn, OrganizationIntent, OrganizationIntents, FDC3Intent, RaiseFDC3IntentContext, CustomFDC3Column, CustomFDC3Intent, } from './AdaptableOptions/FinancePluginOptions';
|
|
23
23
|
export type { DateInputOptions } from './AdaptableOptions/DateInputOptions';
|
|
24
24
|
export type { FilterOptions } from './AdaptableOptions/FilterOptions';
|
|
25
25
|
export type { SearchOptions } from './AdaptableOptions/SearchOptions';
|
|
@@ -112,7 +112,7 @@ export type { AdaptableObject, AdaptableObjectTag, } from './PredefinedConfig/Co
|
|
|
112
112
|
export type { SuspendableObject } from './PredefinedConfig/Common/SuspendableObject';
|
|
113
113
|
export type { AdaptableQuery, AdaptableAggregatedBooleanQuery, AdaptableAggregatedScalarQuery, AdaptableBooleanQuery, AdaptableObservableQuery, AdaptableScalarQuery, } from './PredefinedConfig/Common/AdaptableQuery';
|
|
114
114
|
export type { AdaptablePredicate, AdaptablePredicateDef, ModuleScope, PredicateDefHandlerParams, PredicateDefInput, PredicateDefToStringParams, } from './PredefinedConfig/Common/AdaptablePredicate';
|
|
115
|
-
export type { FDC3Context, InstrumentContext, InstrumentListContext, PositionContext, PortfolioContext, ContactContext, ContactListContext, CountryContext, OrganizationContext, AdaptableFDC3EventInfo, ContextType, } from './PredefinedConfig/Common/FDC3Context';
|
|
115
|
+
export type { FDC3Context, InstrumentContext, InstrumentListContext, PositionContext, PortfolioContext, ContactContext, ContactListContext, CountryContext, OrganizationContext, AdaptableFDC3EventInfo, ContextType, CustomFDC3Context, } from './PredefinedConfig/Common/FDC3Context';
|
|
116
116
|
export type { AdaptableScope } from './PredefinedConfig/Common/AdaptableScope';
|
|
117
117
|
export type { AdaptableStyle } from './PredefinedConfig/Common/AdaptableStyle';
|
|
118
118
|
export type { AdaptableIcon } from './PredefinedConfig/Common/AdaptableIcon';
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "11.2.4
|
|
1
|
+
declare const _default: "11.2.4";
|
|
2
2
|
export default _default;
|
package/version.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = '11.2.4
|
|
3
|
+
exports.default = '11.2.4'; // PLEASE DONT UPDATE THIS!!! - will be updated at build time with the correct version
|