@adaptabletools/adaptable 18.0.0-canary.24 → 18.0.0-canary.26

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 (78) hide show
  1. package/package.json +1 -1
  2. package/src/AdaptableInterfaces/IAdaptable.d.ts +1 -1
  3. package/src/AdaptableOptions/CommentOptions.d.ts +2 -2
  4. package/src/AdaptableOptions/MenuOptions.d.ts +4 -4
  5. package/src/Api/GridApi.d.ts +2 -1
  6. package/src/Api/Implementation/ActionRowApiImpl.js +3 -7
  7. package/src/Api/Implementation/AlertApiImpl.js +5 -10
  8. package/src/Api/Implementation/CalendarApiImpl.js +1 -6
  9. package/src/Api/Implementation/ChartingApiImpl.js +3 -3
  10. package/src/Api/Implementation/ColumnApiImpl.js +6 -6
  11. package/src/Api/Implementation/ColumnFilterApiImpl.js +7 -7
  12. package/src/Api/Implementation/CommentsApiImpl.js +1 -1
  13. package/src/Api/Implementation/ConfigApiImpl.js +11 -17
  14. package/src/Api/Implementation/DashboardApiImpl.js +1 -6
  15. package/src/Api/Implementation/ExportApiImpl.js +5 -10
  16. package/src/Api/Implementation/ExpressionApiImpl.js +8 -13
  17. package/src/Api/Implementation/Fdc3ApiImpl.js +1 -1
  18. package/src/Api/Implementation/FlashingCellApiImpl.js +3 -8
  19. package/src/Api/Implementation/FormatColumnApiImpl.js +4 -4
  20. package/src/Api/Implementation/FreeTextColumnApiImpl.js +1 -1
  21. package/src/Api/Implementation/GridApiImpl.d.ts +2 -1
  22. package/src/Api/Implementation/GridApiImpl.js +11 -8
  23. package/src/Api/Implementation/LayoutApiImpl.d.ts +2 -0
  24. package/src/Api/Implementation/LayoutApiImpl.js +2 -13
  25. package/src/Api/Implementation/PredicateApiImpl.js +2 -2
  26. package/src/Api/Implementation/ScheduleApiImpl.js +6 -6
  27. package/src/Api/Implementation/ScopeApiImpl.js +10 -10
  28. package/src/Api/Implementation/TeamSharingApiImpl.js +3 -15
  29. package/src/Api/Implementation/ThemeApiImpl.js +2 -7
  30. package/src/Api/Implementation/UserInterfaceApiImpl.js +4 -13
  31. package/src/Api/Internal/ActionRowInternalApi.js +7 -45
  32. package/src/Api/Internal/AdaptableInternalApi.js +2 -12
  33. package/src/Api/Internal/AlertInternalApi.js +4 -17
  34. package/src/Api/Internal/CalculatedColumnInternalApi.js +7 -14
  35. package/src/Api/Internal/ChartingInternalApi.js +13 -13
  36. package/src/Api/Internal/ColumnFilterInternalApi.js +18 -36
  37. package/src/Api/Internal/CustomSortInternalApi.js +1 -1
  38. package/src/Api/Internal/DashboardInternalApi.js +4 -10
  39. package/src/Api/Internal/DataImportInternalApi.js +3 -9
  40. package/src/Api/Internal/DataSetInternalApi.js +2 -7
  41. package/src/Api/Internal/ExportInternalApi.js +4 -4
  42. package/src/Api/Internal/ExpressionInternalApi.js +2 -12
  43. package/src/Api/Internal/Fdc3InternalApi.js +1 -10
  44. package/src/Api/Internal/FormatColumnInternalApi.js +11 -20
  45. package/src/Api/Internal/FreeTextColumnInternalApi.js +1 -1
  46. package/src/Api/Internal/GridFilterInternalApi.js +2 -8
  47. package/src/Api/Internal/GridInternalApi.js +13 -40
  48. package/src/Api/Internal/LayoutInternalApi.d.ts +1 -0
  49. package/src/Api/Internal/LayoutInternalApi.js +10 -19
  50. package/src/Api/Internal/PredicateInternalApi.js +5 -40
  51. package/src/Api/Internal/ScheduleInternalApi.js +1 -6
  52. package/src/Api/Internal/StyledColumnInternalApi.js +5 -5
  53. package/src/Api/Internal/SystemStatusInternalApi.js +1 -7
  54. package/src/Api/Internal/TeamSharingInternalApi.js +2 -7
  55. package/src/Api/Internal/ThemeInternalApi.js +1 -1
  56. package/src/Api/Internal/UserInterfaceInternalApi.js +1 -1
  57. package/src/Api/LayoutApi.d.ts +1 -0
  58. package/src/PredefinedConfig/Common/CellSummary.d.ts +5 -14
  59. package/src/PredefinedConfig/Common/Enums.d.ts +2 -0
  60. package/src/PredefinedConfig/Common/Enums.js +2 -0
  61. package/src/PredefinedConfig/Common/RowSummary.d.ts +1 -1
  62. package/src/PredefinedConfig/Common/RowSummary.js +4 -4
  63. package/src/Strategy/CellSummaryModule.js +54 -94
  64. package/src/Strategy/LayoutModule.js +5 -1
  65. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +1 -1
  66. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +19 -19
  67. package/src/Utilities/Helpers/AdaptableHelper.js +3 -2
  68. package/src/Utilities/ObjectFactory.js +2 -0
  69. package/src/View/Layout/Wizard/LayoutWizard.js +2 -0
  70. package/src/View/Layout/Wizard/sections/RowGroupingSection.js +17 -1
  71. package/src/View/Layout/Wizard/sections/RowSummarySection.js +5 -5
  72. package/src/agGrid/AdaptableAgGrid.d.ts +1 -1
  73. package/src/agGrid/AdaptableAgGrid.js +19 -7
  74. package/src/agGrid/AgGridAdapter.d.ts +1 -2
  75. package/src/env.js +2 -2
  76. package/src/metamodel/adaptable.metamodel.d.ts +8 -2
  77. package/src/metamodel/adaptable.metamodel.js +1 -1
  78. package/tsconfig.esm.tsbuildinfo +1 -1
