@adaptabletools/adaptable 14.0.1-canary.1 → 14.0.1-canary.2
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/bundle.cjs.js +115 -115
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableOptions/ChartingOptions.d.ts +6 -0
- package/src/Api/Implementation/AlertApiImpl.js +1 -1
- package/src/PredefinedConfig/Common/Enums.d.ts +0 -9
- package/src/PredefinedConfig/Common/Enums.js +1 -11
- package/src/PredefinedConfig/Common/SpecialColumnSettings.d.ts +1 -1
- package/src/Strategy/FormatColumnModule.d.ts +1 -1
- package/src/Strategy/FormatColumnModule.js +11 -3
- package/src/Strategy/StyledColumnModule.js +6 -1
- package/src/Utilities/Services/CalculatedColumnExpressionService.d.ts +2 -2
- package/src/Utilities/Services/CalculatedColumnExpressionService.js +3 -0
- package/src/Utilities/Services/Interface/ICalculatedColumnExpressionService.d.ts +2 -2
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UiOptionsForm.js +11 -3
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +3 -1
- package/src/View/Components/Charting/useChartState.js +14 -9
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +4 -3
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +3 -3
- package/src/metamodel/adaptable.metamodel.d.ts +9 -2
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable",
|
|
3
|
-
"version": "14.0.1-canary.
|
|
3
|
+
"version": "14.0.1-canary.2",
|
|
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",
|
package/publishTimestamp.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: 1672852001158;
|
|
2
2
|
export default _default;
|
package/publishTimestamp.js
CHANGED
|
@@ -21,6 +21,12 @@ export interface ChartContainer {
|
|
|
21
21
|
* Name of the Location - used in Dropdowns
|
|
22
22
|
*/
|
|
23
23
|
name: string;
|
|
24
|
+
/**
|
|
25
|
+
* Weather a single chart can be displayed or multiple in the same location
|
|
26
|
+
*
|
|
27
|
+
* @defaults 'single'
|
|
28
|
+
*/
|
|
29
|
+
type?: 'single' | 'multiple';
|
|
24
30
|
/**
|
|
25
31
|
* Location - can be HTMLElement or Id of Div
|
|
26
32
|
*/
|
|
@@ -267,7 +267,7 @@ class AlertApiImpl extends ApiBase_1.ApiBase {
|
|
|
267
267
|
this.internalApi.executeAlertButton(button, context);
|
|
268
268
|
}
|
|
269
269
|
getActiveNonReactiveAlertDefinitions() {
|
|
270
|
-
(0, logDeprecation_1.logDeprecationInternal)('AlertApi', '
|
|
270
|
+
(0, logDeprecation_1.logDeprecationInternal)('AlertApi', 'getActiveNonReactiveAlertDefinitions');
|
|
271
271
|
return this.internalApi.getActiveNonReactiveAlertDefinitions();
|
|
272
272
|
}
|
|
273
273
|
getActiveReactiveAlertDefinitions() {
|
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// General Enums
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.ChangeDirection = exports.FilterOnDataChangeOptions = exports.SummaryOperation = exports.StatusColour = exports.ColumnMenuTab = exports.FontSize = exports.FontStyle = exports.FontWeight = exports.SelectionMode = exports.SortOrder = exports.ScheduleType = exports.ExportDestination = exports.MathOperation =
|
|
5
|
-
var DataType;
|
|
6
|
-
(function (DataType) {
|
|
7
|
-
DataType["String"] = "String";
|
|
8
|
-
DataType["Number"] = "Number";
|
|
9
|
-
DataType["Boolean"] = "Boolean";
|
|
10
|
-
DataType["Date"] = "Date";
|
|
11
|
-
DataType["Object"] = "Object";
|
|
12
|
-
DataType["Unknown"] = "Unknown";
|
|
13
|
-
DataType["All"] = "All";
|
|
14
|
-
})(DataType = exports.DataType || (exports.DataType = {}));
|
|
4
|
+
exports.ChangeDirection = exports.FilterOnDataChangeOptions = exports.SummaryOperation = exports.StatusColour = exports.ColumnMenuTab = exports.FontSize = exports.FontStyle = exports.FontWeight = exports.SelectionMode = exports.SortOrder = exports.ScheduleType = exports.ExportDestination = exports.MathOperation = void 0;
|
|
15
5
|
var MathOperation;
|
|
16
6
|
(function (MathOperation) {
|
|
17
7
|
MathOperation["Add"] = "Add";
|
|
@@ -5,7 +5,7 @@ export interface SpecialColumnSettings {
|
|
|
5
5
|
/**
|
|
6
6
|
* Expression's return value DataType, only mandatory property
|
|
7
7
|
*/
|
|
8
|
-
DataType: 'String' | 'Number' | 'Boolean' | 'Date';
|
|
8
|
+
DataType: 'String' | 'Number' | 'Boolean' | 'Date' | 'NumberArray';
|
|
9
9
|
/**
|
|
10
10
|
* Preferred (pixel) Column Width; if unset, calculated dynamically by AG Grid
|
|
11
11
|
*/
|
|
@@ -12,7 +12,7 @@ export declare class FormatColumnModule extends AdaptableModuleBase implements I
|
|
|
12
12
|
includeLayoutNotAssociatedObjects?: boolean;
|
|
13
13
|
}): AdaptableObject[];
|
|
14
14
|
getExplicitlyReferencedColumnIds(formatColumn: FormatColumn): string[];
|
|
15
|
-
|
|
15
|
+
getReferencedNamedQueryNames(formatColumn: FormatColumn): string[];
|
|
16
16
|
updateOldConfig(): void;
|
|
17
17
|
private updateFormatColumnSingleToMultiplePredicates;
|
|
18
18
|
private updateConditionalStylesColumnsOldConfig;
|
|
@@ -24,15 +24,23 @@ class FormatColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
24
24
|
return this.api.formatColumnApi.getFormatColumns(config);
|
|
25
25
|
}
|
|
26
26
|
getExplicitlyReferencedColumnIds(formatColumn) {
|
|
27
|
-
|
|
27
|
+
const queryExpression = this.api.queryLanguageApi.getAdaptableQueryExpression(formatColumn.Rule);
|
|
28
|
+
if (queryExpression) {
|
|
29
|
+
return this.api.queryLanguageApi.getColumnsFromExpression(queryExpression);
|
|
30
|
+
}
|
|
31
|
+
else if (this.api.scopeApi.scopeHasColumns(formatColumn.Scope)) {
|
|
28
32
|
return this.api.scopeApi
|
|
29
33
|
.getColumnsForScope(formatColumn.Scope)
|
|
30
34
|
.map((adaptableColumn) => adaptableColumn.columnId);
|
|
31
35
|
}
|
|
32
36
|
return [];
|
|
33
37
|
}
|
|
34
|
-
|
|
35
|
-
|
|
38
|
+
getReferencedNamedQueryNames(formatColumn) {
|
|
39
|
+
const queryExpression = this.api.queryLanguageApi.getAdaptableQueryExpression(formatColumn.Rule);
|
|
40
|
+
if (!queryExpression) {
|
|
41
|
+
return [];
|
|
42
|
+
}
|
|
43
|
+
return this.api.queryApi.internalApi.getReferencedNamedQueryNames(queryExpression);
|
|
36
44
|
}
|
|
37
45
|
updateOldConfig() {
|
|
38
46
|
this.updateConditionalStylesColumnsOldConfig();
|
|
@@ -108,9 +108,14 @@ class StyledColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
108
108
|
let styledColumn = this.api.styledColumnApi.getStyledColumnForColumnId(column.columnId);
|
|
109
109
|
let styledColumnExists = Boolean(styledColumn);
|
|
110
110
|
if (!styledColumn) {
|
|
111
|
+
const emptyRanges = this.api.scopeApi.createCellColorRangesForScope({
|
|
112
|
+
ColumnIds: [column.columnId],
|
|
113
|
+
});
|
|
111
114
|
styledColumn = Object.assign(Object.assign({}, ObjectFactory_1.default.CreateEmptyStyledColumn()), { ColumnId: column.columnId,
|
|
112
115
|
// numbers default to gradient
|
|
113
|
-
GradientStyle: {
|
|
116
|
+
GradientStyle: {
|
|
117
|
+
CellRanges: emptyRanges,
|
|
118
|
+
} });
|
|
114
119
|
}
|
|
115
120
|
if (styledColumn && styledColumn.IsReadOnly && styledColumn.IsReadOnly == true) {
|
|
116
121
|
styledColumnExists = false;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ICalculatedColumnExpressionService } from './Interface/ICalculatedColumnExpressionService';
|
|
2
2
|
import { RowNode } from '@ag-grid-community/core';
|
|
3
|
-
import { AdaptableCalculatedColumnQuery, CalculatedColumn } from '../../PredefinedConfig/CalculatedColumnState';
|
|
3
|
+
import { AdaptableCalculatedColumnQuery, CalculatedColumn, CalculatedColumnSettings } from '../../PredefinedConfig/CalculatedColumnState';
|
|
4
4
|
import { AdaptableApi } from '../../../types';
|
|
5
5
|
export declare class CalculatedColumnExpressionService implements ICalculatedColumnExpressionService {
|
|
6
6
|
private adaptableApi;
|
|
7
7
|
private aggregatedScalarLiveValuesMap;
|
|
8
8
|
constructor(adaptableApi: AdaptableApi);
|
|
9
9
|
destroy(): void;
|
|
10
|
-
getCalculatedColumnDataType(calculatedColumnQuery: AdaptableCalculatedColumnQuery): '
|
|
10
|
+
getCalculatedColumnDataType(calculatedColumnQuery: AdaptableCalculatedColumnQuery): CalculatedColumnSettings['DataType'];
|
|
11
11
|
isCalculatedColumnQueryValid(calculatedColumnQuery: AdaptableCalculatedColumnQuery): boolean;
|
|
12
12
|
evaluateCalculatedColumnQuery(calculatedColumn: CalculatedColumn, rowNode: RowNode): any;
|
|
13
13
|
createAggregatedScalarLiveValue(calculatedColumn: CalculatedColumn): void;
|
|
@@ -69,6 +69,9 @@ class CalculatedColumnExpressionService {
|
|
|
69
69
|
if (typeof firstRowValue === 'number') {
|
|
70
70
|
return 'Number';
|
|
71
71
|
}
|
|
72
|
+
if (Array.isArray(firstRowValue)) {
|
|
73
|
+
return 'NumberArray';
|
|
74
|
+
}
|
|
72
75
|
}
|
|
73
76
|
catch (e) {
|
|
74
77
|
(0, LoggingHelper_1.LogAdaptableWarning)(`Invalid CalculatedColumn expression ${this.adaptableApi.queryLanguageApi.getAdaptableQueryExpression(calculatedColumnQuery)} :: ${e}`);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { IAdaptableService } from './IAdaptableService';
|
|
2
2
|
import { RowNode } from '@ag-grid-community/core';
|
|
3
|
-
import { AdaptableCalculatedColumnQuery, CalculatedColumn } from '../../../PredefinedConfig/CalculatedColumnState';
|
|
3
|
+
import { AdaptableCalculatedColumnQuery, CalculatedColumn, CalculatedColumnSettings } from '../../../PredefinedConfig/CalculatedColumnState';
|
|
4
4
|
export interface ICalculatedColumnExpressionService extends IAdaptableService {
|
|
5
5
|
isCalculatedColumnQueryValid(calculatedColumnQuery: AdaptableCalculatedColumnQuery): boolean;
|
|
6
6
|
evaluateCalculatedColumnQuery(calculatedColumn: CalculatedColumn, rowNode: RowNode): any;
|
|
7
|
-
getCalculatedColumnDataType(calculatedColumnQuery: AdaptableCalculatedColumnQuery): '
|
|
7
|
+
getCalculatedColumnDataType(calculatedColumnQuery: AdaptableCalculatedColumnQuery): CalculatedColumnSettings['DataType'];
|
|
8
8
|
createAggregatedScalarLiveValue(calculatedColumn: CalculatedColumn): void;
|
|
9
9
|
destroyAggregatedScalarLiveValue(calculatedColumn: CalculatedColumn): void;
|
|
10
10
|
}
|
package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UiOptionsForm.js
CHANGED
|
@@ -4,14 +4,22 @@ exports.UIElementsForm = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const rebass_1 = require("rebass");
|
|
7
|
+
const Tabs_1 = require("../../../../components/Tabs");
|
|
7
8
|
const UIOptionsActionColumnsForm_1 = require("./UIOptionsActionColumnsForm");
|
|
8
9
|
const UIOptionsSidebarForm_1 = require("./UIOptionsSidebarForm");
|
|
9
10
|
const UIOptionsStatusbarForm_1 = require("./UIOptionsStatusbarForm");
|
|
10
11
|
const UIElementsForm = (props) => {
|
|
11
12
|
let abOptions = props.adaptableOptions;
|
|
12
13
|
return (React.createElement(rebass_1.Box, { p: 2 },
|
|
13
|
-
React.createElement(
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
React.createElement(Tabs_1.Tabs, null,
|
|
15
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Action Rows"),
|
|
16
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Sidebar"),
|
|
17
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Statusbar"),
|
|
18
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
19
|
+
React.createElement(UIOptionsActionColumnsForm_1.UIOptionsActionColumnsForm, { abOptions: abOptions, onChange: props.onChangeadAptableOptions })),
|
|
20
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
21
|
+
React.createElement(UIOptionsSidebarForm_1.UIOptionsSidebarForm, { abOptions: abOptions, onChange: props.onChangeadAptableOptions })),
|
|
22
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
23
|
+
React.createElement(UIOptionsStatusbarForm_1.UIOptionsStatusbarForm, { abOptions: abOptions, onChange: props.onChangeadAptableOptions })))));
|
|
16
24
|
};
|
|
17
25
|
exports.UIElementsForm = UIElementsForm;
|
|
@@ -78,6 +78,8 @@ const CalculatedColumnSettingsWizardSection = (props) => {
|
|
|
78
78
|
Width: Number(e.target.value),
|
|
79
79
|
}) })))))),
|
|
80
80
|
ErrorMessage ? React.createElement(ErrorBox_1.default, { marginTop: 2 }, ErrorMessage) : null,
|
|
81
|
-
React.createElement(SpecialColumnSettingsWizardStep_1.SpecialColumnSettingsWizardStep, { isEditable: false,
|
|
81
|
+
React.createElement(SpecialColumnSettingsWizardStep_1.SpecialColumnSettingsWizardStep, { isEditable: false,
|
|
82
|
+
// @ts-ignore CalculatedColumn has a broader DataType
|
|
83
|
+
settings: data.CalculatedColumnSettings, onChange: handleSpecialColumnSettingsChange })));
|
|
82
84
|
};
|
|
83
85
|
exports.CalculatedColumnSettingsWizardSection = CalculatedColumnSettingsWizardSection;
|
|
@@ -20,6 +20,18 @@ const useChartState = (chartDefinition) => {
|
|
|
20
20
|
const currentChartRef = (_a = adaptable.api.chartingApi.getChartRef(chartDefinition.Model.chartId)) !== null && _a !== void 0 ? _a : null;
|
|
21
21
|
setChartRef(currentChartRef);
|
|
22
22
|
}, [currentChartModels, chartDefinition]);
|
|
23
|
+
const closeAlreadyOpenedChartsInContainer = (element) => {
|
|
24
|
+
const chartModelAlreadyInChartContainer = currentChartModels.find((chartModel) => {
|
|
25
|
+
const chartRef = adaptable.api.chartingApi.getChartRef(chartModel.chartId);
|
|
26
|
+
return chartRef && element.contains(chartRef.chartElement);
|
|
27
|
+
});
|
|
28
|
+
if (chartModelAlreadyInChartContainer) {
|
|
29
|
+
const chartRef = adaptable.api.chartingApi.getChartRef(chartModelAlreadyInChartContainer.chartId);
|
|
30
|
+
if (chartRef) {
|
|
31
|
+
chartRef.destroyChart();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
};
|
|
23
35
|
const handleShowChart = React.useCallback((chartContainer) => {
|
|
24
36
|
if (!adaptable || !chartDefinition) {
|
|
25
37
|
return;
|
|
@@ -41,15 +53,8 @@ const useChartState = (chartDefinition) => {
|
|
|
41
53
|
* If multple charts are opened in the same contianer, it infinitly adds the charts to the container.
|
|
42
54
|
*/
|
|
43
55
|
if (chartContainer && element) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
return chartRef && element.contains(chartRef.chartElement);
|
|
47
|
-
});
|
|
48
|
-
if (chartModelAlreadyInChartContainer) {
|
|
49
|
-
const chartRef = adaptable.api.chartingApi.getChartRef(chartModelAlreadyInChartContainer.chartId);
|
|
50
|
-
if (chartRef) {
|
|
51
|
-
chartRef.destroyChart();
|
|
52
|
-
}
|
|
56
|
+
if (chartContainer.type !== 'multiple') {
|
|
57
|
+
closeAlreadyOpenedChartsInContainer(element);
|
|
53
58
|
}
|
|
54
59
|
adaptable.api.chartingApi.showChartDefinitionOnce(chartDefinition, element);
|
|
55
60
|
}
|
|
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.FreeTextColumnSettingsWizardSection = exports.isValidFreeTextColumn = exports.renderFreeTextColumnSummary = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const react_1 = require("react");
|
|
6
7
|
const rebass_1 = require("rebass");
|
|
7
8
|
const Input_1 = tslib_1.__importDefault(require("../../../components/Input"));
|
|
8
9
|
const ErrorBox_1 = tslib_1.__importDefault(require("../../../components/ErrorBox"));
|
|
9
10
|
const Radio_1 = tslib_1.__importDefault(require("../../../components/Radio"));
|
|
10
11
|
const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
|
|
11
12
|
const DropdownButton_1 = tslib_1.__importDefault(require("../../../components/DropdownButton"));
|
|
12
|
-
const react_1 = require("react");
|
|
13
13
|
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
14
14
|
const AdaptableInput_1 = tslib_1.__importDefault(require("../../Components/AdaptableInput"));
|
|
15
15
|
const CheckBox_1 = require("../../../components/CheckBox");
|
|
@@ -78,10 +78,11 @@ const FreeTextColumnSettingsWizardSection = (props) => {
|
|
|
78
78
|
props.onChange(Object.assign(Object.assign({}, data), { FriendlyName: ColumnName }));
|
|
79
79
|
};
|
|
80
80
|
const handleDataTypeChange = (DataType) => {
|
|
81
|
-
|
|
81
|
+
var _a;
|
|
82
|
+
const newData = Object.assign(Object.assign({}, data), { FreeTextColumnSettings: Object.assign(Object.assign({}, data.FreeTextColumnSettings), { DataType }) });
|
|
82
83
|
delete newData.DefaultValue;
|
|
83
84
|
if (!DataType) {
|
|
84
|
-
|
|
85
|
+
(_a = newData.FreeTextColumnSettings) === null || _a === void 0 ? true : delete _a.DataType;
|
|
85
86
|
}
|
|
86
87
|
props.onChange(newData);
|
|
87
88
|
};
|
|
@@ -29,11 +29,11 @@ const StyledColumnWizard = (props) => {
|
|
|
29
29
|
});
|
|
30
30
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
31
31
|
const handleFinish = () => {
|
|
32
|
-
if (data) {
|
|
33
|
-
dispatch(StyledColumnRedux.
|
|
32
|
+
if (props.popupParams.action === 'New' || !data) {
|
|
33
|
+
dispatch(StyledColumnRedux.StyledColumnAdd(styledColumn));
|
|
34
34
|
}
|
|
35
35
|
else {
|
|
36
|
-
dispatch(StyledColumnRedux.
|
|
36
|
+
dispatch(StyledColumnRedux.StyledColumnEdit(styledColumn));
|
|
37
37
|
}
|
|
38
38
|
props.onFinishWizard(styledColumn);
|
|
39
39
|
};
|
|
@@ -1535,12 +1535,19 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
1535
1535
|
name: string;
|
|
1536
1536
|
kind: string;
|
|
1537
1537
|
description: string;
|
|
1538
|
-
properties: {
|
|
1538
|
+
properties: ({
|
|
1539
1539
|
name: string;
|
|
1540
1540
|
kind: string;
|
|
1541
1541
|
description: string;
|
|
1542
1542
|
uiLabel: string;
|
|
1543
|
-
|
|
1543
|
+
isOptional?: undefined;
|
|
1544
|
+
} | {
|
|
1545
|
+
name: string;
|
|
1546
|
+
kind: string;
|
|
1547
|
+
description: string;
|
|
1548
|
+
uiLabel: string;
|
|
1549
|
+
isOptional: boolean;
|
|
1550
|
+
})[];
|
|
1544
1551
|
};
|
|
1545
1552
|
ChartDefinition: {
|
|
1546
1553
|
name: string;
|