@adaptabletools/adaptable 24.0.0-canary.0 → 24.0.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.
- package/index.css +16 -12
- package/package.json +2 -2
- package/src/Api/ExpressionApi.d.ts +3 -15
- package/src/Api/Implementation/ExpressionApiImpl.d.ts +1 -3
- package/src/Api/Implementation/ExpressionApiImpl.js +5 -6
- package/src/Api/Internal/AdaptableInternalApi.d.ts +2 -2
- package/src/Api/Internal/AdaptableInternalApi.js +6 -4
- package/src/Strategy/AlertModule.js +2 -2
- package/src/Strategy/FormatColumnModule.js +2 -2
- package/src/Utilities/Services/QueryLanguageService.js +0 -2
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +1 -1
- package/src/View/Filter/ColumnFilter/ColumnFilterNew.js +2 -3
- package/src/components/aql/CompactEditor/CompactEditor.js +1 -1
- package/src/components/aql/ExpressionEditor/BaseEditorInput.js +1 -1
- package/src/components/aql/ExpressionEditor/CompactExpressionToolbar.d.ts +5 -0
- package/src/components/aql/ExpressionEditor/CompactExpressionToolbar.js +12 -5
- package/src/components/aql/ExpressionEditor/ExpressionPreview.js +1 -1
- package/src/components/aql/ExpressionEditor/index.d.ts +3 -2
- package/src/env.js +2 -2
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/vendor/components/Combobox/comboboxUtils.d.ts +9 -0
- package/vendor/components/Combobox/comboboxUtils.d.ts.map +1 -1
- package/vendor/components/Combobox/comboboxUtils.js +41 -2
- package/vendor/components/Combobox/comboboxUtils.js.map +1 -1
- package/vendor/components/Combobox/index.d.ts.map +1 -1
- package/vendor/components/Combobox/index.js +14 -9
- package/vendor/components/Combobox/index.js.map +1 -1
- package/vendor/components/twMerge.d.ts +3 -2
- package/vendor/components/twMerge.d.ts.map +1 -1
- package/vendor/components/twMerge.js.map +1 -1
package/index.css
CHANGED
|
@@ -934,6 +934,9 @@
|
|
|
934
934
|
.twa\:w-\[7rem\] {
|
|
935
935
|
width: 7rem;
|
|
936
936
|
}
|
|
937
|
+
.twa\:w-\[8\.5rem\] {
|
|
938
|
+
width: 8.5rem;
|
|
939
|
+
}
|
|
937
940
|
.twa\:w-\[10px\] {
|
|
938
941
|
width: 10px;
|
|
939
942
|
}
|
|
@@ -997,9 +1000,6 @@
|
|
|
997
1000
|
.twa\:w-\[480px\] {
|
|
998
1001
|
width: 480px;
|
|
999
1002
|
}
|
|
1000
|
-
.twa\:w-\[calc\(6\.75rem\+2px\)\] {
|
|
1001
|
-
width: calc(6.75rem + 2px);
|
|
1002
|
-
}
|
|
1003
1003
|
.twa\:w-auto {
|
|
1004
1004
|
width: auto;
|
|
1005
1005
|
}
|
|
@@ -7208,8 +7208,11 @@
|
|
|
7208
7208
|
--ab-aql-token-keyword: #f0abfc;
|
|
7209
7209
|
}
|
|
7210
7210
|
.ab-AqlCodeMirror {
|
|
7211
|
+
display: flex;
|
|
7212
|
+
flex-direction: column;
|
|
7211
7213
|
width: 100%;
|
|
7212
7214
|
min-height: 0;
|
|
7215
|
+
overflow: hidden;
|
|
7213
7216
|
border-radius: var(--ab-border-radius);
|
|
7214
7217
|
border: 1px solid var(--ab-aql-editor__border);
|
|
7215
7218
|
background: var(--ab-aql-editor__background);
|
|
@@ -7222,6 +7225,14 @@
|
|
|
7222
7225
|
box-shadow: inset 0 1px 3px color-mix(in srgb, var(--ab-color-primary-foreground) 12%, transparent);
|
|
7223
7226
|
}
|
|
7224
7227
|
}
|
|
7228
|
+
.ab-AqlCodeMirror:focus-within {
|
|
7229
|
+
box-shadow: 0 0 0 3px var(--ab-color-ring, var(--ab-color-accent));
|
|
7230
|
+
}
|
|
7231
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
7232
|
+
.ab-AqlCodeMirror:focus-within {
|
|
7233
|
+
box-shadow: 0 0 0 3px color-mix(in srgb, var(--ab-color-ring, var(--ab-color-accent)) 50%, transparent);
|
|
7234
|
+
}
|
|
7235
|
+
}
|
|
7225
7236
|
.ab-AqlCodeMirror--full {
|
|
7226
7237
|
min-height: 150px;
|
|
7227
7238
|
font-size: var(--ab-font-size-4, 1rem);
|
|
@@ -7236,20 +7247,13 @@
|
|
|
7236
7247
|
pointer-events: none;
|
|
7237
7248
|
}
|
|
7238
7249
|
.ab-AqlCodeMirror .cm-editor {
|
|
7250
|
+
flex: 1;
|
|
7251
|
+
min-height: 0;
|
|
7239
7252
|
height: 100%;
|
|
7240
7253
|
background: transparent;
|
|
7241
7254
|
}
|
|
7242
7255
|
.ab-AqlCodeMirror .cm-editor.cm-focused {
|
|
7243
7256
|
outline: none;
|
|
7244
|
-
box-shadow: 0 0 0 3px var(--ab-color-ring, var(--ab-color-accent));
|
|
7245
|
-
}
|
|
7246
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
7247
|
-
.ab-AqlCodeMirror .cm-editor.cm-focused {
|
|
7248
|
-
box-shadow: 0 0 0 3px color-mix(in srgb, var(--ab-color-ring, var(--ab-color-accent)) 50%, transparent);
|
|
7249
|
-
}
|
|
7250
|
-
}
|
|
7251
|
-
.ab-AqlCodeMirror .cm-editor.cm-focused {
|
|
7252
|
-
border-radius: inherit;
|
|
7253
7257
|
}
|
|
7254
7258
|
.ab-AqlCodeMirror .cm-scroller {
|
|
7255
7259
|
padding: calc(var(--ab-base-space, 4px) * 2);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable",
|
|
3
|
-
"version": "24.0.0-canary.
|
|
3
|
+
"version": "24.0.0-canary.1",
|
|
4
4
|
"description": "Powerful AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@base-ui/react": "1.7.0",
|
|
46
46
|
"@codemirror/autocomplete": "^6.20.3",
|
|
47
47
|
"@codemirror/commands": "^6.11.0",
|
|
48
|
-
"@codemirror/language": "
|
|
48
|
+
"@codemirror/language": "6.12.4",
|
|
49
49
|
"@codemirror/lint": "^6.9.7",
|
|
50
50
|
"@codemirror/state": "^6.7.1",
|
|
51
51
|
"@codemirror/view": "^6.43.9",
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AdaptableModule } from '../AdaptableState/Common/Types';
|
|
2
2
|
import type { ExpressionKind } from '../AdaptableState/Common/AdaptableQuery';
|
|
3
|
-
import type { LegacyAdaptableQuery } from '../migration/legacyAdaptableQuery';
|
|
4
3
|
import { AdaptableColumn } from '../AdaptableState/Common/AdaptableColumn';
|
|
5
4
|
import type { IRowNode } from 'ag-grid-enterprise';
|
|
6
5
|
import { AggregatedExpressionEvaluationValue, EvaluateAggregatedExpressionRequest, EvaluateStandardExpressionRequest, ExpressionEvaluationResult, FilterDataSetRequest, FilterRowNodesRequest } from '../aql/ExpressionEvaluation';
|
|
@@ -53,21 +52,10 @@ export interface ExpressionApi {
|
|
|
53
52
|
*/
|
|
54
53
|
getExpressionKind(expression: string, module?: AdaptableModule): ExpressionKind;
|
|
55
54
|
/**
|
|
56
|
-
* Returns the Expression
|
|
57
|
-
*
|
|
58
|
-
* Since v25 these properties are plain strings and this method simply returns its argument;
|
|
59
|
-
* it still unwraps the pre-v25 object shape (`{ Expression }` / `{ AggregatedExpression }` /
|
|
60
|
-
* …) for callers that hold un-migrated objects.
|
|
61
|
-
*
|
|
62
|
-
* @deprecated `Rule` / `Expression` are strings; use them directly
|
|
63
|
-
* @param query - the Expression string (or pre-v25 wrapper object)
|
|
64
|
-
*/
|
|
65
|
-
getAdaptableQueryExpression(query: string | Partial<LegacyAdaptableQuery> | undefined | null): string | undefined;
|
|
66
|
-
/**
|
|
67
|
-
* Returns the Expression string with column friendly names (instead of Column IDs)
|
|
68
|
-
* @param query - the Expression string (or pre-v25 wrapper object)
|
|
55
|
+
* Returns the Expression with Column Headers in place of Column IDs
|
|
56
|
+
* @param expression - the Expression string
|
|
69
57
|
*/
|
|
70
|
-
|
|
58
|
+
getExpressionWithColumnFriendlyNames(expression: string | undefined | null): string | undefined;
|
|
71
59
|
/**
|
|
72
60
|
* Evaluates a Standard Expression against a row.
|
|
73
61
|
* Requires a row target (`rowNode`, `primaryKeyValue`, or `data`) on the request.
|
|
@@ -4,7 +4,6 @@ import { AdaptableModule } from '../../AdaptableState/Common/Types';
|
|
|
4
4
|
import { ExpressionApi } from '../ExpressionApi';
|
|
5
5
|
import { AggregatedExpressionEvaluationValue, EvaluateAggregatedExpressionRequest, EvaluateStandardExpressionRequest, ExpressionEvaluationResult, FilterDataSetRequest, FilterRowNodesRequest } from '../../aql/ExpressionEvaluation';
|
|
6
6
|
import type { ExpressionKind } from '../../AdaptableState/Common/AdaptableQuery';
|
|
7
|
-
import { type LegacyAdaptableQuery } from '../../migration/legacyAdaptableQuery';
|
|
8
7
|
import { AdaptableColumn } from '../../AdaptableState/Common/AdaptableColumn';
|
|
9
8
|
import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
|
|
10
9
|
import { ExpressionInternalApi } from '../Internal/ExpressionInternalApi';
|
|
@@ -31,8 +30,7 @@ export declare class ExpressionApiImpl extends ApiBase implements ExpressionApi
|
|
|
31
30
|
getColumnsFromExpression(expression: string, visitedCalculatedColumnIds?: Set<string>): string[];
|
|
32
31
|
isColumnQueryable(abColumn: AdaptableColumn): boolean;
|
|
33
32
|
getExpressionKind(expression: string, module?: AdaptableModule): ExpressionKind;
|
|
34
|
-
|
|
35
|
-
getAdaptableQueryExpressionWithColumnFriendlyNames(query: string | Partial<LegacyAdaptableQuery> | undefined | null): string | undefined;
|
|
33
|
+
getExpressionWithColumnFriendlyNames(expression: string | undefined | null): string | undefined;
|
|
36
34
|
migratePreV24Expression(expression: string, options?: {
|
|
37
35
|
expressionKind?: 'boolean' | 'scalar' | 'aggregatedScalar' | 'aggregatedBoolean';
|
|
38
36
|
}): {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ApiBase } from './ApiBase';
|
|
2
2
|
import { emitAstForConsumer, migrateExpression } from "../../../vendor/aql/index.js";
|
|
3
3
|
import { toMigrateOptions } from '../../aql/legacyExpressionKinds';
|
|
4
|
-
import { getLegacyQueryText } from '../../migration/legacyAdaptableQuery';
|
|
5
4
|
import { ExpressionInternalApi } from '../Internal/ExpressionInternalApi';
|
|
6
5
|
import { ExpressionModuleId } from '../../Utilities/Constants/ModuleConstants';
|
|
7
6
|
import { invokeOptionCallback, resolveValueOrFunction, } from '../../Utilities/Helpers/ValueOrFunctionHelper';
|
|
@@ -269,13 +268,13 @@ export class ExpressionApiImpl extends ApiBase {
|
|
|
269
268
|
.internalApi.getQueryLanguageService()
|
|
270
269
|
.getExpressionKind(expression, module);
|
|
271
270
|
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
271
|
+
getExpressionWithColumnFriendlyNames(expression) {
|
|
272
|
+
if (expression == null) {
|
|
273
|
+
return undefined;
|
|
274
|
+
}
|
|
276
275
|
return this.getAdaptableApi()
|
|
277
276
|
.internalApi.getQueryLanguageService()
|
|
278
|
-
.getExpressionWithColumnFriendlyNames(
|
|
277
|
+
.getExpressionWithColumnFriendlyNames(expression);
|
|
279
278
|
}
|
|
280
279
|
migratePreV24Expression(expression, options) {
|
|
281
280
|
return migrateExpression(expression, toMigrateOptions(options?.expressionKind));
|
|
@@ -7,7 +7,7 @@ import { AdaptableMenuItem } from '../../AdaptableState/Common/Menu';
|
|
|
7
7
|
import { AdaptableModule } from '../../AdaptableState/Common/Types';
|
|
8
8
|
import { CellDataChangedInfo } from '../../AdaptableState/Common/CellDataChangedInfo';
|
|
9
9
|
import { AdaptableIcon, AdaptableObjectLookupCriteria, AdaptableState, BaseContext, InitialState } from '../../types';
|
|
10
|
-
import type
|
|
10
|
+
import { type LegacyAdaptableQuery } from '../../migration/legacyAdaptableQuery';
|
|
11
11
|
import { IValidationService } from '../../Utilities/Services/Interface/IValidationService';
|
|
12
12
|
import { IModuleService } from '../../Utilities/Services/Interface/IModuleService';
|
|
13
13
|
import { ICalculatedColumnExpressionService } from '../../Utilities/Services/Interface/ICalculatedColumnExpressionService';
|
|
@@ -112,7 +112,7 @@ export declare class AdaptableInternalApi extends ApiBase {
|
|
|
112
112
|
/**
|
|
113
113
|
* Display text for an expression: column friendly names when
|
|
114
114
|
* `expressionOptions.displayColumnFriendlyNamesForExpressions` is set, the raw
|
|
115
|
-
* text otherwise.
|
|
115
|
+
* text otherwise. Still unwraps a leftover wrapper for internal callers.
|
|
116
116
|
*/
|
|
117
117
|
getAdaptableQueryExpressionText(query: string | Partial<LegacyAdaptableQuery> | undefined | null): string;
|
|
118
118
|
/**
|
|
@@ -3,6 +3,7 @@ import * as InternalRedux from '../../Redux/ActionsReducers/InternalRedux';
|
|
|
3
3
|
import { ApiBase } from '../Implementation/ApiBase';
|
|
4
4
|
import StringExtensions from '../../Utilities/Extensions/StringExtensions';
|
|
5
5
|
import { ADAPTABLE_ID } from '../../Utilities/Constants/GeneralConstants';
|
|
6
|
+
import { getLegacyQueryText, } from '../../migration/legacyAdaptableQuery';
|
|
6
7
|
import { waitForCondition } from '../../Utilities/waitForCondition';
|
|
7
8
|
import { isAdaptableCustomIcon, isAdaptableSystemIcon } from '../../components/Icon';
|
|
8
9
|
import { parseDateValue } from '../../Utilities/Helpers/DateHelper';
|
|
@@ -293,13 +294,14 @@ export class AdaptableInternalApi extends ApiBase {
|
|
|
293
294
|
return adaptableObjectTag;
|
|
294
295
|
}
|
|
295
296
|
getAdaptableQueryExpressionText(query) {
|
|
296
|
-
|
|
297
|
+
const text = getLegacyQueryText(query);
|
|
298
|
+
if (!text) {
|
|
297
299
|
return '';
|
|
298
300
|
}
|
|
299
301
|
const displayColumnFriendlyNames = this.getExpressionOptions()?.displayColumnFriendlyNamesForExpressions;
|
|
300
|
-
return
|
|
301
|
-
? this.getExpressionApi().
|
|
302
|
-
:
|
|
302
|
+
return displayColumnFriendlyNames
|
|
303
|
+
? (this.getExpressionApi().getExpressionWithColumnFriendlyNames(text) ?? '')
|
|
304
|
+
: text;
|
|
303
305
|
}
|
|
304
306
|
getValueUsingField(rowData, fieldName) {
|
|
305
307
|
if (!rowData || !fieldName?.length) {
|
|
@@ -102,7 +102,7 @@ export class AlertModule extends AdaptableModuleBase {
|
|
|
102
102
|
if (isScheduledAlertDefinition(alertDefinition)) {
|
|
103
103
|
return [];
|
|
104
104
|
}
|
|
105
|
-
const queryExpression =
|
|
105
|
+
const queryExpression = alertDefinition.Rule;
|
|
106
106
|
if (queryExpression) {
|
|
107
107
|
return this.api.expressionApi.getColumnsFromExpression(queryExpression);
|
|
108
108
|
}
|
|
@@ -117,7 +117,7 @@ export class AlertModule extends AdaptableModuleBase {
|
|
|
117
117
|
if (isScheduledAlertDefinition(alertDefinition)) {
|
|
118
118
|
return [];
|
|
119
119
|
}
|
|
120
|
-
const queryExpression =
|
|
120
|
+
const queryExpression = alertDefinition.Rule;
|
|
121
121
|
if (!queryExpression) {
|
|
122
122
|
return [];
|
|
123
123
|
}
|
|
@@ -22,7 +22,7 @@ export class FormatColumnModule extends AdaptableModuleBase {
|
|
|
22
22
|
return this.getLayoutExtensionModuleObjects('FormatColumn', () => this.api.formatColumnApi.getFormatColumns(), config);
|
|
23
23
|
}
|
|
24
24
|
getExplicitlyReferencedColumnIds(formatColumn) {
|
|
25
|
-
const queryExpression = formatColumn.Rule
|
|
25
|
+
const queryExpression = formatColumn.Rule;
|
|
26
26
|
if (queryExpression) {
|
|
27
27
|
return this.api.expressionApi.getColumnsFromExpression(queryExpression);
|
|
28
28
|
}
|
|
@@ -34,7 +34,7 @@ export class FormatColumnModule extends AdaptableModuleBase {
|
|
|
34
34
|
return [];
|
|
35
35
|
}
|
|
36
36
|
getReferencedNamedQueryNames(formatColumn) {
|
|
37
|
-
const queryExpression = formatColumn.Rule
|
|
37
|
+
const queryExpression = formatColumn.Rule;
|
|
38
38
|
if (!queryExpression) {
|
|
39
39
|
return [];
|
|
40
40
|
}
|
|
@@ -784,8 +784,6 @@ export class QueryLanguageService {
|
|
|
784
784
|
const columnFriendlyName = this.adaptableApi.columnApi.getFriendlyNameForColumnId(columnId);
|
|
785
785
|
result = result.split(columnId).join(columnFriendlyName);
|
|
786
786
|
}
|
|
787
|
-
result = result.replace(/\$SCOPE\s*\(\s*\)/g, '$Column_Scope');
|
|
788
|
-
result = result.replace(/\$SCOPE\b/g, '$Column_Scope');
|
|
789
787
|
return result;
|
|
790
788
|
}
|
|
791
789
|
getNodesFromExpression(input, nodeType) {
|
|
@@ -121,5 +121,5 @@ export const CalculatedColumnExpressionWizardSection = (props) => {
|
|
|
121
121
|
const showObservableHint = props.calculatedColumnType === 'Standard' &&
|
|
122
122
|
props.onCalculatedColumnTypeChange != null &&
|
|
123
123
|
expressionContainsObservableCall(data.Expression);
|
|
124
|
-
return (_jsxs(ExpressionUseCaseCard, { title: getTypeTitle(props.calculatedColumnType), description: getTypeDescription(props.calculatedColumnType), examplesKind: getExamplesKind(props.calculatedColumnType), children: [_jsx(ExpressionEditor, { type: editorType, scalarVariant: isObservable ? 'observable' : undefined, module: moduleInfo.ModuleName, className: "twa:pl-0", value: data.Expression ?? '', onChange: (expression) => setCalculatedColumnExpression(expression), initialData: initialData, columns: columns, fields: isPerRow ? api.expressionApi.internalApi.getAvailableFields() : undefined, namedQueries: api.namedQueryApi.getNamedQueries(), isFullExpression: true, api: api, suppressTypeInfoCard: true, examplesKind: getExamplesKind(props.calculatedColumnType) }), showObservableHint ? (_jsxs(HelpBlock, { "data-name": "calculated-column-observable-hint", className: "twa:mt-2 twa:flex twa:items-center twa:gap-2 twa:text-3", children: [_jsx("span", { children: "This Expression uses observable (live) functions." }), _jsx(SimpleButton, { variant: "outlined", "data-name": "calculated-column-switch-to-observable", onClick: () => props.onCalculatedColumnTypeChange?.('Observable'), children: "Switch to Observable" })] })) : null] }));
|
|
124
|
+
return (_jsxs(ExpressionUseCaseCard, { title: getTypeTitle(props.calculatedColumnType), description: getTypeDescription(props.calculatedColumnType), examplesKind: getExamplesKind(props.calculatedColumnType), children: [_jsx(ExpressionEditor, { type: editorType, scalarVariant: isObservable ? 'observable' : undefined, suppressObservable: !isObservable, module: moduleInfo.ModuleName, className: "twa:pl-0", value: data.Expression ?? '', onChange: (expression) => setCalculatedColumnExpression(expression), initialData: initialData, columns: columns, fields: isPerRow ? api.expressionApi.internalApi.getAvailableFields() : undefined, namedQueries: api.namedQueryApi.getNamedQueries(), isFullExpression: true, api: api, suppressTypeInfoCard: true, examplesKind: getExamplesKind(props.calculatedColumnType) }), showObservableHint ? (_jsxs(HelpBlock, { "data-name": "calculated-column-observable-hint", className: "twa:mt-2 twa:flex twa:items-center twa:gap-2 twa:text-3", children: [_jsx("span", { children: "This Expression uses observable (live) functions." }), _jsx(SimpleButton, { variant: "outlined", "data-name": "calculated-column-switch-to-observable", onClick: () => props.onCalculatedColumnTypeChange?.('Observable'), children: "Switch to Observable" })] })) : null] }));
|
|
125
125
|
};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { clsx } from 'cn';
|
|
4
3
|
import SimpleButton from '../../../components/SimpleButton';
|
|
5
4
|
import { useAdaptable } from '../../AdaptableContext';
|
|
6
5
|
import { Box, Flex } from '../../../components/Flex';
|
|
7
6
|
import { twMerge } from '../../../twMerge';
|
|
8
|
-
import { captureTab } from '../../../lib/utils';
|
|
7
|
+
import { captureTab, cn } from '../../../lib/utils';
|
|
9
8
|
import * as ModuleConstants from '../../../Utilities/Constants/ModuleConstants';
|
|
10
9
|
import { QueryBuilder } from '../../../components/aql/QueryBuilder';
|
|
11
10
|
import { getQueryBuilderColumnOptions, getQueryBuilderFieldOptions, } from '../../../components/aql/QueryBuilder/qlGroupUtils';
|
|
@@ -65,7 +64,7 @@ export const ColumnFilterComponentNew = (props) => {
|
|
|
65
64
|
};
|
|
66
65
|
const showClear = props.location !== 'filterForm';
|
|
67
66
|
const showActions = !props.hideActionButtons && (showClear || manuallyApplyColumnFilter);
|
|
68
|
-
return (_jsx(ColumnFilterOverlayHost, { location: props.location, children: _jsxs("div", { ref: rootRef, onKeyDown: handleFocusTrap, className: "twa:contents", children: [showActions && (_jsxs(Flex, { className:
|
|
67
|
+
return (_jsx(ColumnFilterOverlayHost, { location: props.location, children: _jsxs("div", { ref: rootRef, onKeyDown: handleFocusTrap, className: "twa:contents", children: [showActions && (_jsxs(Flex, { className: cn('ab-ColumnFilter-actions twa:m-2', {
|
|
69
68
|
'twa:mb-2': isEmbeddedColumnFilterLocation(props.location),
|
|
70
69
|
}), justifyContent: "space-between", children: [showClear && (_jsx(Box, { className: "ab-ColumnFilter-action-clearall", children: _jsx(SimpleButton, { "aria-label": "Clear All Filters", onClick: clearAllFilters, children: "Clear All" }) })), manuallyApplyColumnFilter && (_jsxs(_Fragment, { children: [_jsx(Box, { className: "twa:flex-1", "data-name": "spacer" }), _jsx(Box, { className: "ab-ColumnFilter-action-reset twa:mr-2", children: _jsx(SimpleButton, { "aria-label": "Reset All", tone: "neutral", variant: "raised", onClick: resetFilter, children: "Reset" }) }), _jsx(Box, { className: "ab-ColumnFilter-action-apply", children: _jsx(SimpleButton, { "aria-label": "Apply Filter", tone: "accent", variant: "raised", onClick: applyFilter, children: "Apply" }) })] }))] })), _jsx(Box, { style: props.wrapperProps?.style, className: twMerge('ab-ColumnFilter twa:flex-1 twa:min-h-0 twa:overflow-auto twa:overflow-x-hidden twa:p-0.5 twa:gap-1 twa:flex twa:flex-col', props.location === 'filtersToolPanel' && 'ab-ColumnFilter--tool-panel', props.disabled ? 'twa:opacity-60 twa:pointer-events-none' : '', props.wrapperProps?.className), children: _jsx(QueryBuilder, { module: ModuleConstants.ColumnFilterModuleId, query: "", initialPredicate: seededGroup, onChange: noop, onPredicateChange: handlePredicateChange, getColumns: getColumns, getFields: getFields, subject: { mode: 'locked', columnId: props.columnId }, hideExpressionPreview: true, hideInlineAdd: true, hideAddGroup: true, hideLockedSubject: true, hideDragHandles: true, layout: getColumnFilterQueryBuilderLayout(props.location) }, `${props.columnId}:${resetNonce}`) })] }) }));
|
|
71
70
|
};
|
|
@@ -137,5 +137,5 @@ export const CompactEditor = () => {
|
|
|
137
137
|
}, children: _jsx(PanelWithImage, { className: "twa:overflow-hidden", bodyScroll: false, style: { height: '100%', maxHeight: '100%' }, bodyProps: {
|
|
138
138
|
className: 'twa:min-h-0 twa:overflow-hidden twa:p-2',
|
|
139
139
|
style: { height: '100%', maxHeight: '100%' },
|
|
140
|
-
}, header: `Edit Expression — ${title}`, glyphicon: "calculated-column", variant: "primary", children: _jsx(Box, { className: "twa:min-h-0 twa:overflow-hidden", style: { height: '100%' }, children: _jsx(ExpressionEditor, { type: editorType, scalarVariant: calculatedColumnType === 'Observable' ? 'observable' : undefined, module: CalculatedColumnModuleId, isFullExpression: true, compactLayout: true, value: expression, onChange: persistExpression, initialData: initialData, columns: api.columnApi.internalApi.getQueryableColumnsForUIEditor(), namedQueries: api.namedQueryApi.getNamedQueries(), allowSaveNamedQuery: false, api: api, className: "twa:min-h-0 twa:overflow-hidden", style: { height: '100%' }, toolbarEnd: _jsxs(Flex, { className: "twa:gap-1 twa:shrink-0 twa:items-center", children: [_jsx(SimpleButton, { variant: "outlined", icon: "undo", "data-name": "compact-calcol-revert", disabled: !canRevert, onClick: revertExpression, children: "Revert" }), _jsx(SimpleButton, { variant: "outlined", icon: "edit", "data-name": "compact-calcol-open-full-editor", onClick: openFullEditor, children: "Open Full Editor" })] }) }) }) }) }));
|
|
140
|
+
}, header: `Edit Expression — ${title}`, glyphicon: "calculated-column", variant: "primary", children: _jsx(Box, { className: "twa:min-h-0 twa:overflow-hidden", style: { height: '100%' }, children: _jsx(ExpressionEditor, { type: editorType, scalarVariant: calculatedColumnType === 'Observable' ? 'observable' : undefined, suppressObservable: calculatedColumnType !== 'Observable', module: CalculatedColumnModuleId, isFullExpression: true, compactLayout: true, value: expression, onChange: persistExpression, initialData: initialData, columns: api.columnApi.internalApi.getQueryableColumnsForUIEditor(), namedQueries: api.namedQueryApi.getNamedQueries(), allowSaveNamedQuery: false, api: api, className: "twa:min-h-0 twa:overflow-hidden", style: { height: '100%' }, toolbarEnd: _jsxs(Flex, { className: "twa:gap-1 twa:shrink-0 twa:items-center", children: [_jsx(SimpleButton, { variant: "outlined", icon: "undo", "data-name": "compact-calcol-revert", disabled: !canRevert, onClick: revertExpression, children: "Revert" }), _jsx(SimpleButton, { variant: "outlined", icon: "edit", "data-name": "compact-calcol-open-full-editor", onClick: openFullEditor, children: "Open Full Editor" })] }) }) }) }) }));
|
|
141
141
|
};
|
|
@@ -1081,7 +1081,7 @@ export function BaseEditorInput(props) {
|
|
|
1081
1081
|
}, [])
|
|
1082
1082
|
.filter((row) => row.length > 0);
|
|
1083
1083
|
const showDocumentationLink = Boolean(props.documentationLink) && props.api.internalApi.isDocumentationLinksDisplayed();
|
|
1084
|
-
return (_jsxs(Flex, { flexDirection: "column", className: isCompact ? 'twa:h-full twa:min-h-0 twa:overflow-hidden' : undefined, children: [_jsxs(Flex, { "data-name": "expression-toolbar", className: `${baseClassName} twa:pt-1 twa:pb-2 twa:mb-2 twa:mt-0 twa:w-full twa:shrink-0 ${isCompact ? 'twa:pb-1 twa:mb-1' : ''}`, flexDirection: "column", children: [_jsxs(Flex, { className: "twa:w-full twa:min-h-8 twa:items-center twa:justify-between twa:gap-2", children: [_jsx(Flex, { className: "twa:flex-wrap twa:items-center", children: (props.functionMenuVariant ?? 'legacy') === 'basic' ? (_jsx(BasicFunctionMenus, { expressionFunctions: menuExpressionFunctions, editorButtons: props.editorButtons, baseClassName: baseClassName, extraFunctionMenus: props.extraFunctionMenus, prioritizeObservableMenu: props.prioritizeObservableMenu, suppressObservableMenu: props.suppressObservableMenu, getInsertText: getMenuInsertText })) : isCompact ? (_jsx(CompactExpressionToolbar, { expressionFunctions: menuExpressionFunctions, columns: props.columnsDropdownItems ?? [], getInsertText: getMenuInsertText, toolbarFunctionNames: props.compactIncludeToolbarFunctions ? undefined : toolbarFunctionNames })) : (_jsx(_Fragment, { children: (() => {
|
|
1084
|
+
return (_jsxs(Flex, { flexDirection: "column", className: isCompact ? 'twa:h-full twa:min-h-0 twa:overflow-hidden' : undefined, children: [_jsxs(Flex, { "data-name": "expression-toolbar", className: `${baseClassName} twa:pt-1 twa:pb-2 twa:mb-2 twa:mt-0 twa:w-full twa:shrink-0 ${isCompact ? 'twa:pb-1 twa:mb-1' : ''}`, flexDirection: "column", children: [_jsxs(Flex, { className: "twa:w-full twa:min-h-8 twa:items-center twa:justify-between twa:gap-2", children: [_jsx(Flex, { className: "twa:flex-wrap twa:items-center", children: (props.functionMenuVariant ?? 'legacy') === 'basic' ? (_jsx(BasicFunctionMenus, { expressionFunctions: menuExpressionFunctions, editorButtons: props.editorButtons, baseClassName: baseClassName, extraFunctionMenus: props.extraFunctionMenus, prioritizeObservableMenu: props.prioritizeObservableMenu, suppressObservableMenu: props.suppressObservableMenu, getInsertText: getMenuInsertText })) : isCompact ? (_jsx(CompactExpressionToolbar, { expressionFunctions: menuExpressionFunctions, columns: props.columnsDropdownItems ?? [], getInsertText: getMenuInsertText, suppressObservable: props.suppressObservableMenu, toolbarFunctionNames: props.compactIncludeToolbarFunctions ? undefined : toolbarFunctionNames })) : (_jsx(_Fragment, { children: (() => {
|
|
1085
1085
|
const menuVariant = props.functionMenuVariant;
|
|
1086
1086
|
const isAggregatedVariant = menuVariant === 'aggregated';
|
|
1087
1087
|
const whereStrip = menuVariant != null &&
|
|
@@ -24,5 +24,10 @@ export declare const CompactExpressionToolbar: React.FunctionComponent<{
|
|
|
24
24
|
toolbarFunctionNames?: Set<string>;
|
|
25
25
|
/** Pool-aware insert text (brace calls); defaults to the paren spelling. */
|
|
26
26
|
getInsertText?: (functionName: string) => string;
|
|
27
|
+
/**
|
|
28
|
+
* When true (Standard Calculated Column), omit live sources and timeframe
|
|
29
|
+
* / history clauses from Functions. Observable compact keeps them.
|
|
30
|
+
*/
|
|
31
|
+
suppressObservable?: boolean;
|
|
27
32
|
}>;
|
|
28
33
|
export {};
|
|
@@ -6,6 +6,7 @@ import { useExpressionEditor } from './EditorContext';
|
|
|
6
6
|
import { getFunctionInsertText } from './functionInsertText';
|
|
7
7
|
import { useLookupItems } from './useLookupItems';
|
|
8
8
|
import StringExtensions from '../../../Utilities/Extensions/StringExtensions';
|
|
9
|
+
const OBSERVABLE_ONLY_CATEGORIES = new Set(['observable', 'timeframe', 'history']);
|
|
9
10
|
const SIDEBAR_REFERENCE_FUNCTION_NAMES = new Set(['COL', 'FIELD', '$SCOPE']);
|
|
10
11
|
const LOOKUP_FUNCTION_NAMES = new Set(['QUERY', 'VAR']);
|
|
11
12
|
const EXCLUDED_FROM_COMPACT_FUNCTIONS = new Set([
|
|
@@ -22,10 +23,13 @@ const CATEGORY_ORDER = {
|
|
|
22
23
|
numeric: 5,
|
|
23
24
|
date: 6,
|
|
24
25
|
changes: 7,
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
history: 8,
|
|
27
|
+
timeframe: 9,
|
|
28
|
+
observable: 10,
|
|
29
|
+
general: 11,
|
|
30
|
+
custom: 12,
|
|
27
31
|
};
|
|
28
|
-
export const CompactExpressionToolbar = ({ expressionFunctions, columns, toolbarFunctionNames, getInsertText }) => {
|
|
32
|
+
export const CompactExpressionToolbar = ({ expressionFunctions, columns, toolbarFunctionNames, getInsertText, suppressObservable, }) => {
|
|
29
33
|
const { expressionEditorRef } = useExpressionEditor();
|
|
30
34
|
const { queryVariables, namedQueries, hasLookups } = useLookupItems(expressionFunctions);
|
|
31
35
|
const insert = React.useCallback((text) => {
|
|
@@ -46,6 +50,9 @@ export const CompactExpressionToolbar = ({ expressionFunctions, columns, toolbar
|
|
|
46
50
|
const category = typeof rawCategory === 'string' && rawCategory.trim() !== ''
|
|
47
51
|
? rawCategory.trim()
|
|
48
52
|
: 'general';
|
|
53
|
+
if (suppressObservable && OBSERVABLE_ONLY_CATEGORIES.has(category)) {
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
49
56
|
const existing = byCategory.get(category) ?? [];
|
|
50
57
|
existing.push({ label: name, value: name, textLabel: name });
|
|
51
58
|
byCategory.set(category, existing);
|
|
@@ -58,7 +65,7 @@ export const CompactExpressionToolbar = ({ expressionFunctions, columns, toolbar
|
|
|
58
65
|
items: items.sort((a, b) => a.label.localeCompare(b.label)),
|
|
59
66
|
}))
|
|
60
67
|
.filter((group) => group.items.length > 0);
|
|
61
|
-
}, [expressionFunctions, toolbarFunctionNames]);
|
|
68
|
+
}, [expressionFunctions, toolbarFunctionNames, suppressObservable]);
|
|
62
69
|
const columnItems = React.useMemo(() => {
|
|
63
70
|
return columns.map((column) => {
|
|
64
71
|
const label = column.friendlyName || column.columnId;
|
|
@@ -93,7 +100,7 @@ export const CompactExpressionToolbar = ({ expressionFunctions, columns, toolbar
|
|
|
93
100
|
}
|
|
94
101
|
return groups;
|
|
95
102
|
}, [namedQueries, queryVariables]);
|
|
96
|
-
return (_jsxs(Flex, { className: "twa:flex-row twa:flex-wrap twa:items-center twa:gap-1", "data-name": "compact-expression-toolbar", children: [_jsx(CompactInsertCombobox, { dataName: "expression-functions-dropdown", placeholder: "Functions", widthClassName: "twa:w-[
|
|
103
|
+
return (_jsxs(Flex, { className: "twa:flex-row twa:flex-wrap twa:items-center twa:gap-1", "data-name": "compact-expression-toolbar", children: [_jsx(CompactInsertCombobox, { dataName: "expression-functions-dropdown", placeholder: "Functions", widthClassName: "twa:w-[8.5rem]", groups: functionGroups, onInsert: (functionName) => insert((getInsertText ?? getFunctionInsertText)(functionName)) }), columnItems.length > 0 ? (_jsx(CompactInsertCombobox, { dataName: "expression-columns-dropdown", placeholder: "Columns", items: columnItems, onInsert: (columnId) => insert(`[${columnId}]`) })) : null, hasLookups && lookupGroups.length > 0 ? (_jsx(CompactInsertCombobox, { dataName: "expression-lookups-dropdown", placeholder: "Lookups", groups: lookupGroups, onInsert: (value) => {
|
|
97
104
|
if (value.startsWith('var:')) {
|
|
98
105
|
insert(`VAR('${value.slice(4)}')`);
|
|
99
106
|
return;
|
|
@@ -11,7 +11,7 @@ export const ExpressionPreview = (props) => {
|
|
|
11
11
|
const displayColumnFriendlyNames = adaptableApi.optionsApi.getExpressionOptions()?.displayColumnFriendlyNamesForExpressions;
|
|
12
12
|
const text = props.expression ?? undefined;
|
|
13
13
|
const expression = displayColumnFriendlyNames && text
|
|
14
|
-
? adaptableApi.expressionApi.
|
|
14
|
+
? adaptableApi.expressionApi.getExpressionWithColumnFriendlyNames(text)
|
|
15
15
|
: text;
|
|
16
16
|
const canonical = toCanonical(expression);
|
|
17
17
|
if (!canonical) {
|
|
@@ -32,8 +32,9 @@ interface ExpressionEditorProps {
|
|
|
32
32
|
scalarVariant?: ScalarEditorVariant;
|
|
33
33
|
/**
|
|
34
34
|
* When true on a `scalar` editor, hide Observable chrome (Live chips, Observable
|
|
35
|
-
* Function menu, brace completions) even if the
|
|
36
|
-
* pool. Used by
|
|
35
|
+
* Function menu, brace completions, timeframe / history Functions) even if the
|
|
36
|
+
* module offers the observable pool. Used by Standard Calculated Columns and
|
|
37
|
+
* Change / Relative Change surfaces so they stay uncluttered.
|
|
37
38
|
*/
|
|
38
39
|
suppressObservable?: boolean;
|
|
39
40
|
module: AdaptableModule;
|
package/src/env.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
NEXT_PUBLIC_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:
|
|
4
|
-
VERSION: "24.0.0-canary.
|
|
3
|
+
PUBLISH_TIMESTAMP: 1791377450889 || Date.now(),
|
|
4
|
+
VERSION: "24.0.0-canary.1" || '--current-version--',
|
|
5
5
|
};
|