@adaptabletools/adaptable 22.0.0-canary.0 → 22.0.0-canary.2
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/README.md +4 -6
- package/index.css +3 -14
- package/index.css.map +1 -1
- package/package.json +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +9 -0
- package/src/AdaptableOptions/AdaptablePlugin.js +6 -1
- package/src/AdaptableOptions/ExportOptions.d.ts +1 -2
- package/src/AdaptableOptions/FilterOptions.d.ts +3 -0
- package/src/AdaptableState/Common/AdaptableColumn.d.ts +6 -0
- package/src/AdaptableState/Common/RowDataChangedInfo.d.ts +3 -0
- package/src/AdaptableState/InitialState.d.ts +1 -1
- package/src/AdaptableState/Selection/GridCell.d.ts +9 -0
- package/src/Api/GridApi.d.ts +14 -0
- package/src/Api/Implementation/ActionColumnApiImpl.js +1 -0
- package/src/Api/Implementation/AdaptableApiImpl.js +52 -0
- package/src/Api/Implementation/AlertApiImpl.js +1 -0
- package/src/Api/Implementation/ApiBase.js +1 -0
- package/src/Api/Implementation/CalculatedColumnApiImpl.js +1 -0
- package/src/Api/Implementation/ChartingApiImpl.js +4 -0
- package/src/Api/Implementation/ColumnApiImpl.js +1 -0
- package/src/Api/Implementation/ColumnFilterApiImpl.js +1 -0
- package/src/Api/Implementation/CommentsApiImpl.js +1 -0
- package/src/Api/Implementation/CustomSortApiImpl.js +1 -0
- package/src/Api/Implementation/DashboardApiImpl.js +1 -0
- package/src/Api/Implementation/DataChangeHistoryApiImpl.js +12 -15
- package/src/Api/Implementation/DataImportApiImpl.js +1 -0
- package/src/Api/Implementation/DataSetApiImpl.js +1 -0
- package/src/Api/Implementation/EntitlementApiImpl.js +1 -0
- package/src/Api/Implementation/EventApiImpl.js +16 -14
- package/src/Api/Implementation/ExportApiImpl.js +1 -0
- package/src/Api/Implementation/ExpressionApiImpl.js +1 -0
- package/src/Api/Implementation/Fdc3ApiImpl.js +1 -0
- package/src/Api/Implementation/FilterApiImpl.js +3 -0
- package/src/Api/Implementation/FlashingCellApiImpl.js +1 -0
- package/src/Api/Implementation/FormatColumnApiImpl.js +1 -0
- package/src/Api/Implementation/FreeTextColumnApiImpl.js +1 -0
- package/src/Api/Implementation/GridApiImpl.d.ts +9 -0
- package/src/Api/Implementation/GridApiImpl.js +17 -0
- package/src/Api/Implementation/GridFilterApiImpl.js +1 -0
- package/src/Api/Implementation/LayoutApiImpl.js +1 -0
- package/src/Api/Implementation/NamedQueryApiImpl.js +1 -0
- package/src/Api/Implementation/NoteApiImpl.js +1 -0
- package/src/Api/Implementation/PredicateApiImpl.js +1 -0
- package/src/Api/Implementation/RowFormApiImpl.js +1 -0
- package/src/Api/Implementation/StyledColumnApiImpl.js +1 -0
- package/src/Api/Implementation/SystemStatusApiImpl.js +2 -0
- package/src/Api/Implementation/TeamSharingApiImpl.js +1 -0
- package/src/Api/Implementation/ThemeApiImpl.js +1 -0
- package/src/Api/Implementation/UserInterfaceApiImpl.js +2 -1
- package/src/Redux/Store/AdaptableReduxLocalStorageEngine.js +6 -0
- package/src/Redux/Store/AdaptableStore.js +57 -50
- package/src/Strategy/AdaptableModuleBase.js +4 -0
- package/src/Strategy/AlertModule.js +1 -0
- package/src/Strategy/CalculatedColumnModule.js +1 -0
- package/src/Strategy/CellSummaryModule.js +1 -1
- package/src/Strategy/DataChangeHistoryModule.js +1 -0
- package/src/Strategy/FlashingCellModule.js +1 -0
- package/src/Strategy/FreeTextColumnModule.js +1 -0
- package/src/Strategy/LayoutModule.js +2 -1
- package/src/Strategy/PlusMinusModule.js +2 -0
- package/src/Strategy/ScheduleModule.js +1 -0
- package/src/Strategy/ShortcutModule.js +2 -0
- package/src/Strategy/TeamSharingModule.js +10 -10
- package/src/Utilities/Constants/DocumentationLinkConstants.d.ts +18 -17
- package/src/Utilities/Constants/DocumentationLinkConstants.js +18 -17
- package/src/Utilities/ExpressionFunctions/deepMap.js +31 -31
- package/src/Utilities/MenuItem.js +18 -0
- package/src/Utilities/Services/AggregatedScalarLiveValue.js +8 -0
- package/src/Utilities/Services/AlertService.js +6 -4
- package/src/Utilities/Services/AnnotationsService.js +3 -0
- package/src/Utilities/Services/CalculatedColumnExpressionService.js +2 -1
- package/src/Utilities/Services/ChartingService.js +1 -0
- package/src/Utilities/Services/DataService.js +10 -2
- package/src/Utilities/Services/Fdc3Service.js +5 -3
- package/src/Utilities/Services/FlashingCellService.js +5 -0
- package/src/Utilities/Services/LicenseService/index.js +1 -1
- package/src/Utilities/Services/MetamodelService.js +2 -2
- package/src/Utilities/Services/ModuleService.js +38 -38
- package/src/Utilities/Services/QueryLanguageService.js +6 -5
- package/src/Utilities/Services/RowFormService.js +1 -0
- package/src/Utilities/Services/RowSummaryService.js +10 -7
- package/src/Utilities/Services/TeamSharingService.js +3 -1
- package/src/Utilities/Services/ThemeService.js +11 -9
- package/src/Utilities/Services/ValidationService.js +1 -0
- package/src/Utilities/createAgStatusPanelComponent.js +3 -0
- package/src/View/BulkUpdate/BulkUpdateViewPanel.js +1 -0
- package/src/View/CalculatedColumn/CalculatedColumnSummary.js +8 -8
- package/src/View/CellSummary/CellSummaryViewPanel.js +1 -0
- package/src/View/Components/Buttons/ButtonBase/index.js +9 -9
- package/src/View/Components/Buttons/EntityListActionButtons.js +18 -18
- package/src/View/Components/ColumnFilter/components/FloatingFilterValues.js +1 -1
- package/src/View/Components/ExpressionWizard.js +5 -5
- package/src/View/Components/Panels/PanelDashboard/index.js +8 -8
- package/src/View/Components/Panels/PanelToolPanel/index.js +7 -7
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +2 -0
- package/src/View/CustomSort/CustomSortSummary.js +13 -13
- package/src/View/FormatColumn/FormatColumnSummary.js +13 -13
- package/src/View/FreeTextColumn/FreeTextColumnSummary.js +13 -13
- package/src/View/SmartEdit/SmartEditViewPanel.js +1 -0
- package/src/View/Theme/ThemePopup.js +13 -16
- package/src/agGrid/Adaptable.js +4 -0
- package/src/agGrid/AdaptableAgGrid.d.ts +9 -0
- package/src/agGrid/AdaptableAgGrid.js +160 -37
- package/src/agGrid/AdaptableFilterHandler.js +4 -0
- package/src/agGrid/AdaptableLogger.d.ts +3 -0
- package/src/agGrid/AdaptableLogger.js +10 -0
- package/src/agGrid/AgGridAdapter.js +11 -1
- package/src/agGrid/AgGridColumnAdapter.js +2 -0
- package/src/agGrid/AgGridExportAdapter.js +10 -9
- package/src/agGrid/AgGridFilterAdapter.js +4 -0
- package/src/agGrid/AgGridFloatingFilterAdapter.js +3 -0
- package/src/agGrid/AgGridMenuAdapter.js +1 -0
- package/src/agGrid/AgGridModulesAdapter.js +2 -1
- package/src/agGrid/AgGridOptionsService.js +3 -0
- package/src/agGrid/AgGridThemeAdapter.js +2 -0
- package/src/agGrid/cellRenderers/ActionColumnRenderer.js +5 -0
- package/src/agGrid/cellRenderers/BadgeRenderer.js +2 -0
- package/src/agGrid/cellRenderers/PercentBarRenderer.js +1 -0
- package/src/agGrid/editors/AdaptableDateEditor/index.js +6 -3
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +16 -12
- package/src/agGrid/editors/AdaptablePercentageEditor/index.js +17 -13
- package/src/agGrid/index.d.ts +6 -0
- package/src/agGrid/index.js +6 -0
- package/src/components/Datepicker/index.js +1 -1
- package/src/components/overlayBaseZIndex.js +1 -1
- package/src/components/utils/useContainerScrollObserver/index.js +17 -14
- package/src/devTools/index.js +54 -53
- package/src/env.js +2 -2
- package/src/layout-manager/src/LMEmitter.js +11 -11
- package/src/layout-manager/src/LMLogger.js +7 -0
- package/src/layout-manager/src/index.js +56 -51
- package/src/metamodel/adaptable.metamodel.d.ts +57 -0
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/migration/AdaptableUpgradeHelper.js +3 -0
- package/src/migration/VersionUpgrade.js +1 -0
- package/src/migration/VersionUpgrade17.js +1 -2
- package/src/parser/src/ExpressionEvaluationError.js +1 -0
- package/tsconfig.esm.tsbuildinfo +1 -1
package/src/agGrid/Adaptable.js
CHANGED
|
@@ -257,6 +257,15 @@ export declare class AdaptableAgGrid implements IAdaptable {
|
|
|
257
257
|
added: IRowNode[];
|
|
258
258
|
updated: IRowNode[];
|
|
259
259
|
}>;
|
|
260
|
+
applyGridDataTransaction(dataTransaction: {
|
|
261
|
+
add?: any[];
|
|
262
|
+
update?: any[];
|
|
263
|
+
remove?: any[];
|
|
264
|
+
}, config?: DataUpdateConfig): Promise<{
|
|
265
|
+
addedRows: IRowNode[];
|
|
266
|
+
updatedRows: IRowNode[];
|
|
267
|
+
removedRows: IRowNode[];
|
|
268
|
+
}>;
|
|
260
269
|
deleteRows(dataRows: any[], dataUpdateConfig?: DataUpdateConfig): Promise<IRowNode[]>;
|
|
261
270
|
getRowNodeForPrimaryKey(primaryKeyValue: any): any;
|
|
262
271
|
hideColumn(columnId: string): void;
|
|
@@ -155,38 +155,77 @@ LocalEventService_Prototype.dispatchEvent = function (event) {
|
|
|
155
155
|
const adaptableInstances = {};
|
|
156
156
|
const publishTimestamp = Number(ADAPTABLE_PUBLISH_TIMESTAMP);
|
|
157
157
|
export class AdaptableAgGrid {
|
|
158
|
+
logger;
|
|
159
|
+
_id;
|
|
160
|
+
lifecycleState;
|
|
161
|
+
variant;
|
|
162
|
+
emitter;
|
|
163
|
+
/**
|
|
164
|
+
* Runtime flags
|
|
165
|
+
*/
|
|
166
|
+
hasAutogeneratedPrimaryKey;
|
|
167
|
+
hasAdaptableToolPanel;
|
|
168
|
+
initWithLazyData;
|
|
169
|
+
_rawAdaptableOptions;
|
|
170
|
+
adaptableOptions;
|
|
171
|
+
_isDetailGrid;
|
|
172
|
+
_isDetailGridForIndex;
|
|
173
|
+
agGridOptionsService;
|
|
174
|
+
agGridAdapter;
|
|
175
|
+
agGridColumnAdapter;
|
|
176
|
+
agGridMenuAdapter;
|
|
177
|
+
agGridExportAdapter;
|
|
178
|
+
agGridThemeAdapter;
|
|
179
|
+
agGridModulesAdapter;
|
|
180
|
+
DANGER_USE_GETTER_adaptableContainerElement;
|
|
181
|
+
DANGER_USE_GETTER_agGridContainerElement;
|
|
182
|
+
api;
|
|
183
|
+
adaptableStore;
|
|
184
|
+
adaptableModules;
|
|
185
|
+
DataService;
|
|
186
|
+
CalculatedColumnExpressionService;
|
|
187
|
+
ModuleService;
|
|
188
|
+
ValidationService;
|
|
189
|
+
QueryLanguageService;
|
|
190
|
+
AlertService;
|
|
191
|
+
TeamSharingService;
|
|
192
|
+
MetamodelService;
|
|
193
|
+
RowFormService;
|
|
194
|
+
Fdc3Service;
|
|
195
|
+
AnnotationsService;
|
|
196
|
+
FlashingCellService;
|
|
197
|
+
LicenseService;
|
|
198
|
+
ChartingService;
|
|
199
|
+
ThemeService;
|
|
200
|
+
rowListeners;
|
|
201
|
+
throttleFilterOnDataChange;
|
|
202
|
+
debouncedSetSelectedRows;
|
|
203
|
+
debouncedSetSelectedCells;
|
|
204
|
+
agGridListenerKeydown;
|
|
205
|
+
agGridListenerMouseEnter;
|
|
206
|
+
agGridListenerMouseLeave;
|
|
207
|
+
listenerGlobalSetRowSelection;
|
|
208
|
+
listenerGlobalChartingChanges;
|
|
209
|
+
listenerCellEditingStarted;
|
|
210
|
+
listenerFirstDataRendered;
|
|
211
|
+
listenerPivotChanged;
|
|
212
|
+
listenerCellSelectionChanged;
|
|
213
|
+
listenerSortChanged;
|
|
214
|
+
listenerColumnGroupOpened;
|
|
215
|
+
layoutManager;
|
|
216
|
+
columnMinMaxValuesCache = {};
|
|
217
|
+
renderReactRoot = (node, container) => defaultRenderReactRoot(node, container);
|
|
218
|
+
unmountReactRoot;
|
|
219
|
+
unmountLoadingScreen;
|
|
220
|
+
/**
|
|
221
|
+
* Temporary, these are MIGRATION technical debts, and should be removed as soon as possible
|
|
222
|
+
*/
|
|
223
|
+
adaptableStatusPanelKeys = [];
|
|
224
|
+
// see #no_additional_react_root
|
|
225
|
+
_PRIVATE_adaptableJSXElement;
|
|
226
|
+
_prevLayout;
|
|
227
|
+
__prevLayoutForRefresh;
|
|
158
228
|
constructor(config) {
|
|
159
|
-
this.columnMinMaxValuesCache = {};
|
|
160
|
-
this.renderReactRoot = (node, container) => defaultRenderReactRoot(node, container);
|
|
161
|
-
/**
|
|
162
|
-
* Temporary, these are MIGRATION technical debts, and should be removed as soon as possible
|
|
163
|
-
*/
|
|
164
|
-
this.adaptableStatusPanelKeys = [];
|
|
165
|
-
// only for our private / internal events used within Adaptable
|
|
166
|
-
// public events are emitted through the EventApi
|
|
167
|
-
this._emit = (eventName, data) => {
|
|
168
|
-
if (this.emitter) {
|
|
169
|
-
return this.emitter.emit(eventName, data);
|
|
170
|
-
}
|
|
171
|
-
};
|
|
172
|
-
this._emitSync = (eventName, data) => {
|
|
173
|
-
if (this.emitter) {
|
|
174
|
-
return this.emitter.emitSync(eventName, data);
|
|
175
|
-
}
|
|
176
|
-
};
|
|
177
|
-
this._on = (eventName, callback) => {
|
|
178
|
-
if (!this.emitter) {
|
|
179
|
-
return () => { };
|
|
180
|
-
}
|
|
181
|
-
return this.emitter.on(eventName, callback);
|
|
182
|
-
};
|
|
183
|
-
this._onIncludeFired = (eventName, callback) => {
|
|
184
|
-
if (!this.emitter) {
|
|
185
|
-
return () => { };
|
|
186
|
-
}
|
|
187
|
-
return this.emitter.onIncludeFired(eventName, callback);
|
|
188
|
-
};
|
|
189
|
-
this.__updateColumnModelAndRefreshGrid_already_called = false;
|
|
190
229
|
this.lifecycleState = 'initial';
|
|
191
230
|
this.emitter = new Emitter();
|
|
192
231
|
this.agGridOptionsService = new AgGridOptionsService(this);
|
|
@@ -222,6 +261,30 @@ export class AdaptableAgGrid {
|
|
|
222
261
|
get isDestroyed() {
|
|
223
262
|
return this.lifecycleState === 'preDestroyed';
|
|
224
263
|
}
|
|
264
|
+
// only for our private / internal events used within Adaptable
|
|
265
|
+
// public events are emitted through the EventApi
|
|
266
|
+
_emit = (eventName, data) => {
|
|
267
|
+
if (this.emitter) {
|
|
268
|
+
return this.emitter.emit(eventName, data);
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
_emitSync = (eventName, data) => {
|
|
272
|
+
if (this.emitter) {
|
|
273
|
+
return this.emitter.emitSync(eventName, data);
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
_on = (eventName, callback) => {
|
|
277
|
+
if (!this.emitter) {
|
|
278
|
+
return () => { };
|
|
279
|
+
}
|
|
280
|
+
return this.emitter.on(eventName, callback);
|
|
281
|
+
};
|
|
282
|
+
_onIncludeFired = (eventName, callback) => {
|
|
283
|
+
if (!this.emitter) {
|
|
284
|
+
return () => { };
|
|
285
|
+
}
|
|
286
|
+
return this.emitter.onIncludeFired(eventName, callback);
|
|
287
|
+
};
|
|
225
288
|
/**
|
|
226
289
|
* Internal initializer for Adaptable, directly called by the React and Angular Adaptable wrappers
|
|
227
290
|
* @private
|
|
@@ -654,11 +717,8 @@ You need to define at least one Layout!`);
|
|
|
654
717
|
// FIXME AFL FILTER why is this needed???
|
|
655
718
|
this.refreshSelectedCellsState();
|
|
656
719
|
this.refreshSelectedRowsState();
|
|
657
|
-
// FIXME AFL: this is temporary, will be replaced with v22's new autoCol filtering
|
|
658
|
-
const currentPivotLayoutHasAutoCols = this.api.layoutApi.isCurrentLayoutPivot() &&
|
|
659
|
-
!!this.api.layoutApi.getCurrentRowGroupsColumnIds()?.length;
|
|
660
720
|
// agGridApi.setFilterModel() already triggered onFilterChanged(), so we skip it if updateColumnFilterModel is TRUE
|
|
661
|
-
if (!filteringApplied
|
|
721
|
+
if (!filteringApplied) {
|
|
662
722
|
agGridApi.onFilterChanged();
|
|
663
723
|
filteringApplied = true;
|
|
664
724
|
}
|
|
@@ -785,7 +845,8 @@ You need to define at least one Layout!`);
|
|
|
785
845
|
return original_autoGroupColumnDef;
|
|
786
846
|
}
|
|
787
847
|
if (typeof original_autoGroupColumnDef?.filter === 'object') {
|
|
788
|
-
this.logger.
|
|
848
|
+
this.logger.consoleWarn(`autoGroupColumnDef.filter is set and overrides the Adaptable custom filter mechanism, so Adaptable will not be able to manage filtering for the Group Column!
|
|
849
|
+
Please contact the Adaptable Support Team for further assistance and investigation.`);
|
|
789
850
|
return original_autoGroupColumnDef;
|
|
790
851
|
}
|
|
791
852
|
const autoGroupColumnDef = { ...original_autoGroupColumnDef };
|
|
@@ -793,7 +854,8 @@ You need to define at least one Layout!`);
|
|
|
793
854
|
// !! DO NOT REMOVE THIS !!
|
|
794
855
|
// see https://github.com/ag-grid/ag-grid/blob/6f43ff257c2e285068eb425b655e58d6eeb89816/packages/ag-grid-enterprise/src/rowHierarchy/autoColService.ts#L225
|
|
795
856
|
autoGroupColumnDef.filterValueGetter = (params) => {
|
|
796
|
-
this.logger.
|
|
857
|
+
this.logger.consoleWarn(`An unexpected invocation of autoGroupColumnDef.filterValueGetter was detected. This execution path is not expected under normal operation.
|
|
858
|
+
Please contact the Adaptable Support Team for further assistance and investigation.`, params);
|
|
797
859
|
return '';
|
|
798
860
|
};
|
|
799
861
|
// !! it is important that we always return the same component / handler instances
|
|
@@ -2069,6 +2131,7 @@ You need to define at least one Layout!`);
|
|
|
2069
2131
|
}
|
|
2070
2132
|
return rawValue;
|
|
2071
2133
|
}
|
|
2134
|
+
__updateColumnModelAndRefreshGrid_already_called = false;
|
|
2072
2135
|
updateColumnModelAndRefreshGrid() {
|
|
2073
2136
|
if (this.__updateColumnModelAndRefreshGrid_already_called) {
|
|
2074
2137
|
return;
|
|
@@ -2404,6 +2467,66 @@ You need to define at least one Layout!`);
|
|
|
2404
2467
|
});
|
|
2405
2468
|
}
|
|
2406
2469
|
}
|
|
2470
|
+
async applyGridDataTransaction(dataTransaction, config = {}) {
|
|
2471
|
+
const result = {
|
|
2472
|
+
addedRows: [],
|
|
2473
|
+
updatedRows: [],
|
|
2474
|
+
removedRows: [],
|
|
2475
|
+
};
|
|
2476
|
+
if (!dataTransaction) {
|
|
2477
|
+
return result;
|
|
2478
|
+
}
|
|
2479
|
+
const addDataRows = dataTransaction.add;
|
|
2480
|
+
const updateDataRows = dataTransaction.update;
|
|
2481
|
+
const removeDataRows = dataTransaction.remove;
|
|
2482
|
+
if (this.hasAutogeneratedPrimaryKey) {
|
|
2483
|
+
this.addSyntheticPrimaryKeyIfMissing(addDataRows);
|
|
2484
|
+
}
|
|
2485
|
+
if (config.runAsync) {
|
|
2486
|
+
return new Promise((resolve) => {
|
|
2487
|
+
this.applyAgGridTransactionAsync({
|
|
2488
|
+
update: updateDataRows,
|
|
2489
|
+
add: addDataRows,
|
|
2490
|
+
remove: removeDataRows,
|
|
2491
|
+
addIndex: config.addIndex,
|
|
2492
|
+
}, (transaction) => {
|
|
2493
|
+
if (typeof config.callback === 'function') {
|
|
2494
|
+
config.callback(transaction);
|
|
2495
|
+
}
|
|
2496
|
+
if (transaction?.add) {
|
|
2497
|
+
this.updateRowGroupsAndColumnGroupsExpandedState();
|
|
2498
|
+
}
|
|
2499
|
+
resolve({
|
|
2500
|
+
addedRows: transaction?.add,
|
|
2501
|
+
updatedRows: transaction?.update,
|
|
2502
|
+
removedRows: transaction?.remove,
|
|
2503
|
+
});
|
|
2504
|
+
});
|
|
2505
|
+
if (config.flushAsync) {
|
|
2506
|
+
this.agGridAdapter.getAgGridApi().flushAsyncTransactions();
|
|
2507
|
+
}
|
|
2508
|
+
});
|
|
2509
|
+
}
|
|
2510
|
+
else {
|
|
2511
|
+
const transaction = this.applyAgGridTransaction({
|
|
2512
|
+
update: updateDataRows,
|
|
2513
|
+
add: addDataRows,
|
|
2514
|
+
remove: removeDataRows,
|
|
2515
|
+
addIndex: config.addIndex,
|
|
2516
|
+
});
|
|
2517
|
+
if (transaction?.add) {
|
|
2518
|
+
this.updateRowGroupsAndColumnGroupsExpandedState();
|
|
2519
|
+
}
|
|
2520
|
+
if (config.flushAsync) {
|
|
2521
|
+
this.agGridAdapter.getAgGridApi().flushAsyncTransactions();
|
|
2522
|
+
}
|
|
2523
|
+
return Promise.resolve({
|
|
2524
|
+
addedRows: transaction?.add,
|
|
2525
|
+
updatedRows: transaction?.update,
|
|
2526
|
+
removedRows: transaction?.remove,
|
|
2527
|
+
});
|
|
2528
|
+
}
|
|
2529
|
+
}
|
|
2407
2530
|
deleteRows(dataRows, dataUpdateConfig) {
|
|
2408
2531
|
dataUpdateConfig = dataUpdateConfig || {};
|
|
2409
2532
|
if (dataUpdateConfig.runAsync) {
|
|
@@ -11,7 +11,17 @@ export const errorOnce = (message) => {
|
|
|
11
11
|
console.error(message);
|
|
12
12
|
errorOnceFlags[message] = true;
|
|
13
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* AdapTable's Logger
|
|
16
|
+
*/
|
|
14
17
|
export class AdaptableLogger {
|
|
18
|
+
adaptableId;
|
|
19
|
+
debugger;
|
|
20
|
+
infoLogger;
|
|
21
|
+
successLogger;
|
|
22
|
+
warnLogger;
|
|
23
|
+
errorLogger;
|
|
24
|
+
perfLogger;
|
|
15
25
|
// use static loggers whenever access to AdaptableLogger instance is not feasible
|
|
16
26
|
static consoleErrorBase(message, ...optionalParams) {
|
|
17
27
|
if (optionalParams?.length) {
|
|
@@ -13,9 +13,19 @@ import { isWeightedAverageAggFuncName } from '../AdaptableState/Common/Aggregati
|
|
|
13
13
|
const DANGER_AG_GRID_BEANS_MAP = {};
|
|
14
14
|
const getColumnApiModule = () => ColumnApiModule;
|
|
15
15
|
export class AgGridAdapter {
|
|
16
|
+
_adaptableInstance;
|
|
17
|
+
DANGER_USE_GETTER_gridApi;
|
|
18
|
+
DANGER_gridApi_from_args;
|
|
19
|
+
// see #gridOpts_monkey_patch
|
|
20
|
+
DANGER_updateGridOptionsMonkeyPatcher;
|
|
21
|
+
// see #aggColumnFilters_monkey_patch
|
|
22
|
+
DANGER_doFiltersPassMonkeyPatcher;
|
|
23
|
+
DANGER_isAggFilterPresentMonkeyPatcher;
|
|
24
|
+
activePivotColumnFilters_MEMO = new WeakMap();
|
|
25
|
+
initialGridOptions;
|
|
26
|
+
_agGridId;
|
|
16
27
|
constructor(_adaptableInstance, config) {
|
|
17
28
|
this._adaptableInstance = _adaptableInstance;
|
|
18
|
-
this.activePivotColumnFilters_MEMO = new WeakMap();
|
|
19
29
|
const columnApiModuleReference = config?.getAgGridColumnApiModuleReference?.() ?? getColumnApiModule();
|
|
20
30
|
const ColumnDefFactory_Prototype = columnApiModuleReference?.beans?.[0]?.prototype;
|
|
21
31
|
if (!ColumnDefFactory_Prototype) {
|
|
@@ -27,6 +27,8 @@ export function getEditorForColumnDataType(columnDataType, variant) {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
export class AgGridColumnAdapter {
|
|
30
|
+
adaptableInstance;
|
|
31
|
+
colDefPropertyCache;
|
|
30
32
|
constructor(adaptableInstance) {
|
|
31
33
|
this.adaptableInstance = adaptableInstance;
|
|
32
34
|
this.colDefPropertyCache = new Map();
|
|
@@ -8,17 +8,18 @@ import { createUuid } from '../AdaptableState/Uuid';
|
|
|
8
8
|
import { inferSchema, initParser } from 'udsv';
|
|
9
9
|
import { AG_GRID_GROUPED_COLUMN, AG_GRID_SELECTION_COLUMN, } from '../Utilities/Constants/GeneralConstants';
|
|
10
10
|
export class AgGridExportAdapter {
|
|
11
|
+
_adaptableInstance;
|
|
12
|
+
/**
|
|
13
|
+
* !!!
|
|
14
|
+
* do NOT mutate this array reference, this is passed only initially to AG Grid and we can only change it's internal state
|
|
15
|
+
*/
|
|
16
|
+
DANGER_excelStyles = [];
|
|
17
|
+
originalExcelStyles = [];
|
|
18
|
+
excelStylesCache = {};
|
|
19
|
+
cellOrHeaderClassKey2ExcelStyleIdMap = {};
|
|
20
|
+
excelStylesWithFormattedDate = {};
|
|
11
21
|
constructor(_adaptableInstance) {
|
|
12
22
|
this._adaptableInstance = _adaptableInstance;
|
|
13
|
-
/**
|
|
14
|
-
* !!!
|
|
15
|
-
* do NOT mutate this array reference, this is passed only initially to AG Grid and we can only change it's internal state
|
|
16
|
-
*/
|
|
17
|
-
this.DANGER_excelStyles = [];
|
|
18
|
-
this.originalExcelStyles = [];
|
|
19
|
-
this.excelStylesCache = {};
|
|
20
|
-
this.cellOrHeaderClassKey2ExcelStyleIdMap = {};
|
|
21
|
-
this.excelStylesWithFormattedDate = {};
|
|
22
23
|
}
|
|
23
24
|
get agGridApi() {
|
|
24
25
|
return this._adaptableInstance.agGridAdapter.getAgGridApi();
|
|
@@ -14,6 +14,10 @@ export const AgGridFilterAdapterFactory = (adaptable) => {
|
|
|
14
14
|
return 'filter_' + colId + '_' + adaptable.adaptableOptions.adaptableId;
|
|
15
15
|
}
|
|
16
16
|
return class AgGridFilterAdapter {
|
|
17
|
+
params;
|
|
18
|
+
filterContainer;
|
|
19
|
+
column;
|
|
20
|
+
unmountReactRoot;
|
|
17
21
|
init(params) {
|
|
18
22
|
this.params = params;
|
|
19
23
|
this.column = params.column;
|
|
@@ -3,6 +3,7 @@ import { iconToString } from '../components/icons';
|
|
|
3
3
|
import ArrayExtensions from '../Utilities/Extensions/ArrayExtensions';
|
|
4
4
|
import { MENU_SEPARATOR } from '../Utilities/Constants/GeneralConstants';
|
|
5
5
|
export class AgGridMenuAdapter {
|
|
6
|
+
_adaptableInstance;
|
|
6
7
|
constructor(_adaptableInstance) {
|
|
7
8
|
this._adaptableInstance = _adaptableInstance;
|
|
8
9
|
}
|
|
@@ -2,9 +2,10 @@ import { AdaptableLogger } from '.';
|
|
|
2
2
|
import { AllEnterpriseModule } from 'ag-grid-enterprise';
|
|
3
3
|
export const AG_GRID_VERSION = AllEnterpriseModule.version;
|
|
4
4
|
export class AgGridModulesAdapter {
|
|
5
|
+
adaptableInstance;
|
|
6
|
+
allAgGridModules = new Set();
|
|
5
7
|
constructor(adaptableInstance) {
|
|
6
8
|
this.adaptableInstance = adaptableInstance;
|
|
7
|
-
this.allAgGridModules = new Set();
|
|
8
9
|
this.allAgGridModules = this.extractAgGridModuleNames(AllEnterpriseModule);
|
|
9
10
|
}
|
|
10
11
|
destroy() {
|
|
@@ -97,6 +97,11 @@ export const ReactActionColumnRenderer = (props) => {
|
|
|
97
97
|
React.createElement(ActionButtons, { buttons: actionButtons, adaptableApi: adaptable.api, context: buttonContext, rerender: rerender })));
|
|
98
98
|
};
|
|
99
99
|
export class ActionColumnRenderer {
|
|
100
|
+
eGui;
|
|
101
|
+
eventListener;
|
|
102
|
+
unmountReactRoot;
|
|
103
|
+
layoutSwitchUnsubscribe;
|
|
104
|
+
actionButtons;
|
|
100
105
|
// gets called once before the renderer is used
|
|
101
106
|
init(params) {
|
|
102
107
|
const adaptable = params.context.__adaptable;
|
|
@@ -3,6 +3,8 @@ import { renderWithAdaptableContext } from '../../View/renderWithAdaptableContex
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
export const getBadgeRendererForColumn = (badgeStyle, abColumn, api) => {
|
|
5
5
|
return class BadgetRenderer {
|
|
6
|
+
eGui;
|
|
7
|
+
unmountReactRoot;
|
|
6
8
|
getAdaptableInstance(params) {
|
|
7
9
|
const adaptable = params.context.__adaptable;
|
|
8
10
|
return adaptable;
|
|
@@ -5,6 +5,7 @@ export const getPercentBarRendererForColumn = (styledColumn, abColumn, api) => {
|
|
|
5
5
|
return;
|
|
6
6
|
}
|
|
7
7
|
return class PercentBarRenderer {
|
|
8
|
+
eGui;
|
|
8
9
|
init(params) {
|
|
9
10
|
const min = api.styledColumnApi.internalApi.getNumericStyleMinValue(styledColumn, abColumn, params.node, params.value);
|
|
10
11
|
const max = api.styledColumnApi.internalApi.getNumericStyleMaxValue(styledColumn, abColumn, params.node, params.value);
|
|
@@ -94,9 +94,12 @@ export const AdaptableReactDateEditor = forwardRef((props, ref) => {
|
|
|
94
94
|
* We strongly recommend you specify a `colDef.valueParser` function
|
|
95
95
|
*/
|
|
96
96
|
export class AdaptableDateEditor {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
value;
|
|
98
|
+
el;
|
|
99
|
+
params;
|
|
100
|
+
editor;
|
|
101
|
+
unmountReactRoot;
|
|
102
|
+
valueParser = defaultDateValueParser;
|
|
100
103
|
init(params) {
|
|
101
104
|
this.value = getStartValue(params);
|
|
102
105
|
const { valueParser } = params.column.getColDef();
|
|
@@ -81,18 +81,13 @@ AdaptableReactNumberEditor.displayName = 'AdaptableReactNumberEditor';
|
|
|
81
81
|
* Number Editor provided by AdapTable and used by default for all `number` columns
|
|
82
82
|
*/
|
|
83
83
|
export class AdaptableNumberEditor {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
newValue: value,
|
|
92
|
-
})
|
|
93
|
-
: value;
|
|
94
|
-
};
|
|
95
|
-
}
|
|
84
|
+
value;
|
|
85
|
+
columnId;
|
|
86
|
+
el;
|
|
87
|
+
params;
|
|
88
|
+
editor;
|
|
89
|
+
valueParser = defaultValueParser;
|
|
90
|
+
unmountReactRoot;
|
|
96
91
|
init(params) {
|
|
97
92
|
this.value = getStartValue(params);
|
|
98
93
|
this.params = params;
|
|
@@ -143,4 +138,13 @@ export class AdaptableNumberEditor {
|
|
|
143
138
|
destroy() {
|
|
144
139
|
this.unmountReactRoot?.();
|
|
145
140
|
}
|
|
141
|
+
onValueChange = (value) => {
|
|
142
|
+
this.value = this.valueParser
|
|
143
|
+
? this.valueParser({
|
|
144
|
+
...this.params,
|
|
145
|
+
oldValue: this.params.value,
|
|
146
|
+
newValue: value,
|
|
147
|
+
})
|
|
148
|
+
: value;
|
|
149
|
+
};
|
|
146
150
|
}
|
|
@@ -65,19 +65,13 @@ AdaptableReactPercentageEditor.displayName = 'AdaptableReactPercentageEditor';
|
|
|
65
65
|
* Used to edit percentage columns as percentages (similar to how its done in Excel)
|
|
66
66
|
*/
|
|
67
67
|
export class AdaptablePercentageEditor {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
newValue: value,
|
|
76
|
-
})
|
|
77
|
-
: value;
|
|
78
|
-
this.value = NumberExtensions.divideBy100(newValue);
|
|
79
|
-
};
|
|
80
|
-
}
|
|
68
|
+
value;
|
|
69
|
+
columnId;
|
|
70
|
+
el;
|
|
71
|
+
params;
|
|
72
|
+
editor;
|
|
73
|
+
valueParser = defaultValueParser;
|
|
74
|
+
unmountReactRoot;
|
|
81
75
|
init(params) {
|
|
82
76
|
this.value = getStartValue(params);
|
|
83
77
|
this.params = params;
|
|
@@ -128,4 +122,14 @@ export class AdaptablePercentageEditor {
|
|
|
128
122
|
destroy() {
|
|
129
123
|
this.unmountReactRoot?.();
|
|
130
124
|
}
|
|
125
|
+
onValueChange = (value) => {
|
|
126
|
+
const newValue = this.valueParser
|
|
127
|
+
? this.valueParser({
|
|
128
|
+
...this.params,
|
|
129
|
+
oldValue: this.params.value,
|
|
130
|
+
newValue: value,
|
|
131
|
+
})
|
|
132
|
+
: value;
|
|
133
|
+
this.value = NumberExtensions.divideBy100(newValue);
|
|
134
|
+
};
|
|
131
135
|
}
|
package/src/agGrid/index.d.ts
CHANGED
|
@@ -2,5 +2,11 @@ import { Adaptable, AdaptableNoCodeWizard as ABWizard } from './Adaptable';
|
|
|
2
2
|
import { AdaptableLogger as ABLogger } from './AdaptableLogger';
|
|
3
3
|
export { default as AdaptableWizardView } from '../View/AdaptableWizardView';
|
|
4
4
|
export default Adaptable;
|
|
5
|
+
/**
|
|
6
|
+
* AdapTable's No Code Wizard
|
|
7
|
+
*/
|
|
5
8
|
export declare const AdaptableNoCodeWizard: typeof ABWizard;
|
|
9
|
+
/**
|
|
10
|
+
* AdapTable's Logger
|
|
11
|
+
*/
|
|
6
12
|
export declare const AdaptableLogger: typeof ABLogger;
|
package/src/agGrid/index.js
CHANGED
|
@@ -4,5 +4,11 @@ AdaptableNoCodeWizard as ABWizard, } from './Adaptable';
|
|
|
4
4
|
import { AdaptableLogger as ABLogger } from './AdaptableLogger';
|
|
5
5
|
export { default as AdaptableWizardView } from '../View/AdaptableWizardView';
|
|
6
6
|
export default Adaptable;
|
|
7
|
+
/**
|
|
8
|
+
* AdapTable's No Code Wizard
|
|
9
|
+
*/
|
|
7
10
|
export const AdaptableNoCodeWizard = ABWizard;
|
|
11
|
+
/**
|
|
12
|
+
* AdapTable's Logger
|
|
13
|
+
*/
|
|
8
14
|
export const AdaptableLogger = ABLogger;
|
|
@@ -112,7 +112,7 @@ export const Datepicker = React.forwardRef((props, ref) => {
|
|
|
112
112
|
}, accessLevel: 'Full' })) : null;
|
|
113
113
|
const calendarButton = (React.createElement(SimpleButton, { disabled: disabled, variant: "text", icon: "calendar", tooltip: "Date", iconSize: 20, className: "twa:p-0", onClick: () => setVisible(true) }));
|
|
114
114
|
const overlayDOMRef = useRef(null);
|
|
115
|
-
return (React.createElement(Flex,
|
|
115
|
+
return (React.createElement(Flex, { className: "twa:flex-1" },
|
|
116
116
|
React.createElement(OverlayTrigger, { visible: visible, render: () => (React.createElement(DatepickerOverlay, { overlayDOMRef: overlayDOMRef, onMouseDown: props.onMouseDown, onHide: () => setVisible(false), onKeyDown: (e) => {
|
|
117
117
|
if (e.key === 'Escape' || e.key === 'Enter') {
|
|
118
118
|
setVisible(false, e.key);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const OVERLAY_BASE_Z_INDEX =
|
|
1
|
+
export const OVERLAY_BASE_Z_INDEX = 9_999_999;
|
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
import { useCallback, useRef } from 'react';
|
|
2
2
|
class SectionSelector {
|
|
3
|
+
scrollTop = 0;
|
|
4
|
+
node;
|
|
5
|
+
boxHeight;
|
|
6
|
+
childrenHeights = [];
|
|
7
|
+
maxScrollTop;
|
|
3
8
|
constructor(node) {
|
|
4
|
-
this.scrollTop = 0;
|
|
5
|
-
this.childrenHeights = [];
|
|
6
|
-
this.select = (scrollTop) => {
|
|
7
|
-
this.refreshFromDOM();
|
|
8
|
-
const relativeCurrentHeight = (scrollTop * this.boxHeight) / this.maxScrollTop;
|
|
9
|
-
let heightSum = 0;
|
|
10
|
-
for (let i = 0, len = this.childrenHeights.length; i < len; i++) {
|
|
11
|
-
heightSum += this.childrenHeights[i];
|
|
12
|
-
if (heightSum > relativeCurrentHeight) {
|
|
13
|
-
return i;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return this.childrenHeights.length - 1;
|
|
17
|
-
};
|
|
18
9
|
this.node = node;
|
|
19
10
|
this.refreshFromDOM();
|
|
20
11
|
}
|
|
@@ -33,6 +24,18 @@ class SectionSelector {
|
|
|
33
24
|
height,
|
|
34
25
|
};
|
|
35
26
|
}
|
|
27
|
+
select = (scrollTop) => {
|
|
28
|
+
this.refreshFromDOM();
|
|
29
|
+
const relativeCurrentHeight = (scrollTop * this.boxHeight) / this.maxScrollTop;
|
|
30
|
+
let heightSum = 0;
|
|
31
|
+
for (let i = 0, len = this.childrenHeights.length; i < len; i++) {
|
|
32
|
+
heightSum += this.childrenHeights[i];
|
|
33
|
+
if (heightSum > relativeCurrentHeight) {
|
|
34
|
+
return i;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return this.childrenHeights.length - 1;
|
|
38
|
+
};
|
|
36
39
|
}
|
|
37
40
|
export const useContainerScrollObserver = (callback) => {
|
|
38
41
|
const containerNodeRef = useRef(null);
|