@adaptabletools/adaptable 12.1.4 → 12.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle.cjs.js +116 -143
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/Api/Implementation/FilterApiImpl.js +3 -0
- package/src/PredefinedConfig/AlertState.d.ts +2 -2
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +9 -1
- package/src/PredefinedConfig/Common/Types.d.ts +1 -0
- package/src/PredefinedConfig/Common/Types.js +38 -1
- package/src/PredefinedConfig/FlashingCellState.d.ts +1 -1
- package/src/Strategy/AlertModule.js +1 -1
- package/src/Strategy/BulkUpdateModule.js +1 -1
- package/src/Strategy/CalculatedColumnModule.js +1 -1
- package/src/Strategy/CellSummaryModule.js +1 -1
- package/src/Strategy/ChartingModule.js +1 -1
- package/src/Strategy/ConditionalStyleModule.js +1 -1
- package/src/Strategy/CustomSortModule.js +1 -1
- package/src/Strategy/DashboardModule.js +1 -1
- package/src/Strategy/DataChangeHistoryModule.js +1 -1
- package/src/Strategy/DataSetModule.js +1 -1
- package/src/Strategy/ExportModule.js +1 -1
- package/src/Strategy/FilterModule.js +1 -1
- package/src/Strategy/FlashingCellModule.js +1 -1
- package/src/Strategy/FormatColumnModule.js +1 -1
- package/src/Strategy/FreeTextColumnModule.js +1 -1
- package/src/Strategy/GridInfoModule.js +1 -1
- package/src/Strategy/LayoutModule.js +1 -1
- package/src/Strategy/PlusMinusModule.js +1 -1
- package/src/Strategy/QueryModule.js +1 -1
- package/src/Strategy/QuickSearchModule.js +1 -1
- package/src/Strategy/ScheduleModule.js +1 -1
- package/src/Strategy/ShortcutModule.js +1 -1
- package/src/Strategy/SmartEditModule.js +1 -1
- package/src/Strategy/StateManagementModule.js +1 -1
- package/src/Strategy/StatusBarModule.js +1 -1
- package/src/Strategy/SystemStatusModule.js +1 -1
- package/src/Strategy/TeamSharingModule.js +1 -1
- package/src/Strategy/ThemeModule.js +1 -1
- package/src/Strategy/ToolPanelModule.js +1 -1
- package/src/Utilities/Constants/ModuleConstants.d.ts +68 -0
- package/src/Utilities/Constants/ModuleConstants.js +70 -1
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +2 -1
- package/src/Utilities/Services/Interface/IMetamodelService.d.ts +5 -0
- package/src/Utilities/Services/MetamodelService.d.ts +4 -4
- package/src/Utilities/Services/MetamodelService.js +19 -12
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.js +193 -135
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +23 -15
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizardColumnsStep.js +3 -7
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/EntitlementsForm.d.ts +2 -2
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/EntitlementsForm.js +148 -8
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/GridOptionsForm.js +0 -7
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsActionColumnsForm.d.ts +6 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsActionColumnsForm.js +33 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsSidebarForm.d.ts +6 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsSidebarForm.js +82 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsStatusbarForm.d.ts +6 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsStatusbarForm.js +109 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UiOptionsForm.d.ts +8 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UiOptionsForm.js +16 -0
- package/src/View/AdaptableWizardView/Wizard.js +2 -1
- package/src/View/AdaptableWizardView/helper.d.ts +1 -1
- package/src/View/AdaptableWizardView/helper.js +3 -10
- package/src/View/Components/FilterForm/FilterForm.js +2 -1
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +2 -2
- package/src/agGrid/Adaptable.js +4 -1
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -1,36 +1,105 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ShortcutFriendlyName = exports.ShortcutModuleId = exports.ScheduleFriendlyName = exports.ScheduleModuleId = exports.QuickSearchFriendlyName = exports.QuickSearchModuleId = exports.QueryFriendlyName = exports.QueryModuleId = exports.PlusMinusFriendlyName = exports.PlusMinusModuleId = exports.OpenFinFriendlyName = exports.OpenFinModuleId = exports.LayoutFriendlyName = exports.LayoutModuleId = exports.IPushPullFriendlyName = exports.IPushPullModuleId = exports.GridInfoFriendlyName = exports.GridInfoModuleId = exports.Glue42FriendlyName = exports.Glue42ModuleId = exports.FreeTextColumnFriendlyName = exports.FreeTextColumnModuleId = exports.FormatColumnFriendlyName = exports.FormatColumnModuleId = exports.FilterFriendlyName = exports.FilterModuleId = exports.ExportFriendlyName = exports.ExportModuleId = exports.DataSetFriendlyName = exports.DataSetModuleId = exports.DataChangeHistoryFriendlyName = exports.DataChangeHistoryModuleId = exports.DashboardFriendlyName = exports.DashboardModuleId = exports.CustomSortFriendlyName = exports.CustomSortModuleId = exports.ConditionalStyleFriendlyName = exports.ConditionalStyleModuleId = exports.ChartingFriendlyName = exports.ChartingModuleId = exports.CellSummaryFriendlyName = exports.CellSummaryModuleId = exports.CalculatedColumnFriendlyName = exports.CalculatedColumnModuleId = exports.BulkUpdateFriendlyName = exports.BulkUpdateModuleId = exports.FlashingCellFriendlyName = exports.FlashingCellModuleId = exports.AlertModuleFriendlyName = exports.AlertModuleId = void 0;
|
|
4
|
+
exports.ADAPTABLE_MODULE_MAP = exports.StatusBarFriendlyName = exports.StatusBarModuleId = exports.SettingsPanelFriendlyName = exports.SettingsPanelModuleId = exports.ToolPanelFriendlyName = exports.ToolPanelModuleId = exports.ThemeFriendlyName = exports.ThemeModuleId = exports.TeamSharingFriendlyName = exports.TeamSharingModuleId = exports.SystemStatusFriendlyName = exports.SystemStatusModuleId = exports.StateManagementFriendlyName = exports.StateManagementModuleId = exports.SmartEditFriendlyName = exports.SmartEditModuleId = void 0;
|
|
4
5
|
exports.AlertModuleId = 'Alert';
|
|
6
|
+
exports.AlertModuleFriendlyName = 'Alert';
|
|
5
7
|
exports.FlashingCellModuleId = 'FlashingCell';
|
|
8
|
+
exports.FlashingCellFriendlyName = 'Flashing Cell';
|
|
6
9
|
exports.BulkUpdateModuleId = 'BulkUpdate';
|
|
10
|
+
exports.BulkUpdateFriendlyName = 'Bulk Update';
|
|
7
11
|
exports.CalculatedColumnModuleId = 'CalculatedColumn';
|
|
12
|
+
exports.CalculatedColumnFriendlyName = 'Calculated Column';
|
|
8
13
|
exports.CellSummaryModuleId = 'CellSummary';
|
|
14
|
+
exports.CellSummaryFriendlyName = 'Cell Summary';
|
|
9
15
|
exports.ChartingModuleId = 'Charting';
|
|
16
|
+
exports.ChartingFriendlyName = 'Charts';
|
|
10
17
|
exports.ConditionalStyleModuleId = 'ConditionalStyle';
|
|
18
|
+
exports.ConditionalStyleFriendlyName = 'Conditional Style';
|
|
11
19
|
exports.CustomSortModuleId = 'CustomSort';
|
|
20
|
+
exports.CustomSortFriendlyName = 'Custom Sort';
|
|
12
21
|
exports.DashboardModuleId = 'Dashboard';
|
|
22
|
+
exports.DashboardFriendlyName = 'Dashboard';
|
|
13
23
|
exports.DataChangeHistoryModuleId = 'DataChangeHistory';
|
|
24
|
+
exports.DataChangeHistoryFriendlyName = 'Data Changes';
|
|
14
25
|
exports.DataSetModuleId = 'DataSet';
|
|
26
|
+
exports.DataSetFriendlyName = 'Data Set';
|
|
15
27
|
exports.ExportModuleId = 'Export';
|
|
28
|
+
exports.ExportFriendlyName = 'Export';
|
|
16
29
|
exports.FilterModuleId = 'Filter';
|
|
30
|
+
exports.FilterFriendlyName = 'Filter';
|
|
17
31
|
exports.FormatColumnModuleId = 'FormatColumn';
|
|
32
|
+
exports.FormatColumnFriendlyName = 'Format Column';
|
|
18
33
|
exports.FreeTextColumnModuleId = 'FreeTextColumn';
|
|
34
|
+
exports.FreeTextColumnFriendlyName = 'Free Text Column';
|
|
19
35
|
exports.Glue42ModuleId = 'Glue42';
|
|
36
|
+
exports.Glue42FriendlyName = 'Glue42';
|
|
20
37
|
exports.GridInfoModuleId = 'GridInfo';
|
|
38
|
+
exports.GridInfoFriendlyName = 'Grid Info';
|
|
21
39
|
exports.IPushPullModuleId = 'IPushPull';
|
|
40
|
+
exports.IPushPullFriendlyName = 'IPushPull';
|
|
22
41
|
exports.LayoutModuleId = 'Layout';
|
|
42
|
+
exports.LayoutFriendlyName = 'Layout';
|
|
23
43
|
exports.OpenFinModuleId = 'OpenFin';
|
|
44
|
+
exports.OpenFinFriendlyName = 'OpenFin';
|
|
24
45
|
exports.PlusMinusModuleId = 'PlusMinus';
|
|
46
|
+
exports.PlusMinusFriendlyName = 'Plus Minus';
|
|
25
47
|
exports.QueryModuleId = 'Query';
|
|
48
|
+
exports.QueryFriendlyName = 'Query';
|
|
26
49
|
exports.QuickSearchModuleId = 'QuickSearch';
|
|
50
|
+
exports.QuickSearchFriendlyName = 'Quick Search';
|
|
27
51
|
exports.ScheduleModuleId = 'Schedule';
|
|
52
|
+
exports.ScheduleFriendlyName = 'Schedule';
|
|
28
53
|
exports.ShortcutModuleId = 'Shortcut';
|
|
54
|
+
exports.ShortcutFriendlyName = 'Shortcut';
|
|
29
55
|
exports.SmartEditModuleId = 'SmartEdit';
|
|
56
|
+
exports.SmartEditFriendlyName = 'Smart Edit';
|
|
30
57
|
exports.StateManagementModuleId = 'StateManagement';
|
|
58
|
+
exports.StateManagementFriendlyName = 'Manage State';
|
|
31
59
|
exports.SystemStatusModuleId = 'SystemStatus';
|
|
60
|
+
exports.SystemStatusFriendlyName = 'System Status';
|
|
32
61
|
exports.TeamSharingModuleId = 'TeamSharing';
|
|
62
|
+
exports.TeamSharingFriendlyName = 'Team Sharing';
|
|
33
63
|
exports.ThemeModuleId = 'Theme';
|
|
64
|
+
exports.ThemeFriendlyName = 'Theme';
|
|
34
65
|
exports.ToolPanelModuleId = 'ToolPanel';
|
|
66
|
+
exports.ToolPanelFriendlyName = 'Tool Panel';
|
|
35
67
|
exports.SettingsPanelModuleId = 'SettingsPanel';
|
|
68
|
+
exports.SettingsPanelFriendlyName = 'Settings Panel';
|
|
36
69
|
exports.StatusBarModuleId = 'StatusBar';
|
|
70
|
+
exports.StatusBarFriendlyName = 'Status Bar';
|
|
71
|
+
exports.ADAPTABLE_MODULE_MAP = {
|
|
72
|
+
[exports.AlertModuleId]: exports.AlertModuleFriendlyName,
|
|
73
|
+
[exports.FlashingCellModuleId]: exports.FlashingCellFriendlyName,
|
|
74
|
+
[exports.BulkUpdateModuleId]: exports.BulkUpdateFriendlyName,
|
|
75
|
+
[exports.CalculatedColumnModuleId]: exports.CalculatedColumnFriendlyName,
|
|
76
|
+
[exports.CellSummaryModuleId]: exports.CellSummaryFriendlyName,
|
|
77
|
+
[exports.ChartingModuleId]: exports.ChartingFriendlyName,
|
|
78
|
+
[exports.ConditionalStyleModuleId]: exports.ConditionalStyleFriendlyName,
|
|
79
|
+
[exports.CustomSortModuleId]: exports.CustomSortFriendlyName,
|
|
80
|
+
[exports.DashboardModuleId]: exports.DashboardFriendlyName,
|
|
81
|
+
[exports.DataChangeHistoryModuleId]: exports.DataChangeHistoryFriendlyName,
|
|
82
|
+
[exports.DataSetModuleId]: exports.DataSetFriendlyName,
|
|
83
|
+
[exports.ExportModuleId]: exports.ExportFriendlyName,
|
|
84
|
+
[exports.FilterModuleId]: exports.FilterFriendlyName,
|
|
85
|
+
[exports.FormatColumnModuleId]: exports.FormatColumnFriendlyName,
|
|
86
|
+
[exports.FreeTextColumnModuleId]: exports.FreeTextColumnFriendlyName,
|
|
87
|
+
[exports.Glue42ModuleId]: exports.Glue42FriendlyName,
|
|
88
|
+
[exports.GridInfoModuleId]: exports.GridInfoFriendlyName,
|
|
89
|
+
[exports.IPushPullModuleId]: exports.IPushPullFriendlyName,
|
|
90
|
+
[exports.LayoutModuleId]: exports.LayoutFriendlyName,
|
|
91
|
+
[exports.OpenFinModuleId]: exports.OpenFinFriendlyName,
|
|
92
|
+
[exports.PlusMinusModuleId]: exports.PlusMinusFriendlyName,
|
|
93
|
+
[exports.QueryModuleId]: exports.QueryFriendlyName,
|
|
94
|
+
[exports.QuickSearchModuleId]: exports.QuickSearchFriendlyName,
|
|
95
|
+
[exports.ScheduleModuleId]: exports.ScheduleFriendlyName,
|
|
96
|
+
[exports.ShortcutModuleId]: exports.ShortcutFriendlyName,
|
|
97
|
+
[exports.SmartEditModuleId]: exports.SmartEditFriendlyName,
|
|
98
|
+
[exports.StateManagementModuleId]: exports.StateManagementFriendlyName,
|
|
99
|
+
[exports.SystemStatusModuleId]: exports.SystemStatusFriendlyName,
|
|
100
|
+
[exports.TeamSharingModuleId]: exports.TeamSharingFriendlyName,
|
|
101
|
+
[exports.ThemeModuleId]: exports.ThemeFriendlyName,
|
|
102
|
+
[exports.ToolPanelModuleId]: exports.ToolPanelFriendlyName,
|
|
103
|
+
[exports.SettingsPanelModuleId]: exports.SettingsPanelFriendlyName,
|
|
104
|
+
[exports.StatusBarModuleId]: exports.StatusBarFriendlyName,
|
|
105
|
+
};
|
|
@@ -12,6 +12,7 @@ const aggregatedBooleanExpressionFunctions_1 = require("../ExpressionFunctions/a
|
|
|
12
12
|
const AdaptablePredicate_1 = require("../../PredefinedConfig/Common/AdaptablePredicate");
|
|
13
13
|
const Enums_1 = require("../../PredefinedConfig/Common/Enums");
|
|
14
14
|
const aggregatedScalarExpressionFunctions_1 = require("../ExpressionFunctions/aggregatedScalarExpressionFunctions");
|
|
15
|
+
const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
|
|
15
16
|
// change type to DeepRequired<AdaptableOptions> to check which properties have no default values defined
|
|
16
17
|
exports.DefaultAdaptableOptions = {
|
|
17
18
|
adaptableId: GeneralConstants.ADAPTABLE_ID,
|
|
@@ -260,7 +261,7 @@ exports.DefaultAdaptableOptions = {
|
|
|
260
261
|
},
|
|
261
262
|
settingsPanelOptions: {
|
|
262
263
|
popupType: 'window',
|
|
263
|
-
title:
|
|
264
|
+
title: ModuleConstants.SettingsPanelFriendlyName,
|
|
264
265
|
icon: 'ConfigurationIcon',
|
|
265
266
|
navigation: {},
|
|
266
267
|
alwaysShowInDashboard: false,
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { AdaptableOptions } from '../../../../types';
|
|
2
|
+
import { MetamodelItemPropertyKind } from '../../../metamodel/adaptable-metamodel-model';
|
|
1
3
|
import { IAdaptableService } from './IAdaptableService';
|
|
2
4
|
export declare type GridInfoOptions = Map<string, {
|
|
3
5
|
containerLabel: string;
|
|
@@ -7,9 +9,12 @@ export interface GridInfoOption {
|
|
|
7
9
|
name: string;
|
|
8
10
|
value: any;
|
|
9
11
|
description: string;
|
|
12
|
+
kind: MetamodelItemPropertyKind;
|
|
10
13
|
defaultValue?: any;
|
|
11
14
|
}
|
|
12
15
|
export interface IMetamodelService extends IAdaptableService {
|
|
16
|
+
getAdaptableOptions: () => AdaptableOptions;
|
|
13
17
|
getGridInfoOptions(): GridInfoOptions;
|
|
18
|
+
getGridInfoNoCodeOptions(): GridInfoOptions;
|
|
14
19
|
validateAdaptableOptionsValues(): void;
|
|
15
20
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { GridInfoOptions, IMetamodelService } from './Interface/IMetamodelService';
|
|
2
|
-
import {
|
|
2
|
+
import { AdaptableOptions } from '../../../types';
|
|
3
3
|
export declare class MetamodelService implements IMetamodelService {
|
|
4
|
-
private adaptableApi;
|
|
5
4
|
private gridInfoOptions;
|
|
6
|
-
|
|
5
|
+
getAdaptableOptions: () => AdaptableOptions;
|
|
6
|
+
constructor(getAdaptableOptions: () => AdaptableOptions);
|
|
7
7
|
getGridInfoOptions(): GridInfoOptions;
|
|
8
|
+
getGridInfoNoCodeOptions(): GridInfoOptions;
|
|
8
9
|
validateAdaptableOptionsValues(): void;
|
|
9
10
|
private validateOptionsObject;
|
|
10
11
|
private getExpectedOptionsValueType;
|
|
@@ -13,5 +14,4 @@ export declare class MetamodelService implements IMetamodelService {
|
|
|
13
14
|
private getAdaptableOptionsDefaultValues;
|
|
14
15
|
private getAdaptableMetamodel;
|
|
15
16
|
private getAdaptableOptionsMetamodel;
|
|
16
|
-
private getAdaptableOptions;
|
|
17
17
|
}
|
|
@@ -14,15 +14,23 @@ const supportedMetamodelTypes = [
|
|
|
14
14
|
'REFERENCE',
|
|
15
15
|
];
|
|
16
16
|
class MetamodelService {
|
|
17
|
-
constructor(
|
|
18
|
-
this.adaptableApi = adaptableApi;
|
|
17
|
+
constructor(getAdaptableOptions) {
|
|
19
18
|
this.gridInfoOptions = new Map();
|
|
20
|
-
this.
|
|
19
|
+
this.getAdaptableOptions = () => null;
|
|
20
|
+
this.getAdaptableOptions = getAdaptableOptions;
|
|
21
21
|
this.gridInfoOptions = this.buildGridInfoOptions();
|
|
22
22
|
}
|
|
23
23
|
getGridInfoOptions() {
|
|
24
24
|
return this.gridInfoOptions;
|
|
25
25
|
}
|
|
26
|
+
getGridInfoNoCodeOptions() {
|
|
27
|
+
return this.buildGridInfoOptions({
|
|
28
|
+
filterItemProperty: (itemProperty) => {
|
|
29
|
+
return itemProperty.noCode === 'item';
|
|
30
|
+
},
|
|
31
|
+
filterEmptyAdaptableOptions: false,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
26
34
|
validateAdaptableOptionsValues() {
|
|
27
35
|
var _a;
|
|
28
36
|
LoggingHelper_1.LogAdaptableInfo('Validating Adaptable Options...');
|
|
@@ -79,7 +87,8 @@ class MetamodelService {
|
|
|
79
87
|
return metamodelPropertyKind;
|
|
80
88
|
}
|
|
81
89
|
}
|
|
82
|
-
buildGridInfoOptions() {
|
|
90
|
+
buildGridInfoOptions(options) {
|
|
91
|
+
const { filterItemProperty, filterEmptyAdaptableOptions = true } = options || {};
|
|
83
92
|
const gridInfoOptions = new Map();
|
|
84
93
|
const adaptableMetamodel = this.getAdaptableMetamodel();
|
|
85
94
|
const adaptableOptionsMetamodel = this.getAdaptableOptionsMetamodel();
|
|
@@ -107,12 +116,12 @@ class MetamodelService {
|
|
|
107
116
|
// @ts-ignore
|
|
108
117
|
const containerOptionsDefaultValues = adaptableOptionsDefaultValues[adaptableOptionsName];
|
|
109
118
|
if (!containerOptionsMetamodel ||
|
|
110
|
-
!containerOptionsValues ||
|
|
119
|
+
(!containerOptionsValues && filterEmptyAdaptableOptions) ||
|
|
111
120
|
!containerOptionsDefaultValues) {
|
|
112
121
|
// should never happen
|
|
113
122
|
return;
|
|
114
123
|
}
|
|
115
|
-
const optionItems = this.mapGridInfoContainerItems(containerOptionsMetamodel, containerOptionsValues, containerOptionsDefaultValues);
|
|
124
|
+
const optionItems = this.mapGridInfoContainerItems(containerOptionsMetamodel, containerOptionsValues, containerOptionsDefaultValues, filterItemProperty);
|
|
116
125
|
gridInfoOptions.set(containerOptionItem.name, {
|
|
117
126
|
containerLabel: containerOptionItem.uiLabel,
|
|
118
127
|
items: optionItems,
|
|
@@ -120,13 +129,14 @@ class MetamodelService {
|
|
|
120
129
|
});
|
|
121
130
|
return gridInfoOptions;
|
|
122
131
|
}
|
|
123
|
-
mapGridInfoContainerItems(optionItemContainer, adaptableOptionsValues, defaultAdaptableOptionsValues) {
|
|
132
|
+
mapGridInfoContainerItems(optionItemContainer, adaptableOptionsValues, defaultAdaptableOptionsValues, filter = (itemProperty) => itemProperty.gridInfo === 'item') {
|
|
124
133
|
var _a;
|
|
125
|
-
return (_a = optionItemContainer.properties) === null || _a === void 0 ? void 0 : _a.filter(
|
|
134
|
+
return (_a = optionItemContainer.properties) === null || _a === void 0 ? void 0 : _a.filter(filter).map((itemProperty) => {
|
|
126
135
|
return {
|
|
127
136
|
name: itemProperty.name,
|
|
128
|
-
value: adaptableOptionsValues[itemProperty.name],
|
|
137
|
+
value: adaptableOptionsValues === null || adaptableOptionsValues === void 0 ? void 0 : adaptableOptionsValues[itemProperty.name],
|
|
129
138
|
defaultValue: defaultAdaptableOptionsValues[itemProperty.name],
|
|
139
|
+
kind: itemProperty.kind,
|
|
130
140
|
description: itemProperty.description,
|
|
131
141
|
};
|
|
132
142
|
});
|
|
@@ -140,8 +150,5 @@ class MetamodelService {
|
|
|
140
150
|
getAdaptableOptionsMetamodel() {
|
|
141
151
|
return this.getAdaptableMetamodel()['AdaptableOptions'];
|
|
142
152
|
}
|
|
143
|
-
getAdaptableOptions() {
|
|
144
|
-
return this.adaptableApi.internalApi.getAdaptableOptions();
|
|
145
|
-
}
|
|
146
153
|
}
|
|
147
154
|
exports.MetamodelService = MetamodelService;
|
|
@@ -5,12 +5,13 @@ const React = tslib_1.__importStar(require("react"));
|
|
|
5
5
|
const useSelection_1 = tslib_1.__importDefault(require("./useSelection"));
|
|
6
6
|
const CheckBox_1 = require("../../../components/CheckBox");
|
|
7
7
|
const Radio_1 = tslib_1.__importDefault(require("../../../components/Radio"));
|
|
8
|
-
const AdaptableObjectRow_1 = require("../../Components/AdaptableObjectRow");
|
|
9
|
-
const AdaptableObjectCollection_1 = require("../../Components/AdaptableObjectCollection");
|
|
10
8
|
const Dropdown_1 = tslib_1.__importDefault(require("../../../components/Dropdown"));
|
|
11
9
|
const Input_1 = tslib_1.__importDefault(require("../../../components/Input"));
|
|
12
10
|
const react_1 = require("react");
|
|
13
11
|
const StringExtensions_1 = tslib_1.__importDefault(require("../../../Utilities/Extensions/StringExtensions"));
|
|
12
|
+
const InfiniteTable_1 = require("../../../components/InfiniteTable");
|
|
13
|
+
const rebass_1 = require("rebass");
|
|
14
|
+
const throttle_1 = tslib_1.__importDefault(require("lodash/throttle"));
|
|
14
15
|
const dataTypes = [
|
|
15
16
|
{
|
|
16
17
|
value: 'abColDefString',
|
|
@@ -28,7 +29,7 @@ const dataTypes = [
|
|
|
28
29
|
];
|
|
29
30
|
const inputStyle = {
|
|
30
31
|
width: '100%',
|
|
31
|
-
minWidth:
|
|
32
|
+
minWidth: 80,
|
|
32
33
|
textAlign: 'start',
|
|
33
34
|
};
|
|
34
35
|
const useForceRender = () => {
|
|
@@ -37,6 +38,26 @@ const useForceRender = () => {
|
|
|
37
38
|
setNow(Date.now());
|
|
38
39
|
};
|
|
39
40
|
};
|
|
41
|
+
const ThrottledInput = React.memo((props) => {
|
|
42
|
+
const [stateValue, setStateValue] = react_1.useState(props.value);
|
|
43
|
+
const throttleOnChange = React.useRef(throttle_1.default(props.onChange, 600, { leading: false }));
|
|
44
|
+
const handleChange = React.useCallback((event) => {
|
|
45
|
+
const newValue = event.target.value;
|
|
46
|
+
setStateValue(newValue);
|
|
47
|
+
throttleOnChange.current(newValue);
|
|
48
|
+
}, []);
|
|
49
|
+
React.useEffect(() => {
|
|
50
|
+
setStateValue(props.value);
|
|
51
|
+
}, [props.value]);
|
|
52
|
+
return React.createElement(Input_1.default, { style: props.style, value: stateValue, onChange: handleChange });
|
|
53
|
+
});
|
|
54
|
+
const tableDOMProps = {
|
|
55
|
+
style: {
|
|
56
|
+
height: '100%',
|
|
57
|
+
minWidth: '10rem',
|
|
58
|
+
minHeight: 600,
|
|
59
|
+
},
|
|
60
|
+
};
|
|
40
61
|
const ColumnsList = ({ columns: cols, handle, onValidityChange, onChange, onSelectionChange, selectedColumns, }) => {
|
|
41
62
|
const rerender = useForceRender();
|
|
42
63
|
const columnsRef = react_1.useRef(cols);
|
|
@@ -72,7 +93,7 @@ const ColumnsList = ({ columns: cols, handle, onValidityChange, onChange, onSele
|
|
|
72
93
|
}
|
|
73
94
|
return c;
|
|
74
95
|
});
|
|
75
|
-
|
|
96
|
+
setColumns(cols);
|
|
76
97
|
};
|
|
77
98
|
const onColumnTypeChange = (col, type) => {
|
|
78
99
|
const cols = getColumns().map((c) => {
|
|
@@ -131,144 +152,181 @@ const ColumnsList = ({ columns: cols, handle, onValidityChange, onChange, onSele
|
|
|
131
152
|
});
|
|
132
153
|
const allIncluded = isAllIncludedColumns();
|
|
133
154
|
const allExcluded = isNoneIncludedColumns();
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
155
|
+
React.useEffect(() => {
|
|
156
|
+
onValidityChange(isIncludedColumn(primaryKeyField));
|
|
157
|
+
}, [includedColumnsMap, primaryKeyField]);
|
|
158
|
+
const rowHeight = 40;
|
|
159
|
+
const data = columns;
|
|
160
|
+
const CellWrapper = (props) => {
|
|
161
|
+
return (React.createElement(rebass_1.Flex, Object.assign({}, props, { style: Object.assign(Object.assign({}, props.style), { position: 'absolute', textAlign: 'center', top: 0, left: 0, height: '100%', width: '100%', whiteSpace: 'normal' }), justifyContent: "center", alignItems: "center" }), props.children));
|
|
162
|
+
};
|
|
163
|
+
const HeaderCellWrapper = (props) => (React.createElement(CellWrapper, Object.assign({}, props, { fontSize: 3, style: { fontWeight: 600 } })));
|
|
164
|
+
const HeaderWithCheckbox = (props) => {
|
|
165
|
+
const { label, onChange, checked } = props, flexProps = tslib_1.__rest(props, ["label", "onChange", "checked"]);
|
|
166
|
+
return (React.createElement(HeaderCellWrapper, Object.assign({}, flexProps, { flexDirection: "column" }),
|
|
167
|
+
React.createElement(rebass_1.Box, null, label),
|
|
168
|
+
React.createElement(rebass_1.Box, { style: { textAlign: 'center' } },
|
|
169
|
+
React.createElement(CheckBox_1.CheckBox, { checked: checked, onChange: onChange }))));
|
|
170
|
+
};
|
|
171
|
+
const columnsMap = {
|
|
172
|
+
pk: {
|
|
173
|
+
header: () => React.createElement(HeaderCellWrapper, null, "Primary Key"),
|
|
174
|
+
maxWidth: 80,
|
|
175
|
+
sortable: false,
|
|
176
|
+
render: (params) => {
|
|
177
|
+
const { data } = params;
|
|
178
|
+
const column = data;
|
|
179
|
+
const isPrimaryKey = (column === null || column === void 0 ? void 0 : column.field) === primaryKeyField;
|
|
180
|
+
return (React.createElement(Radio_1.default, { checked: isPrimaryKey, onChange: (checked) => {
|
|
181
|
+
if (checked && isIncludedColumn(column.field)) {
|
|
182
|
+
setPrimaryKeyField(column.field);
|
|
146
183
|
}
|
|
147
|
-
} }))
|
|
148
|
-
|
|
184
|
+
} }));
|
|
185
|
+
},
|
|
149
186
|
},
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
187
|
+
included: {
|
|
188
|
+
maxWidth: 80,
|
|
189
|
+
resizable: true,
|
|
190
|
+
header: () => (React.createElement(HeaderWithCheckbox, { label: "Included", checked: allIncluded ? true : allExcluded ? false : null, onChange: (allIncluded) => {
|
|
191
|
+
if (allIncluded) {
|
|
192
|
+
includeAllColumns();
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
excludeAllColumns();
|
|
196
|
+
}
|
|
197
|
+
} })),
|
|
198
|
+
render: (params) => {
|
|
199
|
+
const column = params.data;
|
|
200
|
+
return (React.createElement(CellWrapper, null,
|
|
201
|
+
React.createElement(CheckBox_1.CheckBox, { checked: isIncludedColumn(column.field), onChange: (included) => {
|
|
202
|
+
if (included) {
|
|
203
|
+
includeColumn(column.field);
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
excludeColumn(column.field);
|
|
207
|
+
}
|
|
208
|
+
} })));
|
|
209
|
+
},
|
|
165
210
|
},
|
|
166
|
-
{
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
Size: 3,
|
|
211
|
+
field: {
|
|
212
|
+
header: React.createElement(HeaderCellWrapper, null, "Field"),
|
|
213
|
+
field: 'field',
|
|
214
|
+
minWidth: 150,
|
|
215
|
+
render: (params) => {
|
|
216
|
+
const column = params.data;
|
|
217
|
+
const humanized = StringExtensions_1.default.Humanize(column.field);
|
|
218
|
+
return (React.createElement(rebass_1.Box, { p: 2 },
|
|
219
|
+
React.createElement(ThrottledInput, { key: column.field, style: inputStyle, value: column.caption != undefined ? column.caption : humanized, placeholder: humanized, onChange: (value) => {
|
|
220
|
+
setColumnCaption(value, column.field);
|
|
221
|
+
} })));
|
|
222
|
+
},
|
|
179
223
|
},
|
|
180
|
-
{
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
else {
|
|
190
|
-
setAllUnresizable();
|
|
191
|
-
}
|
|
192
|
-
} }))),
|
|
224
|
+
type: {
|
|
225
|
+
header: React.createElement(HeaderCellWrapper, null, "Type"),
|
|
226
|
+
maxWidth: 140,
|
|
227
|
+
render: (params) => {
|
|
228
|
+
var _a;
|
|
229
|
+
const column = params.data;
|
|
230
|
+
return (React.createElement(CellWrapper, { paddingLeft: 1, paddingRight: 1 },
|
|
231
|
+
React.createElement(Dropdown_1.default, { style: inputStyle, showClearButton: false, options: dataTypes, value: (_a = column === null || column === void 0 ? void 0 : column.type) !== null && _a !== void 0 ? _a : '', onChange: onColumnTypeChange.bind(null, column) })));
|
|
232
|
+
},
|
|
193
233
|
},
|
|
194
|
-
{
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
234
|
+
sortable: {
|
|
235
|
+
header: (React.createElement(HeaderWithCheckbox, { label: "Sortable", checked: isAllSortableColumns() ? true : isNoneSortableColumns() ? false : null, onChange: (allSortable) => {
|
|
236
|
+
if (allSortable) {
|
|
237
|
+
setAllSortable();
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
setAllUnsortable();
|
|
241
|
+
}
|
|
242
|
+
} })),
|
|
243
|
+
render: (params) => {
|
|
244
|
+
const column = params.data;
|
|
245
|
+
return (React.createElement(CheckBox_1.CheckBox, { checked: isSortableColumn(column.field), onChange: (sortable) => {
|
|
246
|
+
sortable ? setSortableColumn(column.field) : setUnsortableColumn(column.field);
|
|
247
|
+
} }));
|
|
248
|
+
},
|
|
207
249
|
},
|
|
208
|
-
{
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
250
|
+
editable: {
|
|
251
|
+
header: (React.createElement(HeaderWithCheckbox, { label: "Editable", checked: isAllEditableColumns() ? true : isNoneEditableColumns() ? false : null, onChange: (allEditable) => {
|
|
252
|
+
if (allEditable) {
|
|
253
|
+
setAllEditable();
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
setAllUneditable();
|
|
257
|
+
}
|
|
258
|
+
} })),
|
|
259
|
+
render: (params) => {
|
|
260
|
+
const col = params.data;
|
|
261
|
+
return (React.createElement(CellWrapper, null,
|
|
262
|
+
React.createElement(CheckBox_1.CheckBox, { checked: isEditableColumn(col.field), onChange: (editable) => {
|
|
263
|
+
editable ? setEditableColumn(col.field) : setUneditableColumn(col.field);
|
|
264
|
+
} })));
|
|
265
|
+
},
|
|
221
266
|
},
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
267
|
+
resizable: {
|
|
268
|
+
header: (React.createElement(HeaderWithCheckbox, { label: "Resizable", checked: isAllResizableColumns() ? true : isNoneResizableColumns() ? false : null, onChange: (allResizable) => {
|
|
269
|
+
if (allResizable) {
|
|
270
|
+
setAllResizable();
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
setAllUnresizable();
|
|
274
|
+
}
|
|
275
|
+
} })),
|
|
276
|
+
render: (params) => {
|
|
277
|
+
const col = params.data;
|
|
278
|
+
return (React.createElement(CellWrapper, null,
|
|
279
|
+
React.createElement(CheckBox_1.CheckBox, { checked: isResizableColumn(col.field), onChange: (resizable) => {
|
|
280
|
+
resizable ? setResizableColumn(col.field) : setUnresizableColumn(col.field);
|
|
281
|
+
} })));
|
|
282
|
+
},
|
|
283
|
+
},
|
|
284
|
+
groupable: {
|
|
285
|
+
header: (React.createElement(HeaderWithCheckbox, { label: "Groupable", checked: isAllGroupableColumns() ? true : isNoneGroupableColumns() ? false : null, onChange: (allGroupable) => {
|
|
286
|
+
if (allGroupable) {
|
|
287
|
+
setAllGroupable();
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
setAllUngroupable();
|
|
291
|
+
}
|
|
292
|
+
} })),
|
|
293
|
+
render: (params) => {
|
|
294
|
+
const col = params.data;
|
|
295
|
+
return (React.createElement(CellWrapper, null,
|
|
296
|
+
React.createElement(CheckBox_1.CheckBox, { checked: isGroupableColumn(col.field), onChange: (groupable) => {
|
|
297
|
+
groupable ? setGroupableColumn(col.field) : setUngroupableColumn(col.field);
|
|
298
|
+
} })));
|
|
299
|
+
},
|
|
300
|
+
},
|
|
301
|
+
filtrable: {
|
|
302
|
+
header: (React.createElement(HeaderWithCheckbox, { label: "Filtrable", checked: isAllFilterableColumns() ? true : isNoneFilterableColumns() ? false : null, onChange: (allFilterable) => {
|
|
303
|
+
if (allFilterable) {
|
|
304
|
+
setAllFilterable();
|
|
305
|
+
}
|
|
306
|
+
else {
|
|
307
|
+
setAllUnfilterable();
|
|
308
|
+
}
|
|
309
|
+
} })),
|
|
310
|
+
render: (params) => {
|
|
311
|
+
const col = params.data;
|
|
312
|
+
return (React.createElement(CellWrapper, null,
|
|
313
|
+
React.createElement(CheckBox_1.CheckBox, { checked: isFilterableColumn(col.field), onChange: (filterable) => {
|
|
314
|
+
filterable ? setFilterableColumn(col.field) : setUnFilterableColumn(col.field);
|
|
315
|
+
} })));
|
|
316
|
+
},
|
|
317
|
+
},
|
|
318
|
+
};
|
|
319
|
+
return (React.createElement(rebass_1.Box, { p: 2, style: { height: '100%' }, className: "light" },
|
|
320
|
+
React.createElement(InfiniteTable_1.DataSource, { data: data, primaryKey: "colId" },
|
|
321
|
+
React.createElement(InfiniteTable_1.InfiniteTable, { columnTypes: {
|
|
322
|
+
default: {
|
|
323
|
+
defaultFlex: 1,
|
|
324
|
+
align: 'center',
|
|
325
|
+
sortable: false,
|
|
326
|
+
},
|
|
327
|
+
}, headerOptions: {
|
|
328
|
+
alwaysReserveSpaceForSortIcon: false,
|
|
329
|
+
}, rowHeight: rowHeight, columnHeaderHeight: 65, domProps: tableDOMProps, columns: columnsMap }))));
|
|
272
330
|
};
|
|
273
331
|
function areEqual() {
|
|
274
332
|
/**
|