@adaptabletools/adaptable 18.0.17 → 18.1.0-canary.1

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 (136) hide show
  1. package/agGrid.d.ts +4 -3
  2. package/agGrid.js +4 -3
  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/AdaptableInterfaces/IAdaptable.d.ts +3 -4
  9. package/src/AdaptableOptions/ActionColumnOptions.d.ts +1 -1
  10. package/src/AdaptableOptions/ColumnFilterOptions.d.ts +52 -11
  11. package/src/AdaptableOptions/ExportOptions.d.ts +20 -7
  12. package/src/AdaptableOptions/ExpressionOptions.d.ts +12 -2
  13. package/src/AdaptableOptions/Fdc3Options.d.ts +48 -43
  14. package/src/Api/ColumnApi.d.ts +5 -0
  15. package/src/Api/Events/Fdc3MessageInfo.d.ts +5 -7
  16. package/src/Api/ExpressionApi.d.ts +2 -2
  17. package/src/Api/Fdc3Api.d.ts +14 -19
  18. package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -0
  19. package/src/Api/Implementation/ColumnApiImpl.js +3 -0
  20. package/src/Api/Implementation/ConfigApiImpl.js +3 -0
  21. package/src/Api/Implementation/Fdc3ApiImpl.d.ts +14 -16
  22. package/src/Api/Implementation/Fdc3ApiImpl.js +36 -12
  23. package/src/Api/Internal/AlertInternalApi.d.ts +17 -2
  24. package/src/Api/Internal/AlertInternalApi.js +196 -25
  25. package/src/Api/Internal/ColumnFilterInternalApi.d.ts +2 -0
  26. package/src/Api/Internal/ColumnFilterInternalApi.js +20 -0
  27. package/src/Api/Internal/ExportInternalApi.d.ts +3 -3
  28. package/src/Api/Internal/ExportInternalApi.js +31 -17
  29. package/src/Api/Internal/ExpressionInternalApi.d.ts +5 -1
  30. package/src/Api/Internal/ExpressionInternalApi.js +79 -0
  31. package/src/Api/Internal/Fdc3InternalApi.d.ts +8 -10
  32. package/src/Api/Internal/Fdc3InternalApi.js +6 -10
  33. package/src/Api/Internal/GridInternalApi.d.ts +29 -13
  34. package/src/Api/Internal/GridInternalApi.js +129 -39
  35. package/src/PredefinedConfig/Common/AdaptableField.d.ts +18 -0
  36. package/src/PredefinedConfig/Common/AdaptableField.js +1 -0
  37. package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
  38. package/src/PredefinedConfig/Common/AdaptablePredicate.js +22 -1
  39. package/src/PredefinedConfig/Common/Fdc3Context.d.ts +7 -226
  40. package/src/PredefinedConfig/Common/Fdc3Context.js +43 -31
  41. package/src/PredefinedConfig/Common/Fdc3Intent.d.ts +6 -89
  42. package/src/PredefinedConfig/Common/Fdc3Intent.js +26 -73
  43. package/src/PredefinedConfig/Common/RowSummary.d.ts +2 -1
  44. package/src/PredefinedConfig/StyledColumnState.d.ts +1 -1
  45. package/src/Redux/ActionsReducers/FormatColumnRedux.js +0 -3
  46. package/src/Strategy/AdaptableModuleBase.js +1 -3
  47. package/src/Strategy/AlertModule.d.ts +1 -1
  48. package/src/Strategy/AlertModule.js +8 -8
  49. package/src/Utilities/Constants/DocumentationLinkConstants.js +4 -4
  50. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +3 -1
  51. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +1 -1
  52. package/src/Utilities/Services/Fdc3Service.d.ts +1 -1
  53. package/src/Utilities/Services/Fdc3Service.js +2 -2
  54. package/src/Utilities/Services/QueryLanguageService.d.ts +8 -4
  55. package/src/Utilities/Services/QueryLanguageService.js +105 -6
  56. package/src/Utilities/Services/ReportService.js +8 -5
  57. package/src/Utilities/Services/RowSummaryService.js +3 -1
  58. package/src/Utilities/divideBy100.d.ts +1 -0
  59. package/src/Utilities/divideBy100.js +30 -0
  60. package/src/Utilities/times100.d.ts +1 -0
  61. package/src/Utilities/times100.js +23 -0
  62. package/src/View/Alert/Wizard/AlertMessageWizardSection.js +1 -1
  63. package/src/View/Alert/Wizard/AlertNotificationWizardSection.js +2 -2
  64. package/src/View/Alert/Wizard/AlertScopeWizardSection.js +2 -1
  65. package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +1 -1
  66. package/src/View/CalculatedColumn/Wizard/CalculatedColumnTypeSection.js +5 -5
  67. package/src/View/Components/EntityRulesEditor/index.d.ts +1 -0
  68. package/src/View/Components/EntityRulesEditor/index.js +11 -7
  69. package/src/View/Components/ExpressionWizard.js +1 -1
  70. package/src/View/Components/FilterForm/FilterForm.js +2 -2
  71. package/src/View/Components/FilterForm/ListBoxFilterForm.js +2 -1
  72. package/src/View/Components/FilterForm/QuickFilterValues.d.ts +1 -1
  73. package/src/View/Components/FilterForm/QuickFilterValues.js +5 -5
  74. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +6 -2
  75. package/src/View/Components/Selectors/FieldSelector.d.ts +13 -0
  76. package/src/View/Components/Selectors/FieldSelector.js +21 -0
  77. package/src/View/Components/Selectors/PermittedValuesSelector.js +9 -5
  78. package/src/View/Export/Wizard/ReportRowsWizardSection.js +1 -1
  79. package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +1 -1
  80. package/src/View/GridFilter/GridFilterExpressionEditor.js +1 -1
  81. package/src/View/Layout/Wizard/sections/GridFilterSection.js +4 -2
  82. package/src/View/Layout/Wizard/sections/RowSummarySection.js +7 -1
  83. package/src/View/NamedQuery/Wizard/NamedQueryExpressionWizardSection.js +1 -1
  84. package/src/View/Wizard/OnePageAdaptableWizard.js +3 -2
  85. package/src/agGrid/AdaptableAgGrid.d.ts +4 -6
  86. package/src/agGrid/AdaptableAgGrid.js +68 -49
  87. package/src/agGrid/AgGridColumnAdapter.d.ts +3 -0
  88. package/src/agGrid/AgGridColumnAdapter.js +22 -0
  89. package/src/agGrid/AgGridMenuAdapter.js +1 -1
  90. package/src/agGrid/FilterWrapper.js +12 -7
  91. package/src/agGrid/defaultAdaptableOptions.js +2 -2
  92. package/src/agGrid/editors/AdaptableDateEditor/InternalAdaptableDateEditor.d.ts +0 -1
  93. package/src/agGrid/editors/AdaptableDateEditor/InternalAdaptableDateEditor.js +0 -2
  94. package/src/agGrid/editors/AdaptableDateEditor/index.d.ts +4 -16
  95. package/src/agGrid/editors/AdaptableDateEditor/index.js +5 -18
  96. package/src/agGrid/editors/AdaptableNumberEditor/InternalAdaptableNumberEditor.js +6 -1
  97. package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +4 -3
  98. package/src/agGrid/editors/AdaptableNumberEditor/index.js +5 -2
  99. package/src/agGrid/editors/AdaptablePercentageEditor/InternalAdaptablePercentageEditor.d.ts +23 -0
  100. package/src/agGrid/editors/AdaptablePercentageEditor/InternalAdaptablePercentageEditor.js +80 -0
  101. package/src/agGrid/editors/AdaptablePercentageEditor/index.d.ts +47 -0
  102. package/src/agGrid/editors/AdaptablePercentageEditor/index.js +148 -0
  103. package/src/components/Accordion.js +1 -1
  104. package/src/components/Datepicker/DatepickerContext.d.ts +0 -2
  105. package/src/components/Datepicker/index.js +3 -4
  106. package/src/components/ExpressionEditor/DataTableEditor.d.ts +17 -0
  107. package/src/components/ExpressionEditor/DataTableEditor.js +63 -0
  108. package/src/components/ExpressionEditor/EditorInput.js +22 -9
  109. package/src/components/ExpressionEditor/NamedQueryEditor.d.ts +5 -0
  110. package/src/components/ExpressionEditor/NamedQueryEditor.js +30 -0
  111. package/src/components/ExpressionEditor/QueryBuilder/QueryBuilder.d.ts +10 -0
  112. package/src/components/ExpressionEditor/QueryBuilder/QueryBuilder.js +7 -4
  113. package/src/components/ExpressionEditor/QueryBuilder/QueryBuilderInputs.d.ts +3 -2
  114. package/src/components/ExpressionEditor/QueryBuilder/QueryBuilderInputs.js +71 -13
  115. package/src/components/ExpressionEditor/QueryBuilder/QueryPredicateBuilder.js +30 -22
  116. package/src/components/ExpressionEditor/QueryBuilder/utils.d.ts +9 -1
  117. package/src/components/ExpressionEditor/QueryBuilder/utils.js +41 -3
  118. package/src/components/ExpressionEditor/index.d.ts +3 -1
  119. package/src/components/ExpressionEditor/index.js +67 -94
  120. package/src/components/Input/NumberInput.d.ts +2 -1
  121. package/src/components/Input/NumberInput.js +7 -4
  122. package/src/components/OverlayTrigger/index.js +10 -6
  123. package/src/components/icons/column-outline.d.ts +3 -0
  124. package/src/components/icons/column-outline.js +4 -0
  125. package/src/components/icons/index.js +5 -1
  126. package/src/components/icons/sync.d.ts +3 -0
  127. package/src/components/icons/sync.js +4 -0
  128. package/src/env.js +2 -2
  129. package/src/metamodel/adaptable.metamodel.d.ts +121 -200
  130. package/src/metamodel/adaptable.metamodel.js +1 -1
  131. package/src/parser/src/predicate/mapExpressionToQlPredicate.d.ts +1 -0
  132. package/src/parser/src/predicate/mapExpressionToQlPredicate.js +12 -2
  133. package/src/parser/src/predicate/mapQlPredicateToExpression.js +4 -1
  134. package/src/parser/src/types.d.ts +101 -1
  135. package/src/types.d.ts +8 -6
  136. package/tsconfig.esm.tsbuildinfo +1 -1
