@adaptabletools/adaptable-cjs 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 +19 -18
- 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.cjs.tsbuildinfo +1 -1
|
@@ -15,22 +15,6 @@ const icons_1 = require("../../components/icons");
|
|
|
15
15
|
const ThemeSelector_1 = require("./ThemeSelector");
|
|
16
16
|
const Flex_1 = require("../../components/Flex");
|
|
17
17
|
class ThemePopupComponent extends React.Component {
|
|
18
|
-
constructor() {
|
|
19
|
-
super(...arguments);
|
|
20
|
-
this.handleCreateNewTheme = (variant) => {
|
|
21
|
-
let nthItem = this.props.UserThemes.length + 1;
|
|
22
|
-
let name = 'Custom-Theme-' + nthItem;
|
|
23
|
-
// make sure it is unique
|
|
24
|
-
while (this.props.UserThemes.some((theme) => theme.Name === name)) {
|
|
25
|
-
nthItem++;
|
|
26
|
-
name = 'Custom-Theme-' + nthItem;
|
|
27
|
-
}
|
|
28
|
-
const newTheme = ObjectFactory_1.default.CreateEmptyTheme(name);
|
|
29
|
-
newTheme.Variant = variant;
|
|
30
|
-
this.props.api.themeApi.addUserTheme(newTheme);
|
|
31
|
-
this.props.api.themeApi.loadTheme(newTheme.Name);
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
18
|
render() {
|
|
35
19
|
const isCustomTheme = this.props.api.themeApi
|
|
36
20
|
.getUserThemes()
|
|
@@ -63,6 +47,19 @@ class ThemePopupComponent extends React.Component {
|
|
|
63
47
|
onChangeTheme(value) {
|
|
64
48
|
this.props.SelectTheme(value);
|
|
65
49
|
}
|
|
50
|
+
handleCreateNewTheme = (variant) => {
|
|
51
|
+
let nthItem = this.props.UserThemes.length + 1;
|
|
52
|
+
let name = 'Custom-Theme-' + nthItem;
|
|
53
|
+
// make sure it is unique
|
|
54
|
+
while (this.props.UserThemes.some((theme) => theme.Name === name)) {
|
|
55
|
+
nthItem++;
|
|
56
|
+
name = 'Custom-Theme-' + nthItem;
|
|
57
|
+
}
|
|
58
|
+
const newTheme = ObjectFactory_1.default.CreateEmptyTheme(name);
|
|
59
|
+
newTheme.Variant = variant;
|
|
60
|
+
this.props.api.themeApi.addUserTheme(newTheme);
|
|
61
|
+
this.props.api.themeApi.loadTheme(newTheme.Name);
|
|
62
|
+
};
|
|
66
63
|
}
|
|
67
64
|
function mapStateToProps(state, ownProps) {
|
|
68
65
|
return {
|
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;
|
|
@@ -159,38 +159,77 @@ LocalEventService_Prototype.dispatchEvent = function (event) {
|
|
|
159
159
|
const adaptableInstances = {};
|
|
160
160
|
const publishTimestamp = Number(EnvVars_1.ADAPTABLE_PUBLISH_TIMESTAMP);
|
|
161
161
|
class AdaptableAgGrid {
|
|
162
|
+
logger;
|
|
163
|
+
_id;
|
|
164
|
+
lifecycleState;
|
|
165
|
+
variant;
|
|
166
|
+
emitter;
|
|
167
|
+
/**
|
|
168
|
+
* Runtime flags
|
|
169
|
+
*/
|
|
170
|
+
hasAutogeneratedPrimaryKey;
|
|
171
|
+
hasAdaptableToolPanel;
|
|
172
|
+
initWithLazyData;
|
|
173
|
+
_rawAdaptableOptions;
|
|
174
|
+
adaptableOptions;
|
|
175
|
+
_isDetailGrid;
|
|
176
|
+
_isDetailGridForIndex;
|
|
177
|
+
agGridOptionsService;
|
|
178
|
+
agGridAdapter;
|
|
179
|
+
agGridColumnAdapter;
|
|
180
|
+
agGridMenuAdapter;
|
|
181
|
+
agGridExportAdapter;
|
|
182
|
+
agGridThemeAdapter;
|
|
183
|
+
agGridModulesAdapter;
|
|
184
|
+
DANGER_USE_GETTER_adaptableContainerElement;
|
|
185
|
+
DANGER_USE_GETTER_agGridContainerElement;
|
|
186
|
+
api;
|
|
187
|
+
adaptableStore;
|
|
188
|
+
adaptableModules;
|
|
189
|
+
DataService;
|
|
190
|
+
CalculatedColumnExpressionService;
|
|
191
|
+
ModuleService;
|
|
192
|
+
ValidationService;
|
|
193
|
+
QueryLanguageService;
|
|
194
|
+
AlertService;
|
|
195
|
+
TeamSharingService;
|
|
196
|
+
MetamodelService;
|
|
197
|
+
RowFormService;
|
|
198
|
+
Fdc3Service;
|
|
199
|
+
AnnotationsService;
|
|
200
|
+
FlashingCellService;
|
|
201
|
+
LicenseService;
|
|
202
|
+
ChartingService;
|
|
203
|
+
ThemeService;
|
|
204
|
+
rowListeners;
|
|
205
|
+
throttleFilterOnDataChange;
|
|
206
|
+
debouncedSetSelectedRows;
|
|
207
|
+
debouncedSetSelectedCells;
|
|
208
|
+
agGridListenerKeydown;
|
|
209
|
+
agGridListenerMouseEnter;
|
|
210
|
+
agGridListenerMouseLeave;
|
|
211
|
+
listenerGlobalSetRowSelection;
|
|
212
|
+
listenerGlobalChartingChanges;
|
|
213
|
+
listenerCellEditingStarted;
|
|
214
|
+
listenerFirstDataRendered;
|
|
215
|
+
listenerPivotChanged;
|
|
216
|
+
listenerCellSelectionChanged;
|
|
217
|
+
listenerSortChanged;
|
|
218
|
+
listenerColumnGroupOpened;
|
|
219
|
+
layoutManager;
|
|
220
|
+
columnMinMaxValuesCache = {};
|
|
221
|
+
renderReactRoot = (node, container) => (0, renderReactRoot_1.renderReactRoot)(node, container);
|
|
222
|
+
unmountReactRoot;
|
|
223
|
+
unmountLoadingScreen;
|
|
224
|
+
/**
|
|
225
|
+
* Temporary, these are MIGRATION technical debts, and should be removed as soon as possible
|
|
226
|
+
*/
|
|
227
|
+
adaptableStatusPanelKeys = [];
|
|
228
|
+
// see #no_additional_react_root
|
|
229
|
+
_PRIVATE_adaptableJSXElement;
|
|
230
|
+
_prevLayout;
|
|
231
|
+
__prevLayoutForRefresh;
|
|
162
232
|
constructor(config) {
|
|
163
|
-
this.columnMinMaxValuesCache = {};
|
|
164
|
-
this.renderReactRoot = (node, container) => (0, renderReactRoot_1.renderReactRoot)(node, container);
|
|
165
|
-
/**
|
|
166
|
-
* Temporary, these are MIGRATION technical debts, and should be removed as soon as possible
|
|
167
|
-
*/
|
|
168
|
-
this.adaptableStatusPanelKeys = [];
|
|
169
|
-
// only for our private / internal events used within Adaptable
|
|
170
|
-
// public events are emitted through the EventApi
|
|
171
|
-
this._emit = (eventName, data) => {
|
|
172
|
-
if (this.emitter) {
|
|
173
|
-
return this.emitter.emit(eventName, data);
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
this._emitSync = (eventName, data) => {
|
|
177
|
-
if (this.emitter) {
|
|
178
|
-
return this.emitter.emitSync(eventName, data);
|
|
179
|
-
}
|
|
180
|
-
};
|
|
181
|
-
this._on = (eventName, callback) => {
|
|
182
|
-
if (!this.emitter) {
|
|
183
|
-
return () => { };
|
|
184
|
-
}
|
|
185
|
-
return this.emitter.on(eventName, callback);
|
|
186
|
-
};
|
|
187
|
-
this._onIncludeFired = (eventName, callback) => {
|
|
188
|
-
if (!this.emitter) {
|
|
189
|
-
return () => { };
|
|
190
|
-
}
|
|
191
|
-
return this.emitter.onIncludeFired(eventName, callback);
|
|
192
|
-
};
|
|
193
|
-
this.__updateColumnModelAndRefreshGrid_already_called = false;
|
|
194
233
|
this.lifecycleState = 'initial';
|
|
195
234
|
this.emitter = new Emitter_1.default();
|
|
196
235
|
this.agGridOptionsService = new AgGridOptionsService_1.AgGridOptionsService(this);
|
|
@@ -226,6 +265,30 @@ class AdaptableAgGrid {
|
|
|
226
265
|
get isDestroyed() {
|
|
227
266
|
return this.lifecycleState === 'preDestroyed';
|
|
228
267
|
}
|
|
268
|
+
// only for our private / internal events used within Adaptable
|
|
269
|
+
// public events are emitted through the EventApi
|
|
270
|
+
_emit = (eventName, data) => {
|
|
271
|
+
if (this.emitter) {
|
|
272
|
+
return this.emitter.emit(eventName, data);
|
|
273
|
+
}
|
|
274
|
+
};
|
|
275
|
+
_emitSync = (eventName, data) => {
|
|
276
|
+
if (this.emitter) {
|
|
277
|
+
return this.emitter.emitSync(eventName, data);
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
_on = (eventName, callback) => {
|
|
281
|
+
if (!this.emitter) {
|
|
282
|
+
return () => { };
|
|
283
|
+
}
|
|
284
|
+
return this.emitter.on(eventName, callback);
|
|
285
|
+
};
|
|
286
|
+
_onIncludeFired = (eventName, callback) => {
|
|
287
|
+
if (!this.emitter) {
|
|
288
|
+
return () => { };
|
|
289
|
+
}
|
|
290
|
+
return this.emitter.onIncludeFired(eventName, callback);
|
|
291
|
+
};
|
|
229
292
|
/**
|
|
230
293
|
* Internal initializer for Adaptable, directly called by the React and Angular Adaptable wrappers
|
|
231
294
|
* @private
|
|
@@ -658,11 +721,8 @@ You need to define at least one Layout!`);
|
|
|
658
721
|
// FIXME AFL FILTER why is this needed???
|
|
659
722
|
this.refreshSelectedCellsState();
|
|
660
723
|
this.refreshSelectedRowsState();
|
|
661
|
-
// FIXME AFL: this is temporary, will be replaced with v22's new autoCol filtering
|
|
662
|
-
const currentPivotLayoutHasAutoCols = this.api.layoutApi.isCurrentLayoutPivot() &&
|
|
663
|
-
!!this.api.layoutApi.getCurrentRowGroupsColumnIds()?.length;
|
|
664
724
|
// agGridApi.setFilterModel() already triggered onFilterChanged(), so we skip it if updateColumnFilterModel is TRUE
|
|
665
|
-
if (!filteringApplied
|
|
725
|
+
if (!filteringApplied) {
|
|
666
726
|
agGridApi.onFilterChanged();
|
|
667
727
|
filteringApplied = true;
|
|
668
728
|
}
|
|
@@ -789,7 +849,8 @@ You need to define at least one Layout!`);
|
|
|
789
849
|
return original_autoGroupColumnDef;
|
|
790
850
|
}
|
|
791
851
|
if (typeof original_autoGroupColumnDef?.filter === 'object') {
|
|
792
|
-
this.logger.
|
|
852
|
+
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!
|
|
853
|
+
Please contact the Adaptable Support Team for further assistance and investigation.`);
|
|
793
854
|
return original_autoGroupColumnDef;
|
|
794
855
|
}
|
|
795
856
|
const autoGroupColumnDef = { ...original_autoGroupColumnDef };
|
|
@@ -797,7 +858,8 @@ You need to define at least one Layout!`);
|
|
|
797
858
|
// !! DO NOT REMOVE THIS !!
|
|
798
859
|
// see https://github.com/ag-grid/ag-grid/blob/6f43ff257c2e285068eb425b655e58d6eeb89816/packages/ag-grid-enterprise/src/rowHierarchy/autoColService.ts#L225
|
|
799
860
|
autoGroupColumnDef.filterValueGetter = (params) => {
|
|
800
|
-
this.logger.
|
|
861
|
+
this.logger.consoleWarn(`An unexpected invocation of autoGroupColumnDef.filterValueGetter was detected. This execution path is not expected under normal operation.
|
|
862
|
+
Please contact the Adaptable Support Team for further assistance and investigation.`, params);
|
|
801
863
|
return '';
|
|
802
864
|
};
|
|
803
865
|
// !! it is important that we always return the same component / handler instances
|
|
@@ -2073,6 +2135,7 @@ You need to define at least one Layout!`);
|
|
|
2073
2135
|
}
|
|
2074
2136
|
return rawValue;
|
|
2075
2137
|
}
|
|
2138
|
+
__updateColumnModelAndRefreshGrid_already_called = false;
|
|
2076
2139
|
updateColumnModelAndRefreshGrid() {
|
|
2077
2140
|
if (this.__updateColumnModelAndRefreshGrid_already_called) {
|
|
2078
2141
|
return;
|
|
@@ -2408,6 +2471,66 @@ You need to define at least one Layout!`);
|
|
|
2408
2471
|
});
|
|
2409
2472
|
}
|
|
2410
2473
|
}
|
|
2474
|
+
async applyGridDataTransaction(dataTransaction, config = {}) {
|
|
2475
|
+
const result = {
|
|
2476
|
+
addedRows: [],
|
|
2477
|
+
updatedRows: [],
|
|
2478
|
+
removedRows: [],
|
|
2479
|
+
};
|
|
2480
|
+
if (!dataTransaction) {
|
|
2481
|
+
return result;
|
|
2482
|
+
}
|
|
2483
|
+
const addDataRows = dataTransaction.add;
|
|
2484
|
+
const updateDataRows = dataTransaction.update;
|
|
2485
|
+
const removeDataRows = dataTransaction.remove;
|
|
2486
|
+
if (this.hasAutogeneratedPrimaryKey) {
|
|
2487
|
+
this.addSyntheticPrimaryKeyIfMissing(addDataRows);
|
|
2488
|
+
}
|
|
2489
|
+
if (config.runAsync) {
|
|
2490
|
+
return new Promise((resolve) => {
|
|
2491
|
+
this.applyAgGridTransactionAsync({
|
|
2492
|
+
update: updateDataRows,
|
|
2493
|
+
add: addDataRows,
|
|
2494
|
+
remove: removeDataRows,
|
|
2495
|
+
addIndex: config.addIndex,
|
|
2496
|
+
}, (transaction) => {
|
|
2497
|
+
if (typeof config.callback === 'function') {
|
|
2498
|
+
config.callback(transaction);
|
|
2499
|
+
}
|
|
2500
|
+
if (transaction?.add) {
|
|
2501
|
+
this.updateRowGroupsAndColumnGroupsExpandedState();
|
|
2502
|
+
}
|
|
2503
|
+
resolve({
|
|
2504
|
+
addedRows: transaction?.add,
|
|
2505
|
+
updatedRows: transaction?.update,
|
|
2506
|
+
removedRows: transaction?.remove,
|
|
2507
|
+
});
|
|
2508
|
+
});
|
|
2509
|
+
if (config.flushAsync) {
|
|
2510
|
+
this.agGridAdapter.getAgGridApi().flushAsyncTransactions();
|
|
2511
|
+
}
|
|
2512
|
+
});
|
|
2513
|
+
}
|
|
2514
|
+
else {
|
|
2515
|
+
const transaction = this.applyAgGridTransaction({
|
|
2516
|
+
update: updateDataRows,
|
|
2517
|
+
add: addDataRows,
|
|
2518
|
+
remove: removeDataRows,
|
|
2519
|
+
addIndex: config.addIndex,
|
|
2520
|
+
});
|
|
2521
|
+
if (transaction?.add) {
|
|
2522
|
+
this.updateRowGroupsAndColumnGroupsExpandedState();
|
|
2523
|
+
}
|
|
2524
|
+
if (config.flushAsync) {
|
|
2525
|
+
this.agGridAdapter.getAgGridApi().flushAsyncTransactions();
|
|
2526
|
+
}
|
|
2527
|
+
return Promise.resolve({
|
|
2528
|
+
addedRows: transaction?.add,
|
|
2529
|
+
updatedRows: transaction?.update,
|
|
2530
|
+
removedRows: transaction?.remove,
|
|
2531
|
+
});
|
|
2532
|
+
}
|
|
2533
|
+
}
|
|
2411
2534
|
deleteRows(dataRows, dataUpdateConfig) {
|
|
2412
2535
|
dataUpdateConfig = dataUpdateConfig || {};
|
|
2413
2536
|
if (dataUpdateConfig.runAsync) {
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AdaptableFilterHandler = void 0;
|
|
4
4
|
class AdaptableFilterHandler {
|
|
5
|
+
adaptableApi;
|
|
6
|
+
colId;
|
|
7
|
+
filterDisplayValuesResult;
|
|
8
|
+
previousFilterDisplayValuesResult;
|
|
5
9
|
constructor(adaptableApi) {
|
|
6
10
|
this.adaptableApi = adaptableApi;
|
|
7
11
|
}
|
|
@@ -15,7 +15,17 @@ const errorOnce = (message) => {
|
|
|
15
15
|
errorOnceFlags[message] = true;
|
|
16
16
|
};
|
|
17
17
|
exports.errorOnce = errorOnce;
|
|
18
|
+
/**
|
|
19
|
+
* AdapTable's Logger
|
|
20
|
+
*/
|
|
18
21
|
class AdaptableLogger {
|
|
22
|
+
adaptableId;
|
|
23
|
+
debugger;
|
|
24
|
+
infoLogger;
|
|
25
|
+
successLogger;
|
|
26
|
+
warnLogger;
|
|
27
|
+
errorLogger;
|
|
28
|
+
perfLogger;
|
|
19
29
|
// use static loggers whenever access to AdaptableLogger instance is not feasible
|
|
20
30
|
static consoleErrorBase(message, ...optionalParams) {
|
|
21
31
|
if (optionalParams?.length) {
|
|
@@ -17,9 +17,19 @@ const AggregationColumns_1 = require("../AdaptableState/Common/AggregationColumn
|
|
|
17
17
|
const DANGER_AG_GRID_BEANS_MAP = {};
|
|
18
18
|
const getColumnApiModule = () => ag_grid_enterprise_1.ColumnApiModule;
|
|
19
19
|
class AgGridAdapter {
|
|
20
|
+
_adaptableInstance;
|
|
21
|
+
DANGER_USE_GETTER_gridApi;
|
|
22
|
+
DANGER_gridApi_from_args;
|
|
23
|
+
// see #gridOpts_monkey_patch
|
|
24
|
+
DANGER_updateGridOptionsMonkeyPatcher;
|
|
25
|
+
// see #aggColumnFilters_monkey_patch
|
|
26
|
+
DANGER_doFiltersPassMonkeyPatcher;
|
|
27
|
+
DANGER_isAggFilterPresentMonkeyPatcher;
|
|
28
|
+
activePivotColumnFilters_MEMO = new WeakMap();
|
|
29
|
+
initialGridOptions;
|
|
30
|
+
_agGridId;
|
|
20
31
|
constructor(_adaptableInstance, config) {
|
|
21
32
|
this._adaptableInstance = _adaptableInstance;
|
|
22
|
-
this.activePivotColumnFilters_MEMO = new WeakMap();
|
|
23
33
|
const columnApiModuleReference = config?.getAgGridColumnApiModuleReference?.() ?? getColumnApiModule();
|
|
24
34
|
const ColumnDefFactory_Prototype = columnApiModuleReference?.beans?.[0]?.prototype;
|
|
25
35
|
if (!ColumnDefFactory_Prototype) {
|
|
@@ -32,6 +32,8 @@ function getEditorForColumnDataType(columnDataType, variant) {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
class AgGridColumnAdapter {
|
|
35
|
+
adaptableInstance;
|
|
36
|
+
colDefPropertyCache;
|
|
35
37
|
constructor(adaptableInstance) {
|
|
36
38
|
this.adaptableInstance = adaptableInstance;
|
|
37
39
|
this.colDefPropertyCache = new Map();
|
|
@@ -12,17 +12,18 @@ const Uuid_1 = require("../AdaptableState/Uuid");
|
|
|
12
12
|
const udsv_1 = require("udsv");
|
|
13
13
|
const GeneralConstants_1 = require("../Utilities/Constants/GeneralConstants");
|
|
14
14
|
class AgGridExportAdapter {
|
|
15
|
+
_adaptableInstance;
|
|
16
|
+
/**
|
|
17
|
+
* !!!
|
|
18
|
+
* do NOT mutate this array reference, this is passed only initially to AG Grid and we can only change it's internal state
|
|
19
|
+
*/
|
|
20
|
+
DANGER_excelStyles = [];
|
|
21
|
+
originalExcelStyles = [];
|
|
22
|
+
excelStylesCache = {};
|
|
23
|
+
cellOrHeaderClassKey2ExcelStyleIdMap = {};
|
|
24
|
+
excelStylesWithFormattedDate = {};
|
|
15
25
|
constructor(_adaptableInstance) {
|
|
16
26
|
this._adaptableInstance = _adaptableInstance;
|
|
17
|
-
/**
|
|
18
|
-
* !!!
|
|
19
|
-
* do NOT mutate this array reference, this is passed only initially to AG Grid and we can only change it's internal state
|
|
20
|
-
*/
|
|
21
|
-
this.DANGER_excelStyles = [];
|
|
22
|
-
this.originalExcelStyles = [];
|
|
23
|
-
this.excelStylesCache = {};
|
|
24
|
-
this.cellOrHeaderClassKey2ExcelStyleIdMap = {};
|
|
25
|
-
this.excelStylesWithFormattedDate = {};
|
|
26
27
|
}
|
|
27
28
|
get agGridApi() {
|
|
28
29
|
return this._adaptableInstance.agGridAdapter.getAgGridApi();
|
|
@@ -18,6 +18,10 @@ const AgGridFilterAdapterFactory = (adaptable) => {
|
|
|
18
18
|
return 'filter_' + colId + '_' + adaptable.adaptableOptions.adaptableId;
|
|
19
19
|
}
|
|
20
20
|
return class AgGridFilterAdapter {
|
|
21
|
+
params;
|
|
22
|
+
filterContainer;
|
|
23
|
+
column;
|
|
24
|
+
unmountReactRoot;
|
|
21
25
|
init(params) {
|
|
22
26
|
this.params = params;
|
|
23
27
|
this.column = params.column;
|
|
@@ -7,6 +7,7 @@ const icons_1 = require("../components/icons");
|
|
|
7
7
|
const ArrayExtensions_1 = tslib_1.__importDefault(require("../Utilities/Extensions/ArrayExtensions"));
|
|
8
8
|
const GeneralConstants_1 = require("../Utilities/Constants/GeneralConstants");
|
|
9
9
|
class AgGridMenuAdapter {
|
|
10
|
+
_adaptableInstance;
|
|
10
11
|
constructor(_adaptableInstance) {
|
|
11
12
|
this._adaptableInstance = _adaptableInstance;
|
|
12
13
|
}
|
|
@@ -5,9 +5,10 @@ const _1 = require(".");
|
|
|
5
5
|
const ag_grid_enterprise_1 = require("ag-grid-enterprise");
|
|
6
6
|
exports.AG_GRID_VERSION = ag_grid_enterprise_1.AllEnterpriseModule.version;
|
|
7
7
|
class AgGridModulesAdapter {
|
|
8
|
+
adaptableInstance;
|
|
9
|
+
allAgGridModules = new Set();
|
|
8
10
|
constructor(adaptableInstance) {
|
|
9
11
|
this.adaptableInstance = adaptableInstance;
|
|
10
|
-
this.allAgGridModules = new Set();
|
|
11
12
|
this.allAgGridModules = this.extractAgGridModuleNames(ag_grid_enterprise_1.AllEnterpriseModule);
|
|
12
13
|
}
|
|
13
14
|
destroy() {
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AgGridOptionsService = void 0;
|
|
4
4
|
class AgGridOptionsService {
|
|
5
|
+
adaptableInstance;
|
|
6
|
+
gridOptionsPropertyCache;
|
|
7
|
+
colDefPropertyCache;
|
|
5
8
|
constructor(adaptableInstance) {
|
|
6
9
|
this.adaptableInstance = adaptableInstance;
|
|
7
10
|
this.gridOptionsPropertyCache = new Map();
|
|
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AgGridThemeAdapter = void 0;
|
|
4
4
|
const GeneralConstants_1 = require("../Utilities/Constants/GeneralConstants");
|
|
5
5
|
class AgGridThemeAdapter {
|
|
6
|
+
_adaptableInstance;
|
|
7
|
+
agGridThemeMode;
|
|
6
8
|
constructor(_adaptableInstance) {
|
|
7
9
|
this._adaptableInstance = _adaptableInstance;
|
|
8
10
|
}
|
|
@@ -102,6 +102,11 @@ const ReactActionColumnRenderer = (props) => {
|
|
|
102
102
|
};
|
|
103
103
|
exports.ReactActionColumnRenderer = ReactActionColumnRenderer;
|
|
104
104
|
class ActionColumnRenderer {
|
|
105
|
+
eGui;
|
|
106
|
+
eventListener;
|
|
107
|
+
unmountReactRoot;
|
|
108
|
+
layoutSwitchUnsubscribe;
|
|
109
|
+
actionButtons;
|
|
105
110
|
// gets called once before the renderer is used
|
|
106
111
|
init(params) {
|
|
107
112
|
const adaptable = params.context.__adaptable;
|
|
@@ -7,6 +7,8 @@ const renderWithAdaptableContext_1 = require("../../View/renderWithAdaptableCont
|
|
|
7
7
|
const React = tslib_1.__importStar(require("react"));
|
|
8
8
|
const getBadgeRendererForColumn = (badgeStyle, abColumn, api) => {
|
|
9
9
|
return class BadgetRenderer {
|
|
10
|
+
eGui;
|
|
11
|
+
unmountReactRoot;
|
|
10
12
|
getAdaptableInstance(params) {
|
|
11
13
|
const adaptable = params.context.__adaptable;
|
|
12
14
|
return adaptable;
|
|
@@ -9,6 +9,7 @@ const getPercentBarRendererForColumn = (styledColumn, abColumn, api) => {
|
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
11
|
return class PercentBarRenderer {
|
|
12
|
+
eGui;
|
|
12
13
|
init(params) {
|
|
13
14
|
const min = api.styledColumnApi.internalApi.getNumericStyleMinValue(styledColumn, abColumn, params.node, params.value);
|
|
14
15
|
const max = api.styledColumnApi.internalApi.getNumericStyleMaxValue(styledColumn, abColumn, params.node, params.value);
|
|
@@ -98,9 +98,12 @@ exports.AdaptableReactDateEditor = (0, react_1.forwardRef)((props, ref) => {
|
|
|
98
98
|
* We strongly recommend you specify a `colDef.valueParser` function
|
|
99
99
|
*/
|
|
100
100
|
class AdaptableDateEditor {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
value;
|
|
102
|
+
el;
|
|
103
|
+
params;
|
|
104
|
+
editor;
|
|
105
|
+
unmountReactRoot;
|
|
106
|
+
valueParser = defaultDateValueParser;
|
|
104
107
|
init(params) {
|
|
105
108
|
this.value = getStartValue(params);
|
|
106
109
|
const { valueParser } = params.column.getColDef();
|
|
@@ -86,18 +86,13 @@ exports.AdaptableReactNumberEditor.displayName = 'AdaptableReactNumberEditor';
|
|
|
86
86
|
* Number Editor provided by AdapTable and used by default for all `number` columns
|
|
87
87
|
*/
|
|
88
88
|
class AdaptableNumberEditor {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
newValue: value,
|
|
97
|
-
})
|
|
98
|
-
: value;
|
|
99
|
-
};
|
|
100
|
-
}
|
|
89
|
+
value;
|
|
90
|
+
columnId;
|
|
91
|
+
el;
|
|
92
|
+
params;
|
|
93
|
+
editor;
|
|
94
|
+
valueParser = defaultValueParser;
|
|
95
|
+
unmountReactRoot;
|
|
101
96
|
init(params) {
|
|
102
97
|
this.value = getStartValue(params);
|
|
103
98
|
this.params = params;
|
|
@@ -148,5 +143,14 @@ class AdaptableNumberEditor {
|
|
|
148
143
|
destroy() {
|
|
149
144
|
this.unmountReactRoot?.();
|
|
150
145
|
}
|
|
146
|
+
onValueChange = (value) => {
|
|
147
|
+
this.value = this.valueParser
|
|
148
|
+
? this.valueParser({
|
|
149
|
+
...this.params,
|
|
150
|
+
oldValue: this.params.value,
|
|
151
|
+
newValue: value,
|
|
152
|
+
})
|
|
153
|
+
: value;
|
|
154
|
+
};
|
|
151
155
|
}
|
|
152
156
|
exports.AdaptableNumberEditor = AdaptableNumberEditor;
|
|
@@ -69,19 +69,13 @@ exports.AdaptableReactPercentageEditor.displayName = 'AdaptableReactPercentageEd
|
|
|
69
69
|
* Used to edit percentage columns as percentages (similar to how its done in Excel)
|
|
70
70
|
*/
|
|
71
71
|
class AdaptablePercentageEditor {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
newValue: value,
|
|
80
|
-
})
|
|
81
|
-
: value;
|
|
82
|
-
this.value = NumberExtensions_1.default.divideBy100(newValue);
|
|
83
|
-
};
|
|
84
|
-
}
|
|
72
|
+
value;
|
|
73
|
+
columnId;
|
|
74
|
+
el;
|
|
75
|
+
params;
|
|
76
|
+
editor;
|
|
77
|
+
valueParser = defaultValueParser;
|
|
78
|
+
unmountReactRoot;
|
|
85
79
|
init(params) {
|
|
86
80
|
this.value = (0, AdaptableNumberEditor_1.getStartValue)(params);
|
|
87
81
|
this.params = params;
|
|
@@ -132,5 +126,15 @@ class AdaptablePercentageEditor {
|
|
|
132
126
|
destroy() {
|
|
133
127
|
this.unmountReactRoot?.();
|
|
134
128
|
}
|
|
129
|
+
onValueChange = (value) => {
|
|
130
|
+
const newValue = this.valueParser
|
|
131
|
+
? this.valueParser({
|
|
132
|
+
...this.params,
|
|
133
|
+
oldValue: this.params.value,
|
|
134
|
+
newValue: value,
|
|
135
|
+
})
|
|
136
|
+
: value;
|
|
137
|
+
this.value = NumberExtensions_1.default.divideBy100(newValue);
|
|
138
|
+
};
|
|
135
139
|
}
|
|
136
140
|
exports.AdaptablePercentageEditor = AdaptablePercentageEditor;
|
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
|
@@ -7,5 +7,11 @@ const AdaptableLogger_1 = require("./AdaptableLogger");
|
|
|
7
7
|
var AdaptableWizardView_1 = require("../View/AdaptableWizardView");
|
|
8
8
|
Object.defineProperty(exports, "AdaptableWizardView", { enumerable: true, get: function () { return tslib_1.__importDefault(AdaptableWizardView_1).default; } });
|
|
9
9
|
exports.default = Adaptable_1.Adaptable;
|
|
10
|
+
/**
|
|
11
|
+
* AdapTable's No Code Wizard
|
|
12
|
+
*/
|
|
10
13
|
exports.AdaptableNoCodeWizard = Adaptable_1.AdaptableNoCodeWizard;
|
|
14
|
+
/**
|
|
15
|
+
* AdapTable's Logger
|
|
16
|
+
*/
|
|
11
17
|
exports.AdaptableLogger = AdaptableLogger_1.AdaptableLogger;
|
|
@@ -116,7 +116,7 @@ exports.Datepicker = React.forwardRef((props, ref) => {
|
|
|
116
116
|
}, accessLevel: 'Full' })) : null;
|
|
117
117
|
const calendarButton = (React.createElement(SimpleButton_1.default, { disabled: disabled, variant: "text", icon: "calendar", tooltip: "Date", iconSize: 20, className: "twa:p-0", onClick: () => setVisible(true) }));
|
|
118
118
|
const overlayDOMRef = (0, react_1.useRef)(null);
|
|
119
|
-
return (React.createElement(Flex_1.Flex,
|
|
119
|
+
return (React.createElement(Flex_1.Flex, { className: "twa:flex-1" },
|
|
120
120
|
React.createElement(OverlayTrigger_1.default, { visible: visible, render: () => (React.createElement(DatepickerOverlay, { overlayDOMRef: overlayDOMRef, onMouseDown: props.onMouseDown, onHide: () => setVisible(false), onKeyDown: (e) => {
|
|
121
121
|
if (e.key === 'Escape' || e.key === 'Enter') {
|
|
122
122
|
setVisible(false, e.key);
|