@adaptabletools/adaptable 18.0.0-canary.1 → 18.0.0-canary.11
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/agGrid.d.ts +4 -21
- package/agGrid.js +9 -26
- package/base.css +11 -3
- package/base.css.map +1 -1
- package/index.css +88 -70
- package/index.css.map +1 -1
- package/package.json +4 -5
- package/src/AdaptableInterfaces/IAdaptable.d.ts +61 -108
- package/src/AdaptableOptions/AdaptableOptions.d.ts +12 -6
- package/src/AdaptableOptions/ColumnFilterOptions.d.ts +4 -4
- package/src/AdaptableOptions/ColumnOptions.d.ts +4 -2
- package/src/AdaptableOptions/{CommentsOptions.d.ts → CommentOptions.d.ts} +5 -5
- package/src/AdaptableOptions/MenuOptions.d.ts +1 -1
- package/src/AdaptableOptions/MenuOptions.js +1 -5
- package/src/AdaptableOptions/{NotesOptions.d.ts → NoteOptions.d.ts} +1 -1
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +17 -0
- package/src/Api/AdaptableApi.d.ts +5 -0
- package/src/Api/BulkUpdateApi.d.ts +0 -5
- package/src/Api/ConfigApi.d.ts +1 -1
- package/src/Api/Events/AdaptableReady.d.ts +3 -3
- package/src/Api/Events/GridDataChanged.d.ts +4 -4
- package/src/Api/GridApi.d.ts +18 -13
- package/src/Api/Implementation/ActionColumnApiImpl.d.ts +2 -0
- package/src/Api/Implementation/ActionColumnApiImpl.js +33 -0
- package/src/Api/Implementation/AdaptableApiImpl.d.ts +1 -0
- package/src/Api/Implementation/AdaptableApiImpl.js +3 -0
- package/src/Api/Implementation/ApiBase.d.ts +2 -1
- package/src/Api/Implementation/ApiBase.js +4 -1
- package/src/Api/Implementation/BulkUpdateApiImpl.d.ts +0 -1
- package/src/Api/Implementation/BulkUpdateApiImpl.js +0 -4
- package/src/Api/Implementation/CommentsApiImpl.d.ts +4 -0
- package/src/Api/Implementation/CommentsApiImpl.js +7 -1
- package/src/Api/Implementation/ConfigApiImpl.js +13 -5
- package/src/Api/Implementation/GridApiImpl.d.ts +4 -3
- package/src/Api/Implementation/GridApiImpl.js +33 -14
- package/src/Api/Implementation/LayoutApiImpl.d.ts +2 -0
- package/src/Api/Implementation/LayoutApiImpl.js +15 -0
- package/src/Api/Implementation/NotesApiImpl.d.ts +6 -4
- package/src/Api/Implementation/NotesApiImpl.js +9 -8
- package/src/Api/Implementation/OptionsApiImpl.d.ts +2 -1
- package/src/Api/Implementation/OptionsApiImpl.js +12 -2
- package/src/Api/Implementation/ScopeApiImpl.d.ts +2 -0
- package/src/Api/Implementation/ScopeApiImpl.js +20 -7
- package/src/Api/Implementation/StatusBarApiImpl.d.ts +0 -1
- package/src/Api/Implementation/StatusBarApiImpl.js +0 -3
- package/src/Api/Implementation/ToolPanelApiImpl.js +6 -6
- package/src/Api/Internal/ActionRowInternalApi.d.ts +5 -1
- package/src/Api/Internal/ActionRowInternalApi.js +106 -0
- package/src/Api/Internal/AdaptableInternalApi.d.ts +3 -4
- package/src/Api/Internal/AdaptableInternalApi.js +10 -8
- package/src/Api/Internal/CalculatedColumnInternalApi.d.ts +2 -0
- package/src/Api/Internal/CalculatedColumnInternalApi.js +70 -0
- package/src/Api/Internal/ColumnFilterInternalApi.d.ts +1 -0
- package/src/Api/Internal/ColumnFilterInternalApi.js +11 -1
- package/src/Api/Internal/ColumnInternalApi.d.ts +4 -1
- package/src/Api/Internal/ColumnInternalApi.js +12 -0
- package/src/Api/Internal/CommentsInternalApi.d.ts +4 -0
- package/src/Api/Internal/CommentsInternalApi.js +14 -0
- package/src/Api/Internal/CustomSortInternalApi.d.ts +3 -2
- package/src/Api/Internal/CustomSortInternalApi.js +32 -1
- package/src/Api/Internal/DataSetInternalApi.js +1 -1
- package/src/Api/Internal/FormatColumnInternalApi.js +3 -2
- package/src/Api/Internal/FreeTextColumnInternalApi.d.ts +2 -0
- package/src/Api/Internal/FreeTextColumnInternalApi.js +59 -0
- package/src/Api/Internal/GridFilterInternalApi.js +1 -1
- package/src/Api/Internal/GridInternalApi.d.ts +21 -3
- package/src/Api/Internal/GridInternalApi.js +126 -7
- package/src/Api/Internal/NotesInternalApi.d.ts +4 -0
- package/src/Api/Internal/NotesInternalApi.js +14 -0
- package/src/Api/Internal/TeamSharingInternalApi.js +1 -1
- package/src/Api/InteropioPluginApi.d.ts +2 -2
- package/src/Api/LayoutApi.d.ts +11 -0
- package/src/Api/OptionsApi.d.ts +5 -1
- package/src/Api/ScopeApi.d.ts +10 -0
- package/src/EnvVars.d.ts +3 -0
- package/src/EnvVars.js +4 -0
- package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +4 -0
- package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptableScope.d.ts +4 -1
- package/src/PredefinedConfig/Common/AggregationColumns.d.ts +1 -0
- package/src/PredefinedConfig/Common/AggregationColumns.js +3 -0
- package/src/PredefinedConfig/Common/DataUpdateConfig.d.ts +8 -0
- package/src/PredefinedConfig/Common/RowSummary.d.ts +7 -0
- package/src/PredefinedConfig/Common/RowSummary.js +1 -0
- package/src/PredefinedConfig/LayoutState.d.ts +5 -0
- package/src/PredefinedConfig/NotesState.d.ts +10 -20
- package/src/PredefinedConfig/PredefinedConfig.d.ts +1 -1
- package/src/PredefinedConfig/SystemState.d.ts +7 -0
- package/src/Redux/ActionsReducers/LayoutRedux.d.ts +9 -0
- package/src/Redux/ActionsReducers/LayoutRedux.js +20 -0
- package/src/Redux/ActionsReducers/NotesRedux.d.ts +3 -4
- package/src/Redux/ActionsReducers/NotesRedux.js +8 -7
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +5 -0
- package/src/Redux/ActionsReducers/SystemRedux.js +13 -1
- package/src/Redux/Store/AdaptableStore.d.ts +4 -6
- package/src/Redux/Store/AdaptableStore.js +33 -50
- package/src/Redux/Store/Interface/IAdaptableStore.d.ts +8 -2
- package/src/Strategy/AdaptableModuleBase.d.ts +2 -3
- package/src/Strategy/AdaptableModuleBase.js +4 -7
- package/src/Strategy/AlertModule.d.ts +1 -2
- package/src/Strategy/AlertModule.js +2 -55
- package/src/Strategy/CalculatedColumnModule.d.ts +2 -3
- package/src/Strategy/CalculatedColumnModule.js +5 -25
- package/src/Strategy/CellSummaryModule.d.ts +1 -0
- package/src/Strategy/CellSummaryModule.js +50 -21
- package/src/Strategy/ChartingModule.d.ts +0 -1
- package/src/Strategy/ChartingModule.js +2 -22
- package/src/Strategy/ColumnFilterModule.d.ts +1 -2
- package/src/Strategy/ColumnFilterModule.js +1 -64
- package/src/Strategy/CommentsModule.d.ts +1 -0
- package/src/Strategy/CommentsModule.js +5 -1
- package/src/Strategy/CustomSortModule.js +1 -1
- package/src/Strategy/DashboardModule.d.ts +1 -2
- package/src/Strategy/DashboardModule.js +1 -8
- package/src/Strategy/DataChangeHistoryModule.d.ts +1 -0
- package/src/Strategy/DataChangeHistoryModule.js +3 -1
- package/src/Strategy/DataSetModule.d.ts +1 -1
- package/src/Strategy/DataSetModule.js +1 -1
- package/src/Strategy/FlashingCellModule.d.ts +1 -2
- package/src/Strategy/FlashingCellModule.js +2 -15
- package/src/Strategy/FormatColumnModule.d.ts +0 -2
- package/src/Strategy/FormatColumnModule.js +0 -47
- package/src/Strategy/FreeTextColumnModule.d.ts +0 -1
- package/src/Strategy/FreeTextColumnModule.js +0 -30
- package/src/Strategy/GridFilterModule.d.ts +0 -1
- package/src/Strategy/GridFilterModule.js +0 -37
- package/src/Strategy/Interface/IModule.d.ts +0 -1
- package/src/Strategy/LayoutModule.d.ts +8 -3
- package/src/Strategy/LayoutModule.js +108 -53
- package/src/Strategy/NamedQueryModule.d.ts +0 -1
- package/src/Strategy/NamedQueryModule.js +0 -19
- package/src/Strategy/NotesModule.js +3 -4
- package/src/Strategy/PlusMinusModule.d.ts +1 -1
- package/src/Strategy/PlusMinusModule.js +1 -1
- package/src/Strategy/ScheduleModule.d.ts +1 -1
- package/src/Strategy/ScheduleModule.js +1 -1
- package/src/Strategy/ShortcutModule.d.ts +1 -1
- package/src/Strategy/ShortcutModule.js +1 -1
- package/src/Strategy/StyledColumnModule.d.ts +0 -1
- package/src/Strategy/StyledColumnModule.js +0 -21
- package/src/Strategy/TeamSharingModule.d.ts +1 -0
- package/src/Strategy/TeamSharingModule.js +5 -5
- package/src/Strategy/ToolPanelModule.d.ts +0 -1
- package/src/Strategy/ToolPanelModule.js +0 -23
- package/src/Utilities/Constants/DocumentationLinkConstants.js +1 -1
- package/src/Utilities/Constants/GeneralConstants.d.ts +1 -0
- package/src/Utilities/Constants/GeneralConstants.js +1 -0
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +5 -4
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +2 -1
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +294 -0
- package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.js +1 -1
- package/src/Utilities/Extensions/ArrayExtensions.d.ts +2 -0
- package/src/Utilities/Extensions/ArrayExtensions.js +4 -0
- package/src/Utilities/Helpers/AdaptableHelper.d.ts +3 -4
- package/src/Utilities/Helpers/AdaptableHelper.js +18 -58
- package/src/Utilities/Helpers/Helper.d.ts +2 -0
- package/src/Utilities/Helpers/Helper.js +4 -0
- package/src/Utilities/ObjectFactory.js +6 -6
- package/src/Utilities/Services/AggregatedScalarLiveValue.d.ts +3 -2
- package/src/Utilities/Services/AggregatedScalarLiveValue.js +14 -9
- package/src/Utilities/Services/CellPopupService.js +0 -1
- package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +1 -1
- package/src/Utilities/Services/LicenseService/index.d.ts +3 -0
- package/src/Utilities/Services/LicenseService/index.js +1 -181
- package/src/Utilities/Services/MetamodelService.d.ts +1 -1
- package/src/Utilities/Services/MetamodelService.js +6 -3
- package/src/Utilities/Services/QueryLanguageService.d.ts +1 -1
- package/src/Utilities/Services/QueryLanguageService.js +2 -1
- package/src/Utilities/Services/RowEditService.d.ts +3 -2
- package/src/Utilities/Services/RowEditService.js +3 -1
- package/src/Utilities/Services/SummaryService.d.ts +19 -0
- package/src/Utilities/Services/SummaryService.js +29 -0
- package/src/Utilities/license/decode.js +1 -65
- package/src/Utilities/license/hashing.js +1 -43
- package/src/View/AdaptableView.js +1 -3
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +2 -2
- package/src/View/BulkUpdate/BulkUpdatePopup.js +1 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.d.ts +1 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +2 -2
- package/src/View/CalculatedColumn/utils.d.ts +1 -1
- package/src/View/CellSummary/CellSummaryPopup.js +1 -1
- package/src/View/Comments/CommentsPopup.js +12 -8
- package/src/View/Components/AdaptableDateInput/index.d.ts +1 -1
- package/src/View/Components/NewScopeComponent.js +34 -1
- package/src/View/Components/Popups/AdaptableLoadingScreen.d.ts +6 -5
- package/src/View/Components/Popups/AdaptableLoadingScreen.js +19 -9
- package/src/View/Components/Popups/AdaptableToaster.js +1 -1
- package/src/View/Components/Popups/GridCellPopup/GridCellPopup.js +1 -1
- package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +1 -0
- package/src/View/Components/Popups/WindowPopups/windowFactory.js +3 -0
- package/src/View/Components/Selectors/PermittedValuesSelector.js +1 -1
- package/src/View/CustomSort/CustomSortSummary.js +1 -1
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +8 -8
- package/src/View/GridFilter/GridFilterViewPanel.js +7 -3
- package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +2 -3
- package/src/View/Layout/TransposedPopup.d.ts +3 -0
- package/src/View/Layout/TransposedPopup.js +194 -0
- package/src/View/Layout/Wizard/LayoutWizard.js +1 -1
- package/src/View/License/LicenseWatermark.js +1 -61
- package/src/View/Notes/NotesPopup.js +9 -11
- package/src/View/SpecialColumnSettingsWizardStep.js +4 -4
- package/src/View/Theme/ThemeSelector.js +3 -3
- package/src/agGrid/ActionColumnRenderer.js +7 -6
- package/src/agGrid/Adaptable.d.ts +3 -455
- package/src/agGrid/Adaptable.js +8 -5292
- package/src/agGrid/AdaptableAgGrid.d.ts +351 -0
- package/src/agGrid/AdaptableAgGrid.js +3936 -0
- package/src/agGrid/AdaptableLogger.js +77 -11
- package/src/agGrid/AgGridAdapter.d.ts +62 -0
- package/src/agGrid/AgGridAdapter.js +577 -0
- package/src/agGrid/AgGridColumnAdapter.d.ts +56 -0
- package/src/agGrid/AgGridColumnAdapter.js +824 -0
- package/src/agGrid/AgGridMenuAdapter.d.ts +28 -0
- package/src/agGrid/AgGridMenuAdapter.js +271 -0
- package/src/agGrid/AgGridOptionsService.d.ts +12 -0
- package/src/agGrid/AgGridOptionsService.js +54 -0
- package/src/agGrid/BadgeRenderer.js +1 -1
- package/src/agGrid/CheckboxRenderer.js +1 -1
- package/src/agGrid/FilterWrapper.d.ts +2 -2
- package/src/agGrid/FilterWrapper.js +1 -1
- package/src/agGrid/attachAddaptableColumnTypes.d.ts +12 -12
- package/src/agGrid/defaultAdaptableOptions.d.ts +3 -0
- package/src/{Utilities/Defaults/DefaultAdaptableOptions.js → agGrid/defaultAdaptableOptions.js} +70 -9
- package/src/agGrid/editors/AdaptableDateEditor/index.js +2 -2
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +2 -2
- package/src/components/ColorPicker/ColorPicker.d.ts +1 -1
- package/src/components/Datepicker/index.d.ts +1 -1
- package/src/components/InfiniteTable/index.js +2 -2
- package/src/components/Input/index.d.ts +1 -1
- package/src/components/List/ListGroupItem/index.d.ts +1 -1
- package/src/components/Modal/index.d.ts +1 -0
- package/src/components/Modal/index.js +4 -3
- package/src/components/Select/Select.d.ts +2 -0
- package/src/components/Select/Select.js +2 -2
- package/src/components/icons/index.js +2 -0
- package/src/components/icons/rows.d.ts +3 -0
- package/src/components/icons/rows.js +4 -0
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +74 -11
- package/src/metamodel/adaptable.metamodel.js +1 -9313
- package/src/migration/AdaptableUpgradeHelper.d.ts +38 -0
- package/src/migration/AdaptableUpgradeHelper.js +48 -0
- package/src/migration/VersionUpgrade.d.ts +8 -0
- package/src/migration/VersionUpgrade.js +11 -0
- package/src/migration/VersionUpgrade17.d.ts +18 -0
- package/src/migration/VersionUpgrade17.js +342 -0
- package/src/migration/VersionUpgrade18.d.ts +5 -0
- package/src/migration/VersionUpgrade18.js +6 -0
- package/src/parser/src/types.d.ts +5 -0
- package/src/types.d.ts +7 -3
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/src/Utilities/Defaults/DefaultAdaptableOptions.d.ts +0 -2
- package/src/Utilities/Services/Interface/IRowEditService.d.ts +0 -3
- package/src/Utilities/Services/Interface/IRowEditService.js +0 -1
- package/src/View/Components/ScopeComponent.d.ts +0 -24
- package/src/View/Components/ScopeComponent.js +0 -133
- package/src/View/Export/Wizard/ReportScopeWizard.d.ts +0 -17
- package/src/View/Export/Wizard/ReportScopeWizard.js +0 -47
- package/src/agGrid/agGridHelper.d.ts +0 -57
- package/src/agGrid/agGridHelper.js +0 -686
- package/src/agGrid/agGridMenuHelper.d.ts +0 -46
- package/src/agGrid/agGridMenuHelper.js +0 -668
- /package/src/AdaptableOptions/{CommentsOptions.js → CommentOptions.js} +0 -0
- /package/src/AdaptableOptions/{NotesOptions.js → NoteOptions.js} +0 -0
|
@@ -8,18 +8,18 @@ const logOnce = (message, loggingFn) => {
|
|
|
8
8
|
doOnceFlags[message] = true;
|
|
9
9
|
};
|
|
10
10
|
export class AggregatedScalarLiveValue {
|
|
11
|
-
constructor(source, requestingModule, adaptableApi) {
|
|
11
|
+
constructor(source, requestingModule, adaptableApi, getRowNodes) {
|
|
12
12
|
this.source = source;
|
|
13
13
|
this.requestingModule = requestingModule;
|
|
14
14
|
this.adaptableApi = adaptableApi;
|
|
15
|
+
this.getRowNodes = getRowNodes;
|
|
15
16
|
if (source.aggregatedScalarExpression) {
|
|
16
17
|
this.aggregatedScalarExpression = source.aggregatedScalarExpression;
|
|
17
18
|
}
|
|
18
19
|
this.expressionEvaluation = source.aggregatedScalarExpression
|
|
19
20
|
? this.adaptableApi.internalApi
|
|
20
21
|
.getQueryLanguageService()
|
|
21
|
-
.evaluateAggregatedScalarExpression(source.aggregatedScalarExpression, requestingModule)
|
|
22
|
-
.value
|
|
22
|
+
.evaluateAggregatedScalarExpression(source.aggregatedScalarExpression, requestingModule, getRowNodes).value
|
|
23
23
|
: source.aggregatedScalarExpressionEvaluation;
|
|
24
24
|
// currently we support only one reducer
|
|
25
25
|
this.aggregationReducerName = Object.keys(this.expressionEvaluation.aggregationParams.reducers)[0];
|
|
@@ -29,7 +29,7 @@ export class AggregatedScalarLiveValue {
|
|
|
29
29
|
if (this.aggregatedScalarExpression) {
|
|
30
30
|
this.expressionEvaluation = this.adaptableApi.internalApi
|
|
31
31
|
.getQueryLanguageService()
|
|
32
|
-
.evaluateAggregatedScalarExpression(this.aggregatedScalarExpression, this.requestingModule).value;
|
|
32
|
+
.evaluateAggregatedScalarExpression(this.aggregatedScalarExpression, this.requestingModule, this.getRowNodes).value;
|
|
33
33
|
}
|
|
34
34
|
// currently we support only one reducer
|
|
35
35
|
this.aggregationReducerName = Object.keys(this.expressionEvaluation.aggregationParams.reducers)[0];
|
|
@@ -38,7 +38,9 @@ export class AggregatedScalarLiveValue {
|
|
|
38
38
|
getAggregatedValueForRow(rowNode) {
|
|
39
39
|
const aggregationValue = this.getAggregationValue(rowNode);
|
|
40
40
|
if (aggregationValue == undefined) {
|
|
41
|
-
logOnce(`${this.aggregatedScalarExpression} :: aggregation value is NOT available!`,
|
|
41
|
+
logOnce(`${this.aggregatedScalarExpression} :: aggregation value is NOT available!`, (message) => {
|
|
42
|
+
this.adaptableApi.internalApi.getAdaptableInstance().logger.warn(message);
|
|
43
|
+
});
|
|
42
44
|
return;
|
|
43
45
|
}
|
|
44
46
|
if (this.expressionEvaluation.rowValueGetter) {
|
|
@@ -68,9 +70,11 @@ export class AggregatedScalarLiveValue {
|
|
|
68
70
|
}
|
|
69
71
|
computeAggregatedValue(expressionEvaluation) {
|
|
70
72
|
var _a;
|
|
71
|
-
const gridRowNodes =
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
const gridRowNodes = expressionEvaluation.getRowNodes
|
|
74
|
+
? expressionEvaluation.getRowNodes()
|
|
75
|
+
: this.adaptableApi.gridApi.getAllRowNodes({
|
|
76
|
+
filterFn: expressionEvaluation.rowFilterFn,
|
|
77
|
+
});
|
|
74
78
|
// we iterate over the RowNode list (we need this to handle complex column values (nested values, valueGetters etc)
|
|
75
79
|
// so we will map the fieldNames to RowNode.data
|
|
76
80
|
const mapReducerValueGetter = (fieldName) => {
|
|
@@ -106,6 +110,7 @@ export class AggregatedScalarLiveValue {
|
|
|
106
110
|
return 0;
|
|
107
111
|
});
|
|
108
112
|
}
|
|
109
|
-
|
|
113
|
+
const result = aggregate(expressionEvaluation.aggregationParams, aggregatedRowNodes);
|
|
114
|
+
return result;
|
|
110
115
|
}
|
|
111
116
|
}
|
|
@@ -6,7 +6,6 @@ export class CellPopupService {
|
|
|
6
6
|
constructor(api) {
|
|
7
7
|
this.api = api;
|
|
8
8
|
this.adaptable = api.internalApi.getAdaptableInstance();
|
|
9
|
-
this.adaptable = api.internalApi.getAdaptableInstance();
|
|
10
9
|
this.adaptable.api.eventApi.on('AdaptableReady', () => this.handleAdaptableReady());
|
|
11
10
|
}
|
|
12
11
|
getAdaptableState() {
|
|
@@ -15,7 +15,7 @@ export interface IQueryLanguageService extends IAdaptableService {
|
|
|
15
15
|
evaluateScalarExpression(expression: string, module: AdaptableModule, rowNode: IRowNode): any;
|
|
16
16
|
evaluateObservableExpression(expression: string, module: AdaptableModule): Observable<CellDataChangedInfo | GridDataChangedInfo>;
|
|
17
17
|
evaluateAggregatedBooleanExpression(expression: string, module: AdaptableModule): BooleanAggregationParameter;
|
|
18
|
-
evaluateAggregatedScalarExpression(expression: string, module: AdaptableModule): ScalarAggregationParameter;
|
|
18
|
+
evaluateAggregatedScalarExpression(expression: string, module: AdaptableModule, getRowNodes?: () => IRowNode[]): ScalarAggregationParameter;
|
|
19
19
|
validateBoolean(expression: string, module: AdaptableModule, config?: {
|
|
20
20
|
force?: boolean;
|
|
21
21
|
}): {
|
|
@@ -13,9 +13,12 @@ export declare enum LicenseValidityType {
|
|
|
13
13
|
}
|
|
14
14
|
export declare class LicenseService implements ILicenseService {
|
|
15
15
|
private adaptable;
|
|
16
|
+
private licenseKey;
|
|
17
|
+
private packageDetails;
|
|
16
18
|
constructor(adaptable: IAdaptable, licenseKey: string | undefined, packageDetails: {
|
|
17
19
|
publishedAt: number | Date;
|
|
18
20
|
});
|
|
21
|
+
init(): void;
|
|
19
22
|
getValidityType(details: LicenseDetails | Error | null, packageDetails: {
|
|
20
23
|
publishedAt: number | Date;
|
|
21
24
|
}): LicenseValidityType;
|
|
@@ -1,181 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { PopupShowAlert } from '../../../Redux/ActionsReducers/PopupRedux';
|
|
3
|
-
import ObjectFactory from '../../ObjectFactory';
|
|
4
|
-
import clamp from 'lodash/clamp';
|
|
5
|
-
import { LicenseDocsLink } from '../../Constants/DocumentationLinkConstants';
|
|
6
|
-
import { decode as decodeLicense, GENERIC_APP_NAME } from '../../license/decode';
|
|
7
|
-
import { shouldLogThankYouMessage } from './shouldLogThankYouMessage';
|
|
8
|
-
const EMAIL = 'sales@adaptabletools.com';
|
|
9
|
-
const COMMERCIAL_LICENSE_SHOW_INFO_DAYS_BEFORE_EXPIRE = 10;
|
|
10
|
-
const DAY_IN_MS = 1000 * 60 * 60 * 24;
|
|
11
|
-
export var LicenseValidityType;
|
|
12
|
-
(function (LicenseValidityType) {
|
|
13
|
-
LicenseValidityType["INVALID_LICENSE"] = "INVALID_LICENSE";
|
|
14
|
-
LicenseValidityType["NO_LICENSE"] = "NO_LICENSE";
|
|
15
|
-
LicenseValidityType["NON_PRODUCTION_VALID"] = "NON_PRODUCTION_VALID";
|
|
16
|
-
LicenseValidityType["NON_PRODUCTION_EXPIRED_IN_SCOPE"] = "NON_PRODUCTION_EXPIRED_IN_SCOPE";
|
|
17
|
-
LicenseValidityType["NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE"] = "NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE";
|
|
18
|
-
LicenseValidityType["COMMERCIAL_VALID"] = "COMMERCIAL_VALID";
|
|
19
|
-
LicenseValidityType["COMMERCIAL_EXPIRED_IN_SCOPE"] = "COMMERCIAL_EXPIRED_IN_SCOPE";
|
|
20
|
-
LicenseValidityType["COMMERCIAL_EXPIRED_OUT_OF_SCOPE"] = "COMMERCIAL_EXPIRED_OUT_OF_SCOPE";
|
|
21
|
-
})(LicenseValidityType || (LicenseValidityType = {}));
|
|
22
|
-
const SANDPACK_REGEX = /(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g;
|
|
23
|
-
const SANDBOX_REGEX = /(https):\/\/\S+(\.csb\.app)/g;
|
|
24
|
-
const DEMO_REGEX = /(https):\/\/\S+(\.adaptabletools\.com)/g;
|
|
25
|
-
const origin = typeof window !== 'undefined' ? window.location.origin : '';
|
|
26
|
-
const isInsideSandpack = () => {
|
|
27
|
-
const [_fullUrl, protocol, sandpackUrl] = Array.from(SANDPACK_REGEX.exec(origin) || []);
|
|
28
|
-
return protocol === 'https' && sandpackUrl === 'sandpack.codesandbox.io';
|
|
29
|
-
};
|
|
30
|
-
const isInsideSandbox = () => {
|
|
31
|
-
const [_fullUrl, protocol, sandboxUrl] = Array.from(SANDBOX_REGEX.exec(origin) || []);
|
|
32
|
-
return protocol === 'https' && sandboxUrl === '.csb.app';
|
|
33
|
-
};
|
|
34
|
-
const isDemoApp = () => {
|
|
35
|
-
const [_fullUrl, protocol, demoAppUrl] = Array.from(DEMO_REGEX.exec(origin) || []);
|
|
36
|
-
return protocol === 'https' && demoAppUrl === '.adaptabletools.com';
|
|
37
|
-
};
|
|
38
|
-
export class LicenseService {
|
|
39
|
-
constructor(adaptable, licenseKey, packageDetails) {
|
|
40
|
-
this.adaptable = adaptable;
|
|
41
|
-
this.adaptable = adaptable;
|
|
42
|
-
let details = null;
|
|
43
|
-
if (licenseKey) {
|
|
44
|
-
try {
|
|
45
|
-
details = decodeLicense(licenseKey);
|
|
46
|
-
}
|
|
47
|
-
catch (error) {
|
|
48
|
-
details = error;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
if (!isInsideSandpack() && !isInsideSandbox() && !isDemoApp()) {
|
|
52
|
-
this.handleLicenseValidation(details, this.getValidityType(details, packageDetails));
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
getValidityType(details, packageDetails) {
|
|
56
|
-
if (!details) {
|
|
57
|
-
return LicenseValidityType.NO_LICENSE;
|
|
58
|
-
}
|
|
59
|
-
if (details instanceof Error) {
|
|
60
|
-
return LicenseValidityType.INVALID_LICENSE;
|
|
61
|
-
}
|
|
62
|
-
const currentVersionReleaseDate = new Date(packageDetails.publishedAt);
|
|
63
|
-
const licenseEndDate = new Date(details.end);
|
|
64
|
-
const currentDate = new Date();
|
|
65
|
-
const isExpired = licenseEndDate < currentDate;
|
|
66
|
-
const isTrial = details.trial;
|
|
67
|
-
const isScope = licenseEndDate > currentVersionReleaseDate;
|
|
68
|
-
let validityType = null;
|
|
69
|
-
if (isExpired) {
|
|
70
|
-
if (isScope) {
|
|
71
|
-
if (isTrial) {
|
|
72
|
-
validityType = LicenseValidityType.NON_PRODUCTION_EXPIRED_IN_SCOPE;
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
validityType = LicenseValidityType.COMMERCIAL_EXPIRED_IN_SCOPE;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
if (isTrial) {
|
|
80
|
-
validityType = LicenseValidityType.NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE;
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
validityType = LicenseValidityType.COMMERCIAL_EXPIRED_OUT_OF_SCOPE;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
if (isTrial) {
|
|
89
|
-
validityType = LicenseValidityType.NON_PRODUCTION_VALID;
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
validityType = LicenseValidityType.COMMERCIAL_VALID;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
return validityType;
|
|
96
|
-
}
|
|
97
|
-
handleLicenseValidation(details, validityType) {
|
|
98
|
-
var _a;
|
|
99
|
-
const nowAtMidnight = new Date();
|
|
100
|
-
nowAtMidnight.setHours(0, 0, 0, 0);
|
|
101
|
-
let daysLeft = 0;
|
|
102
|
-
if (!(details instanceof Error) && (details === null || details === void 0 ? void 0 : details.end)) {
|
|
103
|
-
daysLeft = Math.floor((((_a = details === null || details === void 0 ? void 0 : details.end) === null || _a === void 0 ? void 0 : _a.getTime()) - nowAtMidnight.getTime()) / DAY_IN_MS);
|
|
104
|
-
daysLeft = clamp(daysLeft, 0, Infinity);
|
|
105
|
-
}
|
|
106
|
-
let APP_NAME = '';
|
|
107
|
-
let forApp = '';
|
|
108
|
-
if (details &&
|
|
109
|
-
!(details instanceof Error) &&
|
|
110
|
-
details.appName &&
|
|
111
|
-
details.appName != GENERIC_APP_NAME) {
|
|
112
|
-
APP_NAME = details.appName;
|
|
113
|
-
forApp = ` for application [APP_NAME]`;
|
|
114
|
-
}
|
|
115
|
-
const annotateMessage = (message, link = LicenseDocsLink, email = EMAIL, days = daysLeft, appName = APP_NAME) => {
|
|
116
|
-
return message
|
|
117
|
-
.replace('[LINK]', link)
|
|
118
|
-
.replace('[EMAIL]', email)
|
|
119
|
-
.replace('[APP_NAME]', appName)
|
|
120
|
-
.replace('[DAYS]', `${days}`);
|
|
121
|
-
};
|
|
122
|
-
switch (validityType) {
|
|
123
|
-
case 'NO_LICENSE':
|
|
124
|
-
case 'NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE':
|
|
125
|
-
this.adaptable.logger.consoleLogByMessageType(annotateMessage('This instance of AdapTable does not have a license, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK].'), 'Error');
|
|
126
|
-
this.showNotification('No AdapTable License found.');
|
|
127
|
-
this.showWatermark('This instance of AdapTable does not have a license, and some functionality has therefore been removed.');
|
|
128
|
-
this.disableStatePersistence();
|
|
129
|
-
break;
|
|
130
|
-
case 'INVALID_LICENSE':
|
|
131
|
-
this.adaptable.logger.consoleLogByMessageType(annotateMessage('This instance of AdapTable seems to use a corrupted License, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK].'), 'Error');
|
|
132
|
-
this.showNotification('Corrupted AdapTable License found.');
|
|
133
|
-
this.showWatermark(`This instance of AdapTable has a corrupted License, and some functionality has therefore been removed.`);
|
|
134
|
-
this.disableStatePersistence();
|
|
135
|
-
break;
|
|
136
|
-
case 'NON_PRODUCTION_VALID':
|
|
137
|
-
this.adaptable.logger.consoleLogByMessageType(annotateMessage('This AdapTable trial license expires in [DAYS] days. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK].'), 'Info');
|
|
138
|
-
break;
|
|
139
|
-
case 'NON_PRODUCTION_EXPIRED_IN_SCOPE':
|
|
140
|
-
this.adaptable.logger.consoleLogByMessageType(annotateMessage('This AdapTable trial license has now expired. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK].'), 'Warning');
|
|
141
|
-
this.showWatermark('AdapTable License has expired');
|
|
142
|
-
break;
|
|
143
|
-
case 'COMMERCIAL_VALID':
|
|
144
|
-
if (daysLeft <= COMMERCIAL_LICENSE_SHOW_INFO_DAYS_BEFORE_EXPIRE) {
|
|
145
|
-
this.adaptable.logger.consoleLogByMessageType(annotateMessage(`This AdapTable license${forApp} expires in [DAYS] days. Please contact [EMAIL] to renew (giving you access to Support and Updates)`), 'Info');
|
|
146
|
-
}
|
|
147
|
-
else {
|
|
148
|
-
try {
|
|
149
|
-
if (shouldLogThankYouMessage()) {
|
|
150
|
-
this.adaptable.logger.consoleLogByMessageType(annotateMessage(`Thank you for using a valid AdapTable license${forApp}. Your license will expire in [DAYS] days.`), 'Info');
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
catch (ex) { }
|
|
154
|
-
}
|
|
155
|
-
break;
|
|
156
|
-
case 'COMMERCIAL_EXPIRED_IN_SCOPE':
|
|
157
|
-
this.adaptable.logger.consoleLogByMessageType(annotateMessage(`This AdapTable license${forApp} has expired. Please contact [EMAIL] if you wish to renew (giving you access to Support and Updates)`), 'Warning');
|
|
158
|
-
break;
|
|
159
|
-
case 'COMMERCIAL_EXPIRED_OUT_OF_SCOPE':
|
|
160
|
-
this.adaptable.logger.consoleLogByMessageType(annotateMessage(`This AdapTable license${forApp} has expired. Adaptable version was published after the license expired. Please contact [EMAIL] if you wish to renew your license.`), 'Error');
|
|
161
|
-
this.showNotification('Adaptable License has expired');
|
|
162
|
-
this.showWatermark('Adaptable License has expired');
|
|
163
|
-
break;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
showNotification(text) {
|
|
167
|
-
this.adaptable.api.internalApi.dispatchReduxAction(PopupShowAlert({
|
|
168
|
-
alertType: 'generic',
|
|
169
|
-
header: 'License Error',
|
|
170
|
-
message: text,
|
|
171
|
-
alertDefinition: ObjectFactory.CreateInternalAlertDefinitionForMessages('Error'),
|
|
172
|
-
}));
|
|
173
|
-
}
|
|
174
|
-
showWatermark(text) {
|
|
175
|
-
this.adaptable.api.internalApi.dispatchReduxAction(SystemLicenseShowWatermark(text));
|
|
176
|
-
}
|
|
177
|
-
disableStatePersistence() {
|
|
178
|
-
this.adaptable.api.internalApi.dispatchReduxAction(SystemLicenseDisablePersistence());
|
|
179
|
-
}
|
|
180
|
-
destroy() { }
|
|
181
|
-
}
|
|
1
|
+
import{SystemLicenseDisablePersistence as e,SystemLicenseShowWatermark as a}from"../../../Redux/ActionsReducers/SystemRedux";import{PopupShowAlert as t}from"../../../Redux/ActionsReducers/PopupRedux";import i from"../../ObjectFactory";import s from"lodash/clamp";import{LicenseDocsLink as o}from"../../Constants/DocumentationLinkConstants";import{decode as n,GENERIC_APP_NAME as r}from"../../license/decode";import{shouldLogThankYouMessage as l}from"./shouldLogThankYouMessage";const c="sales@adaptabletools.com",d=10,p=864e5;export var LicenseValidityType;!function(e){e.INVALID_LICENSE="INVALID_LICENSE",e.NO_LICENSE="NO_LICENSE",e.NON_PRODUCTION_VALID="NON_PRODUCTION_VALID",e.NON_PRODUCTION_EXPIRED_IN_SCOPE="NON_PRODUCTION_EXPIRED_IN_SCOPE",e.NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE="NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE",e.COMMERCIAL_VALID="COMMERCIAL_VALID",e.COMMERCIAL_EXPIRED_IN_SCOPE="COMMERCIAL_EXPIRED_IN_SCOPE",e.COMMERCIAL_EXPIRED_OUT_OF_SCOPE="COMMERCIAL_EXPIRED_OUT_OF_SCOPE"}(LicenseValidityType||(LicenseValidityType={}));const h=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,E=/(https):\/\/\S+(\.csb\.app)/g,I=/(https):\/\/\S+(\.adaptabletools\.com)/g,_=()=>"undefined"!=typeof window?window.location.origin:"",O=()=>{const[e,a,t]=Array.from(h.exec(_())||[]);return"https"===a&&"sandpack.codesandbox.io"===t},A=()=>{const[e,a,t]=Array.from(E.exec(_())||[]);return"https"===a&&".csb.app"===t},L=()=>{const[e,a,t]=Array.from(I.exec(_())||[]);return"https"===a&&".adaptabletools.com"===t};export class LicenseService{constructor(e,a,t){this.adaptable=e,this.licenseKey=a,this.packageDetails=t,this.adaptable=e,this.adaptable.api.eventApi.on("AdaptableReady",(()=>{requestAnimationFrame((()=>{this.init()}))}))}init(){let e=null;if(this.licenseKey)try{e=n(this.licenseKey)}catch(a){e=a}O()||A()||L()||this.handleLicenseValidation(e,this.getValidityType(e,this.packageDetails))}getValidityType(e,a){if(!e)return LicenseValidityType.NO_LICENSE;if(e instanceof Error)return LicenseValidityType.INVALID_LICENSE;const t=new Date(a.publishedAt),i=new Date(e.end),s=i<new Date,o=e.trial;let n=null;return n=s?i>t?o?LicenseValidityType.NON_PRODUCTION_EXPIRED_IN_SCOPE:LicenseValidityType.COMMERCIAL_EXPIRED_IN_SCOPE:o?LicenseValidityType.NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE:LicenseValidityType.COMMERCIAL_EXPIRED_OUT_OF_SCOPE:o?LicenseValidityType.NON_PRODUCTION_VALID:LicenseValidityType.COMMERCIAL_VALID,n}handleLicenseValidation(e,a){var t;const i=new Date;i.setHours(0,0,0,0);let n=0;e instanceof Error||!(null==e?void 0:e.end)||(n=Math.floor(((null===(t=null==e?void 0:e.end)||void 0===t?void 0:t.getTime())-i.getTime())/p),n=s(n,0,1/0));let h="",E="";!e||e instanceof Error||!e.appName||e.appName==r||(h=e.appName,E=" for application [APP_NAME]");const I=(e,a=o,t=c,i=n,s=h)=>e.replace("[LINK]",a).replace("[EMAIL]",t).replace("[APP_NAME]",s).replace("[DAYS]",`${i}`);switch(a){case"NO_LICENSE":case"NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE":this.adaptable.logger.consoleLogByMessageType(I("This instance of AdapTable does not have a license, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK]."),"Error"),this.showNotification("No AdapTable License found."),this.showWatermark("This instance of AdapTable does not have a license, and some functionality has therefore been removed."),this.disableStatePersistence();break;case"INVALID_LICENSE":this.adaptable.logger.consoleLogByMessageType(I("This instance of AdapTable seems to use a corrupted License, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK]."),"Error"),this.showNotification("Corrupted AdapTable License found."),this.showWatermark("This instance of AdapTable has a corrupted License, and some functionality has therefore been removed."),this.disableStatePersistence();break;case"NON_PRODUCTION_VALID":this.adaptable.logger.consoleLogByMessageType(I("This AdapTable trial license expires in [DAYS] days. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK]."),"Info");break;case"NON_PRODUCTION_EXPIRED_IN_SCOPE":this.adaptable.logger.consoleLogByMessageType(I("This AdapTable trial license has now expired. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK]."),"Warning"),this.showWatermark("AdapTable License has expired");break;case"COMMERCIAL_VALID":if(n<=d)this.adaptable.logger.consoleLogByMessageType(I(`This AdapTable license${E} expires in [DAYS] days. Please contact [EMAIL] to renew (giving you access to Support and Updates)`),"Info");else try{l()&&this.adaptable.logger.consoleLogByMessageType(I(`Thank you for using a valid AdapTable license${E}. Your license will expire in [DAYS] days.`),"Info")}catch(e){}break;case"COMMERCIAL_EXPIRED_IN_SCOPE":this.adaptable.logger.consoleLogByMessageType(I(`This AdapTable license${E} has expired. Please contact [EMAIL] if you wish to renew (giving you access to Support and Updates)`),"Warning");break;case"COMMERCIAL_EXPIRED_OUT_OF_SCOPE":this.adaptable.logger.consoleLogByMessageType(I(`This AdapTable license${E} has expired. Adaptable version was published after the license expired. Please contact [EMAIL] if you wish to renew your license.`),"Error"),this.showNotification("Adaptable License has expired"),this.showWatermark("Adaptable License has expired")}}showNotification(e){this.adaptable.api.internalApi.dispatchReduxAction(t({alertType:"generic",header:"License Error",message:e,alertDefinition:i.CreateInternalAlertDefinitionForMessages("Error")}))}showWatermark(e){this.adaptable.api.internalApi.dispatchReduxAction(a(e))}disableStatePersistence(){this.adaptable.api.internalApi.dispatchReduxAction(e())}destroy(){}}
|
|
@@ -3,7 +3,7 @@ import { AdaptableOptions } from '../../../types';
|
|
|
3
3
|
export declare class MetamodelService implements IMetamodelService {
|
|
4
4
|
private gridInfoOptions;
|
|
5
5
|
getAdaptableOptions: () => AdaptableOptions;
|
|
6
|
-
constructor(getAdaptableOptions: () => AdaptableOptions);
|
|
6
|
+
constructor(getAdaptableOptions: () => AdaptableOptions, validateOptions?: boolean);
|
|
7
7
|
getGridInfoOptions(): GridInfoOptions;
|
|
8
8
|
getGridInfoNoCodeOptions(): GridInfoOptions;
|
|
9
9
|
validateAdaptableOptionsValues(): void;
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { ADAPTABLE_METAMODEL } from '../../metamodel/adaptable.metamodel';
|
|
2
|
-
import { DefaultAdaptableOptions } from '../Defaults/DefaultAdaptableOptions';
|
|
3
2
|
import { AdaptableOptionsDocsLink } from '../Constants/DocumentationLinkConstants';
|
|
4
3
|
import StringExtensions from '../Extensions/StringExtensions';
|
|
5
4
|
import { AdaptableLogger } from '../../agGrid/AdaptableLogger';
|
|
5
|
+
import { getDefaultAdaptableOptions } from '../../agGrid/defaultAdaptableOptions';
|
|
6
6
|
const supportedMetamodelTypes = ['s', 'n', 'b', 'a', 'f', 'R'];
|
|
7
7
|
export class MetamodelService {
|
|
8
|
-
constructor(getAdaptableOptions) {
|
|
8
|
+
constructor(getAdaptableOptions, validateOptions) {
|
|
9
9
|
this.gridInfoOptions = new Map();
|
|
10
10
|
this.getAdaptableOptions = () => null;
|
|
11
11
|
this.getAdaptableOptions = getAdaptableOptions;
|
|
12
12
|
this.gridInfoOptions = this.buildGridInfoOptions();
|
|
13
|
+
if (validateOptions) {
|
|
14
|
+
this.validateAdaptableOptionsValues();
|
|
15
|
+
}
|
|
13
16
|
}
|
|
14
17
|
getGridInfoOptions() {
|
|
15
18
|
return this.gridInfoOptions;
|
|
@@ -140,7 +143,7 @@ export class MetamodelService {
|
|
|
140
143
|
});
|
|
141
144
|
}
|
|
142
145
|
getAdaptableOptionsDefaultValues() {
|
|
143
|
-
return
|
|
146
|
+
return getDefaultAdaptableOptions();
|
|
144
147
|
}
|
|
145
148
|
getAdaptableMetamodel() {
|
|
146
149
|
return ADAPTABLE_METAMODEL;
|
|
@@ -16,7 +16,7 @@ export declare class QueryLanguageService implements IQueryLanguageService {
|
|
|
16
16
|
constructor(adaptableApi: AdaptableApi);
|
|
17
17
|
evaluateBooleanExpression(expression: string, module: AdaptableModule, rowNode: any): any;
|
|
18
18
|
evaluateScalarExpression(expression: string, module: AdaptableModule, rowNode: IRowNode): any;
|
|
19
|
-
evaluateAggregatedScalarExpression(expression: string, module: AdaptableModule): ScalarAggregationParameter;
|
|
19
|
+
evaluateAggregatedScalarExpression(expression: string, module: AdaptableModule, getRowNodes?: () => IRowNode[]): ScalarAggregationParameter;
|
|
20
20
|
evaluateObservableExpression(reactiveExpression: string, module: AdaptableModule): Observable<CellDataChangedInfo | GridDataChangedInfo>;
|
|
21
21
|
evaluateAggregatedBooleanExpression(aggregationExpression: string, module: AdaptableModule): BooleanAggregationParameter;
|
|
22
22
|
validateBoolean(expressionInput: string, module: AdaptableModule, config?: {
|
|
@@ -32,7 +32,7 @@ export class QueryLanguageService {
|
|
|
32
32
|
// currently scalar and boolean expressions are evaluated the same
|
|
33
33
|
return this.evaluateBooleanExpression(expression, module, rowNode);
|
|
34
34
|
}
|
|
35
|
-
evaluateAggregatedScalarExpression(expression, module) {
|
|
35
|
+
evaluateAggregatedScalarExpression(expression, module, getRowNodes) {
|
|
36
36
|
const aggregatedScalarFunctions = this.getModuleExpressionFunctionsMap(module).aggregatedScalarFunctions;
|
|
37
37
|
return parser.evaluate(expression, {
|
|
38
38
|
node: null,
|
|
@@ -41,6 +41,7 @@ export class QueryLanguageService {
|
|
|
41
41
|
adaptableId: this.adaptableApi.optionsApi.getAdaptableId(),
|
|
42
42
|
functions: aggregatedScalarFunctions,
|
|
43
43
|
evaluateCustomQueryVariable: this.evaluateCustomQueryVariable,
|
|
44
|
+
getRowNodes,
|
|
44
45
|
});
|
|
45
46
|
}
|
|
46
47
|
evaluateObservableExpression(reactiveExpression, module) {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { IRowEditService } from './Interface/IRowEditService';
|
|
2
1
|
import { AdaptableApi } from '../../Api/AdaptableApi';
|
|
3
|
-
|
|
2
|
+
import { IAdaptableService } from './Interface/IAdaptableService';
|
|
3
|
+
export declare class RowEditService implements IAdaptableService {
|
|
4
4
|
private adaptableApi;
|
|
5
5
|
constructor(adaptableApi: AdaptableApi);
|
|
6
6
|
private autoHandleActionRowButtons;
|
|
7
|
+
destroy(): void;
|
|
7
8
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// @ts-ignore
|
|
2
1
|
export class RowEditService {
|
|
3
2
|
constructor(adaptableApi) {
|
|
4
3
|
this.adaptableApi = adaptableApi;
|
|
@@ -37,4 +36,7 @@ export class RowEditService {
|
|
|
37
36
|
adaptableApi.gridApi.addGridData([newRowData], config);
|
|
38
37
|
}
|
|
39
38
|
}
|
|
39
|
+
destroy() {
|
|
40
|
+
// nothing yet
|
|
41
|
+
}
|
|
40
42
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IRowNode } from '@ag-grid-community/core';
|
|
2
|
+
import { AggregatedScalarLiveValue } from './AggregatedScalarLiveValue';
|
|
3
|
+
import { AdaptableApi, AdaptableModule } from '../../types';
|
|
4
|
+
export declare const summarySupportedExpressions: readonly ["SUM", "AVG", "MIN", "MAX", "COUNT", "MEDIAN", "MODE", "DISTINCT", "ONLY", "STD_DEVIATION"];
|
|
5
|
+
export type SummarySupportedExpression = (typeof summarySupportedExpressions)[number];
|
|
6
|
+
export type SumaryConfig = {
|
|
7
|
+
expression: {
|
|
8
|
+
function: SummarySupportedExpression;
|
|
9
|
+
};
|
|
10
|
+
columnId: string;
|
|
11
|
+
getRowNodes?: () => IRowNode[];
|
|
12
|
+
};
|
|
13
|
+
export declare class SummaryService {
|
|
14
|
+
private adaptableApi;
|
|
15
|
+
constructor(adaptableApi: AdaptableApi);
|
|
16
|
+
evaluateExpressionValue(config: SumaryConfig, moduleId: AdaptableModule): any;
|
|
17
|
+
evaluateScalarLiveValue(config: SumaryConfig, moduleId: AdaptableModule): AggregatedScalarLiveValue;
|
|
18
|
+
destroy(): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AggregatedScalarLiveValue } from './AggregatedScalarLiveValue';
|
|
2
|
+
export const summarySupportedExpressions = [
|
|
3
|
+
'SUM',
|
|
4
|
+
'AVG',
|
|
5
|
+
'MIN',
|
|
6
|
+
'MAX',
|
|
7
|
+
'COUNT',
|
|
8
|
+
'MEDIAN',
|
|
9
|
+
'MODE',
|
|
10
|
+
'DISTINCT',
|
|
11
|
+
'ONLY',
|
|
12
|
+
'STD_DEVIATION',
|
|
13
|
+
];
|
|
14
|
+
export class SummaryService {
|
|
15
|
+
constructor(adaptableApi) {
|
|
16
|
+
this.adaptableApi = adaptableApi;
|
|
17
|
+
}
|
|
18
|
+
evaluateExpressionValue(config, moduleId) {
|
|
19
|
+
return this.evaluateScalarLiveValue(config, moduleId).getGlobalAggregatedValue();
|
|
20
|
+
}
|
|
21
|
+
evaluateScalarLiveValue(config, moduleId) {
|
|
22
|
+
return new AggregatedScalarLiveValue({
|
|
23
|
+
aggregatedScalarExpression: `${config.expression.function}([${config.columnId}])`,
|
|
24
|
+
}, moduleId, this.adaptableApi, config.getRowNodes);
|
|
25
|
+
}
|
|
26
|
+
destroy() {
|
|
27
|
+
this.adaptableApi = null;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -1,65 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
const getGenericError = () => new Error('Invalid License');
|
|
3
|
-
export const GENERIC_APP_NAME = 'GenericAdaptableApp';
|
|
4
|
-
export const fieldsToLicenseDetails = (fields) => {
|
|
5
|
-
var _a;
|
|
6
|
-
const fieldsMap = fields.reduce((acc, field) => {
|
|
7
|
-
acc.set(field.name, field.value);
|
|
8
|
-
return acc;
|
|
9
|
-
}, new Map());
|
|
10
|
-
const details = {
|
|
11
|
-
start: new Date(fieldsMap.get('StartDate')),
|
|
12
|
-
end: new Date(fieldsMap.get('EndDate')),
|
|
13
|
-
owner: fieldsMap.get('Owner'),
|
|
14
|
-
appName: fieldsMap.get('AppName') || GENERIC_APP_NAME,
|
|
15
|
-
timestamp: fieldsMap.get('TS') ? Number(fieldsMap.get('TS')) : 0,
|
|
16
|
-
trial: fieldsMap.get('Trial') === 'true' ? true : false,
|
|
17
|
-
ref: (_a = fieldsMap.get('Ref')) !== null && _a !== void 0 ? _a : '',
|
|
18
|
-
};
|
|
19
|
-
if (!details.start ||
|
|
20
|
-
!details.end ||
|
|
21
|
-
!details.owner ||
|
|
22
|
-
typeof details.trial !== 'boolean' ||
|
|
23
|
-
!details.ref) {
|
|
24
|
-
throw getGenericError();
|
|
25
|
-
}
|
|
26
|
-
return details;
|
|
27
|
-
};
|
|
28
|
-
export const decode = (licenseKey) => {
|
|
29
|
-
let crc = '';
|
|
30
|
-
let fields = licenseKey.split('|').map((part) => {
|
|
31
|
-
let [name, value] = part.split('=');
|
|
32
|
-
if (name === 'C') {
|
|
33
|
-
crc = value;
|
|
34
|
-
}
|
|
35
|
-
return {
|
|
36
|
-
name,
|
|
37
|
-
value,
|
|
38
|
-
};
|
|
39
|
-
});
|
|
40
|
-
if (!crc) {
|
|
41
|
-
throw getGenericError();
|
|
42
|
-
}
|
|
43
|
-
const crcParts = crc.split(',').reverse();
|
|
44
|
-
const overallCrc = crcParts.pop();
|
|
45
|
-
crcParts.forEach((fieldCrc, index) => {
|
|
46
|
-
const field = fields[index];
|
|
47
|
-
if (compute_string(field.value) !== fieldCrc) {
|
|
48
|
-
throw getGenericError();
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
const fieldsWithoutC = [...fields];
|
|
52
|
-
fieldsWithoutC.pop();
|
|
53
|
-
const fieldsWithoutCString = fieldsWithoutC
|
|
54
|
-
.map((field) => {
|
|
55
|
-
return `${field.name}=${field.value}`;
|
|
56
|
-
})
|
|
57
|
-
.join('|');
|
|
58
|
-
if (compute_string(fieldsWithoutCString) !== overallCrc) {
|
|
59
|
-
throw getGenericError();
|
|
60
|
-
}
|
|
61
|
-
fields = fields.map((f) => {
|
|
62
|
-
return Object.assign(Object.assign({}, f), { value: decodeURI(f.value) });
|
|
63
|
-
});
|
|
64
|
-
return fieldsToLicenseDetails(fields);
|
|
65
|
-
};
|
|
1
|
+
import{compute_string as e}from"./hashing";const t=()=>new Error("Invalid License");export const GENERIC_APP_NAME="GenericAdaptableApp";export const fieldsToLicenseDetails=e=>{var a;const r=e.reduce(((e,t)=>(e.set(t.name,t.value),e)),new Map),n={start:new Date(r.get("StartDate")),end:new Date(r.get("EndDate")),owner:r.get("Owner"),appName:r.get("AppName")||GENERIC_APP_NAME,timestamp:r.get("TS")?Number(r.get("TS")):0,trial:"true"===r.get("Trial"),ref:null!==(a=r.get("Ref"))&&void 0!==a?a:""};if(!(n.start&&n.end&&n.owner&&"boolean"==typeof n.trial&&n.ref))throw t();return n};export const decode=a=>{let r="",n=a.split("|").map((e=>{let[t,a]=e.split("=");return"C"===t&&(r=a),{name:t,value:a}}));if(!r)throw t();const o=r.split(",").reverse(),s=o.pop();o.forEach(((a,r)=>{const o=n[r];if(e(o.value)!==a)throw t()}));const i=[...n];i.pop();const p=i.map((e=>`${e.name}=${e.value}`)).join("|");if(e(p)!==s)throw t();return n=n.map((e=>Object.assign(Object.assign({},e),{value:decodeURI(e.value)}))),fieldsToLicenseDetails(n)};
|
|
@@ -1,43 +1 @@
|
|
|
1
|
-
const
|
|
2
|
-
/*
|
|
3
|
-
* CRC-32 implementation
|
|
4
|
-
*/
|
|
5
|
-
function generate(reversedPolynomial = DEFAULT_ReversedPolynomial) {
|
|
6
|
-
var table = new Array();
|
|
7
|
-
var i, j, n;
|
|
8
|
-
for (i = 0; i < 256; i++) {
|
|
9
|
-
n = i;
|
|
10
|
-
for (j = 8; j > 0; j--) {
|
|
11
|
-
if ((n & 1) == 1) {
|
|
12
|
-
n = (n >>> 1) ^ reversedPolynomial;
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
n = n >>> 1;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
table[i] = n;
|
|
19
|
-
}
|
|
20
|
-
return table;
|
|
21
|
-
}
|
|
22
|
-
function crc32_initial() {
|
|
23
|
-
return 0xffffffff;
|
|
24
|
-
}
|
|
25
|
-
function crc32_add_byte(table, crc, byte) {
|
|
26
|
-
crc = (crc >>> 8) ^ table[byte ^ (crc & 0x000000ff)];
|
|
27
|
-
return crc;
|
|
28
|
-
}
|
|
29
|
-
function crc32_final(crc) {
|
|
30
|
-
crc = ~crc;
|
|
31
|
-
crc = crc < 0 ? 0xffffffff + crc + 1 : crc;
|
|
32
|
-
return crc;
|
|
33
|
-
}
|
|
34
|
-
export function compute_string(str, reversedPolynomial = DEFAULT_ReversedPolynomial) {
|
|
35
|
-
var table = generate(reversedPolynomial);
|
|
36
|
-
var crc = 0;
|
|
37
|
-
var i;
|
|
38
|
-
crc = crc32_initial();
|
|
39
|
-
for (i = 0; i < str.length; i++)
|
|
40
|
-
crc = crc32_add_byte(table, crc, str.charCodeAt(i));
|
|
41
|
-
crc = crc32_final(crc);
|
|
42
|
-
return `${crc}`;
|
|
43
|
-
}
|
|
1
|
+
const r=3988292384;function n(n=r){var t,o,u,e=new Array;for(t=0;t<256;t++){for(u=t,o=8;o>0;o--)1&~u?u>>>=1:u=u>>>1^n;e[t]=u}return e}function t(){return 4294967295}function o(r,n,t){return n=n>>>8^r[t^255&n]}function u(r){return r=(r=~r)<0?4294967295+r+1:r}export function compute_string(e,c=r){var f,i=n(c),a=0;for(a=t(),f=0;f<e.length;f++)a=o(i,a,e.charCodeAt(f));return`${a=u(a)}`}
|
|
@@ -3,7 +3,6 @@ import { connect } from 'react-redux';
|
|
|
3
3
|
import { ProgressIndicator } from '../components/ProgressIndicator/ProgressIndicator';
|
|
4
4
|
import { ToastContainer } from '../components/Toastify';
|
|
5
5
|
import * as PopupRedux from '../Redux/ActionsReducers/PopupRedux';
|
|
6
|
-
import { AdaptableLoadingScreen } from './Components/Popups/AdaptableLoadingScreen';
|
|
7
6
|
import { AdaptablePopup } from './Components/Popups/AdaptablePopup';
|
|
8
7
|
import { AdaptablePopupConfirmation } from './Components/Popups/AdaptablePopupConfirmation';
|
|
9
8
|
import { AdaptablePopupPrompt } from './Components/Popups/AdaptablePopupPrompt';
|
|
@@ -23,7 +22,6 @@ class AdaptableView extends React.Component {
|
|
|
23
22
|
React.createElement(GridCellPopup, null),
|
|
24
23
|
React.createElement(QuickSearchDrawer, null),
|
|
25
24
|
this.props.AdaptableApi.internalApi.getModuleService().isModuleAvailable('Dashboard') && (React.createElement(Dashboard, { api: this.props.AdaptableApi })),
|
|
26
|
-
this.props.AdaptableApi.optionsApi.getUserInterfaceOptions().showLoadingScreen && (React.createElement(AdaptableLoadingScreen, { onClose: this.props.onCloseLoadingPopup, showLoadingScreen: this.props.PopupState.LoadingPopup.ShowLoadingPopup })),
|
|
27
25
|
this.props.PopupState.PromptPopup.ShowPromptPopup && (React.createElement(AdaptablePopupPrompt, { message: this.props.PopupState.PromptPopup.Message, header: this.props.PopupState.PromptPopup.Header, onClose: this.props.onClosePromptPopup, onConfirm: this.props.onConfirmPromptPopup, onConfirmActionCreator: this.props.PopupState.PromptPopup.ConfirmActionCreator, defaultValue: this.props.PopupState.PromptPopup.DefaultValue })),
|
|
28
26
|
Boolean(this.props.PopupState.ConfirmationPopup.ShowConfirmationPopup) && (React.createElement(AdaptablePopupConfirmation, { header: this.props.PopupState.ConfirmationPopup.Header, messsage: this.props.PopupState.ConfirmationPopup.Msg, showPopup: this.props.PopupState.ConfirmationPopup.ShowConfirmationPopup, cancelButtonText: this.props.PopupState.ConfirmationPopup.CancelButtonText, confirmButtonText: this.props.PopupState.ConfirmationPopup.ConfirmButtonText, onCancel: this.props.onCancelConfirmationPopup, onConfirm: this.props.onConfirmConfirmationPopup, showInputBox: this.props.PopupState.ConfirmationPopup.ShowInputBox, messageType: this.props.PopupState.ConfirmationPopup.MessageType, api: this.props.AdaptableApi })),
|
|
29
27
|
Boolean(this.props.PopupState.ScreenPopup.ShowScreenPopup) && (React.createElement(AdaptablePopup, { componentName: this.props.PopupState.ScreenPopup.ComponentName, componentModule: this.props.PopupState.ScreenPopup.ComponentModule, onHide: this.props.onCloseScreenPopup, api: this.props.AdaptableApi, onClearParams: () => this.props.onClearPopupParams(), moduleParams: this.props.PopupState.ScreenPopup.Params, moduleProps: this.props.PopupState.ScreenPopup.PopupProps })),
|
|
@@ -33,7 +31,7 @@ class AdaptableView extends React.Component {
|
|
|
33
31
|
, {
|
|
34
32
|
// we NEEEEED!!!! this containerId, otherwise, toastify will have memory leaks when the adaptable
|
|
35
33
|
// instance is destroyed and re-created many times
|
|
36
|
-
containerId: adaptableOptions.adaptableId
|
|
34
|
+
containerId: `Toastify-${adaptableOptions.adaptableId}`, limit: adaptableOptions.notificationsOptions.maxNotifications, closeButton: false, icon: false, theme: "colored" }),
|
|
37
35
|
(watermark === null || watermark === void 0 ? void 0 : watermark.show) && React.createElement(LicenseWatermark, null, watermark === null || watermark === void 0 ? void 0 : watermark.text),
|
|
38
36
|
React.createElement(WindowPopups, null),
|
|
39
37
|
React.createElement(FormPopups, null),
|
|
@@ -7,7 +7,7 @@ import GridOptionsForm from './GridOptionsForm';
|
|
|
7
7
|
import EntitlementsForm from './EntitlementsForm';
|
|
8
8
|
import { UIElementsForm } from './UIOptions/UiOptionsForm';
|
|
9
9
|
import { AdaptableOptionsForm } from './AdaptableOptionsForm';
|
|
10
|
-
import
|
|
10
|
+
import { applyDefaultAdaptableOptions } from '../../../agGrid/defaultAdaptableOptions';
|
|
11
11
|
export const ConfigurationWizard = (props) => {
|
|
12
12
|
const [isPrimaryKeySelected, setIsValid] = React.useState(true);
|
|
13
13
|
const [adaptableConfig, setAdaptableConfig] = useState(() => {
|
|
@@ -17,7 +17,7 @@ export const ConfigurationWizard = (props) => {
|
|
|
17
17
|
},
|
|
18
18
|
};
|
|
19
19
|
const gridOptions = Object.assign(Object.assign({}, gridOptionDefaults), props.adaptableConfig.gridOptions);
|
|
20
|
-
const adaptableOptions =
|
|
20
|
+
const adaptableOptions = applyDefaultAdaptableOptions(props.adaptableConfig.adaptableOptions);
|
|
21
21
|
return { gridOptions, adaptableOptions };
|
|
22
22
|
});
|
|
23
23
|
const [selectedColumns, setSelectedColumns] = useState(() => {
|
|
@@ -51,7 +51,7 @@ class BulkUpdatePopupComponent extends React.Component {
|
|
|
51
51
|
this.props.PreviewInfo.previewValidationSummary.validationResult == 'All', onClick: () => {
|
|
52
52
|
this.onApplyClick();
|
|
53
53
|
}, variant: "raised", tone: "accent" }, "Apply to Grid")))) : (React.createElement(React.Fragment, null,
|
|
54
|
-
React.createElement(HelpBlock, { marginTop: 2, marginBottom: 2 }, "Select an existing
|
|
54
|
+
React.createElement(HelpBlock, { marginTop: 2, marginBottom: 2 }, "Select an existing Column value from the dropdown, or enter a new value"),
|
|
55
55
|
React.createElement(Flex, { marginTop: 2, flexDirection: "row", alignItems: "center" },
|
|
56
56
|
React.createElement(Flex, { alignItems: "center", flexDirection: "row", flex: 1, marginRight: 2 },
|
|
57
57
|
React.createElement(ColumnValueSelector, { selectedGridCells: this.props.SelectedGridCells, selectedColumnValue: this.props.BulkUpdateValue, selectedColumn: col, api: this.props.api, onColumnValueChange: (columns) => this.onColumnValueSelectedChanged(columns), style: { width: '100%', maxWidth: 'inherit' } })),
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { CalculatedColumn } from '../../../types';
|
|
3
3
|
import { AdaptableOnePageWizardProps } from '../../Wizard/Interface/IAdaptableWizard';
|
|
4
4
|
export declare const calculatedColumnTypes: readonly ["ScalarExpression", "AggregatedScalarExpression", "CumulativeAggregatedExpression", "QuantileAggregatedExpression"];
|
|
5
|
-
export type ExpressionType = typeof calculatedColumnTypes[number];
|
|
5
|
+
export type ExpressionType = (typeof calculatedColumnTypes)[number];
|
|
6
6
|
export interface CalculatedColumnWizardProps extends AdaptableOnePageWizardProps<CalculatedColumn> {
|
|
7
7
|
}
|
|
8
8
|
export declare const CalculatedColumnWizard: (props: CalculatedColumnWizardProps) => JSX.Element;
|
|
@@ -33,7 +33,7 @@ export const CalculatedColumnWizard = (props) => {
|
|
|
33
33
|
if ((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.column) {
|
|
34
34
|
const calculatedColumn = allCalculatedColumns.find((calculatedColumn) => calculatedColumn.ColumnId === props.popupParams.column.columnId);
|
|
35
35
|
if (calculatedColumn) {
|
|
36
|
-
return calculatedColumn;
|
|
36
|
+
return cloneObject(calculatedColumn);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
return ObjectFactory.CreateEmptyCalculatedColumn();
|
|
@@ -51,7 +51,7 @@ export const CalculatedColumnWizard = (props) => {
|
|
|
51
51
|
};
|
|
52
52
|
const [expressionType, setExpressionType] = useState(() => {
|
|
53
53
|
var _a;
|
|
54
|
-
return (_a = getExpressionType(
|
|
54
|
+
return (_a = getExpressionType(calculatedColumn, adaptable.api)) !== null && _a !== void 0 ? _a : 'ScalarExpression';
|
|
55
55
|
});
|
|
56
56
|
const handleExpressionTypeChange = (type) => {
|
|
57
57
|
setExpressionType(type);
|