@@ -1,12 +1,14 @@
1
- import * as parser from '../../parser/src';
2
1
  import { isObservable } from 'rxjs';
3
- import { aggregatedScalarExpressionFunctions, } from '../ExpressionFunctions/aggregatedScalarExpressionFunctions';
2
+ import * as parser from '../../parser/src';
4
3
  import { aggregatedBooleanExpressionFunctions, } from '../ExpressionFunctions/aggregatedBooleanExpressionFunctions';
5
- import { AggregatedScalarLiveValue } from './AggregatedScalarLiveValue';
4
+ import { addGroupByParams, aggregatedScalarExpressionFunctions, } from '../ExpressionFunctions/aggregatedScalarExpressionFunctions';
6
5
  import { booleanExpressionFunctions } from '../ExpressionFunctions/booleanExpressionFunctions';
7
- import { scalarExpressionFunctions } from '../ExpressionFunctions/scalarExpressionFunctions';
6
+ import { extractColumnParameters, extractParameter, } from '../ExpressionFunctions/expressionFunctionUtils';
8
7
  import { observableExpressionFunctions } from '../ExpressionFunctions/observableExpressionFunctions';
8
+ import { scalarExpressionFunctions } from '../ExpressionFunctions/scalarExpressionFunctions';
9
9
  import { getTypedKeys } from '../Extensions/TypeExtensions';
