@adaptabletools/adaptable 10.0.1 → 10.0.4-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base.css +68 -26
- package/index.css +80 -28
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +12 -2
- package/src/AdaptableOptions/FilterOptions.d.ts +14 -7
- package/src/AdaptableOptions/LayoutOptions.d.ts +1 -1
- package/src/AdaptableOptions/NotificationsOptions.d.ts +3 -1
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +107 -5
- package/src/Api/AlertApi.d.ts +1 -1
- package/src/Api/CalculatedColumnApi.d.ts +15 -0
- package/src/Api/ColumnApi.d.ts +39 -0
- package/src/Api/ConfigApi.d.ts +8 -0
- package/src/Api/Events/AdaptableReady.d.ts +2 -6
- package/src/Api/Events/AdaptableStateChanged.d.ts +2 -1
- package/src/Api/Events/AlertFired.d.ts +2 -1
- package/src/Api/Events/BaseEventInfo.d.ts +10 -0
- package/src/{Utilities/Interface/ProgressIndicator.js → Api/Events/BaseEventInfo.js} +0 -0
- package/src/Api/Events/CellChanged.d.ts +2 -1
- package/src/Api/Events/ChexboxColumnClicked.d.ts +2 -1
- package/src/Api/Events/CustomToolbarConfigured.d.ts +2 -1
- package/src/Api/Events/DashboardChanged.d.ts +2 -1
- package/src/Api/Events/FlashingAlertFired.d.ts +2 -1
- package/src/Api/Events/GridDataChanged.d.ts +2 -1
- package/src/Api/Events/LayoutChanged.d.ts +2 -1
- package/src/Api/Events/LiveDataChanged.d.ts +2 -1
- package/src/Api/Events/SearchChanged.d.ts +2 -1
- package/src/Api/Events/SelectionChanged.d.ts +2 -1
- package/src/Api/Events/SystemStatusMessageDisplayed.d.ts +2 -1
- package/src/Api/Events/TeamSharingEntityChanged.d.ts +2 -1
- package/src/Api/Events/ThemeChanged.d.ts +2 -1
- package/src/Api/GridApi.d.ts +34 -8
- package/src/Api/Implementation/AlertApiImpl.d.ts +1 -1
- package/src/Api/Implementation/AlertApiImpl.js +22 -15
- package/src/Api/Implementation/CalculatedColumnApiImpl.d.ts +3 -0
- package/src/Api/Implementation/CalculatedColumnApiImpl.js +23 -0
- package/src/Api/Implementation/ColumnApiImpl.d.ts +8 -0
- package/src/Api/Implementation/ColumnApiImpl.js +69 -36
- package/src/Api/Implementation/ConfigApiImpl.d.ts +1 -1
- package/src/Api/Implementation/ConfigApiImpl.js +28 -17
- package/src/Api/Implementation/DashboardApiImpl.js +2 -1
- package/src/Api/Implementation/ExportApiImpl.js +4 -4
- package/src/Api/Implementation/FormatColumnApiImpl.js +2 -1
- package/src/Api/Implementation/FreeTextColumnApiImpl.js +9 -3
- package/src/Api/Implementation/GridApiImpl.d.ts +9 -0
- package/src/Api/Implementation/GridApiImpl.js +28 -10
- package/src/Api/Implementation/InternalApiImpl.d.ts +3 -1
- package/src/Api/Implementation/InternalApiImpl.js +20 -4
- package/src/Api/Implementation/LayoutApiImpl.js +4 -3
- package/src/Api/Implementation/ScopeApiImpl.js +11 -11
- package/src/Api/Implementation/SystemStatusApiImpl.js +1 -0
- package/src/Api/Implementation/TeamSharingApiImpl.js +1 -0
- package/src/Api/Implementation/ThemeApiImpl.js +1 -0
- package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +12 -8
- package/src/Api/Implementation/UserInterfaceApiImpl.js +69 -87
- package/src/Api/InternalApi.d.ts +3 -1
- package/src/Api/UserInterfaceApi.d.ts +16 -6
- package/src/PredefinedConfig/AlertState.d.ts +4 -0
- package/src/PredefinedConfig/CalculatedColumnState.d.ts +4 -37
- package/src/PredefinedConfig/Common/AdaptableButton.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +33 -33
- package/src/PredefinedConfig/Common/AdaptableColumn.js +5 -5
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +19 -18
- package/src/PredefinedConfig/Common/DataChangedInfo.d.ts +3 -2
- package/src/PredefinedConfig/Common/DataUpdateConfig.d.ts +5 -1
- package/src/PredefinedConfig/Common/SpecialColumnSettings.d.ts +49 -0
- package/src/PredefinedConfig/Common/SpecialColumnSettings.js +2 -0
- package/src/PredefinedConfig/FilterState.d.ts +1 -1
- package/src/PredefinedConfig/FreeTextColumnState.d.ts +10 -0
- package/src/PredefinedConfig/Selection/GridCell.d.ts +2 -1
- package/src/PredefinedConfig/Selection/GridRow.d.ts +12 -4
- package/src/PredefinedConfig/SystemState.d.ts +4 -1
- package/src/Redux/ActionsReducers/SystemRedux.js +1 -1
- package/src/Redux/Store/AdaptableStore.js +7 -3
- package/src/Strategy/AdaptableModuleBase.js +8 -8
- package/src/Strategy/AlertModule.js +12 -11
- package/src/Strategy/BulkUpdateModule.js +5 -5
- package/src/Strategy/CalculatedColumnModule.js +1 -1
- package/src/Strategy/CellSummaryModule.js +3 -3
- package/src/Strategy/ConditionalStyleModule.js +3 -3
- package/src/Strategy/CustomSortModule.js +2 -2
- package/src/Strategy/ExportModule.d.ts +0 -2
- package/src/Strategy/ExportModule.js +59 -62
- package/src/Strategy/FilterModule.js +4 -4
- package/src/Strategy/FormatColumnModule.js +5 -5
- package/src/Strategy/FreeTextColumnModule.js +1 -1
- package/src/Strategy/LayoutModule.js +3 -3
- package/src/Strategy/PlusMinusModule.js +8 -9
- package/src/Strategy/SmartEditModule.js +6 -6
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +1 -0
- package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +1 -1
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +2 -2
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +3 -2
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +1 -1
- package/src/Utilities/Helpers/DateHelper.d.ts +2 -2
- package/src/Utilities/Helpers/DateHelper.js +30 -20
- package/src/Utilities/Helpers/PreviewHelper.js +2 -2
- package/src/Utilities/ObjectFactory.d.ts +1 -1
- package/src/Utilities/ObjectFactory.js +14 -2
- package/src/Utilities/Services/DataService.js +5 -5
- package/src/Utilities/Services/ReportService.js +13 -12
- package/src/Utilities/Services/ValidationService.js +4 -5
- package/src/Utilities/runIfNotResolvedIn.d.ts +8 -0
- package/src/Utilities/runIfNotResolvedIn.js +23 -0
- package/src/View/AdaptableView.js +1 -1
- package/src/View/Alert/AlertPopup.js +1 -1
- package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +19 -5
- package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.js +1 -1
- package/src/View/BulkUpdate/BulkUpdatePopup.d.ts +2 -0
- package/src/View/BulkUpdate/BulkUpdatePopup.js +6 -4
- package/src/View/BulkUpdate/BulkUpdateViewPanel.d.ts +2 -0
- package/src/View/BulkUpdate/BulkUpdateViewPanel.js +3 -1
- package/src/View/CalculatedColumn/CalculatedColumnPopup.js +1 -1
- package/src/View/CalculatedColumn/CalculatedColumnSummary.js +1 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +1 -1
- package/src/View/Components/ColumnSelector/index.js +2 -2
- package/src/View/Components/FilterForm/FilterForm.d.ts +3 -51
- package/src/View/Components/FilterForm/FilterForm.js +53 -32
- package/src/View/Components/FilterForm/ListBoxFilterForm.d.ts +3 -0
- package/src/View/Components/FilterForm/ListBoxFilterForm.js +14 -5
- package/src/View/Components/FilterForm/QuickFilterForm.d.ts +3 -43
- package/src/View/Components/FilterForm/QuickFilterForm.js +72 -31
- package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.d.ts +3 -0
- package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.js +8 -0
- package/src/View/Components/NewScopeComponent.js +1 -1
- package/src/View/Components/Popups/AdaptablePopup.d.ts +1 -1
- package/src/View/Components/Popups/AdaptablePopupAlert.js +1 -1
- package/src/View/Components/PreviewResultsPanel.js +1 -1
- package/src/View/Components/RangesComponent.js +2 -2
- package/src/View/Components/Selectors/ColumnSelector.js +5 -5
- package/src/View/Components/Selectors/ColumnValueSelector.d.ts +10 -2
- package/src/View/Components/Selectors/ColumnValueSelector.js +47 -15
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +7 -7
- package/src/View/Components/ToolPanel/CustomToolPanelContent.js +1 -1
- package/src/View/ConditionalStyle/ConditionalStylePopup.js +1 -1
- package/src/View/ConditionalStyle/ConditionalStyleSummary.js +1 -1
- package/src/View/CustomSort/CustomSortEntityRow.js +2 -2
- package/src/View/CustomSort/CustomSortPopup.js +1 -1
- package/src/View/CustomSort/CustomSortSummary.js +3 -3
- package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +3 -3
- package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.js +24 -6
- package/src/View/Dashboard/CustomToolbarWrapper.js +2 -1
- package/src/View/Dashboard/Dashboard.js +2 -3
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +5 -5
- package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +4 -1
- package/src/View/Export/ExportCustomDestinationDialog.js +1 -1
- package/src/View/Filter/FilterSummary.js +2 -2
- package/src/View/FormatColumn/FormatColumnPopup.js +1 -1
- package/src/View/FormatColumn/FormatColumnSummary.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +1 -1
- package/src/View/FreeTextColumn/FreeTextColumnPopup.js +4 -2
- package/src/View/FreeTextColumn/FreeTextColumnSummary.js +5 -3
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +1 -1
- package/src/View/GridInfo/ColumnInfoComponent.js +16 -16
- package/src/View/GridInfo/GridInfoPopup.js +4 -1
- package/src/View/Layout/Wizard/LayoutEditor/ColumnList.js +6 -6
- package/src/View/Layout/Wizard/LayoutEditor/ColumnSortList.js +1 -1
- package/src/View/Layout/Wizard/LayoutEditor/PivotList.js +1 -1
- package/src/View/Layout/Wizard/LayoutEditor/RowGroupsList.js +1 -1
- package/src/View/Layout/Wizard/LayoutEditor/getItemStyle.js +2 -2
- package/src/View/Layout/Wizard/LayoutEditor/index.js +41 -41
- package/src/View/PlusMinus/PlusMinusPopup.js +1 -1
- package/src/View/PlusMinus/PlusMinusSummary.js +1 -1
- package/src/View/Query/QueryViewPanel.js +2 -2
- package/src/View/UIHelper.d.ts +2 -0
- package/src/View/UIHelper.js +10 -1
- package/src/agGrid/ActionColumnRenderer.d.ts +2 -1
- package/src/agGrid/ActionColumnRenderer.js +21 -4
- package/src/agGrid/Adaptable.d.ts +20 -4
- package/src/agGrid/Adaptable.js +249 -102
- package/src/agGrid/agGridHelper.js +33 -32
- package/src/agGrid/agGridMenuHelper.js +2 -2
- package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +3 -3
- package/src/components/Dashboard/Dashboard.js +1 -1
- package/src/components/DropdownButton/index.js +1 -1
- package/src/components/ExpressionEditor/index.js +7 -7
- package/src/components/Loader/Loader.d.ts +7 -0
- package/src/components/Loader/Loader.js +13 -0
- package/src/components/Loader/index.d.ts +2 -0
- package/src/components/Loader/index.js +7 -0
- package/src/components/ProgressIndicator/ProgressIndicator.d.ts +2 -0
- package/src/components/ProgressIndicator/ProgressIndicator.js +54 -0
- package/src/metamodel/adaptable.metamodel.d.ts +125 -16
- package/src/metamodel/adaptable.metamodel.js +403 -106
- package/src/types.d.ts +4 -3
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/Utilities/Interface/ProgressIndicator.d.ts +0 -4
- package/src/View/Export/ProgressIndicator.d.ts +0 -6
- package/src/View/Export/ProgressIndicator.js +0 -25
|
@@ -31,36 +31,36 @@ class ColumnInfoComponent extends React.Component {
|
|
|
31
31
|
{ Content: '', Size: 2 },
|
|
32
32
|
];
|
|
33
33
|
let selectedColumnId = this.state.SelectedColumn
|
|
34
|
-
? this.state.SelectedColumn.
|
|
34
|
+
? this.state.SelectedColumn.columnId
|
|
35
35
|
: null;
|
|
36
36
|
let keyValuePairs = [
|
|
37
37
|
{
|
|
38
38
|
Key: 'Column Id',
|
|
39
|
-
Value: this.state.SelectedColumn ? this.state.SelectedColumn.
|
|
39
|
+
Value: this.state.SelectedColumn ? this.state.SelectedColumn.columnId : null,
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
Key: 'Header',
|
|
43
|
-
Value: this.state.SelectedColumn ? this.state.SelectedColumn.
|
|
43
|
+
Value: this.state.SelectedColumn ? this.state.SelectedColumn.friendlyName : null,
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
Key: 'Aggregatable',
|
|
47
|
-
Value: this.state.SelectedColumn ? this.state.SelectedColumn.
|
|
47
|
+
Value: this.state.SelectedColumn ? this.state.SelectedColumn.aggregatable : null,
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
Key: 'DataType',
|
|
51
|
-
Value: this.state.SelectedColumn ? this.state.SelectedColumn.
|
|
51
|
+
Value: this.state.SelectedColumn ? this.state.SelectedColumn.dataType : null,
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
Key: 'Groupable',
|
|
55
|
-
Value: this.state.SelectedColumn ? this.state.SelectedColumn.
|
|
55
|
+
Value: this.state.SelectedColumn ? this.state.SelectedColumn.groupable : null,
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
Key: 'Filterable',
|
|
59
|
-
Value: this.state.SelectedColumn ? this.state.SelectedColumn.
|
|
59
|
+
Value: this.state.SelectedColumn ? this.state.SelectedColumn.filterable : null,
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
Key: 'Hideable',
|
|
63
|
-
Value: this.state.SelectedColumn ? this.state.SelectedColumn.
|
|
63
|
+
Value: this.state.SelectedColumn ? this.state.SelectedColumn.hideable : null,
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
66
|
Key: 'Editable',
|
|
@@ -68,27 +68,27 @@ class ColumnInfoComponent extends React.Component {
|
|
|
68
68
|
},
|
|
69
69
|
{
|
|
70
70
|
Key: 'Moveable',
|
|
71
|
-
Value: this.state.SelectedColumn ? this.state.SelectedColumn.
|
|
71
|
+
Value: this.state.SelectedColumn ? this.state.SelectedColumn.moveable : null,
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
74
|
Key: 'Pivotable',
|
|
75
|
-
Value: this.state.SelectedColumn ? this.state.SelectedColumn.
|
|
75
|
+
Value: this.state.SelectedColumn ? this.state.SelectedColumn.pivotable : null,
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
78
|
Key: 'Queryable',
|
|
79
|
-
Value: this.state.SelectedColumn ? this.state.SelectedColumn.
|
|
79
|
+
Value: this.state.SelectedColumn ? this.state.SelectedColumn.queryable : null,
|
|
80
80
|
},
|
|
81
81
|
{
|
|
82
82
|
Key: 'Sortable',
|
|
83
|
-
Value: this.state.SelectedColumn ? this.state.SelectedColumn.
|
|
83
|
+
Value: this.state.SelectedColumn ? this.state.SelectedColumn.sortable : null,
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
Key: 'Visible',
|
|
87
|
-
Value: this.state.SelectedColumn ? this.state.SelectedColumn.
|
|
87
|
+
Value: this.state.SelectedColumn ? this.state.SelectedColumn.visible : null,
|
|
88
88
|
},
|
|
89
89
|
{
|
|
90
90
|
Key: 'Grouped',
|
|
91
|
-
Value: this.state.SelectedColumn ? this.state.SelectedColumn.
|
|
91
|
+
Value: this.state.SelectedColumn ? this.state.SelectedColumn.isGrouped : null,
|
|
92
92
|
},
|
|
93
93
|
];
|
|
94
94
|
let moduleService = this.props.api.internalApi.getModuleService();
|
|
@@ -125,14 +125,14 @@ class ColumnInfoComponent extends React.Component {
|
|
|
125
125
|
React.createElement(FreeTextColumnSummary_1.FreeTextColumnSummary, { key: ModuleConstants.FreeTextColumnModuleId, summarisedColumn: this.state.SelectedColumn, teamSharingActivated: this.props.teamSharingActivated, accessLevel: this.getAccessLevel(ModuleConstants.FreeTextColumnModuleId), api: this.props.api, moduleInfo: moduleService.getModuleInfoByModule(ModuleConstants.FreeTextColumnModuleId) })));
|
|
126
126
|
}
|
|
127
127
|
if (this.isModuleAvailable(ModuleConstants.PlusMinusModuleId) &&
|
|
128
|
-
this.state.SelectedColumn.
|
|
128
|
+
this.state.SelectedColumn.dataType == Enums_1.DataType.Number) {
|
|
129
129
|
summaries.push(React.createElement("div", { key: ModuleConstants.PlusMinusModuleId, className: this.isModuleReadOnly(ModuleConstants.PlusMinusModuleId)
|
|
130
130
|
? GeneralConstants.READ_ONLY_STYLE
|
|
131
131
|
: '' },
|
|
132
132
|
React.createElement(PlusMinusSummary_1.PlusMinusSummary, { key: ModuleConstants.PlusMinusModuleId, summarisedColumn: this.state.SelectedColumn, teamSharingActivated: this.props.teamSharingActivated, accessLevel: this.getAccessLevel(ModuleConstants.PlusMinusModuleId), api: this.props.api, moduleInfo: moduleService.getModuleInfoByModule(ModuleConstants.PlusMinusModuleId) })));
|
|
133
133
|
}
|
|
134
134
|
if (this.isModuleAvailable(ModuleConstants.CalculatedColumnModuleId) &&
|
|
135
|
-
ArrayExtensions_1.ArrayExtensions.ContainsItem(this.props.api.calculatedColumnApi.getAllCalculatedColumn().map((cc) => cc.ColumnId), this.state.SelectedColumn.
|
|
135
|
+
ArrayExtensions_1.ArrayExtensions.ContainsItem(this.props.api.calculatedColumnApi.getAllCalculatedColumn().map((cc) => cc.ColumnId), this.state.SelectedColumn.columnId)) {
|
|
136
136
|
summaries.push(React.createElement("div", { key: ModuleConstants.CalculatedColumnModuleId, className: this.isModuleReadOnly(ModuleConstants.CalculatedColumnModuleId)
|
|
137
137
|
? GeneralConstants.READ_ONLY_STYLE
|
|
138
138
|
: '' },
|
|
@@ -48,13 +48,16 @@ exports.GridInfoPopup = (props) => {
|
|
|
48
48
|
return props.api.columnApi.getFriendlyNameFromColumnId(gs.ColumnId) + ': ' + gs.SortOrder;
|
|
49
49
|
})
|
|
50
50
|
: null;
|
|
51
|
+
const selectedRowInfo = props.api.gridApi.getSelectedRowInfo();
|
|
51
52
|
returnRows.push(createReadOnlyColItem(colItems, 'AdapTable Version', version_1.default));
|
|
52
53
|
returnRows.push(createReadOnlyColItem(colItems, 'Sorted Columns', ArrayExtensions_1.default.IsNotNullOrEmpty(sorts) ? sorts.join('; ') : 'None'));
|
|
53
54
|
returnRows.push(createReadOnlyColItem(colItems, 'Column Filters', columnFilterDescription));
|
|
54
55
|
returnRows.push(createReadOnlyColItem(colItems, 'All Rows', props.api.gridApi.getRowCount()));
|
|
55
56
|
returnRows.push(createReadOnlyColItem(colItems, 'Visible Rows', props.api.gridApi.getVisibleRowCount()));
|
|
57
|
+
returnRows.push(createReadOnlyColItem(colItems, 'Selected Rows', selectedRowInfo === null || selectedRowInfo === void 0 ? void 0 : selectedRowInfo.gridRows.length));
|
|
58
|
+
returnRows.push(createReadOnlyColItem(colItems, 'Visible Selected Rows', selectedRowInfo === null || selectedRowInfo === void 0 ? void 0 : selectedRowInfo.gridRows.filter((gr) => { var _a; return ((_a = gr.rowNode) === null || _a === void 0 ? void 0 : _a.displayed) == true; }).length));
|
|
56
59
|
returnRows.push(createReadOnlyColItem(colItems, 'All Columns', props.api.gridApi.getColumnCount()));
|
|
57
|
-
returnRows.push(createReadOnlyColItem(colItems, 'Visible
|
|
60
|
+
returnRows.push(createReadOnlyColItem(colItems, 'Visible Columns', props.api.gridApi.getVisibleColumnCount()));
|
|
58
61
|
returnRows.push(createReadOnlyColItem(colItems, 'Calculated Columns', ArrayExtensions_1.default.IsNotNullOrEmpty(calcColumns) ? calcColumns : 'None'));
|
|
59
62
|
returnRows.push(createReadOnlyColItem(colItems, 'Free Text Columns', ArrayExtensions_1.default.IsNotNullOrEmpty(freeTextColumns) ? freeTextColumns : 'None'));
|
|
60
63
|
returnRows.push(createReadOnlyColItem(colItems, 'Action Columns', ArrayExtensions_1.default.IsNotNullOrEmpty(actionColumns) ? actionColumns : 'None'));
|
|
@@ -24,7 +24,7 @@ exports.ColumnList = (props) => {
|
|
|
24
24
|
source.droppableId !== destination.droppableId) {
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
|
-
if (!source.column || !source.column.
|
|
27
|
+
if (!source.column || !source.column.moveable) {
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
30
|
if (destination.index === source.index) {
|
|
@@ -36,8 +36,8 @@ exports.ColumnList = (props) => {
|
|
|
36
36
|
// cannot drop on this list while searching
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
|
-
if (!source.column.
|
|
40
|
-
newColumns.slice(newDropIndex).filter((c) => c.
|
|
39
|
+
if (!source.column.isFixed &&
|
|
40
|
+
newColumns.slice(newDropIndex).filter((c) => c.isFixed).length) {
|
|
41
41
|
// there are fixed cols after this one, so it's an invalid drop
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
@@ -59,7 +59,7 @@ exports.ColumnList = (props) => {
|
|
|
59
59
|
}, [onDragEnd]);
|
|
60
60
|
const renderColumn = react_2.useCallback((c) => {
|
|
61
61
|
const defaultRenderColumn = (c) => {
|
|
62
|
-
return React.createElement(React.Fragment, null, c.
|
|
62
|
+
return React.createElement(React.Fragment, null, c.friendlyName);
|
|
63
63
|
};
|
|
64
64
|
return (props.renderItem || defaultRenderColumn)(c);
|
|
65
65
|
}, [props.renderItem]);
|
|
@@ -68,11 +68,11 @@ exports.ColumnList = (props) => {
|
|
|
68
68
|
React.createElement(rebass_1.Box, { px: 2, mb: 2 },
|
|
69
69
|
React.createElement(AdaptableFormControlTextClear_1.AdaptableFormControlTextClear, { placeholder: "Search a column", width: "100%", value: search, OnTextChange: setSearch })),
|
|
70
70
|
columns.map((c, index) => {
|
|
71
|
-
return (React.createElement(react_beautiful_dnd_1.Draggable, { key: `${c.
|
|
71
|
+
return (React.createElement(react_beautiful_dnd_1.Draggable, { key: `${c.columnId}-column`, draggableId: c.columnId, index: index }, (provided, snapshot) => {
|
|
72
72
|
const style = props.getItemStyle(c, snapshot, provided.draggableProps.style);
|
|
73
73
|
style.padding = 0;
|
|
74
74
|
if (search &&
|
|
75
|
-
c.
|
|
75
|
+
c.friendlyName.toLowerCase().indexOf(search.toLowerCase()) == -1) {
|
|
76
76
|
style.display = 'none';
|
|
77
77
|
}
|
|
78
78
|
return (React.createElement("div", Object.assign({ ref: provided.innerRef }, provided.draggableProps, provided.dragHandleProps, { className: "ab-LayoutEditor__ColumnList__column", style: style }), renderColumn(c)));
|
|
@@ -10,9 +10,9 @@ exports.getItemStyle = (column, layout, dragSource, snapshot, draggableStyle) =>
|
|
|
10
10
|
if (dragSource == droppableIds_1.LayoutEditorDroppableIds.ColumnList &&
|
|
11
11
|
draggingOver === droppableIds_1.LayoutEditorDroppableIds.ColumnSortList &&
|
|
12
12
|
//if col not sortable or is already in the sort order
|
|
13
|
-
(!column.
|
|
13
|
+
(!column.sortable ||
|
|
14
14
|
(layout.ColumnSorts &&
|
|
15
|
-
layout.ColumnSorts.filter((sort) => sort.ColumnId === column.
|
|
15
|
+
layout.ColumnSorts.filter((sort) => sort.ColumnId === column.columnId)[0]))) {
|
|
16
16
|
}
|
|
17
17
|
//dragging things on the first column, from any other column
|
|
18
18
|
if (dragSource != droppableIds_1.LayoutEditorDroppableIds.ColumnList &&
|
|
@@ -88,7 +88,7 @@ exports.LayoutEditor = React.memo((props) => {
|
|
|
88
88
|
const { layout } = state;
|
|
89
89
|
const allColumnsMap = React.useMemo(() => {
|
|
90
90
|
return allColumns.reduce((acc, col) => {
|
|
91
|
-
acc[col.
|
|
91
|
+
acc[col.columnId] = col;
|
|
92
92
|
return acc;
|
|
93
93
|
}, {});
|
|
94
94
|
}, [allColumns]);
|
|
@@ -99,7 +99,7 @@ exports.LayoutEditor = React.memo((props) => {
|
|
|
99
99
|
return col;
|
|
100
100
|
})
|
|
101
101
|
.concat(allColumns.filter((col) => {
|
|
102
|
-
return !tmpMap[col.
|
|
102
|
+
return !tmpMap[col.columnId];
|
|
103
103
|
}))
|
|
104
104
|
.filter((c) => c));
|
|
105
105
|
const setLayout = (layout) => {
|
|
@@ -118,7 +118,7 @@ exports.LayoutEditor = React.memo((props) => {
|
|
|
118
118
|
}, [props.layout]);
|
|
119
119
|
const visibleColumnsMap = React.useMemo(() => {
|
|
120
120
|
return allColumns.reduce((acc, col) => {
|
|
121
|
-
acc[col.
|
|
121
|
+
acc[col.columnId] = layout.Columns.indexOf(col.columnId) != -1 ? col : null;
|
|
122
122
|
return acc;
|
|
123
123
|
}, {});
|
|
124
124
|
}, [layout, allColumns]);
|
|
@@ -126,7 +126,7 @@ exports.LayoutEditor = React.memo((props) => {
|
|
|
126
126
|
return Object.keys(layout.AggregationColumns || {}).reduce((acc, colId) => {
|
|
127
127
|
let fn = layout.AggregationColumns[colId];
|
|
128
128
|
if (typeof fn === 'boolean') {
|
|
129
|
-
fn = allColumnsMap[colId].
|
|
129
|
+
fn = allColumnsMap[colId].aggregationFunction;
|
|
130
130
|
}
|
|
131
131
|
acc[colId] = fn;
|
|
132
132
|
return acc;
|
|
@@ -145,8 +145,8 @@ exports.LayoutEditor = React.memo((props) => {
|
|
|
145
145
|
const setColumnVisibility = (c, visible) => {
|
|
146
146
|
const newLayout = visible
|
|
147
147
|
? Object.assign(Object.assign({}, layout), { Columns: columnList
|
|
148
|
-
.filter((col) => visibleColumnsMap[col.
|
|
149
|
-
.map((c) => c.
|
|
148
|
+
.filter((col) => visibleColumnsMap[col.columnId] || col.columnId === c.columnId)
|
|
149
|
+
.map((c) => c.columnId) }) : Object.assign(Object.assign({}, layout), { Columns: layout.Columns.filter((colId) => colId !== c.columnId) });
|
|
150
150
|
const previousGroupCols = getAgGridGroupAutoColumn(layout);
|
|
151
151
|
const currentGroupCols = getAgGridGroupAutoColumn(newLayout);
|
|
152
152
|
if (previousGroupCols.length !== currentGroupCols.length) {
|
|
@@ -172,7 +172,7 @@ exports.LayoutEditor = React.memo((props) => {
|
|
|
172
172
|
}
|
|
173
173
|
if (source.droppableId === droppableIds_1.LayoutEditorDroppableIds.ColumnList) {
|
|
174
174
|
source.column = columnList[source.index];
|
|
175
|
-
source.columnId = source.column.
|
|
175
|
+
source.columnId = source.column.columnId;
|
|
176
176
|
}
|
|
177
177
|
if (destination.droppableId === droppableIds_1.LayoutEditorDroppableIds.ColumnList) {
|
|
178
178
|
onDragEndRef.current.columnList(result);
|
|
@@ -192,7 +192,7 @@ exports.LayoutEditor = React.memo((props) => {
|
|
|
192
192
|
const dragSource = source.droppableId;
|
|
193
193
|
const column = dragSource === droppableIds_1.LayoutEditorDroppableIds.ColumnList ? allColumnsMap[draggableId] : null;
|
|
194
194
|
const invalidSourceForColumns = source.droppableId !== droppableIds_1.LayoutEditorDroppableIds.ColumnList;
|
|
195
|
-
const dropDisabledOnColumns = !column || !column.
|
|
195
|
+
const dropDisabledOnColumns = !column || !column.moveable || invalidSourceForColumns;
|
|
196
196
|
dispatch({
|
|
197
197
|
type: reducer_1.LayoutEditorActions.SET_DROP_DISABLED_ON_COLUMNS,
|
|
198
198
|
payload: dropDisabledOnColumns,
|
|
@@ -203,37 +203,37 @@ exports.LayoutEditor = React.memo((props) => {
|
|
|
203
203
|
});
|
|
204
204
|
const columnAlreadySorted = column &&
|
|
205
205
|
layout.ColumnSorts &&
|
|
206
|
-
!!layout.ColumnSorts.filter((c) => c.ColumnId === column.
|
|
206
|
+
!!layout.ColumnSorts.filter((c) => c.ColumnId === column.columnId)[0];
|
|
207
207
|
const invalidSourceForSort = dragSource !== droppableIds_1.LayoutEditorDroppableIds.ColumnList &&
|
|
208
208
|
dragSource !== droppableIds_1.LayoutEditorDroppableIds.ColumnSortList;
|
|
209
|
-
const disableDropOnSort = invalidSourceForSort || columnAlreadySorted || (column && !column.
|
|
209
|
+
const disableDropOnSort = invalidSourceForSort || columnAlreadySorted || (column && !column.sortable);
|
|
210
210
|
dispatch({
|
|
211
211
|
type: reducer_1.LayoutEditorActions.SET_DROP_DISABLED_ON_SORT,
|
|
212
212
|
payload: !!disableDropOnSort,
|
|
213
213
|
});
|
|
214
214
|
const columnAlreadyRowGrouped = column && layout.RowGroupedColumns
|
|
215
|
-
? !!layout.RowGroupedColumns.filter((colId) => colId === column.
|
|
215
|
+
? !!layout.RowGroupedColumns.filter((colId) => colId === column.columnId)[0]
|
|
216
216
|
: false;
|
|
217
217
|
const invalidSourceForRowGroups = dragSource !== droppableIds_1.LayoutEditorDroppableIds.ColumnList &&
|
|
218
218
|
dragSource !== droppableIds_1.LayoutEditorDroppableIds.RowGroupsList;
|
|
219
|
-
const disableDropOnRowGroups = invalidSourceForRowGroups || columnAlreadyRowGrouped || (column && !column.
|
|
219
|
+
const disableDropOnRowGroups = invalidSourceForRowGroups || columnAlreadyRowGrouped || (column && !column.groupable);
|
|
220
220
|
dispatch({
|
|
221
221
|
type: reducer_1.LayoutEditorActions.SET_DROP_DISABLED_ON_ROW_GROUPS,
|
|
222
222
|
payload: !!disableDropOnRowGroups,
|
|
223
223
|
});
|
|
224
224
|
const columnAlreadyPivoted = column && layout.PivotColumns
|
|
225
|
-
? !!layout.PivotColumns.filter((colId) => colId === column.
|
|
225
|
+
? !!layout.PivotColumns.filter((colId) => colId === column.columnId)[0]
|
|
226
226
|
: false;
|
|
227
227
|
const invalidSourceForPivot = dragSource !== droppableIds_1.LayoutEditorDroppableIds.ColumnList &&
|
|
228
228
|
dragSource !== droppableIds_1.LayoutEditorDroppableIds.PivotList;
|
|
229
|
-
const disableDropOnPivot = invalidSourceForPivot || columnAlreadyPivoted || (column && !column.
|
|
229
|
+
const disableDropOnPivot = invalidSourceForPivot || columnAlreadyPivoted || (column && !column.pivotable);
|
|
230
230
|
dispatch({
|
|
231
231
|
type: reducer_1.LayoutEditorActions.SET_DROP_DISABLED_ON_PIVOT,
|
|
232
232
|
payload: !!disableDropOnPivot,
|
|
233
233
|
});
|
|
234
234
|
}, [state, layout]);
|
|
235
235
|
const onColumnOrderChange = react_1.useCallback((columns) => {
|
|
236
|
-
setLayout(Object.assign(Object.assign({}, layout), { Columns: columns.filter((c) => visibleColumnsMap[c.
|
|
236
|
+
setLayout(Object.assign(Object.assign({}, layout), { Columns: columns.filter((c) => visibleColumnsMap[c.columnId]).map((c) => c.columnId) }));
|
|
237
237
|
setColumnList(columns);
|
|
238
238
|
}, [visibleColumnsMap, layout]);
|
|
239
239
|
const onColumnSortsChange = react_1.useCallback((ColumnSorts) => {
|
|
@@ -257,16 +257,16 @@ exports.LayoutEditor = React.memo((props) => {
|
|
|
257
257
|
}, getItemStyle: (c, snapshot, draggableStyle) => {
|
|
258
258
|
return getItemStyle_1.getItemStyle(c, layout, state.dragSource, snapshot, draggableStyle);
|
|
259
259
|
}, columns: columnList, isDropDisabled: state.dropDisabledOnColumns, onColumnOrderChange: onColumnOrderChange, renderItem: (c) => {
|
|
260
|
-
const visible = !!visibleColumnsMap[c.
|
|
261
|
-
const aggregate = !!aggregationColumnsMap[c.
|
|
260
|
+
const visible = !!visibleColumnsMap[c.columnId];
|
|
261
|
+
const aggregate = !!aggregationColumnsMap[c.columnId];
|
|
262
262
|
// enable aggregation if there are row groups or pivoting is enabled
|
|
263
263
|
// const aggregateEnabled =
|
|
264
264
|
// (layout.RowGroupedColumns && layout.RowGroupedColumns.length) || layout.EnablePivot;
|
|
265
265
|
// JW: Not sure we do - why not just make it always visible as we ignore if if not required.
|
|
266
266
|
const aggregateEnabled = true;
|
|
267
|
-
const customHeader = headerColumnsMap[c.
|
|
268
|
-
const initialHeader = api.internalApi.getUserDefinedHeaderName(c.
|
|
269
|
-
return (React.createElement(rebass_1.Flex, { flexDirection: "column", alignItems: "stretch", "data-name": "drag-item", "data-col-id": c.
|
|
267
|
+
const customHeader = headerColumnsMap[c.columnId];
|
|
268
|
+
const initialHeader = api.internalApi.getUserDefinedHeaderName(c.columnId);
|
|
269
|
+
return (React.createElement(rebass_1.Flex, { flexDirection: "column", alignItems: "stretch", "data-name": "drag-item", "data-col-id": c.columnId },
|
|
270
270
|
React.createElement(rebass_1.Flex, { flexDirection: "row", alignItems: "center", backgroundColor: "secondary", color: "text-on-secondary" },
|
|
271
271
|
React.createElement(rebass_1.Flex, { flex: 1, alignItems: "center" },
|
|
272
272
|
React.createElement(rebass_1.Box, { ml: 2, mr: 2 },
|
|
@@ -279,18 +279,18 @@ exports.LayoutEditor = React.memo((props) => {
|
|
|
279
279
|
source: 'ContextMenu',
|
|
280
280
|
});
|
|
281
281
|
} }),
|
|
282
|
-
c.
|
|
282
|
+
c.columnGroup && c.columnGroup.groupCount > 1 ? (React.createElement(rebass_1.Box, { ml: 2, padding: 1, style: {
|
|
283
283
|
borderRadius: 'var(--ab__border-radius)',
|
|
284
284
|
background: 'var(--ab-color-defaultbackground)',
|
|
285
285
|
color: 'var(--ab-color-text-on-defaultbackground)',
|
|
286
286
|
} },
|
|
287
287
|
"Group: ",
|
|
288
|
-
c.
|
|
289
|
-
React.createElement(CheckBox_1.CheckBox, { title: "Visible", readOnly: !c.
|
|
288
|
+
c.columnGroup.friendlyName)) : null),
|
|
289
|
+
React.createElement(CheckBox_1.CheckBox, { title: "Visible", readOnly: !c.hideable && visible, checked: visible, mx: 2, style: {
|
|
290
290
|
whiteSpace: 'nowrap',
|
|
291
291
|
}, onChange: setColumnVisibility.bind(null, c) }, "Visible")),
|
|
292
292
|
React.createElement(rebass_1.Flex, { padding: 2, flexDirection: "column" },
|
|
293
|
-
React.createElement(ColumnLabels, { showTitle: true,
|
|
293
|
+
React.createElement(ColumnLabels, { showTitle: true, sortable: c.sortable, filterable: c.filterable, moveable: c.moveable, pivotable: c.pivotable, groupable: c.groupable, aggregatable: c.aggregatable }, ' '),
|
|
294
294
|
React.createElement(rebass_1.Flex, { flexDirection: "row", mt: 2 },
|
|
295
295
|
React.createElement(rebass_1.Flex, { flex: 3, alignItems: "baseline" },
|
|
296
296
|
React.createElement(rebass_1.Text, { fontSize: 3, mr: 2 }, "Header:"),
|
|
@@ -298,27 +298,27 @@ exports.LayoutEditor = React.memo((props) => {
|
|
|
298
298
|
const newTextValue = event.target.value;
|
|
299
299
|
const columnHeaders = Object.assign({}, layout.ColumnHeadersMap) || {};
|
|
300
300
|
if (StringExtensions_1.default.IsNullOrEmptyOrWhiteSpace(newTextValue)) {
|
|
301
|
-
delete columnHeaders[c.
|
|
301
|
+
delete columnHeaders[c.columnId];
|
|
302
302
|
}
|
|
303
303
|
else {
|
|
304
|
-
columnHeaders[c.
|
|
304
|
+
columnHeaders[c.columnId] = newTextValue;
|
|
305
305
|
}
|
|
306
306
|
setLayout(Object.assign(Object.assign({}, layout), { ColumnHeadersMap: columnHeaders }));
|
|
307
307
|
} })),
|
|
308
|
-
React.createElement(rebass_1.Flex, { flex: 2 }, c.
|
|
309
|
-
c.
|
|
310
|
-
c.
|
|
308
|
+
React.createElement(rebass_1.Flex, { flex: 2 }, c.aggregatable &&
|
|
309
|
+
c.availableAggregationFunctions &&
|
|
310
|
+
c.availableAggregationFunctions.length ? (React.createElement(CheckBox_1.CheckBox, { key: "checkbox", ml: 3, my: 0, disabled: !aggregateEnabled, onChange: (checked) => {
|
|
311
311
|
let aggCols = layout.AggregationColumns || {};
|
|
312
312
|
// const aggCols = new Set(layout.AggregationColumns);
|
|
313
313
|
if (checked) {
|
|
314
|
-
let aggFunc = c.
|
|
315
|
-
if (!aggFunc && c.
|
|
316
|
-
aggFunc = c.
|
|
314
|
+
let aggFunc = c.aggregationFunction;
|
|
315
|
+
if (!aggFunc && c.availableAggregationFunctions) {
|
|
316
|
+
aggFunc = c.availableAggregationFunctions[0];
|
|
317
317
|
}
|
|
318
|
-
aggCols[c.
|
|
318
|
+
aggCols[c.columnId] = aggFunc;
|
|
319
319
|
}
|
|
320
320
|
else {
|
|
321
|
-
delete aggCols[c.
|
|
321
|
+
delete aggCols[c.columnId];
|
|
322
322
|
if (!Object.keys(aggCols).length) {
|
|
323
323
|
aggCols = null;
|
|
324
324
|
}
|
|
@@ -328,7 +328,7 @@ exports.LayoutEditor = React.memo((props) => {
|
|
|
328
328
|
"Aggregate",
|
|
329
329
|
React.createElement(DropdownButton_1.default, { style: {
|
|
330
330
|
visibility: aggregate ? 'visible' : 'hidden',
|
|
331
|
-
}, ml: 2, padding: 0, columns: ['label'], variant: "text", items: c.
|
|
331
|
+
}, ml: 2, padding: 0, columns: ['label'], variant: "text", items: c.availableAggregationFunctions.map((fnName) => {
|
|
332
332
|
return {
|
|
333
333
|
label: fnName,
|
|
334
334
|
onClick: () => {
|
|
@@ -336,11 +336,11 @@ exports.LayoutEditor = React.memo((props) => {
|
|
|
336
336
|
if (!aggCols) {
|
|
337
337
|
return;
|
|
338
338
|
}
|
|
339
|
-
aggCols[c.
|
|
339
|
+
aggCols[c.columnId] = fnName;
|
|
340
340
|
setLayout(Object.assign(Object.assign({}, layout), { AggregationColumns: aggCols }));
|
|
341
341
|
},
|
|
342
342
|
};
|
|
343
|
-
}) }, aggregationColumnsMap[c.
|
|
343
|
+
}) }, aggregationColumnsMap[c.columnId]))) : null)))));
|
|
344
344
|
} })),
|
|
345
345
|
React.createElement(ListPanel, { header: "Sorting", className: "ab-LayoutEditor__ColumnSortListPanel" },
|
|
346
346
|
React.createElement(ColumnSortList_1.ColumnSortList, { columnSorts: layout.ColumnSorts, onColumnSortsChange: onColumnSortsChange, isDropDisabled: state.dropDisabledOnSort, onReady: (dragEnd) => {
|
|
@@ -356,7 +356,7 @@ exports.LayoutEditor = React.memo((props) => {
|
|
|
356
356
|
React.createElement(rebass_1.Box, { ml: 2, mr: 3 },
|
|
357
357
|
React.createElement(icons_1.Icon, { name: "drag", size: 30 })),
|
|
358
358
|
React.createElement(rebass_1.Flex, { flex: "1", flexDirection: "row", alignItems: "center" },
|
|
359
|
-
column.
|
|
359
|
+
column.friendlyName,
|
|
360
360
|
" [",
|
|
361
361
|
c.SortOrder,
|
|
362
362
|
"]"),
|
|
@@ -381,7 +381,7 @@ exports.LayoutEditor = React.memo((props) => {
|
|
|
381
381
|
return (React.createElement(rebass_1.Flex, { flexDirection: "row", alignItems: "center", "data-name": "drag-item" },
|
|
382
382
|
React.createElement(rebass_1.Box, { ml: 2, mr: 3 },
|
|
383
383
|
React.createElement(icons_1.Icon, { name: "drag", size: 30 })),
|
|
384
|
-
React.createElement(rebass_1.Flex, { flexDirection: "row", alignItems: "center", flex: 1 }, column.
|
|
384
|
+
React.createElement(rebass_1.Flex, { flexDirection: "row", alignItems: "center", flex: 1 }, column.friendlyName),
|
|
385
385
|
React.createElement(SimpleButton_1.default, { variant: "text", onClick: (e) => {
|
|
386
386
|
e.stopPropagation();
|
|
387
387
|
clear();
|
|
@@ -400,7 +400,7 @@ exports.LayoutEditor = React.memo((props) => {
|
|
|
400
400
|
return (React.createElement(rebass_1.Flex, { flexDirection: "row", alignItems: "center", "data-name": "drag-item" },
|
|
401
401
|
React.createElement(rebass_1.Box, { ml: 2, mr: 3 },
|
|
402
402
|
React.createElement(icons_1.Icon, { name: "drag", size: 30 })),
|
|
403
|
-
React.createElement(rebass_1.Flex, { flexDirection: "row", alignItems: "center", flex: 1 }, column.
|
|
403
|
+
React.createElement(rebass_1.Flex, { flexDirection: "row", alignItems: "center", flex: 1 }, column.friendlyName),
|
|
404
404
|
React.createElement(SimpleButton_1.default, { variant: "text", onClick: (e) => {
|
|
405
405
|
e.stopPropagation();
|
|
406
406
|
clear();
|
|
@@ -424,5 +424,5 @@ exports.LayoutEditor = React.memo((props) => {
|
|
|
424
424
|
Groupable: 'Can form a row group',
|
|
425
425
|
Moveable: 'Is draggable and movable',
|
|
426
426
|
Pivotable: 'Eligible for pivoting',
|
|
427
|
-
},
|
|
427
|
+
}, sortable: true, filterable: true, moveable: true, pivotable: true, groupable: true, aggregatable: true })))));
|
|
428
428
|
}, areEqual);
|
|
@@ -45,7 +45,7 @@ class PlusMinusPopupComponent extends React.Component {
|
|
|
45
45
|
let column = this.props.popupParams.column;
|
|
46
46
|
let plusMinus = ObjectFactory_1.ObjectFactory.CreateEmptyPlusMinusNudge();
|
|
47
47
|
plusMinus.Scope = {
|
|
48
|
-
ColumnIds: [column.
|
|
48
|
+
ColumnIds: [column.columnId],
|
|
49
49
|
};
|
|
50
50
|
this.setState({
|
|
51
51
|
editedAdaptableObject: plusMinus,
|
|
@@ -40,7 +40,7 @@ class PlusMinusSummaryComponent extends React.Component {
|
|
|
40
40
|
onNew() {
|
|
41
41
|
let configEntity = ObjectFactory_1.ObjectFactory.CreateEmptyPlusMinusNudge();
|
|
42
42
|
configEntity.Scope = {
|
|
43
|
-
ColumnIds: [this.props.summarisedColumn.
|
|
43
|
+
ColumnIds: [this.props.summarisedColumn.columnId],
|
|
44
44
|
};
|
|
45
45
|
this.setState({
|
|
46
46
|
editedAdaptableObject: configEntity,
|
|
@@ -73,8 +73,8 @@ class QueryViewPanelComponent extends React.Component {
|
|
|
73
73
|
];
|
|
74
74
|
let availableColumns = this.props.api.columnApi.getColumns().map((col) => {
|
|
75
75
|
return {
|
|
76
|
-
label: col.
|
|
77
|
-
onClick: () => this.setState({ expression: this.state.expression + `[${col.
|
|
76
|
+
label: col.friendlyName,
|
|
77
|
+
onClick: () => this.setState({ expression: this.state.expression + `[${col.columnId}]` }),
|
|
78
78
|
};
|
|
79
79
|
});
|
|
80
80
|
const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
|
package/src/View/UIHelper.d.ts
CHANGED
|
@@ -52,6 +52,7 @@ export declare function getButtonTextColourForArrayandMessageType(adaptableAlert
|
|
|
52
52
|
export declare function getButtonTextColourForMessageType(messageType: AdaptableMessageType): string;
|
|
53
53
|
export declare function getAdaptableToolPanelWidth(): number;
|
|
54
54
|
export declare function getCSSVariableValue(cssVariable: string): string | undefined;
|
|
55
|
+
export declare function setCSSVariableValue(cssVariable: string, value: string): void;
|
|
55
56
|
export declare function isBrowserDocumentAvailable(): boolean;
|
|
56
57
|
export declare const UIHelper: {
|
|
57
58
|
getHexForName: typeof getHexForName;
|
|
@@ -79,6 +80,7 @@ export declare const UIHelper: {
|
|
|
79
80
|
getButtonTextColourForArrayandMessageType: typeof getButtonTextColourForArrayandMessageType;
|
|
80
81
|
getButtonTextColourForMessageType: typeof getButtonTextColourForMessageType;
|
|
81
82
|
getCSSVariableValue: typeof getCSSVariableValue;
|
|
83
|
+
setCSSVariableValue: typeof setCSSVariableValue;
|
|
82
84
|
getAdaptableToolPanelWidth: typeof getAdaptableToolPanelWidth;
|
|
83
85
|
isBrowserDocumentAvailable: typeof isBrowserDocumentAvailable;
|
|
84
86
|
};
|
package/src/View/UIHelper.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UIHelper = exports.isBrowserDocumentAvailable = exports.getCSSVariableValue = exports.getAdaptableToolPanelWidth = exports.getButtonTextColourForMessageType = exports.getButtonTextColourForArrayandMessageType = exports.getButtonColourForAdaptableAlerts = exports.getMessageTypeFromAdaptableAlerts = exports.getScheduleDescription = exports.getButtonToneForMessageType = exports.getGlyphForMessageType = exports.getGlyphForStatusColour = exports.getStyleForMessageType = exports.getStyleForStatusColour = exports.getColorByMessageType = exports.getGlyphByMessageType = exports.getButtonToneByMessageType = exports.getMessageTypeByStatusColour = exports.IsNotEmptyStyle = exports.IsEmptyStyle = exports.isValidUserChartContainer = exports.getChartContainer = exports.getModalContainer = exports.getPlaceHolderforDataType = exports.getDescriptionForDataType = exports.getEmptyConfigState = exports.getDefaultColors = exports.getHexForName = exports.ORANGE = exports.LIGHT_RED = exports.RED = exports.DARK_RED = exports.PURPLE = exports.MAGENTA = exports.CYAN = exports.LIGHT_BLUE = exports.BLUE = exports.DARK_BLUE = exports.LIGHT_YELLOW = exports.YELLOW = exports.LIME_GREEN = exports.GREEN = exports.DARK_GREEN = exports.BROWN = exports.GRAY = exports.LIGHT_GRAY = exports.WHITE = exports.BLACK = void 0;
|
|
3
|
+
exports.UIHelper = exports.isBrowserDocumentAvailable = exports.setCSSVariableValue = exports.getCSSVariableValue = exports.getAdaptableToolPanelWidth = exports.getButtonTextColourForMessageType = exports.getButtonTextColourForArrayandMessageType = exports.getButtonColourForAdaptableAlerts = exports.getMessageTypeFromAdaptableAlerts = exports.getScheduleDescription = exports.getButtonToneForMessageType = exports.getGlyphForMessageType = exports.getGlyphForStatusColour = exports.getStyleForMessageType = exports.getStyleForStatusColour = exports.getColorByMessageType = exports.getGlyphByMessageType = exports.getButtonToneByMessageType = exports.getMessageTypeByStatusColour = exports.IsNotEmptyStyle = exports.IsEmptyStyle = exports.isValidUserChartContainer = exports.getChartContainer = exports.getModalContainer = exports.getPlaceHolderforDataType = exports.getDescriptionForDataType = exports.getEmptyConfigState = exports.getDefaultColors = exports.getHexForName = exports.ORANGE = exports.LIGHT_RED = exports.RED = exports.DARK_RED = exports.PURPLE = exports.MAGENTA = exports.CYAN = exports.LIGHT_BLUE = exports.BLUE = exports.DARK_BLUE = exports.LIGHT_YELLOW = exports.YELLOW = exports.LIME_GREEN = exports.GREEN = exports.DARK_GREEN = exports.BROWN = exports.GRAY = exports.LIGHT_GRAY = exports.WHITE = exports.BLACK = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const EditableConfigEntityState_1 = require("./Components/SharedProps/EditableConfigEntityState");
|
|
6
6
|
const Enums_1 = require("../PredefinedConfig/Common/Enums");
|
|
@@ -459,6 +459,14 @@ function getCSSVariableValue(cssVariable) {
|
|
|
459
459
|
return getComputedStyle(document.documentElement).getPropertyValue(cssVariable);
|
|
460
460
|
}
|
|
461
461
|
exports.getCSSVariableValue = getCSSVariableValue;
|
|
462
|
+
function setCSSVariableValue(cssVariable, value) {
|
|
463
|
+
if (!isBrowserDocumentAvailable()) {
|
|
464
|
+
// possible during static/server-side rendering (should happen only in test cases)
|
|
465
|
+
return undefined;
|
|
466
|
+
}
|
|
467
|
+
document.documentElement.style.setProperty(cssVariable, value);
|
|
468
|
+
}
|
|
469
|
+
exports.setCSSVariableValue = setCSSVariableValue;
|
|
462
470
|
function isBrowserDocumentAvailable() {
|
|
463
471
|
return typeof window !== 'undefined' && typeof window.document !== 'undefined';
|
|
464
472
|
}
|
|
@@ -489,6 +497,7 @@ exports.UIHelper = {
|
|
|
489
497
|
getButtonTextColourForArrayandMessageType,
|
|
490
498
|
getButtonTextColourForMessageType,
|
|
491
499
|
getCSSVariableValue,
|
|
500
|
+
setCSSVariableValue,
|
|
492
501
|
getAdaptableToolPanelWidth,
|
|
493
502
|
isBrowserDocumentAvailable,
|
|
494
503
|
};
|
|
@@ -8,7 +8,8 @@ export declare class ActionColumnRenderer implements ICellRendererComp {
|
|
|
8
8
|
private eGui;
|
|
9
9
|
private eventListener;
|
|
10
10
|
init(params: ICellRendererParams): void;
|
|
11
|
+
render(): void;
|
|
11
12
|
getGui(): HTMLElement;
|
|
12
|
-
refresh(params:
|
|
13
|
+
refresh(params: ICellRendererParams): boolean;
|
|
13
14
|
destroy(): void;
|
|
14
15
|
}
|
|
@@ -40,7 +40,7 @@ class ActionColumnRenderer {
|
|
|
40
40
|
actionColumn: actionCol,
|
|
41
41
|
primaryKeyValue: pkValue,
|
|
42
42
|
rowNode: params.node,
|
|
43
|
-
|
|
43
|
+
adaptableApi: adaptable.api,
|
|
44
44
|
};
|
|
45
45
|
// if its a group node then only show if set to do so
|
|
46
46
|
if (adaptable.api.gridApi.isGroupRowNode(params.node) && !actionCol.includeGroupedRows) {
|
|
@@ -64,14 +64,30 @@ class ActionColumnRenderer {
|
|
|
64
64
|
let buttonStyle = adaptableApi.internalApi.getStyleForButton(button, context);
|
|
65
65
|
let buttonLabel = adaptableApi.internalApi.getLabelForButton(button, context);
|
|
66
66
|
let buttonTooltip = adaptableApi.internalApi.getTooltipForButton(button, context);
|
|
67
|
-
|
|
67
|
+
const handleClick = () => {
|
|
68
|
+
button.onClick(button, context);
|
|
69
|
+
// Timeout to let any updates to be done before re-rendering the component
|
|
70
|
+
setTimeout(() => {
|
|
71
|
+
// when called again it triggers a re-render
|
|
72
|
+
// https:reactjs.org/docs/react-dom.html#render
|
|
73
|
+
doRender();
|
|
74
|
+
}, 16);
|
|
75
|
+
};
|
|
76
|
+
return (React.createElement(SimpleButton_1.default, { key: button.Uuid, variant: (_a = buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.variant) !== null && _a !== void 0 ? _a : 'text', disabled: disabled, tooltip: buttonTooltip, tone: (_b = buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.tone) !== null && _b !== void 0 ? _b : 'none', onClick: handleClick, className: buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.className, accessLevel: 'Full' },
|
|
68
77
|
button.icon ? React.createElement("img", Object.assign({}, iconProps)) : null,
|
|
69
78
|
buttonLabel));
|
|
70
79
|
};
|
|
71
|
-
|
|
72
|
-
|
|
80
|
+
const eGui = this.eGui;
|
|
81
|
+
function doRender() {
|
|
82
|
+
react_dom_1.render(renderButton(adaptable.api, context), eGui);
|
|
83
|
+
}
|
|
84
|
+
this.render = doRender;
|
|
85
|
+
doRender();
|
|
73
86
|
}
|
|
74
87
|
}
|
|
88
|
+
// defined on init
|
|
89
|
+
// used to re-render in refresh
|
|
90
|
+
render() { }
|
|
75
91
|
// gets called once when grid ready to insert the element
|
|
76
92
|
getGui() {
|
|
77
93
|
return this.eGui;
|
|
@@ -79,6 +95,7 @@ class ActionColumnRenderer {
|
|
|
79
95
|
// gets called whenever the user gets the cell to refresh
|
|
80
96
|
refresh(params) {
|
|
81
97
|
// return true to tell the grid we refreshed successfully
|
|
98
|
+
this.render();
|
|
82
99
|
return true;
|
|
83
100
|
}
|
|
84
101
|
// gets called when the cell is removed from the grid
|