@@ -12,7 +12,23 @@ export const RowGroupingSectionSummary = () => {
12
12
  var _a;
13
13
  const adaptable = useAdaptable();
14
14
  const { data: layout } = useOnePageAdaptableWizardContext();
15
- return (React.createElement(Box, null, ((_a = layout.RowGroupedColumns) === null || _a === void 0 ? void 0 : _a.length) ? (layout.RowGroupedColumns.map((columnId) => (React.createElement(Tag, { mr: 1, key: columnId }, adaptable.api.columnApi.getFriendlyNameForColumnId(columnId))))) : (React.createElement(Tag, null, "No Row Grouping"))));
15
+ return (React.createElement(Box, null, ((_a = layout.RowSummaries) === null || _a === void 0 ? void 0 : _a.length) ? (layout === null || layout === void 0 ? void 0 : layout.RowSummaries.map((rowSummary, index) => {
16
+ var _a;
17
+ const columns = Object.entries((_a = rowSummary.ColumnsMap) !== null && _a !== void 0 ? _a : {})
18
+ .map(([columnId, expression]) => {
19
+ if (columnId === 'Source' || columnId === 'Uuid') {
20
+ return '';
21
+ }
22
+ return `${expression}(${adaptable.api.columnApi.getFriendlyNameForColumnId(columnId)})`;
23
+ })
24
+ .filter(Boolean)
25
+ .join(', ');
26
+ return (React.createElement(Box, { mb: 2 },
27
+ React.createElement(Tag, { key: index },
28
+ rowSummary.Position,
29
+ " ",
30
+ columns)));
31
+ })) : (React.createElement(Tag, null, "No Row Summaries"))));
16
32
  };
