@adaptabletools/adaptable 18.0.12 → 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 (124) 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/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 +36 -12
  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 +79 -0
  28. package/src/Api/Internal/Fdc3InternalApi.d.ts +8 -10
  29. package/src/Api/Internal/Fdc3InternalApi.js +6 -10
  30. package/src/PredefinedConfig/Common/AdaptableField.d.ts +18 -0
  31. package/src/PredefinedConfig/Common/AdaptableField.js +1 -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 +43 -31
  36. package/src/PredefinedConfig/Common/Fdc3Intent.d.ts +6 -89
  37. package/src/PredefinedConfig/Common/Fdc3Intent.js +26 -73
  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 +1 -1
  46. package/src/Utilities/Services/Fdc3Service.d.ts +1 -1
  47. package/src/Utilities/Services/Fdc3Service.js +2 -2
  48. package/src/Utilities/Services/QueryLanguageService.d.ts +8 -4
  49. package/src/Utilities/Services/QueryLanguageService.js +105 -6
  50. package/src/Utilities/Services/ReportService.js +8 -5
  51. package/src/Utilities/Services/RowSummaryService.js +3 -1
  52. package/src/Utilities/divideBy100.d.ts +1 -0
  53. package/src/Utilities/divideBy100.js +30 -0
  54. package/src/Utilities/times100.d.ts +1 -0
  55. package/src/Utilities/times100.js +23 -0
  56. package/src/View/Alert/Wizard/AlertMessageWizardSection.js +1 -1
  57. package/src/View/Alert/Wizard/AlertNotificationWizardSection.js +2 -2
  58. package/src/View/Alert/Wizard/AlertScopeWizardSection.js +2 -1
  59. package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +1 -1
  60. package/src/View/Components/EntityRulesEditor/index.d.ts +1 -0
  61. package/src/View/Components/EntityRulesEditor/index.js +11 -7
  62. package/src/View/Components/ExpressionWizard.js +1 -1
  63. package/src/View/Components/FilterForm/QuickFilterValues.js +28 -4
  64. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +6 -2
  65. package/src/View/Components/Selectors/FieldSelector.d.ts +13 -0
  66. package/src/View/Components/Selectors/FieldSelector.js +21 -0
  67. package/src/View/Components/Selectors/PermittedValuesSelector.js +8 -4
  68. package/src/View/Export/Wizard/ReportRowsWizardSection.js +1 -1
  69. package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +1 -1
  70. package/src/View/GridFilter/GridFilterExpressionEditor.js +1 -1
  71. package/src/View/Layout/Wizard/sections/GridFilterSection.js +4 -2
  72. package/src/View/Layout/Wizard/sections/RowSummarySection.js +7 -1
  73. package/src/View/NamedQuery/Wizard/NamedQueryExpressionWizardSection.js +1 -1
  74. package/src/View/Wizard/OnePageAdaptableWizard.js +3 -2
  75. package/src/agGrid/AdaptableAgGrid.d.ts +1 -2
  76. package/src/agGrid/AdaptableAgGrid.js +64 -33
  77. package/src/agGrid/AgGridColumnAdapter.d.ts +3 -0
  78. package/src/agGrid/AgGridColumnAdapter.js +22 -0
  79. package/src/agGrid/AgGridMenuAdapter.js +1 -1
  80. package/src/agGrid/editors/AdaptableDateEditor/InternalAdaptableDateEditor.d.ts +0 -1
  81. package/src/agGrid/editors/AdaptableDateEditor/InternalAdaptableDateEditor.js +0 -2
  82. package/src/agGrid/editors/AdaptableDateEditor/index.d.ts +4 -16
  83. package/src/agGrid/editors/AdaptableDateEditor/index.js +5 -18
  84. package/src/agGrid/editors/AdaptableNumberEditor/InternalAdaptableNumberEditor.js +6 -1
  85. package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +4 -3
  86. package/src/agGrid/editors/AdaptableNumberEditor/index.js +5 -2
  87. package/src/agGrid/editors/AdaptablePercentageEditor/InternalAdaptablePercentageEditor.d.ts +23 -0
  88. package/src/agGrid/editors/AdaptablePercentageEditor/InternalAdaptablePercentageEditor.js +80 -0
  89. package/src/agGrid/editors/AdaptablePercentageEditor/index.d.ts +47 -0
  90. package/src/agGrid/editors/AdaptablePercentageEditor/index.js +148 -0
  91. package/src/components/Accordion.js +1 -1
  92. package/src/components/Datepicker/DatepickerContext.d.ts +0 -2
  93. package/src/components/Datepicker/index.js +3 -4
  94. package/src/components/ExpressionEditor/DataTableEditor.d.ts +17 -0
  95. package/src/components/ExpressionEditor/DataTableEditor.js +63 -0
  96. package/src/components/ExpressionEditor/EditorInput.js +22 -9
  97. package/src/components/ExpressionEditor/NamedQueryEditor.d.ts +5 -0
  98. package/src/components/ExpressionEditor/NamedQueryEditor.js +30 -0
  99. package/src/components/ExpressionEditor/QueryBuilder/QueryBuilder.d.ts +10 -0
  100. package/src/components/ExpressionEditor/QueryBuilder/QueryBuilder.js +7 -4
  101. package/src/components/ExpressionEditor/QueryBuilder/QueryBuilderInputs.d.ts +3 -2
  102. package/src/components/ExpressionEditor/QueryBuilder/QueryBuilderInputs.js +71 -13
  103. package/src/components/ExpressionEditor/QueryBuilder/QueryPredicateBuilder.js +30 -22
  104. package/src/components/ExpressionEditor/QueryBuilder/utils.d.ts +9 -1
  105. package/src/components/ExpressionEditor/QueryBuilder/utils.js +41 -3
  106. package/src/components/ExpressionEditor/index.d.ts +3 -1
  107. package/src/components/ExpressionEditor/index.js +66 -91
  108. package/src/components/Input/NumberInput.d.ts +2 -1
  109. package/src/components/Input/NumberInput.js +7 -4
  110. package/src/components/OverlayTrigger/index.js +10 -6
  111. package/src/components/icons/column-outline.d.ts +3 -0
  112. package/src/components/icons/column-outline.js +4 -0
  113. package/src/components/icons/index.js +5 -1
  114. package/src/components/icons/sync.d.ts +3 -0
  115. package/src/components/icons/sync.js +4 -0
  116. package/src/env.js +2 -2
  117. package/src/metamodel/adaptable.metamodel.d.ts +78 -200
  118. package/src/metamodel/adaptable.metamodel.js +1 -1
  119. package/src/parser/src/predicate/mapExpressionToQlPredicate.d.ts +1 -0
  120. package/src/parser/src/predicate/mapExpressionToQlPredicate.js +11 -2
  121. package/src/parser/src/predicate/mapQlPredicateToExpression.js +4 -1
  122. package/src/parser/src/types.d.ts +101 -1
  123. package/src/types.d.ts +9 -7
  124. package/tsconfig.esm.tsbuildinfo +1 -1
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { Draggable, Droppable } from 'react-beautiful-dnd';
3
3
  import { Box, Flex } from 'rebass';
