@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable",
|
|
3
|
-
"version": "11.2.4
|
|
3
|
+
"version": "11.2.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: 1653160464222;
|
|
2
2
|
export default _default;
|
package/publishTimestamp.js
CHANGED
|
@@ -22,6 +22,7 @@ import { GridOptions, Module } from '@ag-grid-community/all-modules';
|
|
|
22
22
|
import { FlashingCellOptions } from './FlashingCellOptions';
|
|
23
23
|
import { AlertOptions } from './AlertOptions';
|
|
24
24
|
import { AdaptableQLOptions } from './AdaptableQLOptions';
|
|
25
|
+
import { FormatColumnOptions } from './FormatColumnOptions';
|
|
25
26
|
/**
|
|
26
27
|
* Group of property options enabling developers to set up AdapTable at design time to fit precise requirements - provides AG Grid, Predefined Config and other information required to ensure a full, rich user experience
|
|
27
28
|
*/
|
|
@@ -141,6 +142,12 @@ export interface AdaptableOptions {
|
|
|
141
142
|
* @gridInfoContainer
|
|
142
143
|
*/
|
|
143
144
|
flashingCellOptions?: FlashingCellOptions;
|
|
145
|
+
/**
|
|
146
|
+
* Options for managing format columns
|
|
147
|
+
*
|
|
148
|
+
* @gridInfoContainer
|
|
149
|
+
*/
|
|
150
|
+
formatColumnOptions?: FormatColumnOptions;
|
|
144
151
|
/**
|
|
145
152
|
* General options to manage AdapTable e.g. grouping behaviour, Primary Keys
|
|
146
153
|
*
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ContextMenuContext } from '../../types';
|
|
1
|
+
import { ContextMenuContext, GridCell } from '../../types';
|
|
2
|
+
import { CustomFDC3Context } from '../PredefinedConfig/Common/FDC3Context';
|
|
2
3
|
/**
|
|
3
4
|
* Options required for when using the Finance plugin
|
|
4
5
|
*/
|
|
@@ -27,6 +28,14 @@ export interface FinancePluginOptions {
|
|
|
27
28
|
* FDC3 Organizations
|
|
28
29
|
*/
|
|
29
30
|
organizationColumns?: OrganizationColumn[];
|
|
31
|
+
/**
|
|
32
|
+
* Custom FDC3 Columns
|
|
33
|
+
*/
|
|
34
|
+
customFDC3Columns?: CustomFDC3Column[];
|
|
35
|
+
/**
|
|
36
|
+
* Custom FDC3 Intents
|
|
37
|
+
*/
|
|
38
|
+
customFDC3Intents?: CustomFDC3Intent[];
|
|
30
39
|
};
|
|
31
40
|
/**
|
|
32
41
|
* Columns to use a Weighted Average aggregation
|
|
@@ -69,11 +78,15 @@ export interface FDC3Column {
|
|
|
69
78
|
/**
|
|
70
79
|
* FDC3 intents which the Column can raise
|
|
71
80
|
*/
|
|
72
|
-
intents?: any;
|
|
81
|
+
intents?: any[];
|
|
73
82
|
/**
|
|
74
83
|
* Label to display in Intent Context Menu Item
|
|
75
84
|
*/
|
|
76
85
|
intentContextMenuLabel?: string | ((raiseFDC3IntentContext: RaiseFDC3IntentContext) => string);
|
|
86
|
+
/**
|
|
87
|
+
* Returns the icon to display in the Raise Intent Context Menu Item
|
|
88
|
+
*/
|
|
89
|
+
getIconForIntent?: (intent: FDC3Intent | CustomFDC3Intent) => any;
|
|
77
90
|
}
|
|
78
91
|
/**
|
|
79
92
|
* A Column which will be defined as an FDC3 Instrument
|
|
@@ -222,10 +235,27 @@ export declare type CountryIntents = CountryIntent[];
|
|
|
222
235
|
* FDC3 Intents available to a Country Column
|
|
223
236
|
*/
|
|
224
237
|
export declare type CountryIntent = 'ViewChart';
|
|
238
|
+
/**
|
|
239
|
+
* A Column which will be defined as Custom FDC3 (can be any datatype)
|
|
240
|
+
*/
|
|
241
|
+
export interface CustomFDC3Column extends FDC3Column {
|
|
242
|
+
/**
|
|
243
|
+
* Custom FDC3 Intents available to the column
|
|
244
|
+
*/
|
|
245
|
+
intents: CustomFDC3Intent[];
|
|
246
|
+
/**
|
|
247
|
+
* Function which creates FDC3 context for the current column and row
|
|
248
|
+
*/
|
|
249
|
+
createContext: (gridCell: GridCell) => CustomFDC3Context;
|
|
250
|
+
}
|
|
225
251
|
/**
|
|
226
252
|
* Full list of FDC3 Intents available - each FDC3 Column can use a subset
|
|
227
253
|
*/
|
|
228
254
|
export declare type FDC3Intent = 'StartCall' | 'StartChat' | 'ViewAnalysis' | 'ViewChart' | 'ViewContact' | 'ViewInstrument' | 'ViewNews' | 'ViewQuote';
|
|
255
|
+
/**
|
|
256
|
+
* Custom FDC3 Intent - just a string value
|
|
257
|
+
*/
|
|
258
|
+
export declare type CustomFDC3Intent = string;
|
|
229
259
|
/**
|
|
230
260
|
* Context passed into Raise FDC3 Intent functions (e.g. get label)
|
|
231
261
|
*/
|
|
@@ -233,5 +263,5 @@ export interface RaiseFDC3IntentContext extends ContextMenuContext {
|
|
|
233
263
|
/**
|
|
234
264
|
* FDC3 Intent that was raised
|
|
235
265
|
*/
|
|
236
|
-
intent: FDC3Intent;
|
|
266
|
+
intent: FDC3Intent | CustomFDC3Intent;
|
|
237
267
|
}
|
package/src/Api/ColumnApi.d.ts
CHANGED
|
@@ -227,7 +227,10 @@ export interface ColumnApi {
|
|
|
227
227
|
* @param columnFilter Current applied filter
|
|
228
228
|
*/
|
|
229
229
|
getDistinctFilterDisplayValuesForColumn(columnId: string, filter: string): Promise<{
|
|
230
|
-
values:
|
|
230
|
+
values: {
|
|
231
|
+
value: any;
|
|
232
|
+
label: string;
|
|
233
|
+
}[];
|
|
231
234
|
suppressClientSideFilter: boolean;
|
|
232
235
|
}>;
|
|
233
236
|
/**
|
package/src/Api/FinanceApi.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RowNode } from '@ag-grid-community/all-modules';
|
|
2
|
-
import { ContactColumn, ContactIntent, CountryColumn, FDC3Intent, FinancePluginOptions, InstrumentColumn, InstrumentIntent, OrganizationColumn, PositionColumn, PositionIntent } from '../AdaptableOptions/FinancePluginOptions';
|
|
2
|
+
import { ContactColumn, ContactIntent, CountryColumn, CustomFDC3Column, CustomFDC3Intent, FDC3Intent, FinancePluginOptions, InstrumentColumn, InstrumentIntent, OrganizationColumn, PositionColumn, PositionIntent } from '../AdaptableOptions/FinancePluginOptions';
|
|
3
3
|
import { ContactContext, ContactListContext, CountryContext, FDC3Context, InstrumentContext, InstrumentListContext, OrganizationContext, PortfolioContext, PositionContext } from '../types';
|
|
4
4
|
/**
|
|
5
5
|
* Provides run-time access to the Finance Plugin
|
|
@@ -82,6 +82,7 @@ export interface FinanceApi {
|
|
|
82
82
|
* @param instrumentColumnId Column to Look
|
|
83
83
|
*/
|
|
84
84
|
getCountryColumnById(countryColumnId: string): CountryColumn;
|
|
85
|
+
getCustomFDC3ColumnById(customFDC3ColumnId: string): CustomFDC3Column;
|
|
85
86
|
/**
|
|
86
87
|
* Publishes an FDC3 Message Event of type `Broadcast`
|
|
87
88
|
* @param context context for Event
|
|
@@ -92,7 +93,7 @@ export interface FinanceApi {
|
|
|
92
93
|
* @param context context for Event
|
|
93
94
|
* @param intent FDC3 Intent to Raise
|
|
94
95
|
*/
|
|
95
|
-
publishRaiseFDC3IntentEvent(context: FDC3Context, intent: FDC3Intent): void;
|
|
96
|
+
publishRaiseFDC3IntentEvent(context: FDC3Context, intent: FDC3Intent | CustomFDC3Intent): void;
|
|
96
97
|
/**
|
|
97
98
|
* Checks whether the Instrument Intent is valid for Instrument Lists
|
|
98
99
|
* @param intent FDC3 Intent to check
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FormatColumnState, FormatColumn, ColumnStyle, ColumnComparison } from '../PredefinedConfig/FormatColumnState';
|
|
2
|
-
import { AdaptableColumn } from '../types';
|
|
2
|
+
import { AdaptableColumn, AdaptableFormat } from '../types';
|
|
3
3
|
import { RowNode } from '@ag-grid-community/all-modules';
|
|
4
4
|
/**
|
|
5
5
|
* Provides run-time access to the Format Column Module and associated state
|
|
@@ -172,4 +172,25 @@ export interface FormatColumnApi {
|
|
|
172
172
|
* Publishes the CheckboxColumnClickedEvent - when the checkbox in an Checkbox Column is clicked
|
|
173
173
|
*/
|
|
174
174
|
fireCheckboxColumnClickedEvent(columnId: string, rowData: any, primaryKeyValue: any, isChecked: boolean): void;
|
|
175
|
+
/**
|
|
176
|
+
* Format value according to format options.
|
|
177
|
+
*
|
|
178
|
+
* @param value value to format
|
|
179
|
+
* @param options formatter options
|
|
180
|
+
*/
|
|
181
|
+
getNumberFormattedValue(value: any, options: AdaptableFormat['Options']): any;
|
|
182
|
+
/**
|
|
183
|
+
* Format value according to format options.
|
|
184
|
+
*
|
|
185
|
+
* @param value value to format
|
|
186
|
+
* @param options formatter options
|
|
187
|
+
*/
|
|
188
|
+
getStringFormattedValue(value: any, options: AdaptableFormat['Options']): string;
|
|
189
|
+
/**
|
|
190
|
+
* Format value according to format options.
|
|
191
|
+
*
|
|
192
|
+
* @param value value to format
|
|
193
|
+
* @param options formatter options
|
|
194
|
+
*/
|
|
195
|
+
getDateFormattedValue(value: any, options: AdaptableFormat['Options']): string;
|
|
175
196
|
}
|
|
@@ -299,7 +299,10 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
299
299
|
const { gridCells, suppressClientSideFilter } = await this.adaptable.getDistinctFilterValuesForColumn(abColumn, false, filter);
|
|
300
300
|
return {
|
|
301
301
|
values: this.sortDistinctValues(gridCells, abColumn).map((cv) => {
|
|
302
|
-
return
|
|
302
|
+
return {
|
|
303
|
+
label: cv.displayValue,
|
|
304
|
+
value: cv.normalisedValue,
|
|
305
|
+
};
|
|
303
306
|
}),
|
|
304
307
|
suppressClientSideFilter,
|
|
305
308
|
};
|
|
@@ -156,7 +156,7 @@ class FilterApiImpl extends ApiBase_1.ApiBase {
|
|
|
156
156
|
return columnFilters.map((cf) => this.columnFilterToString(cf)).join(', ');
|
|
157
157
|
}
|
|
158
158
|
evaluateColumnFilter(columnFilter, node) {
|
|
159
|
-
var _a
|
|
159
|
+
var _a;
|
|
160
160
|
if (!columnFilter.Predicate) {
|
|
161
161
|
return true;
|
|
162
162
|
}
|
|
@@ -172,15 +172,10 @@ class FilterApiImpl extends ApiBase_1.ApiBase {
|
|
|
172
172
|
return true;
|
|
173
173
|
}
|
|
174
174
|
let value = gridCell.normalisedValue;
|
|
175
|
-
if (((_b = columnFilter.Predicate) === null || _b === void 0 ? void 0 : _b.PredicateId) === 'Contains' && column.dataType === 'Date') {
|
|
176
|
-
// although 'Contains' Predicate is NOT relevant for Date columns, we have to handle the special case of QuickSearching
|
|
177
|
-
// in that case, we have to evaluate the displayedValue of the cell, not the normalisedValue (it's a textual search after all)
|
|
178
|
-
value = gridCell.displayValue;
|
|
179
|
-
}
|
|
180
175
|
return this.adaptable.api.predicateApi.handlePredicate(columnFilter.Predicate, {
|
|
181
176
|
value: value,
|
|
182
177
|
oldValue: null,
|
|
183
|
-
displayValue: gridCell.
|
|
178
|
+
displayValue: gridCell.displayValue,
|
|
184
179
|
node,
|
|
185
180
|
column,
|
|
186
181
|
}, true);
|
|
@@ -4,6 +4,7 @@ import { FormatColumnApi } from '../FormatColumnApi';
|
|
|
4
4
|
import { FormatColumnState, FormatColumn, ColumnStyle, ColumnComparison } from '../../PredefinedConfig/FormatColumnState';
|
|
5
5
|
import { AdaptableColumn } from '../../PredefinedConfig/Common/AdaptableColumn';
|
|
6
6
|
import { RowNode } from '@ag-grid-community/all-modules';
|
|
7
|
+
import { AdaptableFormat } from '../../types';
|
|
7
8
|
export declare class FormatColumnApiImpl extends ApiBase implements FormatColumnApi {
|
|
8
9
|
getFormatColumnState(): FormatColumnState;
|
|
9
10
|
getAllFormatColumn(config?: {
|
|
@@ -44,4 +45,8 @@ export declare class FormatColumnApiImpl extends ApiBase implements FormatColumn
|
|
|
44
45
|
getCheckBoxStyleFormatColumn(column: AdaptableColumn): FormatColumn | undefined;
|
|
45
46
|
isCheckBoxStyleFormatColumn(column: AdaptableColumn): boolean;
|
|
46
47
|
fireCheckboxColumnClickedEvent(columnId: string, rowData: any, primaryKeyValue: any, isChecked: boolean): void;
|
|
48
|
+
private applyCustomFormatters;
|
|
49
|
+
getNumberFormattedValue(value: any, options: AdaptableFormat['Options']): string;
|
|
50
|
+
getStringFormattedValue(value: any, options: AdaptableFormat['Options']): string;
|
|
51
|
+
getDateFormattedValue(value: any, options: AdaptableFormat['Options']): string;
|
|
47
52
|
}
|
|
@@ -8,6 +8,7 @@ const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/
|
|
|
8
8
|
const ArrayExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/ArrayExtensions"));
|
|
9
9
|
const StringExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/StringExtensions"));
|
|
10
10
|
const Helper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/Helper"));
|
|
11
|
+
const FormatHelper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/FormatHelper"));
|
|
11
12
|
class FormatColumnApiImpl extends ApiBase_1.ApiBase {
|
|
12
13
|
getFormatColumnState() {
|
|
13
14
|
return this.getAdaptableState().FormatColumn;
|
|
@@ -269,5 +270,33 @@ class FormatColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
269
270
|
};
|
|
270
271
|
this.adaptable.api.eventApi.emit('CheckboxColumnClicked', checkboxColumnClickedInfo);
|
|
271
272
|
}
|
|
273
|
+
applyCustomFormatters(value, options) {
|
|
274
|
+
var _a, _b;
|
|
275
|
+
const columnCustomFormatters = (_a = options === null || options === void 0 ? void 0 : options.CustomDisplayFormats) !== null && _a !== void 0 ? _a : [];
|
|
276
|
+
if (!(columnCustomFormatters === null || columnCustomFormatters === void 0 ? void 0 : columnCustomFormatters.length)) {
|
|
277
|
+
return value;
|
|
278
|
+
}
|
|
279
|
+
const adaptableOptions = this.adaptable.adaptableOptions;
|
|
280
|
+
const customFormattersFromOptions = (_b = adaptableOptions === null || adaptableOptions === void 0 ? void 0 : adaptableOptions.formatColumnOptions) === null || _b === void 0 ? void 0 : _b.customDisplayFormatters;
|
|
281
|
+
const customFormatters = columnCustomFormatters.map((customFormatter) => customFormattersFromOptions === null || customFormattersFromOptions === void 0 ? void 0 : customFormattersFromOptions.find((customFormatterOption) => customFormatterOption.id === customFormatter.Id));
|
|
282
|
+
return customFormatters.reduce((acc, formatter) => {
|
|
283
|
+
if (formatter && formatter.handler) {
|
|
284
|
+
return formatter.handler(acc);
|
|
285
|
+
}
|
|
286
|
+
return acc;
|
|
287
|
+
}, value);
|
|
288
|
+
}
|
|
289
|
+
getNumberFormattedValue(value, options) {
|
|
290
|
+
let preparedValue = this.applyCustomFormatters(value, options);
|
|
291
|
+
return FormatHelper_1.default.NumberFormatter(preparedValue, options);
|
|
292
|
+
}
|
|
293
|
+
getStringFormattedValue(value, options) {
|
|
294
|
+
let preparedValue = this.applyCustomFormatters(value, options);
|
|
295
|
+
return FormatHelper_1.default.StringFormatter(preparedValue, options);
|
|
296
|
+
}
|
|
297
|
+
getDateFormattedValue(value, options) {
|
|
298
|
+
let preparedValue = this.applyCustomFormatters(value, options);
|
|
299
|
+
return FormatHelper_1.default.DateFormatter(preparedValue, options);
|
|
300
|
+
}
|
|
272
301
|
}
|
|
273
302
|
exports.FormatColumnApiImpl = FormatColumnApiImpl;
|
|
@@ -11,10 +11,15 @@ export declare type AdaptableFormat = {
|
|
|
11
11
|
Formatter: 'StringFormatter';
|
|
12
12
|
Options: StringFormatterOptions;
|
|
13
13
|
};
|
|
14
|
+
export interface BaseFormatterOptions {
|
|
15
|
+
CustomDisplayFormats?: {
|
|
16
|
+
Id: string;
|
|
17
|
+
}[];
|
|
18
|
+
}
|
|
14
19
|
/**
|
|
15
20
|
* Formatter Options for Numeric Columns
|
|
16
21
|
*/
|
|
17
|
-
export interface NumberFormatterOptions {
|
|
22
|
+
export interface NumberFormatterOptions extends BaseFormatterOptions {
|
|
18
23
|
/**
|
|
19
24
|
* Number of digits to show in fractions
|
|
20
25
|
*/
|
|
@@ -55,7 +60,7 @@ export interface NumberFormatterOptions {
|
|
|
55
60
|
/**
|
|
56
61
|
* Formatter Options for Date Columns - contains a single `Pattern` property
|
|
57
62
|
*/
|
|
58
|
-
export interface DateFormatterOptions {
|
|
63
|
+
export interface DateFormatterOptions extends BaseFormatterOptions {
|
|
59
64
|
/**
|
|
60
65
|
* Pattern to use for Date Format
|
|
61
66
|
*/
|
|
@@ -64,7 +69,7 @@ export interface DateFormatterOptions {
|
|
|
64
69
|
/**
|
|
65
70
|
* Formatter Options for String Columns
|
|
66
71
|
*/
|
|
67
|
-
export interface StringFormatterOptions {
|
|
72
|
+
export interface StringFormatterOptions extends BaseFormatterOptions {
|
|
68
73
|
/**
|
|
69
74
|
* Sets text to Upper or Lower case
|
|
70
75
|
*/
|
|
@@ -27,7 +27,23 @@ exports.SystemPredicateDefs = [
|
|
|
27
27
|
icon: { text: 'IN' },
|
|
28
28
|
columnScope: { DataTypes: ['String', 'Number', 'Date'] },
|
|
29
29
|
moduleScope: ['filter'],
|
|
30
|
-
handler: ({
|
|
30
|
+
handler: ({ inputs, column, value }) => {
|
|
31
|
+
if (inputs.length === 0) {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
if (column.dataType === 'Date') {
|
|
35
|
+
return inputs.some((input) => {
|
|
36
|
+
return isSameDay_1.default(input, value);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
if (column.dataType === 'Number') {
|
|
40
|
+
return inputs.includes(value);
|
|
41
|
+
}
|
|
42
|
+
if (column.dataType === 'String') {
|
|
43
|
+
return inputs.includes(value);
|
|
44
|
+
}
|
|
45
|
+
return true;
|
|
46
|
+
},
|
|
31
47
|
toString: ({ inputs }) => `IN (${inputs.join(', ')})`,
|
|
32
48
|
shortcuts: ['#', '['],
|
|
33
49
|
},
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CustomFDC3Intent } from '../../AdaptableOptions/FinancePluginOptions';
|
|
1
2
|
import { BaseEventInfo } from '../../Api/Events/BaseEventInfo';
|
|
2
3
|
import { FDC3Intent } from '../../types';
|
|
3
4
|
/**
|
|
@@ -221,10 +222,13 @@ export interface AdaptableFDC3EventInfo extends BaseEventInfo {
|
|
|
221
222
|
/**
|
|
222
223
|
* The FDC3 Intent which caused Event to fire (if type is `RaiseIntent`)
|
|
223
224
|
*/
|
|
224
|
-
intent?: FDC3Intent;
|
|
225
|
+
intent?: FDC3Intent | CustomFDC3Intent;
|
|
225
226
|
/**
|
|
226
227
|
* Full FDC3 Context for the object related to the event
|
|
227
228
|
*/
|
|
228
229
|
context: FDC3Context;
|
|
229
230
|
}
|
|
230
231
|
export declare type ContextType = 'fdc3.instrument' | 'fdc3.instrumentList' | 'fdc3.position' | 'fdc3.portfolio' | 'fdc3.contact' | 'fdc3.contactList' | 'fdc3.organization' | 'fdc3.country';
|
|
232
|
+
export interface CustomFDC3Context extends FDC3Context {
|
|
233
|
+
type: any;
|
|
234
|
+
}
|
|
@@ -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, this.api.formatColumnApi)],
|
|
251
251
|
},
|
|
252
252
|
getFormatColumnSettingsViewItems_1.getFormatColumnSettingsViewItems(formatColumn),
|
|
253
253
|
getObjectTagsViewItems_1.getObjectTagsViewItems(formatColumn, this.api),
|
|
@@ -152,12 +152,12 @@ class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
152
152
|
if (columns.length >
|
|
153
153
|
maxColumnsToDisplay + 1 /* +1 is to show tag only beginning with 2, 'other 2' */) {
|
|
154
154
|
const extraColumns = columns.length - maxColumnsToDisplay;
|
|
155
|
-
const firstNColumns = columns
|
|
156
|
-
.slice(0, maxColumnsToDisplay)
|
|
157
|
-
.map((colId) => columnIdToFriendlyName(colId));
|
|
155
|
+
const firstNColumns = columns.slice(0, maxColumnsToDisplay);
|
|
158
156
|
columns = [...firstNColumns, `and other ${extraColumns}`];
|
|
159
157
|
}
|
|
160
|
-
|
|
158
|
+
else {
|
|
159
|
+
columns = columns.map((column) => this.api.columnApi.getFriendlyNameFromColumnId(column));
|
|
160
|
+
}
|
|
161
161
|
return {
|
|
162
162
|
items: [
|
|
163
163
|
{
|
|
@@ -226,10 +226,8 @@ exports.booleanExpressionFunctions = {
|
|
|
226
226
|
var _a;
|
|
227
227
|
const searchTerm = expressionFunctionUtils_1.getStringValue(context, String(args[0]));
|
|
228
228
|
return (_a = context.api) === null || _a === void 0 ? void 0 : _a.columnApi.getColumns().some((column) => {
|
|
229
|
-
var _a
|
|
230
|
-
const value =
|
|
231
|
-
? // for Date columns use the display value, as we do a textual comparison
|
|
232
|
-
(_a = context.api) === null || _a === void 0 ? void 0 : _a.gridApi.getDisplayValueFromRowNode(context.node, column.columnId) : (_b = context.api) === null || _b === void 0 ? void 0 : _b.gridApi.getNormalisedValueFromRowNode(context.node, column.columnId);
|
|
229
|
+
var _a;
|
|
230
|
+
const value = (_a = context.api) === null || _a === void 0 ? void 0 : _a.gridApi.getDisplayValueFromRowNode(context.node, column.columnId);
|
|
233
231
|
const columnValue = expressionFunctionUtils_1.getStringValue(context, String(value));
|
|
234
232
|
return columnValue.indexOf(searchTerm) !== -1;
|
|
235
233
|
});
|
|
@@ -70,7 +70,7 @@ exports.CalculatedColumnExpressionWizardSection = (props) => {
|
|
|
70
70
|
props.onChange(Object.assign(Object.assign({}, data), { Query: calculatedColumnQuery, CalculatedColumnSettings: Object.assign(Object.assign({}, data.CalculatedColumnSettings), { DataType: dataType, Pivotable,
|
|
71
71
|
Aggregatable }) }));
|
|
72
72
|
};
|
|
73
|
-
return (React.createElement(Tabs_1.Tabs, { onValueChange: setType, value: selectedTab, p: 2, style: { flex: 1, overflow: 'auto' } },
|
|
73
|
+
return (React.createElement(Tabs_1.Tabs, { onValueChange: setType, value: selectedTab, p: 2, style: { height: '100%', flex: 1, overflow: 'auto' } },
|
|
74
74
|
React.createElement(QueryTab, { value: "ScalarExpression", type: type, label: "Scalar" }),
|
|
75
75
|
React.createElement(Tabs_1.Tabs.Content, { value: 'ScalarExpression' },
|
|
76
76
|
React.createElement(ExpressionEditor_1.ExpressionEditor, { type: 'scalar', module: moduleInfo.ModuleName, style: { paddingLeft: 0 }, value: data.Query.ScalarExpression, onChange: (ScalarExpression) => setCalculatedColumnExpression({ ScalarExpression }), initialData: initialData, columns: api.columnApi.getQueryableColumns(), namedQueries: api.queryApi.getAllNamedQuery(), isFullExpression: true, api: api })),
|
|
@@ -4,7 +4,10 @@ import { ColumnMenuTab } from '../../../PredefinedConfig/Common/Enums';
|
|
|
4
4
|
import { ColumnFilter } from '../../../PredefinedConfig/FilterState';
|
|
5
5
|
export interface FilterFormState {
|
|
6
6
|
columnFilters: ColumnFilter[];
|
|
7
|
-
distinctColumnValues:
|
|
7
|
+
distinctColumnValues: {
|
|
8
|
+
label: string;
|
|
9
|
+
value: any;
|
|
10
|
+
}[];
|
|
8
11
|
isDistinctColumnValuesLoading: boolean;
|
|
9
12
|
showTab: boolean;
|
|
10
13
|
selectedTab: ColumnMenuTab;
|
|
@@ -5,7 +5,10 @@ export interface ListBoxFilterFormProps extends ListGroupProps {
|
|
|
5
5
|
currentColumn: AdaptableColumn;
|
|
6
6
|
columns: AdaptableColumn[];
|
|
7
7
|
useAgGridStyle?: boolean;
|
|
8
|
-
columnDistinctValues:
|
|
8
|
+
columnDistinctValues: {
|
|
9
|
+
label: string;
|
|
10
|
+
value: any;
|
|
11
|
+
}[];
|
|
9
12
|
uiSelectedColumnValues: Array<string>;
|
|
10
13
|
onColumnValueSelectedChange: (SelectedValues: Array<any>) => void;
|
|
11
14
|
dataType: 'String' | 'Number' | 'NumberArray' | 'Boolean' | 'Date' | 'Object' | 'Unknown';
|
|
@@ -40,9 +40,9 @@ exports.ListBoxFilterForm = (props) => {
|
|
|
40
40
|
setUiSelectedColumnValues([...UiSelectedColumnValues, item]);
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
-
const columnValuesItemsElements = props.columnDistinctValues.map((
|
|
44
|
-
const isActive = UiSelectedColumnValues.indexOf(
|
|
45
|
-
const columnValue =
|
|
43
|
+
const columnValuesItemsElements = props.columnDistinctValues.map((distinctValue, index) => {
|
|
44
|
+
const isActive = UiSelectedColumnValues.indexOf(distinctValue.value) >= 0;
|
|
45
|
+
const columnValue = distinctValue.value;
|
|
46
46
|
if (StringExtensions_1.StringExtensions.IsNullOrEmpty(columnValue)) {
|
|
47
47
|
return null;
|
|
48
48
|
}
|
|
@@ -53,13 +53,13 @@ exports.ListBoxFilterForm = (props) => {
|
|
|
53
53
|
}
|
|
54
54
|
if (props.useAgGridStyle) {
|
|
55
55
|
return renderItemForAgGridStyle({
|
|
56
|
-
key: 'columnValue' +
|
|
57
|
-
children:
|
|
56
|
+
key: 'columnValue' + index,
|
|
57
|
+
children: distinctValue.label,
|
|
58
58
|
checked: isActive,
|
|
59
|
-
onChange: () => onClickItemColumnValue(
|
|
59
|
+
onChange: () => onClickItemColumnValue(distinctValue.value),
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
return (React.createElement(ListGroupItem_1.default, { noZebra: props.useAgGridStyle, key: 'columnValue' +
|
|
62
|
+
return (React.createElement(ListGroupItem_1.default, { noZebra: props.useAgGridStyle, key: 'columnValue' + index, onClick: () => onClickItemColumnValue(distinctValue.value), active: isActive, value: columnValue }, distinctValue.label));
|
|
63
63
|
});
|
|
64
64
|
const textClear = (React.createElement(AdaptableFormControlTextClear_1.AdaptableFormControlTextClear, { autoFocus: true, type: "text", placeholder: "Search Column Values", value: FilterValue, style: {
|
|
65
65
|
paddingTop: 'var(--ab-space-1)',
|
|
@@ -19,6 +19,7 @@ const CheckBox_1 = require("../../../components/CheckBox");
|
|
|
19
19
|
const isEqual_1 = tslib_1.__importDefault(require("lodash/isEqual"));
|
|
20
20
|
const runIfNotResolvedIn_1 = require("../../../Utilities/runIfNotResolvedIn");
|
|
21
21
|
const getDefaultColumnFilterPredicate_1 = require("./getDefaultColumnFilterPredicate");
|
|
22
|
+
const date_fns_1 = require("date-fns");
|
|
22
23
|
class QuickFilterFormComponent extends React.Component {
|
|
23
24
|
constructor(props) {
|
|
24
25
|
super(props);
|
|
@@ -214,6 +215,19 @@ class QuickFilterFormComponent extends React.Component {
|
|
|
214
215
|
if (this.props.quickFilterValuesTrigger === 'click') {
|
|
215
216
|
showEvent = 'click';
|
|
216
217
|
}
|
|
218
|
+
let selectedValues = filter.Predicate.PredicateId === 'Values' ? 'Select Values' : 'Exclude Values';
|
|
219
|
+
if (filter.Predicate.Inputs.length) {
|
|
220
|
+
selectedValues = filter.Predicate.Inputs.map((input) => {
|
|
221
|
+
var _a, _b;
|
|
222
|
+
const label = (_b = (_a = this.state.distinctColumnValues) === null || _a === void 0 ? void 0 : _a.find((distinctValue) => {
|
|
223
|
+
if (input instanceof Date) {
|
|
224
|
+
return date_fns_1.isSameDay(input, distinctValue.value);
|
|
225
|
+
}
|
|
226
|
+
return distinctValue.value === input;
|
|
227
|
+
})) === null || _b === void 0 ? void 0 : _b.label;
|
|
228
|
+
return label !== null && label !== void 0 ? label : input;
|
|
229
|
+
}).join(', ');
|
|
230
|
+
}
|
|
217
231
|
return (React.createElement(OverlayTrigger_1.default, { alignHorizontal: "left", showEvent: showEvent,
|
|
218
232
|
// cannot hide on blur, because the form input receives the input when this is opened
|
|
219
233
|
hideEvent: "mouseleave", hideDelay: 300, ref: (api) => {
|
|
@@ -248,8 +262,7 @@ class QuickFilterFormComponent extends React.Component {
|
|
|
248
262
|
borderRadius: 0,
|
|
249
263
|
borderLeftWidth: 0,
|
|
250
264
|
borderColor: 'var(--ab-color-primarydark)',
|
|
251
|
-
}, disabled: ArrayExtensions_1.default.IsNullOrEmptyOrContainsSingleEmptyValue(this.state.distinctColumnValues) },
|
|
252
|
-
(filter.Predicate.PredicateId === 'Values' ? 'Select Values' : 'Exclude Values'))));
|
|
265
|
+
}, disabled: ArrayExtensions_1.default.IsNullOrEmptyOrContainsSingleEmptyValue(this.state.distinctColumnValues) }, selectedValues)));
|
|
253
266
|
}
|
|
254
267
|
onColumnValuesChange(columnValues) {
|
|
255
268
|
var _a;
|
|
@@ -3,6 +3,7 @@ import { FormatColumn } from '../../../PredefinedConfig/FormatColumnState';
|
|
|
3
3
|
import { AdaptableFormat } from '../../../PredefinedConfig/Common/AdaptableFormat';
|
|
4
4
|
import { AdaptableScope } from '../../../PredefinedConfig/Common/AdaptableScope';
|
|
5
5
|
import { AdaptableApi } from '../../../Api/AdaptableApi';
|
|
6
|
+
import { FormatColumnApi } from '../../../types';
|
|
6
7
|
export declare type FormatColumnFormatWizardSectionProps = {
|
|
7
8
|
onChange: (data: FormatColumn) => void;
|
|
8
9
|
};
|
|
@@ -10,7 +11,7 @@ export interface FormatColumnFormatWizardState {
|
|
|
10
11
|
DisplayFormat: AdaptableFormat;
|
|
11
12
|
NumericFormat?: 'Percent' | 'Thousand' | 'Million' | 'Dollar' | 'Sterling' | undefined;
|
|
12
13
|
}
|
|
13
|
-
export declare const getFormatColumnFormatSummaryValue: (data: FormatColumn) => string;
|
|
14
|
-
export declare const renderFormatColumnFormatSummary: (data: FormatColumn) => JSX.Element;
|
|
14
|
+
export declare const getFormatColumnFormatSummaryValue: (data: FormatColumn, formattedColumnApi: FormatColumnApi) => string;
|
|
15
|
+
export declare const renderFormatColumnFormatSummary: (data: FormatColumn, api: AdaptableApi) => JSX.Element;
|
|
15
16
|
export declare const getFormatDisplayTypeForScope: (scope: AdaptableScope, api: AdaptableApi) => 'Number' | 'Date' | 'String' | undefined;
|
|
16
17
|
export declare const FormatColumnFormatWizardSection: (props: FormatColumnFormatWizardSectionProps) => JSX.Element;
|