@adaptabletools/adaptable 15.0.1 → 15.0.3-canary.0

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.
Files changed (86) hide show
  1. package/bundle.cjs.js +164 -164
  2. package/package.json +2 -2
  3. package/publishTimestamp.d.ts +1 -1
  4. package/publishTimestamp.js +1 -1
  5. package/src/AdaptableInterfaces/IAdaptable.d.ts +2 -0
  6. package/src/AdaptableOptions/GeneralOptions.d.ts +4 -0
  7. package/src/Api/Implementation/ActionApiImpl.js +3 -4
  8. package/src/Api/Implementation/AdaptableApiImpl.d.ts +4 -0
  9. package/src/Api/Implementation/AdaptableApiImpl.js +12 -0
  10. package/src/Api/Implementation/AlertApiImpl.js +23 -24
  11. package/src/Api/Implementation/ApiBase.d.ts +4 -0
  12. package/src/Api/Implementation/ApiBase.js +14 -3
  13. package/src/Api/Implementation/CalculatedColumnApiImpl.js +8 -9
  14. package/src/Api/Implementation/CellSummaryApiImpl.js +1 -1
  15. package/src/Api/Implementation/ChartingApiImpl.js +1 -1
  16. package/src/Api/Implementation/ColumnApiImpl.js +31 -32
  17. package/src/Api/Implementation/CustomSortApiImpl.js +5 -6
  18. package/src/Api/Implementation/DashboardApiImpl.js +3 -3
  19. package/src/Api/Implementation/DataChangeHistoryApiImpl.js +1 -1
  20. package/src/Api/Implementation/DataSetApiImpl.js +3 -3
  21. package/src/Api/Implementation/ExportApiImpl.js +7 -8
  22. package/src/Api/Implementation/FilterApiImpl.js +15 -16
  23. package/src/Api/Implementation/FlashingCellApiImpl.js +3 -3
  24. package/src/Api/Implementation/FormatColumnApiImpl.js +18 -18
  25. package/src/Api/Implementation/FreeTextColumnApiImpl.js +9 -10
  26. package/src/Api/Implementation/GridApiImpl.js +9 -10
  27. package/src/Api/Implementation/LayoutApiImpl.js +11 -12
  28. package/src/Api/Implementation/PlusMinusApiImpl.js +1 -1
  29. package/src/Api/Implementation/PredicateApiImpl.js +8 -9
  30. package/src/Api/Implementation/QueryApiImpl.js +5 -5
  31. package/src/Api/Implementation/QueryLanguageApiImpl.js +5 -6
  32. package/src/Api/Implementation/QuickSearchApiImpl.js +1 -1
  33. package/src/Api/Implementation/ScheduleApiImpl.js +17 -17
  34. package/src/Api/Implementation/SettingsPanelApiImpl.js +3 -4
  35. package/src/Api/Implementation/ShortcutApiImpl.js +5 -5
  36. package/src/Api/Implementation/SmartEditApiImpl.js +1 -1
  37. package/src/Api/Implementation/StyledColumnApiImpl.js +4 -4
  38. package/src/Api/Implementation/SystemStatusApiImpl.js +2 -2
  39. package/src/Api/Implementation/TeamSharingApiImpl.js +11 -12
  40. package/src/Api/Implementation/ThemeApiImpl.js +4 -4
  41. package/src/Api/Implementation/UserInterfaceApiImpl.js +2 -2
  42. package/src/Api/Internal/AdaptableInternalApi.js +1 -2
  43. package/src/Api/Internal/ChartingInternalApi.js +1 -2
  44. package/src/Api/Internal/QueryInternalApi.js +1 -2
  45. package/src/Redux/Store/AdaptableReduxLocalStorageEngine.js +4 -4
  46. package/src/Redux/Store/AdaptableReduxMerger.js +1 -2
  47. package/src/Redux/Store/AdaptableStore.js +11 -13
  48. package/src/Strategy/CalculatedColumnModule.js +2 -3
  49. package/src/Strategy/DashboardModule.js +1 -2
  50. package/src/Strategy/DataChangeHistoryModule.js +1 -2
  51. package/src/Strategy/FilterModule.js +1 -2
  52. package/src/Strategy/FormatColumnModule.js +1 -2
  53. package/src/Strategy/StyledColumnModule.js +1 -2
  54. package/src/Strategy/ToolPanelModule.js +2 -3
  55. package/src/Utilities/Helpers/AdaptableHelper.js +1 -2
  56. package/src/Utilities/Helpers/DateHelper.js +2 -2
  57. package/src/Utilities/Helpers/Helper.js +3 -3
  58. package/src/Utilities/Helpers/StyleHelper.d.ts +1 -0
  59. package/src/Utilities/Helpers/StyleHelper.js +10 -1
  60. package/src/Utilities/Services/AggregatedScalarLiveValue.js +3 -4
  61. package/src/Utilities/Services/AlertService.js +1 -2
  62. package/src/Utilities/Services/CalculatedColumnExpressionService.js +3 -4
  63. package/src/Utilities/Services/DataService.js +1 -2
  64. package/src/Utilities/Services/LicenseService/index.js +1 -1
  65. package/src/Utilities/Services/MetamodelService.js +3 -4
  66. package/src/Utilities/Services/QueryLanguageService.js +1 -2
  67. package/src/Utilities/logDeprecation.d.ts +4 -3
  68. package/src/Utilities/logDeprecation.js +6 -7
  69. package/src/View/Charting/useChartState.js +1 -2
  70. package/src/View/Dashboard/Dashboard.js +1 -2
  71. package/src/View/StateManagement/handleExportState.js +1 -2
  72. package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +1 -2
  73. package/src/agGrid/Adaptable.d.ts +3 -1
  74. package/src/agGrid/Adaptable.js +85 -44
  75. package/src/agGrid/AdaptableLogger.d.ts +26 -0
  76. package/src/agGrid/AdaptableLogger.js +148 -0
  77. package/src/agGrid/agGridHelper.js +7 -8
  78. package/src/components/ExpressionEditor/BaseEditorInput.js +1 -2
  79. package/src/components/OverlayTrigger/index.js +1 -2
  80. package/src/components/SelectableList/index.js +0 -2
  81. package/src/components/icons/index.js +2 -2
  82. package/src/metamodel/adaptable.metamodel.js +1 -1
  83. package/version.d.ts +1 -1
  84. package/version.js +1 -1
  85. package/src/Utilities/Helpers/LoggingHelper.d.ts +0 -15
  86. package/src/Utilities/Helpers/LoggingHelper.js +0 -111
