@adaptabletools/adaptable 18.1.0 → 18.1.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/package.json +1 -1
- package/src/AdaptableOptions/ColumnFilterOptions.d.ts +6 -0
- package/src/AdaptableOptions/ExportOptions.d.ts +9 -0
- package/src/AdaptableOptions/ExpressionOptions.d.ts +2 -2
- package/src/Api/Internal/AlertInternalApi.js +2 -2
- package/src/Utilities/Constants/DocumentationLinkConstants.d.ts +1 -0
- package/src/Utilities/Constants/DocumentationLinkConstants.js +1 -0
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +0 -1
- package/src/Utilities/Services/QueryLanguageService.js +31 -15
- package/src/View/Alert/Wizard/AlertMessageWizardSection.js +12 -3
- package/src/agGrid/AdaptableAgGrid.js +1 -1
- package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +1 -19
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +1 -19
- package/src/agGrid/editors/AdaptablePercentageEditor/InternalAdaptablePercentageEditor.d.ts +2 -2
- package/src/agGrid/editors/AdaptablePercentageEditor/index.d.ts +2 -20
- package/src/agGrid/editors/AdaptablePercentageEditor/index.js +1 -19
- package/src/components/ExpressionEditor/QueryBuilder/QueryBuilderInputs.js +1 -1
- package/src/components/ExpressionEditor/QueryBuilder/QueryPredicateBuilder.js +3 -3
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +18 -0
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/parser/src/types.d.ts +50 -24
- package/src/types.d.ts +1 -1
- package/tsconfig.esm.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable",
|
|
3
|
-
"version": "18.1.
|
|
3
|
+
"version": "18.1.1",
|
|
4
4
|
"description": "Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components",
|
|
@@ -258,7 +258,13 @@ export interface ColumnFilterContext<TData = any> extends BaseContext {
|
|
|
258
258
|
* Context used for setting whether a Row can be Column Filtered
|
|
259
259
|
*/
|
|
260
260
|
export interface IsRowFilterableContext<TData = any> extends BaseContext {
|
|
261
|
+
/**
|
|
262
|
+
* The Row Node about to be evaluated
|
|
263
|
+
*/
|
|
261
264
|
rowNode: IRowNode;
|
|
265
|
+
/**
|
|
266
|
+
* The data in the Row Node
|
|
267
|
+
*/
|
|
262
268
|
data: TData;
|
|
263
269
|
}
|
|
264
270
|
/**
|
|
@@ -211,7 +211,16 @@ export interface DataFormatTypeContext extends BaseContext {
|
|
|
211
211
|
* Defines the Format Data Types for all Data Types
|
|
212
212
|
*/
|
|
213
213
|
export interface DataFormatDataType {
|
|
214
|
+
/**
|
|
215
|
+
* Data Format type for String columns
|
|
216
|
+
*/
|
|
214
217
|
string?: DataFormatType;
|
|
218
|
+
/**
|
|
219
|
+
* Data Format type for Number columns
|
|
220
|
+
*/
|
|
215
221
|
number?: DataFormatType;
|
|
222
|
+
/**
|
|
223
|
+
* Data Format type for Date columns
|
|
224
|
+
*/
|
|
216
225
|
date?: DataFormatType;
|
|
217
226
|
}
|
|
@@ -2,7 +2,7 @@ import { AdaptablePredicate } from '../PredefinedConfig/Common/AdaptablePredicat
|
|
|
2
2
|
import { AdaptableModule, AdaptableQLModule } from '../PredefinedConfig/Common/Types';
|
|
3
3
|
import { BaseContext } from '../PredefinedConfig/Common/BaseContext';
|
|
4
4
|
import { AdaptableColumn, AdaptableColumnBase } from '../PredefinedConfig/Common/AdaptableColumn';
|
|
5
|
-
import { AdaptableObject, AggregatedBooleanFunctionName,
|
|
5
|
+
import { AdaptableObject, AggregatedBooleanFunctionName, AggregatedExpressionFunction, AggregatedScalarFunctionName, BooleanFunctionName, ExpressionFunction, ObservableFunctionName, ScalarFunctionName, AdaptableField } from '../types';
|
|
6
6
|
/**
|
|
7
7
|
* Options for managing Expressions in AdapTable's Query Language
|
|
8
8
|
*/
|
|
@@ -64,7 +64,7 @@ export interface ExpressionOptions<TData = any> {
|
|
|
64
64
|
/**
|
|
65
65
|
* Bespoke Aggregated Scalar functions - to complement those provided by AdapTable
|
|
66
66
|
*/
|
|
67
|
-
|
|
67
|
+
customAggregatedFunctions?: Record<string, AggregatedExpressionFunction> | ((context: GlobalExpressionFunctionsContext<string>) => Record<string, AggregatedExpressionFunction>);
|
|
68
68
|
/**
|
|
69
69
|
* Module-specific Expression Functions available
|
|
70
70
|
*
|
|
@@ -662,8 +662,8 @@ export class AlertInternalApi extends ApiBase {
|
|
|
662
662
|
(_a = (dataChangeTriggerMap[context.trigger] || rowChangeTriggerMap[context.trigger])) !== null && _a !== void 0 ? _a : context.trigger;
|
|
663
663
|
text = this.replaceAll(text, '[trigger]', mappedTrigger);
|
|
664
664
|
}
|
|
665
|
-
if (
|
|
666
|
-
text = this.replaceAll(text, '[column]', this.
|
|
665
|
+
if (context === null || context === void 0 ? void 0 : context.column) {
|
|
666
|
+
text = this.replaceAll(text, '[column]', this.getColumnApi().getFriendlyNameForColumnId(context.column.columnId));
|
|
667
667
|
}
|
|
668
668
|
if (context === null || context === void 0 ? void 0 : context.rowNode) {
|
|
669
669
|
const columns = this.extractColsFromText(text);
|
|
@@ -13,3 +13,4 @@ export const PrimaryKeyDocsLink = `${HOST_URL_DOCS}/guide/getting-started-primar
|
|
|
13
13
|
export const LicenseDocsLink = `${HOST_URL_DOCS}/guide/licensing`;
|
|
14
14
|
export const AdaptableOptionsDocsLink = `${HOST_URL_DOCS}/guide/reference-options-overview`;
|
|
15
15
|
export const AgGridModulesDocsLink = `${HOST_URL_DOCS}/guide/dev-guide-aggrid-modules-overview`;
|
|
16
|
+
export const AlertMessageDocsLink = `${HOST_URL_DOCS}/guide/handbook-alerting-message`;
|
|
@@ -332,7 +332,7 @@ export class QueryLanguageService {
|
|
|
332
332
|
}
|
|
333
333
|
getCustomAggregatedScalarFunctions() {
|
|
334
334
|
var _a;
|
|
335
|
-
const customAggregatedScalarFunctions = (_a = this.adaptableApi.optionsApi.getExpressionOptions()) === null || _a === void 0 ? void 0 : _a.
|
|
335
|
+
const customAggregatedScalarFunctions = (_a = this.adaptableApi.optionsApi.getExpressionOptions()) === null || _a === void 0 ? void 0 : _a.customAggregatedFunctions;
|
|
336
336
|
if (!customAggregatedScalarFunctions) {
|
|
337
337
|
return {};
|
|
338
338
|
}
|
|
@@ -351,21 +351,22 @@ export class QueryLanguageService {
|
|
|
351
351
|
return Object.entries(aggregatedScalarFunctions).reduce((acc, [expressionName, customExpressionDefinition]) => {
|
|
352
352
|
const expression = {
|
|
353
353
|
handler: (args, context) => {
|
|
354
|
-
// There is built in support for column validation
|
|
355
|
-
// TODO: change to extractParameters
|
|
356
|
-
// { colArgs: { [colId]: value } }
|
|
357
354
|
const [aggColParam, ...restOfColParams] = extractColumnParameters(expressionName, args);
|
|
358
355
|
const aggColumnId = aggColParam === null || aggColParam === void 0 ? void 0 : aggColParam.value;
|
|
359
356
|
const groupByParameter = extractParameter(expressionName, 'operand', ['GROUP_BY'], args, {
|
|
360
357
|
isOptional: true,
|
|
361
358
|
});
|
|
362
|
-
const
|
|
359
|
+
const groupByColumnIds = groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value;
|
|
360
|
+
const contextArgs = args.filter((arg) => {
|
|
363
361
|
if (typeof arg === 'object' && arg.name === 'COL') {
|
|
364
|
-
// filter out
|
|
362
|
+
// filter out aggregation column
|
|
365
363
|
return arg.value !== aggColumnId;
|
|
366
364
|
}
|
|
367
|
-
|
|
368
|
-
|
|
365
|
+
if (typeof arg === 'object' && arg.name === 'GROUP_BY') {
|
|
366
|
+
// filter out groupBy column
|
|
367
|
+
return false;
|
|
368
|
+
}
|
|
369
|
+
return true;
|
|
369
370
|
});
|
|
370
371
|
const aggregationExpressionEvaluation = {
|
|
371
372
|
aggregationParams: {
|
|
@@ -375,18 +376,20 @@ export class QueryLanguageService {
|
|
|
375
376
|
field: aggColumnId,
|
|
376
377
|
initialValue: customExpressionDefinition.initialValue,
|
|
377
378
|
reducer: (acc, value, rowNode, dataIndex) => {
|
|
378
|
-
const context = Object.assign({ rowNode, args:
|
|
379
|
+
const context = Object.assign({ rowNode, args: contextArgs.map((arg) => {
|
|
379
380
|
// if col, replace with value
|
|
380
381
|
if (typeof arg === 'object' && arg.name === 'COL') {
|
|
381
382
|
return getValueForColId(arg.value, rowNode);
|
|
382
383
|
}
|
|
383
384
|
return arg;
|
|
384
|
-
}), aggColumnId,
|
|
385
|
+
}), aggColumnId,
|
|
386
|
+
groupByColumnIds, getValueForColId: (colId) => getValueForColId(colId, rowNode) }, createBaseContext(this.adaptableApi));
|
|
385
387
|
return customExpressionDefinition.reducer(acc, value, dataIndex, context);
|
|
386
388
|
},
|
|
387
389
|
done: (accValue, dataArray) => {
|
|
388
|
-
if (customExpressionDefinition.
|
|
389
|
-
return customExpressionDefinition.
|
|
390
|
+
if (customExpressionDefinition.processAggregatedValue) {
|
|
391
|
+
return customExpressionDefinition.processAggregatedValue(accValue, dataArray, Object.assign(Object.assign({}, createBaseContext(this.adaptableApi)), { args: contextArgs, aggColumnId,
|
|
392
|
+
groupByColumnIds }));
|
|
390
393
|
}
|
|
391
394
|
return accValue;
|
|
392
395
|
},
|
|
@@ -395,15 +398,28 @@ export class QueryLanguageService {
|
|
|
395
398
|
},
|
|
396
399
|
rowValueGetter: (rowNode, aggregationValue) => {
|
|
397
400
|
if (customExpressionDefinition.prepareRowValue) {
|
|
398
|
-
return customExpressionDefinition.prepareRowValue(rowNode, aggregationValue, Object.assign(Object.assign({}, createBaseContext(this.adaptableApi)), {
|
|
399
|
-
|
|
401
|
+
return customExpressionDefinition.prepareRowValue(rowNode, aggregationValue, Object.assign(Object.assign({}, createBaseContext(this.adaptableApi)), { args: contextArgs.map((arg) => {
|
|
402
|
+
// if col, replace with value
|
|
403
|
+
if (typeof arg === 'object' && arg.name === 'COL') {
|
|
404
|
+
return getValueForColId(arg.value, rowNode);
|
|
405
|
+
}
|
|
406
|
+
return arg;
|
|
407
|
+
}), aggColumnId,
|
|
408
|
+
groupByColumnIds, getValueForColId: (colId) => getValueForColId(colId, rowNode) }));
|
|
400
409
|
}
|
|
401
410
|
return aggregationValue;
|
|
402
411
|
},
|
|
403
412
|
rowFilterFn: (rowNode) => {
|
|
404
413
|
var _a, _b;
|
|
405
414
|
if (customExpressionDefinition.rowFilter) {
|
|
406
|
-
return customExpressionDefinition.rowFilter(rowNode, Object.assign(Object.assign({}, createBaseContext(this.adaptableApi)), {
|
|
415
|
+
return customExpressionDefinition.rowFilter(rowNode, Object.assign(Object.assign({}, createBaseContext(this.adaptableApi)), { args: contextArgs.map((arg) => {
|
|
416
|
+
// if col, replace with value
|
|
417
|
+
if (typeof arg === 'object' && arg.name === 'COL') {
|
|
418
|
+
return getValueForColId(arg.value, rowNode);
|
|
419
|
+
}
|
|
420
|
+
return arg;
|
|
421
|
+
}), aggColumnId,
|
|
422
|
+
groupByColumnIds, getValueForColId: (colId) => getValueForColId(colId, rowNode) }));
|
|
407
423
|
}
|
|
408
424
|
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
425
|
},
|
|
@@ -4,8 +4,11 @@ import Radio, { RadioGroup } from '../../../components/Radio';
|
|
|
4
4
|
import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableWizard';
|
|
5
5
|
import { Text } from 'rebass';
|
|
6
6
|
import { CodeBlock } from '../../../components/CodeBlock';
|
|
7
|
-
import AdaptableInput from '../../Components/AdaptableInput';
|
|
8
7
|
import FormLayout, { FormRow } from '../../../components/FormLayout';
|
|
8
|
+
import { ButtonInfo } from '../../Components/Buttons/ButtonInfo';
|
|
9
|
+
import { AlertMessageDocsLink } from '../../../Utilities/Constants/DocumentationLinkConstants';
|
|
10
|
+
import Textarea from '../../../components/Textarea';
|
|
11
|
+
import HelpBlock from '../../../components/HelpBlock';
|
|
9
12
|
export const renderAlertMessageSummary = () => {
|
|
10
13
|
const { data } = useOnePageAdaptableWizardContext();
|
|
11
14
|
return (React.createElement(Text, { fontSize: 2 },
|
|
@@ -43,9 +46,15 @@ export const AlertMessageWizardSection = (props) => {
|
|
|
43
46
|
' ',
|
|
44
47
|
React.createElement(FormLayout, null,
|
|
45
48
|
React.createElement(FormRow, { label: "Header" },
|
|
46
|
-
React.createElement(
|
|
49
|
+
React.createElement(Textarea, { minWidth: 300, rows: 3, placeholder: "use defaults", marginTop: 2, type: 'text', autoFocus: false, value: messageHeader !== null && messageHeader !== void 0 ? messageHeader : '',
|
|
47
50
|
// placeholder="defaults to column name"
|
|
48
51
|
onChange: (e) => onMessageHeaderChange(e) })),
|
|
49
52
|
React.createElement(FormRow, { label: "Message" },
|
|
50
|
-
React.createElement(
|
|
53
|
+
React.createElement(Textarea, { minWidth: 300, rows: 3, marginTop: 2, type: 'text', autoFocus: false, value: messageText !== null && messageText !== void 0 ? messageText : '', onChange: (e) => onMessageTextChange(e) }))),
|
|
54
|
+
React.createElement(HelpBlock, { "data-name": "alert-message-documentation", mt: 3, mb: 2, style: {
|
|
55
|
+
fontSize: 'var(--ab-font-size-3)',
|
|
56
|
+
padding: 0,
|
|
57
|
+
} },
|
|
58
|
+
React.createElement(ButtonInfo, { mr: 2, onClick: () => window.open(AlertMessageDocsLink, '_blank') }),
|
|
59
|
+
"See Alert Message documentation for more details and examples")))));
|
|
51
60
|
};
|
|
@@ -1365,7 +1365,7 @@ export class AdaptableAgGrid {
|
|
|
1365
1365
|
*/
|
|
1366
1366
|
this.agGridAdapter.getAgGridApi().addEventListener(Events.EVENT_FIRST_DATA_RENDERED, (this.listenerFirstDataRendered = () => {
|
|
1367
1367
|
if (this.initWithLazyData) {
|
|
1368
|
-
this.updateColumnModelAndRefreshGrid();
|
|
1368
|
+
this.updateColumnModelAndRefreshGrid({ skipColDefsRefresh: true });
|
|
1369
1369
|
this.api.calculatedColumnApi.refreshAggregatedCalculatedColumns();
|
|
1370
1370
|
this._emit('FirstDataRendered');
|
|
1371
1371
|
}
|
|
@@ -19,25 +19,7 @@ export interface AdaptableNumberCellEditorParams extends ICellEditorParams {
|
|
|
19
19
|
}
|
|
20
20
|
export declare const AdaptableReactNumberEditor: React.ForwardRefExoticComponent<AdaptableNumberCellEditorParams & React.RefAttributes<unknown>>;
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* You can configure it by specifying `cellEditorParams` in the colDef:
|
|
25
|
-
*
|
|
26
|
-
* colDef {
|
|
27
|
-
* field: 'stars',
|
|
28
|
-
* type: 'abColDefNumber',
|
|
29
|
-
* cellEditorParams: {
|
|
30
|
-
* emptyValue: 5, // defaults to ''
|
|
31
|
-
* showClearButton: false
|
|
32
|
-
* }
|
|
33
|
-
* }
|
|
34
|
-
*
|
|
35
|
-
* For now, there are 2 editor params you can configure:
|
|
36
|
-
*
|
|
37
|
-
* cellEditorParams.showClearButton - defaults to `true` - whether to show the clear button. If `true`, it works together with `cellEditorParams.emptyValue`
|
|
38
|
-
* cellEditorParams.emptyValue - defaults to `''` (empty string) - value to set for the cell, when the clear button is pressed.
|
|
39
|
-
*
|
|
40
|
-
* When the colDef has a `valueParser` provided as a function, it will be used before setting the value for the cell.
|
|
22
|
+
* Number Editor provided by AdapTable and used by default for all `abColDefNumber` columns
|
|
41
23
|
*/
|
|
42
24
|
export declare class AdaptableNumberEditor implements ICellEditorComp {
|
|
43
25
|
private value;
|
|
@@ -77,25 +77,7 @@ export const AdaptableReactNumberEditor = forwardRef((props, ref) => {
|
|
|
77
77
|
});
|
|
78
78
|
AdaptableReactNumberEditor.displayName = 'AdaptableReactNumberEditor';
|
|
79
79
|
/**
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
* You can configure it by specifying `cellEditorParams` in the colDef:
|
|
83
|
-
*
|
|
84
|
-
* colDef {
|
|
85
|
-
* field: 'stars',
|
|
86
|
-
* type: 'abColDefNumber',
|
|
87
|
-
* cellEditorParams: {
|
|
88
|
-
* emptyValue: 5, // defaults to ''
|
|
89
|
-
* showClearButton: false
|
|
90
|
-
* }
|
|
91
|
-
* }
|
|
92
|
-
*
|
|
93
|
-
* For now, there are 2 editor params you can configure:
|
|
94
|
-
*
|
|
95
|
-
* cellEditorParams.showClearButton - defaults to `true` - whether to show the clear button. If `true`, it works together with `cellEditorParams.emptyValue`
|
|
96
|
-
* cellEditorParams.emptyValue - defaults to `''` (empty string) - value to set for the cell, when the clear button is pressed.
|
|
97
|
-
*
|
|
98
|
-
* When the colDef has a `valueParser` provided as a function, it will be used before setting the value for the cell.
|
|
80
|
+
* Number Editor provided by AdapTable and used by default for all `abColDefNumber` columns
|
|
99
81
|
*/
|
|
100
82
|
export class AdaptableNumberEditor {
|
|
101
83
|
constructor() {
|
|
@@ -5,7 +5,7 @@ export type InternalAdaptablePercentageEditorApi = {
|
|
|
5
5
|
};
|
|
6
6
|
export type InternalAdaptablePercentageEditorProps = {
|
|
7
7
|
/**
|
|
8
|
-
* Value to set when the
|
|
8
|
+
* Value to set when the Clear button is clicked
|
|
9
9
|
*/
|
|
10
10
|
emptyValue?: string | number;
|
|
11
11
|
defaultValue?: string | number;
|
|
@@ -15,7 +15,7 @@ export type InternalAdaptablePercentageEditorProps = {
|
|
|
15
15
|
*/
|
|
16
16
|
type?: string;
|
|
17
17
|
/**
|
|
18
|
-
* Whether to show the
|
|
18
|
+
* Whether to show the Clear button; defaults to true
|
|
19
19
|
*/
|
|
20
20
|
showClearButton?: boolean;
|
|
21
21
|
onValueChange?: (value: string | number) => void;
|
|
@@ -2,31 +2,13 @@ import * as React from 'react';
|
|
|
2
2
|
import { ICellEditorComp } from '@ag-grid-community/core';
|
|
3
3
|
import { AdaptableNumberCellEditorParams } from '../AdaptableNumberEditor';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* AdapTablePercentageCellEditor parameters - extends AdaptableNumberCellEditorParams
|
|
6
6
|
*/
|
|
7
7
|
export interface AdaptablePercentageCellEditorParams extends AdaptableNumberCellEditorParams {
|
|
8
8
|
}
|
|
9
9
|
export declare const AdaptableReactPercentageEditor: React.ForwardRefExoticComponent<AdaptablePercentageCellEditorParams & React.RefAttributes<unknown>>;
|
|
10
10
|
/**
|
|
11
|
-
* Used
|
|
12
|
-
*
|
|
13
|
-
* You can configure it by specifying `cellEditorParams` in the colDef:
|
|
14
|
-
*
|
|
15
|
-
* colDef {
|
|
16
|
-
* field: 'stars',
|
|
17
|
-
* type: 'abColDefNumber',
|
|
18
|
-
* cellEditorParams: {
|
|
19
|
-
* emptyValue: 5, // defaults to ''
|
|
20
|
-
* showClearButton: false
|
|
21
|
-
* }
|
|
22
|
-
* }
|
|
23
|
-
*
|
|
24
|
-
* For now, there are 2 editor params you can configure:
|
|
25
|
-
*
|
|
26
|
-
* cellEditorParams.showClearButton - defaults to `true` - whether to show the clear button. If `true`, it works together with `cellEditorParams.emptyValue`
|
|
27
|
-
* cellEditorParams.emptyValue - defaults to `''` (empty string) - value to set for the cell, when the clear button is pressed.
|
|
28
|
-
*
|
|
29
|
-
* When the colDef has a `valueParser` provided as a function, it will be used before setting the value for the cell.
|
|
11
|
+
* Used to edit percentage columns as percentages (similar to how its done in Excel)
|
|
30
12
|
*/
|
|
31
13
|
export declare class AdaptablePercentageEditor implements ICellEditorComp {
|
|
32
14
|
private value;
|
|
@@ -62,25 +62,7 @@ export const AdaptableReactPercentageEditor = forwardRef((props, ref) => {
|
|
|
62
62
|
});
|
|
63
63
|
AdaptableReactPercentageEditor.displayName = 'AdaptableReactPercentageEditor';
|
|
64
64
|
/**
|
|
65
|
-
* Used
|
|
66
|
-
*
|
|
67
|
-
* You can configure it by specifying `cellEditorParams` in the colDef:
|
|
68
|
-
*
|
|
69
|
-
* colDef {
|
|
70
|
-
* field: 'stars',
|
|
71
|
-
* type: 'abColDefNumber',
|
|
72
|
-
* cellEditorParams: {
|
|
73
|
-
* emptyValue: 5, // defaults to ''
|
|
74
|
-
* showClearButton: false
|
|
75
|
-
* }
|
|
76
|
-
* }
|
|
77
|
-
*
|
|
78
|
-
* For now, there are 2 editor params you can configure:
|
|
79
|
-
*
|
|
80
|
-
* cellEditorParams.showClearButton - defaults to `true` - whether to show the clear button. If `true`, it works together with `cellEditorParams.emptyValue`
|
|
81
|
-
* cellEditorParams.emptyValue - defaults to `''` (empty string) - value to set for the cell, when the clear button is pressed.
|
|
82
|
-
*
|
|
83
|
-
* When the colDef has a `valueParser` provided as a function, it will be used before setting the value for the cell.
|
|
65
|
+
* Used to edit percentage columns as percentages (similar to how its done in Excel)
|
|
84
66
|
*/
|
|
85
67
|
export class AdaptablePercentageEditor {
|
|
86
68
|
constructor() {
|
|
@@ -161,7 +161,7 @@ export const PrimiteValueInput = (props) => {
|
|
|
161
161
|
editor));
|
|
162
162
|
};
|
|
163
163
|
export const PrimitiveMultiValueInput = (props) => {
|
|
164
|
-
return (React.createElement(PermittedValuesSelector, { isMulti: true, allowNewValues: true, value: props.value, columnId: props.lefthandColumnIdParam, onChange: (value) => {
|
|
164
|
+
return (React.createElement(PermittedValuesSelector, { isMulti: true, allowNewValues: true, value: props.value, columnId: mapColumnExpressionToColumnId(props.lefthandColumnIdParam), onChange: (value) => {
|
|
165
165
|
props.onChange(value);
|
|
166
166
|
} }));
|
|
167
167
|
};
|
|
@@ -151,18 +151,18 @@ const PrimitiveFunctionEditor = (props) => {
|
|
|
151
151
|
}, value: props.predicate.operator })),
|
|
152
152
|
React.createElement(Flex, { flex: 1, ml: 2 }, restOfFunctionInputDataTypes.map((type, index) => {
|
|
153
153
|
var _a;
|
|
154
|
+
const key = type + index;
|
|
154
155
|
const commonProps = {
|
|
155
|
-
key: type + index,
|
|
156
156
|
lefthandColumnIdParam: columnOrFieldId,
|
|
157
157
|
inputType: type,
|
|
158
158
|
};
|
|
159
159
|
if (type.includes('[]')) {
|
|
160
|
-
return (React.createElement(PrimitiveMultiValueInput, Object.assign({}, commonProps, { value: restOfArgs, onChange: (values) => {
|
|
160
|
+
return (React.createElement(PrimitiveMultiValueInput, Object.assign({}, commonProps, { key: key, value: restOfArgs, onChange: (values) => {
|
|
161
161
|
const args = [...props.predicate.args.slice(0, 1), ...values];
|
|
162
162
|
props.onChange(Object.assign(Object.assign({}, props.predicate), { args }));
|
|
163
163
|
} })));
|
|
164
164
|
}
|
|
165
|
-
return (React.createElement(PrimiteValueInput, Object.assign({}, commonProps, { value: (_a = restOfArgs[index]) !== null && _a !== void 0 ? _a : null, onChange: (value) => {
|
|
165
|
+
return (React.createElement(PrimiteValueInput, Object.assign({}, commonProps, { key: key, value: (_a = restOfArgs[index]) !== null && _a !== void 0 ? _a : null, onChange: (value) => {
|
|
166
166
|
const args = [...props.predicate.args];
|
|
167
167
|
// +1 because col is the first argument
|
|
168
168
|
args[index + 1] = value;
|
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:
|
|
4
|
-
VERSION: "18.1.
|
|
3
|
+
PUBLISH_TIMESTAMP: 1718271522875 || Date.now(),
|
|
4
|
+
VERSION: "18.1.1" || '--current-version--',
|
|
5
5
|
};
|
|
@@ -2623,6 +2623,13 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
2623
2623
|
name: string;
|
|
2624
2624
|
kind: string;
|
|
2625
2625
|
desc: string;
|
|
2626
|
+
props: {
|
|
2627
|
+
name: string;
|
|
2628
|
+
kind: string;
|
|
2629
|
+
desc: string;
|
|
2630
|
+
isOpt: boolean;
|
|
2631
|
+
ref: string;
|
|
2632
|
+
}[];
|
|
2626
2633
|
};
|
|
2627
2634
|
DataFormatType: {
|
|
2628
2635
|
name: string;
|
|
@@ -3791,6 +3798,17 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
3791
3798
|
name: string;
|
|
3792
3799
|
kind: string;
|
|
3793
3800
|
desc: string;
|
|
3801
|
+
props: ({
|
|
3802
|
+
name: string;
|
|
3803
|
+
kind: string;
|
|
3804
|
+
desc: string;
|
|
3805
|
+
ref?: undefined;
|
|
3806
|
+
} | {
|
|
3807
|
+
name: string;
|
|
3808
|
+
kind: string;
|
|
3809
|
+
desc: string;
|
|
3810
|
+
ref: string;
|
|
3811
|
+
})[];
|
|
3794
3812
|
};
|
|
3795
3813
|
Layout: {
|
|
3796
3814
|
name: string;
|