@adaptabletools/adaptable-cjs 22.0.9 → 22.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable-cjs",
3
- "version": "22.0.9",
3
+ "version": "22.0.10",
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",
@@ -507,6 +507,7 @@ class AdaptableAgGrid {
507
507
  this.agGridAdapter.setAgGridApi(agGridApi);
508
508
  this.agGridAdapter.monkeyPatchingGridOptionsUpdates();
509
509
  this.agGridAdapter.monkeyPatchingAggColumnFilters();
510
+ this.agGridAdapter.monkeyPatchingAggFuncLabels();
510
511
  this.lifecycleState = 'agGridReady';
511
512
  this.api.entitlementApi.internalApi.setModulesAgGridDepsInfos();
512
513
  this.ModuleService.logMissingAgGridDepsInfos();
@@ -11,6 +11,7 @@ export declare class AgGridAdapter {
11
11
  private DANGER_updateGridOptionsMonkeyPatcher;
12
12
  private DANGER_doFiltersPassMonkeyPatcher;
13
13
  private DANGER_isAggFilterPresentMonkeyPatcher;
14
+ private DANGER_getDefaultFuncLabelMonkeyPatcher;
14
15
  private activePivotColumnFilters_MEMO;
15
16
  initialGridOptions: GridOptions;
16
17
  private _agGridId;
@@ -28,6 +29,7 @@ export declare class AgGridAdapter {
28
29
  getAgGridApi(skipLogging?: boolean): GridApi | undefined;
29
30
  monkeyPatchingGridOptionsUpdates(): void;
30
31
  monkeyPatchingAggColumnFilters(): void;
32
+ monkeyPatchingAggFuncLabels(): void;
31
33
  private DANGER_getPrivateAgGridBeans;
32
34
  DANGER_getLiveGridOptions(): GridOptions<any>;
33
35
  getAgGridRootElement(): HTMLElement;
@@ -25,6 +25,8 @@ class AgGridAdapter {
25
25
  // see #aggColumnFilters_monkey_patch
26
26
  DANGER_doFiltersPassMonkeyPatcher;
27
27
  DANGER_isAggFilterPresentMonkeyPatcher;
28
+ // see #aggFuncLabels_monkey_patch
29
+ DANGER_getDefaultFuncLabelMonkeyPatcher;
28
30
  activePivotColumnFilters_MEMO = new WeakMap();
29
31
  initialGridOptions;
30
32
  _agGridId;
@@ -55,6 +57,7 @@ class AgGridAdapter {
55
57
  this.DANGER_updateGridOptionsMonkeyPatcher = null;
56
58
  this.DANGER_doFiltersPassMonkeyPatcher = null;
57
59
  this.DANGER_isAggFilterPresentMonkeyPatcher = null;
60
+ this.DANGER_getDefaultFuncLabelMonkeyPatcher = null;
58
61
  this.activePivotColumnFilters_MEMO = null;
59
62
  this._adaptableInstance = null;
60
63
  }
@@ -212,6 +215,27 @@ class AgGridAdapter {
212
215
  };
213
216
  agGridColumnFilterService.isAggFilterPresent = this.DANGER_isAggFilterPresentMonkeyPatcher;
214
217
  }
218
+ // #aggFuncLabels_monkey_patch
219
+ monkeyPatchingAggFuncLabels() {
220
+ const agGridAggFuncService = this.DANGER_getPrivateAgGridBeans()?.aggFuncSvc;
221
+ if (!agGridAggFuncService) {
222
+ return;
223
+ }
224
+ const original_getDefaultFuncLabel = agGridAggFuncService.getDefaultFuncLabel;
225
+ if (typeof original_getDefaultFuncLabel !== 'function') {
226
+ return;
227
+ }
228
+ this.DANGER_getDefaultFuncLabelMonkeyPatcher = function (fctName) {
229
+ if (fctName === 'only') {
230
+ return 'Only';
231
+ }
232
+ if (fctName === 'weightedAvg') {
233
+ return 'Weighted Average';
234
+ }
235
+ return original_getDefaultFuncLabel.call(this, fctName);
236
+ };
237
+ agGridAggFuncService.getDefaultFuncLabel = this.DANGER_getDefaultFuncLabelMonkeyPatcher;
238
+ }
215
239
  DANGER_getPrivateAgGridBeans() {
216
240
  const beans = DANGER_AG_GRID_BEANS_MAP[this._agGridId];
217
241
  if (!beans) {
@@ -659,9 +683,14 @@ class AgGridAdapter {
659
683
  return false;
660
684
  }
661
685
  getColumnAggregationFunctions(colDef) {
662
- let result = [].concat(colDef.allowedAggFuncs || ['sum', 'min', 'max', 'count', 'avg', 'first', 'last']); // those are the default fns aggrid supports out-of-the-box
686
+ const defaultAggFuncs = ['sum', 'min', 'max', 'count', 'avg', 'first', 'last'];
687
+ const hasAllowedAggFuncs = Array.isArray(colDef.allowedAggFuncs);
688
+ let result = hasAllowedAggFuncs ? [...colDef.allowedAggFuncs] : [...defaultAggFuncs];
663
689
  const gridOptionsAggFuncs = this.adaptableApi.agGridApi.getGridOption('aggFuncs') || {};
664
- result.push(...Object.keys(gridOptionsAggFuncs));
690
+ const gridOptionsAggFuncNames = Object.keys(gridOptionsAggFuncs);
691
+ if (!hasAllowedAggFuncs) {
692
+ result.push(...gridOptionsAggFuncNames);
693
+ }
665
694
  result = result.filter((func) => !(0, AggregationColumns_1.isWeightedAverageAggFuncName)(func));
666
695
  return [...new Set(result)];
667
696
  }
@@ -576,6 +576,7 @@ class AgGridColumnAdapter {
576
576
  return undefined;
577
577
  }
578
578
  return abColumn.availableAggregationFunctions.filter((func) => !(0, AggregationColumns_1.isWeightedAverageAggFuncName)(func));
579
+ // .filter((func) => func !== ONLY_AGG_FN_NAME);
579
580
  });
580
581
  }
581
582
  setupColumnType(columnSetupInfo) {
package/src/env.js CHANGED
@@ -2,6 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = {
4
4
  NEXT_PUBLIC_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: 1775641581659 || Date.now(),
6
- VERSION: "22.0.9" || '--current-version--',
5
+ PUBLISH_TIMESTAMP: 1775746156657 || Date.now(),
6
+ VERSION: "22.0.10" || '--current-version--',
7
7
  };