17
33
  export const RowGroupingSection = (props) => {
18
34
  var _a, _b, _c;
@@ -32,13 +32,13 @@ export const areSummaryRowsValid = (layout) => {
32
32
  };
33
33
  const getAvailableExpressionsForColumnType = (columnType, availableScalarExpressions) => {
34
34
  const inputType = mapColumnDataTypeToExpressionFunctionType(columnType);
35
- return Object.entries(availableScalarExpressions !== null && availableScalarExpressions !== void 0 ? availableScalarExpressions : {})
36
- .map(([expression, expressionDef]) => {
35
+ // Object.entries(availableScalarExpressions ?? {})
36
+ return summarySupportedExpressions
37
+ .filter((expression) => availableScalarExpressions[expression])
38
+ .map((expression) => {
37
39
  var _a, _b;
40
+ const expressionDef = availableScalarExpressions[expression];
38
41
  let firstArg = null;
39
- if (!summarySupportedExpressions.includes(expression)) {
40
- return null;
41
- }
42
42
  if (Array.isArray((_a = expressionDef === null || expressionDef === void 0 ? void 0 : expressionDef.inputs) === null || _a === void 0 ? void 0 : _a[0])) {
43
43
  // @ts-ignore
44
44
  firstArg = (_b = expressionDef.inputs.find((input) => input.includes(inputType))) === null || _b === void 0 ? void 0 : _b[0];
@@ -287,7 +287,7 @@ export declare class AdaptableAgGrid implements IAdaptable {
287
287
  private getAgGridLightThemeName;
288
288
  applyAdaptableTheme(theme: AdaptableTheme | string): void;
289
289
  setRowGroupColumns(columnIds: string[]): void;
290
- getAgGridAllGridColumns(): Column<any>[];
290
+ getAllGridColumns(): Column<any>[];
291
291
  clearRowGroupColumns(): void;
292
292
  expandAllRowGroups(): void;
293
293
  closeAllRowGroups(): void;
@@ -368,6 +368,16 @@ export class AdaptableAgGrid {
368
368
  this.temporaryAdaptableStateUpdates();
369
369
  this.redrawBody();
370
370
  this.refreshHeader();
371
+ const currentLayout = this.api.layoutApi.getCurrentLayout();
372
+ if (currentLayout.EnablePivot) {
373
+ // this is very very strange!
374
+ // for some projects, if the initial layout is pivot, the columnDefs of the pivot resutl columns are NOT derived correctly from the main colDefs
375
+ // doing the following line fixes the issue because it foces the pivot columns to be created again
376
+ // this proj works without the hack: /tests/pages/format-column/initial-pivot-layout.page.tsx
377
+ // but this proj needs the hack: /tests/pages/format-column/initial-pivot-layout-docs.page.tsx
378
+ this.agGridAdapter.setGridOption('pivotMode', false);
379
+ this.agGridAdapter.setGridOption('pivotMode', true);
380
+ }
371
381
  // create the module menu (for use in the dashboard and the toolpanel)
372
382
  // TODO see #create-create-module-menu - make sure it's the same here and there
373
383
  this.ModuleService.createModuleMenus();
@@ -985,7 +995,9 @@ export class AdaptableAgGrid {
985
995
  // framework wrapper may pass the rowData as a prop
986
996
  const rowData = agGridApi.getGridOption('rowData');
987
997
  this.initWithLazyData = rowData == undefined || rowData.length === 0;
988
- this.logger.info('initWithLazyData = TRUE');
998
+ if (this.initWithLazyData) {
999
+ this.logger.info('initWithLazyData = TRUE');
1000
+ }
989
1001
  if (!this.getAgGridContainerElement()) {
990
1002
  // initialize the agGridContainerElement from the AgGrid instance
991
1003
  // @ts-ignore
@@ -1371,17 +1383,17 @@ export class AdaptableAgGrid {
1371
1383
  // ADD filter event
1372
1384
  this.agGridAdapter.getAgGridApi().addGlobalListener((this.listenerGlobalColumnEventsThatTriggerAutoLayoutSave = (type) => {
1373
1385
  if (columnEventsThatTriggersAutoLayoutSave.indexOf(type) > -1) {
1374
- this.logger.info('Column Event Triggering Auto Layout Save', type);
1375
- this.debouncedSaveGridLayout();
1386
+ this.debouncedSaveGridLayout(type);
1376
1387
  }
1377
1388
  }));
1378
1389
  /**
1379
1390
  * Save Layout if Display Row Groups is "dynamic
1380
1391
  */
1381
- this.debouncedSaveGridLayout = debounce(() => {
1392
+ this.debouncedSaveGridLayout = debounce((type) => {
1382
1393
  if (!this.isReady) {
1383
1394
  return;
1384
1395
  }
1396
+ this.logger.info('Event Triggering Auto Layout Save', type || '');
1385
1397
  this.updateLayoutFromGrid();
1386
1398
  }, HALF_SECOND);
1387
1399
  const rowGroupEventsThatTriggersAutoLayoutSave = [
@@ -1391,7 +1403,7 @@ export class AdaptableAgGrid {
1391
1403
  this.agGridAdapter.getAgGridApi().addGlobalListener((this.listenerGlobalRowGroupEventsThatTriggerAutoLayoutSave = (type) => {
1392
1404
  if (rowGroupEventsThatTriggersAutoLayoutSave.indexOf(type) > -1) {
1393
1405
  if (this.adaptableOptions.layoutOptions.displayRowGroups == 'dynamic') {
1394
- this.debouncedSaveGridLayout();
1406
+ this.debouncedSaveGridLayout(type);
1395
1407
  }
1396
1408
  }
1397
1409
  }));
@@ -1415,7 +1427,7 @@ export class AdaptableAgGrid {
1415
1427
  */
1416
1428
  this.agGridAdapter.getAgGridApi().addEventListener(Events.EVENT_COLUMN_RESIZED, (this.listenerColumnResized = (params) => {
1417
1429
  if (params.finished == true && params.type == 'columnResized' && params.column) {
1418
- this.debouncedSaveGridLayout();
1430
+ this.debouncedSaveGridLayout(params.type);
1419
1431
  }
1420
1432
  }));
1421
1433
  /**
@@ -2744,7 +2756,7 @@ export class AdaptableAgGrid {
2744
2756
  setRowGroupColumns(columnIds) {
2745
2757
  this.agGridAdapter.getAgGridApi().setRowGroupColumns(columnIds);
2746
2758
  }
2747
- getAgGridAllGridColumns() {
2759
+ getAllGridColumns() {
2748
2760
  return this.agGridAdapter.getAgGridApi().getAllGridColumns();
2749
2761
  }
2750
2762
  clearRowGroupColumns() {
@@ -1,9 +1,8 @@
1
- import { ColDef, Column, GridApi, GridOptions, IRowNode, ManagedGridOptionKey, ManagedGridOptions, Module, ModuleNames } from '@ag-grid-community/core';
1
+ import { ColDef, ColGroupDef, Column, GridApi, GridOptions, IRowNode, ManagedGridOptionKey, ManagedGridOptions, Module, ModuleNames } from '@ag-grid-community/core';
2
2
  import { AdaptableAgGrid } from './AdaptableAgGrid';
3
3
  import { AdaptableColumn, AdaptableColumnGroup } from '../PredefinedConfig/Common/AdaptableColumn';
4
4
  import { SelectedCellInfo } from '../PredefinedConfig/Selection/SelectedCellInfo';
5
5
  import { SelectedRowInfo } from '../PredefinedConfig/Selection/SelectedRowInfo';
6
- import { ColGroupDef } from '@ag-grid-community/core/dist/esm/es6/entities/colDef';
7
6
  export declare class AgGridAdapter {
8
7
  private adaptableInstance;
9
8
  private DANGER_USE_GETTER_gridApi;
package/src/env.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export default {
2
2
  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" || '',
3
- PUBLISH_TIMESTAMP: 1712325818168 || Date.now(),
4
- VERSION: "18.0.0-canary.24" || '--current-version--',
3
+ PUBLISH_TIMESTAMP: 1712574265503 || Date.now(),
4
+ VERSION: "18.0.0-canary.26" || '--current-version--',
5
5
  };
@@ -1590,11 +1590,17 @@ export declare const ADAPTABLE_METAMODEL: {
1590
1590
  name: string;
1591
1591
  kind: string;
1592
1592
  desc: string;
1593
- props: {
1593
+ props: ({
1594
1594
  name: string;
1595
1595
  kind: string;
1596
1596
  desc: string;
1597
- }[];
1597
+ ref?: undefined;
1598
+ } | {
1599
+ name: string;
1600
+ kind: string;
1601
+ desc: string;
1602
+ ref: string;
1603
+ })[];
1598
1604
  };
1599
1605
  CellSummaryOptions: {
1600
1606
  name: string;