4
- import { isQlLogicalOperator } from '../../../parser/src/predicate';
4
+ import { isArgumentColumnOrField, isQlLogicalOperator, } from '../../../parser/src/predicate';
5
5
  import { mapColumnDataTypeToExpressionFunctionType } from '../../../Utilities/adaptableQlUtils';
6
6
  import { booleanExpressionFunctions } from '../../../Utilities/ExpressionFunctions/booleanExpressionFunctions';
7
7
  import { useAdaptable } from '../../../View/AdaptableContext';
@@ -9,8 +9,8 @@ import DropdownButton from '../../DropdownButton';
9
9
  import ErrorBox from '../../ErrorBox';
10
10
  import { Icon } from '../../icons';
11
11
  import SimpleButton from '../../SimpleButton';
12
- import { CombinatorSelector, ExpressionSelector, PrimiteValueInput, PrimitiveColumnSelector, PrimitiveMultiValueInput, } from './QueryBuilderInputs';
13
- import { getOperatorMatchingInputs as getFunctionMatchingInputTypes } from './utils';
12
+ import { CombinatorSelector, ExpressionSelector, PrimiteValueInput, PrimitiveColumnOrFieldSelector, PrimitiveMultiValueInput, } from './QueryBuilderInputs';
13
+ import { getOperatorMatchingInputs as getFunctionMatchingInputTypes, mapExpressionToFieldValue, } from './utils';
14
14
  const ITEM_HEIGHT = 40;
15
15
  const BASE_CLASS_NAME = 'ab-QueryBuilder-predicate-editor';
