@adaptabletools/adaptable 18.0.0-canary.12 → 18.0.0-canary.14

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 (115) hide show
  1. package/base.css +1 -1
  2. package/base.css.map +1 -1
  3. package/index.css +1 -1
  4. package/index.css.map +1 -1
  5. package/package.json +1 -1
  6. package/src/AdaptableInterfaces/IAdaptable.d.ts +2 -2
  7. package/src/AdaptableOptions/MenuOptions.d.ts +1 -53
  8. package/src/AdaptableOptions/MenuOptions.js +3 -3
  9. package/src/Api/AdaptableApi.d.ts +2 -2
  10. package/src/Api/ConfigApi.d.ts +2 -3
  11. package/src/Api/GridApi.d.ts +2 -1
  12. package/src/Api/Implementation/ActionColumnApiImpl.js +3 -6
  13. package/src/Api/Implementation/ConfigApiImpl.js +7 -7
  14. package/src/Api/Implementation/GridApiImpl.d.ts +2 -1
  15. package/src/Api/Implementation/GridApiImpl.js +8 -1
  16. package/src/Api/Implementation/NoteApiImpl.d.ts +2 -2
  17. package/src/Api/Implementation/NoteApiImpl.js +8 -8
  18. package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +0 -3
  19. package/src/Api/Implementation/UserInterfaceApiImpl.js +0 -8
  20. package/src/Api/Internal/ActionRowInternalApi.js +1 -1
  21. package/src/Api/Internal/AdaptableInternalApi.d.ts +4 -2
  22. package/src/Api/Internal/AdaptableInternalApi.js +14 -11
  23. package/src/Api/Internal/CalculatedColumnInternalApi.js +3 -2
  24. package/src/Api/Internal/Fdc3InternalApi.js +2 -2
  25. package/src/Api/Internal/FreeTextColumnInternalApi.js +3 -2
  26. package/src/Api/Internal/GridInternalApi.d.ts +2 -0
  27. package/src/Api/Internal/GridInternalApi.js +15 -0
  28. package/src/Api/NoteApi.d.ts +5 -5
  29. package/src/Api/OptionsApi.d.ts +2 -2
  30. package/src/Api/UserInterfaceApi.d.ts +0 -11
  31. package/src/PredefinedConfig/AdaptableState.d.ts +1 -1
  32. package/src/PredefinedConfig/CommentState.d.ts +16 -12
  33. package/src/PredefinedConfig/Common/RowSummary.d.ts +7 -1
  34. package/src/PredefinedConfig/Common/TransposeConfig.d.ts +25 -0
  35. package/src/PredefinedConfig/Common/TransposeConfig.js +1 -0
  36. package/src/PredefinedConfig/Common/Types.d.ts +4 -4
  37. package/src/PredefinedConfig/Common/Types.js +4 -1
  38. package/src/PredefinedConfig/LayoutState.d.ts +1 -1
  39. package/src/PredefinedConfig/NoteState.d.ts +1 -1
  40. package/src/PredefinedConfig/PredefinedConfig.d.ts +1 -1
  41. package/src/Redux/ActionsReducers/NoteRedux.d.ts +38 -0
  42. package/src/Redux/ActionsReducers/{NotesRedux.js → NoteRedux.js} +20 -20
  43. package/src/Redux/ActionsReducers/SystemRedux.d.ts +1 -1
  44. package/src/Redux/Store/AdaptableStore.js +7 -7
  45. package/src/Strategy/CellSummaryModule.js +2 -1
  46. package/src/Strategy/{CommentsModule.d.ts → CommentModule.d.ts} +1 -5
  47. package/src/Strategy/{CommentsModule.js → CommentModule.js} +5 -6
  48. package/src/Strategy/LayoutModule.d.ts +1 -0
  49. package/src/Strategy/LayoutModule.js +17 -1
  50. package/src/Strategy/{NotesModule.d.ts → NoteModule.d.ts} +2 -1
  51. package/src/Strategy/{NotesModule.js → NoteModule.js} +7 -3
  52. package/src/Strategy/Utilities/getScopeViewItems.js +3 -0
  53. package/src/Utilities/Constants/ModuleConstants.d.ts +6 -6
  54. package/src/Utilities/Constants/ModuleConstants.js +6 -6
  55. package/src/Utilities/Defaults/DefaultSettingsPanel.js +2 -2
  56. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +15 -2
  57. package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +3 -3
  58. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.d.ts +1 -1
  59. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +15 -0
  60. package/src/Utilities/ObjectFactory.d.ts +3 -3
  61. package/src/Utilities/ObjectFactory.js +4 -24
  62. package/src/Utilities/Services/AggregatedScalarLiveValue.d.ts +1 -0
  63. package/src/Utilities/Services/AggregatedScalarLiveValue.js +12 -10
  64. package/src/Utilities/Services/CellPopupService.js +2 -2
  65. package/src/Utilities/Services/Interface/ISummaryService.d.ts +17 -0
  66. package/src/Utilities/Services/Interface/ISummaryService.js +12 -0
  67. package/src/Utilities/Services/ModuleService.js +4 -0
  68. package/src/Utilities/Services/QueryLanguageService.js +2 -2
  69. package/src/Utilities/Services/SummaryService.d.ts +5 -14
  70. package/src/Utilities/Services/SummaryService.js +0 -12
  71. package/src/Utilities/adaptableQlUtils.d.ts +2 -0
  72. package/src/Utilities/adaptableQlUtils.js +14 -0
  73. package/src/View/AdaptableViewFactory.js +2 -2
  74. package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.d.ts +1 -1
  75. package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +1 -1
  76. package/src/View/Comments/CommentsEditor.js +1 -1
  77. package/src/View/Comments/CommentsPopup.js +8 -4
  78. package/src/View/Components/Popups/GridCellPopup/GridCellPopup.js +5 -5
  79. package/src/View/Components/ValueSelector/index.d.ts +1 -0
  80. package/src/View/Components/ValueSelector/index.js +1 -1
  81. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +0 -1
  82. package/src/View/FreeTextColumn/FreeTextColumnSummary.js +1 -1
  83. package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +3 -1
  84. package/src/View/Layout/TransposedPopup.js +19 -18
  85. package/src/View/Layout/Wizard/LayoutWizard.js +8 -0
  86. package/src/View/Layout/Wizard/sections/RowSummarySection.d.ts +8 -0
  87. package/src/View/Layout/Wizard/sections/RowSummarySection.js +150 -0
  88. package/src/View/Note/NotePopup.d.ts +2 -0
  89. package/src/View/{Notes/NotesPopup.js → Note/NotePopup.js} +3 -3
  90. package/src/agGrid/AdaptableAgGrid.d.ts +2 -2
  91. package/src/agGrid/AdaptableAgGrid.js +7 -5
  92. package/src/agGrid/AgGridAdapter.d.ts +1 -0
  93. package/src/agGrid/AgGridAdapter.js +5 -0
  94. package/src/agGrid/AgGridColumnAdapter.js +3 -3
  95. package/src/agGrid/AgGridMenuAdapter.js +10 -6
  96. package/src/agGrid/defaultAdaptableOptions.js +0 -7
  97. package/src/components/ExpressionEditor/QueryBuilder/QueryPredicateBuilder.js +2 -1
  98. package/src/components/ExpressionEditor/QueryBuilder/utils.d.ts +0 -1
  99. package/src/components/ExpressionEditor/QueryBuilder/utils.js +1 -14
  100. package/src/components/icons/note.js +2 -2
  101. package/src/env.js +2 -2
  102. package/src/metamodel/adaptable.metamodel.d.ts +61 -11
  103. package/src/metamodel/adaptable.metamodel.js +1 -1
  104. package/src/parser/src/parser.js +117 -1257
  105. package/src/parser/src/predicate/mapExpressionToQlPredicate.js +1 -1
  106. package/src/parser/src/predicate/mapQlPredicateToExpression.js +2 -1
  107. package/src/parser/src/types.d.ts +2 -2
  108. package/src/types.d.ts +5 -4
  109. package/tsconfig.esm.tsbuildinfo +1 -1
  110. package/src/Redux/ActionsReducers/NotesRedux.d.ts +0 -38
  111. package/src/View/Notes/NotesPopup.d.ts +0 -2
  112. /package/src/Api/Internal/{NotesInternalApi.d.ts → NoteInternalApi.d.ts} +0 -0
  113. /package/src/Api/Internal/{NotesInternalApi.js → NoteInternalApi.js} +0 -0
  114. /package/src/View/{Notes → Note}/NoteEditor.d.ts +0 -0
  115. /package/src/View/{Notes → Note}/NoteEditor.js +0 -0
