@adaptabletools/adaptable-cjs 18.0.11 → 18.1.0-canary.0

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.
Files changed (126) hide show
  1. package/agGrid.d.ts +4 -3
  2. package/agGrid.js +6 -1
  3. package/base.css +7 -2
  4. package/base.css.map +1 -1
  5. package/index.css +11 -2
  6. package/index.css.map +1 -1
  7. package/package.json +2 -2
  8. package/src/AdaptableOptions/ActionColumnOptions.d.ts +1 -1
  9. package/src/AdaptableOptions/ColumnFilterOptions.d.ts +27 -1
  10. package/src/AdaptableOptions/ExportOptions.d.ts +20 -7
  11. package/src/AdaptableOptions/ExpressionOptions.d.ts +12 -2
  12. package/src/AdaptableOptions/Fdc3Options.d.ts +48 -43
  13. package/src/Api/ColumnApi.d.ts +1 -1
  14. package/src/Api/Events/Fdc3MessageInfo.d.ts +5 -7
  15. package/src/Api/ExpressionApi.d.ts +2 -2
  16. package/src/Api/Fdc3Api.d.ts +14 -19
  17. package/src/Api/Implementation/ConfigApiImpl.js +3 -0
  18. package/src/Api/Implementation/Fdc3ApiImpl.d.ts +14 -16
  19. package/src/Api/Implementation/Fdc3ApiImpl.js +35 -11
  20. package/src/Api/Internal/AlertInternalApi.d.ts +17 -2
  21. package/src/Api/Internal/AlertInternalApi.js +196 -25
  22. package/src/Api/Internal/ColumnFilterInternalApi.d.ts +2 -0
  23. package/src/Api/Internal/ColumnFilterInternalApi.js +20 -0
  24. package/src/Api/Internal/ExportInternalApi.d.ts +3 -3
  25. package/src/Api/Internal/ExportInternalApi.js +31 -17
  26. package/src/Api/Internal/ExpressionInternalApi.d.ts +5 -1
  27. package/src/Api/Internal/ExpressionInternalApi.js +80 -0
  28. package/src/Api/Internal/Fdc3InternalApi.d.ts +8 -10
  29. package/src/Api/Internal/Fdc3InternalApi.js +5 -9
  30. package/src/PredefinedConfig/Common/AdaptableField.d.ts +18 -0
  31. package/src/PredefinedConfig/Common/AdaptableField.js +2 -0
  32. package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
  33. package/src/PredefinedConfig/Common/AdaptablePredicate.js +18 -1
  34. package/src/PredefinedConfig/Common/Fdc3Context.d.ts +7 -226
  35. package/src/PredefinedConfig/Common/Fdc3Context.js +44 -32
  36. package/src/PredefinedConfig/Common/Fdc3Intent.d.ts +6 -89
  37. package/src/PredefinedConfig/Common/Fdc3Intent.js +27 -74
  38. package/src/PredefinedConfig/Common/RowSummary.d.ts +2 -1
  39. package/src/PredefinedConfig/StyledColumnState.d.ts +1 -1
  40. package/src/Redux/ActionsReducers/FormatColumnRedux.js +0 -3
  41. package/src/Strategy/AdaptableModuleBase.js +1 -3
  42. package/src/Strategy/AlertModule.d.ts +1 -1
  43. package/src/Strategy/AlertModule.js +8 -8
  44. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +3 -1
  45. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +14 -13
  46. package/src/Utilities/Services/Fdc3Service.d.ts +1 -1
  47. package/src/Utilities/Services/QueryLanguageService.d.ts +8 -4
  48. package/src/Utilities/Services/QueryLanguageService.js +105 -6
  49. package/src/Utilities/Services/ReportService.js +8 -5
  50. package/src/Utilities/Services/RowSummaryService.js +3 -1
  51. package/src/Utilities/divideBy100.d.ts +1 -0
  52. package/src/Utilities/divideBy100.js +34 -0
  53. package/src/Utilities/times100.d.ts +1 -0
  54. package/src/Utilities/times100.js +27 -0
  55. package/src/View/Alert/Wizard/AlertMessageWizardSection.js +1 -1
  56. package/src/View/Alert/Wizard/AlertNotificationWizardSection.js +2 -2
  57. package/src/View/Alert/Wizard/AlertScopeWizardSection.js +2 -1
  58. package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +1 -1
  59. package/src/View/Components/EntityRulesEditor/index.d.ts +1 -0
  60. package/src/View/Components/EntityRulesEditor/index.js +11 -7
  61. package/src/View/Components/ExpressionWizard.js +1 -1
  62. package/src/View/Components/FilterForm/QuickFilterValues.js +28 -4
  63. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +6 -2
  64. package/src/View/Components/Selectors/FieldSelector.d.ts +13 -0
  65. package/src/View/Components/Selectors/FieldSelector.js +26 -0
  66. package/src/View/Components/Selectors/PermittedValuesSelector.js +8 -4
  67. package/src/View/Export/Wizard/ReportRowsWizardSection.js +1 -1
  68. package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +1 -1
  69. package/src/View/GridFilter/GridFilterExpressionEditor.js +1 -1
  70. package/src/View/Layout/Wizard/sections/GridFilterSection.js +4 -2
  71. package/src/View/Layout/Wizard/sections/RowSummarySection.js +7 -1
  72. package/src/View/NamedQuery/Wizard/NamedQueryExpressionWizardSection.js +1 -1
  73. package/src/View/Wizard/OnePageAdaptableWizard.js +3 -2
  74. package/src/agGrid/AdaptableAgGrid.d.ts +1 -2
  75. package/src/agGrid/AdaptableAgGrid.js +65 -37
  76. package/src/agGrid/AgGridAdapter.d.ts +2 -0
  77. package/src/agGrid/AgGridAdapter.js +12 -2
  78. package/src/agGrid/AgGridColumnAdapter.d.ts +3 -0
  79. package/src/agGrid/AgGridColumnAdapter.js +24 -1
  80. package/src/agGrid/AgGridMenuAdapter.js +1 -1
  81. package/src/agGrid/editors/AdaptableDateEditor/InternalAdaptableDateEditor.d.ts +0 -1
  82. package/src/agGrid/editors/AdaptableDateEditor/InternalAdaptableDateEditor.js +0 -2
  83. package/src/agGrid/editors/AdaptableDateEditor/index.d.ts +4 -16
  84. package/src/agGrid/editors/AdaptableDateEditor/index.js +6 -19
  85. package/src/agGrid/editors/AdaptableNumberEditor/InternalAdaptableNumberEditor.js +6 -1
  86. package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +4 -3
  87. package/src/agGrid/editors/AdaptableNumberEditor/index.js +6 -2
  88. package/src/agGrid/editors/AdaptablePercentageEditor/InternalAdaptablePercentageEditor.d.ts +23 -0
  89. package/src/agGrid/editors/AdaptablePercentageEditor/InternalAdaptablePercentageEditor.js +84 -0
  90. package/src/agGrid/editors/AdaptablePercentageEditor/index.d.ts +47 -0
  91. package/src/agGrid/editors/AdaptablePercentageEditor/index.js +153 -0
  92. package/src/agGrid/weightedAverage.js +3 -2
  93. package/src/components/Accordion.js +1 -1
  94. package/src/components/Datepicker/DatepickerContext.d.ts +0 -2
  95. package/src/components/Datepicker/index.js +3 -4
  96. package/src/components/ExpressionEditor/DataTableEditor.d.ts +17 -0
  97. package/src/components/ExpressionEditor/DataTableEditor.js +68 -0
  98. package/src/components/ExpressionEditor/EditorInput.js +21 -8
  99. package/src/components/ExpressionEditor/NamedQueryEditor.d.ts +5 -0
  100. package/src/components/ExpressionEditor/NamedQueryEditor.js +35 -0
  101. package/src/components/ExpressionEditor/QueryBuilder/QueryBuilder.d.ts +10 -0
  102. package/src/components/ExpressionEditor/QueryBuilder/QueryBuilder.js +7 -4
  103. package/src/components/ExpressionEditor/QueryBuilder/QueryBuilderInputs.d.ts +3 -2
  104. package/src/components/ExpressionEditor/QueryBuilder/QueryBuilderInputs.js +72 -14
  105. package/src/components/ExpressionEditor/QueryBuilder/QueryPredicateBuilder.js +27 -19
  106. package/src/components/ExpressionEditor/QueryBuilder/utils.d.ts +9 -1
  107. package/src/components/ExpressionEditor/QueryBuilder/utils.js +46 -4
  108. package/src/components/ExpressionEditor/index.d.ts +3 -1
  109. package/src/components/ExpressionEditor/index.js +67 -92
  110. package/src/components/Input/NumberInput.d.ts +2 -1
  111. package/src/components/Input/NumberInput.js +6 -5
  112. package/src/components/OverlayTrigger/index.js +10 -6
  113. package/src/components/icons/column-outline.d.ts +3 -0
  114. package/src/components/icons/column-outline.js +7 -0
  115. package/src/components/icons/index.js +5 -1
  116. package/src/components/icons/sync.d.ts +3 -0
  117. package/src/components/icons/sync.js +7 -0
  118. package/src/env.js +2 -2
  119. package/src/metamodel/adaptable.metamodel.d.ts +78 -200
  120. package/src/metamodel/adaptable.metamodel.js +1 -1
  121. package/src/parser/src/predicate/mapExpressionToQlPredicate.d.ts +1 -0
  122. package/src/parser/src/predicate/mapExpressionToQlPredicate.js +13 -3
  123. package/src/parser/src/predicate/mapQlPredicateToExpression.js +4 -1
  124. package/src/parser/src/types.d.ts +101 -1
  125. package/src/types.d.ts +9 -7
  126. package/tsconfig.cjs.tsbuildinfo +1 -1