16
16
  const Handle = (props) => (React.createElement(Flex, Object.assign({ className: `${BASE_CLASS_NAME}__handle`, height: ITEM_HEIGHT, alignItems: "center", mr: 1 }, props),
@@ -18,8 +18,8 @@ const Handle = (props) => (React.createElement(Flex, Object.assign({ className:
18
18
  const QueryPredicateButtons = (props) => {
19
19
  return (React.createElement(React.Fragment, null,
20
20
  !props.hideAdd && (React.createElement(DropdownButton, { listMinWidth: 150, columns: ['label'], items: [
21
- { label: 'Add Column Condition', onClick: () => props.onNewPredicate('filter') },
22
- { label: 'Add AND / OR Group', onClick: () => props.onNewPredicate('group') },
21
+ { label: 'Condition', onClick: () => props.onNewPredicate('filter') },
22
+ { label: 'AND / OR Group', onClick: () => props.onNewPredicate('group') },
23
23
  ], variant: "text" },
24
24
  React.createElement(Icon, { name: "plus" }))),
25
25
  !props.hideDelete && (React.createElement(SimpleButton, { icon: "delete", variant: "text", onClick: () => {
@@ -96,22 +96,31 @@ const PrimitiveFunctionEditor = (props) => {
96
96
  var _a;
97
97
  // [handle] [column] [operator-dropdown] [...args] [delete-button] [plus-button]
98
98
  const adaptable = useAdaptable();
99
- const [columnExpression, ...restOfArgs] = props.predicate.args;
100
- const col = columnExpression;
101
- let columnId = null;
102
- let columnDataType = null;
99
+ const [columnOrFieldExpression, ...restOfArgs] = props.predicate.args;
100
+ const columnOrField = columnOrFieldExpression;
101
+ let columnOrFieldId = null;
102
+ let columnOrFieldDataType = null;
103
103
  let columnInputDataType = null;
104
104
  let functionInputInputDataTypes = null;
105
105
  // Thsese are the type of inputs ommiting the column
106
106
  // [[column-data-type], number, number]
107
107
  let restOfFunctionInputDataTypes = [];
108
- if (col) {
109
- if (typeof col !== 'string' || !col.includes('[')) {
110
- return React.createElement(ErrorBox, null, "Expression must start with a column!");
108
+ if (columnOrField) {
109
+ if (!isArgumentColumnOrField(columnOrField)) {
110
+ return React.createElement(ErrorBox, null, "Expression must start with a column or a filed!");
111
111
  }
112
- columnId = col.replace(/[\[\]]/g, '');
113
- columnDataType = adaptable.api.columnApi.getColumnDataTypeForColumnId(columnId);
114
- columnInputDataType = mapColumnDataTypeToExpressionFunctionType(columnDataType);
112
+ if (columnOrField.includes('FIELD')) {
113
+ // we let the full expression so we can difirienciate between column and field
114
+ columnOrFieldId = columnOrField;
115
+ const fieldValue = mapExpressionToFieldValue(columnOrField);
116
+ columnOrFieldDataType = adaptable.api.expressionApi.internalApi.getFieldType(fieldValue);
117
+ }
118
+ else if (columnOrField.includes('[')) {
119
+ columnOrFieldId = columnOrField;
120
+ const columnId = columnOrField.replace(/[\[\]]/g, '');
121
+ columnOrFieldDataType = adaptable.api.columnApi.getColumnDataTypeForColumnId(columnId);
122
+ }
123
+ columnInputDataType = mapColumnDataTypeToExpressionFunctionType(columnOrFieldDataType);
115
124
  functionInputInputDataTypes = (_a = booleanExpressionFunctions[props.predicate.operator]) === null || _a === void 0 ? void 0 : _a.inputs;
116
125
  restOfFunctionInputDataTypes = functionInputInputDataTypes
117
126
  ? getFunctionMatchingInputTypes(columnInputDataType, functionInputInputDataTypes)
@@ -128,12 +137,12 @@ const PrimitiveFunctionEditor = (props) => {
128
137
  React.createElement(Handle, Object.assign({}, provided.dragHandleProps)),
129
138
  React.createElement(Flex, { alignItems: "center", height: ITEM_HEIGHT },
130
139
  React.createElement(Box, { mr: 2 },
131
- React.createElement(PrimitiveColumnSelector, { onChange: (colId) => {
132
- props.onChange(Object.assign(Object.assign({}, props.predicate), { args: [colId], operator: null }));
133
- }, columnId: columnId })),
134
- columnId && columnDataType && (React.createElement(ExpressionSelector, { dataType: columnDataType, onExpressionChange: (operator) => {
140
+ React.createElement(PrimitiveColumnOrFieldSelector, { onChange: (colOrField) => {
141
+ props.onChange(Object.assign(Object.assign({}, props.predicate), { args: [colOrField], operator: null }));
142
+ }, fieldOrColumn: columnOrFieldId })),
143
+ columnOrFieldId && columnOrFieldDataType && (React.createElement(ExpressionSelector, { dataType: columnOrFieldDataType, onExpressionChange: (operator) => {
135
144
  let args = [props.predicate.args[0]];
136
- if (columnDataType === 'Boolean' && operator !== 'NOT') {
145
+ if (columnOrFieldDataType === 'Boolean' && operator !== 'NOT') {
137
146
  args = [props.predicate.args[0], 'TRUE'];
138
147
  }
139
148
  props.onChange(Object.assign(Object.assign({}, props.predicate), { operator,
@@ -142,10 +151,9 @@ const PrimitiveFunctionEditor = (props) => {
142
151
  }, value: props.predicate.operator })),
143
152
  React.createElement(Flex, { flex: 1, ml: 2 }, restOfFunctionInputDataTypes.map((type, index) => {
144
153
  var _a;
145
- let value = restOfArgs[index];
146
154
  const commonProps = {
147
155
  key: type + index,
148
- lefthandColumnIdParam: columnId,
156
+ lefthandColumnIdParam: columnOrFieldId,
149
157
  inputType: type,
150
158
  };
151
159
  if (type.includes('[]')) {
@@ -5,4 +5,12 @@ export declare const reorder: (predicate: QlPredicate, from: string, to: string)
5
5
  export declare const mapExpressionFunctionTypeToColumnDataType: (type: ExpressionFunctionInputType) => AdaptableColumnDataType;
6
6
  export declare const getOperatorMatchingInputs: (columnType: ExpressionFunctionInputType, inputs: ExpressionFunctionInputType[] | Array<ExpressionFunctionInputType>[]) => ExpressionFunctionInputType[];
7
7
  export declare const getFunctionsForColumnType: (dataType: AdaptableColumnDataType, availableBooleanFunctions: BooleanFunctionName[]) => BooleanFunctionName[];
8
- export declare const getUnsuportedExpressionFromQlPredicate: (predicate: QlPredicate | QlPredicateError) => string;
8
+ export declare const getUnsuportedExpressionFromQlPredicate: (predicate: QlPredicate | QlPredicateError, context: {
9
+ supportedFields: {
10
+ value: string;
11
+ }[];
12
+ }) => string;
13
+ export declare const mapFieldValueToExpression: (field: string) => string;
14
+ export declare const mapExpressionToFieldValue: (expression: string) => string;
15
+ export declare const mapColumnExpressionToColumnId: (expression: string) => string;
16
+ export declare const isFieldValue: (expression: string) => boolean;
@@ -45,7 +45,7 @@ export const mapExpressionFunctionTypeToColumnDataType = (type) => {
45
45
  export const getOperatorMatchingInputs = (columnType, inputs) => {
46
46
  if (Array.isArray(inputs[0])) {
47
47
  const matchingInput = inputs.find((input) => input[0] === columnType);
48
- const [_, ...restOfArgs] = matchingInput;
48
+ const [_, ...restOfArgs] = matchingInput !== null && matchingInput !== void 0 ? matchingInput : [];
49
49
  return restOfArgs;
50
50
  }
51
51
  const [_, ...restOfArgs] = inputs;
@@ -69,10 +69,20 @@ export const getFunctionsForColumnType = (dataType, availableBooleanFunctions) =
69
69
  return (matchingInputTypes === null || matchingInputTypes === void 0 ? void 0 : matchingInputTypes[0]) === columnType;
70
70
  });
71
71
  };
72
- export const getUnsuportedExpressionFromQlPredicate = (predicate) => {
72
+ export const getUnsuportedExpressionFromQlPredicate = (predicate, context) => {
73
+ var _a;
73
74
  if (!predicate) {
74
75
  return null;
75
76
  }
77
+ if (typeof predicate === 'string' && isFieldValue(predicate)) {
78
+ const field = mapExpressionToFieldValue(predicate);
79
+ if (!((_a = context.supportedFields) === null || _a === void 0 ? void 0 : _a.some((field) => (field === null || field === void 0 ? void 0 : field.value) === mapExpressionToFieldValue(predicate)))) {
80
+ return `Expression uses an unregistered field: "${field}"`;
81
+ }
82
+ else {
83
+ return null;
84
+ }
85
+ }
76
86
  if (typeof predicate === 'object' && 'errorMessage' in predicate) {
77
87
  return null;
78
88
  }
@@ -88,7 +98,7 @@ export const getUnsuportedExpressionFromQlPredicate = (predicate) => {
88
98
  }
89
99
  let firstInvalidArg = null;
90
100
  for (let arg of predicate.args) {
91
- firstInvalidArg = getUnsuportedExpressionFromQlPredicate(arg);
101
+ firstInvalidArg = getUnsuportedExpressionFromQlPredicate(arg, context);
92
102
  if (firstInvalidArg) {
93
103
  break;
94
104
  }
@@ -98,3 +108,31 @@ export const getUnsuportedExpressionFromQlPredicate = (predicate) => {
98
108
  }
99
109
  return null;
100
110
  };
111
+ export const mapFieldValueToExpression = (field) => `FIELD('${field}')`;
112
+ export const mapExpressionToFieldValue = (expression) => {
113
+ var _a;
114
+ if (!expression) {
115
+ return '';
116
+ }
117
+ try {
118
+ return (_a = expression.match(/FIELD\(['"](.+)['"]\)/)) === null || _a === void 0 ? void 0 : _a[1];
119
+ }
120
+ catch (e) {
121
+ return '';
122
+ }
123
+ };
124
+ export const mapColumnExpressionToColumnId = (expression) => {
125
+ var _a;
126
+ if (!expression) {
127
+ return null;
128
+ }
129
+ try {
130
+ return (_a = expression.match(/\[(.+)\]/)) === null || _a === void 0 ? void 0 : _a[1];
131
+ }
132
+ catch (e) {
133
+ return expression;
134
+ }
135
+ };
136
+ export const isFieldValue = (expression) => {
137
+ return typeof expression === 'string' && expression.includes('FIELD');
138
+ };
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { AdaptableApi, AdaptableColumn, AdaptableModule, NamedQuery } from '../../types';
2
+ import { AdaptableApi, AdaptableColumn, AdaptableField, AdaptableModule, NamedQuery } from '../../types';
3
3
  export type ExpressionEditorType = 'boolean' | 'scalar' | 'observable' | 'aggregatedBoolean' | 'aggregatedScalar' | 'cumulativeAggregatedScalar' | 'quantileAggregatedScalar';
4
4
  interface ExpressionEditorProps {
5
5
  value: string;
@@ -10,6 +10,7 @@ interface ExpressionEditorProps {
10
10
  [key: string]: any;
11
11
  };
12
12
  columns: AdaptableColumn[];
13
+ fields?: AdaptableField[];
13
14
  namedQueries: NamedQuery[];
14
15
  allowSaveNamedQuery?: boolean;
15
16
  style?: React.CSSProperties;
@@ -18,5 +19,6 @@ interface ExpressionEditorProps {
18
19
  showQueryBuilder?: boolean;
19
20
  showExpressionEditor?: boolean;
20
21
  }
22
+ export declare const baseClassName = "ab-ExpressionEditor";
21
23
  export declare function ExpressionEditor(props: ExpressionEditorProps): JSX.Element;
22
24
  export {};
@@ -1,36 +1,29 @@
1
1
  import * as React from 'react';
2
- import { useState, useRef } from 'react';
2
+ import { useRef, useState } from 'react';
3
3
  import { Box, Flex, Text } from 'rebass';
4
- import { CheckBox } from '../CheckBox';
5
- import FormLayout, { FormRow } from '../FormLayout';
6
- import HelpBlock from '../HelpBlock';
7
- import Input from '../Input';
8
- import EditorButton from './EditorButton';
9
- import AdaptableInput from '../../View/Components/AdaptableInput';
10
- import Radio from '../Radio';
11
- import ArrayExtensions from '../../Utilities/Extensions/ArrayExtensions';
12
- import EditorInputWithWhereClause from './EditorInputWithWhereClause';
13
- import EditorInput from './EditorInput';
14
- import { ExpressionEditorContext } from './EditorContext';
15
- import { ExpressionFunctionDocumentation } from './ExpressionFunctionDocumentation';
16
4
  import { AggregatedBooleanQueryDocsLink, AggregatedScalarQueryDocsLink, BooleanQueryDocsLink, CumulativeAggregatedScalarQueryDocsLink, ObservableQueryDocsLink, QuantileAggregatedScalarQueryDocsLink, ScalarQueryDocsLink, } from '../../Utilities/Constants/DocumentationLinkConstants';
5
+ import { NamedQueryModuleId } from '../../Utilities/Constants/ModuleConstants';
6
+ import ArrayExtensions from '../../Utilities/Extensions/ArrayExtensions';
17
7
  import StringExtensions from '../../Utilities/Extensions/StringExtensions';
8
+ import AdaptableInput from '../../View/Components/AdaptableInput';
18
9
  import { ButtonInfo } from '../../View/Components/Buttons/ButtonInfo';
10
+ import { CheckBox } from '../CheckBox';
19
11
  import { CodeBlock } from '../CodeBlock';
20
- import { useNamedQueryContext } from './NamedQueryContext';
21
- import { NamedQueryModuleId } from '../../Utilities/Constants/ModuleConstants';
22
- import { isValueValidDate } from '../../Utilities/Helpers/DateHelper';
23
- import { AdaptableFormControlTextClear } from '../../View/Components/Forms/AdaptableFormControlTextClear';
12
+ import HelpBlock from '../HelpBlock';
13
+ import Panel from '../Panel';
24
14
  import { Tabs } from '../Tabs';
15
+ import { DataTableEditor } from './DataTableEditor';
16
+ import { ExpressionEditorContext } from './EditorContext';
17
+ import EditorInput from './EditorInput';
18
+ import EditorInputWithWhereClause from './EditorInputWithWhereClause';
19
+ import { ExpressionFunctionDocumentation } from './ExpressionFunctionDocumentation';
20
+ import { useNamedQueryContext } from './NamedQueryContext';
21
+ import { NamedQueryEditor } from './NamedQueryEditor';
25
22
  import { QueryBuilder } from './QueryBuilder';
23
+ export const baseClassName = `ab-ExpressionEditor`;
26
24
  export function ExpressionEditor(props) {
27
25
  var _a, _b, _c;
28
26
  const { type, module } = props;
29
- const [data, setData] = useState(props.initialData);
30
- const [showColumnIds, setShowColumnIds] = useState(false);
31
- const [inlineQuery, setInlineQuery] = useState(false);
32
- const [showNamedQueries, setShowNamedQueries] = useState(false);
33
- const baseClassName = `ab-ExpressionEditor`;
34
27
  const [selectedFunction, setSelectedFunction] = useState(null);
35
28
  const [expressionText, setExpressionText] = useState(props.value);
36
29
  const { namedQuery, setNamedQuery } = useNamedQueryContext();
@@ -39,80 +32,20 @@ export function ExpressionEditor(props) {
39
32
  const editorInput = type === 'observable' || type === 'aggregatedBoolean' ? (React.createElement(EditorInputWithWhereClause, { type: type, module: module, value: props.value, onChange: (value) => {
40
33
  setExpressionText(value);
41
34
  props.onChange(value);
42
- }, testData: data, api: props.api })) : (
35
+ }, testData: props.initialData, api: props.api })) : (
43
36
  // 'boolean','scalar','aggregatedScalar'/'cumulativeAggregatedScalar'/'quantileAggregatedScalar'
44
37
  (React.createElement(
45
38
  EditorInput,
46
39
  { type: type, module: module, value: props.value, onChange: (value) => {
47
40
  setExpressionText(value);
48
41
  props.onChange(value);
49
- }, testData: data, isFullExpression: props.isFullExpression, api: props.api }
42
+ }, testData: props.initialData, isFullExpression: props.isFullExpression, api: props.api }
50
43
  )));
44
+ const adaptableFields = props.api.expressionApi.internalApi.getAvailableFields();
51
45
  // currently only boolean and scalar expressions support nested calculated columns (calc cols which reference other calc cols)
52
46
  const queryableColumns = type === 'scalar' || type === 'boolean' || type === 'aggregatedScalar'
53
47
  ? props.columns
54
48
  : props.columns.filter((c) => !props.api.columnApi.isCalculatedColumn(c.columnId));
55
- const getColValue = (column) => {
56
- var _a;
57
- return props.api.internalApi.getValueUsingField(data, (_a = column.field) !== null && _a !== void 0 ? _a : column.columnId);
58
- };
59
- const updateColValue = (rowData, column, newValue) => {
60
- var _a;
61
- const updatedRowData = props.api.internalApi.setValueUsingField(rowData, (_a = column.field) !== null && _a !== void 0 ? _a : column.columnId, newValue);
62
- return Object.assign({}, updatedRowData);
63
- };
64
- const getColDateValue = (column) => {
65
- const colValue = getColValue(column);
66
- return colValue && isValueValidDate(colValue)
67
- ? new Date(colValue).toISOString().substr(0, 10)
68
- : '';
69
- };
70
- const [searchInputValue, setSearchInputValue] = React.useState('');
71
- const dataTableEditor = (React.createElement(React.Fragment, null,
72
- React.createElement(Flex, { className: `${baseClassName}__columns-list`, flexDirection: "column", alignItems: "start", style: { marginTop: 2 } },
73
- React.createElement(CheckBox, { checked: showColumnIds, onChange: (checked) => setShowColumnIds(checked), style: {
74
- float: 'right',
75
- margin: 0,
76
- paddingTop: 'var(--ab-space-1)',
77
- paddingBottom: 'var(--ab-space-1)',
78
- } }, 'Show Column IDs'),
79
- React.createElement(AdaptableFormControlTextClear, { value: searchInputValue, OnTextChange: setSearchInputValue, placeholder: "Filter columns...", style: { flex: 1, marginBottom: 3 } })),
80
- React.createElement(FormLayout, { className: "ab-ExpressionEditor__columns", gridColumnGap: "var(--ab-space-1)", gridRowGap: "var(--ab-space-1)", sizes: ['auto', '100px'], style: { alignItems: 'stretch' } }, queryableColumns
81
- .filter((column) => {
82
- if (!searchInputValue) {
83
- return true;
84
- }
85
- return (column.columnId.includes(searchInputValue) ||
86
- column.friendlyName.includes(searchInputValue));
87
- })
88
- .map((column) => (React.createElement(FormRow, { key: column.columnId, label: React.createElement(EditorButton, { width: "100%", height: "100%", style: {
89
- background: 'var(--ab-color-primary)',
90
- cursor: 'grab',
91
- marginRight: 'var(--ab-space-1)',
92
- }, data: `[${column.columnId}]`, "data-name": "column", icon: "drag" },
93
- React.createElement(Flex, { flexDirection: "column", alignItems: "start" }, showColumnIds ? `[${column.columnId}]` : column.friendlyName)) }, column.dataType === 'Number' ? (React.createElement(Input, { type: "number", "data-name": "column-input", "data-value": column.columnId, value: getColValue(column), onChange: (e) => setData(updateColValue(data, column, Number(e.target.value))), width: "100%", disabled: column.readOnly })) : column.dataType === 'String' ? (React.createElement(Input, { type: "text", "data-name": "column-input", "data-value": column.columnId, value: getColValue(column), onChange: (e) => setData(updateColValue(data, column, e.target.value)), width: "100%", disabled: column.readOnly })) : column.dataType === 'Date' ? (React.createElement(AdaptableInput, { type: "date", "data-name": "column-input", "data-value": column.columnId, value: getColDateValue(column), onChange: (e) => {
94
- setData(updateColValue(data, column, new Date(e.target.value)));
95
- }, style: { width: '100%' }, disabled: column.readOnly })) : column.dataType === 'Boolean' ? (React.createElement(CheckBox, { "data-name": "column-input", "data-value": column.columnId, checked: getColValue(column), onChange: (checked) => setData(updateColValue(data, column, checked)), disabled: column.readOnly })) : null))))));
96
- const namedQueries = (React.createElement(Flex, { flexDirection: "column", alignItems: "start", style: { marginTop: 2 } },
97
- React.createElement(CheckBox, { checked: showColumnIds, onChange: (checked) => setShowColumnIds(checked) }, "Show Column IDs"),
98
- React.createElement(CheckBox, { checked: inlineQuery, onChange: (checked) => setInlineQuery(checked) }, "Inline Query"),
99
- props.namedQueries.map((namedQuery) => (React.createElement(Flex, { key: namedQuery.Uuid, flexDirection: "column", alignItems: "start", style: {
100
- padding: 3,
101
- marginTop: 'var(--ab-space-2)',
102
- marginBottom: 'var(--ab-space-2)',
103
- width: '100%',
104
- }, backgroundColor: "primarylight" },
105
- ' ',
106
- React.createElement(EditorButton, { width: "100%", height: "100%", style: {
107
- background: 'var(--ab-color-primary)',
108
- cursor: 'grab',
109
- }, data: inlineQuery ? namedQuery.BooleanExpression : `QUERY("${namedQuery.Name}")`, "data-name": "column", icon: "drag" },
110
- React.createElement(Flex, { flexDirection: "column", alignItems: "start" }, namedQuery.Name)),
111
- React.createElement(Flex, { alignItems: "start", style: {
112
- padding: 5,
113
- } }, showColumnIds
114
- ? namedQuery.BooleanExpression
115
- : props.api.expressionApi.getAdaptableQueryExpressionWithColumnFriendlyNames(namedQuery)))))));
116
49
  const showDocumentationLinks = props.api.internalApi.isDocumentationLinksDisplayed();
117
50
  // @Bogdan i did this to be sure but i think we can get rid of this as the button does the same (and better IMO)
118
51
  const showNamedQueryStuff = false;
@@ -159,14 +92,56 @@ export function ExpressionEditor(props) {
159
92
  " Query documentation for more details and examples")),
160
93
  React.createElement(Box, { flex: 1 }),
161
94
  showNamedQueryStuff && saveAsNamedQueryElement),
162
- React.createElement(Box, { className: `${baseClassName}__column-picker`, "data-name": "expression-column-picker", pb: 2, paddingLeft: 2, pr: 2 },
163
- ArrayExtensions.IsNotNullOrEmpty(props.namedQueries) && (React.createElement(Flex, { flexDirection: "row", alignItems: "start", p: 1, mt: 2, backgroundColor: "primarylight" },
164
- React.createElement(Radio, { checked: !showNamedQueries, onChange: (checked) => setShowNamedQueries(!checked), style: { marginRight: 10 } }, "Columns"),
165
- React.createElement(Radio, { checked: showNamedQueries, onChange: (checked) => setShowNamedQueries(checked), style: { marginLeft: 10, whiteSpace: 'nowrap' } }, "Named Queries"))),
166
- showNamedQueries ? React.createElement("div", null, namedQueries) : React.createElement("div", null, dataTableEditor))))));
95
+ React.createElement(Box, { className: `${baseClassName}__sidebar`, "data-name": "expression-sidebar", pb: 2, paddingLeft: 2, pr: 2 },
96
+ React.createElement(Panel, { bodyProps: { style: { height: '100%' } }, style: { height: '100%' } },
97
+ React.createElement(Tabs, { style: { height: '100%' }, variant: "" },
98
+ React.createElement(Tabs.Tab, { value: "column" }, "Columns"),
99
+ React.createElement(Tabs.Tab, { value: "field" }, "Fields"),
100
+ React.createElement(Tabs.Tab, { value: "named-query" }, "Named Queries"),
101
+ React.createElement(Tabs.Content, { flex: 1, style: { height: '100%' } },
102
+ React.createElement(DataTableEditor, { type: "column", dataFormatter: (value) => `[${value}]`, fields: queryableColumns.map((column) => ({
103
+ label: column.friendlyName,
104
+ value: column.columnId,
105
+ dataType: column.dataType,
106
+ readOnly: column.readOnly,
107
+ })), data: props.initialData })),
108
+ React.createElement(Tabs.Content, null, adaptableFields && adaptableFields.length > 0 ? (React.createElement(DataTableEditor, { type: "field", labels: {
109
+ showIds: 'Show Field path',
110
+ filterPlaceholder: 'Filter fields...',
111
+ }, dataFormatter: (value) => `FIELD("${value}")`, data: props.initialData, fields: adaptableFields === null || adaptableFields === void 0 ? void 0 : adaptableFields.map((field) => ({
112
+ label: field.label,
113
+ value: field.name,
114
+ dataType: field.dataType,
115
+ readOnly: true,
116
+ })) })) : (React.createElement(Text, { p: 2 }, "No Data Fields provided"))),
117
+ React.createElement(Tabs.Content, null, ArrayExtensions.IsNullOrEmpty(props.namedQueries) ? (React.createElement("div", null,
118
+ React.createElement(Text, { p: 2 }, "No Named Queries defined"),
119
+ React.createElement(Text, { fontSize: 2, padding: 2, p: 2 },
120
+ "Named Queries are saved Expressions which can be referenced in other Expressions using the ",
121
+ React.createElement("i", null, "QUERY"),
122
+ " keyword",
123
+ ' '))) : (React.createElement(NamedQueryEditor, { namedQueries: props.namedQueries }))))))))));
167
124
  const queryBuilderElement = (React.createElement(QueryBuilder, { module: module, query: expressionText, onChange: (query) => {
168
125
  setExpressionText(query);
169
126
  props.onChange(query);
127
+ }, getFields: (type) => {
128
+ return props.fields
129
+ .filter((field) => {
130
+ if (!type) {
131
+ return (field.dataType === 'String' ||
132
+ field.dataType === 'Number' ||
133
+ field.dataType === 'Boolean' ||
134
+ field.dataType === 'Date');
135
+ }
136
+ else {
137
+ return field.dataType === type;
138
+ }
139
+ })
140
+ .map((field) => ({
141
+ value: field.name,
142
+ label: field.label,
143
+ type: field.dataType,
144
+ }));
170
145
  }, getColumns: (type) => {
171
146
  return props.columns
172
147
  .filter((column) => {
@@ -198,7 +173,7 @@ export function ExpressionEditor(props) {
198
173
  } }, (() => {
199
174
  switch (true) {
200
175
  case showQueryBuilder && showExpressionEditor:
201
- return (React.createElement(Tabs, { mb: 2, p: 2, minHeight: 0, flex: 1 },
176
+ return (React.createElement(Tabs, { "data-name": "editor-selector-tabs", mb: 2, p: 2, minHeight: 0, flex: 1 },
202
177
  React.createElement(Tabs.Tab, { value: "editor" }, "Expression Editor"),
203
178
  React.createElement(Tabs.Tab, { value: "ui" }, "Query Builder"),
204
179
  React.createElement(Tabs.Content, null, editorElement),
@@ -2,9 +2,10 @@ import * as React from 'react';
2
2
  import { InputProps } from './index';
3
3
  export type NumberInputProps = {
4
4
  onChange: (value: number) => void;
5
+ noArrows?: boolean;
5
6
  } & Omit<InputProps, 'onChange'>;
6
7
  /**
7
8
  * This component allows - and empty values as intermediery values
8
9
  * it calls change only with valid numeric values
9
10
  */
10
- export declare const NumberInput: React.FunctionComponent<NumberInputProps>;
11
+ export declare const NumberInput: React.ForwardRefExoticComponent<Pick<NumberInputProps, "children" | "size" | "name" | "tabIndex" | "color" | "style" | "cite" | "data" | "form" | "label" | "p" | "slot" | "span" | "summary" | "title" | "pattern" | "start" | "hidden" | "content" | "default" | "flex" | "wrap" | "open" | "padding" | "multiple" | "disabled" | "checked" | "download" | "list" | "order" | "target" | "rows" | "src" | "className" | "onTransitionEnd" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEndCapture" | "opacity" | "value" | "step" | "sizes" | "variant" | "tx" | "as" | "css" | "key" | "m" | "margin" | "mt" | "marginTop" | "mr" | "marginRight" | "mb" | "marginBottom" | "ml" | "marginLeft" | "mx" | "marginX" | "my" | "marginY" | "pt" | "paddingTop" | "pr" | "paddingRight" | "pb" | "paddingBottom" | "pl" | "paddingLeft" | "px" | "paddingX" | "py" | "paddingY" | "width" | "height" | "minWidth" | "minHeight" | "maxWidth" | "maxHeight" | "display" | "verticalAlign" | "overflow" | "overflowX" | "overflowY" | "fontFamily" | "fontSize" | "fontWeight" | "lineHeight" | "letterSpacing" | "fontStyle" | "textAlign" | "bg" | "backgroundColor" | "alignItems" | "alignContent" | "justifyItems" | "justifyContent" | "flexWrap" | "flexDirection" | "flexGrow" | "flexShrink" | "flexBasis" | "justifySelf" | "alignSelf" | "sx" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "srcDoc" | "srcLang" | "srcSet" | "type" | "useMap" | "wmode" | "noArrows"> & React.RefAttributes<HTMLInputElement>>;
@@ -1,10 +1,12 @@
1
+ import { __rest } from "tslib";
1
2
  import * as React from 'react';
2
- import Input from './index';
3
+ import Input, { baseClassName } from './index';
4
+ import join from '../utils/join';
3
5
  /**
4
6
  * This component allows - and empty values as intermediery values
5
7
  * it calls change only with valid numeric values
6
8
  */
7
- export const NumberInput = (props) => {
9
+ export const NumberInput = React.forwardRef((props, ref) => {
8
10
  const [value, setValue] = React.useState(() => {
9
11
  var _a;
10
12
  // awlays controlled
@@ -37,5 +39,6 @@ export const NumberInput = (props) => {
37
39
  setValue(props.value);
38
40
  }
39
41
  }, [props.value, value]);
40
- return React.createElement(Input, Object.assign({}, props, { value: value, onBlur: handleBlur, onChange: handleChange }));
41
- };
42
+ const { noArrows } = props, restOfProps = __rest(props, ["noArrows"]);
43
+ return (React.createElement(Input, Object.assign({}, restOfProps, { ref: ref, className: join(noArrows ? `${baseClassName}--no-arrows` : '', props.className), value: value, onBlur: handleBlur, onChange: handleChange })));
44
+ });
@@ -61,6 +61,8 @@ const OverlayTrigger = React.forwardRef((givenProps, ref) => {
61
61
  // overlay - target
62
62
  ['TopLeft', 'BottomLeft'],
63
63
  ['TopRight', 'BottomRight'],
64
+ ['TopCenter', 'BottomCenter'],
65
+ ['BottomCenter', 'TopCenter'],
64
66
  ['TopRight', 'BottomCenter'],
65
67
  ['TopRight', 'BottomLeft'],
66
68
  ['TopRight', 'BottomLeft'],
@@ -68,6 +70,11 @@ const OverlayTrigger = React.forwardRef((givenProps, ref) => {
68
70
  ['BottomRight', 'TopRight'],
69
71
  ['BottomRight', 'TopCenter'],
70
72
  ['BottomRight', 'TopLeft'],
73
+ ['TopRight', 'CenterLeft'],
74
+ ['TopRight', 'TopLeft'],
75
+ ['TopLeft', 'TopRight'],
76
+ ['CenterRight', 'CenterLeft'],
77
+ ['CenterLeft', 'CenterRight'],
71
78
  ], constrainTo, target: targetProp } = props, domProps = __rest(props, ["visible", "showTriangle", "showEvent", "hideEvent", "render", "targetOffset", "preventPortalEventPropagation", "defaultZIndex", "anchor", "hideDelay", "opacityTransitionDuration", "onVisibleChange", "alignPosition", "constrainTo", "target"]);
72
79
  const { showOverlay, clearAll: clearAllOverlays, hideOverlay, portal, } = useOverlay({
73
80
  portalContainer: portalElement,
@@ -179,19 +186,16 @@ const OverlayTrigger = React.forwardRef((givenProps, ref) => {
179
186
  hideOverlay('overlay-trigger');
180
187
  }
181
188
  } }), props.render({ targetWidth: targetWidth })));
182
- let preparedConstrinTo;
189
+ let preparedConstrainTo;
183
190
  if (constrainTo) {
184
- preparedConstrinTo = getConstrainElement(targetRef.current, constrainTo);
185
- }
186
- else {
187
- preparedConstrinTo = adaptable === null || adaptable === void 0 ? void 0 : adaptable.getAgGridContainerElement();
191
+ preparedConstrainTo = getConstrainElement(targetRef.current, constrainTo);
188
192
  }
189
193
  // show only if visible or if it was visible and now it is invisible
190
194
  const alignToRect = getRect(target, targetOffset !== null && targetOffset !== void 0 ? targetOffset : 0);
191
195
  const showOverlayOptions = {
192
196
  id: 'overlay-trigger',
193
197
  alignPosition,
194
- constrainTo: (_b = (_a = preparedConstrinTo === null || preparedConstrinTo === void 0 ? void 0 : preparedConstrinTo.getBoundingClientRect) === null || _a === void 0 ? void 0 : _a.call(preparedConstrinTo)) !== null && _b !== void 0 ? _b : true,
198
+ constrainTo: (_b = (_a = preparedConstrainTo === null || preparedConstrainTo === void 0 ? void 0 : preparedConstrainTo.getBoundingClientRect) === null || _a === void 0 ? void 0 : _a.call(preparedConstrainTo)) !== null && _b !== void 0 ? _b : true,
195
199
  alignTo: alignToRect,
196
200
  };
197
201
  showOverlay(() => overlayContent, showOverlayOptions);
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const _default: (props: any) => JSX.Element;
3
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import DefaultIcon from './DefaultIcon';
3
+ export default (props) => (React.createElement(DefaultIcon, Object.assign({}, props, { viewBox: "0 -960 960 960" }),
4
+ React.createElement("path", { d: "M121-280v-400q0-33 23.5-56.5T201-760h559q33 0 56.5 23.5T840-680v400q0 33-23.5 56.5T760-200H201q-33 0-56.5-23.5T121-280Zm79 0h133v-400H200v400Zm213 0h133v-400H413v400Zm213 0h133v-400H626v400Z" })));
@@ -52,6 +52,7 @@ import ColumnChooser from './column-chooser';
52
52
  import ColumnAdd from './column-add';
53
53
  import CellValidation from './cell-validation';
54
54
  import ColumnFilter from './column-filter';
55
+ import ColumnOutline from './column-outline';
55
56
  import SystemStatus from './system-status';
56
57
  import DataSet from './data-set';
57
58
  import DataObject from './data-object';
@@ -167,6 +168,7 @@ import SelectFwd from './select-fwd';
167
168
  import Copy from './copy';
168
169
  import ExpandAll from './expand-all';
169
170
  import CollapseAll from './collapse-all';
171
+ import Sync from './sync';
170
172
  import { IconComponent } from '../Icon';
171
173
  import { AdaptableLogger } from '../../agGrid/AdaptableLogger';
172
174
  export const allIcons = {
@@ -188,7 +190,7 @@ export const allIcons = {
188
190
  news: News,
189
191
  brush: Brush,
190
192
  'data-set': DataSet,
191
- 'excel': Excel,
193
+ excel: Excel,
192
194
  json: DataObject,
193
195
  export: Export,
194
196
  broadcast: Campaign,
@@ -197,6 +199,7 @@ export const allIcons = {
197
199
  calendar: Calendar,
198
200
  chat: Chat,
199
201
  'filter-list': ColumnFilter,
202
+ 'column-outline': ColumnOutline,
200
203
  'grid-filter': GridFilter,
201
204
  'grid-info': GridInfo,
202
205
  filter: Filter,
@@ -337,6 +340,7 @@ export const allIcons = {
337
340
  rows: Rows,
338
341
  'expand-all': ExpandAll,
339
342
  'collapse-all': CollapseAll,
343
+ sync: Sync,
340
344
  };
341
345
  Object.keys(allIcons).forEach((name) => {
342
346
  const ReactCmp = allIcons[name];
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const _default: (props: any) => JSX.Element;
3
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import DefaultIcon from './DefaultIcon';
3
+ export default (props) => (React.createElement(DefaultIcon, Object.assign({}, props, { viewBox: "0 -960 960 960" }),
4
+ React.createElement("path", { d: "M280-120 80-320l200-200 57 56-104 104h607v80H233l104 104-57 56Zm400-320-57-56 104-104H120v-80h607L623-784l57-56 200 200-200 200Z" })));
package/src/env.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export default {
2
2
  INFINITE_TABLE_LICENSE_KEY: "StartDate=2021-06-29|EndDate=2030-01-01|Owner=Adaptable|Type=distribution|TS=1624971462479|C=137829811,1004007071,2756196225,1839832928,3994409405,636616862" || '',
3
- PUBLISH_TIMESTAMP: 1716379103965 || Date.now(),
4
- VERSION: "18.0.12" || '--current-version--',
3
+ PUBLISH_TIMESTAMP: 1716641872713 || Date.now(),
4
+ VERSION: "18.1.0-canary.0" || '--current-version--',
5
5
  };