10
+ import { createBaseContext } from '../ObjectFactory';
11
+ import { AggregatedScalarLiveValue } from './AggregatedScalarLiveValue';
10
12
  export class QueryLanguageService {
11
13
  constructor(adaptableApi) {
12
14
  this.adaptableApi = adaptableApi;
@@ -285,8 +287,11 @@ export class QueryLanguageService {
285
287
  const generalBooleanExpressionFunctions = this.extractMappedExpressionFunctions(booleanExpressionFunctions, expressionOptions.systemBooleanFunctions, expressionOptions.customBooleanFunctions);
286
288
  const generalScalarExpressionFunctions = this.extractMappedExpressionFunctions(scalarExpressionFunctions, expressionOptions.systemScalarFunctions, expressionOptions.customScalarFunctions);
287
289
  const generalObservableExpressionFunctions = this.extractMappedExpressionFunctions(observableExpressionFunctions, expressionOptions.systemObservableFunctions);
288
- const generalAggregatedBooleanExpressionFunctions = this.extractMappedExpressionFunctions(aggregatedBooleanExpressionFunctions, expressionOptions.systemAggregatedBooleanFunctions);
289
- const generalAggregatedScalarExpressionFunctions = this.extractMappedExpressionFunctions(aggregatedScalarExpressionFunctions, expressionOptions.systemAggregatedScalarFunctions);
290
+ const generalAggregatedBooleanExpressionFunctions = this.extractMappedExpressionFunctions(aggregatedBooleanExpressionFunctions, expressionOptions.systemAggregatedBooleanFunctions,
291
+ // right now the custom aggregated scalar functions are used in the aggregated boolean functions as well
292
+ // hopefully we'll simplify this in the future
293
+ this.getCustomAggregatedScalarFunctions());
294
+ const generalAggregatedScalarExpressionFunctions = this.extractMappedExpressionFunctions(aggregatedScalarExpressionFunctions, expressionOptions.systemAggregatedScalarFunctions, this.getCustomAggregatedScalarFunctions());
290
295
  if (!module) {
291
296
  this.adaptableApi.logWarn(`QueryLanguageService.getModuleExpressionFunctions() was called with an undefined 'module' param, this should never happen`);
292
297
  return {
@@ -325,6 +330,100 @@ export class QueryLanguageService {
325
330
  this.cacheModuleSpecificExpressionFunctions.set(module, moduleExpressionFunctionsMap);
326
331
  return moduleExpressionFunctionsMap;
327
332
  }
333
+ getCustomAggregatedScalarFunctions() {
334
+ var _a;
335
+ const customAggregatedScalarFunctions = (_a = this.adaptableApi.optionsApi.getExpressionOptions()) === null || _a === void 0 ? void 0 : _a.customAggregatedScalarFunctions;
336
+ if (!customAggregatedScalarFunctions) {
337
+ return {};
338
+ }
339
+ if (typeof customAggregatedScalarFunctions === 'function') {
340
+ return (context) => {
341
+ const customDefinitions = customAggregatedScalarFunctions(context);
342
+ return this.mapCustomAggregatedScalarFunctionsToInternal(customDefinitions);
343
+ };
344
+ }
345
+ return this.mapCustomAggregatedScalarFunctionsToInternal(customAggregatedScalarFunctions);
346
+ }
347
+ mapCustomAggregatedScalarFunctionsToInternal(aggregatedScalarFunctions) {
348
+ const getValueForColId = (colId, rowNode) => {
349
+ return this.adaptableApi.gridApi.getRawValueFromRowNode(rowNode, colId);
350
+ };
351
+ return Object.entries(aggregatedScalarFunctions).reduce((acc, [expressionName, customExpressionDefinition]) => {
352
+ const expression = {
353
+ handler: (args, context) => {
354
+ // There is built in support for column validation
355
+ // TODO: change to extractParameters
356
+ // { colArgs: { [colId]: value } }
357
+ const [aggColParam, ...restOfColParams] = extractColumnParameters(expressionName, args);
358
+ const aggColumnId = aggColParam === null || aggColParam === void 0 ? void 0 : aggColParam.value;
359
+ const groupByParameter = extractParameter(expressionName, 'operand', ['GROUP_BY'], args, {
360
+ isOptional: true,
361
+ });
362
+ const preparedArgs = args.filter((arg) => {
363
+ if (typeof arg === 'object' && arg.name === 'COL') {
364
+ // filter out only first col
365
+ return arg.value !== aggColumnId;
366
+ }
367
+ // filter out all other objects, e.g. GROUP_BY
368
+ return typeof arg !== 'object';
369
+ });
370
+ const aggregationExpressionEvaluation = {
371
+ aggregationParams: {
372
+ reducers: {
373
+ [expressionName]: {
374
+ name: expressionName,
375
+ field: aggColumnId,
376
+ initialValue: customExpressionDefinition.initialValue,
377
+ reducer: (acc, value, rowNode, dataIndex) => {
378
+ const context = Object.assign({ rowNode, args: preparedArgs.map((arg) => {
379
+ // if col, replace with value
380
+ if (typeof arg === 'object' && arg.name === 'COL') {
381
+ return getValueForColId(arg.value, rowNode);
382
+ }
383
+ return arg;
384
+ }), aggColumnId, getValueForColId: (colId) => getValueForColId(colId, rowNode) }, createBaseContext(this.adaptableApi));
385
+ return customExpressionDefinition.reducer(acc, value, dataIndex, context);
386
+ },
387
+ done: (accValue, dataArray) => {
388
+ if (customExpressionDefinition.processReducerValue) {
389
+ return customExpressionDefinition.processReducerValue(accValue, dataArray, Object.assign(Object.assign({}, createBaseContext(this.adaptableApi)), { args }));
390
+ }
391
+ return accValue;
392
+ },
393
+ },
394
+ },
395
+ },
396
+ rowValueGetter: (rowNode, aggregationValue) => {
397
+ if (customExpressionDefinition.prepareRowValue) {
398
+ return customExpressionDefinition.prepareRowValue(rowNode, aggregationValue, Object.assign(Object.assign({}, createBaseContext(this.adaptableApi)), { aggColumnId,
399
+ args, getValueForColId: (colId) => getValueForColId(colId, rowNode) }));
400
+ }
401
+ return aggregationValue;
402
+ },
403
+ rowFilterFn: (rowNode) => {
404
+ var _a, _b;
405
+ if (customExpressionDefinition.rowFilter) {
406
+ return customExpressionDefinition.rowFilter(rowNode, Object.assign(Object.assign({}, createBaseContext(this.adaptableApi)), { aggColumnId, getValueForColId: (colId) => getValueForColId(colId, rowNode) }));
407
+ }
408
+ return (_b = (_a = context === null || context === void 0 ? void 0 : context.filterFn) === null || _a === void 0 ? void 0 : _a.call(context, rowNode)) !== null && _b !== void 0 ? _b : true;
409
+ },
410
+ getRowNodes: context.getRowNodes,
411
+ };
412
+ addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
413
+ const result = {
414
+ name: expressionName,
415
+ type: 'aggregationScalar',
416
+ value: aggregationExpressionEvaluation,
417
+ };
418
+ return result;
419
+ },
420
+ description: customExpressionDefinition.description,
421
+ signatures: customExpressionDefinition.signatures,
422
+ };
423
+ acc[expressionName] = expression;
424
+ return acc;
425
+ }, {});
426
+ }
328
427
  extractMappedExpressionFunctions(availableExpressionFunctions, systemFunctions, customFunctions) {
329
428
  const systemFunctionNames = typeof systemFunctions === 'function'
330
429
  ? systemFunctions({
@@ -323,16 +323,17 @@ export class ReportService {
323
323
  if (StringExtensions.IsNullOrEmpty(cellRawValue)) {
324
324
  return cellRawValue;
325
325
  }
326
- const columnType = this.adaptableApi.columnApi.getColumnDataTypeForColumnId(columnId);
326
+ const column = this.adaptableApi.columnApi.getColumnWithColumnId(columnId);
327
+ const columnDataType = column.dataType;
327
328
  // if this is a date column and there is a custom export date format provided, that will take precedence
328
- if (columnType === 'Date' && !!this.getCustomExportDateFormat()) {
329
+ if (columnDataType === 'Date' && !!this.getCustomExportDateFormat()) {
329
330
  const exportDateFormat = this.getCustomExportDateFormat();
330
331
  return FormatHelper.DateFormatter(cellRawValue, {
331
332
  Pattern: exportDateFormat,
332
333
  });
333
334
  }
334
335
  // otherwise check the general export format types
335
- let cellExportFormat = this.adaptableApi.exportApi.internalApi.getCellExportFormatType(columnType);
336
+ let cellExportFormat = this.adaptableApi.exportApi.internalApi.getCellExportFormatType(column, columnDataType);
336
337
  return this.getCellExportValueFromRawValueByType(rowNode, cellRawValue, columnId, cellExportFormat);
337
338
  }
338
339
  getReportFileName(reportName, destination) {
@@ -395,7 +396,6 @@ export class ReportService {
395
396
  formatColumnsWithDisplayFormatForColumn[columnId] = formatColumns;
396
397
  return formatColumns;
397
398
  };
398
- const isDateCellExportedAsFormattedValue = this.adaptableApi.exportApi.internalApi.isDateCellExportedAsFormattedValue();
399
399
  const displayedColumns = this.adaptableApi.agGridApi.getAllDisplayedColumns();
400
400
  const colDefs = displayedColumns.map((column) => {
401
401
  return column.getColDef();
@@ -419,6 +419,9 @@ export class ReportService {
419
419
  displayedColumns.forEach((column, columnIndex) => {
420
420
  var _a, _b, _c;
421
421
  const colDef = colDefs[columnIndex];
422
+ const columnId = column.getId();
423
+ const adaptableColumn = this.adaptableApi.columnApi.getColumnWithColumnId(columnId);
424
+ const isDateCellExportedAsFormattedValue = this.adaptableApi.exportApi.internalApi.isDateCellExportedAsFormattedValue(adaptableColumn);
422
425
  let cellClassParams;
423
426
  const getLazyCellClassParams = () => {
424
427
  if (!cellClassParams) {
@@ -427,7 +430,7 @@ export class ReportService {
427
430
  node,
428
431
  column,
429
432
  data: node.data,
430
- value: this.adaptableApi.gridApi.getRawValueFromRowNode(node, column.getId()),
433
+ value: this.adaptableApi.gridApi.getRawValueFromRowNode(node, columnId),
431
434
  rowIndex,
432
435
  api: agGridApi,
433
436
  columnApi: null,
@@ -94,7 +94,9 @@ export class RowSummaryService {
94
94
  return;
95
95
  }
96
96
  const rowSummaries = (_a = this.api.layoutApi.getCurrentLayout().RowSummaries) !== null && _a !== void 0 ? _a : [];
97
- const rowSummariesResults = rowSummaries.map(({ ColumnsMap, Position }) => {
97
+ const rowSummariesResults = rowSummaries
98
+ .filter((rowSummary) => !rowSummary.IsSuspended)
99
+ .map(({ ColumnsMap, Position }) => {
98
100
  return {
99
101
  Position,
100
102
  RowData: Object.entries(ColumnsMap !== null && ColumnsMap !== void 0 ? ColumnsMap : {}).reduce((acc, [columnId, expression]) => {
@@ -0,0 +1 @@
1
+ export declare function divideBy100(value: any): any;
@@ -0,0 +1,30 @@
1
+ export function divideBy100(value) {
2
+ // the simple solution does not work
3
+ // return value / 100;
4
+ // needed because 4012.3456/100 = 40.123456000000004
5
+ // but we dont want that to happen
6
+ // this solution does not handle -0 correctly
7
+ // return parseFloat((value / 100).toFixed(12));
8
+ if (isNaN(value) || !value) {
9
+ return value;
10
+ }
11
+ const isNegative = value < 0;
12
+ if (isNegative) {
13
+ value = -value;
14
+ }
15
+ const valueAsStr = value.toPrecision();
16
+ const separator = Number(1.1).toLocaleString()[1];
17
+ let indexOfSeparator = valueAsStr.indexOf(separator);
18
+ if (indexOfSeparator === -1) {
19
+ indexOfSeparator = 0;
20
+ }
21
+ let [integer = '', decimal] = valueAsStr.split(separator);
22
+ decimal = decimal || '';
23
+ integer = integer.padStart(2, '0');
24
+ const integerArr = [...integer];
25
+ const num = integerArr.slice(0, integerArr.length - 2).join('') +
26
+ separator +
27
+ integerArr.slice(-2).join('') +
28
+ decimal;
29
+ return Number(num) * (isNegative ? -1 : 1);
30
+ }
@@ -0,0 +1 @@
1
+ export declare function times100(value: any): any;
@@ -0,0 +1,23 @@
1
+ export function times100(value) {
2
+ // the simple solution does not work
3
+ // return value * 100;
4
+ // needed because 0.12676 * 100 = 12.676000000000002
5
+ // but we dont want that to happen
6
+ // this solution does not handle -0 correctly
7
+ // also 1267.6 * 100 is 126759.99999999999
8
+ // which is not what we want
9
+ // return parseFloat((value * 100).toFixed(12));
10
+ if (isNaN(value) || !value) {
11
+ return value;
12
+ }
13
+ const valueAsStr = value.toPrecision();
14
+ const separator = Number(1.1).toLocaleString()[1];
15
+ const indexOfSeparator = valueAsStr.indexOf(separator);
16
+ if (indexOfSeparator === -1) {
17
+ return value * 100;
18
+ }
19
+ const [integer, decimal] = valueAsStr.split(separator);
20
+ const num = [...`${integer}${decimal !== null && decimal !== void 0 ? decimal : ''}00`];
21
+ num.splice(indexOfSeparator + 2, 0, separator);
22
+ return Number(num.join(''));
23
+ }
@@ -15,7 +15,7 @@ export const renderAlertMessageSummary = () => {
15
15
  export const AlertMessageWizardSection = (props) => {
16
16
  const { data, api } = useOnePageAdaptableWizardContext();
17
17
  const messageType = data.MessageType;
18
- const messageText = api.alertApi.internalApi.getAlertDescription(data);
18
+ const messageText = api.alertApi.internalApi.getAlertDescriptionForDataChange(data);
19
19
  const messageHeader = data.MessageHeader;
20
20
  const onMessageTextChange = (e) => {
21
21
  const { value } = e.target;
@@ -31,8 +31,8 @@ export const AlertPreview = (_a) => {
31
31
  }
32
32
  const result = {
33
33
  alertType: 'generic',
34
- header: api.alertApi.internalApi.getAlertMessageHeader(alertDefinition),
35
- message: api.alertApi.internalApi.getAlertDescription(alertDefinition),
34
+ header: api.alertApi.internalApi.getAlertMessageHeaderForDataChange(alertDefinition),
35
+ message: api.alertApi.internalApi.getAlertDescriptionForDataChange(alertDefinition),
36
36
  alertDefinition: Object.assign(Object.assign({}, alertDefinition), { AlertForm: alertForm }),
37
37
  };
38
38
  return result;
@@ -24,7 +24,8 @@ export const AlertScopeWizardSection = (props) => {
24
24
  Predicates: [{ PredicateId: 'AnyChange' }],
25
25
  };
26
26
  }
27
- if (newData.Rule.ObservableExpression !== undefined && !api.columnScopeApi.scopeIsAll(Scope)) {
27
+ if (newData.Rule.ObservableExpression !== undefined &&
28
+ !api.columnScopeApi.scopeIsAll(Scope)) {
28
29
  // if it had observable expression and the scope is changed to partial
29
30
  // we need to reset to not be an observable expression, as observable is not supported
30
31
  // for partial scope
@@ -49,7 +49,7 @@ export const CalculatedColumnExpressionWizardSection = (props) => {
49
49
  React.createElement(Tabs.Content, null, (() => {
50
50
  switch (props.expressionType) {
51
51
  case 'ScalarExpression':
52
- return (React.createElement(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.namedQueryApi.getNamedQueries(), isFullExpression: true, api: api }));
52
+ return (React.createElement(ExpressionEditor, { type: 'scalar', module: moduleInfo.ModuleName, style: { paddingLeft: 0 }, value: data.Query.ScalarExpression, onChange: (ScalarExpression) => setCalculatedColumnExpression({ ScalarExpression }), initialData: initialData, columns: api.columnApi.getQueryableColumns(), fields: api.expressionApi.internalApi.getAvailableFields(), namedQueries: api.namedQueryApi.getNamedQueries(), isFullExpression: true, api: api }));
53
53
  case 'AggregatedScalarExpression':
54
54
  case 'CumulativeAggregatedExpression':
55
55
  case 'QuantileAggregatedExpression':
@@ -4,11 +4,11 @@ import { Tabs } from '../../../components/Tabs';
4
4
  import { TypeRadio } from '../../Wizard/TypeRadio';
5
5
  export const CalculatedColumnTypeWizardSection = (props) => {
6
6
  return (React.createElement(Tabs, null,
7
- React.createElement(Tabs.Tab, null, "Calculated Column Type"),
7
+ React.createElement(Tabs.Tab, null, "Calculated Column Expression Type"),
8
8
  React.createElement(Tabs.Content, null,
9
9
  React.createElement(Flex, { flexDirection: "column" },
10
- React.createElement(TypeRadio, { text: 'Scalar Expression', description: "The calculated value is derived from other cells in the row", checked: props.type === 'ScalarExpression', onClick: () => props.onTypeChange('ScalarExpression') }),
11
- React.createElement(TypeRadio, { text: 'Aggregated Scalar Expression', description: "The calculated value is derived from other rows", checked: props.type === 'AggregatedScalarExpression', onClick: () => props.onTypeChange('AggregatedScalarExpression') }),
12
- React.createElement(TypeRadio, { text: 'Cumulative Aggregated Expression', description: "The calculated value is derived cumulatively from other rows", checked: props.type === 'CumulativeAggregatedExpression', onClick: () => props.onTypeChange('CumulativeAggregatedExpression') }),
13
- React.createElement(TypeRadio, { text: 'Quantile Aggregated Expression', description: "The calculated value is derived from other rows using quantile aggregations", checked: props.type === 'QuantileAggregatedExpression', onClick: () => props.onTypeChange('QuantileAggregatedExpression') })))));
10
+ React.createElement(TypeRadio, { text: 'Standard', description: "The calculated value is derived from other cells in the row", checked: props.type === 'ScalarExpression', onClick: () => props.onTypeChange('ScalarExpression') }),
11
+ React.createElement(TypeRadio, { text: 'Aggregated', description: "The calculated value is derived from other rows", checked: props.type === 'AggregatedScalarExpression', onClick: () => props.onTypeChange('AggregatedScalarExpression') }),
12
+ React.createElement(TypeRadio, { text: 'Cumulative', description: "The calculated value is derived cumulatively from other rows", checked: props.type === 'CumulativeAggregatedExpression', onClick: () => props.onTypeChange('CumulativeAggregatedExpression') }),
13
+ React.createElement(TypeRadio, { text: 'Quantile', description: "The calculated value is derived from other rows using quantile aggregations", checked: props.type === 'QuantileAggregatedExpression', onClick: () => props.onTypeChange('QuantileAggregatedExpression') })))));
14
14
  };
@@ -27,6 +27,7 @@ export type EntityRulesEditorProps<T> = {
27
27
  useAggregationQuery: React.ReactNode;
28
28
  };
29
29
  flexProps?: FlexProps;
30
+ showQueryBuilder?: boolean;
30
31
  };
31
32
  export declare const EntityRulesSummary: <T extends {
32
33
  Rule?: RuleType;
@@ -7,6 +7,7 @@ import Radio from '../../../components/Radio';
7
7
  import { ExpressionEditor } from '../../../components/ExpressionEditor';
8
8
  import { useAdaptable } from '../../AdaptableContext';
9
9
  import { EntityRulePredicatesEditor } from './EntityRulePredicatesEditor';
10
+ import Panel from '../../../components/Panel';
10
11
  const QueryTab = (props) => {
11
12
  const { type, label, disabled = false } = props, tabProps = __rest(props, ["type", "label", "disabled"]);
12
13
  const text = (React.createElement(Flex, { flexDirection: "column" },
@@ -43,7 +44,7 @@ const RuleTabTitle = (props) => {
43
44
  return props.showRadio ? (React.createElement(Radio, { tabIndex: -1, margin: 0, checked: props.checked }, props.children)) : (React.createElement(React.Fragment, null, "props.children"));
44
45
  };
45
46
  export const EntityRulesEditor = (props) => {
46
- var _a, _b, _c;
47
+ var _a, _b;
47
48
  const { data, children, descriptions, predicateDefs, showNoRule = false, showPredicate = true, showObservable = true, showBoolean = true, showAggregation = true, flexProps, module, } = props;
48
49
  const { api } = useAdaptable();
49
50
  const numberOfTabs = [
@@ -125,12 +126,15 @@ export const EntityRulesEditor = (props) => {
125
126
  showPredicate ? (React.createElement(Tabs.Content, { "data-name": "Predicate", value: "Predicate" },
126
127
  React.createElement(EntityRulePredicatesEditor, { enablePredicateColumnId: props.enablePredicateColumnId, data: data, descriptions: descriptions, predicateDefs: filteredPredicateDefs, getPredicateDefsForColId: props.getPredicateDefsForColId, onChange: props.onChange }))) : null,
127
128
  showBoolean ? (React.createElement(QueryTab, { showRadio: showRadioButtons, value: "BooleanExpression", type: type, label: "Boolean" })) : null,
128
- showBoolean ? (React.createElement(Tabs.Content, { "data-name": "BooleanExpression", value: 'BooleanExpression', paddingLeft: 0 },
129
- React.createElement(ExpressionEditor, { type: 'boolean', module: module, value: (_a = data.Rule) === null || _a === void 0 ? void 0 : _a.BooleanExpression, onChange: setBooleanExpression, initialData: initialData, columns: api.columnApi.getQueryableColumns(), namedQueries: api.namedQueryApi.getNamedQueries(), api: api }))) : null,
129
+ showBoolean ? (React.createElement(Tabs.Content, { "data-name": "BooleanExpression", value: 'BooleanExpression' }, (() => {
130
+ var _a;
131
+ const editor = (React.createElement(ExpressionEditor, { type: 'boolean', module: module, value: (_a = data.Rule) === null || _a === void 0 ? void 0 : _a.BooleanExpression, onChange: setBooleanExpression, initialData: initialData, columns: api.columnApi.getQueryableColumns(), fields: api.expressionApi.internalApi.getAvailableFields(), namedQueries: api.namedQueryApi.getNamedQueries(), api: api, showQueryBuilder: props.showQueryBuilder }));
132
+ return props.showQueryBuilder ? React.createElement(Panel, null, editor) : editor;
133
+ })())) : null,
130
134
  showObservable ? (React.createElement(QueryTab, { showRadio: showRadioButtons, value: "ObservableExpression", type: type, label: "Observable" })) : null,
131
- showObservable ? (React.createElement(Tabs.Content, { "data-name": "ObservableExpression", value: 'ObservableExpression', paddingLeft: 0 },
132
- React.createElement(ExpressionEditor, { type: 'observable', module: module, value: (_b = data.Rule) === null || _b === void 0 ? void 0 : _b.ObservableExpression, onChange: setReactiveExpression, initialData: initialData, columns: api.columnApi.getQueryableColumns(), namedQueries: api.namedQueryApi.getNamedQueries(), api: api }))) : null,
135
+ showObservable ? (React.createElement(Tabs.Content, { "data-name": "ObservableExpression", value: 'ObservableExpression' },
136
+ React.createElement(ExpressionEditor, { type: 'observable', module: module, value: (_a = data.Rule) === null || _a === void 0 ? void 0 : _a.ObservableExpression, onChange: setReactiveExpression, initialData: initialData, columns: api.columnApi.getQueryableColumns(), fields: api.expressionApi.internalApi.getAvailableFields(), namedQueries: api.namedQueryApi.getNamedQueries(), api: api }))) : null,
133
137
  showAggregation ? (React.createElement(QueryTab, { showRadio: showRadioButtons, value: "AggregatedBooleanExpression", type: type, label: "Aggregated Boolean" })) : null,
134
- showAggregation ? (React.createElement(Tabs.Content, { "data-name": "AggregatedBooleanExpression", value: 'AggregatedBooleanExpression', paddingLeft: 0 },
135
- React.createElement(ExpressionEditor, { type: 'aggregatedBoolean', module: module, value: (_c = data.Rule) === null || _c === void 0 ? void 0 : _c.AggregatedBooleanExpression, onChange: setAggregationExpression, initialData: initialData, columns: api.columnApi.getQueryableColumns(), namedQueries: api.namedQueryApi.getNamedQueries(), api: api }))) : null)));
138
+ showAggregation ? (React.createElement(Tabs.Content, { "data-name": "AggregatedBooleanExpression", value: 'AggregatedBooleanExpression' },
139
+ React.createElement(ExpressionEditor, { type: 'aggregatedBoolean', module: module, value: (_b = data.Rule) === null || _b === void 0 ? void 0 : _b.AggregatedBooleanExpression, onChange: setAggregationExpression, initialData: initialData, columns: api.columnApi.getQueryableColumns(), fields: api.expressionApi.internalApi.getAvailableFields(), namedQueries: api.namedQueryApi.getNamedQueries(), api: api }))) : null)));
136
140
  };
@@ -28,7 +28,7 @@ export class ExpressionWizard extends React.Component {
28
28
  render() {
29
29
  const initialData = useMemo(() => this.props.api.internalApi.getQueryPreviewData(), []);
30
30
  return (React.createElement(React.Fragment, null,
31
- React.createElement(ExpressionEditor, { type: 'boolean', module: NamedQueryModuleId, value: this.state.expression, onChange: this.handleCustomExpressionChange, initialData: initialData, columns: this.props.api.columnApi.getQueryableColumns(), namedQueries: this.props.api.namedQueryApi.getNamedQueries(), api: this.props.api }),
31
+ React.createElement(ExpressionEditor, { type: 'boolean', module: NamedQueryModuleId, value: this.state.expression, onChange: this.handleCustomExpressionChange, initialData: initialData, columns: this.props.api.columnApi.getQueryableColumns(), fields: this.props.api.expressionApi.internalApi.getAvailableFields(), namedQueries: this.props.api.namedQueryApi.getNamedQueries(), api: this.props.api }),
32
32
  ' ',
33
33
  React.createElement(Flex, { flexDirection: "row", padding: 1, marginBottom: 2, marginLeft: 1, alignItems: "center", "data-name": "expression-wizard-save-option" },
34
34
  React.createElement(CheckBox, { marginLeft: 2, disabled: !this.isValidExpression(), marginBottom: 2, checked: this.state.saveToNamedQueries, onChange: (checked) => this.setState({
@@ -107,8 +107,8 @@ class FilterFormComponent extends React.Component {
107
107
  }
108
108
  }
109
109
  async loadPermittedValues(filter = '') {
110
- const { values: distinctColumnValues, suppressClientSideFilter } = await runIfNotResolvedIn(this.props.api.gridApi.internalApi.getDistinctFilterDisplayValuesForColumn(this.props.currentColumn.columnId, filter, this.props.api.optionsApi.getColumnFilterOptions().valuesFilterOptions
111
- .showDistinctFilteredValuesOnly), () => this._isMounted && this.setState({ isDistinctColumnValuesLoading: true }));
110
+ const { values: distinctColumnValues, suppressClientSideFilter } = await runIfNotResolvedIn(this.props.api.gridApi.internalApi.getDistinctFilterDisplayValuesForColumnForFiltersUI(this.props.currentColumn.columnId, filter, this.props.api.optionsApi.getColumnFilterOptions().valuesFilterOptions
111
+ .showCurrentlyFilteredValuesOnly), () => this._isMounted && this.setState({ isDistinctColumnValuesLoading: true }));
112
112
  if (this._isMounted) {
113
113
  this.setState({
114
114
  distinctColumnValues,
@@ -41,7 +41,8 @@ export const ListBoxFilterForm = (props) => {
41
41
  setUiSelectedColumnValues([...UiSelectedColumnValues, item]);
42
42
  }
43
43
  };
44
- const columnValuesItemsElements = props.columnDistinctValues.map((distinctValue, index) => {
44
+ const permittedValuesOptions = props.columnDistinctValues;
45
+ const columnValuesItemsElements = permittedValuesOptions.map((distinctValue, index) => {
45
46
  let isActive = UiSelectedColumnValues.indexOf(distinctValue.value) >= 0;
46
47
  // special case for date objects, need to check against string values
47
48
  if (!isActive && distinctValue.value && distinctValue.value instanceof Date) {
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { ColumnFilter } from '../../../PredefinedConfig/Common/ColumnFilter';
3
2
  import { AdaptableApi } from '../../../Api/AdaptableApi';
4
3
  import { AdaptableColumn } from '../../../PredefinedConfig/Common/AdaptableColumn';
4
+ import { ColumnFilter } from '../../../PredefinedConfig/Common/ColumnFilter';
5
5
  import { ValuesFilterOptions } from '../../../types';
6
6
  export interface QuickFilterValuesProps {
7
7
  api: AdaptableApi;
@@ -1,12 +1,12 @@
1
+ import { isSameDay } from 'date-fns';
2
+ import { Resizable } from 're-resizable';
1
3
  import * as React from 'react';
2
4
  import { useCallback, useEffect, useRef } from 'react';
5
+ import { Flex } from 'rebass';
3
6
  import ArrayExtensions from '../../../Utilities/Extensions/ArrayExtensions';
4
- import SimpleButton from '../../../components/SimpleButton';
5
- import { isSameDay } from 'date-fns';
6
7
  import OverlayTrigger from '../../../components/OverlayTrigger';
7
- import { Flex } from 'rebass';
8
+ import SimpleButton from '../../../components/SimpleButton';
8
9
  import { ListBoxFilterForm } from './ListBoxFilterForm';
9
- import { Resizable } from 're-resizable';
10
10
  export const QuickFilterValues = (props) => {
11
11
  const { api } = props;
12
12
  const currentOverlayVisible = useRef(false);
@@ -48,7 +48,7 @@ export const QuickFilterValues = (props) => {
48
48
  let ignore = false;
49
49
  setIsDistinctColumnValuesLoading(true);
50
50
  api.gridApi.internalApi
51
- .getDistinctFilterDisplayValuesForColumn(props.columnFilter.ColumnId, textFilterValue, api.optionsApi.getColumnFilterOptions().valuesFilterOptions.showDistinctFilteredValuesOnly)
51
+ .getDistinctFilterDisplayValuesForColumnForFiltersUI(props.columnFilter.ColumnId, textFilterValue, api.optionsApi.getColumnFilterOptions().valuesFilterOptions.showCurrentlyFilteredValuesOnly)
52
52
  .then((distinctFilterDisplayValues) => {
53
53
  if (ignore) {
54
54
  return;
@@ -79,10 +79,14 @@ export const AdaptablePopupModuleView = (props) => {
79
79
  newButton = (React.createElement(ButtonNew, { onClick: () => handleOpenEditPopup(), tooltip: toolTipText, accessLevel: props.accessLevel }));
80
80
  }
81
81
  let suspendButton = null;
82
- if (items.length &&
82
+ const editableObjects = (items).filter(item => !item.abObject.IsReadOnly);
83
+ if (editableObjects.length &&
83
84
  (moduleViewProperties === null || moduleViewProperties === void 0 ? void 0 : moduleViewProperties.getSuspendAllAction) &&
84
85
  (moduleViewProperties === null || moduleViewProperties === void 0 ? void 0 : moduleViewProperties.getUnSuspendAllAction)) {
85
- const isAtLeastOneAbObjectActive = items.some((item) => { var _a; return !((_a = item.abObject) === null || _a === void 0 ? void 0 : _a.IsSuspended); });
86
+ const isAtLeastOneAbObjectActive = editableObjects.some((item) => {
87
+ var _a;
88
+ return !((_a = item.abObject) === null || _a === void 0 ? void 0 : _a.IsSuspended);
89
+ });
86
90
  const handleSuspendUnsuspendAll = () => {
87
91
  if (isAtLeastOneAbObjectActive) {
88
92
  const suspendAllAction = moduleViewProperties.getSuspendAllAction();
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ import { SelectProps } from '../../../components/Select';
3
+ import { AdaptableColumnDataType } from '../../../types';
4
+ interface FieldSelectorProps {
5
+ value: string;
6
+ onChange: (fieldExp: string) => void;
7
+ type?: AdaptableColumnDataType;
8
+ disabled?: boolean;
9
+ menuPosition?: SelectProps<any>['menuPosition'];
10
+ placeholder?: string;
11
+ }
12
+ export declare const FieldSelector: React.FunctionComponent<FieldSelectorProps>;
13
+ export {};
@@ -0,0 +1,21 @@
1
+ import * as React from 'react';
2
+ import { Select } from '../../../components/Select';
3
+ import { useAdaptable } from '../../AdaptableContext';
4
+ export const FieldSelector = (props) => {
5
+ var _a;
6
+ const { api } = useAdaptable();
7
+ const fields = React.useMemo(() => {
8
+ return api.expressionApi.internalApi.getFieldsOfType(props.type);
9
+ }, []);
10
+ const options = fields.map((field) => {
11
+ var _a;
12
+ return ({
13
+ label: (_a = field.label) !== null && _a !== void 0 ? _a : field.name,
14
+ value: field.name,
15
+ });
16
+ });
17
+ return (React.createElement(React.Fragment, null,
18
+ React.createElement(Select, { "data-name": "column-selector", disabled: props.disabled, isMulti: false, menuPosition: props.menuPosition, value: props.value || undefined, placeholder: (_a = props.placeholder) !== null && _a !== void 0 ? _a : 'Select Field', onChange: (fieldValue) => {
19
+ props.onChange(fieldValue);
20
+ }, options: options })));
21
+ };
@@ -7,7 +7,7 @@ export const PermittedValuesSelector = function (props) {
7
7
  const [isLoading, setIsLoading] = React.useState(true);
8
8
  const [options, setOptions] = React.useState([]);
9
9
  const [filter, setFilter] = React.useState('');
10
- const columnType = React.useMemo(() => {
10
+ const dataType = React.useMemo(() => {
11
11
  return adaptable.api.columnApi.getColumnDataTypeForColumnId(props.columnId);
12
12
  }, [props.columnId]);
13
13
  React.useEffect(() => {
@@ -18,17 +18,21 @@ export const PermittedValuesSelector = function (props) {
18
18
  setIsLoading(true);
19
19
  (async () => {
20
20
  const { values: distinctColumnValues } = await runIfNotResolvedIn(adaptable.api.gridApi.internalApi.getDistinctFilterDisplayValuesForColumn(props.columnId, filter, adaptable.api.optionsApi.getColumnFilterOptions().valuesFilterOptions
21
- .showDistinctFilteredValuesOnly), () => {
21
+ .showCurrentlyFilteredValuesOnly), () => {
22
22
  setIsLoading(true);
23
23
  });
24
24
  setIsLoading(false);
25
25
  setOptions(distinctColumnValues);
26
26
  })();
27
27
  }, [props.columnId, filter]);
28
- const isCreatable = props.allowNewValues && ['String', 'Number'].includes(columnType);
28
+ const isCreatable = (props.allowNewValues && !dataType) || ['String', 'Number'].includes(dataType);
29
29
  const handleSingleValueChange = (value) => {
30
30
  if (isCreatable) {
31
- if (columnType === 'Number') {
31
+ // try to convert to correct type, when there is not type, e.g. field
32
+ if (!dataType && typeof value === 'string' && !isNaN(parseFloat(value))) {
33
+ props.onChange(parseFloat(value));
34
+ }
35
+ else if (dataType === 'Number') {
32
36
  let num = parseFloat(value);
33
37
  num = isNaN(num) ? null : num;
34
38
  props.onChange(num);
@@ -43,7 +47,7 @@ export const PermittedValuesSelector = function (props) {
43
47
  };
44
48
  const handleMultiValueChange = (values) => {
45
49
  if (isCreatable) {
46
- if (columnType === 'Number') {
50
+ if (dataType === 'Number') {
47
51
  const nums = values.map((v) => parseFloat(v)).filter((v) => !isNaN(v));
48
52
  props.onChange(nums);
49
53
  }
@@ -66,5 +66,5 @@ export const ReportRowsWizardSection = (props) => {
66
66
  props.onChange(Object.assign(Object.assign({}, data), { Query: {
67
67
  BooleanExpression,
68
68
  } }));
69
- }, initialData: initialData, columns: api.columnApi.getQueryableColumns(), namedQueries: api.namedQueryApi.getNamedQueries(), api: api })))));
69
+ }, initialData: initialData, columns: api.columnApi.getQueryableColumns(), fields: api.expressionApi.internalApi.getAvailableFields(), namedQueries: api.namedQueryApi.getNamedQueries(), api: api })))));
70
70
  };
@@ -5,7 +5,7 @@ export function FormatColumnRuleWizardSection(props) {
5
5
  const { data, api, moduleInfo } = useOnePageAdaptableWizardContext();
6
6
  return (React.createElement(EntityRulesEditor, { module: moduleInfo.ModuleName, defaultPredicateId: props.defaultPredicateId,
7
7
  // TODO see what is this
8
- predicateDefs: api.formatColumnApi.internalApi.getFormatColumnDefsForScope(data.Scope), getPredicateDefsForColId: (colId) => api.formatColumnApi.internalApi.getFormatColumnDefsForScope({ ColumnIds: [colId] }), showNoRule: true, showBoolean: true, showAggregation: false, showObservable: false, showPredicate: !api.columnScopeApi.scopeIsAll(data.Scope), data: data, onChange: (formatColumn) => props.onChange(formatColumn), descriptions: {
8
+ predicateDefs: api.formatColumnApi.internalApi.getFormatColumnDefsForScope(data.Scope), getPredicateDefsForColId: (colId) => api.formatColumnApi.internalApi.getFormatColumnDefsForScope({ ColumnIds: [colId] }), showNoRule: true, showBoolean: true, showAggregation: false, showObservable: false, showQueryBuilder: true, showPredicate: !api.columnScopeApi.scopeIsAll(data.Scope), data: data, onChange: (formatColumn) => props.onChange(formatColumn), descriptions: {
9
9
  selectPredicate: 'Create a Format Column Rule - to be applied when data changes',
10
10
  useBooleanQuery: (React.createElement(React.Fragment, null,
11
11
  "Use an BooleanQuery if ",
@@ -88,7 +88,7 @@ export const GridFilterExpressionEditor = (props) => {
88
88
  },
89
89
  } },
90
90
  React.createElement(Flex, { height: "100%", flexDirection: "column" },
91
- React.createElement(ExpressionEditor, Object.assign({}, expressionEditorProps, { type: 'boolean', module: GridFilterModuleId, value: expression, onChange: (expression) => setExpression(expression), initialData: initialData, columns: api.columnApi.getQueryableColumns(), namedQueries: api.namedQueryApi.getNamedQueries(), api: api })),
91
+ React.createElement(ExpressionEditor, Object.assign({}, expressionEditorProps, { type: 'boolean', module: GridFilterModuleId, value: expression, onChange: (expression) => setExpression(expression), initialData: initialData, columns: api.columnApi.getQueryableColumns(), fields: api.expressionApi.internalApi.getAvailableFields(), namedQueries: api.namedQueryApi.getNamedQueries(), api: api })),
92
92
  React.createElement(Flex, { flexDirection: "row", padding: 1, alignItems: "center" },
93
93
  props.onDismiss && (React.createElement(SimpleButton, { margin: 1, variant: "text", "data-name": "action-close", onClick: () => {
94
94
  props.onDismiss();
@@ -8,6 +8,7 @@ import { ExpressionEditor } from '../../../../components/ExpressionEditor';
8
8
  import { GridFilterModuleId } from '../../../../Utilities/Constants/ModuleConstants';
9
9
  import StringExtensions from '../../../../Utilities/Extensions/StringExtensions';
10
10
  import { useGridFilterOptionsForExpressionEditorProps } from '../../../GridFilter/useGridFilterOptionsForExpressionEditor';
11
+ import Panel from '../../../../components/Panel';
11
12
  export const isGridFiltersValid = (layout, api) => {
12
13
  var _a;
13
14
  const expression = (_a = layout === null || layout === void 0 ? void 0 : layout.GridFilter) === null || _a === void 0 ? void 0 : _a.Expression;
@@ -30,8 +31,9 @@ export const GridFilterSection = (props) => {
30
31
  const expressionEditorProps = useGridFilterOptionsForExpressionEditorProps();
31
32
  const expressionEditorContent = (React.createElement(ExpressionEditor, Object.assign({}, expressionEditorProps, { allowSaveNamedQuery: false, type: 'boolean', module: GridFilterModuleId, value: (_b = (_a = layout === null || layout === void 0 ? void 0 : layout.GridFilter) === null || _a === void 0 ? void 0 : _a.Expression) !== null && _b !== void 0 ? _b : '', onChange: (expression) => {
32
33
  props.onChange(Object.assign(Object.assign({}, layout), { GridFilter: Object.assign(Object.assign({}, layout.GridFilter), { Expression: expression }) }));
33
- }, initialData: initialData, columns: api.columnApi.getQueryableColumns(), namedQueries: api.namedQueryApi.getNamedQueries(), api: api })));
34
+ }, initialData: initialData, columns: api.columnApi.getQueryableColumns(), fields: api.expressionApi.internalApi.getAvailableFields(), namedQueries: api.namedQueryApi.getNamedQueries(), api: api })));
34
35
  return (React.createElement(Tabs, { style: { height: '100%' } },
35
36
  React.createElement(Tabs.Tab, null, "Grid Filters"),
36
- React.createElement(Tabs.Content, null, expressionEditorContent)));
37
+ React.createElement(Tabs.Content, null,
38
+ React.createElement(Panel, null, expressionEditorContent))));
37
39
  };