@adaptabletools/adaptable-cjs 18.0.2 → 18.0.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable-cjs",
3
- "version": "18.0.2",
3
+ "version": "18.0.3",
4
4
  "description": "Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
5
5
  "keywords": [
6
6
  "web-components",
@@ -114,6 +114,11 @@ export declare class AdaptableAgGrid implements IAdaptable {
114
114
  renderReactRoot: RenderReactRootFn;
115
115
  private unmountReactRoot?;
116
116
  private unmountLoadingScreen?;
117
+ /**
118
+ * do NOT mutate this array reference, this is passed only initially to AG Grid and we can only change it's internal state
119
+ */
120
+ private DANGER_excelStyles;
121
+ private originalExcelStyles;
117
122
  /**
118
123
  * Temporary, these are MIGRATION technical debts, and should be removed as soon as possible
119
124
  */
@@ -151,6 +151,11 @@ class AdaptableAgGrid {
151
151
  this.previousAgGridLayoutState = '';
152
152
  this.columnMinMaxValuesCache = {};
153
153
  this.renderReactRoot = (node, container) => (0, renderReactRoot_1.renderReactRoot)(node, container);
154
+ /**
155
+ * do NOT mutate this array reference, this is passed only initially to AG Grid and we can only change it's internal state
156
+ */
157
+ this.DANGER_excelStyles = [];
158
+ this.originalExcelStyles = [];
154
159
  /**
155
160
  * Temporary, these are MIGRATION technical debts, and should be removed as soon as possible
156
161
  */
@@ -906,8 +911,10 @@ class AdaptableAgGrid {
906
911
  * `excelStyles`
907
912
  */
908
913
  this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'excelStyles', (original_excelStyles) => {
909
- // we need this here just to register the original excelStyles in the service
910
- return original_excelStyles;
914
+ this.originalExcelStyles = original_excelStyles !== null && original_excelStyles !== void 0 ? original_excelStyles : [];
915
+ this.DANGER_excelStyles = this.originalExcelStyles;
916
+ // this array reference will be used for the entire AG Grid session
917
+ return this.DANGER_excelStyles;
911
918
  });
912
919
  /**
913
920
  * `processPivotResultColDef`
@@ -3062,7 +3069,9 @@ class AdaptableAgGrid {
3062
3069
  exportVisualDataToExcel() {
3063
3070
  try {
3064
3071
  const exportExcelStyles = this.ReportService.buildExcelStylesForVisualReports();
3065
- this.agGridOptionsService.CAREFUL_patchGridOptionsProperty('excelStyles', exportExcelStyles);
3072
+ // set DANGER_excelStyles without changing the array reference
3073
+ this.DANGER_excelStyles.splice(0, this.DANGER_excelStyles.length, ...exportExcelStyles);
3074
+ // this.agGridOptionsService.CAREFUL_patchGridOptionsProperty('excelStyles', exportExcelStyles);
3066
3075
  this.agGridAdapter.getAgGridApi().exportDataAsExcel({
3067
3076
  sheetName: 'Sheet 1',
3068
3077
  fileName: this.ReportService.getReportFileName(this.adaptableOptions.adaptableId, 'Excel'),
@@ -3100,7 +3109,7 @@ class AdaptableAgGrid {
3100
3109
  return summary;
3101
3110
  },
3102
3111
  });
3103
- this.agGridOptionsService.revertGridOptionsPropertyToUserValue('excelStyles');
3112
+ this.DANGER_excelStyles.splice(0, this.DANGER_excelStyles.length, ...this.originalExcelStyles);
3104
3113
  }
3105
3114
  catch (error) {
3106
3115
  this.logger.consoleError('Error exporting visual data to Excel', error);
@@ -9,7 +9,6 @@ export declare class AgGridOptionsService {
9
9
  setGridOptionsProperty<T extends keyof GridOptions>(gridOptions: GridOptions, propertyName: T, propertyGetter: (userPropertyValue: GridOptions[T]) => GridOptions[T] | undefined): GridOptions;
10
10
  getUserGridOptionsProperty<T extends keyof GridOptions>(propertyName: T): GridOptions[T];
11
11
  revertGridOptionsPropertyToUserValue(propertyName: ManagedGridOptionKey): void;
12
- CAREFUL_patchGridOptionsProperty<T extends keyof GridOptions>(propertyName: T, value: GridOptions[T]): void;
13
12
  revertGridOptionsPropertiesToUserValue<T extends keyof GridOptions>(gridOptions: GridOptions, propertyNames: T[]): void;
14
13
  private get agGridAdapter();
15
14
  }
@@ -52,19 +52,6 @@ class AgGridOptionsService {
52
52
  const userValue = this.gridOptionsPropertyCache.get(userKey);
53
53
  this.agGridAdapter.setGridOption(propertyName, userValue);
54
54
  }
55
- CAREFUL_patchGridOptionsProperty(propertyName, value) {
56
- var _a;
57
- // @ts-ignore this is required to set gridOptions peroperties which are marked as initial (writable once, before grid is initialised)
58
- const gos = (_a = this.agGridAdapter.getAgGridApi()) === null || _a === void 0 ? void 0 : _a.gos;
59
- if (gos) {
60
- gos.updateGridOptions({
61
- options: {
62
- [propertyName]: value,
63
- },
64
- source: 'api',
65
- });
66
- }
67
- }
68
55
  revertGridOptionsPropertiesToUserValue(gridOptions, propertyNames) {
69
56
  for (const propertyName of propertyNames) {
70
57
  // see this.setGridOptionsProperty(...)
package/src/env.js CHANGED
@@ -2,6 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = {
4
4
  INFINITE_TABLE_LICENSE_KEY: "StartDate=2021-06-29|EndDate=2030-01-01|Owner=Adaptable|Type=distribution|TS=1624971462479|C=137829811,1004007071,2756196225,1839832928,3994409405,636616862" || '',
5
- PUBLISH_TIMESTAMP: 1713453412882 || Date.now(),
6
- VERSION: "18.0.2" || '--current-version--',
5
+ PUBLISH_TIMESTAMP: 1713539999695 || Date.now(),
6
+ VERSION: "18.0.3" || '--current-version--',
7
7
  };