@@ -3,7 +3,7 @@ import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChang
3
3
  import { Report } from '../../PredefinedConfig/ExportState';
4
4
  import { AdaptableColumnType } from '../../PredefinedConfig/Common/Types';
5
5
  import { ExcelDataType, ExcelStyle } from '@ag-grid-community/core';
6
- import { AdaptableColumnDataType } from '../../PredefinedConfig/Common/AdaptableColumn';
6
+ import { AdaptableColumn, AdaptableColumnDataType } from '../../PredefinedConfig/Common/AdaptableColumn';
7
7
  import { DataFormatType } from '../../AdaptableOptions/ExportOptions';
8
8
  export declare class ExportInternalApi extends ApiBase {
9
9
  /**
@@ -14,8 +14,8 @@ export declare class ExportInternalApi extends ApiBase {
14
14
  isDataChangeInReport(cellDataChangedInfo: CellDataChangedInfo, report: Report): boolean;
15
15
  getExcelDataType(adaptableColumnType: string | string[] | AdaptableColumnType | AdaptableColumnType[]): ExcelDataType;
16
16
  isVisualDataExportInProgress(): boolean;
17
- isDateCellExportedAsFormattedValue(): boolean;
18
- getCellExportFormatType(columnDataType: AdaptableColumnDataType): DataFormatType;
17
+ isDateCellExportedAsFormattedValue(abColumn: AdaptableColumn): boolean;
18
+ getCellExportFormatType(column: AdaptableColumn, columnDataType: AdaptableColumnDataType): DataFormatType;
19
19
  isDestinationEnabled(destination: string): boolean;
20
20
  getExcelStylesForVisualDataExport(original_excelStyles: ExcelStyle[]): ExcelStyle[];
21
21
  }
@@ -97,28 +97,42 @@ class ExportInternalApi extends ApiBase_1.ApiBase {
97
97
  isVisualDataExportInProgress() {
98
98
  return this.getAdaptableState().System.Export.visualDataExportInProgress;
99
99
  }
100
- isDateCellExportedAsFormattedValue() {
100
+ isDateCellExportedAsFormattedValue(abColumn) {
101
101
  return (!!this.getExportOptions().exportDateFormat ||
102
- this.getCellExportFormatType('Date') === 'formattedValue');
102
+ this.getCellExportFormatType(abColumn, 'Date') === 'formattedValue');
103
103
  }
104
- getCellExportFormatType(columnDataType) {
104
+ getCellExportFormatType(column, columnDataType) {
105
105
  const exportOptions = this.getExportOptions();
106
- if (exportOptions.exportFormatType === 'rawValue' ||
107
- exportOptions.exportFormatType === 'formattedValue') {
108
- return exportOptions.exportFormatType;
106
+ const exportFormatType = exportOptions.exportFormatType;
107
+ // First check if a function was provided and return the result
108
+ if (exportFormatType != null && typeof exportFormatType === 'function') {
109
+ const context = Object.assign(Object.assign({}, this.getAdaptableApi().internalApi.buildBaseContext()), { column: column });
110
+ return exportFormatType(context);
109
111
  }
110
- // format is customized based on column data type
111
- switch (columnDataType) {
112
- case 'String':
113
- return exportOptions.exportFormatType.string;
114
- case 'Number':
115
- return exportOptions.exportFormatType.number;
116
- case 'Date':
117
- return exportOptions.exportFormatType.date;
118
- default:
119
- // default to rawValue for all other column types
120
- return 'rawValue';
112
+ // Next Check if a "hard-coded" value has been provided and return that
113
+ if (exportFormatType === 'rawValue') {
114
+ return 'rawValue';
121
115
  }
116
+ if (exportFormatType === 'formattedValue') {
117
+ return 'formattedValue';
118
+ }
119
+ // Finally test if a DataType object has been provided and return the relevant property
120
+ const dataFormatDataType = exportFormatType;
121
+ if (dataFormatDataType) {
122
+ // format is customized based on column data type
123
+ switch (columnDataType) {
124
+ case 'String':
125
+ return dataFormatDataType.string;
126
+ case 'Number':
127
+ return dataFormatDataType.number;
128
+ case 'Date':
129
+ return dataFormatDataType.date;
130
+ default:
131
+ // default to rawValue for all other column types
132
+ return 'rawValue';
133
+ }
134
+ }
135
+ return 'rawValue';
122
136
  }
123
137
  isDestinationEnabled(destination) {
124
138
  if (destination === 'Table' && this.getLayoutApi().internalApi.isLayoutGrouped()) {
@@ -1,6 +1,6 @@
1
1
  import { ApiBase } from '../Implementation/ApiBase';
2
2
  import { AdaptableQLModule } from '../../PredefinedConfig/Common/Types';
3
- import { AdaptableObject, AdaptablePredicate } from '../../types';
3
+ import { AdaptableField, AdaptableObject, AdaptablePredicate } from '../../types';
4
4
  export declare class ExpressionInternalApi extends ApiBase {
5
5
  /**
6
6
  * Checks if a column is referenced in a given Expression
@@ -10,4 +10,8 @@ export declare class ExpressionInternalApi extends ApiBase {
10
10
  isColumnReferencedInExpression(columnId: string, expression: string): boolean;
11
11
  evaluateExpressionInAdaptableQL(module: AdaptableQLModule, object?: AdaptableObject, expression?: string): boolean;
12
12
  evaluatePredicatesInAdaptableQL(module: AdaptableQLModule, object?: AdaptableObject, predicates?: AdaptablePredicate[]): boolean;
13
+ private getFieldsFromOptions;
14
+ getAvailableFields(data?: Record<string, any>): AdaptableField[];
15
+ getFieldType(field: string): AdaptableField['dataType'];
16
+ getFieldsOfType(type?: AdaptableField['dataType']): AdaptableField[];
13
17
  }
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ExpressionInternalApi = void 0;
4
+ const tslib_1 = require("tslib");
4
5
  const ApiBase_1 = require("../Implementation/ApiBase");
6
+ const ArrayExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/ArrayExtensions"));
5
7
  class ExpressionInternalApi extends ApiBase_1.ApiBase {
6
8
  /**
7
9
  * Checks if a column is referenced in a given Expression
@@ -48,5 +50,83 @@ class ExpressionInternalApi extends ApiBase_1.ApiBase {
48
50
  }
49
51
  return !evaluateExpressionExternallyFn(context);
50
52
  }
53
+ // Used later, when we extend to support inferring fields from data
54
+ // private getFieldsFromData<T extends Record<string, any>>(data: T): string[] {
55
+ // if (!data) {
56
+ // return [];
57
+ // }
58
+ // if (typeof data !== 'object' || Number.isNaN(data)) {
59
+ // return [];
60
+ // }
61
+ // const keys: string[] = [];
62
+ // for (const key in Object.keys(data)) {
63
+ // const candidate = data[key];
64
+ // if (
65
+ // typeof candidate === 'number' ||
66
+ // typeof candidate === 'string' ||
67
+ // typeof candidate === 'boolean' ||
68
+ // candidate instanceof Date
69
+ // ) {
70
+ // keys.push(key);
71
+ // continue;
72
+ // }
73
+ // // no support for arrays
74
+ // // for objects we go one level deep
75
+ // if (typeof candidate === 'object' && candidate !== null && !Array.isArray(candidate)) {
76
+ // const childKeys = this.getFieldsFromData(candidate);
77
+ // for (const childKey of childKeys) {
78
+ // keys.push(`${key}.${childKey}`);
79
+ // }
80
+ // }
81
+ // }
82
+ // return keys;
83
+ // }
84
+ getFieldsFromOptions() {
85
+ const fields = this.adaptable.api.optionsApi.getExpressionOptions().fields;
86
+ if (fields != null && typeof fields === 'function') {
87
+ return fields(this.getAdaptableApi().internalApi.buildBaseContext());
88
+ }
89
+ else {
90
+ let arr = fields;
91
+ if (arr && ArrayExtensions_1.default.IsNotNullOrEmpty(arr)) {
92
+ return arr;
93
+ }
94
+ }
95
+ }
96
+ getAvailableFields(data) {
97
+ var _a, _b;
98
+ const optionFields = (_b = ((_a = this.getFieldsFromOptions()) !== null && _a !== void 0 ? _a : [])) === null || _b === void 0 ? void 0 : _b.map((field) => (Object.assign(Object.assign({}, field), { label: field.label || field.name })));
99
+ // const existingFields = new Set<string>();
100
+ // Exclude fields already in options
101
+ // optionFields.forEach((field) => existingFields.add(field.value));
102
+ // const queriableColumns = this.getColumnApi().getQueryableColumns();
103
+ // Exclude queriable columns
104
+ // queriableColumns.forEach((column) => existingFields.add(column.field));
105
+ // const dataFields = this.getFieldsFromData(data).reduce<AdaptableField[]>((acc, field) => {
106
+ // if (!existingFields.has(field)) {
107
+ // acc.push({
108
+ // label: field,
109
+ // value: field,
110
+ // });
111
+ // }
112
+ // return acc;
113
+ // }, []);
114
+ return optionFields;
115
+ }
116
+ getFieldType(field) {
117
+ var _a;
118
+ const fieldDef = (_a = this.getFieldsFromOptions()) === null || _a === void 0 ? void 0 : _a.find((f) => f.name === field);
119
+ if (fieldDef) {
120
+ return fieldDef.dataType;
121
+ }
122
+ return 'String';
123
+ }
124
+ getFieldsOfType(type) {
125
+ var _a, _b, _c;
126
+ if (!type) {
127
+ return (_a = this.getAvailableFields()) !== null && _a !== void 0 ? _a : [];
128
+ }
129
+ return (_c = (_b = this.getAvailableFields()) === null || _b === void 0 ? void 0 : _b.filter((f) => f.dataType === type)) !== null && _c !== void 0 ? _c : [];
130
+ }
51
131
  }
52
132
  exports.ExpressionInternalApi = ExpressionInternalApi;
@@ -1,32 +1,30 @@
1
1
  import { ApiBase } from '../Implementation/ApiBase';
2
- import { Fdc3ContextType, Fdc3Context, Fdc3StandardContextType } from '../../PredefinedConfig/Common/Fdc3Context';
3
2
  import { ColDef, IRowNode } from '@ag-grid-community/core';
4
- import { AppIdentifier, Context, IntentResolution } from '@finos/fdc3';
3
+ import { AppIdentifier, Context, ContextType, Intent, IntentResolution, StandardContextType, StandardIntent } from '@finos/fdc3';
5
4
  import { BroadcastConfig, RaiseIntentConfig } from '../../AdaptableOptions/Fdc3Options';
6
- import { Fdc3IntentType, Fdc3StandardIntentType } from '../../PredefinedConfig/Common/Fdc3Intent';
7
5
  import { AdaptableButton } from '../../PredefinedConfig/Common/AdaptableButton';
8
6
  import { ActionColumnContext } from '../../AdaptableOptions/ActionColumnOptions';
9
7
  import { AdaptableIcon } from '../../PredefinedConfig/Common/AdaptableIcon';
10
8
  export type WithContext<K> = K & {
11
- contextType: Fdc3ContextType;
9
+ contextType: ContextType;
12
10
  };
13
11
  export type WithIntent<K> = K & {
14
- intentType: Fdc3IntentType;
12
+ intentType: Intent;
15
13
  };
16
14
  export declare class Fdc3InternalApi extends ApiBase {
17
- mapRowToContextData(contextType: Fdc3ContextType, rowNode: IRowNode): Fdc3Context;
15
+ mapRowToContextData(contextType: ContextType, rowNode: IRowNode): Context;
18
16
  getFdc3ActionColDefs(): ColDef[];
19
17
  getButtonsForFdc3MainActionColumn(): AdaptableButton<ActionColumnContext<any>>[];
20
18
  getButtonsForFdc3StandaloneActionColumn(columnId: string): AdaptableButton<ActionColumnContext<any>>[];
21
19
  isFdc3MainActionColumn(columnId: string): boolean;
22
20
  isFdc3StandaloneActionColumn(columnId: string, columnType: string | string[]): boolean;
23
21
  handleIntentResolution(intentResolution: IntentResolution, context: Context, raisedIntent: string, app?: AppIdentifier): void;
24
- isStandardContextType(contextType: string): contextType is Fdc3StandardContextType;
25
- isStandardIntentType(intentType: string): intentType is Fdc3StandardIntentType;
22
+ isStandardContextType(contextType: string): contextType is StandardContextType;
23
+ isStandardIntentType(intentType: string): intentType is StandardIntent;
26
24
  getAllRaiseIntentConfigs(): WithIntent<RaiseIntentConfig>[];
27
25
  getAllBroadcastContextConfigs(): WithContext<BroadcastConfig>[];
28
- getDefaultIconForIntent(intentType: Fdc3IntentType): AdaptableIcon;
29
- getDefaultIconForContext(contextType: Fdc3ContextType): AdaptableIcon;
26
+ getDefaultIconForIntent(intentType: Intent): AdaptableIcon;
27
+ getDefaultIconForContext(contextType: ContextType): AdaptableIcon;
30
28
  private mapRowValueToContextData;
31
29
  private isAtLeastOneActionButtonConfigured;
32
30
  private getIntentConfigsWithActionButtons;
@@ -2,19 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Fdc3InternalApi = void 0;
4
4
  const ApiBase_1 = require("../Implementation/ApiBase");
5
- const Fdc3Context_1 = require("../../PredefinedConfig/Common/Fdc3Context");
6
5
  const fdc3_1 = require("@finos/fdc3");
7
6
  const Fdc3Options_1 = require("../../AdaptableOptions/Fdc3Options");
8
- const Fdc3Intent_1 = require("../../PredefinedConfig/Common/Fdc3Intent");
9
7
  const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
10
8
  const ActionColumnRenderer_1 = require("../../agGrid/ActionColumnRenderer");
11
9
  class Fdc3InternalApi extends ApiBase_1.ApiBase {
12
10
  mapRowToContextData(contextType, rowNode) {
13
11
  var _a, _b, _c;
14
- if (contextType === fdc3_1.ContextTypes.Nothing) {
15
- return { type: fdc3_1.ContextTypes.Nothing };
12
+ if (contextType === 'fdc3.nothing') {
13
+ return { type: contextType };
16
14
  }
17
- const mappedContextData = this.mapRowValueToContextData(rowNode, this.isStandardContextType(contextType) && contextType !== fdc3_1.ContextTypes.Nothing
15
+ const mappedContextData = this.mapRowValueToContextData(rowNode, this.isStandardContextType(contextType) && contextType !== 'fdc3.nothing'
18
16
  ? (_a = this.getFdc3Options().gridDataContextMapping) === null || _a === void 0 ? void 0 : _a[contextType]
19
17
  : (_c = (_b = this.getFdc3Options().gridDataContextMapping) === null || _b === void 0 ? void 0 : _b.custom) === null || _c === void 0 ? void 0 : _c[contextType]);
20
18
  const contextMappedFromGridData = Object.assign({ type: contextType }, mappedContextData);
@@ -157,12 +155,10 @@ class Fdc3InternalApi extends ApiBase_1.ApiBase {
157
155
  }
158
156
  }
159
157
  isStandardContextType(contextType) {
160
- // @ts-ignore
161
- return Fdc3Context_1.StandardContextTypes.includes(contextType);
158
+ return (0, fdc3_1.isStandardContextType)(contextType);
162
159
  }
163
160
  isStandardIntentType(intentType) {
164
- // @ts-ignore
165
- return Fdc3Intent_1.Fdc3StandardIntents.includes(intentType);
161
+ return (0, fdc3_1.isStandardIntent)(intentType);
166
162
  }
167
163
  getAllRaiseIntentConfigs() {
168
164
  var _a;
@@ -0,0 +1,18 @@
1
+ import { AdaptableColumnDataType } from './AdaptableColumn';
2
+ /**
3
+ * Used in Expressions to reference row values which are not a column definition
4
+ */
5
+ export interface AdaptableField {
6
+ /**
7
+ * Name of field, e.g. 'rowId', 'parentObject.childObject.value'
8
+ */
9
+ name: string;
10
+ /**
11
+ * Label for field (optional - defaults to name)
12
+ */
13
+ label?: string;
14
+ /**
15
+ * Data Type of field, used to validate and show correctly in UI
16
+ */
17
+ dataType: AdaptableColumnDataType;
18
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -54,4 +54,4 @@ export interface AdaptableBaseIcon {
54
54
  /**
55
55
  * All AdapTable System Icon names
56
56
  */
57
- export type AdaptableSystemIconName = 'add' | 'alert' | 'building' | 'laptop' | 'arrow-down' | 'arrow-left' | 'arrow-right' | 'arrow-up' | 'arrow-up-long' | 'arrow-down-long' | 'arrow-expand' | 'paperclip' | 'unfilled-circle' | 'boolean-list' | 'broadcast' | 'brush' | 'spanner' | 'edit-table' | 'chart-and-grid' | 'calendar' | 'call' | 'cells' | 'fdc3' | 'flag' | 'chart' | 'chat' | 'check' | 'check-circle' | 'checked' | 'clone' | 'close' | 'cloud-upload' | 'collapse' | 'column-add' | 'columns' | 'filter-list' | 'copy' | 'comment' | 'comments' | 'contains' | 'dashboard' | 'json' | 'data-set' | 'date-range' | 'delete' | 'division' | 'dock' | 'dollar' | 'drag' | 'edit' | 'ends-with' | 'equals' | 'equation' | 'error' | 'excel' | 'expand' | 'exponent' | 'export' | 'export-data' | 'fast-backward' | 'fast-forward' | 'filter' | 'filter-off' | 'lightning' | 'folder' | 'folder-open' | 'folder-shared' | 'color-palette' | 'horizontal-lines' | 'function' | 'greater-than' | 'greater-than-or-equal' | 'history' | 'home' | 'import-export' | 'info' | 'brain' | 'download' | 'grid' | 'interactions' | 'less-than' | 'less-than-or-equal' | 'list' | 'logout' | 'mail' | 'menu' | 'minus' | 'multiplication' | 'money' | 'newpage' | 'news' | 'filled-circle' | 'not-contains' | 'not-equal' | 'open-in-new' | 'order' | 'organisation' | 'pause' | 'percent' | 'percent-tag' | 'person' | 'contact' | 'pie-chart' | 'play' | 'plus' | 'add-circle' | 'search' | 'search-table' | 'select-all' | 'select-off' | 'select-fwd' | 'quote' | 'refresh' | 'regex' | 'reminder' | 'save' | 'schedule' | 'science' | 'settings' | 'link' | 'sort-asc' | 'sort-desc' | 'spark-line' | 'resume' | 'starts-with' | 'assignment' | 'statusbar' | 'stop' | 'traffic-lights' | 'tab-unselected' | 'theme' | 'clipboard' | 'target' | 'triangle-down' | 'triangle-up' | 'unchecked' | 'undo' | 'downloaded' | 'upload' | 'warning' | 'gradient' | 'badge' | 'italic' | 'bold' | 'align-left' | 'align-right' | 'align-center' | 'align-justify' | 'underline' | 'strikethrough' | 'overline' | 'case-upper' | 'case-lower' | 'case-sentence' | 'visibility-on' | 'visibility-off' | 'visibility-off-bold' | 'visibility-on-bold' | 'note' | 'import' | 'grid-filter' | 'grid-info' | 'csv' | 'rows' | 'expand-all' | 'collapse-all';
57
+ export type AdaptableSystemIconName = 'add' | 'alert' | 'building' | 'laptop' | 'arrow-down' | 'arrow-left' | 'arrow-right' | 'arrow-up' | 'arrow-up-long' | 'arrow-down-long' | 'arrow-expand' | 'paperclip' | 'unfilled-circle' | 'boolean-list' | 'broadcast' | 'brush' | 'spanner' | 'edit-table' | 'chart-and-grid' | 'calendar' | 'call' | 'cells' | 'fdc3' | 'flag' | 'chart' | 'chat' | 'check' | 'check-circle' | 'checked' | 'clone' | 'close' | 'cloud-upload' | 'collapse' | 'column-add' | 'columns' | 'filter-list' | 'copy' | 'comment' | 'comments' | 'contains' | 'dashboard' | 'json' | 'data-set' | 'date-range' | 'delete' | 'division' | 'dock' | 'dollar' | 'drag' | 'edit' | 'ends-with' | 'equals' | 'equation' | 'error' | 'excel' | 'expand' | 'exponent' | 'export' | 'export-data' | 'fast-backward' | 'fast-forward' | 'filter' | 'filter-off' | 'lightning' | 'folder' | 'folder-open' | 'folder-shared' | 'color-palette' | 'horizontal-lines' | 'function' | 'greater-than' | 'greater-than-or-equal' | 'history' | 'home' | 'import-export' | 'info' | 'brain' | 'download' | 'grid' | 'interactions' | 'less-than' | 'less-than-or-equal' | 'list' | 'logout' | 'mail' | 'menu' | 'minus' | 'multiplication' | 'money' | 'newpage' | 'news' | 'filled-circle' | 'not-contains' | 'not-equal' | 'open-in-new' | 'order' | 'organisation' | 'pause' | 'percent' | 'percent-tag' | 'person' | 'contact' | 'pie-chart' | 'play' | 'plus' | 'add-circle' | 'search' | 'search-table' | 'select-all' | 'select-off' | 'select-fwd' | 'sync' | 'quote' | 'refresh' | 'regex' | 'reminder' | 'save' | 'schedule' | 'science' | 'settings' | 'link' | 'sort-asc' | 'sort-desc' | 'spark-line' | 'resume' | 'starts-with' | 'assignment' | 'statusbar' | 'stop' | 'traffic-lights' | 'tab-unselected' | 'theme' | 'clipboard' | 'target' | 'triangle-down' | 'triangle-up' | 'unchecked' | 'undo' | 'downloaded' | 'upload' | 'warning' | 'gradient' | 'badge' | 'italic' | 'bold' | 'align-left' | 'align-right' | 'align-center' | 'align-justify' | 'underline' | 'strikethrough' | 'overline' | 'case-upper' | 'case-lower' | 'case-sentence' | 'visibility-on' | 'visibility-off' | 'visibility-off-bold' | 'visibility-on-bold' | 'note' | 'import' | 'grid-filter' | 'grid-info' | 'csv' | 'rows' | 'expand-all' | 'collapse-all' | 'column-outline';
@@ -29,7 +29,24 @@ exports.SystemPredicateDefs = [
29
29
  icon: { text: 'IN' },
30
30
  columnScope: { DataTypes: ['String', 'Number', 'Date'] },
31
31
  moduleScope: ['columnFilter', 'flashingcell', 'formatColumn', 'alert', 'badgeStyle'],
32
- handler: ({ inputs, column, value, adaptableApi }) => {
32
+ handler: (context) => {
33
+ const { inputs, column, value, adaptableApi } = context;
34
+ const predicateInputs = context.inputs.reduce((acc, input) => {
35
+ const predicate = adaptableApi.predicateApi.getPredicateDefById(input);
36
+ if (predicate) {
37
+ acc.push(predicate);
38
+ }
39
+ return acc;
40
+ }, []);
41
+ if (predicateInputs.length) {
42
+ const nestedContext = Object.assign({}, context);
43
+ delete nestedContext.inputs;
44
+ return predicateInputs.some((predicate) => {
45
+ return adaptableApi.predicateApi.handlePredicate({
46
+ PredicateId: predicate.id,
47
+ }, nestedContext, false);
48
+ });
49
+ }
33
50
  if (inputs.length === 0) {
34
51
  return true;
35
52
  }
@@ -1,226 +1,7 @@
1
- import { Chart, ChatInitSettings, Contact, ContactList, Context, Country, Currency, Email, Instrument, InstrumentList, Nothing, Organization, Portfolio, Position, TimeRange, Valuation, ContextTypes } from '@finos/fdc3';
2
- /**
3
- * FDC3 (2.0) Standard Context Types supported by AdapTable
4
- */
5
- export type Fdc3StandardContextType = ChartContextType | ChatInitSettingsContextType | ContactContextType | ContactListContextType | CountryContextType | CurrencyContextType | EmailContextType | InstrumentContextType | InstrumentListContextType | OrganizationContextType | PortfolioContextType | PositionContextType | TimeRangeContextType | ValuationContextType | NothingContextType;
6
- /**
7
- * Type for FDC3 Custom Context
8
- */
9
- export type Fdc3CustomContextType = string;
10
- /**
11
- * Type for FDC3 Contexts (can be Standard or Custom)
12
- */
13
- export type Fdc3ContextType = Fdc3StandardContextType | Fdc3CustomContextType;
14
- export declare const ChartContextKey = "fdc3.chart";
15
- /**
16
- * Type for FDC3 Chart Context
17
- */
18
- export type ChartContextType = typeof ChartContextKey;
19
- export declare const ChatInitSettingsContextKey = "fdc3.chat.initSettings";
20
- /**
21
- * Type for FDC3 Chart Init Settings Context
22
- */
23
- export type ChatInitSettingsContextType = typeof ChatInitSettingsContextKey;
24
- export declare const ContactContextKey = "fdc3.contact";
25
- /**
26
- * Type for FDC3 Contact Context
27
- */
28
- export type ContactContextType = typeof ContactContextKey;
29
- export declare const ContactListContextKey = "fdc3.contactList";
30
- /**
31
- * Type for FDC3 Contact List Context
32
- */
33
- export type ContactListContextType = typeof ContactListContextKey;
34
- export declare const CountryContextKey = "fdc3.country";
35
- /**
36
- * Type for FDC3 Country Context
37
- */
38
- export type CountryContextType = typeof CountryContextKey;
39
- export declare const CurrencyContextKey = "fdc3.currency";
40
- /**
41
- * Type for FDC3 Currency Context
42
- */
43
- export type CurrencyContextType = typeof CurrencyContextKey;
44
- export declare const EmailContextKey = "fdc3.email";
45
- /**
46
- * Type for FDC3 Email Context
47
- */
48
- export type EmailContextType = typeof EmailContextKey;
49
- export declare const InstrumentContextKey = "fdc3.instrument";
50
- /**
51
- * Type for FDC3 Instrument Context
52
- */
53
- export type InstrumentContextType = typeof InstrumentContextKey;
54
- export declare const InstrumentListContextKey = "fdc3.instrumentList";
55
- /**
56
- * Type for FDC3 Instrument List Context
57
- */
58
- export type InstrumentListContextType = typeof InstrumentListContextKey;
59
- export declare const OrganizationContextKey = "fdc3.organization";
60
- /**
61
- * Type for FDC3 Organization Context
62
- */
63
- export type OrganizationContextType = typeof OrganizationContextKey;
64
- export declare const PortfolioContextKey = "fdc3.portfolio";
65
- /**
66
- * Type for FDC3 Portfolio Context
67
- */
68
- export type PortfolioContextType = typeof PortfolioContextKey;
69
- export declare const PositionContextKey = "fdc3.position";
70
- /**
71
- * Type for FDC3 Position Context
72
- */
73
- export type PositionContextType = typeof PositionContextKey;
74
- export declare const TimeRangeContextKey = "fdc3.timerange";
75
- /**
76
- * Type for FDC3 Time Range Context
77
- */
78
- export type TimeRangeContextType = typeof TimeRangeContextKey;
79
- export declare const ValuationContextKey = "fdc3.valuation";
80
- /**
81
- * Type for FDC3 Valuation Context
82
- */
83
- export type ValuationContextType = typeof ValuationContextKey;
84
- export declare const NothingContextKey = "fdc3.nothing";
85
- /**
86
- * Type for FDC3 Nothing Context
87
- */
88
- export type NothingContextType = typeof NothingContextKey;
89
- /**
90
- * FDC3 (2.0) Contexts
91
- */
92
- export type Fdc3StandardContext = ChartContext | ChatInitSettingsContext | ContactContext | ContactListContext | CountryContext | CurrencyContext | EmailContext | InstrumentContext | InstrumentListContext | OrganizationContext | PortfolioContext | PositionContext | TimeRangeContext | ValuationContext | NothingContext;
93
- /**
94
- * FDC3 (2.0) Custom Context
95
- */
96
- export type Fdc3CustomContext = Context;
97
- /**
98
- * FDC3 (2.0) Generic Context (Standard or Custom)
99
- */
100
- export type Fdc3Context = Fdc3StandardContext | Fdc3CustomContext;
101
- export type TypedFdc3Context<CONTEXT, TYPE extends Fdc3StandardContextType> = CONTEXT & {
102
- type: TYPE;
103
- };
104
- /**
105
- * FDC3 2.0 Chart Context
106
- */
107
- export type ChartContext = TypedFdc3Context<Chart, ContextTypes.Chart>;
108
- /**
109
- * FDC3 2.0 Chat Context
110
- */
111
- export type ChatInitSettingsContext = TypedFdc3Context<ChatInitSettings, ContextTypes.ChatInitSettings>;
112
- /**
113
- * FDC3 2.0 Contact Context
114
- */
115
- export type ContactContext = TypedFdc3Context<Contact, ContextTypes.Contact>;
116
- /**
117
- * FDC3 2.0 Contact List Context
118
- */
119
- export type ContactListContext = TypedFdc3Context<ContactList, ContextTypes.ContactList>;
120
- /**
121
- * FDC3 2.0 Country Context
122
- */
123
- export type CountryContext = TypedFdc3Context<Country, ContextTypes.Country>;
124
- /**
125
- * FDC3 2.0 Currency Context
126
- */
127
- export type CurrencyContext = TypedFdc3Context<Currency, ContextTypes.Currency>;
128
- /**
129
- * FDC3 2.0 Email Context
130
- */
131
- export type EmailContext = TypedFdc3Context<Email, ContextTypes.Email>;
132
- /**
133
- * FDC3 2.0 Instrument Context
134
- */
135
- export type InstrumentContext = TypedFdc3Context<Instrument, ContextTypes.Instrument>;
136
- /**
137
- * FDC3 2.0 Instrument List Context
138
- */
139
- export type InstrumentListContext = TypedFdc3Context<InstrumentList, ContextTypes.InstrumentList>;
140
- /**
141
- * FDC3 2.0 Organization Context
142
- */
143
- export type OrganizationContext = TypedFdc3Context<Organization, ContextTypes.Organization>;
144
- /**
145
- * FDC3 2.0 Portfolio Context
146
- */
147
- export type PortfolioContext = TypedFdc3Context<Portfolio, ContextTypes.Portfolio>;
148
- /**
149
- * FDC3 2.0 Position Context
150
- */
151
- export type PositionContext = TypedFdc3Context<Position, ContextTypes.Position>;
152
- /**
153
- * FDC3 2.0 Time Range Context
154
- */
155
- export type TimeRangeContext = TypedFdc3Context<TimeRange, ContextTypes.TimeRange>;
156
- /**
157
- * FDC3 2.0 Valuation Context
158
- */
159
- export type ValuationContext = TypedFdc3Context<Valuation, ContextTypes.Valuation>;
160
- /**
161
- * FDC3 2.0 Nothing Context
162
- */
163
- export type NothingContext = TypedFdc3Context<Nothing, ContextTypes.Nothing>;
164
- export declare const ContextConfiguration: {
165
- readonly "fdc3.chart": {
166
- readonly label: "Chart";
167
- readonly icon: "pie-chart";
168
- };
169
- readonly "fdc3.chat.initSettings": {
170
- readonly label: "ChatInitSettings";
171
- readonly icon: "chat";
172
- };
173
- readonly "fdc3.contact": {
174
- readonly label: "Contact";
175
- readonly icon: "badge";
176
- };
177
- readonly "fdc3.contactList": {
178
- readonly label: "ContactList";
179
- readonly icon: "badge";
180
- };
181
- readonly "fdc3.country": {
182
- readonly label: "Country";
183
- readonly icon: "flag";
184
- };
185
- readonly "fdc3.currency": {
186
- readonly label: "Currency";
187
- readonly icon: "dollar";
188
- };
189
- readonly "fdc3.email": {
190
- readonly label: "Email";
191
- readonly icon: "mail";
192
- };
193
- readonly "fdc3.instrument": {
194
- readonly label: "Instrument";
195
- readonly icon: "money";
196
- };
197
- readonly "fdc3.instrumentList": {
198
- readonly label: "InstrumentList";
199
- readonly icon: "money";
200
- };
201
- readonly "fdc3.organization": {
202
- readonly label: "Organization";
203
- readonly icon: "organisation";
204
- };
205
- readonly "fdc3.portfolio": {
206
- readonly label: "Portfolio";
207
- readonly icon: "building";
208
- };
209
- readonly "fdc3.position": {
210
- readonly label: "Position";
211
- readonly icon: "building";
212
- };
213
- readonly "fdc3.timerange": {
214
- readonly label: "TimeRange";
215
- readonly icon: "date-range";
216
- };
217
- readonly "fdc3.valuation": {
218
- readonly label: "Valuation";
219
- readonly icon: "equation";
220
- };
221
- readonly "fdc3.nothing": {
222
- readonly label: "Nothing";
223
- readonly icon: "fdc3";
224
- };
225
- };
226
- export declare const StandardContextTypes: Fdc3StandardContextType[];
1
+ import { StandardContextType } from '@finos/fdc3';
2
+ interface ContextConfig {
3
+ label: string;
4
+ icon: string;
5
+ }
6
+ export declare const ContextConfiguration: Record<StandardContextType, ContextConfig>;
7
+ export {};