@@ -7,21 +7,21 @@ import { ColumnSelector } from '../Components/Selectors/ColumnSelector';
7
7
  import { AdaptableAgGrid } from '../../agGrid/AdaptableAgGrid';
8
8
  export const TransposedPopup = (props) => {
9
9
  const adaptable = useAdaptable();
10
+ const { transposedColumnId, hideTransposedColumn, visibleColumns, visibleRows } = props.popupProps;
10
11
  const rowNodes = React.useMemo(() => {
11
- return adaptable.api.gridApi.getAllRowNodes();
12
+ return props.popupProps.visibleRows
13
+ ? adaptable.api.gridApi.getVisibleRowNodes()
14
+ : adaptable.api.gridApi.getAllRowNodes();
12
15
  }, [
13
- // can be later triggered by ticking data
16
+ // can be later triggered by tickng data
14
17
  ]);
15
- const { transposedColumnId, hideTransposedColumn = true } = props.popupProps;
16
18
  const primaryKey = adaptable.api.optionsApi.getPrimaryKey();
17
- // Thist must be qunique
18
- const transposeByColumnId = primaryKey;
19
- // Only used to show nice values a the top of the grid, istead on the value
20
- // of the primarykey
21
- const [synteticTransposedByColumnId, setSynteticTransposedByColumnId] = React.useState(transposedColumnId !== null && transposedColumnId !== void 0 ? transposedColumnId : primaryKey);
19
+ const [syntheticTransposedByColumnId, setSyntheticTransposedByColumnId] = React.useState(transposedColumnId);
22
20
  const columns = React.useMemo(() => {
23
21
  // customisable
24
- return adaptable.api.columnApi.getColumns();
22
+ return visibleColumns
23
+ ? adaptable.api.columnApi.getVisibleColumns()
24
+ : adaptable.api.columnApi.getColumns();
25
25
  }, []);
26
26
  const adaptableContainerId = 'transposed-adaptable-container';
27
27
  const agGridContainerId = 'transposed-adaptable-ag-grid-container';
@@ -40,9 +40,10 @@ export const TransposedPopup = (props) => {
40
40
  for (const row of rowNodes) {
41
41
  // we force the col-ids to be strings, easer to work with
42
42
  //row[transposeByColumnId] + '';
43
- const colId = adaptable.api.gridApi.getNormalisedValueFromRowNode(row, transposeByColumnId) + '';
43
+ const colId = adaptable.api.gridApi.getNormalisedValueFromRowNode(row, primaryKey) + '';
44
44
  //row[synteticTransposedByColumnId] + '';
45
- const header = adaptable.api.gridApi.getNormalisedValueFromRowNode(row, synteticTransposedByColumnId) + '';
45
+ const header = adaptable.api.gridApi.getNormalisedValueFromRowNode(row, syntheticTransposedByColumnId) +
46
+ '';
46
47
  transposedColumns.push({
47
48
  colId,
48
49
  header,
@@ -52,7 +53,7 @@ export const TransposedPopup = (props) => {
52
53
  /**
53
54
  * We can hide the transposed column, if we want
54
55
  */
55
- if (hideTransposedColumn && column.columnId === synteticTransposedByColumnId) {
56
+ if (hideTransposedColumn && column.columnId === syntheticTransposedByColumnId) {
56
57
  continue;
57
58
  }
58
59
  const transposedRow = {
@@ -63,7 +64,7 @@ export const TransposedPopup = (props) => {
63
64
  };
64
65
  for (let row of rowNodes) {
65
66
  // [transposed-by-column-value[n]]: [other column value[n]]
66
- const key = adaptable.api.gridApi.getNormalisedValueFromRowNode(row, transposeByColumnId);
67
+ const key = adaptable.api.gridApi.getNormalisedValueFromRowNode(row, primaryKey);
67
68
  // row[column.field]
68
69
  let value = adaptable.api.gridApi.getDisplayValueFromRowNode(row, column.columnId);
69
70
  if (value instanceof Date) {
@@ -77,7 +78,7 @@ export const TransposedPopup = (props) => {
77
78
  transposedColumns,
78
79
  transposedRows,
79
80
  };
80
- }, [rowNodes, primaryKey, synteticTransposedByColumnId]);
81
+ }, [rowNodes, primaryKey, syntheticTransposedByColumnId]);
81
82
  React.useEffect(() => {
82
83
  // Mounting in an effect, so the nodes are rendered/available
83
84
  const hostAdaptableOptions = adaptable.adaptableOptions;
@@ -121,7 +122,7 @@ export const TransposedPopup = (props) => {
121
122
  };
122
123
  const firstColumn = {
123
124
  field: transposedFirstColumnHeader,
124
- headerName: adaptable.api.columnApi.getFriendlyNameForColumnId(synteticTransposedByColumnId),
125
+ headerName: adaptable.api.columnApi.getFriendlyNameForColumnId(syntheticTransposedByColumnId),
125
126
  };
126
127
  const agGridOptions = {
127
128
  suppressLoadingOverlay: true,
@@ -173,7 +174,7 @@ export const TransposedPopup = (props) => {
173
174
  transposedAdaptableApi.destroy();
174
175
  }
175
176
  };
176
- }, [synteticTransposedByColumnId]);
177
+ }, [syntheticTransposedByColumnId]);
177
178
  /**
178
179
  * Need to get all data, manualy pivot the grid using the primary key.
179
180
  *
@@ -185,8 +186,8 @@ export const TransposedPopup = (props) => {
185
186
  React.createElement(Panel, null,
186
187
  React.createElement(FormLayout, null,
187
188
  React.createElement(FormRow, { label: "Elevated Column" },
188
- React.createElement(ColumnSelector, { value: synteticTransposedByColumnId, onChange: (colId) => {
189
- setSynteticTransposedByColumnId(colId);
189
+ React.createElement(ColumnSelector, { value: syntheticTransposedByColumnId, onChange: (colId) => {
190
+ setSyntheticTransposedByColumnId(colId);
190
191
  } })))),
191
192
  React.createElement(Flex, { height: "100%" },
192
193
  React.createElement(Box, { id: "transposed-adaptable-container" }),
@@ -14,6 +14,7 @@ import { AggregationsSection, AggregationsSectionSummary, isAggregationsSectionV
14
14
  import { SortSection, SortSectionSummary } from './sections/SortSection';
15
15
  import { FilterSection, FilterSectionSummary, isColumnFiltersValid, } from './sections/FilterSection';
16
16
  import { GridFilterSection, GridFilterSectionSummary, isGridFiltersValid, } from './sections/GridFilterSection';
17
+ import { RowSummarySection } from './sections/RowSummarySection';
17
18
  export const LayoutWizard = (props) => {
18
19
  var _a, _b;
19
20
  const dispatch = useDispatch();
@@ -116,6 +117,13 @@ export const LayoutWizard = (props) => {
116
117
  render: () => (React.createElement(Box, { p: 2, style: { height: '100%' } },
117
118
  React.createElement(AggregationsSection, { onChange: setLayout }))),
118
119
  },
120
+ {
121
+ title: 'Row Summaries',
122
+ details: 'Configure Row Summaries',
123
+ renderSummary: () => React.createElement(RowGroupingSectionSummary, null),
124
+ render: () => (React.createElement(Box, { p: 2, style: { height: '100%' } },
125
+ React.createElement(RowSummarySection, { onChange: setLayout }))),
126
+ },
119
127
  {
120
128
  title: 'Sort',
121
129
  isVisible: () => layoutSupportedFeatures.ColumnSorts,
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import { Layout } from '../../../../../types';
3
+ export declare const RowGroupingSectionSummary: React.FunctionComponent;
4
+ interface RowSummarySectionProps {
5
+ onChange: (data: Layout) => void;
6
+ }
7
+ export declare const RowSummarySection: React.FunctionComponent<RowSummarySectionProps>;
8
+ export {};
@@ -0,0 +1,150 @@
1
+ import * as React from 'react';
2
+ import { Box, Flex } from 'rebass';
3
+ import FormLayout, { FormRow } from '../../../../components/FormLayout';
4
+ import Panel from '../../../../components/Panel';
5
+ import { Select } from '../../../../components/Select';
6
+ import SimpleButton from '../../../../components/SimpleButton';
7
+ import { Tabs } from '../../../../components/Tabs';
8
+ import { Tag } from '../../../../components/Tag';
9
+ import { mapColumnDataTypeToExpressionFunctionType } from '../../../../Utilities/adaptableQlUtils';
10
+ import { LayoutModuleId } from '../../../../Utilities/Constants/ModuleConstants';
11
+ import { summarySupportedExpressions } from '../../../../Utilities/Services/Interface/ISummaryService';
12
+ import { sortWithOrderArray } from '../../../../Utilities/sortWithOrder';
13
+ import { useAdaptable } from '../../../AdaptableContext';
14
+ import { ValueSelector } from '../../../Components/ValueSelector';
15
+ import { useOnePageAdaptableWizardContext } from '../../../Wizard/OnePageAdaptableWizard';
16
+ import { columnFilter } from './Utilities';
17
+ const getAvailableExpressionsForColumnType = (columnType, availableScalarExpressions) => {
18
+ const inputType = mapColumnDataTypeToExpressionFunctionType(columnType);
19
+ return Object.entries(availableScalarExpressions !== null && availableScalarExpressions !== void 0 ? availableScalarExpressions : {})
20
+ .map(([expression, expressionDef]) => {
21
+ var _a, _b;
22
+ let firstArg = null;
23
+ if (!summarySupportedExpressions.includes(expression)) {
24
+ return null;
25
+ }
26
+ if (Array.isArray((_a = expressionDef === null || expressionDef === void 0 ? void 0 : expressionDef.inputs) === null || _a === void 0 ? void 0 : _a[0])) {
27
+ // @ts-ignore
28
+ firstArg = (_b = expressionDef.inputs.find((input) => input.includes(inputType))) === null || _b === void 0 ? void 0 : _b[0];
29
+ }
30
+ else {
31
+ firstArg = expressionDef.inputs[0];
32
+ }
33
+ if (inputType === firstArg) {
34
+ return expression;
35
+ }
36
+ else {
37
+ return null;
38
+ }
39
+ })
40
+ .filter(Boolean);
41
+ };
42
+ export const RowGroupingSectionSummary = () => {
43
+ var _a;
44
+ const adaptable = useAdaptable();
45
+ const { data: layout } = useOnePageAdaptableWizardContext();
46
+ 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"))));
47
+ };
48
+ const RowSummaryEditor = ({ rowSummary, onChange, availableScalarExpressions, onDelete, }) => {
49
+ const { data: layout } = useOnePageAdaptableWizardContext();
50
+ const adaptable = useAdaptable();
51
+ const columns = React.useMemo(() => {
52
+ const colIds = adaptable.api.columnApi
53
+ .getColumns()
54
+ .filter((column) => {
55
+ var _a, _b;
56
+ if (!['Number', 'String'].includes(column.dataType))
57
+ return false;
58
+ return (_b = (_a = layout.Columns) === null || _a === void 0 ? void 0 : _a.includes) === null || _b === void 0 ? void 0 : _b.call(_a, column.columnId);
59
+ })
60
+ .map((c) => c.columnId);
61
+ return sortWithOrderArray(colIds, Object.keys(rowSummary.ColumnsMap), {
62
+ sortUnorderedItems: false,
63
+ }).map((colId) => adaptable.api.columnApi.getColumnWithColumnId(colId));
64
+ }, [rowSummary.ColumnsMap]);
65
+ return (React.createElement(Panel, { header: React.createElement(Flex, { style: { width: '100%' } },
66
+ React.createElement(Flex, { flex: 1, alignItems: "center" }, "Row Summary"),
67
+ React.createElement(SimpleButton, { icon: "delete", onClick: () => {
68
+ onDelete();
69
+ } })), p: 2 },
70
+ React.createElement(FormLayout, null,
71
+ React.createElement(FormRow, { label: "Position" },
72
+ React.createElement(Select, { options: [
73
+ {
74
+ label: 'Top',
75
+ value: 'Top',
76
+ },
77
+ {
78
+ label: 'Bottom',
79
+ value: 'Bottom',
80
+ },
81
+ ], value: rowSummary.Position, onChange: (position) => {
82
+ onChange(Object.assign(Object.assign({}, rowSummary), { Position: position }));
83
+ } }))),
84
+ React.createElement(Flex, { flexDirection: 'column', mt: 2, mb: 1 },
85
+ React.createElement(Flex, { alignItems: "center", flex: 1, mb: 2 }, "Column Aggregations"),
86
+ React.createElement(Panel, { bodyProps: { maxHeight: '100%' }, style: { height: 360 } },
87
+ React.createElement(ValueSelector, { style: { maxHeight: '100%' }, showFilterInput: true, filter: columnFilter, toIdentifier: (column) => column.columnId, toLabel: (option) => { var _a; return (_a = option.friendlyName) !== null && _a !== void 0 ? _a : option.columnId; }, options: columns, xSelectedLabel: () => {
88
+ return 'Active Aggregations:';
89
+ }, toListLabel: (column) => {
90
+ var _a, _b;
91
+ const label = (_a = column.friendlyName) !== null && _a !== void 0 ? _a : column.columnId;
92
+ if (!(column.columnId in ((_b = rowSummary.ColumnsMap) !== null && _b !== void 0 ? _b : {}))) {
93
+ return label;
94
+ }
95
+ const expressionOptions = getAvailableExpressionsForColumnType(column.dataType, availableScalarExpressions).map((expression) => ({
96
+ label: expression,
97
+ value: expression,
98
+ }));
99
+ const expression = rowSummary.ColumnsMap[column.columnId];
100
+ return (React.createElement(Flex, null,
101
+ React.createElement(Flex, { mr: 2, alignItems: 'center' }, label),
102
+ React.createElement(Select, { value: expression, options: expressionOptions, onChange: (expression) => {
103
+ onChange(Object.assign(Object.assign({}, rowSummary), { ColumnsMap: Object.assign(Object.assign({}, rowSummary.ColumnsMap), { [column.columnId]: expression }) }));
104
+ } })));
105
+ }, value: Object.keys(rowSummary.ColumnsMap), onChange: (colIds) => {
106
+ const newColumnsMap = {};
107
+ colIds.forEach((colId) => {
108
+ var _a;
109
+ newColumnsMap[colId] = (_a = rowSummary.ColumnsMap[colId]) !== null && _a !== void 0 ? _a : null;
110
+ });
111
+ onChange(Object.assign(Object.assign({}, rowSummary), { ColumnsMap: newColumnsMap }));
112
+ } })))));
113
+ };
114
+ export const RowSummarySection = (props) => {
115
+ var _a;
116
+ const adaptable = useAdaptable();
117
+ const { data: layout } = useOnePageAdaptableWizardContext();
118
+ const availableScalarExpressions = React.useMemo(() => {
119
+ return adaptable.api.internalApi
120
+ .getQueryLanguageService()
121
+ .getModuleExpressionFunctionsMap(LayoutModuleId).aggregatedScalarFunctions;
122
+ }, []);
123
+ return (React.createElement(Tabs, { style: { height: '100%' } },
124
+ React.createElement(Tabs.Tab, null, "Row Summaries"),
125
+ React.createElement(Tabs.Content, null,
126
+ React.createElement("div", null,
127
+ React.createElement(Flex, { mb: 1 },
128
+ React.createElement(Flex, { flex: 1 }),
129
+ React.createElement(SimpleButton, { onClick: () => {
130
+ var _a;
131
+ props.onChange(Object.assign(Object.assign({}, layout), { RowSummaries: [
132
+ ...((_a = layout.RowSummaries) !== null && _a !== void 0 ? _a : []),
133
+ {
134
+ Position: 'Top',
135
+ ColumnsMap: {},
136
+ },
137
+ ] }));
138
+ }, icon: "plus" }, "Add Row Summary")),
139
+ ((_a = layout.RowSummaries) !== null && _a !== void 0 ? _a : []).map((rowSummary, index) => {
140
+ return (React.createElement(RowSummaryEditor, { key: index, onDelete: () => {
141
+ const newSummaries = [...layout.RowSummaries];
142
+ newSummaries.splice(index, 1);
143
+ props.onChange(Object.assign(Object.assign({}, layout), { RowSummaries: newSummaries }));
144
+ }, availableScalarExpressions: availableScalarExpressions, rowSummary: rowSummary, onChange: (rowSummary) => {
145
+ const newSummaries = [...layout.RowSummaries];
146
+ newSummaries[index] = rowSummary;
147
+ props.onChange(Object.assign(Object.assign({}, layout), { RowSummaries: newSummaries }));
148
+ } }));
149
+ })))));
150
+ };
@@ -0,0 +1,2 @@
1
+ import * as React from 'react';
2
+ export declare const NotePopup: React.FunctionComponent;
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { useSelector } from 'react-redux';
3
3
  import { DataSource, InfiniteTable } from '../../components/InfiniteTable';
4
- import { GetAllNotesSelector } from '../../Redux/ActionsReducers/NotesRedux';
4
+ import { GetAllNotesSelector } from '../../Redux/ActionsReducers/NoteRedux';
5
5
  import { useAdaptable } from '../AdaptableContext';
6
6
  import { AdaptableButtonComponent } from '../Components/AdaptableButton';
7
7
  import { PopupPanel } from '../Components/Popups/AdaptablePopup/PopupPanel';
@@ -12,10 +12,10 @@ const tableDOMProps = {
12
12
  // minHeight: 600,
13
13
  },
14
14
  };
15
- export const NotesPopup = (props) => {
15
+ export const NotePopup = (props) => {
16
16
  const adaptable = useAdaptable();
17
17
  const primaryKeyHeader = adaptable.api.columnApi.getFriendlyNameForColumnId(adaptable.api.columnApi.getPrimaryKeyColumn().columnId);
18
- const allNotes = useSelector((state) => GetAllNotesSelector(state.Notes));
18
+ const allNotes = useSelector((state) => GetAllNotesSelector(state.Note));
19
19
  const columnsMap = React.useMemo(() => {
20
20
  const columns = {
21
21
  primaryKey: {
@@ -26,7 +26,7 @@ import { RenderReactRootFn } from '../renderReactRoot';
26
26
  import { AgGridOptionsService } from './AgGridOptionsService';
27
27
  import { AgGridColumnAdapter } from './AgGridColumnAdapter';
28
28
  import { RowEditService } from '../Utilities/Services/RowEditService';
29
- import { SummaryService } from '../Utilities/Services/SummaryService';
29
+ import { ISummaryService } from '../Utilities/Services/Interface/ISummaryService';
30
30
  export type AdaptableVariant = 'vanilla' | 'react' | 'angular';
31
31
  export type AdaptableLifecycleState = 'initial' | 'preprocessOptions' | 'initAdaptableState' | 'setupAgGrid' | 'initAgGrid' | 'available' | 'ready' | 'preDestroyed';
32
32
  type RenderAgGridFrameworkComponentResult = false | GridApi;
@@ -82,7 +82,7 @@ export declare class AdaptableAgGrid implements IAdaptable {
82
82
  RowEditService: RowEditService;
83
83
  Fdc3Service: Fdc3Service;
84
84
  CellPopupService: CellPopupService;
85
- SummaryService: SummaryService;
85
+ SummaryService: ISummaryService;
86
86
  private LicenseService;
87
87
  private ChartingService;
88
88
  private ThemeService;
@@ -59,12 +59,12 @@ import { ColumnInfoModule } from '../Strategy/ColumnInfoModule';
59
59
  import { SettingsPanelModule } from '../Strategy/SettingsPanelModule';
60
60
  import { StatusBarModule } from '../Strategy/StatusBarModule';
61
61
  import { ChartingModule } from '../Strategy/ChartingModule';
62
- import { NotesModule } from '../Strategy/NotesModule';
62
+ import { NoteModule } from '../Strategy/NoteModule';
63
63
  import { StyledColumnModule } from '../Strategy/StyledColumnModule';
64
64
  import { Fdc3Module } from '../Strategy/Fdc3Module';
65
65
  import { GridFilterModule } from '../Strategy/GridFilterModule';
66
66
  import { NamedQueryModule } from '../Strategy/NamedQueryModule';
67
- import { CommentsModule } from '../Strategy/CommentsModule';
67
+ import { CommentModule } from '../Strategy/CommentModule';
68
68
  import { AdaptableNumberEditor, ReactAdaptableNumberEditor } from './editors/AdaptableNumberEditor';
69
69
  import { AdaptableDateEditor, ReactAdaptableDateEditor } from './editors/AdaptableDateEditor';
70
70
  import { Helper } from '../Utilities/Helpers/Helper';
@@ -1139,7 +1139,9 @@ export class AdaptableAgGrid {
1139
1139
  const allAgGridColDefIds = allAgGridFlattenedColDefs.map((colDef) => colDef.colId);
1140
1140
  const getColDef = (colId) => allAgGridFlattenedColDefs.find((colDef) => colDef.colId === colId);
1141
1141
  agGridState.columnVisibility = {
1142
- hiddenColIds: allAgGridColDefIds.filter((colDefId) => { var _a; return !((_a = currentLayout.Columns) === null || _a === void 0 ? void 0 : _a.includes(colDefId)); }),
1142
+ hiddenColIds: allAgGridFlattenedColDefs
1143
+ .filter((colDef) => { var _a; return !((_a = currentLayout.Columns) === null || _a === void 0 ? void 0 : _a.includes(colDef.colId)) || colDef.hide || colDef.initialHide; })
1144
+ .map((colDef) => colDef.colId),
1143
1145
  };
1144
1146
  agGridState.columnOrder = {
1145
1147
  orderedColIds: sortWithOrderArray(allAgGridColDefIds, currentLayout.Columns || [], {
@@ -1581,7 +1583,7 @@ export class AdaptableAgGrid {
1581
1583
  modules.set(ModuleConstants.ChartingModuleId, new ChartingModule(this.api));
1582
1584
  modules.set(ModuleConstants.ColumnFilterModuleId, new ColumnFilterModule(this.api));
1583
1585
  modules.set(ModuleConstants.ColumnInfoModuleId, new ColumnInfoModule(this.api));
1584
- modules.set(ModuleConstants.CommentsModuleId, new CommentsModule(this.api));
1586
+ modules.set(ModuleConstants.CommentModuleId, new CommentModule(this.api));
1585
1587
  modules.set(ModuleConstants.CustomSortModuleId, new CustomSortModule(this.api));
1586
1588
  modules.set(ModuleConstants.DashboardModuleId, new DashboardModule(this.api));
1587
1589
  modules.set(ModuleConstants.DataChangeHistoryModuleId, new DataChangeHistoryModule(this.api));
@@ -1596,7 +1598,7 @@ export class AdaptableAgGrid {
1596
1598
  modules.set(ModuleConstants.GridInfoModuleId, new GridInfoModule(this.api));
1597
1599
  modules.set(ModuleConstants.LayoutModuleId, new LayoutModule(this.api));
1598
1600
  modules.set(ModuleConstants.NamedQueryModuleId, new NamedQueryModule(this.api));
1599
- modules.set(ModuleConstants.NotesModuleId, new NotesModule(this.api));
1601
+ modules.set(ModuleConstants.NoteModuleId, new NoteModule(this.api));
1600
1602
  modules.set(ModuleConstants.PlusMinusModuleId, new PlusMinusModule(this.api));
1601
1603
  modules.set(ModuleConstants.QuickSearchModuleId, new QuickSearchModule(this.api));
1602
1604
  modules.set(ModuleConstants.ScheduleModuleId, new ScheduleModule(this.api));
@@ -60,4 +60,5 @@ export declare class AgGridAdapter {
60
60
  * Mutates the colDefs to ensure that each column has a colId
61
61
  */
62
62
  assignColumnIdsToColDefs(colDefs?: (ColDef | ColGroupDef)[]): void;
63
+ getDefaultColumnDefinition(): GridOptions['defaultColDef'];
63
64
  }
@@ -577,4 +577,9 @@ export class AgGridAdapter {
577
577
  };
578
578
  colDefs.forEach((colDef) => assignColId(colDef));
579
579
  }
580
+ getDefaultColumnDefinition() {
581
+ var _a, _b;
582
+ // for early init phase, gridApi might not be ready yet
583
+ return (_b = (_a = this.getAgGridApi(true)) === null || _a === void 0 ? void 0 : _a.getGridOption('defaultColDef')) !== null && _b !== void 0 ? _b : {};
584
+ }
580
585
  }
@@ -603,7 +603,7 @@ export class AgGridColumnAdapter {
603
603
  : undefined;
604
604
  }
605
605
  getNoteCellClassName(gridCell, params) {
606
- if (!this.adaptableApi.internalApi.getModuleService().isModuleAvailable('Notes')) {
606
+ if (!this.adaptableApi.internalApi.getModuleService().isModuleAvailable('Note')) {
607
607
  return;
608
608
  }
609
609
  if (!this.adaptableApi.noteApi.internalApi.areNotesAvailable()) {
@@ -613,14 +613,14 @@ export class AgGridColumnAdapter {
613
613
  PrimaryKeyValue: gridCell.primaryKeyValue,
614
614
  ColumnId: gridCell.column.columnId,
615
615
  };
616
- const cellNotes = this.adaptableApi.noteApi.getCellNotes(cellPosition);
616
+ const cellNotes = this.adaptableApi.noteApi.getNotesForCell(cellPosition);
617
617
  if (!(cellNotes === null || cellNotes === void 0 ? void 0 : cellNotes.length)) {
618
618
  return undefined;
619
619
  }
620
620
  return 'ab-Cell-Note';
621
621
  }
622
622
  getCommentCellClassName(gridCell, params) {
623
- if (!this.adaptableApi.internalApi.getModuleService().isModuleAvailable('Comments')) {
623
+ if (!this.adaptableApi.internalApi.getModuleService().isModuleAvailable('Comment')) {
624
624
  return;
625
625
  }
626
626
  if (!this.adaptableApi.commentApi.internalApi.areCommentsAvailable()) {
@@ -213,18 +213,22 @@ export class AgGridMenuAdapter {
213
213
  };
214
214
  }
215
215
  else {
216
- return adaptableMenuItems.find((menuItem) => menuItem.module === moduleOrGroup);
216
+ return adaptableMenuItems.filter((menuItem) => menuItem.module === moduleOrGroup);
217
217
  }
218
218
  })
219
- .filter((menuItem) => {
220
- if (!menuItem) {
219
+ .filter((menuItems) => {
220
+ if (!menuItems.length) {
221
221
  return false;
222
222
  }
223
- if (menuItem.subItems && menuItem.subItems.length === 0) {
224
- return false;
223
+ if (menuItems.length === 1) {
224
+ const singleMenuItem = menuItems[0];
225
+ if (singleMenuItem.subItems && singleMenuItem.subItems.length === 0) {
226
+ return false;
227
+ }
225
228
  }
226
229
  return true;
227
- });
230
+ })
231
+ .flat();
228
232
  }
229
233
  mapAdaptableMenuItemToSystemMenuItems(adaptableMenuItems) {
230
234
  return (adaptableMenuItems !== null && adaptableMenuItems !== void 0 ? adaptableMenuItems : []).map((menuItem) => {
@@ -170,13 +170,6 @@ const DefaultAdaptableOptions = {
170
170
  menuOptions: {
171
171
  customColumnMenu: undefined,
172
172
  customContextMenu: undefined,
173
- showAdaptableContextMenu: true,
174
- showAdaptableColumnMenu: true,
175
- showUngroupColumnMenuItem: true,
176
- columnMenuOrder: ['aggrid', 'adaptable', 'user'],
177
- contextMenuOrder: ['aggrid', 'adaptable', 'user'],
178
- columnMenuItems: undefined,
179
- contextMenuItems: undefined,
180
173
  },
181
174
  columnFilterOptions: {
182
175
  quickFilterOptions: {
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { Draggable, Droppable } from 'react-beautiful-dnd';
3
3
  import { Box, Flex } from 'rebass';
4
4
  import { isQlLogicalOperator } from '../../../parser/src/predicate';
5
+ import { mapColumnDataTypeToExpressionFunctionType } from '../../../Utilities/adaptableQlUtils';
5
6
  import { booleanExpressionFunctions } from '../../../Utilities/ExpressionFunctions/booleanExpressionFunctions';
6
7
  import { useAdaptable } from '../../../View/AdaptableContext';
7
8
  import DropdownButton from '../../DropdownButton';
@@ -9,7 +10,7 @@ import ErrorBox from '../../ErrorBox';
9
10
  import { Icon } from '../../icons';
10
11
  import SimpleButton from '../../SimpleButton';
11
12
  import { CombinatorSelector, ExpressionSelector, PrimiteValueInput, PrimitiveColumnSelector, PrimitiveMultiValueInput, } from './QueryBuilderInputs';
12
- import { getOperatorMatchingInputs as getFunctionMatchingInputTypes, mapColumnDataTypeToExpressionFunctionType, } from './utils';
13
+ import { getOperatorMatchingInputs as getFunctionMatchingInputTypes } from './utils';
13
14
  const ITEM_HEIGHT = 40;
14
15
  const BASE_CLASS_NAME = 'ab-QueryBuilder-predicate-editor';
15
16
  const Handle = (props) => (React.createElement(Flex, Object.assign({ className: `${BASE_CLASS_NAME}__handle`, height: ITEM_HEIGHT, alignItems: "center", mr: 1 }, props),
@@ -2,7 +2,6 @@ import { QlPredicate, QlPredicateError } from '../../../parser/src/predicate';
2
2
  import { ExpressionFunctionInputType } from '../../../parser/src/types';
3
3
  import { AdaptableColumnDataType, BooleanFunctionName } from '../../../types';
4
4
  export declare const reorder: (predicate: QlPredicate, from: string, to: string) => any;
5
- export declare const mapColumnDataTypeToExpressionFunctionType: (dataType: AdaptableColumnDataType) => ExpressionFunctionInputType;
6
5
  export declare const mapExpressionFunctionTypeToColumnDataType: (type: ExpressionFunctionInputType) => AdaptableColumnDataType;
7
6
  export declare const getOperatorMatchingInputs: (columnType: ExpressionFunctionInputType, inputs: ExpressionFunctionInputType[] | Array<ExpressionFunctionInputType>[]) => ExpressionFunctionInputType[];
8
7
  export declare const getFunctionsForColumnType: (dataType: AdaptableColumnDataType, availableBooleanFunctions: BooleanFunctionName[]) => BooleanFunctionName[];
@@ -1,3 +1,4 @@
1
+ import { mapColumnDataTypeToExpressionFunctionType } from '../../../Utilities/adaptableQlUtils';
1
2
  import { isQlLogicalOperator } from '../../../parser/src/predicate';
2
3
  import { booleanExpressionFunctions } from '../../../Utilities/ExpressionFunctions/booleanExpressionFunctions';
3
4
  import { deepClone } from '../../../Utilities/Extensions/ObjectExtensions';
@@ -26,20 +27,6 @@ export const reorder = (predicate, from, to) => {
26
27
  parent.args.splice(parseInt(toPath[toPath.length - 1]), 0, itemToMove);
27
28
  return predicateCopy;
28
29
  };
29
- export const mapColumnDataTypeToExpressionFunctionType = (dataType) => {
30
- if (dataType === 'Number') {
31
- return 'number';
32
- }
33
- if (dataType === 'Boolean') {
34
- return 'boolean';
35
- }
36
- if (dataType === 'String') {
37
- return 'text';
38
- }
39
- if (dataType === 'Date') {
40
- return 'date';
41
- }
42
- };
43
30
  export const mapExpressionFunctionTypeToColumnDataType = (type) => {
44
31
  if (type === 'number') {
45
32
  return 'Number';
@@ -1,4 +1,4 @@
1
1
  import * as React from 'react';
2
2
  import DefaultIcon from './DefaultIcon';
3
- export default (props) => (React.createElement(DefaultIcon, Object.assign({}, props, { viewBox: "0 -960 960 960" }),
4
- React.createElement("path", { d: "M440-240h80v-120h120v-80H520v-120h-80v120H320v80h120v120ZM240-80q-33 0-56.5-23.5T160-160v-640q0-33 23.5-56.5T240-880h320l240 240v480q0 33-23.5 56.5T720-80H240Zm280-520v-200H240v640h480v-440H520ZM240-800v200-200 640-640Z" })));
3
+ export default (props) => (React.createElement(DefaultIcon, Object.assign({}, props),
4
+ React.createElement("path", { d: "M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM8 14H6v-2h2v2zm0-3H6V9h2v2zm0-3H6V6h2v2zm7 6h-5v-2h5v2zm3-3h-8V9h8v2zm0-3h-8V6h8v2z" })));
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: 1711034314862 || Date.now(),
4
- VERSION: "18.0.0-canary.12" || '--current-version--',
3
+ PUBLISH_TIMESTAMP: 1711381973916 || Date.now(),
4
+ VERSION: "18.0.0-canary.14" || '--current-version--',
5
5
  };