@adaptabletools/adaptable-cjs 18.0.0-canary.25 → 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 +1 -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 +1 -1
  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.cjs.tsbuildinfo +1 -1
@@ -334,7 +334,7 @@ exports.aggregatedScalarExpressionFunctions = {
334
334
  handler(args, context) {
335
335
  const modeColumnParameter = (0, expressionFunctionUtils_1.extractColumnParameter)('mode', args);
336
336
  const modeColumnName = modeColumnParameter.value;
337
- (0, expressionFunctionUtils_1.validateColumnType)(modeColumnName, ['Number', 'String'], 'mode', context.adaptableApi);
337
+ (0, expressionFunctionUtils_1.validateColumnType)(modeColumnName, ['Number', 'String', 'Date'], 'mode', context.adaptableApi);
338
338
  const groupByParameter = (0, expressionFunctionUtils_1.extractParameter)('MODE', 'operand', ['GROUP_BY'], args, {
339
339
  isOptional: true,
340
340
  });
@@ -394,7 +394,7 @@ exports.aggregatedScalarExpressionFunctions = {
394
394
  ],
395
395
  examples: ['MODE([colA])', 'MODE([colA], GROUP_BY([colB]))'],
396
396
  category: 'aggregation',
397
- inputs: [['number'], ['text']],
397
+ inputs: [['number'], ['text'], ['date']],
398
398
  },
399
399
  DISTINCT: {
400
400
  handler(args, context) {
@@ -442,7 +442,7 @@ exports.aggregatedScalarExpressionFunctions = {
442
442
  ],
443
443
  examples: ['DISTINCT([colA])', 'DISTINCT([colA], GROUP_BY([colB]))'],
444
444
  category: 'aggregation',
445
- inputs: [['number'], ['text']],
445
+ inputs: [['number'], ['text'], ['date']],
446
446
  },
447
447
  ONLY: {
448
448
  handler(args, context) {
@@ -492,7 +492,7 @@ exports.aggregatedScalarExpressionFunctions = {
492
492
  ],
493
493
  examples: ['ONLY([colA])', 'ONLY([colA], GROUP_BY([colB]))'],
494
494
  category: 'aggregation',
495
- inputs: [['number'], ['text']],
495
+ inputs: [['number'], ['text'], ['date']],
496
496
  },
497
497
  STD_DEVIATION: {
498
498
  handler(args, context) {
@@ -853,7 +853,7 @@ exports.aggregatedScalarExpressionFunctions = {
853
853
  ],
854
854
  examples: ['COUNT([colA])', 'COUNT([colA], GROUP_BY([colB]))'],
855
855
  category: 'aggregation',
856
- inputs: [['number'], ['text']],
856
+ inputs: [['number'], ['text'], ['date']],
857
857
  },
858
858
  OVER: {
859
859
  handler(args, context) {
@@ -963,7 +963,7 @@ exports.aggregatedScalarExpressionFunctions = {
963
963
  };
964
964
  return result;
965
965
  },
966
- description: 'Aggregates a column over multiple rows by computing the minimum of the column values\nOptionally the aggregation may be computed within provided individual groups',
966
+ description: 'Aggregates a Date column over multiple rows by computing the oldest of the column values\nOptionally the aggregation may be computed within provided individual groups',
967
967
  signatures: [
968
968
  'OLDEST( [colName] )',
969
969
  'OLDEST( COL(name: string))',
@@ -974,19 +974,19 @@ exports.aggregatedScalarExpressionFunctions = {
974
974
  category: 'aggregation',
975
975
  inputs: ['date'],
976
976
  },
977
- YOUNGEST: {
977
+ NEWEST: {
978
978
  handler(args, context) {
979
- const minColumnParameter = (0, expressionFunctionUtils_1.extractColumnParameter)('YOUNGEST', args);
979
+ const minColumnParameter = (0, expressionFunctionUtils_1.extractColumnParameter)('NEWEST', args);
980
980
  const minColumnName = minColumnParameter.value;
981
- (0, expressionFunctionUtils_1.validateColumnType)(minColumnName, ['Date'], 'YOUNGEST', context.adaptableApi);
982
- const groupByParameter = (0, expressionFunctionUtils_1.extractParameter)('YOUNGEST', 'operand', ['GROUP_BY'], args, {
981
+ (0, expressionFunctionUtils_1.validateColumnType)(minColumnName, ['Date'], 'NEWEST', context.adaptableApi);
982
+ const groupByParameter = (0, expressionFunctionUtils_1.extractParameter)('NEWEST', 'operand', ['GROUP_BY'], args, {
983
983
  isOptional: true,
984
984
  });
985
985
  const aggregationExpressionEvaluation = {
986
986
  aggregationParams: {
987
987
  reducers: {
988
- YOUNGEST: {
989
- name: 'YOUNGEST',
988
+ NEWEST: {
989
+ name: 'NEWEST',
990
990
  field: minColumnName,
991
991
  initialValue: null,
992
992
  reducer: (minValue, rowValue) => {
@@ -1016,20 +1016,20 @@ exports.aggregatedScalarExpressionFunctions = {
1016
1016
  };
1017
1017
  addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
1018
1018
  const result = {
1019
- name: 'YOUNGEST',
1019
+ name: 'NEWEST',
1020
1020
  type: 'aggregationScalar',
1021
1021
  value: aggregationExpressionEvaluation,
1022
1022
  };
1023
1023
  return result;
1024
1024
  },
1025
- description: 'Aggregates a column over multiple rows by computing the minimum of the column values\nOptionally the aggregation may be computed within provided individual groups',
1025
+ description: 'Aggregates a Date column over multiple rows by computing the most recent of the column values\nOptionally the aggregation may be computed within provided individual groups',
1026
1026
  signatures: [
1027
- 'YOUNGEST( [colName] )',
1028
- 'YOUNGEST( COL(name: string))',
1029
- 'YOUNGEST( [colNameA], GROUP_BY( [colNameB] ))',
1030
- 'YOUNGEST( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
1027
+ 'NEWEST( [colName] )',
1028
+ 'NEWEST( COL(name: string))',
1029
+ 'NEWEST( [colNameA], GROUP_BY( [colNameB] ))',
1030
+ 'NEWEST( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
1031
1031
  ],
1032
- examples: ['YOUNGEST([colA])', 'YOUNGEST([colA], GROUP_BY([colB]))'],
1032
+ examples: ['NEWEST([colA])', 'NEWEST([colA], GROUP_BY([colB]))'],
1033
1033
  category: 'aggregation',
1034
1034
  inputs: ['date'],
1035
1035
  },
@@ -97,6 +97,7 @@ function addUuidAndSource(adaptableObject) {
97
97
  }
98
98
  exports.addUuidAndSource = addUuidAndSource;
99
99
  function removeUuidAndSource(adaptableObject) {
100
+ const clonedObject = structuredClone(adaptableObject);
100
101
  const sanitiseObject = (object) => {
101
102
  for (const key in object) {
102
103
  if (key === 'Source' || key === 'Uuid') {
@@ -110,8 +111,8 @@ function removeUuidAndSource(adaptableObject) {
110
111
  }
111
112
  }
112
113
  };
113
- sanitiseObject(adaptableObject);
114
- return adaptableObject;
114
+ sanitiseObject(clonedObject);
115
+ return clonedObject;
115
116
  }
116
117
  exports.removeUuidAndSource = removeUuidAndSource;
117
118
  exports.AdaptableHelper = {
@@ -313,6 +313,8 @@ function CreateEmptyCellSummmary() {
313
313
  Max: undefined,
314
314
  Min: undefined,
315
315
  Count: undefined,
316
+ Newest: undefined,
317
+ Oldest: undefined,
316
318
  Std_Deviation: undefined,
317
319
  Only: undefined,
318
320
  };
@@ -150,6 +150,7 @@ const LayoutWizard = (props) => {
150
150
  title: 'Row Summaries',
151
151
  details: 'Configure Row Summaries',
152
152
  renderSummary: () => React.createElement(RowGroupingSection_1.RowGroupingSectionSummary, null),
153
+ isVisible: () => layoutSupportedFeatures.RowSummaries,
153
154
  render: () => (React.createElement(rebass_1.Box, { p: 2, style: { height: '100%' } },
154
155
  React.createElement(RowSummarySection_1.RowSummarySection, { onChange: setLayout }))),
155
156
  },
@@ -16,7 +16,23 @@ const RowGroupingSectionSummary = () => {
16
16
  var _a;
17
17
  const adaptable = (0, AdaptableContext_1.useAdaptable)();
18
18
  const { data: layout } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
19
- return (React.createElement(rebass_1.Box, null, ((_a = layout.RowGroupedColumns) === null || _a === void 0 ? void 0 : _a.length) ? (layout.RowGroupedColumns.map((columnId) => (React.createElement(Tag_1.Tag, { mr: 1, key: columnId }, adaptable.api.columnApi.getFriendlyNameForColumnId(columnId))))) : (React.createElement(Tag_1.Tag, null, "No Row Grouping"))));
19
+ return (React.createElement(rebass_1.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) => {
20
+ var _a;
21
+ const columns = Object.entries((_a = rowSummary.ColumnsMap) !== null && _a !== void 0 ? _a : {})
22
+ .map(([columnId, expression]) => {
23
+ if (columnId === 'Source' || columnId === 'Uuid') {
24
+ return '';
25
+ }
26
+ return `${expression}(${adaptable.api.columnApi.getFriendlyNameForColumnId(columnId)})`;
27
+ })
28
+ .filter(Boolean)
29
+ .join(', ');
30
+ return (React.createElement(rebass_1.Box, { mb: 2 },
31
+ React.createElement(Tag_1.Tag, { key: index },
32
+ rowSummary.Position,
33
+ " ",
34
+ columns)));
35
+ })) : (React.createElement(Tag_1.Tag, null, "No Row Summaries"))));
20
36
  };
21
37
  exports.RowGroupingSectionSummary = RowGroupingSectionSummary;
22
38
  const RowGroupingSection = (props) => {
@@ -37,13 +37,13 @@ const areSummaryRowsValid = (layout) => {
37
37
  exports.areSummaryRowsValid = areSummaryRowsValid;
38
38
  const getAvailableExpressionsForColumnType = (columnType, availableScalarExpressions) => {
39
39
  const inputType = (0, adaptableQlUtils_1.mapColumnDataTypeToExpressionFunctionType)(columnType);
40
- return Object.entries(availableScalarExpressions !== null && availableScalarExpressions !== void 0 ? availableScalarExpressions : {})
41
- .map(([expression, expressionDef]) => {
40
+ // Object.entries(availableScalarExpressions ?? {})
41
+ return RowSummary_1.summarySupportedExpressions
42
+ .filter((expression) => availableScalarExpressions[expression])
43
+ .map((expression) => {
42
44
  var _a, _b;
45
+ const expressionDef = availableScalarExpressions[expression];
43
46
  let firstArg = null;
44
- if (!RowSummary_1.summarySupportedExpressions.includes(expression)) {
45
- return null;
46
- }
47
47
  if (Array.isArray((_a = expressionDef === null || expressionDef === void 0 ? void 0 : expressionDef.inputs) === null || _a === void 0 ? void 0 : _a[0])) {
48
48
  // @ts-ignore
49
49
  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;
@@ -2760,7 +2760,7 @@ class AdaptableAgGrid {
2760
2760
  setRowGroupColumns(columnIds) {
2761
2761
  this.agGridAdapter.getAgGridApi().setRowGroupColumns(columnIds);
2762
2762
  }
2763
- getAgGridAllGridColumns() {
2763
+ getAllGridColumns() {
2764
2764
  return this.agGridAdapter.getAgGridApi().getAllGridColumns();
2765
2765
  }
2766
2766
  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
@@ -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: 1712327561436 || Date.now(),
6
- VERSION: "18.0.0-canary.25" || '--current-version--',
5
+ PUBLISH_TIMESTAMP: 1712574295706 || Date.now(),
6
+ VERSION: "18.0.0-canary.26" || '--current-version--',
7
7
  };
@@ -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;