@adaptabletools/adaptable 18.0.0-canary.3 → 18.0.0-canary.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/agGrid.d.ts +4 -21
- package/agGrid.js +9 -26
- package/base.css +4 -1
- package/base.css.map +1 -1
- package/index.css +79 -68
- package/index.css.map +1 -1
- package/package.json +3 -4
- package/src/AdaptableInterfaces/IAdaptable.d.ts +55 -109
- package/src/AdaptableOptions/AdaptableOptions.d.ts +11 -5
- package/src/AdaptableOptions/ColumnFilterOptions.d.ts +4 -4
- 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/Events/AdaptableReady.d.ts +3 -3
- package/src/Api/Events/GridDataChanged.d.ts +4 -4
- package/src/Api/GridApi.d.ts +14 -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.js +2 -1
- package/src/Api/Implementation/ConfigApiImpl.js +8 -3
- package/src/Api/Implementation/GridApiImpl.d.ts +3 -3
- package/src/Api/Implementation/GridApiImpl.js +20 -14
- package/src/Api/Implementation/LayoutApiImpl.d.ts +4 -0
- package/src/Api/Implementation/LayoutApiImpl.js +14 -0
- package/src/Api/Implementation/NotesApiImpl.d.ts +2 -4
- package/src/Api/Implementation/NotesApiImpl.js +4 -8
- package/src/Api/Implementation/OptionsApiImpl.d.ts +1 -1
- package/src/Api/Implementation/OptionsApiImpl.js +2 -2
- 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/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/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/TeamSharingInternalApi.js +1 -1
- package/src/Api/InteropioPluginApi.d.ts +2 -2
- package/src/Api/LayoutApi.d.ts +8 -0
- package/src/Api/OptionsApi.d.ts +1 -1
- package/src/EnvVars.d.ts +3 -0
- package/src/EnvVars.js +4 -0
- package/src/PredefinedConfig/Common/AggregationColumns.d.ts +1 -0
- package/src/PredefinedConfig/Common/AggregationColumns.js +3 -0
- package/src/PredefinedConfig/NotesState.d.ts +10 -20
- package/src/PredefinedConfig/PredefinedConfig.d.ts +1 -1
- package/src/Redux/ActionsReducers/NotesRedux.d.ts +3 -4
- package/src/Redux/ActionsReducers/NotesRedux.js +8 -7
- package/src/Redux/Store/AdaptableStore.d.ts +4 -6
- package/src/Redux/Store/AdaptableStore.js +22 -50
- package/src/Redux/Store/Interface/IAdaptableStore.d.ts +7 -1
- 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/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 +2 -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 +1 -3
- package/src/Strategy/LayoutModule.js +6 -50
- package/src/Strategy/NamedQueryModule.d.ts +0 -1
- package/src/Strategy/NamedQueryModule.js +0 -19
- 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/Helpers/AdaptableHelper.d.ts +0 -3
- package/src/Utilities/Helpers/AdaptableHelper.js +0 -58
- package/src/Utilities/Helpers/Helper.d.ts +2 -0
- package/src/Utilities/Helpers/Helper.js +4 -0
- package/src/Utilities/Services/AggregatedScalarLiveValue.js +3 -1
- package/src/Utilities/Services/CellPopupService.js +0 -1
- package/src/Utilities/Services/LicenseService/index.d.ts +3 -0
- package/src/Utilities/Services/LicenseService/index.js +10 -3
- package/src/Utilities/Services/MetamodelService.d.ts +1 -1
- package/src/Utilities/Services/MetamodelService.js +6 -3
- package/src/Utilities/Services/RowEditService.d.ts +3 -2
- package/src/Utilities/Services/RowEditService.js +3 -1
- package/src/View/AdaptableView.js +0 -2
- 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/Popups/AdaptableLoadingScreen.d.ts +6 -5
- package/src/View/Components/Popups/AdaptableLoadingScreen.js +19 -9
- 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 +1 -1
- package/src/View/GridFilter/GridFilterViewPanel.js +6 -2
- package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +2 -3
- package/src/View/Layout/TransposedPopup.d.ts +3 -0
- package/src/View/Layout/TransposedPopup.js +193 -0
- package/src/View/Layout/Wizard/LayoutWizard.js +1 -1
- package/src/View/Notes/NotesPopup.js +9 -11
- package/src/View/Theme/ThemeSelector.js +3 -3
- package/src/agGrid/ActionColumnRenderer.js +4 -4
- package/src/agGrid/Adaptable.d.ts +3 -455
- package/src/agGrid/Adaptable.js +8 -5292
- package/src/agGrid/AdaptableAgGrid.d.ts +336 -0
- package/src/agGrid/AdaptableAgGrid.js +3780 -0
- package/src/agGrid/AdaptableLogger.js +77 -11
- package/src/agGrid/AgGridAdapter.d.ts +54 -0
- package/src/agGrid/AgGridAdapter.js +549 -0
- package/src/agGrid/AgGridColumnAdapter.d.ts +56 -0
- package/src/agGrid/AgGridColumnAdapter.js +813 -0
- package/src/agGrid/AgGridMenuAdapter.d.ts +28 -0
- package/src/agGrid/AgGridMenuAdapter.js +271 -0
- package/src/agGrid/AgGridOptionsService.d.ts +11 -0
- package/src/agGrid/AgGridOptionsService.js +50 -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/Datepicker/index.d.ts +1 -1
- package/src/components/InfiniteTable/index.js +2 -2
- 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/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +39 -11
- package/src/metamodel/adaptable.metamodel.js +73 -32
- 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/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/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
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { ApiBase } from '../Implementation/ApiBase';
|
|
2
|
+
import { CreateEmptyCalculatedColumn } from '../../Utilities/ObjectFactory';
|
|
3
|
+
import { AB_SPECIAL_COLUMN } from '../../Utilities/Constants/GeneralConstants';
|
|
4
|
+
import ArrayExtensions from '../../Utilities/Extensions/ArrayExtensions';
|
|
5
|
+
import StringExtensions from '../../Utilities/Extensions/StringExtensions';
|
|
2
6
|
export class CalculatedColumnInternalApi extends ApiBase {
|
|
3
7
|
/**
|
|
4
8
|
* Returns all the references in the AdaptableState of the given CalculatedColumn
|
|
@@ -87,4 +91,70 @@ export class CalculatedColumnInternalApi extends ApiBase {
|
|
|
87
91
|
};
|
|
88
92
|
this.adaptable.api.eventApi.emit('CalculatedColumnChanged', calculatedColumnChangedInfo);
|
|
89
93
|
}
|
|
94
|
+
getColDefsForCalculatedColumns() {
|
|
95
|
+
const defaultCalculatedColumnSettings = CreateEmptyCalculatedColumn().CalculatedColumnSettings;
|
|
96
|
+
return this.getCalculatedColumnApi()
|
|
97
|
+
.getCalculatedColumns()
|
|
98
|
+
.map((calculatedColumn) => {
|
|
99
|
+
const calculatedColumnSettings = Object.assign(Object.assign({}, defaultCalculatedColumnSettings), calculatedColumn.CalculatedColumnSettings);
|
|
100
|
+
if (!calculatedColumnSettings.DataType) {
|
|
101
|
+
calculatedColumnSettings.DataType = this.getAdaptableApi()
|
|
102
|
+
.internalApi.getAdaptableInstance()
|
|
103
|
+
.CalculatedColumnExpressionService.getCalculatedColumnDataType(calculatedColumn.Query);
|
|
104
|
+
}
|
|
105
|
+
const columnTypes = [
|
|
106
|
+
AB_SPECIAL_COLUMN,
|
|
107
|
+
this.getGridApi().internalApi.getAgGridDataType(calculatedColumnSettings.DataType),
|
|
108
|
+
];
|
|
109
|
+
if (ArrayExtensions.IsNotNullOrEmpty(calculatedColumnSettings.ColumnTypes)) {
|
|
110
|
+
columnTypes.push(...calculatedColumnSettings.ColumnTypes);
|
|
111
|
+
}
|
|
112
|
+
const isExternalEvaluation = !this.getExpressionApi().internalApi.evaluateExpressionInAdaptableQL('CalculatedColumn', calculatedColumn, this.getExpressionApi().getAdaptableQueryExpression(calculatedColumn.Query));
|
|
113
|
+
const valueGetter = (params) => {
|
|
114
|
+
var _a, _b;
|
|
115
|
+
if (isExternalEvaluation) {
|
|
116
|
+
return (_a = params.data) === null || _a === void 0 ? void 0 : _a[calculatedColumn.ColumnId];
|
|
117
|
+
}
|
|
118
|
+
// if the grid data is NOT client side, we can aggregate only simple scalar expression (which depend on row data, not on other rows)
|
|
119
|
+
if (this.getGridApi().getAgGridRowModelType() !== 'clientSide' &&
|
|
120
|
+
StringExtensions.IsNotNullOrEmpty(calculatedColumn.Query.AggregatedScalarExpression)) {
|
|
121
|
+
return (_b = params.data) === null || _b === void 0 ? void 0 : _b[calculatedColumn.ColumnId];
|
|
122
|
+
}
|
|
123
|
+
return this.getAdaptableApi()
|
|
124
|
+
.internalApi.getAdaptableInstance()
|
|
125
|
+
.CalculatedColumnExpressionService.evaluateCalculatedColumnQuery(calculatedColumn, params.node);
|
|
126
|
+
};
|
|
127
|
+
const newColDef = {
|
|
128
|
+
headerName: calculatedColumn.FriendlyName
|
|
129
|
+
? calculatedColumn.FriendlyName
|
|
130
|
+
: calculatedColumn.ColumnId,
|
|
131
|
+
colId: calculatedColumn.ColumnId,
|
|
132
|
+
hide: true,
|
|
133
|
+
editable: false,
|
|
134
|
+
width: calculatedColumnSettings.Width,
|
|
135
|
+
enableValue: calculatedColumnSettings.Aggregatable,
|
|
136
|
+
filter: calculatedColumnSettings.Filterable,
|
|
137
|
+
floatingFilter: calculatedColumnSettings.Filterable,
|
|
138
|
+
resizable: calculatedColumnSettings.Resizable,
|
|
139
|
+
enableRowGroup: calculatedColumnSettings.Groupable,
|
|
140
|
+
sortable: calculatedColumnSettings.Sortable,
|
|
141
|
+
enablePivot: calculatedColumnSettings.Pivotable,
|
|
142
|
+
suppressMenu: calculatedColumnSettings.SuppressMenu,
|
|
143
|
+
suppressMovable: calculatedColumnSettings.SuppressMovable,
|
|
144
|
+
type: columnTypes,
|
|
145
|
+
valueGetter,
|
|
146
|
+
};
|
|
147
|
+
if (calculatedColumnSettings.ShowToolTip != null &&
|
|
148
|
+
calculatedColumnSettings.ShowToolTip == true) {
|
|
149
|
+
newColDef.tooltipValueGetter = () => {
|
|
150
|
+
return this.getAdaptableApi().internalApi.getAdaptableQueryExpressionText(calculatedColumn.Query);
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
if (calculatedColumnSettings.HeaderToolTip) {
|
|
154
|
+
newColDef.headerTooltip = calculatedColumnSettings.HeaderToolTip;
|
|
155
|
+
}
|
|
156
|
+
this.getAdaptableApi().logInfo('Setting up Calculated Column: ' + calculatedColumn.ColumnId);
|
|
157
|
+
return newColDef;
|
|
158
|
+
});
|
|
159
|
+
}
|
|
90
160
|
}
|
|
@@ -56,4 +56,5 @@ export declare class ColumnFilterInternalApi extends ApiBase {
|
|
|
56
56
|
*/
|
|
57
57
|
areColumnFiltersDifferent(oldFilters: ColumnFilter[], newFilters: ColumnFilter[]): boolean;
|
|
58
58
|
getPredicateDefShortcuts(predicateDef: AdaptablePredicateDef): string[];
|
|
59
|
+
getFilterValuesMaxNumberOfItems(column: AdaptableColumn): number | undefined;
|
|
59
60
|
}
|
|
@@ -171,7 +171,7 @@ export class ColumnFilterInternalApi extends ApiBase {
|
|
|
171
171
|
* Fires Column Filter Applied Event - typically used to enable filtering on the server
|
|
172
172
|
*/
|
|
173
173
|
fireColumnFilterAppliedEvent() {
|
|
174
|
-
if (this.adaptable.
|
|
174
|
+
if (this.adaptable.isReady) {
|
|
175
175
|
const adaptableApi = this.getAdaptableApi();
|
|
176
176
|
const columnFilterAppliedInfo = {
|
|
177
177
|
columnFilters: this.getColumnFilterApi().getColumnFilters(),
|
|
@@ -202,4 +202,14 @@ export class ColumnFilterInternalApi extends ApiBase {
|
|
|
202
202
|
}
|
|
203
203
|
return predicateShortcuts;
|
|
204
204
|
}
|
|
205
|
+
getFilterValuesMaxNumberOfItems(column) {
|
|
206
|
+
const maxFilterValues = this.getColumnFilterOptions().valuesFilterOptions.maxFilterValuesToDisplay;
|
|
207
|
+
if (typeof maxFilterValues === 'function') {
|
|
208
|
+
const columnFilterContext = Object.assign(Object.assign({}, this.getAdaptableApi().internalApi.buildBaseContext()), { column: column });
|
|
209
|
+
return maxFilterValues(columnFilterContext);
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
return maxFilterValues;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
205
215
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ApiBase } from '../Implementation/ApiBase';
|
|
2
|
-
import { Column } from '@ag-grid-community/core';
|
|
2
|
+
import { Column, IRowNode } from '@ag-grid-community/core';
|
|
3
|
+
import { CustomSort } from '../../PredefinedConfig/CustomSortState';
|
|
4
|
+
import { ColumnValuesComparer } from '../../AdaptableOptions/CustomSortOptions';
|
|
3
5
|
export declare class ColumnInternalApi extends ApiBase {
|
|
4
6
|
/**
|
|
5
7
|
* Retrieves 'ColumnType' property for a given Column
|
|
@@ -24,4 +26,5 @@ export declare class ColumnInternalApi extends ApiBase {
|
|
|
24
26
|
*/
|
|
25
27
|
getAgGridColumnForAdaptableColumn(columnId: string): Column;
|
|
26
28
|
isActionRowButtonColumn(columnId: string): boolean;
|
|
29
|
+
getActiveColumnComparator(columnId: string, customSort?: CustomSort, customSortComparer?: ColumnValuesComparer): (valueA: any, valueB: any, nodeA?: IRowNode, nodeB?: IRowNode, isInverted?: boolean) => number | undefined;
|
|
27
30
|
}
|
|
@@ -39,4 +39,16 @@ export class ColumnInternalApi extends ApiBase {
|
|
|
39
39
|
isActionRowButtonColumn(columnId) {
|
|
40
40
|
return columnId === ADAPTABLE_ROW_ACTION_BUTTONS;
|
|
41
41
|
}
|
|
42
|
+
getActiveColumnComparator(columnId, customSort, customSortComparer) {
|
|
43
|
+
if ((!customSort || (customSort === null || customSort === void 0 ? void 0 : customSort.IsSuspended)) && !customSortComparer) {
|
|
44
|
+
// defaults to AG-Grid column definition comparator if no CustomSort is defined&active
|
|
45
|
+
const colDefComparator = this.adaptable.agGridColumnAdapter.getUserColDefProperty(columnId, 'comparator');
|
|
46
|
+
return colDefComparator;
|
|
47
|
+
}
|
|
48
|
+
// CustomSort Comparer function takes precedence over CustomSort SortedValues
|
|
49
|
+
const comparerFunction = customSortComparer
|
|
50
|
+
? customSortComparer.comparer
|
|
51
|
+
: this.getCustomSortApi().internalApi.getDefaultCustomSortComparer(customSort.ColumnId, customSort.SortedValues);
|
|
52
|
+
return comparerFunction;
|
|
53
|
+
}
|
|
42
54
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ApiBase } from '../Implementation/ApiBase';
|
|
2
|
-
import { AdaptableColumn } from '../../PredefinedConfig/Common/AdaptableColumn';
|
|
3
2
|
import { ColumnValuesComparer } from '../../AdaptableOptions/CustomSortOptions';
|
|
3
|
+
import { AdaptableComparerFunction } from '../../PredefinedConfig/Common/AdaptableComparerFunction';
|
|
4
4
|
export declare class CustomSortInternalApi extends ApiBase {
|
|
5
|
-
getCustomSortComparer(
|
|
5
|
+
getCustomSortComparer(columnId: string): ColumnValuesComparer | undefined;
|
|
6
|
+
getDefaultCustomSortComparer(columnId: string, columnValues: any[]): AdaptableComparerFunction;
|
|
6
7
|
}
|
|
@@ -1,7 +1,38 @@
|
|
|
1
1
|
import { ApiBase } from '../Implementation/ApiBase';
|
|
2
2
|
export class CustomSortInternalApi extends ApiBase {
|
|
3
|
-
getCustomSortComparer(
|
|
3
|
+
getCustomSortComparer(columnId) {
|
|
4
4
|
var _a;
|
|
5
|
+
const column = this.getColumnApi().getColumnWithColumnId(columnId);
|
|
5
6
|
return (_a = this.getCustomSortOptions().customSortComparers) === null || _a === void 0 ? void 0 : _a.find((csc) => this.adaptable.api.scopeApi.isColumnInScope(column, csc.scope));
|
|
6
7
|
}
|
|
8
|
+
getDefaultCustomSortComparer(columnId, columnValues) {
|
|
9
|
+
// have to return a function that may not have access to this
|
|
10
|
+
const adaptable = this.adaptable;
|
|
11
|
+
return function compareItemsOfCustomSort(valueA, valueB, nodeA, nodeB) {
|
|
12
|
+
var _a, _b;
|
|
13
|
+
let firstElementValueString = (_a = (nodeA && adaptable.getDisplayValueFromRowNode(nodeA, columnId))) !== null && _a !== void 0 ? _a : valueA;
|
|
14
|
+
let secondElementValueString = (_b = (nodeB && adaptable.getDisplayValueFromRowNode(nodeB, columnId))) !== null && _b !== void 0 ? _b : valueB;
|
|
15
|
+
let indexFirstElement = columnValues.indexOf(firstElementValueString);
|
|
16
|
+
let containsFirstElement = indexFirstElement >= 0;
|
|
17
|
+
let indexSecondElement = columnValues.indexOf(secondElementValueString);
|
|
18
|
+
let containsSecondElement = indexSecondElement >= 0;
|
|
19
|
+
//if none of the element are in the list we jsut return normal compare
|
|
20
|
+
if (!containsFirstElement && !containsSecondElement) {
|
|
21
|
+
if (valueA == valueB) {
|
|
22
|
+
return 0;
|
|
23
|
+
}
|
|
24
|
+
return valueA < valueB ? -1 : 1;
|
|
25
|
+
}
|
|
26
|
+
//if first item not in the list make sure we put it after the second item
|
|
27
|
+
if (!containsFirstElement) {
|
|
28
|
+
return 1;
|
|
29
|
+
}
|
|
30
|
+
//if second item not in the list make sure we put it after the first item
|
|
31
|
+
if (!containsSecondElement) {
|
|
32
|
+
return -1;
|
|
33
|
+
}
|
|
34
|
+
//return the comparison from the list if the two items are in the list
|
|
35
|
+
return indexFirstElement - indexSecondElement;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
7
38
|
}
|
|
@@ -5,7 +5,7 @@ export class DataSetInternalApi extends ApiBase {
|
|
|
5
5
|
* @param dataSet Data Set which has been selected
|
|
6
6
|
*/
|
|
7
7
|
fireDataSetSelectedEvent(dataSet) {
|
|
8
|
-
if (this.adaptable.
|
|
8
|
+
if (this.adaptable.isReady) {
|
|
9
9
|
const dataSetSelectedInfo = {
|
|
10
10
|
adaptableApi: this.adaptable.api,
|
|
11
11
|
dataSet,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ApiBase } from '../Implementation/ApiBase';
|
|
2
2
|
import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChangedInfo';
|
|
3
3
|
import { FreeTextColumn } from '../../PredefinedConfig/FreeTextColumnState';
|
|
4
|
+
import { ColDef } from '@ag-grid-community/core';
|
|
4
5
|
export declare class FreeTextColumnInternalApi extends ApiBase {
|
|
5
6
|
/**
|
|
6
7
|
* Checks if a User Edit was in a Free Text Column
|
|
@@ -12,4 +13,5 @@ export declare class FreeTextColumnInternalApi extends ApiBase {
|
|
|
12
13
|
* @param freeTextColumn FreeTextColumn to be checked
|
|
13
14
|
*/
|
|
14
15
|
getFreeTextColumnModuleReferences(freeTextColumn: FreeTextColumn): string[];
|
|
16
|
+
getColDefsForFreeTextColumns(): ColDef<any, any>[];
|
|
15
17
|
}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { ApiBase } from '../Implementation/ApiBase';
|
|
2
|
+
import { CreateEmptyFreeTextColumn } from '../../Utilities/ObjectFactory';
|
|
3
|
+
import { AdaptableNumberEditor } from '../../agGrid/editors/AdaptableNumberEditor';
|
|
4
|
+
import { AdaptableDateEditor } from '../../agGrid/editors/AdaptableDateEditor';
|
|
5
|
+
import { AB_SPECIAL_COLUMN } from '../../Utilities/Constants/GeneralConstants';
|
|
6
|
+
import ArrayExtensions from '../../Utilities/Extensions/ArrayExtensions';
|
|
2
7
|
export class FreeTextColumnInternalApi extends ApiBase {
|
|
3
8
|
/**
|
|
4
9
|
* Checks if a User Edit was in a Free Text Column
|
|
@@ -37,4 +42,58 @@ export class FreeTextColumnInternalApi extends ApiBase {
|
|
|
37
42
|
});
|
|
38
43
|
return references;
|
|
39
44
|
}
|
|
45
|
+
getColDefsForFreeTextColumns() {
|
|
46
|
+
const defaultFreeTextColumnSettings = CreateEmptyFreeTextColumn().FreeTextColumnSettings;
|
|
47
|
+
return this.getFreeTextColumnApi()
|
|
48
|
+
.getFreeTextColumns()
|
|
49
|
+
.map((freeTextColumn) => {
|
|
50
|
+
var _a;
|
|
51
|
+
const freeTextColumnSettings = Object.assign(Object.assign({}, defaultFreeTextColumnSettings), freeTextColumn.FreeTextColumnSettings);
|
|
52
|
+
const dataTypeEditor = freeTextColumnSettings.DataType === 'Number'
|
|
53
|
+
? AdaptableNumberEditor
|
|
54
|
+
: freeTextColumnSettings.DataType === 'Date'
|
|
55
|
+
? AdaptableDateEditor
|
|
56
|
+
: null;
|
|
57
|
+
const columnTypes = [
|
|
58
|
+
AB_SPECIAL_COLUMN,
|
|
59
|
+
this.getGridApi().internalApi.getAgGridDataType(freeTextColumnSettings.DataType),
|
|
60
|
+
];
|
|
61
|
+
if (ArrayExtensions.IsNotNullOrEmpty((_a = freeTextColumn === null || freeTextColumn === void 0 ? void 0 : freeTextColumn.FreeTextColumnSettings) === null || _a === void 0 ? void 0 : _a.ColumnTypes)) {
|
|
62
|
+
columnTypes.push(...freeTextColumn.FreeTextColumnSettings.ColumnTypes);
|
|
63
|
+
}
|
|
64
|
+
const newColDef = {
|
|
65
|
+
headerName: freeTextColumn.FriendlyName || freeTextColumn.ColumnId,
|
|
66
|
+
colId: freeTextColumn.ColumnId,
|
|
67
|
+
editable: true,
|
|
68
|
+
hide: true,
|
|
69
|
+
width: freeTextColumnSettings.Width,
|
|
70
|
+
enableValue: freeTextColumnSettings.Aggregatable,
|
|
71
|
+
filter: freeTextColumnSettings.Filterable,
|
|
72
|
+
floatingFilter: freeTextColumnSettings.Filterable,
|
|
73
|
+
resizable: freeTextColumnSettings.Resizable,
|
|
74
|
+
enableRowGroup: freeTextColumnSettings.Groupable,
|
|
75
|
+
sortable: freeTextColumnSettings.Sortable,
|
|
76
|
+
enablePivot: freeTextColumnSettings.Pivotable,
|
|
77
|
+
suppressMenu: freeTextColumnSettings.SuppressMenu,
|
|
78
|
+
suppressMovable: freeTextColumnSettings.SuppressMovable,
|
|
79
|
+
cellEditor: dataTypeEditor !== null && dataTypeEditor !== void 0 ? dataTypeEditor : (freeTextColumn.TextEditor && freeTextColumn.TextEditor == 'Large'
|
|
80
|
+
? 'agLargeTextCellEditor'
|
|
81
|
+
: 'agTextCellEditor'),
|
|
82
|
+
type: columnTypes,
|
|
83
|
+
valueSetter: (params) => {
|
|
84
|
+
return (params.data[freeTextColumn.ColumnId] = params.newValue);
|
|
85
|
+
},
|
|
86
|
+
// use a Boolean Cell Data Type if the Free Text Column is boolean
|
|
87
|
+
cellDataType: freeTextColumnSettings.DataType && freeTextColumnSettings.DataType == 'Boolean'
|
|
88
|
+
? 'boolean'
|
|
89
|
+
: undefined,
|
|
90
|
+
valueGetter: (params) => this.getFreeTextColumnApi().getFreeTextColumnValueForRowNode(freeTextColumn, params.node),
|
|
91
|
+
};
|
|
92
|
+
if (freeTextColumnSettings.HeaderToolTip) {
|
|
93
|
+
newColDef.headerTooltip = freeTextColumnSettings.HeaderToolTip;
|
|
94
|
+
}
|
|
95
|
+
this.getAdaptableApi().logInfo('Setting up FreeText Column: ' + freeTextColumn.ColumnId);
|
|
96
|
+
return newColDef;
|
|
97
|
+
});
|
|
98
|
+
}
|
|
40
99
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ApiBase } from '../Implementation/ApiBase';
|
|
2
2
|
export class GridFilterInternalApi extends ApiBase {
|
|
3
3
|
fireGridFilterAppliedEvent() {
|
|
4
|
-
if (this.adaptable.
|
|
4
|
+
if (this.adaptable.isReady) {
|
|
5
5
|
const currentGridFilter = this.getGridFilterApi().getCurrentGridFilter();
|
|
6
6
|
const adaptableApi = this.getAdaptableApi();
|
|
7
7
|
const gridFilterAppliedInfo = {
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { ApiBase } from '../Implementation/ApiBase';
|
|
2
2
|
import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChangedInfo';
|
|
3
|
-
import { IRowNode } from '@ag-grid-community/core';
|
|
3
|
+
import { IRowNode, RowClassParams } from '@ag-grid-community/core';
|
|
4
|
+
import { GridDataChangeTrigger } from '../Events/GridDataChanged';
|
|
4
5
|
import { GridCell } from '../../PredefinedConfig/Selection/GridCell';
|
|
5
|
-
import { AdaptableColumn } from '../../PredefinedConfig/Common/AdaptableColumn';
|
|
6
|
+
import { AdaptableColumn, AdaptableColumnDataType } from '../../PredefinedConfig/Common/AdaptableColumn';
|
|
6
7
|
import { SelectedCellInfo } from '../../PredefinedConfig/Selection/SelectedCellInfo';
|
|
7
8
|
import { SelectedRowInfo } from '../../PredefinedConfig/Selection/SelectedRowInfo';
|
|
8
9
|
import { AdaptableMenuItem } from '../../PredefinedConfig/Common/Menu';
|
|
9
10
|
import { EditLookUpPermittedValues } from '../../AdaptableOptions/UserInterfaceOptions';
|
|
11
|
+
import { DistinctValuesParams } from '../../AdaptableInterfaces/IAdaptable';
|
|
12
|
+
import { AdaptableColumnType } from '../../PredefinedConfig/Common/Types';
|
|
10
13
|
export declare class GridInternalApi extends ApiBase {
|
|
11
14
|
/**
|
|
12
15
|
* Fires Grid Sorted Event
|
|
@@ -19,7 +22,7 @@ export declare class GridInternalApi extends ApiBase {
|
|
|
19
22
|
/**
|
|
20
23
|
* Fires Grid Data Changed Event - when a row has changed in AG Grid
|
|
21
24
|
*/
|
|
22
|
-
fireGridDataChangedEvent(dataRows: any[], rowNodes: IRowNode[], rowTrigger:
|
|
25
|
+
fireGridDataChangedEvent(dataRows: any[], rowNodes: IRowNode[], rowTrigger: GridDataChangeTrigger): void;
|
|
23
26
|
/**
|
|
24
27
|
* Gets all distinct display values in the Column with the given ColumnId
|
|
25
28
|
* @param columnId Column to check
|
|
@@ -39,17 +42,23 @@ export declare class GridInternalApi extends ApiBase {
|
|
|
39
42
|
}[];
|
|
40
43
|
suppressClientSideFilter: boolean;
|
|
41
44
|
}>;
|
|
45
|
+
getDistinctFilterListValuesForColumn(column: AdaptableColumn, filter: string, distinctValuesParams: DistinctValuesParams): Promise<{
|
|
46
|
+
suppressClientSideFilter?: boolean;
|
|
47
|
+
gridCells: GridCell[];
|
|
48
|
+
}>;
|
|
42
49
|
/**
|
|
43
50
|
* Gets all distinct Custom Sort values for the Column with the given ColumnId
|
|
44
51
|
* @param columnId Column to check
|
|
45
52
|
*/
|
|
46
53
|
getDistinctCustomSortDisplayValuesForColumn(columnId: string): Promise<any[]>;
|
|
54
|
+
getDistinctCustomSortValuesForColumn(column: AdaptableColumn, distinctValuesParams: DistinctValuesParams): Promise<GridCell<any>[]>;
|
|
47
55
|
/**
|
|
48
56
|
* Gets all distinct Bulk Update values for the Column with the given ColumnId
|
|
49
57
|
* @param columnId Column to check
|
|
50
58
|
* @param selectedGridCells Selected grid cells
|
|
51
59
|
*/
|
|
52
60
|
getDistinctBulkUpdateDisplayValuesForColumn(columnId: string, selectedGridCells: GridCell[]): Promise<any[]>;
|
|
61
|
+
getDistinctBulkUpdateValuesForColumn(column: AdaptableColumn, selectedGridCells: GridCell[], distinctValuesParams: DistinctValuesParams): Promise<GridCell<any>[]>;
|
|
53
62
|
/**
|
|
54
63
|
* Gets all distinct visible (after current filters are applied) display values in the Column with the given ColumnId
|
|
55
64
|
* @param columnId Column to check
|
|
@@ -78,4 +87,13 @@ export declare class GridInternalApi extends ApiBase {
|
|
|
78
87
|
setSelectedRows(selectedRowInfo: SelectedRowInfo): void;
|
|
79
88
|
buildStandaloneColumnHeader(column: AdaptableColumn): AdaptableMenuItem[];
|
|
80
89
|
getEditLookUpValuesForColumn(editLookUpItem: EditLookUpPermittedValues, column: AdaptableColumn, gridCell?: GridCell): any[] | undefined;
|
|
90
|
+
getAgGridDataType(dataType: AdaptableColumnDataType): AdaptableColumnType;
|
|
91
|
+
getRowHighlightStyle(params: RowClassParams): {
|
|
92
|
+
[cssProperty: string]: string;
|
|
93
|
+
};
|
|
94
|
+
getAlertRowStyle(params: RowClassParams): {
|
|
95
|
+
[cssProperty: string]: string;
|
|
96
|
+
};
|
|
97
|
+
getAlertRowClass(params: RowClassParams): string | null;
|
|
98
|
+
getRowHighlightClass(params: RowClassParams): string | null;
|
|
81
99
|
}
|
|
@@ -3,12 +3,15 @@ import { SortOrder } from '../../PredefinedConfig/Common/Enums';
|
|
|
3
3
|
import ArrayExtensions from '../../Utilities/Extensions/ArrayExtensions';
|
|
4
4
|
import * as GridRedux from '../../Redux/ActionsReducers/GridRedux';
|
|
5
5
|
import NumberExtensions from '../../Utilities/Extensions/NumberExtensions';
|
|
6
|
+
import { convertAdaptableStyleToCSS } from '../../Utilities/Helpers/StyleHelper';
|
|
7
|
+
import UIHelper from '../../View/UIHelper';
|
|
8
|
+
import { createBaseContext } from '../../Utilities/ObjectFactory';
|
|
6
9
|
export class GridInternalApi extends ApiBase {
|
|
7
10
|
/**
|
|
8
11
|
* Fires Grid Sorted Event
|
|
9
12
|
*/
|
|
10
13
|
fireGridSortedEvent() {
|
|
11
|
-
if (this.adaptable.
|
|
14
|
+
if (this.adaptable.isReady) {
|
|
12
15
|
const adaptableSortState = this.adaptable.api.configApi.getAdaptableSortState();
|
|
13
16
|
const adaptableApi = this.getAdaptableApi();
|
|
14
17
|
const gridSortedInfo = {
|
|
@@ -24,7 +27,7 @@ export class GridInternalApi extends ApiBase {
|
|
|
24
27
|
* Fires Cell Changed Changed Event - when any data in AG Grid's dataset has changed
|
|
25
28
|
*/
|
|
26
29
|
fireCellChangedEvent(cellDataChangedInfo) {
|
|
27
|
-
if (this.adaptable.
|
|
30
|
+
if (this.adaptable.isReady) {
|
|
28
31
|
const cellChangedInfo = {
|
|
29
32
|
adaptableApi: this.adaptable.api,
|
|
30
33
|
cellChange: cellDataChangedInfo,
|
|
@@ -38,7 +41,7 @@ export class GridInternalApi extends ApiBase {
|
|
|
38
41
|
* Fires Grid Data Changed Event - when a row has changed in AG Grid
|
|
39
42
|
*/
|
|
40
43
|
fireGridDataChangedEvent(dataRows, rowNodes, rowTrigger) {
|
|
41
|
-
if (this.adaptable.
|
|
44
|
+
if (this.adaptable.isReady) {
|
|
42
45
|
const gridDataChangedInfo = {
|
|
43
46
|
changedAt: Date.now(),
|
|
44
47
|
adaptableApi: this.adaptable.api,
|
|
@@ -88,7 +91,7 @@ export class GridInternalApi extends ApiBase {
|
|
|
88
91
|
const distinctValuesParams = {
|
|
89
92
|
visibleRowsOnly: showFilteredRowsOnly,
|
|
90
93
|
};
|
|
91
|
-
const { gridCells, suppressClientSideFilter } = await this.
|
|
94
|
+
const { gridCells, suppressClientSideFilter } = await this.getDistinctFilterListValuesForColumn(abColumn, filter, distinctValuesParams);
|
|
92
95
|
const sortedDistinctValues = this.sortDistinctValues(gridCells, abColumn);
|
|
93
96
|
let shouldShowValuesCount = false;
|
|
94
97
|
const showValuesCountFunction = this.getColumnFilterOptions().valuesFilterOptions.showValuesCount;
|
|
@@ -128,6 +131,26 @@ export class GridInternalApi extends ApiBase {
|
|
|
128
131
|
suppressClientSideFilter,
|
|
129
132
|
};
|
|
130
133
|
}
|
|
134
|
+
async getDistinctFilterListValuesForColumn(column, filter, distinctValuesParams) {
|
|
135
|
+
var _a;
|
|
136
|
+
const filterPermittedValues = (_a = this.getUserInterfaceApi().getFilterPermittedValuesForColumn(column)) !== null && _a !== void 0 ? _a : {
|
|
137
|
+
suppressFilterSearchBar: false,
|
|
138
|
+
values: () => undefined,
|
|
139
|
+
};
|
|
140
|
+
let preparedPermittedValues = undefined;
|
|
141
|
+
try {
|
|
142
|
+
const filterPermittedValuesParams = Object.assign(Object.assign({}, createBaseContext(this.adaptable.api)), { column: column, searchFilter: filter });
|
|
143
|
+
preparedPermittedValues = await (filterPermittedValues === null || filterPermittedValues === void 0 ? void 0 : filterPermittedValues.values(filterPermittedValuesParams));
|
|
144
|
+
}
|
|
145
|
+
catch (error) {
|
|
146
|
+
this.adaptable.logger.consoleError(`Failed to load filter permitted values`, column, filter, error);
|
|
147
|
+
}
|
|
148
|
+
distinctValuesParams.permittedValues = preparedPermittedValues;
|
|
149
|
+
return {
|
|
150
|
+
suppressClientSideFilter: filterPermittedValues.suppressFilterSearchBar,
|
|
151
|
+
gridCells: this.adaptable.getDistinctValuesForColumn(column, distinctValuesParams),
|
|
152
|
+
};
|
|
153
|
+
}
|
|
131
154
|
/**
|
|
132
155
|
* Gets all distinct Custom Sort values for the Column with the given ColumnId
|
|
133
156
|
* @param columnId Column to check
|
|
@@ -140,11 +163,24 @@ export class GridInternalApi extends ApiBase {
|
|
|
140
163
|
const distinctValuesParams = {
|
|
141
164
|
visibleRowsOnly: false,
|
|
142
165
|
};
|
|
143
|
-
const gridCells = await this.
|
|
166
|
+
const gridCells = await this.getDistinctCustomSortValuesForColumn(abColumn, distinctValuesParams);
|
|
144
167
|
return this.sortDistinctValues(gridCells, abColumn).map((cv) => {
|
|
145
168
|
return cv.normalisedValue;
|
|
146
169
|
});
|
|
147
170
|
}
|
|
171
|
+
async getDistinctCustomSortValuesForColumn(column, distinctValuesParams) {
|
|
172
|
+
const customSortPermittedValues = await this.getUserInterfaceApi().getCustomSortPermittedValuesForColumn(column);
|
|
173
|
+
let preparedPermittedValues = undefined;
|
|
174
|
+
try {
|
|
175
|
+
const permittedValuesParams = Object.assign(Object.assign({}, createBaseContext(this.adaptable.api)), { column: column });
|
|
176
|
+
preparedPermittedValues = await (customSortPermittedValues === null || customSortPermittedValues === void 0 ? void 0 : customSortPermittedValues.values(permittedValuesParams));
|
|
177
|
+
}
|
|
178
|
+
catch (error) {
|
|
179
|
+
this.adaptable.logger.consoleError(`Failed to load custom sort permitted values`, column, error);
|
|
180
|
+
}
|
|
181
|
+
distinctValuesParams.permittedValues = preparedPermittedValues;
|
|
182
|
+
return this.adaptable.getDistinctValuesForColumn(column, distinctValuesParams);
|
|
183
|
+
}
|
|
148
184
|
/**
|
|
149
185
|
* Gets all distinct Bulk Update values for the Column with the given ColumnId
|
|
150
186
|
* @param columnId Column to check
|
|
@@ -158,11 +194,24 @@ export class GridInternalApi extends ApiBase {
|
|
|
158
194
|
const distinctValuesParams = {
|
|
159
195
|
visibleRowsOnly: false,
|
|
160
196
|
};
|
|
161
|
-
const gridCells = await this.
|
|
197
|
+
const gridCells = await this.getDistinctBulkUpdateValuesForColumn(abColumn, selectedGridCells, distinctValuesParams);
|
|
162
198
|
return this.sortDistinctValues(gridCells, abColumn).map((cv) => {
|
|
163
199
|
return cv.normalisedValue;
|
|
164
200
|
});
|
|
165
201
|
}
|
|
202
|
+
async getDistinctBulkUpdateValuesForColumn(column, selectedGridCells, distinctValuesParams) {
|
|
203
|
+
const bulkUpdatePermittedValues = await this.getUserInterfaceApi().getBulkUpdatePermittedValuesForColumn(column);
|
|
204
|
+
let preparedPermittedValues = undefined;
|
|
205
|
+
try {
|
|
206
|
+
const bulkUpdatePermittedValuesParams = Object.assign(Object.assign({}, createBaseContext(this.adaptable.api)), { column: column, gridCells: selectedGridCells });
|
|
207
|
+
preparedPermittedValues = await (bulkUpdatePermittedValues === null || bulkUpdatePermittedValues === void 0 ? void 0 : bulkUpdatePermittedValues.values(bulkUpdatePermittedValuesParams));
|
|
208
|
+
}
|
|
209
|
+
catch (error) {
|
|
210
|
+
this.adaptable.logger.consoleError(`Failed to load bulk permitted values`, error, column, selectedGridCells);
|
|
211
|
+
}
|
|
212
|
+
distinctValuesParams.permittedValues = preparedPermittedValues;
|
|
213
|
+
return this.adaptable.getDistinctValuesForColumn(column, distinctValuesParams);
|
|
214
|
+
}
|
|
166
215
|
/**
|
|
167
216
|
* Gets all distinct visible (after current filters are applied) display values in the Column with the given ColumnId
|
|
168
217
|
* @param columnId Column to check
|
|
@@ -257,7 +306,7 @@ export class GridInternalApi extends ApiBase {
|
|
|
257
306
|
this.dispatchAction(GridRedux.GridSetSelectedRows(selectedRowInfo));
|
|
258
307
|
}
|
|
259
308
|
buildStandaloneColumnHeader(column) {
|
|
260
|
-
return this.adaptable.buildStandaloneColumnHeader(column);
|
|
309
|
+
return this.adaptable.agGridMenuAdapter.buildStandaloneColumnHeader(column);
|
|
261
310
|
}
|
|
262
311
|
getEditLookUpValuesForColumn(editLookUpItem, column, gridCell) {
|
|
263
312
|
if (!editLookUpItem || !column) {
|
|
@@ -285,4 +334,74 @@ export class GridInternalApi extends ApiBase {
|
|
|
285
334
|
// this will use the columnApi method that first looks for permitted values and then distinct values
|
|
286
335
|
return this.getDistinctDisplayValuesForColumn(column.columnId);
|
|
287
336
|
}
|
|
337
|
+
getAgGridDataType(dataType) {
|
|
338
|
+
if (!dataType) {
|
|
339
|
+
return 'abColDefString';
|
|
340
|
+
}
|
|
341
|
+
switch (dataType) {
|
|
342
|
+
case 'Boolean':
|
|
343
|
+
return 'abColDefBoolean';
|
|
344
|
+
case 'Date':
|
|
345
|
+
return 'abColDefDate';
|
|
346
|
+
case 'Number':
|
|
347
|
+
return 'abColDefNumber';
|
|
348
|
+
case 'Object':
|
|
349
|
+
return 'abColDefObject';
|
|
350
|
+
case 'String':
|
|
351
|
+
return 'abColDefString';
|
|
352
|
+
case 'NumberArray':
|
|
353
|
+
return 'abColDefNumberArray';
|
|
354
|
+
case 'TupleNumberArray':
|
|
355
|
+
return 'abColDefTupleNumberArray';
|
|
356
|
+
case 'ObjectNumberArray':
|
|
357
|
+
return 'abColDefObjectNumberArray';
|
|
358
|
+
default:
|
|
359
|
+
return 'abColDefCustom';
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
getRowHighlightStyle(params) {
|
|
363
|
+
var _a;
|
|
364
|
+
const primaryKeyValue = this.adaptable.getPrimaryKeyValueFromRowNode(params.node, params.api);
|
|
365
|
+
const highlightRow = (_a = this.getAdaptableApi()
|
|
366
|
+
.internalApi.getSystemState()
|
|
367
|
+
.HighlightedRows) === null || _a === void 0 ? void 0 : _a.find((highlightRow) => {
|
|
368
|
+
return highlightRow.primaryKeyValue === primaryKeyValue;
|
|
369
|
+
});
|
|
370
|
+
if (highlightRow) {
|
|
371
|
+
return convertAdaptableStyleToCSS(highlightRow.highlightStyle);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
getAlertRowStyle(params) {
|
|
375
|
+
var _a, _b;
|
|
376
|
+
const alert = this.getAlertApi().internalApi.getAdaptableAlertWithHighlightRow(params.node);
|
|
377
|
+
const highlightRow = (_b = (_a = alert === null || alert === void 0 ? void 0 : alert.alertDefinition) === null || _a === void 0 ? void 0 : _a.AlertProperties) === null || _b === void 0 ? void 0 : _b.HighlightRow;
|
|
378
|
+
if (highlightRow) {
|
|
379
|
+
return typeof highlightRow === 'object'
|
|
380
|
+
? convertAdaptableStyleToCSS(highlightRow)
|
|
381
|
+
: {
|
|
382
|
+
backgroundColor: UIHelper.getColorByMessageType(alert.alertDefinition.MessageType),
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
return null;
|
|
386
|
+
}
|
|
387
|
+
getAlertRowClass(params) {
|
|
388
|
+
var _a, _b;
|
|
389
|
+
const alert = this.getAlertApi().internalApi.getAdaptableAlertWithHighlightRow(params.node);
|
|
390
|
+
const highlightRow = (_b = (_a = alert === null || alert === void 0 ? void 0 : alert.alertDefinition) === null || _a === void 0 ? void 0 : _a.AlertProperties) === null || _b === void 0 ? void 0 : _b.HighlightRow;
|
|
391
|
+
return typeof highlightRow === 'object' && (highlightRow === null || highlightRow === void 0 ? void 0 : highlightRow.ClassName)
|
|
392
|
+
? highlightRow === null || highlightRow === void 0 ? void 0 : highlightRow.ClassName
|
|
393
|
+
: null;
|
|
394
|
+
}
|
|
395
|
+
getRowHighlightClass(params) {
|
|
396
|
+
var _a;
|
|
397
|
+
const primaryKeyValue = this.adaptable.getPrimaryKeyValueFromRowNode(params.node, params.api);
|
|
398
|
+
const highlightRow = (_a = this.getAdaptableApi()
|
|
399
|
+
.internalApi.getSystemState()
|
|
400
|
+
.HighlightedRows) === null || _a === void 0 ? void 0 : _a.find((highlightRow) => {
|
|
401
|
+
return highlightRow.primaryKeyValue === primaryKeyValue;
|
|
402
|
+
});
|
|
403
|
+
return typeof (highlightRow === null || highlightRow === void 0 ? void 0 : highlightRow.highlightStyle) === 'object'
|
|
404
|
+
? highlightRow.highlightStyle.ClassName
|
|
405
|
+
: null;
|
|
406
|
+
}
|
|
288
407
|
}
|
|
@@ -5,7 +5,7 @@ export class TeamSharingInternalApi extends ApiBase {
|
|
|
5
5
|
* @param sharedEntity Entity that has been changed
|
|
6
6
|
*/
|
|
7
7
|
fireTeamSharingEntityChangedEvent(sharedEntity) {
|
|
8
|
-
if (this.adaptable.
|
|
8
|
+
if (this.adaptable.isReady) {
|
|
9
9
|
const teamSharingEntityChangedInfo = {
|
|
10
10
|
adaptableApi: this.adaptable.api,
|
|
11
11
|
sharedEntity: sharedEntity,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { InteropioPluginOptions } from '../AdaptableOptions/InteropioPluginOptions';
|
|
2
2
|
/**
|
|
3
|
-
* Provides run-time access to the
|
|
3
|
+
* Provides run-time access to the Interopio Plugin
|
|
4
4
|
*/
|
|
5
5
|
export interface InteropioPluginApi {
|
|
6
6
|
/**
|
|
7
|
-
* Retrieves the
|
|
7
|
+
* Retrieves the InteropioPlugOptions provided in interopio Plugin
|
|
8
8
|
*/
|
|
9
9
|
getPluginOptions(): InteropioPluginOptions;
|
|
10
10
|
}
|
package/src/Api/LayoutApi.d.ts
CHANGED
|
@@ -174,4 +174,12 @@ export interface LayoutApi {
|
|
|
174
174
|
ColumnFilters: boolean;
|
|
175
175
|
ColumnSorts: boolean;
|
|
176
176
|
};
|
|
177
|
+
/**
|
|
178
|
+
* Opens a window with a transposed view of the grid
|
|
179
|
+
* it only works for client side data
|
|
180
|
+
*/
|
|
181
|
+
showTransposePopup(config: {
|
|
182
|
+
transposedColumnId: string;
|
|
183
|
+
hideTransposedColumn?: boolean;
|
|
184
|
+
}): void;
|
|
177
185
|
}
|
package/src/Api/OptionsApi.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { ActionColumnOptions, ActionRowOptions, AdaptableOptions, AlertOptions,
|
|
|
5
5
|
import { Fdc3Options } from '../AdaptableOptions/Fdc3Options';
|
|
6
6
|
import { ExpressionOptions } from '../AdaptableOptions/ExpressionOptions';
|
|
7
7
|
import { DataImportOptions } from '../AdaptableOptions/DataImportOptions';
|
|
8
|
-
import { CommentsOptions } from '../AdaptableOptions/
|
|
8
|
+
import { CommentsOptions } from '../AdaptableOptions/CommentOptions';
|
|
9
9
|
/**
|
|
10
10
|
* Range of functions to access Adaptable Options
|
|
11
11
|
*/
|
package/src/EnvVars.d.ts
ADDED
package/src/EnvVars.js
ADDED
|
@@ -16,3 +16,4 @@ export interface WeightedAverageAggregation {
|
|
|
16
16
|
* Defines which Columns in a Layout display Aggregated values when Row-Grouped
|
|
17
17
|
*/
|
|
18
18
|
export type AggregationColumns = Record<string, string | true | WeightedAverageAggregation>;
|
|
19
|
+
export declare const isWeightedAverageAggregation: (aggFunc: AggregationColumns[keyof AggregationColumns]) => aggFunc is WeightedAverageAggregation;
|