@adaptabletools/adaptable 18.0.0-canary.0 → 18.0.0-canary.10
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 +11 -10
- 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 +19 -7
- 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/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/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 +46 -8
- 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/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/Textarea/index.d.ts +9 -0
- package/src/components/Textarea/index.js +50 -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 +157 -34
- 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;
|
|
@@ -22,34 +22,46 @@ export var LicenseValidityType;
|
|
|
22
22
|
const SANDPACK_REGEX = /(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g;
|
|
23
23
|
const SANDBOX_REGEX = /(https):\/\/\S+(\.csb\.app)/g;
|
|
24
24
|
const DEMO_REGEX = /(https):\/\/\S+(\.adaptabletools\.com)/g;
|
|
25
|
-
const
|
|
25
|
+
const getOrigin = () => {
|
|
26
|
+
return typeof window !== 'undefined' ? window.location.origin : '';
|
|
27
|
+
};
|
|
26
28
|
const isInsideSandpack = () => {
|
|
27
|
-
const [_fullUrl, protocol, sandpackUrl] = Array.from(SANDPACK_REGEX.exec(
|
|
29
|
+
const [_fullUrl, protocol, sandpackUrl] = Array.from(SANDPACK_REGEX.exec(getOrigin()) || []);
|
|
28
30
|
return protocol === 'https' && sandpackUrl === 'sandpack.codesandbox.io';
|
|
29
31
|
};
|
|
30
32
|
const isInsideSandbox = () => {
|
|
31
|
-
const [_fullUrl, protocol, sandboxUrl] = Array.from(SANDBOX_REGEX.exec(
|
|
33
|
+
const [_fullUrl, protocol, sandboxUrl] = Array.from(SANDBOX_REGEX.exec(getOrigin()) || []);
|
|
32
34
|
return protocol === 'https' && sandboxUrl === '.csb.app';
|
|
33
35
|
};
|
|
34
36
|
const isDemoApp = () => {
|
|
35
|
-
const [_fullUrl, protocol, demoAppUrl] = Array.from(DEMO_REGEX.exec(
|
|
37
|
+
const [_fullUrl, protocol, demoAppUrl] = Array.from(DEMO_REGEX.exec(getOrigin()) || []);
|
|
36
38
|
return protocol === 'https' && demoAppUrl === '.adaptabletools.com';
|
|
37
39
|
};
|
|
38
40
|
export class LicenseService {
|
|
39
41
|
constructor(adaptable, licenseKey, packageDetails) {
|
|
40
42
|
this.adaptable = adaptable;
|
|
43
|
+
this.licenseKey = licenseKey;
|
|
44
|
+
this.packageDetails = packageDetails;
|
|
41
45
|
this.adaptable = adaptable;
|
|
46
|
+
this.adaptable.api.eventApi.on('AdaptableReady', () => {
|
|
47
|
+
requestAnimationFrame(() => {
|
|
48
|
+
// using a rAF because we want to make sure that the window.location.origin is available (Master/Detail is fidgity sometimes)
|
|
49
|
+
this.init();
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
init() {
|
|
42
54
|
let details = null;
|
|
43
|
-
if (licenseKey) {
|
|
55
|
+
if (this.licenseKey) {
|
|
44
56
|
try {
|
|
45
|
-
details = decodeLicense(licenseKey);
|
|
57
|
+
details = decodeLicense(this.licenseKey);
|
|
46
58
|
}
|
|
47
59
|
catch (error) {
|
|
48
60
|
details = error;
|
|
49
61
|
}
|
|
50
62
|
}
|
|
51
63
|
if (!isInsideSandpack() && !isInsideSandbox() && !isDemoApp()) {
|
|
52
|
-
this.handleLicenseValidation(details, this.getValidityType(details, packageDetails));
|
|
64
|
+
this.handleLicenseValidation(details, this.getValidityType(details, this.packageDetails));
|
|
53
65
|
}
|
|
54
66
|
}
|
|
55
67
|
getValidityType(details, packageDetails) {
|
|
@@ -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
|
+
}
|
|
@@ -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' } })),
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { AdaptableApi, CalculatedColumn } from '../../types';
|
|
2
|
-
export declare const getExpressionType: (calculatedColumn: CalculatedColumn, api: AdaptableApi) => "
|
|
2
|
+
export declare const getExpressionType: (calculatedColumn: CalculatedColumn, api: AdaptableApi) => "AggregatedScalarExpression" | "ScalarExpression" | "CumulativeAggregatedExpression" | "QuantileAggregatedExpression";
|
|
@@ -11,7 +11,7 @@ class CellSummaryPopupComponent extends React.Component {
|
|
|
11
11
|
// afterwards, we will go on with the cell summary logic, as that will evaluate the current(column) cell selection
|
|
12
12
|
this.props.api.columnApi.selectColumn((_c = this.props.popupParams) === null || _c === void 0 ? void 0 : _c.column.columnId);
|
|
13
13
|
// we also need to update the internal state of the selected cells
|
|
14
|
-
this.props.api.internalApi.getAdaptableInstance().
|
|
14
|
+
this.props.api.internalApi.getAdaptableInstance().refreshSelectedCellsState();
|
|
15
15
|
}
|
|
16
16
|
this.props.onCreateCellSummary();
|
|
17
17
|
}
|
|
@@ -29,8 +29,8 @@ const CellComments = (props) => {
|
|
|
29
29
|
return formatDate(params.data.Timestamp, 'MM.DD.YYYY HH:mm');
|
|
30
30
|
},
|
|
31
31
|
},
|
|
32
|
-
|
|
33
|
-
header: '
|
|
32
|
+
text: {
|
|
33
|
+
header: 'Text',
|
|
34
34
|
field: 'Value',
|
|
35
35
|
defaultFlex: 3,
|
|
36
36
|
},
|
|
@@ -38,15 +38,19 @@ const CellComments = (props) => {
|
|
|
38
38
|
return columns;
|
|
39
39
|
}, []);
|
|
40
40
|
const cellValue = adaptable.api.gridApi.getCellDisplayValue(props.commentThread.PrimaryKeyValue, props.commentThread.ColumnId);
|
|
41
|
+
const primaryKeyHeader = React.useMemo(() => {
|
|
42
|
+
const primaryKey = adaptable.api.optionsApi.getPrimaryKey();
|
|
43
|
+
return adaptable.api.columnApi.getFriendlyNameForColumnId(primaryKey);
|
|
44
|
+
}, []);
|
|
41
45
|
const columnFriendlyName = adaptable.api.columnApi.getFriendlyNameForColumnId(props.commentThread.ColumnId);
|
|
42
46
|
return (React.createElement(Panel, { mb: 2, header: React.createElement(Flex, { width: "100%", alignItems: "center" },
|
|
43
47
|
React.createElement(Box, { mr: 2 },
|
|
44
48
|
"Cell Value: ",
|
|
45
49
|
cellValue),
|
|
46
50
|
React.createElement(Box, { mr: 2 },
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
primaryKeyHeader,
|
|
52
|
+
": ",
|
|
53
|
+
props.commentThread.PrimaryKeyValue),
|
|
50
54
|
React.createElement(Box, null,
|
|
51
55
|
"Column: ",
|
|
52
56
|
columnFriendlyName),
|
|
@@ -72,11 +76,11 @@ const CellComments = (props) => {
|
|
|
72
76
|
}, rowHeight: 30, columnHeaderHeight: 30, domProps: tableDOMProps, columns: columnsMap }))));
|
|
73
77
|
};
|
|
74
78
|
export const CommentsPopup = (props) => {
|
|
75
|
-
const
|
|
79
|
+
const commentThreads = useSelector((state) => {
|
|
76
80
|
return state.Comment.CommentThreads;
|
|
77
81
|
});
|
|
78
|
-
return (React.createElement(PopupPanel, { headerText: 'Comments', glyphicon: 'comments', infoLink: props.moduleInfo.HelpPage }, (
|
|
82
|
+
return (React.createElement(PopupPanel, { headerText: 'Comments', glyphicon: 'comments', infoLink: props.moduleInfo.HelpPage }, (commentThreads !== null && commentThreads !== void 0 ? commentThreads : []).map((commentThread, index) => {
|
|
79
83
|
var _a;
|
|
80
|
-
return React.createElement(CellComments, { key: (_a =
|
|
84
|
+
return React.createElement(CellComments, { key: (_a = commentThread === null || commentThread === void 0 ? void 0 : commentThread.Uuid) !== null && _a !== void 0 ? _a : index, commentThread: commentThread });
|
|
81
85
|
})));
|
|
82
86
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { AdaptableInputProps } from '../AdaptableInput';
|
|
3
3
|
export type AdaptableDateInputProps = AdaptableInputProps;
|
|
4
|
-
declare const AdaptableDateInput: React.ForwardRefExoticComponent<Pick<import("../../../components/Input").InputProps, "children" | "size" | "name" | "tabIndex" | "color" | "style" | "cite" | "data" | "form" | "label" | "p" | "slot" | "span" | "summary" | "title" | "pattern" | "start" | "hidden" | "content" | "default" | "flex" | "wrap" | "open" | "padding" | "multiple" | "disabled" | "checked" | "download" | "list" | "order" | "target" | "src" | "className" | "onTransitionEnd" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEndCapture" | "opacity" | "value" | "key" | "sizes" | "variant" | "tx" | "as" | "css" | "m" | "margin" | "mt" | "marginTop" | "mr" | "marginRight" | "mb" | "marginBottom" | "ml" | "marginLeft" | "mx" | "marginX" | "my" | "marginY" | "pt" | "paddingTop" | "pr" | "paddingRight" | "pb" | "paddingBottom" | "pl" | "paddingLeft" | "px" | "paddingX" | "py" | "paddingY" | "width" | "height" | "minWidth" | "minHeight" | "maxWidth" | "maxHeight" | "display" | "verticalAlign" | "overflow" | "overflowX" | "overflowY" | "fontFamily" | "fontSize" | "fontWeight" | "lineHeight" | "letterSpacing" | "fontStyle" | "textAlign" | "bg" | "backgroundColor" | "alignItems" | "alignContent" | "justifyItems" | "justifyContent" | "flexWrap" | "flexDirection" | "flexGrow" | "flexShrink" | "flexBasis" | "justifySelf" | "alignSelf" | "sx" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "
|
|
4
|
+
declare const AdaptableDateInput: React.ForwardRefExoticComponent<Pick<import("../../../components/Input").InputProps, "children" | "size" | "name" | "tabIndex" | "color" | "style" | "cite" | "data" | "form" | "label" | "p" | "slot" | "span" | "summary" | "title" | "pattern" | "start" | "hidden" | "content" | "default" | "flex" | "wrap" | "open" | "padding" | "multiple" | "disabled" | "checked" | "download" | "list" | "order" | "target" | "rows" | "src" | "className" | "onTransitionEnd" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEndCapture" | "opacity" | "value" | "key" | "sizes" | "variant" | "tx" | "as" | "css" | "m" | "margin" | "mt" | "marginTop" | "mr" | "marginRight" | "mb" | "marginBottom" | "ml" | "marginLeft" | "mx" | "marginX" | "my" | "marginY" | "pt" | "paddingTop" | "pr" | "paddingRight" | "pb" | "paddingBottom" | "pl" | "paddingLeft" | "px" | "paddingX" | "py" | "paddingY" | "width" | "height" | "minWidth" | "minHeight" | "maxWidth" | "maxHeight" | "display" | "verticalAlign" | "overflow" | "overflowX" | "overflowY" | "fontFamily" | "fontSize" | "fontWeight" | "lineHeight" | "letterSpacing" | "fontStyle" | "textAlign" | "bg" | "backgroundColor" | "alignItems" | "alignContent" | "justifyItems" | "justifyContent" | "flexWrap" | "flexDirection" | "flexGrow" | "flexShrink" | "flexBasis" | "justifySelf" | "alignSelf" | "sx" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "srcDoc" | "srcLang" | "srcSet" | "step" | "type" | "useMap" | "wmode" | "placehoder"> & React.RefAttributes<HTMLInputElement>>;
|
|
5
5
|
export default AdaptableDateInput;
|
|
@@ -56,6 +56,7 @@ export const renderScopeSummary = (scope, labels) => {
|
|
|
56
56
|
};
|
|
57
57
|
const DATA_TYPES_OPTIONS = Object.values(DATA_TYPES_MAP);
|
|
58
58
|
export const NewScopeComponent = (props) => {
|
|
59
|
+
var _a, _b;
|
|
59
60
|
const { api } = useAdaptable();
|
|
60
61
|
const { scopeApi, columnApi } = api;
|
|
61
62
|
const [columnsSearchText, setColumnsSearchText] = useState('');
|
|
@@ -79,6 +80,9 @@ export const NewScopeComponent = (props) => {
|
|
|
79
80
|
if (scopeApi.scopeHasDataType(props.scope)) {
|
|
80
81
|
return 'DataType';
|
|
81
82
|
}
|
|
83
|
+
if (scopeApi.scopeHasColumnType(props.scope)) {
|
|
84
|
+
return 'ColumnType';
|
|
85
|
+
}
|
|
82
86
|
return undefined;
|
|
83
87
|
};
|
|
84
88
|
const onScopeSelectChanged = (value) => {
|
|
@@ -93,6 +97,11 @@ export const NewScopeComponent = (props) => {
|
|
|
93
97
|
DataTypes: [],
|
|
94
98
|
};
|
|
95
99
|
}
|
|
100
|
+
else if (value == 'ColumnType') {
|
|
101
|
+
newScope = {
|
|
102
|
+
ColumnTypes: [],
|
|
103
|
+
};
|
|
104
|
+
}
|
|
96
105
|
else {
|
|
97
106
|
newScope = {
|
|
98
107
|
All: true,
|
|
@@ -128,6 +137,10 @@ export const NewScopeComponent = (props) => {
|
|
|
128
137
|
if (Array.isArray(props.availableDataTypes)) {
|
|
129
138
|
dataTypeOptions = props.availableDataTypes.map((dataType) => DATA_TYPES_MAP[dataType]);
|
|
130
139
|
}
|
|
140
|
+
const hasColumnTypes = React.useMemo(() => {
|
|
141
|
+
var _a;
|
|
142
|
+
return ((_a = api.optionsApi.getColumnTypes()) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
143
|
+
}, []);
|
|
131
144
|
return (React.createElement(Tabs, { "data-name": 'scope-component', className: "ab-ScopeComponent", value: scopeChoice, style: Object.assign({ height: '100%' }, props.style), onValueChange: onScopeSelectChanged },
|
|
132
145
|
props.hideWholeRow ? null : (React.createElement(Tabs.Tab, { value: "Row" },
|
|
133
146
|
React.createElement(Radio, { margin: 0, checked: scopeChoice == 'All', tabIndex: -1 }, "All Columns"))),
|
|
@@ -135,6 +148,8 @@ export const NewScopeComponent = (props) => {
|
|
|
135
148
|
React.createElement(Radio, { margin: 0, value: "Column", checked: scopeChoice == 'Column', tabIndex: -1 }, "Selected Columns"))),
|
|
136
149
|
!props.disableDataTypes && (React.createElement(Tabs.Tab, { value: "DataType" },
|
|
137
150
|
React.createElement(Radio, { margin: 0, value: "DataType", checked: scopeChoice == 'DataType', tabIndex: -1 }, "Data Types"))),
|
|
151
|
+
hasColumnTypes && (React.createElement(Tabs.Tab, { value: "ColumnType" },
|
|
152
|
+
React.createElement(Radio, { margin: 0, value: "ColumnType", checked: scopeChoice == 'ColumnType', tabIndex: -1 }, "Column Types"))),
|
|
138
153
|
props.hideWholeRow ? null : (React.createElement(Tabs.Content, { value: "Row", style: { flex: 'none' }, "data-name": "row-scope" },
|
|
139
154
|
React.createElement(Text, { padding: 2, pl: 0, fontSize: 2 }, props.descriptions.rowScope))),
|
|
140
155
|
!props.disableColumns && (React.createElement(Tabs.Content, { value: "Column", style: { flex: 1, overflow: 'auto' }, "data-name": "column-scope", padding: 0 },
|
|
@@ -147,5 +162,23 @@ export const NewScopeComponent = (props) => {
|
|
|
147
162
|
!props.disableDataTypes && (React.createElement(Tabs.Content, { value: "DataType", style: { flex: 'none' }, "data-name": "datatype-scope" },
|
|
148
163
|
React.createElement(Box, null,
|
|
149
164
|
props.descriptions.dataTypeScope && (React.createElement(Text, { p: 2, pl: 0, mb: 2, fontSize: 2 }, props.descriptions.dataTypeScope)),
|
|
150
|
-
React.createElement(Flex, { flexDirection: "column" }, dataTypeOptions.map((dataTypeOption) => (React.createElement(CheckBox, { "data-name": "scope", "data-value": dataTypeOption.value, key: dataTypeOption.value, checked: dataTypesInScope && dataTypesInScope.includes(dataTypeOption.value), onChange: (checked) => onCheckBoxDataTypeChecked(checked, dataTypeOption.value) }, dataTypeOption.label)))))))
|
|
165
|
+
React.createElement(Flex, { flexDirection: "column" }, dataTypeOptions.map((dataTypeOption) => (React.createElement(CheckBox, { "data-name": "scope", "data-value": dataTypeOption.value, key: dataTypeOption.value, checked: dataTypesInScope && dataTypesInScope.includes(dataTypeOption.value), onChange: (checked) => onCheckBoxDataTypeChecked(checked, dataTypeOption.value) }, dataTypeOption.label))))))),
|
|
166
|
+
hasColumnTypes && (React.createElement(Tabs.Content, { value: "ColumnType", style: { flex: 'none' }, "data-name": "column-type-scope" },
|
|
167
|
+
React.createElement(Box, null,
|
|
168
|
+
React.createElement(Flex, { flexDirection: "column" }, (_b = (_a = api.optionsApi.getColumnTypes()) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, (columnType) => {
|
|
169
|
+
var _a;
|
|
170
|
+
return (React.createElement(CheckBox, { "data-name": "scope", "data-value": columnType, key: columnType, checked: 'ColumnTypes' in props.scope && ((_a = props.scope.ColumnTypes) === null || _a === void 0 ? void 0 : _a.includes(columnType)), onChange: (checked) => {
|
|
171
|
+
let columnTypes = [].concat(props.scope.ColumnTypes);
|
|
172
|
+
if (checked) {
|
|
173
|
+
columnTypes.push(columnType);
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
columnTypes = columnTypes.filter((ct) => ct !== columnType);
|
|
177
|
+
}
|
|
178
|
+
let newScope = {
|
|
179
|
+
ColumnTypes: columnTypes,
|
|
180
|
+
};
|
|
181
|
+
props.updateScope(newScope);
|
|
182
|
+
} }, columnType));
|
|
183
|
+
})))))));
|
|
151
184
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
export interface IAdaptableLoadingScreenProps
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface IAdaptableLoadingScreenProps {
|
|
3
3
|
showLoadingScreen: boolean;
|
|
4
|
+
loadingScreenDelay?: number;
|
|
5
|
+
loadingScreenTitle?: string;
|
|
6
|
+
loadingScreenText?: string;
|
|
4
7
|
onClose?: () => {};
|
|
5
8
|
}
|
|
6
|
-
export declare
|
|
7
|
-
render(): JSX.Element;
|
|
8
|
-
}
|
|
9
|
+
export declare function AdaptableLoadingScreen(props: IAdaptableLoadingScreenProps): JSX.Element;
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import Dialog from '../../../components/Dialog';
|
|
3
3
|
import { Box } from 'rebass';
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
export function AdaptableLoadingScreen(props) {
|
|
5
|
+
const { showLoadingScreen, loadingScreenDelay, loadingScreenTitle, loadingScreenText } = props;
|
|
6
|
+
const [delayElapsed, setDelayElapsed] = React.useState(typeof loadingScreenDelay === 'number' ? false : showLoadingScreen);
|
|
7
|
+
React.useEffect(() => {
|
|
8
|
+
if (typeof loadingScreenDelay === 'number') {
|
|
9
|
+
const timeoutId = setTimeout(() => {
|
|
10
|
+
setDelayElapsed(true);
|
|
11
|
+
}, loadingScreenDelay);
|
|
12
|
+
return () => {
|
|
13
|
+
clearTimeout(timeoutId);
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
}, [loadingScreenDelay]);
|
|
17
|
+
return (React.createElement(Dialog, { modal: true, isOpen: delayElapsed ? showLoadingScreen : false, onDismiss: props.onClose, showCloseButton: false, className: "ab-LoadingScreen", style: {
|
|
18
|
+
minHeight: 'auto',
|
|
19
|
+
} },
|
|
20
|
+
React.createElement(Box, { padding: 3 },
|
|
21
|
+
React.createElement("h4", null, loadingScreenTitle !== null && loadingScreenTitle !== void 0 ? loadingScreenTitle : 'Initialising Grid'),
|
|
22
|
+
React.createElement("p", null, loadingScreenText !== null && loadingScreenText !== void 0 ? loadingScreenText : 'Retrieving your settings and setting up the grid...'))));
|
|
13
23
|
}
|
|
@@ -12,7 +12,7 @@ export const showToast = (props) => {
|
|
|
12
12
|
});
|
|
13
13
|
const adaptableOptions = props.api.optionsApi.getAdaptableOptions();
|
|
14
14
|
const toastProps = ObjectFactory.CreateToastOptions(adaptableOptions.notificationsOptions, {
|
|
15
|
-
containerId: adaptableOptions.adaptableId
|
|
15
|
+
containerId: `Toastify-${adaptableOptions.adaptableId}`,
|
|
16
16
|
onClose: () => {
|
|
17
17
|
off();
|
|
18
18
|
},
|