@adaptabletools/adaptable-cjs 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 +9 -9
  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 +2 -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} +26 -26
  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} +7 -8
  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} +9 -5
  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 +7 -7
  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 +15 -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 +1 -13
  71. package/src/Utilities/adaptableQlUtils.d.ts +2 -0
  72. package/src/Utilities/adaptableQlUtils.js +18 -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 +156 -0
  88. package/src/View/Note/NotePopup.d.ts +2 -0
  89. package/src/View/{Notes/NotesPopup.js → Note/NotePopup.js} +5 -5
  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 +3 -17
  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.cjs.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
@@ -12,8 +12,10 @@ const ObjectFactory_1 = tslib_1.__importDefault(require("../../../Utilities/Obje
12
12
  const FreeTextColumnRedux = tslib_1.__importStar(require("../../../Redux/ActionsReducers/FreeTextColumnRedux"));
13
13
  const react_redux_1 = require("react-redux");
14
14
  const ObjectTagsWizardSection_1 = require("../../Wizard/ObjectTagsWizardSection");
15
+ const AdaptableContext_1 = require("../../AdaptableContext");
15
16
  const FreeTextColumnWizard = (props) => {
16
17
  var _a;
18
+ const adaptable = (0, AdaptableContext_1.useAdaptable)();
17
19
  const allFreeTextColumns = (0, react_redux_1.useSelector)((state) => state.FreeTextColumn.FreeTextColumns);
18
20
  const [freeTextColumn, setFreeTextColumn] = (0, react_1.useState)(() => {
19
21
  var _a, _b;
@@ -23,7 +25,7 @@ const FreeTextColumnWizard = (props) => {
23
25
  if (((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.action) === 'Edit' && ((_b = props.popupParams) === null || _b === void 0 ? void 0 : _b.column)) {
24
26
  return allFreeTextColumns.find((column) => column.ColumnId === props.popupParams.column.columnId);
25
27
  }
26
- return ObjectFactory_1.default.CreateEmptyFreeTextColumn();
28
+ return ObjectFactory_1.default.CreateEmptyFreeTextColumn(adaptable.api.gridApi.internalApi.deriveSpecialColumnSettingsFromAgGridDefaultColDef());
27
29
  });
28
30
  const dispatch = (0, react_redux_1.useDispatch)();
29
31
  const isEdit = props.data || ((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.action) === 'Edit';
@@ -11,21 +11,21 @@ const ColumnSelector_1 = require("../Components/Selectors/ColumnSelector");
11
11
  const AdaptableAgGrid_1 = require("../../agGrid/AdaptableAgGrid");
12
12
  const TransposedPopup = (props) => {
13
13
  const adaptable = (0, AdaptableContext_1.useAdaptable)();
14
+ const { transposedColumnId, hideTransposedColumn, visibleColumns, visibleRows } = props.popupProps;
14
15
  const rowNodes = React.useMemo(() => {
15
- return adaptable.api.gridApi.getAllRowNodes();
16
+ return props.popupProps.visibleRows
17
+ ? adaptable.api.gridApi.getVisibleRowNodes()
18
+ : adaptable.api.gridApi.getAllRowNodes();
16
19
  }, [
17
- // can be later triggered by ticking data
20
+ // can be later triggered by tickng data
18
21
  ]);
19
- const { transposedColumnId, hideTransposedColumn = true } = props.popupProps;
20
22
  const primaryKey = adaptable.api.optionsApi.getPrimaryKey();
21
- // Thist must be qunique
22
- const transposeByColumnId = primaryKey;
23
- // Only used to show nice values a the top of the grid, istead on the value
24
- // of the primarykey
25
- const [synteticTransposedByColumnId, setSynteticTransposedByColumnId] = React.useState(transposedColumnId !== null && transposedColumnId !== void 0 ? transposedColumnId : primaryKey);
23
+ const [syntheticTransposedByColumnId, setSyntheticTransposedByColumnId] = React.useState(transposedColumnId);
26
24
  const columns = React.useMemo(() => {
27
25
  // customisable
28
- return adaptable.api.columnApi.getColumns();
26
+ return visibleColumns
27
+ ? adaptable.api.columnApi.getVisibleColumns()
28
+ : adaptable.api.columnApi.getColumns();
29
29
  }, []);
30
30
  const adaptableContainerId = 'transposed-adaptable-container';
31
31
  const agGridContainerId = 'transposed-adaptable-ag-grid-container';
@@ -44,9 +44,10 @@ const TransposedPopup = (props) => {
44
44
  for (const row of rowNodes) {
45
45
  // we force the col-ids to be strings, easer to work with
46
46
  //row[transposeByColumnId] + '';
47
- const colId = adaptable.api.gridApi.getNormalisedValueFromRowNode(row, transposeByColumnId) + '';
47
+ const colId = adaptable.api.gridApi.getNormalisedValueFromRowNode(row, primaryKey) + '';
48
48
  //row[synteticTransposedByColumnId] + '';
49
- const header = adaptable.api.gridApi.getNormalisedValueFromRowNode(row, synteticTransposedByColumnId) + '';
49
+ const header = adaptable.api.gridApi.getNormalisedValueFromRowNode(row, syntheticTransposedByColumnId) +
50
+ '';
50
51
  transposedColumns.push({
51
52
  colId,
52
53
  header,
@@ -56,7 +57,7 @@ const TransposedPopup = (props) => {
56
57
  /**
57
58
  * We can hide the transposed column, if we want
58
59
  */
59
- if (hideTransposedColumn && column.columnId === synteticTransposedByColumnId) {
60
+ if (hideTransposedColumn && column.columnId === syntheticTransposedByColumnId) {
60
61
  continue;
61
62
  }
62
63
  const transposedRow = {
@@ -67,7 +68,7 @@ const TransposedPopup = (props) => {
67
68
  };
68
69
  for (let row of rowNodes) {
69
70
  // [transposed-by-column-value[n]]: [other column value[n]]
70
- const key = adaptable.api.gridApi.getNormalisedValueFromRowNode(row, transposeByColumnId);
71
+ const key = adaptable.api.gridApi.getNormalisedValueFromRowNode(row, primaryKey);
71
72
  // row[column.field]
72
73
  let value = adaptable.api.gridApi.getDisplayValueFromRowNode(row, column.columnId);
73
74
  if (value instanceof Date) {
@@ -81,7 +82,7 @@ const TransposedPopup = (props) => {
81
82
  transposedColumns,
82
83
  transposedRows,
83
84
  };
84
- }, [rowNodes, primaryKey, synteticTransposedByColumnId]);
85
+ }, [rowNodes, primaryKey, syntheticTransposedByColumnId]);
85
86
  React.useEffect(() => {
86
87
  // Mounting in an effect, so the nodes are rendered/available
87
88
  const hostAdaptableOptions = adaptable.adaptableOptions;
@@ -125,7 +126,7 @@ const TransposedPopup = (props) => {
125
126
  };
126
127
  const firstColumn = {
127
128
  field: transposedFirstColumnHeader,
128
- headerName: adaptable.api.columnApi.getFriendlyNameForColumnId(synteticTransposedByColumnId),
129
+ headerName: adaptable.api.columnApi.getFriendlyNameForColumnId(syntheticTransposedByColumnId),
129
130
  };
130
131
  const agGridOptions = {
131
132
  suppressLoadingOverlay: true,
@@ -177,7 +178,7 @@ const TransposedPopup = (props) => {
177
178
  transposedAdaptableApi.destroy();
178
179
  }
179
180
  };
180
- }, [synteticTransposedByColumnId]);
181
+ }, [syntheticTransposedByColumnId]);
181
182
  /**
182
183
  * Need to get all data, manualy pivot the grid using the primary key.
183
184
  *
@@ -189,8 +190,8 @@ const TransposedPopup = (props) => {
189
190
  React.createElement(Panel_1.default, null,
190
191
  React.createElement(FormLayout_1.default, null,
191
192
  React.createElement(FormLayout_1.FormRow, { label: "Elevated Column" },
192
- React.createElement(ColumnSelector_1.ColumnSelector, { value: synteticTransposedByColumnId, onChange: (colId) => {
193
- setSynteticTransposedByColumnId(colId);
193
+ React.createElement(ColumnSelector_1.ColumnSelector, { value: syntheticTransposedByColumnId, onChange: (colId) => {
194
+ setSyntheticTransposedByColumnId(colId);
194
195
  } })))),
195
196
  React.createElement(rebass_1.Flex, { height: "100%" },
196
197
  React.createElement(rebass_1.Box, { id: "transposed-adaptable-container" }),
@@ -18,6 +18,7 @@ const AggregationsSection_1 = require("./sections/AggregationsSection");
18
18
  const SortSection_1 = require("./sections/SortSection");
19
19
  const FilterSection_1 = require("./sections/FilterSection");
20
20
  const GridFilterSection_1 = require("./sections/GridFilterSection");
21
+ const RowSummarySection_1 = require("./sections/RowSummarySection");
21
22
  const LayoutWizard = (props) => {
22
23
  var _a, _b;
23
24
  const dispatch = (0, react_redux_1.useDispatch)();
@@ -120,6 +121,13 @@ const LayoutWizard = (props) => {
120
121
  render: () => (React.createElement(rebass_1.Box, { p: 2, style: { height: '100%' } },
121
122
  React.createElement(AggregationsSection_1.AggregationsSection, { onChange: setLayout }))),
122
123
  },
124
+ {
125
+ title: 'Row Summaries',
126
+ details: 'Configure Row Summaries',
127
+ renderSummary: () => React.createElement(RowGroupingSection_1.RowGroupingSectionSummary, null),
128
+ render: () => (React.createElement(rebass_1.Box, { p: 2, style: { height: '100%' } },
129
+ React.createElement(RowSummarySection_1.RowSummarySection, { onChange: setLayout }))),
130
+ },
123
131
  {
124
132
  title: 'Sort',
125
133
  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,156 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RowSummarySection = exports.RowGroupingSectionSummary = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const rebass_1 = require("rebass");
7
+ const FormLayout_1 = tslib_1.__importStar(require("../../../../components/FormLayout"));
8
+ const Panel_1 = tslib_1.__importDefault(require("../../../../components/Panel"));
9
+ const Select_1 = require("../../../../components/Select");
10
+ const SimpleButton_1 = tslib_1.__importDefault(require("../../../../components/SimpleButton"));
11
+ const Tabs_1 = require("../../../../components/Tabs");
12
+ const Tag_1 = require("../../../../components/Tag");
13
+ const adaptableQlUtils_1 = require("../../../../Utilities/adaptableQlUtils");
14
+ const ModuleConstants_1 = require("../../../../Utilities/Constants/ModuleConstants");
15
+ const ISummaryService_1 = require("../../../../Utilities/Services/Interface/ISummaryService");
16
+ const sortWithOrder_1 = require("../../../../Utilities/sortWithOrder");
17
+ const AdaptableContext_1 = require("../../../AdaptableContext");
18
+ const ValueSelector_1 = require("../../../Components/ValueSelector");
19
+ const OnePageAdaptableWizard_1 = require("../../../Wizard/OnePageAdaptableWizard");
20
+ const Utilities_1 = require("./Utilities");
21
+ const getAvailableExpressionsForColumnType = (columnType, availableScalarExpressions) => {
22
+ const inputType = (0, adaptableQlUtils_1.mapColumnDataTypeToExpressionFunctionType)(columnType);
23
+ return Object.entries(availableScalarExpressions !== null && availableScalarExpressions !== void 0 ? availableScalarExpressions : {})
24
+ .map(([expression, expressionDef]) => {
25
+ var _a, _b;
26
+ let firstArg = null;
27
+ if (!ISummaryService_1.summarySupportedExpressions.includes(expression)) {
28
+ return null;
29
+ }
30
+ if (Array.isArray((_a = expressionDef === null || expressionDef === void 0 ? void 0 : expressionDef.inputs) === null || _a === void 0 ? void 0 : _a[0])) {
31
+ // @ts-ignore
32
+ firstArg = (_b = expressionDef.inputs.find((input) => input.includes(inputType))) === null || _b === void 0 ? void 0 : _b[0];
33
+ }
34
+ else {
35
+ firstArg = expressionDef.inputs[0];
36
+ }
37
+ if (inputType === firstArg) {
38
+ return expression;
39
+ }
40
+ else {
41
+ return null;
42
+ }
43
+ })
44
+ .filter(Boolean);
45
+ };
46
+ const RowGroupingSectionSummary = () => {
47
+ var _a;
48
+ const adaptable = (0, AdaptableContext_1.useAdaptable)();
49
+ const { data: layout } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
50
+ 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"))));
51
+ };
52
+ exports.RowGroupingSectionSummary = RowGroupingSectionSummary;
53
+ const RowSummaryEditor = ({ rowSummary, onChange, availableScalarExpressions, onDelete, }) => {
54
+ const { data: layout } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
55
+ const adaptable = (0, AdaptableContext_1.useAdaptable)();
56
+ const columns = React.useMemo(() => {
57
+ const colIds = adaptable.api.columnApi
58
+ .getColumns()
59
+ .filter((column) => {
60
+ var _a, _b;
61
+ if (!['Number', 'String'].includes(column.dataType))
62
+ return false;
63
+ return (_b = (_a = layout.Columns) === null || _a === void 0 ? void 0 : _a.includes) === null || _b === void 0 ? void 0 : _b.call(_a, column.columnId);
64
+ })
65
+ .map((c) => c.columnId);
66
+ return (0, sortWithOrder_1.sortWithOrderArray)(colIds, Object.keys(rowSummary.ColumnsMap), {
67
+ sortUnorderedItems: false,
68
+ }).map((colId) => adaptable.api.columnApi.getColumnWithColumnId(colId));
69
+ }, [rowSummary.ColumnsMap]);
70
+ return (React.createElement(Panel_1.default, { header: React.createElement(rebass_1.Flex, { style: { width: '100%' } },
71
+ React.createElement(rebass_1.Flex, { flex: 1, alignItems: "center" }, "Row Summary"),
72
+ React.createElement(SimpleButton_1.default, { icon: "delete", onClick: () => {
73
+ onDelete();
74
+ } })), p: 2 },
75
+ React.createElement(FormLayout_1.default, null,
76
+ React.createElement(FormLayout_1.FormRow, { label: "Position" },
77
+ React.createElement(Select_1.Select, { options: [
78
+ {
79
+ label: 'Top',
80
+ value: 'Top',
81
+ },
82
+ {
83
+ label: 'Bottom',
84
+ value: 'Bottom',
85
+ },
86
+ ], value: rowSummary.Position, onChange: (position) => {
87
+ onChange(Object.assign(Object.assign({}, rowSummary), { Position: position }));
88
+ } }))),
89
+ React.createElement(rebass_1.Flex, { flexDirection: 'column', mt: 2, mb: 1 },
90
+ React.createElement(rebass_1.Flex, { alignItems: "center", flex: 1, mb: 2 }, "Column Aggregations"),
91
+ React.createElement(Panel_1.default, { bodyProps: { maxHeight: '100%' }, style: { height: 360 } },
92
+ React.createElement(ValueSelector_1.ValueSelector, { style: { maxHeight: '100%' }, showFilterInput: true, filter: Utilities_1.columnFilter, toIdentifier: (column) => column.columnId, toLabel: (option) => { var _a; return (_a = option.friendlyName) !== null && _a !== void 0 ? _a : option.columnId; }, options: columns, xSelectedLabel: () => {
93
+ return 'Active Aggregations:';
94
+ }, toListLabel: (column) => {
95
+ var _a, _b;
96
+ const label = (_a = column.friendlyName) !== null && _a !== void 0 ? _a : column.columnId;
97
+ if (!(column.columnId in ((_b = rowSummary.ColumnsMap) !== null && _b !== void 0 ? _b : {}))) {
98
+ return label;
99
+ }
100
+ const expressionOptions = getAvailableExpressionsForColumnType(column.dataType, availableScalarExpressions).map((expression) => ({
101
+ label: expression,
102
+ value: expression,
103
+ }));
104
+ const expression = rowSummary.ColumnsMap[column.columnId];
105
+ return (React.createElement(rebass_1.Flex, null,
106
+ React.createElement(rebass_1.Flex, { mr: 2, alignItems: 'center' }, label),
107
+ React.createElement(Select_1.Select, { value: expression, options: expressionOptions, onChange: (expression) => {
108
+ onChange(Object.assign(Object.assign({}, rowSummary), { ColumnsMap: Object.assign(Object.assign({}, rowSummary.ColumnsMap), { [column.columnId]: expression }) }));
109
+ } })));
110
+ }, value: Object.keys(rowSummary.ColumnsMap), onChange: (colIds) => {
111
+ const newColumnsMap = {};
112
+ colIds.forEach((colId) => {
113
+ var _a;
114
+ newColumnsMap[colId] = (_a = rowSummary.ColumnsMap[colId]) !== null && _a !== void 0 ? _a : null;
115
+ });
116
+ onChange(Object.assign(Object.assign({}, rowSummary), { ColumnsMap: newColumnsMap }));
117
+ } })))));
118
+ };
119
+ const RowSummarySection = (props) => {
120
+ var _a;
121
+ const adaptable = (0, AdaptableContext_1.useAdaptable)();
122
+ const { data: layout } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
123
+ const availableScalarExpressions = React.useMemo(() => {
124
+ return adaptable.api.internalApi
125
+ .getQueryLanguageService()
126
+ .getModuleExpressionFunctionsMap(ModuleConstants_1.LayoutModuleId).aggregatedScalarFunctions;
127
+ }, []);
128
+ return (React.createElement(Tabs_1.Tabs, { style: { height: '100%' } },
129
+ React.createElement(Tabs_1.Tabs.Tab, null, "Row Summaries"),
130
+ React.createElement(Tabs_1.Tabs.Content, null,
131
+ React.createElement("div", null,
132
+ React.createElement(rebass_1.Flex, { mb: 1 },
133
+ React.createElement(rebass_1.Flex, { flex: 1 }),
134
+ React.createElement(SimpleButton_1.default, { onClick: () => {
135
+ var _a;
136
+ props.onChange(Object.assign(Object.assign({}, layout), { RowSummaries: [
137
+ ...((_a = layout.RowSummaries) !== null && _a !== void 0 ? _a : []),
138
+ {
139
+ Position: 'Top',
140
+ ColumnsMap: {},
141
+ },
142
+ ] }));
143
+ }, icon: "plus" }, "Add Row Summary")),
144
+ ((_a = layout.RowSummaries) !== null && _a !== void 0 ? _a : []).map((rowSummary, index) => {
145
+ return (React.createElement(RowSummaryEditor, { key: index, onDelete: () => {
146
+ const newSummaries = [...layout.RowSummaries];
147
+ newSummaries.splice(index, 1);
148
+ props.onChange(Object.assign(Object.assign({}, layout), { RowSummaries: newSummaries }));
149
+ }, availableScalarExpressions: availableScalarExpressions, rowSummary: rowSummary, onChange: (rowSummary) => {
150
+ const newSummaries = [...layout.RowSummaries];
151
+ newSummaries[index] = rowSummary;
152
+ props.onChange(Object.assign(Object.assign({}, layout), { RowSummaries: newSummaries }));
153
+ } }));
154
+ })))));
155
+ };
156
+ exports.RowSummarySection = RowSummarySection;
@@ -0,0 +1,2 @@
1
+ import * as React from 'react';
2
+ export declare const NotePopup: React.FunctionComponent;
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NotesPopup = void 0;
3
+ exports.NotePopup = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
6
  const react_redux_1 = require("react-redux");
7
7
  const InfiniteTable_1 = require("../../components/InfiniteTable");
8
- const NotesRedux_1 = require("../../Redux/ActionsReducers/NotesRedux");
8
+ const NoteRedux_1 = require("../../Redux/ActionsReducers/NoteRedux");
9
9
  const AdaptableContext_1 = require("../AdaptableContext");
10
10
  const AdaptableButton_1 = require("../Components/AdaptableButton");
11
11
  const PopupPanel_1 = require("../Components/Popups/AdaptablePopup/PopupPanel");
@@ -16,10 +16,10 @@ const tableDOMProps = {
16
16
  // minHeight: 600,
17
17
  },
18
18
  };
19
- const NotesPopup = (props) => {
19
+ const NotePopup = (props) => {
20
20
  const adaptable = (0, AdaptableContext_1.useAdaptable)();
21
21
  const primaryKeyHeader = adaptable.api.columnApi.getFriendlyNameForColumnId(adaptable.api.columnApi.getPrimaryKeyColumn().columnId);
22
- const allNotes = (0, react_redux_1.useSelector)((state) => (0, NotesRedux_1.GetAllNotesSelector)(state.Notes));
22
+ const allNotes = (0, react_redux_1.useSelector)((state) => (0, NoteRedux_1.GetAllNotesSelector)(state.Note));
23
23
  const columnsMap = React.useMemo(() => {
24
24
  const columns = {
25
25
  primaryKey: {
@@ -83,4 +83,4 @@ const NotesPopup = (props) => {
83
83
  alwaysReserveSpaceForSortIcon: false,
84
84
  }, rowHeight: 40, columnHeaderHeight: 65, domProps: tableDOMProps, columns: columnsMap }))));
85
85
  };
86
- exports.NotesPopup = NotesPopup;
86
+ exports.NotePopup = NotePopup;
@@ -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;
@@ -63,12 +63,12 @@ const ColumnInfoModule_1 = require("../Strategy/ColumnInfoModule");
63
63
  const SettingsPanelModule_1 = require("../Strategy/SettingsPanelModule");
64
64
  const StatusBarModule_1 = require("../Strategy/StatusBarModule");
65
65
  const ChartingModule_1 = require("../Strategy/ChartingModule");
66
- const NotesModule_1 = require("../Strategy/NotesModule");
66
+ const NoteModule_1 = require("../Strategy/NoteModule");
67
67
  const StyledColumnModule_1 = require("../Strategy/StyledColumnModule");
68
68
  const Fdc3Module_1 = require("../Strategy/Fdc3Module");
69
69
  const GridFilterModule_1 = require("../Strategy/GridFilterModule");
70
70
  const NamedQueryModule_1 = require("../Strategy/NamedQueryModule");
71
- const CommentsModule_1 = require("../Strategy/CommentsModule");
71
+ const CommentModule_1 = require("../Strategy/CommentModule");
72
72
  const AdaptableNumberEditor_1 = require("./editors/AdaptableNumberEditor");
73
73
  const AdaptableDateEditor_1 = require("./editors/AdaptableDateEditor");
74
74
  const Helper_1 = require("../Utilities/Helpers/Helper");
@@ -1143,7 +1143,9 @@ class AdaptableAgGrid {
1143
1143
  const allAgGridColDefIds = allAgGridFlattenedColDefs.map((colDef) => colDef.colId);
1144
1144
  const getColDef = (colId) => allAgGridFlattenedColDefs.find((colDef) => colDef.colId === colId);
1145
1145
  agGridState.columnVisibility = {
1146
- hiddenColIds: allAgGridColDefIds.filter((colDefId) => { var _a; return !((_a = currentLayout.Columns) === null || _a === void 0 ? void 0 : _a.includes(colDefId)); }),
1146
+ hiddenColIds: allAgGridFlattenedColDefs
1147
+ .filter((colDef) => { var _a; return !((_a = currentLayout.Columns) === null || _a === void 0 ? void 0 : _a.includes(colDef.colId)) || colDef.hide || colDef.initialHide; })
1148
+ .map((colDef) => colDef.colId),
1147
1149
  };
1148
1150
  agGridState.columnOrder = {
1149
1151
  orderedColIds: (0, sortWithOrder_1.sortWithOrderArray)(allAgGridColDefIds, currentLayout.Columns || [], {
@@ -1585,7 +1587,7 @@ class AdaptableAgGrid {
1585
1587
  modules.set(ModuleConstants.ChartingModuleId, new ChartingModule_1.ChartingModule(this.api));
1586
1588
  modules.set(ModuleConstants.ColumnFilterModuleId, new ColumnFilterModule_1.ColumnFilterModule(this.api));
1587
1589
  modules.set(ModuleConstants.ColumnInfoModuleId, new ColumnInfoModule_1.ColumnInfoModule(this.api));
1588
- modules.set(ModuleConstants.CommentsModuleId, new CommentsModule_1.CommentsModule(this.api));
1590
+ modules.set(ModuleConstants.CommentModuleId, new CommentModule_1.CommentModule(this.api));
1589
1591
  modules.set(ModuleConstants.CustomSortModuleId, new CustomSortModule_1.CustomSortModule(this.api));
1590
1592
  modules.set(ModuleConstants.DashboardModuleId, new DashboardModule_1.DashboardModule(this.api));
1591
1593
  modules.set(ModuleConstants.DataChangeHistoryModuleId, new DataChangeHistoryModule_1.DataChangeHistoryModule(this.api));
@@ -1600,7 +1602,7 @@ class AdaptableAgGrid {
1600
1602
  modules.set(ModuleConstants.GridInfoModuleId, new GridInfoModule_1.GridInfoModule(this.api));
1601
1603
  modules.set(ModuleConstants.LayoutModuleId, new LayoutModule_1.LayoutModule(this.api));
1602
1604
  modules.set(ModuleConstants.NamedQueryModuleId, new NamedQueryModule_1.NamedQueryModule(this.api));
1603
- modules.set(ModuleConstants.NotesModuleId, new NotesModule_1.NotesModule(this.api));
1605
+ modules.set(ModuleConstants.NoteModuleId, new NoteModule_1.NoteModule(this.api));
1604
1606
  modules.set(ModuleConstants.PlusMinusModuleId, new PlusMinusModule_1.PlusMinusModule(this.api));
1605
1607
  modules.set(ModuleConstants.QuickSearchModuleId, new QuickSearchModule_1.QuickSearchModule(this.api));
1606
1608
  modules.set(ModuleConstants.ScheduleModuleId, new ScheduleModule_1.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
  }
@@ -581,5 +581,10 @@ class AgGridAdapter {
581
581
  };
582
582
  colDefs.forEach((colDef) => assignColId(colDef));
583
583
  }
584
+ getDefaultColumnDefinition() {
585
+ var _a, _b;
586
+ // for early init phase, gridApi might not be ready yet
587
+ return (_b = (_a = this.getAgGridApi(true)) === null || _a === void 0 ? void 0 : _a.getGridOption('defaultColDef')) !== null && _b !== void 0 ? _b : {};
588
+ }
584
589
  }
585
590
  exports.AgGridAdapter = AgGridAdapter;
@@ -607,7 +607,7 @@ class AgGridColumnAdapter {
607
607
  : undefined;
608
608
  }
609
609
  getNoteCellClassName(gridCell, params) {
610
- if (!this.adaptableApi.internalApi.getModuleService().isModuleAvailable('Notes')) {
610
+ if (!this.adaptableApi.internalApi.getModuleService().isModuleAvailable('Note')) {
611
611
  return;
612
612
  }
613
613
  if (!this.adaptableApi.noteApi.internalApi.areNotesAvailable()) {
@@ -617,14 +617,14 @@ class AgGridColumnAdapter {
617
617
  PrimaryKeyValue: gridCell.primaryKeyValue,
618
618
  ColumnId: gridCell.column.columnId,
619
619
  };
620
- const cellNotes = this.adaptableApi.noteApi.getCellNotes(cellPosition);
620
+ const cellNotes = this.adaptableApi.noteApi.getNotesForCell(cellPosition);
621
621
  if (!(cellNotes === null || cellNotes === void 0 ? void 0 : cellNotes.length)) {
622
622
  return undefined;
623
623
  }
624
624
  return 'ab-Cell-Note';
625
625
  }
626
626
  getCommentCellClassName(gridCell, params) {
627
- if (!this.adaptableApi.internalApi.getModuleService().isModuleAvailable('Comments')) {
627
+ if (!this.adaptableApi.internalApi.getModuleService().isModuleAvailable('Comment')) {
628
628
  return;
629
629
  }
630
630
  if (!this.adaptableApi.commentApi.internalApi.areCommentsAvailable()) {
@@ -217,18 +217,22 @@ class AgGridMenuAdapter {
217
217
  };
218
218
  }
219
219
  else {
220
- return adaptableMenuItems.find((menuItem) => menuItem.module === moduleOrGroup);
220
+ return adaptableMenuItems.filter((menuItem) => menuItem.module === moduleOrGroup);
221
221
  }
222
222
  })
223
- .filter((menuItem) => {
224
- if (!menuItem) {
223
+ .filter((menuItems) => {
224
+ if (!menuItems.length) {
225
225
  return false;
226
226
  }
227
- if (menuItem.subItems && menuItem.subItems.length === 0) {
228
- return false;
227
+ if (menuItems.length === 1) {
228
+ const singleMenuItem = menuItems[0];
229
+ if (singleMenuItem.subItems && singleMenuItem.subItems.length === 0) {
230
+ return false;
231
+ }
229
232
  }
230
233
  return true;
231
- });
234
+ })
235
+ .flat();
232
236
  }
233
237
  mapAdaptableMenuItemToSystemMenuItems(adaptableMenuItems) {
234
238
  return (adaptableMenuItems !== null && adaptableMenuItems !== void 0 ? adaptableMenuItems : []).map((menuItem) => {
@@ -174,13 +174,6 @@ const DefaultAdaptableOptions = {
174
174
  menuOptions: {
175
175
  customColumnMenu: undefined,
176
176
  customContextMenu: undefined,
177
- showAdaptableContextMenu: true,
178
- showAdaptableColumnMenu: true,
179
- showUngroupColumnMenuItem: true,
180
- columnMenuOrder: ['aggrid', 'adaptable', 'user'],
181
- contextMenuOrder: ['aggrid', 'adaptable', 'user'],
182
- columnMenuItems: undefined,
183
- contextMenuItems: undefined,
184
177
  },
185
178
  columnFilterOptions: {
186
179
  quickFilterOptions: {
@@ -6,6 +6,7 @@ const react_1 = tslib_1.__importDefault(require("react"));
6
6
  const react_beautiful_dnd_1 = require("react-beautiful-dnd");
7
7
  const rebass_1 = require("rebass");
8
8
  const predicate_1 = require("../../../parser/src/predicate");
9
+ const adaptableQlUtils_1 = require("../../../Utilities/adaptableQlUtils");
9
10
  const booleanExpressionFunctions_1 = require("../../../Utilities/ExpressionFunctions/booleanExpressionFunctions");
10
11
  const AdaptableContext_1 = require("../../../View/AdaptableContext");
11
12
  const DropdownButton_1 = tslib_1.__importDefault(require("../../DropdownButton"));
@@ -114,7 +115,7 @@ const PrimitiveFunctionEditor = (props) => {
114
115
  }
115
116
  columnId = col.replace(/[\[\]]/g, '');
116
117
  columnDataType = adaptable.api.columnApi.getColumnDataTypeForColumnId(columnId);
117
- columnInputDataType = (0, utils_1.mapColumnDataTypeToExpressionFunctionType)(columnDataType);
118
+ columnInputDataType = (0, adaptableQlUtils_1.mapColumnDataTypeToExpressionFunctionType)(columnDataType);
118
119
  functionInputInputDataTypes = (_a = booleanExpressionFunctions_1.booleanExpressionFunctions[props.predicate.operator]) === null || _a === void 0 ? void 0 : _a.inputs;
119
120
  restOfFunctionInputDataTypes = functionInputInputDataTypes
120
121
  ? (0, utils_1.getOperatorMatchingInputs)(columnInputDataType, functionInputInputDataTypes)
@@ -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,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getUnsuportedExpressionFromQlPredicate = exports.getFunctionsForColumnType = exports.getOperatorMatchingInputs = exports.mapExpressionFunctionTypeToColumnDataType = exports.mapColumnDataTypeToExpressionFunctionType = exports.reorder = void 0;
3
+ exports.getUnsuportedExpressionFromQlPredicate = exports.getFunctionsForColumnType = exports.getOperatorMatchingInputs = exports.mapExpressionFunctionTypeToColumnDataType = exports.reorder = void 0;
4
+ const adaptableQlUtils_1 = require("../../../Utilities/adaptableQlUtils");
4
5
  const predicate_1 = require("../../../parser/src/predicate");
5
6
  const booleanExpressionFunctions_1 = require("../../../Utilities/ExpressionFunctions/booleanExpressionFunctions");
6
7
  const ObjectExtensions_1 = require("../../../Utilities/Extensions/ObjectExtensions");
@@ -30,21 +31,6 @@ const reorder = (predicate, from, to) => {
30
31
  return predicateCopy;
31
32
  };
32
33
  exports.reorder = reorder;
33
- const mapColumnDataTypeToExpressionFunctionType = (dataType) => {
34
- if (dataType === 'Number') {
35
- return 'number';
36
- }
37
- if (dataType === 'Boolean') {
38
- return 'boolean';
39
- }
40
- if (dataType === 'String') {
41
- return 'text';
42
- }
43
- if (dataType === 'Date') {
44
- return 'date';
45
- }
46
- };
47
- exports.mapColumnDataTypeToExpressionFunctionType = mapColumnDataTypeToExpressionFunctionType;
48
34
  const mapExpressionFunctionTypeToColumnDataType = (type) => {
49
35
  if (type === 'number') {
50
36
  return 'Number';
@@ -72,7 +58,7 @@ const getOperatorMatchingInputs = (columnType, inputs) => {
72
58
  };
73
59
  exports.getOperatorMatchingInputs = getOperatorMatchingInputs;
74
60
  const getFunctionsForColumnType = (dataType, availableBooleanFunctions) => {
75
- const columnType = (0, exports.mapColumnDataTypeToExpressionFunctionType)(dataType);
61
+ const columnType = (0, adaptableQlUtils_1.mapColumnDataTypeToExpressionFunctionType)(dataType);
76
62
  return booleanExpressions_1.booleanExpressionsAvailableInQueryBuilder.filter((boolFnName) => {
77
63
  if (!availableBooleanFunctions.includes(boolFnName)) {
78
64
  return false;
@@ -3,5 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const React = tslib_1.__importStar(require("react"));
5
5
  const DefaultIcon_1 = tslib_1.__importDefault(require("./DefaultIcon"));
6
- exports.default = (props) => (React.createElement(DefaultIcon_1.default, Object.assign({}, props, { viewBox: "0 -960 960 960" }),
7
- 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" })));
6
+ exports.default = (props) => (React.createElement(DefaultIcon_1.default, Object.assign({}, props),
7
+ 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
@@ -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: 1711034351652 || Date.now(),
6
- VERSION: "18.0.0-canary.12" || '--current-version--',
5
+ PUBLISH_TIMESTAMP: 1711382001203 || Date.now(),
6
+ VERSION: "18.0.0-canary.14" || '--current-version--',
7
7
  };