@adaptabletools/adaptable 18.0.0-canary.1 → 18.0.0-canary.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agGrid.d.ts +4 -21
- package/agGrid.js +9 -26
- package/base.css +11 -3
- package/base.css.map +1 -1
- package/index.css +88 -70
- package/index.css.map +1 -1
- package/package.json +4 -5
- package/src/AdaptableInterfaces/IAdaptable.d.ts +61 -108
- package/src/AdaptableOptions/AdaptableOptions.d.ts +12 -6
- package/src/AdaptableOptions/ColumnFilterOptions.d.ts +4 -4
- package/src/AdaptableOptions/ColumnOptions.d.ts +4 -2
- package/src/AdaptableOptions/{CommentsOptions.d.ts → CommentOptions.d.ts} +5 -5
- package/src/AdaptableOptions/MenuOptions.d.ts +1 -1
- package/src/AdaptableOptions/MenuOptions.js +1 -5
- package/src/AdaptableOptions/{NotesOptions.d.ts → NoteOptions.d.ts} +1 -1
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +17 -0
- package/src/Api/AdaptableApi.d.ts +5 -0
- package/src/Api/BulkUpdateApi.d.ts +0 -5
- package/src/Api/ConfigApi.d.ts +1 -1
- package/src/Api/Events/AdaptableReady.d.ts +3 -3
- package/src/Api/Events/GridDataChanged.d.ts +4 -4
- package/src/Api/GridApi.d.ts +18 -13
- package/src/Api/Implementation/ActionColumnApiImpl.d.ts +2 -0
- package/src/Api/Implementation/ActionColumnApiImpl.js +33 -0
- package/src/Api/Implementation/AdaptableApiImpl.d.ts +1 -0
- package/src/Api/Implementation/AdaptableApiImpl.js +3 -0
- package/src/Api/Implementation/ApiBase.d.ts +2 -1
- package/src/Api/Implementation/ApiBase.js +4 -1
- package/src/Api/Implementation/BulkUpdateApiImpl.d.ts +0 -1
- package/src/Api/Implementation/BulkUpdateApiImpl.js +0 -4
- package/src/Api/Implementation/CommentsApiImpl.d.ts +4 -0
- package/src/Api/Implementation/CommentsApiImpl.js +7 -1
- package/src/Api/Implementation/ConfigApiImpl.js +13 -5
- package/src/Api/Implementation/GridApiImpl.d.ts +4 -3
- package/src/Api/Implementation/GridApiImpl.js +33 -14
- package/src/Api/Implementation/LayoutApiImpl.d.ts +2 -0
- package/src/Api/Implementation/LayoutApiImpl.js +15 -0
- package/src/Api/Implementation/NotesApiImpl.d.ts +6 -4
- package/src/Api/Implementation/NotesApiImpl.js +9 -8
- package/src/Api/Implementation/OptionsApiImpl.d.ts +2 -1
- package/src/Api/Implementation/OptionsApiImpl.js +12 -2
- package/src/Api/Implementation/ScopeApiImpl.d.ts +2 -0
- package/src/Api/Implementation/ScopeApiImpl.js +20 -7
- package/src/Api/Implementation/StatusBarApiImpl.d.ts +0 -1
- package/src/Api/Implementation/StatusBarApiImpl.js +0 -3
- package/src/Api/Implementation/ToolPanelApiImpl.js +6 -6
- package/src/Api/Internal/ActionRowInternalApi.d.ts +5 -1
- package/src/Api/Internal/ActionRowInternalApi.js +106 -0
- package/src/Api/Internal/AdaptableInternalApi.d.ts +3 -4
- package/src/Api/Internal/AdaptableInternalApi.js +10 -8
- package/src/Api/Internal/CalculatedColumnInternalApi.d.ts +2 -0
- package/src/Api/Internal/CalculatedColumnInternalApi.js +70 -0
- package/src/Api/Internal/ColumnFilterInternalApi.d.ts +1 -0
- package/src/Api/Internal/ColumnFilterInternalApi.js +11 -1
- package/src/Api/Internal/ColumnInternalApi.d.ts +4 -1
- package/src/Api/Internal/ColumnInternalApi.js +12 -0
- package/src/Api/Internal/CommentsInternalApi.d.ts +4 -0
- package/src/Api/Internal/CommentsInternalApi.js +14 -0
- package/src/Api/Internal/CustomSortInternalApi.d.ts +3 -2
- package/src/Api/Internal/CustomSortInternalApi.js +32 -1
- package/src/Api/Internal/DataSetInternalApi.js +1 -1
- package/src/Api/Internal/FormatColumnInternalApi.js +3 -2
- package/src/Api/Internal/FreeTextColumnInternalApi.d.ts +2 -0
- package/src/Api/Internal/FreeTextColumnInternalApi.js +59 -0
- package/src/Api/Internal/GridFilterInternalApi.js +1 -1
- package/src/Api/Internal/GridInternalApi.d.ts +21 -3
- package/src/Api/Internal/GridInternalApi.js +126 -7
- package/src/Api/Internal/NotesInternalApi.d.ts +4 -0
- package/src/Api/Internal/NotesInternalApi.js +14 -0
- package/src/Api/Internal/TeamSharingInternalApi.js +1 -1
- package/src/Api/InteropioPluginApi.d.ts +2 -2
- package/src/Api/LayoutApi.d.ts +11 -0
- package/src/Api/OptionsApi.d.ts +5 -1
- package/src/Api/ScopeApi.d.ts +10 -0
- package/src/EnvVars.d.ts +3 -0
- package/src/EnvVars.js +4 -0
- package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +4 -0
- package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptableScope.d.ts +4 -1
- package/src/PredefinedConfig/Common/AggregationColumns.d.ts +1 -0
- package/src/PredefinedConfig/Common/AggregationColumns.js +3 -0
- package/src/PredefinedConfig/Common/DataUpdateConfig.d.ts +8 -0
- package/src/PredefinedConfig/Common/RowSummary.d.ts +7 -0
- package/src/PredefinedConfig/Common/RowSummary.js +1 -0
- package/src/PredefinedConfig/LayoutState.d.ts +5 -0
- package/src/PredefinedConfig/NotesState.d.ts +10 -20
- package/src/PredefinedConfig/PredefinedConfig.d.ts +1 -1
- package/src/PredefinedConfig/SystemState.d.ts +7 -0
- package/src/Redux/ActionsReducers/LayoutRedux.d.ts +9 -0
- package/src/Redux/ActionsReducers/LayoutRedux.js +20 -0
- package/src/Redux/ActionsReducers/NotesRedux.d.ts +3 -4
- package/src/Redux/ActionsReducers/NotesRedux.js +8 -7
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +5 -0
- package/src/Redux/ActionsReducers/SystemRedux.js +13 -1
- package/src/Redux/Store/AdaptableStore.d.ts +4 -6
- package/src/Redux/Store/AdaptableStore.js +33 -50
- package/src/Redux/Store/Interface/IAdaptableStore.d.ts +8 -2
- package/src/Strategy/AdaptableModuleBase.d.ts +2 -3
- package/src/Strategy/AdaptableModuleBase.js +4 -7
- package/src/Strategy/AlertModule.d.ts +1 -2
- package/src/Strategy/AlertModule.js +2 -55
- package/src/Strategy/CalculatedColumnModule.d.ts +2 -3
- package/src/Strategy/CalculatedColumnModule.js +5 -25
- package/src/Strategy/CellSummaryModule.d.ts +1 -0
- package/src/Strategy/CellSummaryModule.js +50 -21
- package/src/Strategy/ChartingModule.d.ts +0 -1
- package/src/Strategy/ChartingModule.js +2 -22
- package/src/Strategy/ColumnFilterModule.d.ts +1 -2
- package/src/Strategy/ColumnFilterModule.js +1 -64
- package/src/Strategy/CommentsModule.d.ts +1 -0
- package/src/Strategy/CommentsModule.js +5 -1
- package/src/Strategy/CustomSortModule.js +1 -1
- package/src/Strategy/DashboardModule.d.ts +1 -2
- package/src/Strategy/DashboardModule.js +1 -8
- package/src/Strategy/DataChangeHistoryModule.d.ts +1 -0
- package/src/Strategy/DataChangeHistoryModule.js +3 -1
- package/src/Strategy/DataSetModule.d.ts +1 -1
- package/src/Strategy/DataSetModule.js +1 -1
- package/src/Strategy/FlashingCellModule.d.ts +1 -2
- package/src/Strategy/FlashingCellModule.js +2 -15
- package/src/Strategy/FormatColumnModule.d.ts +0 -2
- package/src/Strategy/FormatColumnModule.js +0 -47
- package/src/Strategy/FreeTextColumnModule.d.ts +0 -1
- package/src/Strategy/FreeTextColumnModule.js +0 -30
- package/src/Strategy/GridFilterModule.d.ts +0 -1
- package/src/Strategy/GridFilterModule.js +0 -37
- package/src/Strategy/Interface/IModule.d.ts +0 -1
- package/src/Strategy/LayoutModule.d.ts +8 -3
- package/src/Strategy/LayoutModule.js +108 -53
- package/src/Strategy/NamedQueryModule.d.ts +0 -1
- package/src/Strategy/NamedQueryModule.js +0 -19
- package/src/Strategy/NotesModule.js +3 -4
- package/src/Strategy/PlusMinusModule.d.ts +1 -1
- package/src/Strategy/PlusMinusModule.js +1 -1
- package/src/Strategy/ScheduleModule.d.ts +1 -1
- package/src/Strategy/ScheduleModule.js +1 -1
- package/src/Strategy/ShortcutModule.d.ts +1 -1
- package/src/Strategy/ShortcutModule.js +1 -1
- package/src/Strategy/StyledColumnModule.d.ts +0 -1
- package/src/Strategy/StyledColumnModule.js +0 -21
- package/src/Strategy/TeamSharingModule.d.ts +1 -0
- package/src/Strategy/TeamSharingModule.js +5 -5
- package/src/Strategy/ToolPanelModule.d.ts +0 -1
- package/src/Strategy/ToolPanelModule.js +0 -23
- package/src/Utilities/Constants/DocumentationLinkConstants.js +1 -1
- package/src/Utilities/Constants/GeneralConstants.d.ts +1 -0
- package/src/Utilities/Constants/GeneralConstants.js +1 -0
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +5 -4
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +2 -1
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +294 -0
- package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.js +1 -1
- package/src/Utilities/Extensions/ArrayExtensions.d.ts +2 -0
- package/src/Utilities/Extensions/ArrayExtensions.js +4 -0
- package/src/Utilities/Helpers/AdaptableHelper.d.ts +3 -4
- package/src/Utilities/Helpers/AdaptableHelper.js +18 -58
- package/src/Utilities/Helpers/Helper.d.ts +2 -0
- package/src/Utilities/Helpers/Helper.js +4 -0
- package/src/Utilities/ObjectFactory.js +6 -6
- package/src/Utilities/Services/AggregatedScalarLiveValue.d.ts +3 -2
- package/src/Utilities/Services/AggregatedScalarLiveValue.js +14 -9
- package/src/Utilities/Services/CellPopupService.js +0 -1
- package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +1 -1
- package/src/Utilities/Services/LicenseService/index.d.ts +3 -0
- package/src/Utilities/Services/LicenseService/index.js +19 -7
- package/src/Utilities/Services/MetamodelService.d.ts +1 -1
- package/src/Utilities/Services/MetamodelService.js +6 -3
- package/src/Utilities/Services/QueryLanguageService.d.ts +1 -1
- package/src/Utilities/Services/QueryLanguageService.js +2 -1
- package/src/Utilities/Services/RowEditService.d.ts +3 -2
- package/src/Utilities/Services/RowEditService.js +3 -1
- package/src/Utilities/Services/SummaryService.d.ts +19 -0
- package/src/Utilities/Services/SummaryService.js +29 -0
- package/src/View/AdaptableView.js +1 -3
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +2 -2
- package/src/View/BulkUpdate/BulkUpdatePopup.js +1 -1
- package/src/View/CalculatedColumn/utils.d.ts +1 -1
- package/src/View/CellSummary/CellSummaryPopup.js +1 -1
- package/src/View/Comments/CommentsPopup.js +12 -8
- package/src/View/Components/AdaptableDateInput/index.d.ts +1 -1
- package/src/View/Components/NewScopeComponent.js +34 -1
- package/src/View/Components/Popups/AdaptableLoadingScreen.d.ts +6 -5
- package/src/View/Components/Popups/AdaptableLoadingScreen.js +19 -9
- package/src/View/Components/Popups/AdaptableToaster.js +1 -1
- package/src/View/Components/Popups/GridCellPopup/GridCellPopup.js +1 -1
- package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +1 -0
- package/src/View/Components/Popups/WindowPopups/windowFactory.js +3 -0
- package/src/View/Components/Selectors/PermittedValuesSelector.js +1 -1
- package/src/View/CustomSort/CustomSortSummary.js +1 -1
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +8 -8
- package/src/View/GridFilter/GridFilterViewPanel.js +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 +194 -0
- package/src/View/Layout/Wizard/LayoutWizard.js +1 -1
- package/src/View/Notes/NotesPopup.js +9 -11
- package/src/View/SpecialColumnSettingsWizardStep.js +4 -4
- package/src/View/Theme/ThemeSelector.js +3 -3
- package/src/agGrid/ActionColumnRenderer.js +7 -6
- package/src/agGrid/Adaptable.d.ts +3 -455
- package/src/agGrid/Adaptable.js +8 -5292
- package/src/agGrid/AdaptableAgGrid.d.ts +351 -0
- package/src/agGrid/AdaptableAgGrid.js +3936 -0
- package/src/agGrid/AdaptableLogger.js +77 -11
- package/src/agGrid/AgGridAdapter.d.ts +62 -0
- package/src/agGrid/AgGridAdapter.js +577 -0
- package/src/agGrid/AgGridColumnAdapter.d.ts +56 -0
- package/src/agGrid/AgGridColumnAdapter.js +824 -0
- package/src/agGrid/AgGridMenuAdapter.d.ts +28 -0
- package/src/agGrid/AgGridMenuAdapter.js +271 -0
- package/src/agGrid/AgGridOptionsService.d.ts +12 -0
- package/src/agGrid/AgGridOptionsService.js +54 -0
- package/src/agGrid/BadgeRenderer.js +1 -1
- package/src/agGrid/CheckboxRenderer.js +1 -1
- package/src/agGrid/FilterWrapper.d.ts +2 -2
- package/src/agGrid/FilterWrapper.js +1 -1
- package/src/agGrid/attachAddaptableColumnTypes.d.ts +12 -12
- package/src/agGrid/defaultAdaptableOptions.d.ts +3 -0
- package/src/{Utilities/Defaults/DefaultAdaptableOptions.js → agGrid/defaultAdaptableOptions.js} +70 -9
- package/src/agGrid/editors/AdaptableDateEditor/index.js +2 -2
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +2 -2
- package/src/components/ColorPicker/ColorPicker.d.ts +1 -1
- package/src/components/Datepicker/index.d.ts +1 -1
- package/src/components/InfiniteTable/index.js +2 -2
- package/src/components/Input/index.d.ts +1 -1
- package/src/components/List/ListGroupItem/index.d.ts +1 -1
- package/src/components/Modal/index.d.ts +1 -0
- package/src/components/Modal/index.js +4 -3
- package/src/components/Select/Select.d.ts +2 -0
- package/src/components/Select/Select.js +2 -2
- package/src/components/icons/index.js +2 -0
- package/src/components/icons/rows.d.ts +3 -0
- package/src/components/icons/rows.js +4 -0
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +74 -11
- package/src/metamodel/adaptable.metamodel.js +147 -34
- package/src/migration/AdaptableUpgradeHelper.d.ts +38 -0
- package/src/migration/AdaptableUpgradeHelper.js +48 -0
- package/src/migration/VersionUpgrade.d.ts +8 -0
- package/src/migration/VersionUpgrade.js +11 -0
- package/src/migration/VersionUpgrade17.d.ts +18 -0
- package/src/migration/VersionUpgrade17.js +342 -0
- package/src/migration/VersionUpgrade18.d.ts +5 -0
- package/src/migration/VersionUpgrade18.js +6 -0
- package/src/parser/src/types.d.ts +5 -0
- package/src/types.d.ts +7 -3
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/src/Utilities/Defaults/DefaultAdaptableOptions.d.ts +0 -2
- package/src/Utilities/Services/Interface/IRowEditService.d.ts +0 -3
- package/src/Utilities/Services/Interface/IRowEditService.js +0 -1
- package/src/View/Components/ScopeComponent.d.ts +0 -24
- package/src/View/Components/ScopeComponent.js +0 -133
- package/src/View/Export/Wizard/ReportScopeWizard.d.ts +0 -17
- package/src/View/Export/Wizard/ReportScopeWizard.js +0 -47
- package/src/agGrid/agGridHelper.d.ts +0 -57
- package/src/agGrid/agGridHelper.js +0 -686
- package/src/agGrid/agGridMenuHelper.d.ts +0 -46
- package/src/agGrid/agGridMenuHelper.js +0 -668
- /package/src/AdaptableOptions/{CommentsOptions.js → CommentOptions.js} +0 -0
- /package/src/AdaptableOptions/{NotesOptions.js → NoteOptions.js} +0 -0
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { ApiBase } from '../Implementation/ApiBase';
|
|
2
|
+
import { AB_SPECIAL_COLUMN, ADAPTABLE_ROW_ACTION_BUTTONS, } from '../../Utilities/Constants/GeneralConstants';
|
|
3
|
+
import UIHelper from '../../View/UIHelper';
|
|
4
|
+
import { ActionColumnRenderer, ReactActionColumnRenderer } from '../../agGrid/ActionColumnRenderer';
|
|
2
5
|
export class ActionRowInternalApi extends ApiBase {
|
|
3
6
|
buildRowEditForm(rowNode) {
|
|
4
7
|
return this.buildActionRow('rowEdited', rowNode);
|
|
@@ -197,4 +200,107 @@ export class ActionRowInternalApi extends ApiBase {
|
|
|
197
200
|
label: value,
|
|
198
201
|
}));
|
|
199
202
|
}
|
|
203
|
+
getColDefsForActionRowColumns() {
|
|
204
|
+
const actionButtons = this.getActionRowButtonDefs();
|
|
205
|
+
if (!actionButtons.length) {
|
|
206
|
+
return [];
|
|
207
|
+
}
|
|
208
|
+
return [
|
|
209
|
+
{
|
|
210
|
+
headerName: '',
|
|
211
|
+
colId: ADAPTABLE_ROW_ACTION_BUTTONS,
|
|
212
|
+
hide: false,
|
|
213
|
+
editable: false,
|
|
214
|
+
// 15px is the icon width + left&right padding + left&right border
|
|
215
|
+
width: Math.max(actionButtons.length * (UIHelper.getSimpleButtonPaddingWidth() * 2 + 15) + 2,
|
|
216
|
+
// If the width of the column is to small, the width will not be applied
|
|
217
|
+
// this triggers the setLayout an infinite loop because the width read from the grid is always different
|
|
218
|
+
40),
|
|
219
|
+
resizable: false,
|
|
220
|
+
lockVisible: true,
|
|
221
|
+
suppressColumnsToolPanel: true,
|
|
222
|
+
suppressFiltersToolPanel: true,
|
|
223
|
+
suppressMenu: true,
|
|
224
|
+
suppressMovable: true,
|
|
225
|
+
filter: false,
|
|
226
|
+
sortable: false,
|
|
227
|
+
enableRowGroup: false,
|
|
228
|
+
pinned: this.getActionRowOptions().actionRowButtonOptions.position === 'pinnedRight'
|
|
229
|
+
? 'right'
|
|
230
|
+
: 'left',
|
|
231
|
+
cellRenderer: this.getAdaptableVariant() === 'react' ? ReactActionColumnRenderer : ActionColumnRenderer,
|
|
232
|
+
cellClass: ADAPTABLE_ROW_ACTION_BUTTONS,
|
|
233
|
+
type: [AB_SPECIAL_COLUMN, 'abColDefObject'],
|
|
234
|
+
},
|
|
235
|
+
];
|
|
236
|
+
}
|
|
237
|
+
getActionRowButtonDefs() {
|
|
238
|
+
const actionRowButtons = this.getActionRowApi().getActionRowButtons();
|
|
239
|
+
if (!(actionRowButtons === null || actionRowButtons === void 0 ? void 0 : actionRowButtons.length)) {
|
|
240
|
+
return [];
|
|
241
|
+
}
|
|
242
|
+
const defaultActionRowButtonConfiguration = {
|
|
243
|
+
create: {
|
|
244
|
+
icon: {
|
|
245
|
+
name: 'add',
|
|
246
|
+
},
|
|
247
|
+
tooltip: 'Create',
|
|
248
|
+
onClick: () => {
|
|
249
|
+
this.getActionRowApi().displayCreateActionRow();
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
edit: {
|
|
253
|
+
icon: {
|
|
254
|
+
name: 'edit',
|
|
255
|
+
},
|
|
256
|
+
tooltip: 'Edit',
|
|
257
|
+
onClick: (button, context) => {
|
|
258
|
+
this.getActionRowApi().displayEditActionRow(context.primaryKeyValue);
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
clone: {
|
|
262
|
+
icon: {
|
|
263
|
+
name: 'clone',
|
|
264
|
+
},
|
|
265
|
+
tooltip: 'Clone',
|
|
266
|
+
onClick: (button, context) => {
|
|
267
|
+
this.getActionRowApi().displayCloneActionRow(context.primaryKeyValue);
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
delete: {
|
|
271
|
+
icon: {
|
|
272
|
+
name: 'delete',
|
|
273
|
+
},
|
|
274
|
+
tooltip: 'Delete',
|
|
275
|
+
onClick: (button, context) => {
|
|
276
|
+
var _a, _b;
|
|
277
|
+
const eventInfo = {
|
|
278
|
+
type: 'rowDeleted',
|
|
279
|
+
rowNode: context.rowNode,
|
|
280
|
+
adaptableApi: context.adaptableApi,
|
|
281
|
+
userName: context.userName,
|
|
282
|
+
adaptableId: context.adaptableId,
|
|
283
|
+
};
|
|
284
|
+
this.getEventApi().emit('ActionRowSubmitted', eventInfo);
|
|
285
|
+
(_b = (_a = this.getActionRowOptions().actionRowFormOptions).onFormSubmit) === null || _b === void 0 ? void 0 : _b.call(_a, eventInfo);
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
};
|
|
289
|
+
const actionButtons = actionRowButtons
|
|
290
|
+
.map((actionRowButtonType) => {
|
|
291
|
+
var _a, _b;
|
|
292
|
+
const defaultButtonConfig = defaultActionRowButtonConfiguration[actionRowButtonType];
|
|
293
|
+
if (!defaultButtonConfig) {
|
|
294
|
+
// should NOT happen unless the user sent some invalid button type in the predefined config
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
const customButtonConfig = (_b = (_a = this.getActionRowOptions().actionRowButtonOptions).customConfiguration) === null || _b === void 0 ? void 0 : _b.call(_a, Object.assign(Object.assign({}, this.getAdaptableApi().internalApi.buildBaseContext()), { actionRowButtonType }));
|
|
298
|
+
if (!customButtonConfig) {
|
|
299
|
+
return defaultButtonConfig;
|
|
300
|
+
}
|
|
301
|
+
return Object.assign(Object.assign({}, defaultButtonConfig), customButtonConfig);
|
|
302
|
+
})
|
|
303
|
+
.filter(Boolean);
|
|
304
|
+
return actionButtons;
|
|
305
|
+
}
|
|
200
306
|
}
|
|
@@ -24,9 +24,9 @@ import { AdaptableFrameworkComponent } from '../../AdaptableOptions/AdaptableFra
|
|
|
24
24
|
import { IMetamodelService } from '../../Utilities/Services/Interface/IMetamodelService';
|
|
25
25
|
import { IModuleCollection } from '../../Strategy/Interface/IModule';
|
|
26
26
|
import { AdaptableObjectTag, AdaptableObjectWithScope } from '../../PredefinedConfig/Common/AdaptableObject';
|
|
27
|
-
import { IRowEditService } from '../../Utilities/Services/Interface/IRowEditService';
|
|
28
27
|
import { Fdc3Service } from '../../Utilities/Services/Fdc3Service';
|
|
29
28
|
import { CellPopupService } from '../../Utilities/Services/CellPopupService';
|
|
29
|
+
import { RowEditService } from '../../Utilities/Services/RowEditService';
|
|
30
30
|
export declare class AdaptableInternalApi extends ApiBase {
|
|
31
31
|
getSystemState(): SystemState;
|
|
32
32
|
showPopupConfirmation(confirmation: UIConfirmation): void;
|
|
@@ -46,8 +46,7 @@ export declare class AdaptableInternalApi extends ApiBase {
|
|
|
46
46
|
setPivotModeOn(): void;
|
|
47
47
|
setPivotModeOff(): void;
|
|
48
48
|
isGridInPivotMode(): boolean;
|
|
49
|
-
|
|
50
|
-
setTreeModeOff(): void;
|
|
49
|
+
setTreeMode(mode: boolean): void;
|
|
51
50
|
isGridInTreeMode(): boolean;
|
|
52
51
|
getToolbarTitle(): string;
|
|
53
52
|
buildDataChangedInfo(config: Pick<CellDataChangedInfo, 'newValue' | 'oldValue' | 'column' | 'primaryKeyValue' | 'rowNode' | 'trigger'>): CellDataChangedInfo;
|
|
@@ -65,7 +64,7 @@ export declare class AdaptableInternalApi extends ApiBase {
|
|
|
65
64
|
getAlertService(): IAlertService;
|
|
66
65
|
getTeamSharingService(): ITeamSharingService;
|
|
67
66
|
getMetamodelService(): IMetamodelService;
|
|
68
|
-
getRowEditService():
|
|
67
|
+
getRowEditService(): RowEditService;
|
|
69
68
|
getFdc3Service(): Fdc3Service;
|
|
70
69
|
getModules(): IModuleCollection;
|
|
71
70
|
getModuleFriendlyName(adaptableModule: AdaptableModule): string;
|
|
@@ -47,11 +47,13 @@ export class AdaptableInternalApi extends ApiBase {
|
|
|
47
47
|
isGridInPivotMode() {
|
|
48
48
|
return this.getAdaptableState().Grid.IsGridInPivotMode;
|
|
49
49
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
setTreeMode(mode) {
|
|
51
|
+
if (!!mode) {
|
|
52
|
+
this.dispatchAction(GridRedux.SetTreeModeOn());
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
this.dispatchAction(GridRedux.SetTreeModeOff());
|
|
56
|
+
}
|
|
55
57
|
}
|
|
56
58
|
isGridInTreeMode() {
|
|
57
59
|
return this.getAdaptableState().Grid.IsGridInTreeMode;
|
|
@@ -219,13 +221,13 @@ export class AdaptableInternalApi extends ApiBase {
|
|
|
219
221
|
frameworkComponent,
|
|
220
222
|
componentType,
|
|
221
223
|
});
|
|
222
|
-
if (this.adaptable.
|
|
224
|
+
if (this.adaptable.isReady) {
|
|
223
225
|
createComponentFn();
|
|
224
226
|
}
|
|
225
227
|
else {
|
|
226
228
|
// adaptable may not be initialized yet if the framework component is part of the initial render
|
|
227
229
|
// AFL 2021.10.14 - not really sure if this is necessary anymore?! (see the other changes in this commit)
|
|
228
|
-
waitForCondition(() => this.adaptable.
|
|
230
|
+
waitForCondition(() => this.adaptable.isReady).then(() => {
|
|
229
231
|
createComponentFn();
|
|
230
232
|
});
|
|
231
233
|
}
|
|
@@ -448,7 +450,7 @@ export class AdaptableInternalApi extends ApiBase {
|
|
|
448
450
|
var _a;
|
|
449
451
|
let actionColumn;
|
|
450
452
|
if (colDef.colId == ADAPTABLE_ROW_ACTION_BUTTONS) {
|
|
451
|
-
const actionButtons = this.
|
|
453
|
+
const actionButtons = this.getActionRowApi().internalApi.getActionRowButtonDefs();
|
|
452
454
|
actionColumn = {
|
|
453
455
|
columnId: ADAPTABLE_ROW_ACTION_BUTTONS,
|
|
454
456
|
actionColumnButton: actionButtons,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ApiBase } from '../Implementation/ApiBase';
|
|
2
2
|
import { CalculatedColumn } from '../../PredefinedConfig/CalculatedColumnState';
|
|
3
3
|
import { AdaptableColumn } from '../../types';
|
|
4
|
+
import { ColDef } from '@ag-grid-community/core';
|
|
4
5
|
export declare class CalculatedColumnInternalApi extends ApiBase {
|
|
5
6
|
/**
|
|
6
7
|
* Returns all the references in the AdaptableState of the given CalculatedColumn
|
|
@@ -27,4 +28,5 @@ export declare class CalculatedColumnInternalApi extends ApiBase {
|
|
|
27
28
|
isQuantileAggregatedExpression(input: string): boolean;
|
|
28
29
|
getExpressionFromCalculatedColumn(calculatedColumn: CalculatedColumn): string;
|
|
29
30
|
fireCalculatedColumnChangedEvent(trigger: string, calculatedColumn: CalculatedColumn): void;
|
|
31
|
+
getColDefsForCalculatedColumns(): ColDef[];
|
|
30
32
|
}
|
|
@@ -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: false,
|
|
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
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ApiBase } from '../Implementation/ApiBase';
|
|
2
|
+
export class CommentsInternalApi extends ApiBase {
|
|
3
|
+
areCommentsAvailable() {
|
|
4
|
+
var _a;
|
|
5
|
+
const currentLayout = this.getLayoutApi().getCurrentLayout();
|
|
6
|
+
if (currentLayout.EnablePivot) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
if ((_a = currentLayout === null || currentLayout === void 0 ? void 0 : currentLayout.RowGroupedColumns) === null || _a === void 0 ? void 0 : _a.length) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -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,
|
|
@@ -69,8 +69,9 @@ export class FormatColumnInternalApi extends ApiBase {
|
|
|
69
69
|
// this.getFormatColumnsWithColumnScope(formatColumns)
|
|
70
70
|
(this.adaptable.api.scopeApi.scopeHasColumns(fc.Scope) ||
|
|
71
71
|
// this.getFormatColumnsWithDataTypeScope(formatColumns)
|
|
72
|
-
this.adaptable.api.scopeApi.scopeHasDataType(fc.Scope) ||
|
|
73
|
-
|
|
72
|
+
this.adaptable.api.scopeApi.scopeHasDataType(fc.Scope) ||
|
|
73
|
+
// this.getFormatColumnsWithAllScope(formatColumns)
|
|
74
|
+
this.adaptable.api.scopeApi.scopeIsAll(fc.Scope) || this.adaptable.api.scopeApi.scopeHasColumnType(fc.Scope))
|
|
74
75
|
);
|
|
75
76
|
});
|
|
76
77
|
}
|
|
@@ -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: false,
|
|
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
|
}
|