@adaptabletools/adaptable-cjs 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 +5 -21
- 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 +2 -6
- 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 +107 -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 +71 -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 +60 -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 +8 -0
- package/src/PredefinedConfig/Common/AggregationColumns.d.ts +1 -0
- package/src/PredefinedConfig/Common/AggregationColumns.js +5 -1
- 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 +10 -8
- 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 +3 -2
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +5 -4
- package/src/Utilities/Helpers/AdaptableHelper.d.ts +0 -3
- package/src/Utilities/Helpers/AdaptableHelper.js +1 -60
- package/src/Utilities/Helpers/Helper.d.ts +2 -0
- package/src/Utilities/Helpers/Helper.js +6 -1
- 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 +4 -1
- 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 +198 -0
- package/src/View/Layout/Wizard/LayoutWizard.js +1 -1
- package/src/View/Notes/NotesPopup.js +8 -10
- package/src/View/Theme/ThemeSelector.js +2 -2
- package/src/agGrid/ActionColumnRenderer.js +4 -4
- package/src/agGrid/Adaptable.d.ts +3 -455
- package/src/agGrid/Adaptable.js +7 -5291
- package/src/agGrid/AdaptableAgGrid.d.ts +336 -0
- package/src/agGrid/AdaptableAgGrid.js +3785 -0
- package/src/agGrid/AdaptableLogger.js +78 -13
- package/src/agGrid/AgGridAdapter.d.ts +54 -0
- package/src/agGrid/AgGridAdapter.js +554 -0
- package/src/agGrid/AgGridColumnAdapter.d.ts +56 -0
- package/src/agGrid/AgGridColumnAdapter.js +818 -0
- package/src/agGrid/AgGridMenuAdapter.d.ts +28 -0
- package/src/agGrid/AgGridMenuAdapter.js +276 -0
- package/src/agGrid/AgGridOptionsService.d.ts +11 -0
- package/src/agGrid/AgGridOptionsService.js +54 -0
- package/src/agGrid/BadgeRenderer.js +1 -1
- package/src/agGrid/CheckboxRenderer.js +1 -1
- package/src/agGrid/FilterWrapper.d.ts +2 -2
- package/src/agGrid/FilterWrapper.js +1 -1
- package/src/agGrid/attachAddaptableColumnTypes.d.ts +12 -12
- package/src/agGrid/defaultAdaptableOptions.d.ts +3 -0
- package/src/{Utilities/Defaults/DefaultAdaptableOptions.js → agGrid/defaultAdaptableOptions.js} +73 -10
- 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 +6 -4
- 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 +52 -0
- package/src/migration/VersionUpgrade.d.ts +8 -0
- package/src/migration/VersionUpgrade.js +15 -0
- package/src/migration/VersionUpgrade17.d.ts +18 -0
- package/src/migration/VersionUpgrade17.js +347 -0
- package/src/migration/VersionUpgrade18.d.ts +5 -0
- package/src/migration/VersionUpgrade18.js +10 -0
- package/src/types.d.ts +7 -3
- package/tsconfig.cjs.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 -2
- package/src/agGrid/agGridHelper.d.ts +0 -57
- package/src/agGrid/agGridHelper.js +0 -691
- package/src/agGrid/agGridMenuHelper.d.ts +0 -46
- package/src/agGrid/agGridMenuHelper.js +0 -673
- /package/src/AdaptableOptions/{CommentsOptions.js → CommentOptions.js} +0 -0
- /package/src/AdaptableOptions/{NotesOptions.js → NoteOptions.js} +0 -0
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CalculatedColumnInternalApi = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
4
5
|
const ApiBase_1 = require("../Implementation/ApiBase");
|
|
6
|
+
const ObjectFactory_1 = require("../../Utilities/ObjectFactory");
|
|
7
|
+
const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
|
|
8
|
+
const ArrayExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/ArrayExtensions"));
|
|
9
|
+
const StringExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/StringExtensions"));
|
|
5
10
|
class CalculatedColumnInternalApi extends ApiBase_1.ApiBase {
|
|
6
11
|
/**
|
|
7
12
|
* Returns all the references in the AdaptableState of the given CalculatedColumn
|
|
@@ -90,5 +95,71 @@ class CalculatedColumnInternalApi extends ApiBase_1.ApiBase {
|
|
|
90
95
|
};
|
|
91
96
|
this.adaptable.api.eventApi.emit('CalculatedColumnChanged', calculatedColumnChangedInfo);
|
|
92
97
|
}
|
|
98
|
+
getColDefsForCalculatedColumns() {
|
|
99
|
+
const defaultCalculatedColumnSettings = (0, ObjectFactory_1.CreateEmptyCalculatedColumn)().CalculatedColumnSettings;
|
|
100
|
+
return this.getCalculatedColumnApi()
|
|
101
|
+
.getCalculatedColumns()
|
|
102
|
+
.map((calculatedColumn) => {
|
|
103
|
+
const calculatedColumnSettings = Object.assign(Object.assign({}, defaultCalculatedColumnSettings), calculatedColumn.CalculatedColumnSettings);
|
|
104
|
+
if (!calculatedColumnSettings.DataType) {
|
|
105
|
+
calculatedColumnSettings.DataType = this.getAdaptableApi()
|
|
106
|
+
.internalApi.getAdaptableInstance()
|
|
107
|
+
.CalculatedColumnExpressionService.getCalculatedColumnDataType(calculatedColumn.Query);
|
|
108
|
+
}
|
|
109
|
+
const columnTypes = [
|
|
110
|
+
GeneralConstants_1.AB_SPECIAL_COLUMN,
|
|
111
|
+
this.getGridApi().internalApi.getAgGridDataType(calculatedColumnSettings.DataType),
|
|
112
|
+
];
|
|
113
|
+
if (ArrayExtensions_1.default.IsNotNullOrEmpty(calculatedColumnSettings.ColumnTypes)) {
|
|
114
|
+
columnTypes.push(...calculatedColumnSettings.ColumnTypes);
|
|
115
|
+
}
|
|
116
|
+
const isExternalEvaluation = !this.getExpressionApi().internalApi.evaluateExpressionInAdaptableQL('CalculatedColumn', calculatedColumn, this.getExpressionApi().getAdaptableQueryExpression(calculatedColumn.Query));
|
|
117
|
+
const valueGetter = (params) => {
|
|
118
|
+
var _a, _b;
|
|
119
|
+
if (isExternalEvaluation) {
|
|
120
|
+
return (_a = params.data) === null || _a === void 0 ? void 0 : _a[calculatedColumn.ColumnId];
|
|
121
|
+
}
|
|
122
|
+
// if the grid data is NOT client side, we can aggregate only simple scalar expression (which depend on row data, not on other rows)
|
|
123
|
+
if (this.getGridApi().getAgGridRowModelType() !== 'clientSide' &&
|
|
124
|
+
StringExtensions_1.default.IsNotNullOrEmpty(calculatedColumn.Query.AggregatedScalarExpression)) {
|
|
125
|
+
return (_b = params.data) === null || _b === void 0 ? void 0 : _b[calculatedColumn.ColumnId];
|
|
126
|
+
}
|
|
127
|
+
return this.getAdaptableApi()
|
|
128
|
+
.internalApi.getAdaptableInstance()
|
|
129
|
+
.CalculatedColumnExpressionService.evaluateCalculatedColumnQuery(calculatedColumn, params.node);
|
|
130
|
+
};
|
|
131
|
+
const newColDef = {
|
|
132
|
+
headerName: calculatedColumn.FriendlyName
|
|
133
|
+
? calculatedColumn.FriendlyName
|
|
134
|
+
: calculatedColumn.ColumnId,
|
|
135
|
+
colId: calculatedColumn.ColumnId,
|
|
136
|
+
hide: true,
|
|
137
|
+
editable: false,
|
|
138
|
+
width: calculatedColumnSettings.Width,
|
|
139
|
+
enableValue: calculatedColumnSettings.Aggregatable,
|
|
140
|
+
filter: calculatedColumnSettings.Filterable,
|
|
141
|
+
floatingFilter: calculatedColumnSettings.Filterable,
|
|
142
|
+
resizable: calculatedColumnSettings.Resizable,
|
|
143
|
+
enableRowGroup: calculatedColumnSettings.Groupable,
|
|
144
|
+
sortable: calculatedColumnSettings.Sortable,
|
|
145
|
+
enablePivot: calculatedColumnSettings.Pivotable,
|
|
146
|
+
suppressMenu: calculatedColumnSettings.SuppressMenu,
|
|
147
|
+
suppressMovable: calculatedColumnSettings.SuppressMovable,
|
|
148
|
+
type: columnTypes,
|
|
149
|
+
valueGetter,
|
|
150
|
+
};
|
|
151
|
+
if (calculatedColumnSettings.ShowToolTip != null &&
|
|
152
|
+
calculatedColumnSettings.ShowToolTip == true) {
|
|
153
|
+
newColDef.tooltipValueGetter = () => {
|
|
154
|
+
return this.getAdaptableApi().internalApi.getAdaptableQueryExpressionText(calculatedColumn.Query);
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
if (calculatedColumnSettings.HeaderToolTip) {
|
|
158
|
+
newColDef.headerTooltip = calculatedColumnSettings.HeaderToolTip;
|
|
159
|
+
}
|
|
160
|
+
this.getAdaptableApi().logInfo('Setting up Calculated Column: ' + calculatedColumn.ColumnId);
|
|
161
|
+
return newColDef;
|
|
162
|
+
});
|
|
163
|
+
}
|
|
93
164
|
}
|
|
94
165
|
exports.CalculatedColumnInternalApi = CalculatedColumnInternalApi;
|
|
@@ -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
|
}
|
|
@@ -175,7 +175,7 @@ class ColumnFilterInternalApi extends ApiBase_1.ApiBase {
|
|
|
175
175
|
* Fires Column Filter Applied Event - typically used to enable filtering on the server
|
|
176
176
|
*/
|
|
177
177
|
fireColumnFilterAppliedEvent() {
|
|
178
|
-
if (this.adaptable.
|
|
178
|
+
if (this.adaptable.isReady) {
|
|
179
179
|
const adaptableApi = this.getAdaptableApi();
|
|
180
180
|
const columnFilterAppliedInfo = {
|
|
181
181
|
columnFilters: this.getColumnFilterApi().getColumnFilters(),
|
|
@@ -206,5 +206,15 @@ class ColumnFilterInternalApi extends ApiBase_1.ApiBase {
|
|
|
206
206
|
}
|
|
207
207
|
return predicateShortcuts;
|
|
208
208
|
}
|
|
209
|
+
getFilterValuesMaxNumberOfItems(column) {
|
|
210
|
+
const maxFilterValues = this.getColumnFilterOptions().valuesFilterOptions.maxFilterValuesToDisplay;
|
|
211
|
+
if (typeof maxFilterValues === 'function') {
|
|
212
|
+
const columnFilterContext = Object.assign(Object.assign({}, this.getAdaptableApi().internalApi.buildBaseContext()), { column: column });
|
|
213
|
+
return maxFilterValues(columnFilterContext);
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
return maxFilterValues;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
209
219
|
}
|
|
210
220
|
exports.ColumnFilterInternalApi = ColumnFilterInternalApi;
|
|
@@ -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
|
}
|
|
@@ -42,5 +42,17 @@ class ColumnInternalApi extends ApiBase_1.ApiBase {
|
|
|
42
42
|
isActionRowButtonColumn(columnId) {
|
|
43
43
|
return columnId === GeneralConstants_1.ADAPTABLE_ROW_ACTION_BUTTONS;
|
|
44
44
|
}
|
|
45
|
+
getActiveColumnComparator(columnId, customSort, customSortComparer) {
|
|
46
|
+
if ((!customSort || (customSort === null || customSort === void 0 ? void 0 : customSort.IsSuspended)) && !customSortComparer) {
|
|
47
|
+
// defaults to AG-Grid column definition comparator if no CustomSort is defined&active
|
|
48
|
+
const colDefComparator = this.adaptable.agGridColumnAdapter.getUserColDefProperty(columnId, 'comparator');
|
|
49
|
+
return colDefComparator;
|
|
50
|
+
}
|
|
51
|
+
// CustomSort Comparer function takes precedence over CustomSort SortedValues
|
|
52
|
+
const comparerFunction = customSortComparer
|
|
53
|
+
? customSortComparer.comparer
|
|
54
|
+
: this.getCustomSortApi().internalApi.getDefaultCustomSortComparer(customSort.ColumnId, customSort.SortedValues);
|
|
55
|
+
return comparerFunction;
|
|
56
|
+
}
|
|
45
57
|
}
|
|
46
58
|
exports.ColumnInternalApi = ColumnInternalApi;
|
|
@@ -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
|
}
|
|
@@ -3,9 +3,40 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CustomSortInternalApi = void 0;
|
|
4
4
|
const ApiBase_1 = require("../Implementation/ApiBase");
|
|
5
5
|
class CustomSortInternalApi extends ApiBase_1.ApiBase {
|
|
6
|
-
getCustomSortComparer(
|
|
6
|
+
getCustomSortComparer(columnId) {
|
|
7
7
|
var _a;
|
|
8
|
+
const column = this.getColumnApi().getColumnWithColumnId(columnId);
|
|
8
9
|
return (_a = this.getCustomSortOptions().customSortComparers) === null || _a === void 0 ? void 0 : _a.find((csc) => this.adaptable.api.scopeApi.isColumnInScope(column, csc.scope));
|
|
9
10
|
}
|
|
11
|
+
getDefaultCustomSortComparer(columnId, columnValues) {
|
|
12
|
+
// have to return a function that may not have access to this
|
|
13
|
+
const adaptable = this.adaptable;
|
|
14
|
+
return function compareItemsOfCustomSort(valueA, valueB, nodeA, nodeB) {
|
|
15
|
+
var _a, _b;
|
|
16
|
+
let firstElementValueString = (_a = (nodeA && adaptable.getDisplayValueFromRowNode(nodeA, columnId))) !== null && _a !== void 0 ? _a : valueA;
|
|
17
|
+
let secondElementValueString = (_b = (nodeB && adaptable.getDisplayValueFromRowNode(nodeB, columnId))) !== null && _b !== void 0 ? _b : valueB;
|
|
18
|
+
let indexFirstElement = columnValues.indexOf(firstElementValueString);
|
|
19
|
+
let containsFirstElement = indexFirstElement >= 0;
|
|
20
|
+
let indexSecondElement = columnValues.indexOf(secondElementValueString);
|
|
21
|
+
let containsSecondElement = indexSecondElement >= 0;
|
|
22
|
+
//if none of the element are in the list we jsut return normal compare
|
|
23
|
+
if (!containsFirstElement && !containsSecondElement) {
|
|
24
|
+
if (valueA == valueB) {
|
|
25
|
+
return 0;
|
|
26
|
+
}
|
|
27
|
+
return valueA < valueB ? -1 : 1;
|
|
28
|
+
}
|
|
29
|
+
//if first item not in the list make sure we put it after the second item
|
|
30
|
+
if (!containsFirstElement) {
|
|
31
|
+
return 1;
|
|
32
|
+
}
|
|
33
|
+
//if second item not in the list make sure we put it after the first item
|
|
34
|
+
if (!containsSecondElement) {
|
|
35
|
+
return -1;
|
|
36
|
+
}
|
|
37
|
+
//return the comparison from the list if the two items are in the list
|
|
38
|
+
return indexFirstElement - indexSecondElement;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
10
41
|
}
|
|
11
42
|
exports.CustomSortInternalApi = CustomSortInternalApi;
|
|
@@ -8,7 +8,7 @@ class DataSetInternalApi extends ApiBase_1.ApiBase {
|
|
|
8
8
|
* @param dataSet Data Set which has been selected
|
|
9
9
|
*/
|
|
10
10
|
fireDataSetSelectedEvent(dataSet) {
|
|
11
|
-
if (this.adaptable.
|
|
11
|
+
if (this.adaptable.isReady) {
|
|
12
12
|
const dataSetSelectedInfo = {
|
|
13
13
|
adaptableApi: this.adaptable.api,
|
|
14
14
|
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,7 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FreeTextColumnInternalApi = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
4
5
|
const ApiBase_1 = require("../Implementation/ApiBase");
|
|
6
|
+
const ObjectFactory_1 = require("../../Utilities/ObjectFactory");
|
|
7
|
+
const AdaptableNumberEditor_1 = require("../../agGrid/editors/AdaptableNumberEditor");
|
|
8
|
+
const AdaptableDateEditor_1 = require("../../agGrid/editors/AdaptableDateEditor");
|
|
9
|
+
const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
|
|
10
|
+
const ArrayExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/ArrayExtensions"));
|
|
5
11
|
class FreeTextColumnInternalApi extends ApiBase_1.ApiBase {
|
|
6
12
|
/**
|
|
7
13
|
* Checks if a User Edit was in a Free Text Column
|
|
@@ -40,5 +46,59 @@ class FreeTextColumnInternalApi extends ApiBase_1.ApiBase {
|
|
|
40
46
|
});
|
|
41
47
|
return references;
|
|
42
48
|
}
|
|
49
|
+
getColDefsForFreeTextColumns() {
|
|
50
|
+
const defaultFreeTextColumnSettings = (0, ObjectFactory_1.CreateEmptyFreeTextColumn)().FreeTextColumnSettings;
|
|
51
|
+
return this.getFreeTextColumnApi()
|
|
52
|
+
.getFreeTextColumns()
|
|
53
|
+
.map((freeTextColumn) => {
|
|
54
|
+
var _a;
|
|
55
|
+
const freeTextColumnSettings = Object.assign(Object.assign({}, defaultFreeTextColumnSettings), freeTextColumn.FreeTextColumnSettings);
|
|
56
|
+
const dataTypeEditor = freeTextColumnSettings.DataType === 'Number'
|
|
57
|
+
? AdaptableNumberEditor_1.AdaptableNumberEditor
|
|
58
|
+
: freeTextColumnSettings.DataType === 'Date'
|
|
59
|
+
? AdaptableDateEditor_1.AdaptableDateEditor
|
|
60
|
+
: null;
|
|
61
|
+
const columnTypes = [
|
|
62
|
+
GeneralConstants_1.AB_SPECIAL_COLUMN,
|
|
63
|
+
this.getGridApi().internalApi.getAgGridDataType(freeTextColumnSettings.DataType),
|
|
64
|
+
];
|
|
65
|
+
if (ArrayExtensions_1.default.IsNotNullOrEmpty((_a = freeTextColumn === null || freeTextColumn === void 0 ? void 0 : freeTextColumn.FreeTextColumnSettings) === null || _a === void 0 ? void 0 : _a.ColumnTypes)) {
|
|
66
|
+
columnTypes.push(...freeTextColumn.FreeTextColumnSettings.ColumnTypes);
|
|
67
|
+
}
|
|
68
|
+
const newColDef = {
|
|
69
|
+
headerName: freeTextColumn.FriendlyName || freeTextColumn.ColumnId,
|
|
70
|
+
colId: freeTextColumn.ColumnId,
|
|
71
|
+
editable: true,
|
|
72
|
+
hide: true,
|
|
73
|
+
width: freeTextColumnSettings.Width,
|
|
74
|
+
enableValue: freeTextColumnSettings.Aggregatable,
|
|
75
|
+
filter: freeTextColumnSettings.Filterable,
|
|
76
|
+
floatingFilter: freeTextColumnSettings.Filterable,
|
|
77
|
+
resizable: freeTextColumnSettings.Resizable,
|
|
78
|
+
enableRowGroup: freeTextColumnSettings.Groupable,
|
|
79
|
+
sortable: freeTextColumnSettings.Sortable,
|
|
80
|
+
enablePivot: freeTextColumnSettings.Pivotable,
|
|
81
|
+
suppressMenu: freeTextColumnSettings.SuppressMenu,
|
|
82
|
+
suppressMovable: freeTextColumnSettings.SuppressMovable,
|
|
83
|
+
cellEditor: dataTypeEditor !== null && dataTypeEditor !== void 0 ? dataTypeEditor : (freeTextColumn.TextEditor && freeTextColumn.TextEditor == 'Large'
|
|
84
|
+
? 'agLargeTextCellEditor'
|
|
85
|
+
: 'agTextCellEditor'),
|
|
86
|
+
type: columnTypes,
|
|
87
|
+
valueSetter: (params) => {
|
|
88
|
+
return (params.data[freeTextColumn.ColumnId] = params.newValue);
|
|
89
|
+
},
|
|
90
|
+
// use a Boolean Cell Data Type if the Free Text Column is boolean
|
|
91
|
+
cellDataType: freeTextColumnSettings.DataType && freeTextColumnSettings.DataType == 'Boolean'
|
|
92
|
+
? 'boolean'
|
|
93
|
+
: undefined,
|
|
94
|
+
valueGetter: (params) => this.getFreeTextColumnApi().getFreeTextColumnValueForRowNode(freeTextColumn, params.node),
|
|
95
|
+
};
|
|
96
|
+
if (freeTextColumnSettings.HeaderToolTip) {
|
|
97
|
+
newColDef.headerTooltip = freeTextColumnSettings.HeaderToolTip;
|
|
98
|
+
}
|
|
99
|
+
this.getAdaptableApi().logInfo('Setting up FreeText Column: ' + freeTextColumn.ColumnId);
|
|
100
|
+
return newColDef;
|
|
101
|
+
});
|
|
102
|
+
}
|
|
43
103
|
}
|
|
44
104
|
exports.FreeTextColumnInternalApi = FreeTextColumnInternalApi;
|
|
@@ -4,7 +4,7 @@ exports.GridFilterInternalApi = void 0;
|
|
|
4
4
|
const ApiBase_1 = require("../Implementation/ApiBase");
|
|
5
5
|
class GridFilterInternalApi extends ApiBase_1.ApiBase {
|
|
6
6
|
fireGridFilterAppliedEvent() {
|
|
7
|
-
if (this.adaptable.
|
|
7
|
+
if (this.adaptable.isReady) {
|
|
8
8
|
const currentGridFilter = this.getGridFilterApi().getCurrentGridFilter();
|
|
9
9
|
const adaptableApi = this.getAdaptableApi();
|
|
10
10
|
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
|
}
|
|
@@ -7,12 +7,15 @@ const Enums_1 = require("../../PredefinedConfig/Common/Enums");
|
|
|
7
7
|
const ArrayExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/ArrayExtensions"));
|
|
8
8
|
const GridRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/GridRedux"));
|
|
9
9
|
const NumberExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/NumberExtensions"));
|
|
10
|
+
const StyleHelper_1 = require("../../Utilities/Helpers/StyleHelper");
|
|
11
|
+
const UIHelper_1 = tslib_1.__importDefault(require("../../View/UIHelper"));
|
|
12
|
+
const ObjectFactory_1 = require("../../Utilities/ObjectFactory");
|
|
10
13
|
class GridInternalApi extends ApiBase_1.ApiBase {
|
|
11
14
|
/**
|
|
12
15
|
* Fires Grid Sorted Event
|
|
13
16
|
*/
|
|
14
17
|
fireGridSortedEvent() {
|
|
15
|
-
if (this.adaptable.
|
|
18
|
+
if (this.adaptable.isReady) {
|
|
16
19
|
const adaptableSortState = this.adaptable.api.configApi.getAdaptableSortState();
|
|
17
20
|
const adaptableApi = this.getAdaptableApi();
|
|
18
21
|
const gridSortedInfo = {
|
|
@@ -28,7 +31,7 @@ class GridInternalApi extends ApiBase_1.ApiBase {
|
|
|
28
31
|
* Fires Cell Changed Changed Event - when any data in AG Grid's dataset has changed
|
|
29
32
|
*/
|
|
30
33
|
fireCellChangedEvent(cellDataChangedInfo) {
|
|
31
|
-
if (this.adaptable.
|
|
34
|
+
if (this.adaptable.isReady) {
|
|
32
35
|
const cellChangedInfo = {
|
|
33
36
|
adaptableApi: this.adaptable.api,
|
|
34
37
|
cellChange: cellDataChangedInfo,
|
|
@@ -42,7 +45,7 @@ class GridInternalApi extends ApiBase_1.ApiBase {
|
|
|
42
45
|
* Fires Grid Data Changed Event - when a row has changed in AG Grid
|
|
43
46
|
*/
|
|
44
47
|
fireGridDataChangedEvent(dataRows, rowNodes, rowTrigger) {
|
|
45
|
-
if (this.adaptable.
|
|
48
|
+
if (this.adaptable.isReady) {
|
|
46
49
|
const gridDataChangedInfo = {
|
|
47
50
|
changedAt: Date.now(),
|
|
48
51
|
adaptableApi: this.adaptable.api,
|
|
@@ -92,7 +95,7 @@ class GridInternalApi extends ApiBase_1.ApiBase {
|
|
|
92
95
|
const distinctValuesParams = {
|
|
93
96
|
visibleRowsOnly: showFilteredRowsOnly,
|
|
94
97
|
};
|
|
95
|
-
const { gridCells, suppressClientSideFilter } = await this.
|
|
98
|
+
const { gridCells, suppressClientSideFilter } = await this.getDistinctFilterListValuesForColumn(abColumn, filter, distinctValuesParams);
|
|
96
99
|
const sortedDistinctValues = this.sortDistinctValues(gridCells, abColumn);
|
|
97
100
|
let shouldShowValuesCount = false;
|
|
98
101
|
const showValuesCountFunction = this.getColumnFilterOptions().valuesFilterOptions.showValuesCount;
|
|
@@ -132,6 +135,26 @@ class GridInternalApi extends ApiBase_1.ApiBase {
|
|
|
132
135
|
suppressClientSideFilter,
|
|
133
136
|
};
|
|
134
137
|
}
|
|
138
|
+
async getDistinctFilterListValuesForColumn(column, filter, distinctValuesParams) {
|
|
139
|
+
var _a;
|
|
140
|
+
const filterPermittedValues = (_a = this.getUserInterfaceApi().getFilterPermittedValuesForColumn(column)) !== null && _a !== void 0 ? _a : {
|
|
141
|
+
suppressFilterSearchBar: false,
|
|
142
|
+
values: () => undefined,
|
|
143
|
+
};
|
|
144
|
+
let preparedPermittedValues = undefined;
|
|
145
|
+
try {
|
|
146
|
+
const filterPermittedValuesParams = Object.assign(Object.assign({}, (0, ObjectFactory_1.createBaseContext)(this.adaptable.api)), { column: column, searchFilter: filter });
|
|
147
|
+
preparedPermittedValues = await (filterPermittedValues === null || filterPermittedValues === void 0 ? void 0 : filterPermittedValues.values(filterPermittedValuesParams));
|
|
148
|
+
}
|
|
149
|
+
catch (error) {
|
|
150
|
+
this.adaptable.logger.consoleError(`Failed to load filter permitted values`, column, filter, error);
|
|
151
|
+
}
|
|
152
|
+
distinctValuesParams.permittedValues = preparedPermittedValues;
|
|
153
|
+
return {
|
|
154
|
+
suppressClientSideFilter: filterPermittedValues.suppressFilterSearchBar,
|
|
155
|
+
gridCells: this.adaptable.getDistinctValuesForColumn(column, distinctValuesParams),
|
|
156
|
+
};
|
|
157
|
+
}
|
|
135
158
|
/**
|
|
136
159
|
* Gets all distinct Custom Sort values for the Column with the given ColumnId
|
|
137
160
|
* @param columnId Column to check
|
|
@@ -144,11 +167,24 @@ class GridInternalApi extends ApiBase_1.ApiBase {
|
|
|
144
167
|
const distinctValuesParams = {
|
|
145
168
|
visibleRowsOnly: false,
|
|
146
169
|
};
|
|
147
|
-
const gridCells = await this.
|
|
170
|
+
const gridCells = await this.getDistinctCustomSortValuesForColumn(abColumn, distinctValuesParams);
|
|
148
171
|
return this.sortDistinctValues(gridCells, abColumn).map((cv) => {
|
|
149
172
|
return cv.normalisedValue;
|
|
150
173
|
});
|
|
151
174
|
}
|
|
175
|
+
async getDistinctCustomSortValuesForColumn(column, distinctValuesParams) {
|
|
176
|
+
const customSortPermittedValues = await this.getUserInterfaceApi().getCustomSortPermittedValuesForColumn(column);
|
|
177
|
+
let preparedPermittedValues = undefined;
|
|
178
|
+
try {
|
|
179
|
+
const permittedValuesParams = Object.assign(Object.assign({}, (0, ObjectFactory_1.createBaseContext)(this.adaptable.api)), { column: column });
|
|
180
|
+
preparedPermittedValues = await (customSortPermittedValues === null || customSortPermittedValues === void 0 ? void 0 : customSortPermittedValues.values(permittedValuesParams));
|
|
181
|
+
}
|
|
182
|
+
catch (error) {
|
|
183
|
+
this.adaptable.logger.consoleError(`Failed to load custom sort permitted values`, column, error);
|
|
184
|
+
}
|
|
185
|
+
distinctValuesParams.permittedValues = preparedPermittedValues;
|
|
186
|
+
return this.adaptable.getDistinctValuesForColumn(column, distinctValuesParams);
|
|
187
|
+
}
|
|
152
188
|
/**
|
|
153
189
|
* Gets all distinct Bulk Update values for the Column with the given ColumnId
|
|
154
190
|
* @param columnId Column to check
|
|
@@ -162,11 +198,24 @@ class GridInternalApi extends ApiBase_1.ApiBase {
|
|
|
162
198
|
const distinctValuesParams = {
|
|
163
199
|
visibleRowsOnly: false,
|
|
164
200
|
};
|
|
165
|
-
const gridCells = await this.
|
|
201
|
+
const gridCells = await this.getDistinctBulkUpdateValuesForColumn(abColumn, selectedGridCells, distinctValuesParams);
|
|
166
202
|
return this.sortDistinctValues(gridCells, abColumn).map((cv) => {
|
|
167
203
|
return cv.normalisedValue;
|
|
168
204
|
});
|
|
169
205
|
}
|
|
206
|
+
async getDistinctBulkUpdateValuesForColumn(column, selectedGridCells, distinctValuesParams) {
|
|
207
|
+
const bulkUpdatePermittedValues = await this.getUserInterfaceApi().getBulkUpdatePermittedValuesForColumn(column);
|
|
208
|
+
let preparedPermittedValues = undefined;
|
|
209
|
+
try {
|
|
210
|
+
const bulkUpdatePermittedValuesParams = Object.assign(Object.assign({}, (0, ObjectFactory_1.createBaseContext)(this.adaptable.api)), { column: column, gridCells: selectedGridCells });
|
|
211
|
+
preparedPermittedValues = await (bulkUpdatePermittedValues === null || bulkUpdatePermittedValues === void 0 ? void 0 : bulkUpdatePermittedValues.values(bulkUpdatePermittedValuesParams));
|
|
212
|
+
}
|
|
213
|
+
catch (error) {
|
|
214
|
+
this.adaptable.logger.consoleError(`Failed to load bulk permitted values`, error, column, selectedGridCells);
|
|
215
|
+
}
|
|
216
|
+
distinctValuesParams.permittedValues = preparedPermittedValues;
|
|
217
|
+
return this.adaptable.getDistinctValuesForColumn(column, distinctValuesParams);
|
|
218
|
+
}
|
|
170
219
|
/**
|
|
171
220
|
* Gets all distinct visible (after current filters are applied) display values in the Column with the given ColumnId
|
|
172
221
|
* @param columnId Column to check
|
|
@@ -261,7 +310,7 @@ class GridInternalApi extends ApiBase_1.ApiBase {
|
|
|
261
310
|
this.dispatchAction(GridRedux.GridSetSelectedRows(selectedRowInfo));
|
|
262
311
|
}
|
|
263
312
|
buildStandaloneColumnHeader(column) {
|
|
264
|
-
return this.adaptable.buildStandaloneColumnHeader(column);
|
|
313
|
+
return this.adaptable.agGridMenuAdapter.buildStandaloneColumnHeader(column);
|
|
265
314
|
}
|
|
266
315
|
getEditLookUpValuesForColumn(editLookUpItem, column, gridCell) {
|
|
267
316
|
if (!editLookUpItem || !column) {
|
|
@@ -289,5 +338,75 @@ class GridInternalApi extends ApiBase_1.ApiBase {
|
|
|
289
338
|
// this will use the columnApi method that first looks for permitted values and then distinct values
|
|
290
339
|
return this.getDistinctDisplayValuesForColumn(column.columnId);
|
|
291
340
|
}
|
|
341
|
+
getAgGridDataType(dataType) {
|
|
342
|
+
if (!dataType) {
|
|
343
|
+
return 'abColDefString';
|
|
344
|
+
}
|
|
345
|
+
switch (dataType) {
|
|
346
|
+
case 'Boolean':
|
|
347
|
+
return 'abColDefBoolean';
|
|
348
|
+
case 'Date':
|
|
349
|
+
return 'abColDefDate';
|
|
350
|
+
case 'Number':
|
|
351
|
+
return 'abColDefNumber';
|
|
352
|
+
case 'Object':
|
|
353
|
+
return 'abColDefObject';
|
|
354
|
+
case 'String':
|
|
355
|
+
return 'abColDefString';
|
|
356
|
+
case 'NumberArray':
|
|
357
|
+
return 'abColDefNumberArray';
|
|
358
|
+
case 'TupleNumberArray':
|
|
359
|
+
return 'abColDefTupleNumberArray';
|
|
360
|
+
case 'ObjectNumberArray':
|
|
361
|
+
return 'abColDefObjectNumberArray';
|
|
362
|
+
default:
|
|
363
|
+
return 'abColDefCustom';
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
getRowHighlightStyle(params) {
|
|
367
|
+
var _a;
|
|
368
|
+
const primaryKeyValue = this.adaptable.getPrimaryKeyValueFromRowNode(params.node, params.api);
|
|
369
|
+
const highlightRow = (_a = this.getAdaptableApi()
|
|
370
|
+
.internalApi.getSystemState()
|
|
371
|
+
.HighlightedRows) === null || _a === void 0 ? void 0 : _a.find((highlightRow) => {
|
|
372
|
+
return highlightRow.primaryKeyValue === primaryKeyValue;
|
|
373
|
+
});
|
|
374
|
+
if (highlightRow) {
|
|
375
|
+
return (0, StyleHelper_1.convertAdaptableStyleToCSS)(highlightRow.highlightStyle);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
getAlertRowStyle(params) {
|
|
379
|
+
var _a, _b;
|
|
380
|
+
const alert = this.getAlertApi().internalApi.getAdaptableAlertWithHighlightRow(params.node);
|
|
381
|
+
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;
|
|
382
|
+
if (highlightRow) {
|
|
383
|
+
return typeof highlightRow === 'object'
|
|
384
|
+
? (0, StyleHelper_1.convertAdaptableStyleToCSS)(highlightRow)
|
|
385
|
+
: {
|
|
386
|
+
backgroundColor: UIHelper_1.default.getColorByMessageType(alert.alertDefinition.MessageType),
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
return null;
|
|
390
|
+
}
|
|
391
|
+
getAlertRowClass(params) {
|
|
392
|
+
var _a, _b;
|
|
393
|
+
const alert = this.getAlertApi().internalApi.getAdaptableAlertWithHighlightRow(params.node);
|
|
394
|
+
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;
|
|
395
|
+
return typeof highlightRow === 'object' && (highlightRow === null || highlightRow === void 0 ? void 0 : highlightRow.ClassName)
|
|
396
|
+
? highlightRow === null || highlightRow === void 0 ? void 0 : highlightRow.ClassName
|
|
397
|
+
: null;
|
|
398
|
+
}
|
|
399
|
+
getRowHighlightClass(params) {
|
|
400
|
+
var _a;
|
|
401
|
+
const primaryKeyValue = this.adaptable.getPrimaryKeyValueFromRowNode(params.node, params.api);
|
|
402
|
+
const highlightRow = (_a = this.getAdaptableApi()
|
|
403
|
+
.internalApi.getSystemState()
|
|
404
|
+
.HighlightedRows) === null || _a === void 0 ? void 0 : _a.find((highlightRow) => {
|
|
405
|
+
return highlightRow.primaryKeyValue === primaryKeyValue;
|
|
406
|
+
});
|
|
407
|
+
return typeof (highlightRow === null || highlightRow === void 0 ? void 0 : highlightRow.highlightStyle) === 'object'
|
|
408
|
+
? highlightRow.highlightStyle.ClassName
|
|
409
|
+
: null;
|
|
410
|
+
}
|
|
292
411
|
}
|
|
293
412
|
exports.GridInternalApi = GridInternalApi;
|
|
@@ -8,7 +8,7 @@ class TeamSharingInternalApi extends ApiBase_1.ApiBase {
|
|
|
8
8
|
* @param sharedEntity Entity that has been changed
|
|
9
9
|
*/
|
|
10
10
|
fireTeamSharingEntityChangedEvent(sharedEntity) {
|
|
11
|
-
if (this.adaptable.
|
|
11
|
+
if (this.adaptable.isReady) {
|
|
12
12
|
const teamSharingEntityChangedInfo = {
|
|
13
13
|
adaptableApi: this.adaptable.api,
|
|
14
14
|
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
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.INFINITE_TABLE_LICENSE_KEY = exports.ADAPTABLE_PUBLISH_TIMESTAMP = exports.ADAPTABLE_VERSION = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const env_1 = tslib_1.__importDefault(require("./env"));
|
|
6
|
+
exports.ADAPTABLE_VERSION = env_1.default.VERSION;
|
|
7
|
+
exports.ADAPTABLE_PUBLISH_TIMESTAMP = env_1.default.PUBLISH_TIMESTAMP;
|
|
8
|
+
exports.INFINITE_TABLE_LICENSE_KEY = env_1.default.INFINITE_TABLE_LICENSE_KEY;
|