@@ -25,7 +25,6 @@ const StringExtensions_1 = require("../Utilities/Extensions/StringExtensions");
25
25
  const getScrollbarSize_1 = tslib_1.__importDefault(require("../Utilities/getScrollbarSize"));
26
26
  const AdaptableHelper_1 = tslib_1.__importDefault(require("../Utilities/Helpers/AdaptableHelper"));
27
27
  const Helper_1 = require("../Utilities/Helpers/Helper");
28
- const LoggingHelper_1 = require("../Utilities/Helpers/LoggingHelper");
29
28
  const ObjectFactory_1 = require("../Utilities/ObjectFactory");
30
29
  // services
31
30
  const CalculatedColumnExpressionService_1 = require("../Utilities/Services/CalculatedColumnExpressionService");
@@ -66,10 +65,11 @@ const AggregationColumns_1 = require("../PredefinedConfig/Common/AggregationColu
66
65
  const renderReactRoot_1 = require("../renderReactRoot");
67
66
  const ChartingService_1 = require("../Utilities/Services/ChartingService");
68
67
  const ThemeService_1 = require("../Utilities/Services/ThemeService");
68
+ const AdaptableLogger_1 = require("./AdaptableLogger");
69
69
  const tinycolor = require('tinycolor2');
70
70
  const GROUP_PATH_SEPARATOR = '/';
71
71
  // IMPORTANT - we need colId to be set in order for safeSetColDefs to work correctly
72
- const assignColId = (colDef) => {
72
+ const assignColId = (colDef, logger) => {
73
73
  if (!colDef) {
74
74
  return;
75
75
  }
@@ -77,11 +77,11 @@ const assignColId = (colDef) => {
77
77
  colDef.colId = colDef.field;
78
78
  }
79
79
  if (colDef.children) {
80
- colDef.children.forEach(assignColId);
80
+ colDef.children.forEach((colDef) => assignColId(colDef, logger));
81
81
  }
82
82
  else {
83
83
  if (!colDef.colId) {
84
- (0, LoggingHelper_1.LogAdaptableWarning)('A column is missing the colId - please check ', colDef, 'Either pass a "field" property or a "colId" property.');
84
+ logger.warn('A column is missing the colId - please check ', colDef, 'Either pass a "field" property or a "colId" property.');
85
85
  }
86
86
  }
87
87
  };
@@ -109,7 +109,7 @@ RowNodeProto.dispatchLocalEvent = function (event) {
109
109
  // starting with AG Grid 26.1.0 the gridApi is wrapped in a Beans property
110
110
  const rowNodeApi = (_a = rowNode === null || rowNode === void 0 ? void 0 : rowNode.beans) === null || _a === void 0 ? void 0 : _a.gridApi;
111
111
  if (!rowNodeApi) {
112
- (0, LoggingHelper_1.LogAdaptableWarning)(`No GridAPI found in passed RowNode, this should never happen!`, rowNode);
112
+ AdaptableLogger_1.AdaptableLogger.consoleErrorBase(`No GridAPI found in passed RowNode, this should never happen!`, rowNode);
113
113
  }
114
114
  return rowNodeApi;
115
115
  };
@@ -283,7 +283,7 @@ class Adaptable {
283
283
  static init(adaptableOptions, runtimeConfig) {
284
284
  var _a;
285
285
  if (!((_a = runtimeConfig === null || runtimeConfig === void 0 ? void 0 : runtimeConfig.agGridModules) === null || _a === void 0 ? void 0 : _a.length)) {
286
- (0, LoggingHelper_1.ConsoleLogWarning)(`No AG Grid modules were provided, thus limiting AdapTables features significantly!\n\nRead further info here:${DocumentationLinkConstants_1.AgGridModulesDocsLink}`);
286
+ AdaptableLogger_1.AdaptableLogger.consoleErrorBase(`No AG Grid modules were provided, thus limiting AdapTables features significantly!\n\nRead further info here:${DocumentationLinkConstants_1.AgGridModulesDocsLink}`);
287
287
  }
288
288
  else {
289
289
  core_1.ModuleRegistry.registerModules(runtimeConfig.agGridModules);
@@ -353,6 +353,8 @@ class Adaptable {
353
353
  // this is still used internally but should not be used externally as a preference
354
354
  async init(adaptableOptions, runtimeConfig, _staticInit) {
355
355
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
356
+ this.logger = new AdaptableLogger_1.AdaptableLogger(adaptableOptions.adaptableId || String(Date.now()));
357
+ const perfAdaptableInit = this.logger.beginPerf(`Adaptable init()`);
356
358
  if (runtimeConfig) {
357
359
  this.supressReact18RenderWarning = !!runtimeConfig.supressReact18RenderWarning;
358
360
  if (runtimeConfig.renderReactRoot) {
@@ -378,7 +380,7 @@ class Adaptable {
378
380
  }
379
381
  }
380
382
  if (!_staticInit) {
381
- (0, LoggingHelper_1.ConsoleLogWarning)(`
383
+ this.logger.warn(`
382
384
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
383
385
  !!!!!!! You should not use the "Adaptable" constructor directly, as it was deprecated in v6 and removed in v7!
384
386
  !!!!!!!
@@ -389,7 +391,8 @@ class Adaptable {
389
391
  // we create AdaptableOptions by merging the values provided by the user with the defaults (where no value has been set)
390
392
  this.adaptableOptions = AdaptableHelper_1.default.assignAdaptableOptions(adaptableOptions);
391
393
  if (this.hasAutogeneratedPrimaryKey()) {
392
- (0, LoggingHelper_1.LogAdaptableWarning)(`Autogenerated primary key (adaptableOptions.autogeneratedPrimaryKey = TRUE) should be used only as a last resort,
394
+ this.logger
395
+ .warn(`Autogenerated primary key (adaptableOptions.autogeneratedPrimaryKey = TRUE) should be used only as a last resort,
393
396
  when no unique column is available, as it limits some Adaptable functionalities!
394
397
 
395
398
  For more details see: ${DocumentationLinkConstants_1.PrimaryKeyDocsLink}`);
@@ -477,10 +480,10 @@ class Adaptable {
477
480
  return this.initializeAgGrid().then((initialized) => {
478
481
  if (!initialized) {
479
482
  // we have no grid, we can't do anything
480
- (0, LoggingHelper_1.ConsoleLogError)('Unable to set up AG Grid');
483
+ this.logger.error('Unable to set up AG Grid');
481
484
  return this.api;
482
485
  }
483
- (0, LoggingHelper_1.LogAdaptableInfo)(`Registered AG Grid modules: `, this.getAgGridRegisteredModules().sort());
486
+ this.logger.info(`Registered AG Grid modules: `, this.getAgGridRegisteredModules().sort());
484
487
  let self = this;
485
488
  // add our adaptable object to the grid options api object
486
489
  // this is VERY useful for when we need to access Adaptable inside of agGrid only functions
@@ -496,14 +499,18 @@ class Adaptable {
496
499
  };
497
500
  }
498
501
  // Load the store
502
+ const perfAdaptableStoreLoad = this.logger.beginPerf('AdaptableStore.Load');
499
503
  this.adaptableStore.Load.then(() => {
500
504
  if (this.isDestroyed) {
501
505
  return;
502
506
  }
507
+ perfAdaptableStoreLoad.end();
508
+ const perfInitInternalGridLogic = this.logger.beginPerf('InitInternalGridLogic');
503
509
  this.initInternalGridLogic();
510
+ perfInitInternalGridLogic.end();
504
511
  AdaptableHelper_1.default.checkValidPrimaryKey(this);
505
512
  }, (e) => {
506
- (0, LoggingHelper_1.ConsoleLogError)('Failed to Init Modules : ', e);
513
+ this.logger.error('Failed to Init Modules : ', e);
507
514
  // for now we initialize the grid even if initialising Modules has failed (perhaps revisit this?)
508
515
  this.initInternalGridLogic();
509
516
  this.api.internalApi.hideLoadingScreen(); // doesnt really help but at least clears the screen
@@ -530,6 +537,7 @@ class Adaptable {
530
537
  trailing: true,
531
538
  leading: false,
532
539
  });
540
+ perfAdaptableInit.end();
533
541
  return this.api;
534
542
  });
535
543
  }
@@ -569,24 +577,29 @@ class Adaptable {
569
577
  return undefined;
570
578
  }
571
579
  initStore() {
572
- (0, LoggingHelper_1.LogAdaptableInfo)(`Initialising AdaptableStore`);
580
+ const perfNewAdaptableStore = this.logger.beginPerf(`new AdaptableStore()`);
573
581
  this.adaptableStore = new AdaptableStore_1.AdaptableStore(this, this.isAgGridReady());
582
+ perfNewAdaptableStore.end();
574
583
  this.adaptableStore.onAny((eventName, data) => {
575
584
  this.performAudit(data.action, data.state, data.newState);
576
585
  this.forPlugins((plugin) => plugin.onStoreEvent(eventName, data, this.adaptableStore));
577
586
  if (eventName == AdaptableStore_1.INIT_STATE) {
578
- (0, LoggingHelper_1.LogAdaptableInfo)(`Updating obsolete configuration/state`);
587
+ const perfInitState = this.logger.beginPerf('InitState');
588
+ const perfUpdateOldConfig = this.logger.beginPerf('updateOldConfig()');
579
589
  this.adaptableModules.forEach((m) => m.updateOldConfig());
590
+ perfUpdateOldConfig.end();
580
591
  // call stuff here
581
592
  // and reset state also?
582
593
  this.forPlugins((plugin) => plugin.onAdaptableReady(this, this.adaptableOptions));
583
594
  this._adaptableReady = true;
584
595
  // setTimeout(() => {
596
+ this.logger.info('emit AdaptableReady');
585
597
  this.api.eventApi.emit('AdaptableReady', {
586
598
  adaptableApi: this.api,
587
599
  gridOptions: this.adaptableOptions.gridOptions,
588
600
  });
589
601
  // }, 0);
602
+ perfInitState.end();
590
603
  }
591
604
  });
592
605
  }
@@ -607,12 +620,12 @@ class Adaptable {
607
620
  }
608
621
  }
609
622
  initializeAgGrid() {
610
- (0, LoggingHelper_1.LogAdaptableInfo)(`Initializing AG Grid...`);
623
+ const perfInitializeAgGrid = this.logger.beginPerf('initializeAgGrid()');
611
624
  // set up whether we use the getRowNode method or loop when finding a rowNode (former is preferable)
612
625
  // can only do that here as the gridOptions not yet set up
613
626
  this.useRowNodeLookUp = this.agGridHelper.TrySetUpNodeIds(this.hasAutogeneratedPrimaryKey());
614
627
  if (Array.isArray(this.gridOptions.columnDefs)) {
615
- this.gridOptions.columnDefs.forEach(assignColId);
628
+ this.gridOptions.columnDefs.forEach((colDef) => assignColId(colDef, this.logger));
616
629
  }
617
630
  const adaptableSideBarDef = this.createAdaptableSideBarDef();
618
631
  if (!!adaptableSideBarDef) {
@@ -631,7 +644,7 @@ class Adaptable {
631
644
  if (!agGridContainer) {
632
645
  agGridContainer = this.initAgGridContainerFromInitializedAgGrid();
633
646
  if (!agGridContainer) {
634
- (0, LoggingHelper_1.ConsoleLogError)('You must provide an element id in `containerOptions.agGridContainer`');
647
+ this.logger.consoleError('You must provide an element id in `containerOptions.agGridContainer`');
635
648
  return false;
636
649
  }
637
650
  }
@@ -640,34 +653,44 @@ class Adaptable {
640
653
  const isGridInstantiated = this.gridOptions.api && typeof this.gridOptions.api.getValue === 'function';
641
654
  if (isGridInstantiated) {
642
655
  if (!checkAgGridContainer()) {
656
+ perfInitializeAgGrid.end('isGridInstantiated=TRUE, checkAgGridContainer=FALSE');
643
657
  return Promise.resolve(false);
644
658
  }
659
+ perfInitializeAgGrid.end('isGridInstantiated=TRUE, checkAgGridContainer=TRUE');
645
660
  return Promise.resolve(true);
646
661
  }
647
662
  if (this.runtimeConfig.waitForAgGrid) {
648
663
  return this.isAgGridReady().then(() => {
664
+ const perfInitAgGridContainer = this.logger.beginPerf('initAgGridContainerFromInitializedAgGrid');
649
665
  this.initAgGridContainerFromInitializedAgGrid();
666
+ perfInitAgGridContainer.end();
667
+ perfInitializeAgGrid.end('waitForAgGrid=TRUE');
650
668
  return Promise.resolve(true);
651
669
  }, () => {
652
- (0, LoggingHelper_1.ConsoleLogError)(`Could not find any AG Grid instance rendered. Could not find reference to AG Grid api. Make sure you pass the same gridOptions object reference both to Adaptable and AG Grid`);
670
+ this.logger.consoleError(`Could not find any AG Grid instance rendered. Could not find reference to AG Grid api. Make sure you pass the same gridOptions object reference both to Adaptable and AG Grid`);
671
+ perfInitializeAgGrid.end('waitForAgGrid=TRUE, ERROR!');
653
672
  return Promise.reject(false);
654
673
  });
655
674
  }
656
675
  else {
657
676
  if (!checkAgGridContainer()) {
677
+ perfInitializeAgGrid.end('waitForAgGrid=FALSE, checkAgGridContainer=FALSE!');
658
678
  return Promise.resolve(false);
659
679
  }
660
680
  }
661
681
  // now create the grid itself - it is done this way as previously when we instantiated the Grid 'properly' it got created as J.Grid
662
682
  let grid;
663
683
  const agGridContainer = this.getAgGridContainerElement();
684
+ const perfAgGridInstance = this.logger.beginPerf('new AgGrid()');
664
685
  // the AG Grid modules are already registered, see the init() method
665
686
  grid = new core_1.Grid(agGridContainer, this.gridOptions);
687
+ perfAgGridInstance.end();
666
688
  // add our adaptable object to the grid options api object
667
689
  // this is VERY useful for when we need to access Adaptable inside of agGrid only functions
668
690
  if (this.gridOptions.api) {
669
691
  this.gridOptions.api.__adaptable = this;
670
692
  }
693
+ perfInitializeAgGrid.end('AG Grid instantiation');
671
694
  return Promise.resolve(grid != null);
672
695
  }
673
696
  initAgGridContainerFromInitializedAgGrid() {
@@ -700,7 +723,7 @@ class Adaptable {
700
723
  }
701
724
  }
702
725
  if (!agGridContainer) {
703
- (0, LoggingHelper_1.ConsoleLogError)(`Could not find the AG Grid Container. This will probably break some AdapTable functionality.`);
726
+ this.logger.consoleError(`Could not find the AG Grid Container. This will probably break some AdapTable functionality.`);
704
727
  }
705
728
  return (this.adaptableOptions.containerOptions.agGridContainer = agGridContainer);
706
729
  }
@@ -1286,6 +1309,7 @@ class Adaptable {
1286
1309
  if (!layout) {
1287
1310
  layout = this.api.layoutApi.getCurrentLayout();
1288
1311
  }
1312
+ const perfSetLayout = this.logger.beginPerf(`setLayout(${layout.Name})`);
1289
1313
  layout.Columns = layout.Columns || [];
1290
1314
  const rowEditActionColumn = this.getColDefsForRowEditColumns()[0];
1291
1315
  if (rowEditActionColumn) {
@@ -1460,10 +1484,12 @@ class Adaptable {
1460
1484
  if (shouldUpdatePivoted) {
1461
1485
  this.gridOptions.columnApi.setPivotMode(pivoted);
1462
1486
  }
1487
+ const perfApplyColumnState = this.logger.beginPerf('applyColumnState (layout.isChanged)');
1463
1488
  this.gridOptions.columnApi.applyColumnState({
1464
1489
  state: newColumnsState,
1465
1490
  applyOrder: true,
1466
1491
  });
1492
+ perfApplyColumnState.end();
1467
1493
  this.api.gridApi.setColumnSorts(layout.ColumnSorts);
1468
1494
  this.gridOptions.columnApi.setPivotColumns(layout.PivotColumns || []);
1469
1495
  // aggrid 25.1.0 introduced a bug such that a layout that has a grouped column, if the column has enableRowGroup: true but not rowGroup: true
@@ -1471,7 +1497,9 @@ class Adaptable {
1471
1497
  // see the test in layout/layout-switch/"should be able to switch from grouped to non-grouped and back"
1472
1498
  // so we figured out the following line fixes the issue
1473
1499
  // this.gridOptions.api.setColumnDefs(this.gridOptions.api.getColumnDefs()); //TODO find a solution for weighted averages - column floating filters are not showing
1500
+ const perfSetColumnDefs = this.logger.beginPerf('GridApi_setColumnDefs');
1474
1501
  GridApi_setColumnDefs.call(this.gridOptions.api, this.gridOptions.api.getColumnDefs());
1502
+ perfSetColumnDefs.end();
1475
1503
  // these updates need to be at the end, the methods are based on the grid state/col defs
1476
1504
  // the layout needs to be applied for them to work
1477
1505
  this.updateRowGroupsExpandedState(layout);
@@ -1502,6 +1530,7 @@ class Adaptable {
1502
1530
  plugin.afterSetLayout(this, layout);
1503
1531
  }
1504
1532
  });
1533
+ perfSetLayout.end();
1505
1534
  }
1506
1535
  updateRowGroupsExpandedState(layout) {
1507
1536
  if (!layout) {
@@ -1623,7 +1652,7 @@ class Adaptable {
1623
1652
  if (isEndRowPin) {
1624
1653
  shouldIncludeRange = false;
1625
1654
  }
1626
- (0, LoggingHelper_1.ConsoleLogWarning)('Cannot select pinned rows in AG Grid.');
1655
+ this.logger.consoleWarn('Cannot select pinned rows in AG Grid.');
1627
1656
  }
1628
1657
  if (shouldIncludeRange) {
1629
1658
  const y1 = Math.min(rangeSelection.startRow.rowIndex, rangeSelection.endRow.rowIndex);
@@ -1792,7 +1821,7 @@ class Adaptable {
1792
1821
  preparedPermittedValues = await (permittedValues === null || permittedValues === void 0 ? void 0 : permittedValues.values(filterPermittedValuesParams));
1793
1822
  }
1794
1823
  catch (error) {
1795
- (0, LoggingHelper_1.ConsoleLogError)(`Failed to load filter permitted values`, column, filter, error);
1824
+ this.logger.consoleError(`Failed to load filter permitted values`, column, filter, error);
1796
1825
  }
1797
1826
  return {
1798
1827
  suppressClientSideFilter: permittedValues.suppressFilterSearchBar,
@@ -1810,7 +1839,7 @@ class Adaptable {
1810
1839
  preparedPermittedValues = await (permittedValues === null || permittedValues === void 0 ? void 0 : permittedValues.values(permittedValuesParams));
1811
1840
  }
1812
1841
  catch (error) {
1813
- (0, LoggingHelper_1.ConsoleLogError)(`Failed to load custom sort permitted values`, column, error);
1842
+ this.logger.consoleError(`Failed to load custom sort permitted values`, column, error);
1814
1843
  }
1815
1844
  return this.getDistinctValuesForColumn(column, visibleRowsOnly, skipRowNode, preparedPermittedValues);
1816
1845
  }
@@ -1826,7 +1855,7 @@ class Adaptable {
1826
1855
  preparedPermittedValues = await (permittedValues === null || permittedValues === void 0 ? void 0 : permittedValues.values(bulkUpdatePermittedValuesParams));
1827
1856
  }
1828
1857
  catch (error) {
1829
- (0, LoggingHelper_1.ConsoleLogError)(`Failed to load bulk permitted values`, error, column, selectedGridCells);
1858
+ this.logger.consoleError(`Failed to load bulk permitted values`, error, column, selectedGridCells);
1830
1859
  }
1831
1860
  return this.getDistinctValuesForColumn(column, visibleRowsOnly, skipRowNode, preparedPermittedValues);
1832
1861
  }
@@ -2097,14 +2126,14 @@ class Adaptable {
2097
2126
  }
2098
2127
  selectNode(rowNode, clearSelection) {
2099
2128
  if (!rowNode) {
2100
- (0, LoggingHelper_1.LogAdaptableError)('No node to select');
2129
+ this.logger.error('No node to select');
2101
2130
  return;
2102
2131
  }
2103
2132
  rowNode.setSelected(true, clearSelection);
2104
2133
  }
2105
2134
  deSelectNode(rowNode, clearSelection) {
2106
2135
  if (!rowNode) {
2107
- (0, LoggingHelper_1.LogAdaptableError)('No node to deselect');
2136
+ this.logger.error('No node to deselect');
2108
2137
  return;
2109
2138
  }
2110
2139
  rowNode.setSelected(false, clearSelection);
@@ -2144,6 +2173,7 @@ class Adaptable {
2144
2173
  this.redrawRows([rowNode]);
2145
2174
  }
2146
2175
  redrawRows(rowNodes) {
2176
+ // RedrawRowsParams
2147
2177
  const redrawRowsParams = {
2148
2178
  rowNodes,
2149
2179
  };
@@ -2151,7 +2181,7 @@ class Adaptable {
2151
2181
  this.gridOptions.api.redrawRows(redrawRowsParams);
2152
2182
  }
2153
2183
  catch (ex) {
2154
- (0, LoggingHelper_1.ConsoleLogError)('AG Grid redrawRows was unable to find some row nodes. Tried to redraw row nodes: ', rowNodes, ex);
2184
+ this.logger.consoleError('AG Grid redrawRows was unable to find some row nodes. Tried to redraw row nodes: ', rowNodes, ex);
2155
2185
  }
2156
2186
  }
2157
2187
  refreshCells(rowNodes, columns, forceUpdate, suppressFlash = false) {
@@ -2236,7 +2266,7 @@ class Adaptable {
2236
2266
  if (freeTextColumnSettings.HeaderToolTip) {
2237
2267
  newColDef.headerTooltip = freeTextColumnSettings.HeaderToolTip;
2238
2268
  }
2239
- (0, LoggingHelper_1.LogAdaptableInfo)('Setting up FreeText Column: ' + freeTextColumn.ColumnId);
2269
+ this.logger.info('Setting up FreeText Column: ' + freeTextColumn.ColumnId);
2240
2270
  return newColDef;
2241
2271
  });
2242
2272
  }
@@ -2370,7 +2400,7 @@ class Adaptable {
2370
2400
  cellRenderer: this.variant === 'react' ? ActionColumnRenderer_1.ReactActionColumnRenderer : ActionColumnRenderer_1.ActionColumnRenderer,
2371
2401
  type: [GeneralConstants_1.AB_SPECIAL_COLUMN, 'abColDefObject'],
2372
2402
  };
2373
- (0, LoggingHelper_1.LogAdaptableInfo)('Setting up Action Column: ' + actionColumn.columnId);
2403
+ this.logger.info('Setting up Action Column: ' + actionColumn.columnId);
2374
2404
  return newColDef;
2375
2405
  });
2376
2406
  }
@@ -2487,7 +2517,7 @@ class Adaptable {
2487
2517
  if (calculatedColumnSettings.HeaderToolTip) {
2488
2518
  newColDef.headerTooltip = calculatedColumnSettings.HeaderToolTip;
2489
2519
  }
2490
- (0, LoggingHelper_1.LogAdaptableInfo)('Setting up Calculated Column: ' + calculatedColumn.ColumnId);
2520
+ this.logger.info('Setting up Calculated Column: ' + calculatedColumn.ColumnId);
2491
2521
  return newColDef;
2492
2522
  });
2493
2523
  }
@@ -2686,7 +2716,7 @@ class Adaptable {
2686
2716
  if (!this.abContainerElement) {
2687
2717
  let oldContainer = document.getElementById('adaptableBlotter');
2688
2718
  if (oldContainer) {
2689
- (0, LoggingHelper_1.LogAdaptableWarning)(`
2719
+ this.logger.warn(`
2690
2720
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2691
2721
  !!!!! The old default container element for Adaptable was "#adaptableBlotter", configured via 'containerOptions.adaptableContainer="adaptableBlotter"'.
2692
2722
  !!!!! Seems like you haven't updated your html container selector, so we're falling back to using that one.
@@ -2710,16 +2740,15 @@ class Adaptable {
2710
2740
  return this.gridContainerElement;
2711
2741
  }
2712
2742
  initInternalGridLogic() {
2713
- (0, LoggingHelper_1.LogAdaptableInfo)(`Initializing InternalGridLogic...`);
2714
2743
  if (this.abContainerElement == null) {
2715
2744
  this.abContainerElement = this.getAdaptableContainerElement();
2716
2745
  }
2717
2746
  if (this.abContainerElement == null) {
2718
2747
  if (typeof this.adaptableOptions.containerOptions.adaptableContainer === 'string') {
2719
- (0, LoggingHelper_1.ConsoleLogError)(`There is no DIV with id="${this.adaptableOptions.containerOptions.adaptableContainer}" so cannot render Adaptable`);
2748
+ this.logger.consoleError(`There is no DIV with id="${this.adaptableOptions.containerOptions.adaptableContainer}" so cannot render Adaptable`);
2720
2749
  }
2721
2750
  else {
2722
- (0, LoggingHelper_1.ConsoleLogError)(`No valid adaptableContainer found to render Adaptable`, this.adaptableOptions.containerOptions.adaptableContainer);
2751
+ this.logger.consoleError(`No valid adaptableContainer found to render Adaptable`, this.adaptableOptions.containerOptions.adaptableContainer);
2723
2752
  }
2724
2753
  return;
2725
2754
  }
@@ -2999,7 +3028,7 @@ class Adaptable {
2999
3028
  }
3000
3029
  }
3001
3030
  catch (ex) {
3002
- (0, LoggingHelper_1.LogAdaptableError)(ex);
3031
+ this.logger.error(ex);
3003
3032
  return false;
3004
3033
  }
3005
3034
  return originalDoesExternalFilterPass ? originalDoesExternalFilterPass(node) : true;
@@ -3054,7 +3083,7 @@ class Adaptable {
3054
3083
  return this.agGridMenuHelper.buildStandaloneColumnHeader(adaptableColumn);
3055
3084
  }
3056
3085
  prepareGrid() {
3057
- (0, LoggingHelper_1.LogAdaptableInfo)('Preparing grid...');
3086
+ const perfPrepareGrid = this.logger.beginPerf('prepareGrid()');
3058
3087
  // add any special renderers, display formats, custom sorts and apply the theme
3059
3088
  // then do any final rendering required, filter the grid and - to be on the safe set - redraw
3060
3089
  try {
@@ -3064,13 +3093,15 @@ class Adaptable {
3064
3093
  this.applyGridFiltering();
3065
3094
  }
3066
3095
  catch (ex) {
3067
- (0, LoggingHelper_1.ConsoleLogError)('AgGrid setup failed');
3068
- (0, LoggingHelper_1.ConsoleLogError)(ex);
3096
+ this.logger.consoleError('AgGrid setup failed');
3097
+ this.logger.consoleError(ex);
3069
3098
  }
3099
+ perfPrepareGrid.end();
3070
3100
  }
3071
3101
  setupColumns() {
3102
+ const perfSetupColumns = this.logger.beginPerf('setupColumns()');
3072
3103
  const cols = this.gridOptions.columnApi.getColumns();
3073
- cols.map((c) => c.getColDef()).forEach(assignColId);
3104
+ cols.map((c) => c.getColDef()).forEach((colDef) => assignColId(colDef, this.logger));
3074
3105
  // this needs to be here, before the other setup below
3075
3106
  // so the setup methods below reference the correct columns in adaptable store
3076
3107
  this.updateColumnsIntoStore();
@@ -3108,6 +3139,7 @@ class Adaptable {
3108
3139
  //this.setupAggregationColumnHeaders();
3109
3140
  this.redrawBody();
3110
3141
  this.redrawHeader();
3142
+ perfSetupColumns.end();
3111
3143
  }
3112
3144
  revertGridOptionsPropertiesToUserValue(propertyNames) {
3113
3145
  for (const propertyName of propertyNames) {
@@ -3200,16 +3232,24 @@ class Adaptable {
3200
3232
  const result = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, this.getReadOnlyCellStyle(abColumn, params)), this.getEditableCellStyle(abColumn, params)), (typeof userCellStyle === 'function' ? userCellStyle(params) : userCellStyle)), (!styledColumn
3201
3233
  ? this.getFormatColumnCellStyle(abColumn, activeFormatColumnsWithStyle, params)
3202
3234
  : {})), (styledColumn ? this.getStyledColumnStyle(styledColumn, abColumn, params) : {})), (isQuickSearchActive ? quickSearchStyle : {})), this.getAlertCellStyle(abColumn, params)), this.getFlashingCellStyle(abColumn, params)), this.getCellHighlightStyle(abColumn, params));
3203
- // remove null values, AG Grid 29 fails, it asumes they are strings
3204
3235
  // TODO AFL: remove once AG-7903 and AG-7917 are fixed
3236
+ // this should happen with AG Grid v29.1.0
3205
3237
  Object.keys(result).forEach((key) => {
3238
+ // AG-7917
3206
3239
  if (result[key] === null || result[key] === undefined) {
3207
3240
  delete result[key];
3208
3241
  }
3242
+ // AG-7903
3209
3243
  if (typeof result[key] === 'number') {
3210
3244
  result[key] = String(result[key]);
3211
3245
  }
3212
3246
  });
3247
+ // see https://github.com/AdaptableTools/adaptable/issues/2119
3248
+ StyleHelper_1.AgGridCellStyleProperties.forEach((cellStylePropKey) => {
3249
+ if (result[cellStylePropKey] == null) {
3250
+ result[cellStylePropKey] = '';
3251
+ }
3252
+ });
3213
3253
  return result;
3214
3254
  };
3215
3255
  return cellStyle;
@@ -3704,7 +3744,7 @@ class Adaptable {
3704
3744
  }
3705
3745
  cellDataChangedInfos.forEach((cellDataChangedInfo) => {
3706
3746
  if (cellDataChangedInfo.trigger === 'undo') {
3707
- (0, LoggingHelper_1.LogAdaptableInfo)(`Undo data change: PK(${cellDataChangedInfo.primaryKeyValue}) Col(${cellDataChangedInfo.column}) RevertedValue(${cellDataChangedInfo.oldValue}) OriginalValue(${cellDataChangedInfo.newValue})`);
3747
+ this.logger.info(`Undo data change: PK(${cellDataChangedInfo.primaryKeyValue}) Col(${cellDataChangedInfo.column}) RevertedValue(${cellDataChangedInfo.oldValue}) OriginalValue(${cellDataChangedInfo.newValue})`);
3708
3748
  }
3709
3749
  if (cellDataChangedInfo.trigger === 'edit' || cellDataChangedInfo.trigger === 'undo') {
3710
3750
  this.checkChangedCellCurrentlySelected(cellDataChangedInfo);
@@ -4409,11 +4449,12 @@ class Adaptable {
4409
4449
  return val;
4410
4450
  });
4411
4451
  if (abLoaded !== '777') {
4412
- (0, LoggingHelper_1.ConsoleLogError)('Please import Adaptable styles from "@adaptabletools/adaptable/index.css"');
4452
+ this.logger.consoleError('Please import Adaptable styles from "@adaptabletools/adaptable/index.css"');
4413
4453
  }
4414
4454
  // every theme should define a custom css variable: --ab-theme-loaded: <themeName> defined on the document element.
4415
4455
  if (abThemeLoaded !== themeName) {
4416
- (0, LoggingHelper_1.ConsoleLogWarning)(`Theme "${themeName}" doesn't seem to be loaded! Make sure you import the css file for the "${themeName}" theme!
4456
+ this.logger
4457
+ .consoleWarn(`Theme "${themeName}" doesn't seem to be loaded! Make sure you import the css file for the "${themeName}" theme!
4417
4458
 
4418
4459
  If it's a default theme, try
4419
4460
 
@@ -4457,7 +4498,7 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
4457
4498
  }
4458
4499
  getGridOptionsApi() {
4459
4500
  if (!this.gridOptions.api) {
4460
- (0, LoggingHelper_1.ConsoleLogError)('There is a problem with your instance of AG Grid - it has no gridApi object. Please contact Support.');
4501
+ this.logger.consoleError('There is a problem with your instance of AG Grid - it has no gridApi object. Please contact Support.');
4461
4502
  return;
4462
4503
  }
4463
4504
  return this.gridOptions.api;
@@ -4817,7 +4858,7 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
4817
4858
  }
4818
4859
  showChart(chartDefinition, container) {
4819
4860
  if (!this.gridOptions.api) {
4820
- (0, LoggingHelper_1.ConsoleLogError)('Adaptable must be instantiated before calling showChart');
4861
+ this.logger.consoleError('Adaptable must be instantiated before calling showChart');
4821
4862
  return null;
4822
4863
  }
4823
4864
  /**
@@ -4836,7 +4877,7 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
4836
4877
  }
4837
4878
  getChartModels() {
4838
4879
  if (!this.gridOptions.api) {
4839
- (0, LoggingHelper_1.ConsoleLogError)('Adaptable must be instantiated before calling getChartModels');
4880
+ this.logger.consoleError('Adaptable must be instantiated before calling getChartModels');
4840
4881
  return [];
4841
4882
  }
4842
4883
  return this.gridOptions.api.getChartModels();
@@ -0,0 +1,26 @@
1
+ import { AdaptableMessageType } from '../PredefinedConfig/Common/AdaptableMessageType';
2
+ export declare class AdaptableLogger {
3
+ private adaptableId;
4
+ private debugger;
5
+ private infoLogger;
6
+ private successLogger;
7
+ private warnLogger;
8
+ private errorLogger;
9
+ private perfLogger;
10
+ static consoleErrorBase(message: string, ...optionalParams: any[]): void;
11
+ static consoleWarnBase(message: string, ...optionalParams: any[]): void;
12
+ static consoleLogBase(message: string, ...optionalParams: any[]): void;
13
+ constructor(adaptableId: string);
14
+ beginPerf(sectionName: string): {
15
+ end: (additionalComment?: string) => void;
16
+ };
17
+ info(message: string, ...optionalParams: any[]): void;
18
+ success(message: string, ...optionalParams: any[]): void;
19
+ warn(message: string, ...optionalParams: any[]): void;
20
+ error(message: string, ...optionalParams: any[]): void;
21
+ consoleLogByMessageType(message: string, messageType: AdaptableMessageType, ...optionalParams: any[]): void;
22
+ consoleInfo(message: string, ...optionalParams: any[]): void;
23
+ consoleLog(message: string, ...optionalParams: any[]): void;
24
+ consoleWarn(message: string, ...optionalParams: any[]): void;
25
+ consoleError(message: string, ...optionalParams: any[]): void;
26
+ }